tictactoe-core 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +9 -0
  3. data/Gemfile +3 -0
  4. data/README.md +2 -0
  5. data/Rakefile +34 -0
  6. data/lib/tictactoe.rb +1 -0
  7. data/lib/tictactoe/ai/ab_minimax.rb +78 -0
  8. data/lib/tictactoe/ai/ab_negamax.rb +45 -0
  9. data/lib/tictactoe/ai/perfect_intelligence.rb +35 -0
  10. data/lib/tictactoe/ai/random_chooser.rb +21 -0
  11. data/lib/tictactoe/ai/tree.rb +44 -0
  12. data/lib/tictactoe/boards/board_type_factory.rb +15 -0
  13. data/lib/tictactoe/boards/four_by_four_board.rb +28 -0
  14. data/lib/tictactoe/boards/three_by_three_board.rb +27 -0
  15. data/lib/tictactoe/game.rb +102 -0
  16. data/lib/tictactoe/players/computer.rb +21 -0
  17. data/lib/tictactoe/players/factory.rb +21 -0
  18. data/lib/tictactoe/sequence.rb +24 -0
  19. data/lib/tictactoe/state.rb +64 -0
  20. data/runtests.sh +1 -0
  21. data/spec/performance_spec.rb +16 -0
  22. data/spec/properties_spec.rb +27 -0
  23. data/spec/rake_rspec.rb +42 -0
  24. data/spec/regression_spec.rb +29 -0
  25. data/spec/reproducible_random.rb +16 -0
  26. data/spec/spec_helper.rb +6 -0
  27. data/spec/test_run.rb +19 -0
  28. data/spec/tictactoe/ai/ab_minimax_spec.rb +511 -0
  29. data/spec/tictactoe/ai/ab_negamax_spec.rb +199 -0
  30. data/spec/tictactoe/ai/perfect_intelligence_spec.rb +122 -0
  31. data/spec/tictactoe/ai/random_choser_spec.rb +50 -0
  32. data/spec/tictactoe/boards/board_type_factory_spec.rb +16 -0
  33. data/spec/tictactoe/boards/four_by_four_board_spec.rb +30 -0
  34. data/spec/tictactoe/boards/three_by_three_board_spec.rb +30 -0
  35. data/spec/tictactoe/game_spec.rb +288 -0
  36. data/spec/tictactoe/players/computer_spec.rb +42 -0
  37. data/spec/tictactoe/players/factory_spec.rb +48 -0
  38. data/spec/tictactoe/sequence_spec.rb +20 -0
  39. data/spec/tictactoe/state_spec.rb +136 -0
  40. data/tictactoe-core-0.1.0.gem +0 -0
  41. data/tictactoe-core.gemspec +15 -0
  42. metadata +84 -0
Binary file
@@ -0,0 +1,15 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "tictactoe-core"
3
+ s.version = "0.1.1"
4
+ s.date = %q{2015-05-21}
5
+
6
+ s.summary = "The core logic of a tic-tac-toe implementation"
7
+ s.description = "The core logic of a tic-tac-toe implementation written as part of 8th Light's apprenticeship"
8
+
9
+ s.authors = ["Mateu Adsuara"]
10
+ s.email = "mateuadsuara@gmail.com"
11
+
12
+ s.files = `git ls-files`.split("\n")
13
+ s.homepage = "https://github.com/demonh3x/tictactoe-core.rb"
14
+ s.license = "MIT"
15
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tictactoe-core
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Mateu Adsuara
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: The core logic of a tic-tac-toe implementation written as part of 8th
14
+ Light's apprenticeship
15
+ email: mateuadsuara@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".travis.yml"
21
+ - Gemfile
22
+ - README.md
23
+ - Rakefile
24
+ - lib/tictactoe.rb
25
+ - lib/tictactoe/ai/ab_minimax.rb
26
+ - lib/tictactoe/ai/ab_negamax.rb
27
+ - lib/tictactoe/ai/perfect_intelligence.rb
28
+ - lib/tictactoe/ai/random_chooser.rb
29
+ - lib/tictactoe/ai/tree.rb
30
+ - lib/tictactoe/boards/board_type_factory.rb
31
+ - lib/tictactoe/boards/four_by_four_board.rb
32
+ - lib/tictactoe/boards/three_by_three_board.rb
33
+ - lib/tictactoe/game.rb
34
+ - lib/tictactoe/players/computer.rb
35
+ - lib/tictactoe/players/factory.rb
36
+ - lib/tictactoe/sequence.rb
37
+ - lib/tictactoe/state.rb
38
+ - runtests.sh
39
+ - spec/performance_spec.rb
40
+ - spec/properties_spec.rb
41
+ - spec/rake_rspec.rb
42
+ - spec/regression_spec.rb
43
+ - spec/reproducible_random.rb
44
+ - spec/spec_helper.rb
45
+ - spec/test_run.rb
46
+ - spec/tictactoe/ai/ab_minimax_spec.rb
47
+ - spec/tictactoe/ai/ab_negamax_spec.rb
48
+ - spec/tictactoe/ai/perfect_intelligence_spec.rb
49
+ - spec/tictactoe/ai/random_choser_spec.rb
50
+ - spec/tictactoe/boards/board_type_factory_spec.rb
51
+ - spec/tictactoe/boards/four_by_four_board_spec.rb
52
+ - spec/tictactoe/boards/three_by_three_board_spec.rb
53
+ - spec/tictactoe/game_spec.rb
54
+ - spec/tictactoe/players/computer_spec.rb
55
+ - spec/tictactoe/players/factory_spec.rb
56
+ - spec/tictactoe/sequence_spec.rb
57
+ - spec/tictactoe/state_spec.rb
58
+ - tictactoe-core-0.1.0.gem
59
+ - tictactoe-core.gemspec
60
+ homepage: https://github.com/demonh3x/tictactoe-core.rb
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.4.6
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: The core logic of a tic-tac-toe implementation
84
+ test_files: []