README.md in mastermind-game-0.0.1 vs README.md in mastermind-game-0.0.2
- old
+ new
@@ -32,22 +32,24 @@
The `Mastermind::Game` object is the primary point of interaction. Instances of this object contain all the information for a complete game.
```ruby
# Instantiate a game with a random secret
-game = Mastermind::Game.new
+# :codemaker and :codebreaker are optional and can be any object
+game = Mastermind::Game.new(codemaker: ..., codebreaker: ...)
# Prepare a guess
-guess = [:red, :red, :red, :red]
+guess = Mastermind::Game::Code.from([:red, :red, :red, :red])
game.guess(guess)
# Find how many turns there have been
game.attempts # => 1
# Check if the game is over
game.over? # => false
-# Determine who has won (returns a Player instance)
+# Determine who has won
+# Returns the codemaker, the codebreaker, or nil
game.winner # => nil
```
### Knuth Algorithm