Comments [ Add ]
2009-06-03 APWJ (Boggle) BR Thanks for being a volunteer to update the code in the 2nd edition of At Play With J.
Your article Boggle (Play181) has been checked as complete but unfortunately some code samples give spelling errors when executed in a J window. This seems to be due to the presence of obsolete x. and y. words BR IanClark
Further to the Boggle article: there are several issues with the code when re-executed. My rough notes of my testing are:
The verb comb is due to Roger Hui, and it and its component parts
are given at the end of this paper.
...must stress that comb needs to be entered before (#3 paths 4) will work.
Also the definition of paths should have pc=: not pc=.
--else pc is not available for p230:
If this change is made:
#3 paths 4
408 NB. as reported
...but pc has 3 cols not 4 as Eugene assumes.
37 38 39 40{pc
0 8 1
1 0 8
1 8 0
8 0 1
4 okf 37 38 39 40{pc
0 0 0 0
...not as reported
Don’t bother to use this function. It takes an unbearably long time
as the path lengths get just a little larger. It is intended only to let
you know how my thinking was going.
...does Eugene mean fn: paths?
The time for my path function to do 4 path 4 is 43.4 seconds. I
don’t have the patience to try cases involving longer paths.
...Eugene MUST mean paths, not path.
Rerun these timings! But this needs word lists, doesn't it?
sorted lists of words all of the same length, which I have named Words02 through Words26.
...where can we get these from?
...No way of testing the expression:
r =: /: ~ ~. (w e. p { b) # w
What does Eugene mean by this?...
There are longer words in the list. How many of you found “continent”? And “continental”? And the 16-letter behemoth “intercontinental”? Of course, I contrived this case, choosing a suitable looking word from my Word16 file, in order to fill a 4-by grid completely.
...assume this means a 4-by-4 grid ("intercontinental" does indeed have 16 letters)
p237: missing definition: d8
...allpcn will give a value error if d8 is not defined first.
From 7.B.d8...
m0=: ] NB. Identity
m1=: m6@m7 NB. Three-o’clock rotation
m2=: m4@m6 NB. Six-o’clock rotation
m3=: m4@m7 NB. Nine-o’clock rotation
m4=: |.@] NB. Horizontal reflection
m5=: m2@m7 NB. Counterdiagonal reflection
m6=: |."_1@] NB. Vertical reflection
m7=: |:@] NB. Diagonal reflection
d8=: m0`m1`m2`m3`m4`m5`m6`m7 @. [
NB. i d8 y gives mi y (all rotates and reflects)
...show this in the appendix.
p237 (now p239)
s42 is i.16 hence...
$s42 =: /:~ ~. ,/ q42
is: 16 not: 84 2
Therefore (last line) s42 is not equivalent to: 4 pathb 2
hence (4 pathb 2) -: s42 -will not return 1
article needs converting to MoinMoin form in APWJThe code needs re-testing. I may have made mistakes in my testing. I've certainly misunderstood things.
If you don't have time to check the code out & fix the glitches, will you feel put-out if I open it up for volunteers on the list? I didn't want to go ahead and do so without notifying you first.
Thanks. IanClark
