A program that can perfectly play the word game GHOST.
Sample run:
$ bundle exec ruby lib/ghost_assistant.rb
GHOST word game assistant
How many people are playing? (default 2)
2
What letters have been said so far?
lo
935 words start with “lo”; random 10:
loam
loamed
loamier
loamiest
loaming
loamless
loams
loamy
loan
loanable
302 suitable words found; random 10:
locoweed
loculate
locule
loculi
locums
locust
locustae
locustal
locution
locutories
Suggested letter to say: L (forming “lol”), with score 1
A word starting with “lol”: loll
This program doesn’t actually play perfectly yet – I know that its heuristics can be improved. But it’s still good enough to have beaten every human I have ever tried it against.
Prerequisites:
- Ruby
- Bundler (
gem install bundler
)
Installation:
- download this program, for instance with
git clone https://github.com/roryokane/ghost-assistant.git
bundle install