Constructing Crossword Arrays Faster

Michael Trott · The Mathematica Journal · 2009

In [12]:= positionAWordcharacterList_, k_, i0_, j0_, hv : "" "", f_: Null : Module  LengthcharacterList, i, j, cs, Which The current word is to be placed horizontally. hv  "",  Nothing can be placed immediately before or after the current word. statusi0  k, j0  C; statusi0  k    1, j0  C;  Place the characters from the list characterList horizontally. Doi  i0  k  ; cs  statusi, j0; statusi, j0  Which Part of a vertical word is already in place. MatchQcs, C_String, cs,  Both directions are now used. MatchQcs, CcharacterList, "", CcharacterList, Headcs  C && cs2  "",  Allow the first and last character to be reused. If  1    , CcharacterList, "", CcharacterList,  Nothing is already in place. Headcs  status, CcharacterList, "";  Here is a potential side effect. fi, j0, characterList, , ;  Set the status of squares in the rows below and above the row just set.

Read the paper · More papers on PaperTik