ttt_gem_8thlight 0.0.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61cf6cb2c3398a9f85597236b94566ac32e8777b
4
- data.tar.gz: e76d69e852bb315fa6a365edc01415b299b52d8d
3
+ metadata.gz: 1625205d2bc9baf4691081f008f67d70cd16ebbf
4
+ data.tar.gz: 8dfc22e281888841f64416521741623df4f3b75d
5
5
  SHA512:
6
- metadata.gz: ba1b9bb6c4225f533af76c7742c244e3b198da83ea8858c0fd82d5b91ea4f4a04e4185f7c17ae69b75b8ff7c39b5b8bc7d3bf6912e91cf85d4fcb7b4b5acd2cb
7
- data.tar.gz: a85241c5d0b524caf0d1a7b77c3499b8295c2f8eb530d6d2be461554233b2695ae468400868295e910252ed5fd971f8a4443d9f9e9387813cc320f8bfd1c30ab
6
+ metadata.gz: e5e0f74353940d7dd15024e6a043196a7e39357c96454ee915eee3bc51d085ca62775ef22f5dd4e4d7e06bc434b3c98fd714556c10e187e497575a2f857c7954
7
+ data.tar.gz: e36fb8446d906b0662acbd76873130563105b935be965425ec44663ddfb1eec8514f5c9495fc9692a5d407b331340d7eeb38baa6e32a14dda4aaf3e7c37e5c1f
@@ -30,15 +30,16 @@ module TicTacToe
30
30
  if max_player
31
31
  board.empty_spaces.each do |spaces|
32
32
  board.place_move(mark, spaces)
33
- score_min = [score_min, minimax(board, opponent_mark, depth + 1, score_max, score_min, !(max_player), -color)].max
33
+ score_min = [score_min, minimax(board, opponent_mark, depth + 1, score_min, score_max, !(max_player), -color)].max
34
34
  board.undo_move(spaces)
35
35
  break if score_min >= score_max
36
36
  end
37
37
  return score_min
38
38
  else
39
+
39
40
  board.empty_spaces.each do |spaces|
40
41
  board.place_move(mark, spaces)
41
- score_max = [score_max, minimax(board, opponent_mark, depth + 1, score_max, score_min, !(max_player), -color)].min
42
+ score_max = [score_max, minimax(board, opponent_mark, depth + 1, score_min, score_max, !(max_player), -color)].min
42
43
  board.undo_move(spaces)
43
44
  break if score_min >= score_max
44
45
  end
data/spec/game_spec.rb CHANGED
@@ -221,7 +221,7 @@ describe TicTacToe::Game do
221
221
  config[:player_two] = :ai
222
222
  config[:game_board] = "12X456789"
223
223
  new_game = described_class.play_game(ui, config)
224
- new_game.board.to_s.should == "O2X456789"
224
+ new_game.board.to_s.should == "12X4O6789"
225
225
  end
226
226
  end
227
227
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ttt_gem_8thlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Meagan Waller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-15 00:00:00.000000000 Z
11
+ date: 2013-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec