From 4b177571a7d70bd863efc2a80d1c15b0ce584110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Martins?= Date: Thu, 19 May 2016 10:18:12 +0100 Subject: [PATCH] Update readme.md --- readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 2cb8b1c..1842cc5 100644 --- a/readme.md +++ b/readme.md @@ -9,9 +9,10 @@ Algorithm I purposefully designed and implemented this little project without performing research on crossword generation techniques; I wanted to see if I could do it by myself. The very simple algorithm that is implemented here is as follows: 1. The technique receives a list of words, in a .txt file (I tested using [these](http://www.gwicks.net/dictionaries.htm) lists). -2. A number (100, by default) of words are chosen randomly from the list that is given, and these are the words that will be used hereafter. +2. A number (1000, by default) of words are chosen randomly from the list that is given, and these are the words that will be used hereafter. 3. The technique expands the list of words into a list of possibilities, where each possibility encodes a possible starting location for a word, as well as its direction. This essentially constitutes all possible words that can be placed into the grid. -4. A new word is taken from the list of possibilities and placed on the grid. This makes it so a number of possibilities are now invalid, and these are removed from the list. Steps 3 and 4 are repeated until the grid is as full as we want it to be. +4. Words that connect to words that are already on the grid are isolated into a connected_possibilities list. +5. A new word is taken from the list of possibilities/connected_possibilities and placed on the grid. This makes it so a number of possibilities are now invalid, and these are removed from the list. Steps 3 through 5 are repeated until the grid is as full as we want it to be, or the script times out. Output ---