ghost03Faster.out2 Made with ghost03Faster.rb, Dec 17, 2007. Algorithm: Global identifiers: $alphabet = %w[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] $gamestr=["G","H","O","S","T"] $players=[lambda{ |x| computer2(x)}, lambda{ |x,y,z,letter| computerminmax(x,y,z,letter)}] $words = [] - the dictionary 1. "Outer method", non-recursive: computerminmax(wordstring, player, level, nextletter) if the word string is empty, return a random letter, $alphabet[rand(26)] otherwise: search for wordstring in the dictionary $words (my search method returned a list with two items: list[0] -> the index, if found, of wordstring in the dictionary, -1 if not found list[1] -> a list of strings of length wordstring.length+1, these strings could form words in the dictionary) if wordstring is in the dictionary (index >= 0) and its length is greater than or equal to 4, return a special character such as "!" otherwise (if for some reason there are no strings extending from wordstring return a random letter) loop through the list of strings extending one letter from wordstring, stop the loop when you find a good choice: (while not found and i < matches.length) for each of these strings, if they are words in the dictionary or they could be words in the dictionary, call the recursive MinMax version of this method: choice=computerminmaxAux(temp, player % $numplayers, (player+1)% $numplayers, level+1, current next letter -> matches[i][-1].chr ) "choice" is a list of two items: the index of the player who formed a word at some recursive level. the current next letter that led to finding this word if your choicelist does not include "choice", add choice to the choicelist if the "choice" is a favorable choices: those in which the player forming the word is different from you, the current player (you don't want to be the one forming the word), stop the loop (found = true) (Don't choose any special characters, ("#"), you may have returned for some reason) Return the favorable letter choice. otherwise there are no favorable letters and return a random actual letter from choicelist 2. "Inner method", recursive: computerminmaxAux(wordstring, previousplayer, player, level, nextletter) if the word string is empty, return a random letter, $alphabet[rand(26)] otherwise: search for wordstring in the dictionary $words (my search method returned a list with two items: list[0] -> the index, if found, of wordstring in the dictionary, -1 if not found list[1] -> a list of strings of length wordstring.length+1, these strings could form words in the dictionary) if wordstring is in the dictionary (index >= 0) and its length is greater than or equal to 4, return a list of [prevplayer,nextletter] otherwise (if for some reason there are no strings extending from wordstring return a list with a special character such as "#" [currentplayer, "#"]) loop through the list of strings extending one letter from wordstring, stop the loop when you find a good choice: (while not found and i < matches.length) Choose a random index from you list of next choices: index = rand(matches.length) while indexes.include?(index) index = rand(matches.length) end indexes << index for each of these strings[index], if they are words in the dictionary or they could be words in the dictionary, make a recursive call to this method: choice=computerminmaxAux(temp, player % $numplayers, (player+1)% $numplayers, level+1, current next letter -> matches[i][-1].chr ) "choice" is a list of two items: the index of the player who formed a word at some recursive level. the current next letter that led to finding this word if the "choice" is a favorable choices: those in which the player forming the word is different from you, the current player (you don't want to be the one forming the word), stop the loop (found = true) return "choice" numplayers= 2 New word to pick Player 0 pick a letter: Computer2 adding to current word: b b not found Initial matches: ["ba", "be", "bi", "bl", "bo", "br", "bu", "by"] Player 1 pick a letter Player 1, Computer level 0 adding to b Player 1, Computer level 0 matches: ["ba", "be", "bi", "bl", "bo", "br", "bu", "by"] In TOP MOST LEVEL, player 1 picking o Player 0, Computer level 1 adding to bo Player 0, Computer level 1 matches: ["boa", "bob", "bod", "bog", "boi", "bol", "bom", "bon", "boo", "bor", "bos", "bot", "bou", "bov", "bow", "box", "boy"] Player 1, Computer level 2 adding to bov Player 1, Computer level 2 matches: ["bovi"] Player 0, Computer level 3 adding to bovi Player 0, Computer level 3 matches: ["bovin"] Player 1, Computer level 4 adding to bovin Player 1, Computer level 4 matches: ["bovine"] Player 0, Computer level 5 adding to bovine Found a word made by player 1 at level=5, returning nextletter: o In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "o"] In TOP MOST LEVEL, player 1 picking i Player 0, Computer level 1 adding to bi Player 0, Computer level 1 matches: ["bia", "bib", "bic", "bid", "bie", "bif", "big", "bih", "bij", "bik", "bil", "bim", "bin", "bio", "bip", "bir", "bis", "bit", "biv", "biw", "biz"] Player 1, Computer level 2 adding to bin Player 1, Computer level 2 matches: ["bina", "bind", "bing", "bino", "bins", "binu"] Player 0, Computer level 3 adding to bino Player 0, Computer level 3 matches: ["binoc", "binom"] Player 1, Computer level 4 adding to binoc Player 1, Computer level 4 matches: ["binocu"] Player 0, Computer level 5 adding to binocu Player 0, Computer level 5 matches: ["binocul"] Player 1, Computer level 6 adding to binocul Player 1, Computer level 6 matches: ["binocula"] Player 0, Computer level 7 adding to binocula Player 0, Computer level 7 matches: ["binocular"] Player 1, Computer level 8 adding to binocular Found a word made by player 0 at level=8, returning nextletter: i In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "i"] TOP LEVEL, player = 1, current word=b, choicelist=[[1, "o"], [0, "i"]] TOP LEVEL, player = 1, current word=b, favorable choicelist=[[0, "i"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "i"], picking letter i Current word: ["b", "i"], string: bi bi not found Initial matches: ["bia", "bib", "bic", "bid", "bie", "bif", "big", "bih", "bij", "bik", "bil", "bim", "bin", "bio", "bip", "bir", "bis", "bit", "biv", "biw", "biz"] Player 0 pick a letter, Computer2 adding to bi Current word: ["b", "i", "e"], string: bie bie not found Initial matches: ["bien", "bier"] Player 1 pick a letter Player 1, Computer level 0 adding to bie Player 1, Computer level 0 matches: ["bien", "bier"] In TOP MOST LEVEL, player 1 picking n Player 0, Computer level 1 adding to bien Player 0, Computer level 1 matches: ["bienn"] Player 1, Computer level 2 adding to bienn Player 1, Computer level 2 matches: ["bienni"] Player 0, Computer level 3 adding to bienni Player 0, Computer level 3 matches: ["biennia", "bienniu"] Player 1, Computer level 4 adding to biennia Player 1, Computer level 4 matches: ["biennial"] Player 0, Computer level 5 adding to biennial Found a word made by player 1 at level=5, returning nextletter: n In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "n"] In TOP MOST LEVEL, player 1 picking r Player 0, Computer level 1 adding to bier Found a word made by player 1 at level=1, returning nextletter: r In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "r"] TOP LEVEL, player = 1, current word=bie, choicelist=[[1, "n"], [1, "r"]] TOP LEVEL, player = 1, current word=bie, favorable choicelist=[] TOP LEVEL, player = 1, no favorable letters TOP LEVEL, player = 1, picking index 1 from favorable list: [1, "r"], picking letter r Current word: ["b", "i", "e", "r"], string: bier bier found at position 4113 Player 0 pick a letter, Computer2 adding to bier Current word: bier bier found at position 4113 Challenge issued, player 1 has ["G"], all players: [[], ["G"]] New word to pick Player 1 pick a letter, Computer level 0 adding to Current word: ["k"], string: k k not found Initial matches: ["ka", "ke", "ki", "kl", "kn", "ko", "ku"] Player 0 pick a letter, Computer2 adding to k Current word: ["k", "e"], string: ke ke not found Initial matches: ["kee", "ken", "kep", "ker", "ket", "key"] Player 1 pick a letter Player 1, Computer level 0 adding to ke Player 1, Computer level 0 matches: ["kee", "ken", "kep", "ker", "ket", "key"] In TOP MOST LEVEL, player 1 picking t Player 0, Computer level 1 adding to ket Player 0, Computer level 1 matches: ["ketc", "kett"] Player 1, Computer level 2 adding to kett Player 1, Computer level 2 matches: ["kettl"] Player 0, Computer level 3 adding to kettl Player 0, Computer level 3 matches: ["kettle"] Player 1, Computer level 4 adding to kettle Found a word made by player 0 at level=4, returning nextletter: t In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "t"] TOP LEVEL, player = 1, current word=ke, choicelist=[[0, "t"]] TOP LEVEL, player = 1, current word=ke, favorable choicelist=[[0, "t"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "t"], picking letter t Current word: ["k", "e", "t"], string: ket ket not found Initial matches: ["ketc", "kett"] Player 0 pick a letter, Computer2 adding to ket Current word: ["k", "e", "t", "t"], string: kett kett not found Initial matches: ["kettl"] Player 1 pick a letter, Computer level 0 adding to kett Player 1, Computer level 0 matches: ["kettl"] In TOP MOST LEVEL, player 1 picking l Player 0, Computer level 1 adding to kettl Player 0, Computer level 1 matches: ["kettle"] Player 1, Computer level 2 adding to kettle Found a word made by player 0 at level=2, returning nextletter: l In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "l"] TOP LEVEL, player = 1, current word=kett, choicelist=[[0, "l"]] TOP LEVEL, player = 1, current word=kett, favorable choicelist=[[0, "l"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "l"], picking letter l Current word: ["k", "e", "t", "t", "l"], string: kettl kettl not found Initial matches: ["kettle"] Player 0 pick a letter, Computer2 adding to kettl Current word: ["k", "e", "t", "t", "l", "e"], string: kettle kettle found at position 19859 Player 1 pick a letter, Computer level 0 adding to kettle Found a word, player 1 returning '!' CHALLENGE Current word: kettle kettle found at position 19859 Challenge issued, player 0 has ["G"], all players: [["G"], ["G"]] New word to pick Player 0 pick a letter, Computer2 adding to Current word: ["p"], string: p p not found Initial matches: ["pa", "pe", "ph", "pi", "pl", "pn", "po", "pr", "ps", "pu", "py"] Player 1 pick a letter, Computer level 0 adding to p Player 1, Computer level 0 matches: ["pa", "pe", "ph", "pi", "pl", "pn", "po", "pr", "ps", "pu", "py"] In TOP MOST LEVEL, player 1 picking o Player 0, Computer level 1 adding to po Player 0, Computer level 1 matches: ["poa", "poc", "pod", "poe", "pog", "poi", "pok", "pol", "pom", "pon", "poo", "pop", "por", "pos", "pot", "pou", "pov", "pow", "pox"] Player 1, Computer level 2 adding to pog Player 1, Computer level 2 matches: ["pogo", "pogr"] Player 0, Computer level 3 adding to pogo Found a word made by player 1 at level=3, returning nextletter: o In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "o"] In TOP MOST LEVEL, player 1 picking n Player 0, Computer level 1 adding to pn Player 0, Computer level 1 matches: ["pne"] Player 1, Computer level 2 adding to pne Player 1, Computer level 2 matches: ["pneu"] Player 0, Computer level 3 adding to pneu Player 0, Computer level 3 matches: ["pneum"] Player 1, Computer level 4 adding to pneum Player 1, Computer level 4 matches: ["pneuma", "pneumo"] Player 0, Computer level 5 adding to pneumo Player 0, Computer level 5 matches: ["pneumon"] Player 1, Computer level 6 adding to pneumon Player 1, Computer level 6 matches: ["pneumoni"] Player 0, Computer level 7 adding to pneumoni Player 0, Computer level 7 matches: ["pneumonia"] Player 1, Computer level 8 adding to pneumonia Found a word made by player 0 at level=8, returning nextletter: n In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "n"] TOP LEVEL, player = 1, current word=p, choicelist=[[1, "o"], [0, "n"]] TOP LEVEL, player = 1, current word=p, favorable choicelist=[[0, "n"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "n"], picking letter n Current word: ["p", "n"], string: pn pn not found Initial matches: ["pne"] Player 0 pick a letter, Computer2 adding to pn Current word: ["p", "n", "e"], string: pne pne not found Initial matches: ["pneu"] Player 1 pick a letter, Computer level 0 adding to pne Player 1, Computer level 0 matches: ["pneu"] In TOP MOST LEVEL, player 1 picking u Player 0, Computer level 1 adding to pneu Player 0, Computer level 1 matches: ["pneum"] Player 1, Computer level 2 adding to pneum Player 1, Computer level 2 matches: ["pneuma", "pneumo"] Player 0, Computer level 3 adding to pneumo Player 0, Computer level 3 matches: ["pneumon"] Player 1, Computer level 4 adding to pneumon Player 1, Computer level 4 matches: ["pneumoni"] Player 0, Computer level 5 adding to pneumoni Player 0, Computer level 5 matches: ["pneumonia"] Player 1, Computer level 6 adding to pneumonia Found a word made by player 0 at level=6, returning nextletter: u In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "u"] TOP LEVEL, player = 1, current word=pne, choicelist=[[0, "u"]] TOP LEVEL, player = 1, current word=pne, favorable choicelist=[[0, "u"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "u"], picking letter u Current word: ["p", "n", "e", "u"], string: pneu pneu not found Initial matches: ["pneum"] Player 0 pick a letter, Computer2 adding to pneu Current word: ["p", "n", "e", "u", "m"], string: pneum pneum not found Initial matches: ["pneuma", "pneumo"] Player 1 pick a letter, Computer level 0 adding to pneum Player 1, Computer level 0 matches: ["pneuma", "pneumo"] In TOP MOST LEVEL, player 1 picking o Player 0, Computer level 1 adding to pneumo Player 0, Computer level 1 matches: ["pneumon"] Player 1, Computer level 2 adding to pneumon Player 1, Computer level 2 matches: ["pneumoni"] Player 0, Computer level 3 adding to pneumoni Player 0, Computer level 3 matches: ["pneumonia"] Player 1, Computer level 4 adding to pneumonia Found a word made by player 0 at level=4, returning nextletter: o In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "o"] TOP LEVEL, player = 1, current word=pneum, choicelist=[[0, "o"]] TOP LEVEL, player = 1, current word=pneum, favorable choicelist=[[0, "o"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "o"], picking letter o Current word: ["p", "n", "e", "u", "m", "o"], string: pneumo pneumo not found Initial matches: ["pneumon"] Player 0 pick a letter, Computer2 adding to pneumo Current word: ["p", "n", "e", "u", "m", "o", "n"], string: pneumon pneumon not found Initial matches: ["pneumoni"] Player 1 pick a letter, Computer level 0 adding to pneumon Player 1, Computer level 0 matches: ["pneumoni"] In TOP MOST LEVEL, player 1 picking i Player 0, Computer level 1 adding to pneumoni Player 0, Computer level 1 matches: ["pneumonia"] Player 1, Computer level 2 adding to pneumonia Found a word made by player 0 at level=2, returning nextletter: i In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "i"] TOP LEVEL, player = 1, current word=pneumon, choicelist=[[0, "i"]] TOP LEVEL, player = 1, current word=pneumon, favorable choicelist=[[0, "i"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "i"], picking letter i Current word: ["p", "n", "e", "u", "m", "o", "n", "i"], string: pneumoni pneumoni not found Initial matches: ["pneumonia"] Player 0 pick a letter, Computer2 adding to pneumoni Current word: ["p", "n", "e", "u", "m", "o", "n", "i", "a"], string: pneumonia pneumonia found at position 25909 Player 1 pick a letter Player 1, Computer level 0 adding to pneumonia Found a word, player 1 returning '!' CHALLENGE Current word: pneumonia pneumonia found at position 25909 Challenge issued, player 0 has ["G", "H"], all players: [["G", "H"], ["G"]] New word to pick Player 0 pick a letter, Computer2 adding to Current word: ["w"], string: w w not found Initial matches: ["wa", "we", "wh", "wi", "wo", "wr"] Player 1 pick a letter Player 1, Computer level 0 adding to w Player 1, Computer level 0 matches: ["wa", "we", "wh", "wi", "wo", "wr"] In TOP MOST LEVEL, player 1 picking h Player 0, Computer level 1 adding to wh Player 0, Computer level 1 matches: ["wha", "whe", "whi", "who", "why"] Player 1, Computer level 2 adding to whe Player 1, Computer level 2 matches: ["whea", "whee", "whel", "when", "wher", "whet"] Player 0, Computer level 3 adding to whea Player 0, Computer level 3 matches: ["wheat"] Player 1, Computer level 4 adding to wheat Found a word made by player 0 at level=4, returning nextletter: h In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "h"] TOP LEVEL, player = 1, current word=w, choicelist=[[0, "h"]] TOP LEVEL, player = 1, current word=w, favorable choicelist=[[0, "h"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "h"], picking letter h Current word: ["w", "h"], string: wh wh not found Initial matches: ["wha", "whe", "whi", "who", "why"] Player 0 pick a letter, Computer2 adding to wh Current word: ["w", "h", "i"], string: whi whi not found Initial matches: ["whic", "whil", "whim", "whin", "whip", "whir", "whis", "whit", "whiz"] Player 1 pick a letter Player 1, Computer level 0 adding to whi Player 1, Computer level 0 matches: ["whic", "whil", "whim", "whin", "whip", "whir", "whis", "whit", "whiz"] In TOP MOST LEVEL, player 1 picking l Player 0, Computer level 1 adding to whil Player 0, Computer level 1 matches: ["while"] Player 1, Computer level 2 adding to while Found a word made by player 0 at level=2, returning nextletter: l In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "l"] TOP LEVEL, player = 1, current word=whi, choicelist=[[0, "l"]] TOP LEVEL, player = 1, current word=whi, favorable choicelist=[[0, "l"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "l"], picking letter l Current word: ["w", "h", "i", "l"], string: whil whil not found Initial matches: ["while"] Player 0 pick a letter, Computer2 adding to whil Current word: ["w", "h", "i", "l", "e"], string: while while found at position 38035 Player 1 pick a letter, Computer level 0 adding to while Found a word, player 1 returning '!' CHALLENGE Current word: while while found at position 38035 Challenge issued, player 0 has ["G", "H", "O"], all players: [["G", "H", "O"], ["G"]] New word to pick Player 0 pick a letter, Computer2 adding to Current word: ["k"], string: k k not found Initial matches: ["ka", "ke", "ki", "kl", "kn", "ko", "ku"] Player 1 pick a letter Player 1, Computer level 0 adding to k Player 1, Computer level 0 matches: ["ka", "ke", "ki", "kl", "kn", "ko", "ku"] In TOP MOST LEVEL, player 1 picking n Player 0, Computer level 1 adding to kn Player 0, Computer level 1 matches: ["kna", "kne", "kni", "kno", "knu"] Player 1, Computer level 2 adding to kne Player 1, Computer level 2 matches: ["knea", "knee", "knel", "knew"] Player 0, Computer level 3 adding to knea Player 0, Computer level 3 matches: ["knead"] Player 1, Computer level 4 adding to knead Found a word made by player 0 at level=4, returning nextletter: n In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "n"] TOP LEVEL, player = 1, current word=k, choicelist=[[0, "n"]] TOP LEVEL, player = 1, current word=k, favorable choicelist=[[0, "n"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "n"], picking letter n Current word: ["k", "n"], string: kn kn not found Initial matches: ["kna", "kne", "kni", "kno", "knu"] Player 0 pick a letter, Computer2 adding to kn Current word: ["k", "n", "i"], string: kni kni not found Initial matches: ["knif", "knig", "knit", "kniv"] Player 1 pick a letter Player 1, Computer level 0 adding to kni Player 1, Computer level 0 matches: ["knif", "knig", "knit", "kniv"] In TOP MOST LEVEL, player 1 picking f Player 0, Computer level 1 adding to knif Player 0, Computer level 1 matches: ["knife", "knifi"] Player 1, Computer level 2 adding to knife Found a word made by player 0 at level=2, returning nextletter: f In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "f"] TOP LEVEL, player = 1, current word=kni, choicelist=[[0, "f"]] TOP LEVEL, player = 1, current word=kni, favorable choicelist=[[0, "f"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "f"], picking letter f Current word: ["k", "n", "i", "f"], string: knif knif not found Initial matches: ["knife", "knifi"] Player 0 pick a letter, Computer2 adding to knif Current word: ["k", "n", "i", "f", "e"], string: knife knife found at position 19990 Player 1 pick a letter Player 1, Computer level 0 adding to knife Found a word, player 1 returning '!' CHALLENGE Current word: knife knife found at position 19990 Challenge issued, player 0 has ["G", "H", "O", "S"], all players: [["G", "H", "O", "S"], ["G"]] New word to pick Player 0 pick a letter, Computer2 adding to Current word: ["k"], string: k k not found Initial matches: ["ka", "ke", "ki", "kl", "kn", "ko", "ku"] Player 1 pick a letter Player 1, Computer level 0 adding to k Player 1, Computer level 0 matches: ["ka", "ke", "ki", "kl", "kn", "ko", "ku"] In TOP MOST LEVEL, player 1 picking l Player 0, Computer level 1 adding to kl Player 0, Computer level 1 matches: ["kla", "klu", "kly"] Player 1, Computer level 2 adding to kla Player 1, Computer level 2 matches: ["klax"] Player 0, Computer level 3 adding to klax Player 0, Computer level 3 matches: ["klaxo"] Player 1, Computer level 4 adding to klaxo Player 1, Computer level 4 matches: ["klaxon"] Player 0, Computer level 5 adding to klaxon Found a word made by player 1 at level=5, returning nextletter: l In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "l"] In TOP MOST LEVEL, player 1 picking e Player 0, Computer level 1 adding to ke Player 0, Computer level 1 matches: ["kee", "ken", "kep", "ker", "ket", "key"] Player 1, Computer level 2 adding to ker Player 1, Computer level 2 matches: ["kerc", "kern", "kero"] Player 0, Computer level 3 adding to kero Player 0, Computer level 3 matches: ["keros"] Player 1, Computer level 4 adding to keros Player 1, Computer level 4 matches: ["kerose"] Player 0, Computer level 5 adding to kerose Player 0, Computer level 5 matches: ["kerosen"] Player 1, Computer level 6 adding to kerosen Player 1, Computer level 6 matches: ["kerosene"] Player 0, Computer level 7 adding to kerosene Found a word made by player 1 at level=7, returning nextletter: e In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "e"] In TOP MOST LEVEL, player 1 picking o Player 0, Computer level 1 adding to ko Player 0, Computer level 1 matches: ["koa", "kos"] Player 1, Computer level 2 adding to kos Player 1, Computer level 2 matches: ["kosh"] Player 0, Computer level 3 adding to kosh Player 0, Computer level 3 matches: ["koshe"] Player 1, Computer level 4 adding to koshe Player 1, Computer level 4 matches: ["kosher"] Player 0, Computer level 5 adding to kosher Found a word made by player 1 at level=5, returning nextletter: o In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "o"] In TOP MOST LEVEL, player 1 picking n Player 0, Computer level 1 adding to kn Player 0, Computer level 1 matches: ["kna", "kne", "kni", "kno", "knu"] Player 1, Computer level 2 adding to kno Player 1, Computer level 2 matches: ["knob", "knoc", "knol", "knot", "know"] Player 0, Computer level 3 adding to knot Found a word made by player 1 at level=3, returning nextletter: n In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "n"] In TOP MOST LEVEL, player 1 picking u Player 0, Computer level 1 adding to ku Player 0, Computer level 1 matches: ["kud"] Player 1, Computer level 2 adding to kud Player 1, Computer level 2 matches: ["kudo"] Player 0, Computer level 3 adding to kudo Found a word made by player 1 at level=3, returning nextletter: u In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "u"] In TOP MOST LEVEL, player 1 picking o Player 0, Computer level 1 adding to ko Player 0, Computer level 1 matches: ["koa", "kos"] Player 1, Computer level 2 adding to koa Player 1, Computer level 2 matches: ["koal"] Player 0, Computer level 3 adding to koal Player 0, Computer level 3 matches: ["koala"] Player 1, Computer level 4 adding to koala Found a word made by player 0 at level=4, returning nextletter: o In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "o"] TOP LEVEL, player = 1, current word=k, choicelist=[[1, "l"], [1, "e"], [1, "o"], [1, "n"], [1, "u"], [0, "o"]] TOP LEVEL, player = 1, current word=k, favorable choicelist=[[0, "o"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "o"], picking letter o Current word: ["k", "o"], string: ko ko not found Initial matches: ["koa", "kos"] Player 0 pick a letter, Computer2 adding to ko Current word: ["k", "o", "s"], string: kos kos not found Initial matches: ["kosh"] Player 1 pick a letter, Player 1, Computer level 0 adding to kos Player 1, Computer level 0 matches: ["kosh"] In TOP MOST LEVEL, player 1 picking h Player 0, Computer level 1 adding to kosh Player 0, Computer level 1 matches: ["koshe"] Player 1, Computer level 2 adding to koshe Player 1, Computer level 2 matches: ["kosher"] Player 0, Computer level 3 adding to kosher Found a word made by player 1 at level=3, returning nextletter: h In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "h"] TOP LEVEL, player = 1, current word=kos, choicelist=[[1, "h"]] TOP LEVEL, player = 1, current word=kos, favorable choicelist=[] TOP LEVEL, player = 1, no favorable letters TOP LEVEL, player = 1, picking index 0 from favorable list: [1, "h"], picking letter h Current word: ["k", "o", "s", "h"], string: kosh kosh not found Initial matches: ["koshe"] Player 0 pick a letter, Computer2 adding to kosh Current word: ["k", "o", "s", "h", "e"], string: koshe koshe not found Initial matches: ["kosher"] Player 1 pick a letter, Computer level 0 adding to koshe Player 1, Computer level 0 matches: ["kosher"] In TOP MOST LEVEL, player 1 picking r Player 0, Computer level 1 adding to kosher Found a word made by player 1 at level=1, returning nextletter: r In TOP MOST LEVEL, player 1, Computer level 0 received choice:[1, "r"] TOP LEVEL, player = 1, current word=koshe, choicelist=[[1, "r"]] TOP LEVEL, player = 1, current word=koshe, favorable choicelist=[] TOP LEVEL, player = 1, no favorable letters TOP LEVEL, player = 1, picking index 0 from favorable list: [1, "r"], picking letter r Current word: ["k", "o", "s", "h", "e", "r"], string: kosher kosher found at position 20033 Player 0 pick a letter Computer2 adding to kosher Current word: kosher kosher found at position 20033 Challenge issued, player 1 has ["G", "H"], all players: [["G", "H", "O", "S"], ["G", "H"]] New word to pick Player 1 pick a letter Player 1, Computer level 0 adding to Current word: ["b"], string: b b not found Initial matches: ["ba", "be", "bi", "bl", "bo", "br", "bu", "by"] Player 0 pick a letter, Computer2 adding to b Current word: ["b", "a"], string: ba ba not found Initial matches: ["bab", "bac", "bad", "baf", "bag", "bah", "bai", "bak", "bal", "bam", "ban", "bap", "bar", "bas", "bat", "bau", "baw", "bay", "baz"] Player 1 pick a letter Player 1, Computer level 0 adding to ba Player 1, Computer level 0 matches: ["bab", "bac", "bad", "baf", "bag", "bah", "bai", "bak", "bal", "bam", "ban", "bap", "bar", "bas", "bat", "bau", "baw", "bay", "baz"] In TOP MOST LEVEL, player 1 picking i Player 0, Computer level 1 adding to bai Player 0, Computer level 1 matches: ["bail", "bait"] Player 1, Computer level 2 adding to bait Found a word made by player 0 at level=2, returning nextletter: i In TOP MOST LEVEL, player 1, Computer level 0 received choice:[0, "i"] TOP LEVEL, player = 1, current word=ba, choicelist=[[0, "i"]] TOP LEVEL, player = 1, current word=ba, favorable choicelist=[[0, "i"]] TOP LEVEL, player = 1, picking index 0 from favorable list: [0, "i"], picking letter i Current word: ["b", "a", "i"], string: bai bai not found Initial matches: ["bail", "bait"] Player 0 pick a letter, Computer2 adding to bai Current word: ["b", "a", "i", "t"], string: bait bait found at position 3211 Player 1 pick a letter Player 1, Computer level 0 adding to bait Found a word, player 1 returning '!' CHALLENGE Current word: bait bait found at position 3211 Challenge issued, player 0 has ["G", "H", "O", "S", "T"], all players: [["G", "H", "O", "S", "T"], ["G", "H"]] Player 0 loses, game over