I am looking for a crossword engine to be written in ActionScript 3 using object oriented methodology. The words need to be placed randomly so every successive call would produce different result. If for some reason the crossword can’t be generated in a given time then a flag need to be set indicating a problem.
Basically I need a class object that takes 5 parameters to start.
1. A collection of word:string wordID:int with no limit on collection size but most likely max of 100 objects in the collection
2. A collection of allowable directions as xy points. Example x=1, y=0 and x=-1, y=0 this will let a word go horizontal from left to right or from right to left because only the x direction is changeable. There could be a possible 8 pairs of x,y direction indicators to support horizontal, vertical and diagonal fills and their reverse.
3. Matrix size as x=20, y=20 indicating a matrix of 20 by 20, these can be any positive number with no end limit but most likely will be capped at 100
4. A mask collection of x,y pairs which will indicate that the cell is not to be used
5. Amount of time in seconds allowed to create the crossword.
The class than will create a crossword with the input information and creates these public collections
1. A collection of word, wordid, direction x,y used for the word, and a collection of x,y cords the word mapped to. Also for this word a collection of crossed words. In that collection of crossed words the wordid of the crossing word and its x,y cross point
2. Map array collection which is really a 2 dimensional array as the words are mapped to the matrix. Matrix size is the input matrix size.
The source code needs to be easy to read and follow adobe variable naming conventions. The code needs to be fast. Need to provide us with the samples used to test the matrix so we can also try other words using your test methods.