krystian1201 / MyScrabble

0 stars 2 forks source link

Random AI player #47

Open krystian1201 opened 9 years ago

krystian1201 commented 9 years ago

The simplest case - just choose any random word that satisfies the constraints

krystian1201 commented 9 years ago

First move - easiest case

krystian1201 commented 9 years ago

Random location on board, random orientation, random word length and, finally, random word

krystian1201 commented 9 years ago

Move 2nd and above - next case

krystian1201 commented 9 years ago

AI player needs tiles rack

krystian1201 commented 9 years ago

AI and human needs to share tiles bag

krystian1201 commented 9 years ago

There is some problem with randomly choosing word's orientation - the Random.Next() method always returns the same number. Replaced Next(0,2) with Next(0,10) - a little better

krystian1201 commented 9 years ago

For move 2 and above we need not only the state of tiles rack, but also the state of board and the "anchor" tile

krystian1201 commented 9 years ago

Tiles in tiles rack need to be refilled from tiles bag after each move - seems to work

krystian1201 commented 9 years ago

To add - checking if the new tiles don't form invalid words in any direction

krystian1201 commented 9 years ago

The AI "hangs" when the tiles rack is partially empty

krystian1201 commented 9 years ago

The tiles put by AI player on board needs to be put inside Board array. Assigning them position on board is not enough

krystian1201 commented 9 years ago

If the tiles form some invalid words, they should be taken away from board.

krystian1201 commented 9 years ago

I can add checking for repetitions in random words

krystian1201 commented 9 years ago

Method checking for invalid words can also collect the words formed by tiles in different directions. It can be used later for scoring