I've created a worksheet that outputs a boggle board.  I think it could be more efficient than the method I came up with but the idea is there.  The only way I could figure to rotate the letters was to output them to a bmp format then read them back in and use imagetools for rotation.  I used Times Roman font but the font Boggle uses I think is Tunga, Latha or Mangal.  

Note - remove the colon in the last line to produce the output.  One other thing I believe, in Tools->Options-> (uncheck)Limit Expression Length to 1000000  

Saving the file with the output would have produced a file in the tens of Megabytes and may have caused error loading.


 

restart; gc()

with(plots); with(ImageTools)

a := [seq(k, k = "A" .. "Z")]

["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

(1)

for i in a do plotsetup(bmp, plotoutput = cat("c:/test/", i, ".bmp")); img || i := textplot([0, 1, i, font = ["times", "roman", 200]], axes = none, scaling = constrained) end do
NULL

plotsetup = default

(2)

plotsetup(default)

with(combinat)``

``

Setting up the 16 boggle cubes

 

cube1 := ["H", "E", "E", "N", "W", "G"]

cube2 := ["T", "M", "I", "O", "C", "U"]

cube3 := ["D", "E", "X", "L", "R", "I"]

cube4 := ["S", "P", "F", "A", "K", "F"]

cube5 := ["T", "O", "E", "S", "I", "S"]

cube6 := ["H", "N", "L", "N", "Z", "R"]

cube7 := ["R", "L", "T", "Y", "T", "E"]

cube8 := ["D", "E", "Y", "L", "R", "V"]

cube9 := ["C", "A", "O", "S", "P", "H"]

cube10 := ["Qu", "U", "M", "H", "I", "N"]

cube11 := ["D", "Y", "I", "S", "T", "T"]

cube12 := ["S", "N", "I", "E", "E", "U"]

cube13 := ["T", "O", "O", "W", "A", "T"]

cube14 := ["W", "H", "E", "V", "R", "T"]

cube15 := ["J", "B", "O", "O", "A", "B"]

cube16 := ["N", "A", "E", "A", "E", "G"]

cubes := [seq(cat("cube", i), i = 1 .. 16)]

["cube1", "cube2", "cube3", "cube4", "cube5", "cube6", "cube7", "cube8", "cube9", "cube10", "cube11", "cube12", "cube13", "cube14", "cube15", "cube16"]

(3)

c := randperm(cubes)

["cube13", "cube14", "cube11", "cube6", "cube9", "cube1", "cube16", "cube7", "cube3", "cube2", "cube12", "cube5", "cube4", "cube10", "cube8", "cube15"]

(4)

cc := map(parse, c)

[cube13, cube14, cube11, cube6, cube9, cube1, cube16, cube7, cube3, cube2, cube12, cube5, cube4, cube10, cube8, cube15]

(5)

ccf := [seq(op(randcomb(cc[i], 1)), i = 1 .. 16)]

["A", "H", "I", "N", "A", "N", "E", "T", "D", "M", "E", "S", "K", "N", "E", "O"]

(6)

with(ArrayTools)

g := Reshape(Array(ccf), [4, 4])

Array(%id = 18446744074360417206)

(7)

rr := proc () randcomb([0, 90, 180, 270], 1) end proc

Reshape(Array([seq(display(Preview(Rotate(Read(cat("c:/test/", ccf[i], ".bmp")), op(rr()))), axes = none), i = 1 .. 16)]), [4, 4])
 

````

 

 

 

NULL


 

Download Boggle3-6final.mw


Please Wait...