bashrw_ttt 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. data/bin/play.rb +10 -0
  2. data/lib/ttt/ai.rb +33 -0
  3. data/lib/ttt/ai_easy.rb +17 -0
  4. data/lib/ttt/ai_hard.rb +21 -0
  5. data/lib/ttt/ai_medium.rb +21 -0
  6. data/lib/ttt/ai_medium_back.rb +58 -0
  7. data/lib/ttt/board.rb +37 -0
  8. data/lib/ttt/config_helper.rb +53 -0
  9. data/lib/ttt/config_options.rb +27 -0
  10. data/lib/ttt/context.rb +214 -0
  11. data/lib/ttt/four_by_four.rb +62 -0
  12. data/lib/ttt/game.rb +94 -0
  13. data/lib/ttt/game_history.rb +37 -0
  14. data/lib/ttt/game_interactor.rb +126 -0
  15. data/lib/ttt/human.rb +12 -0
  16. data/lib/ttt/interfaces/cli/lib/cli/board_selection.rb +34 -0
  17. data/lib/ttt/interfaces/cli/lib/cli/cli_game.rb +186 -0
  18. data/lib/ttt/interfaces/cli/lib/cli/cli_presenter.rb +216 -0
  19. data/lib/ttt/interfaces/cli/lib/cli/clio.rb +17 -0
  20. data/lib/ttt/interfaces/cli/lib/cli/play_again.rb +38 -0
  21. data/lib/ttt/interfaces/cli/lib/cli/player_selection.rb +43 -0
  22. data/lib/ttt/interfaces/cli/lib/cli/selection.rb +8 -0
  23. data/lib/ttt/interfaces/cli/lib/cli/walk_history.rb +48 -0
  24. data/lib/ttt/interfaces/cli/spec/cli/board_selection_spec.rb +29 -0
  25. data/lib/ttt/interfaces/cli/spec/cli/cli_game_spec.rb +376 -0
  26. data/lib/ttt/interfaces/cli/spec/cli/cli_presenter_spec.rb +147 -0
  27. data/lib/ttt/interfaces/cli/spec/cli/play_again_spec.rb +39 -0
  28. data/lib/ttt/interfaces/cli/spec/cli/player_selection_spec.rb +62 -0
  29. data/lib/ttt/interfaces/cli/spec/cli/walk_history_spec.rb +115 -0
  30. data/lib/ttt/interfaces/cli/spec/spec_helper.rb +14 -0
  31. data/lib/ttt/interfaces/limelight/four_by_four/props.rb +1 -0
  32. data/lib/ttt/interfaces/limelight/four_by_four/styles.rb +74 -0
  33. data/lib/ttt/interfaces/limelight/four_by_four_finished/props.rb +1 -0
  34. data/lib/ttt/interfaces/limelight/four_by_four_finished/styles.rb +74 -0
  35. data/lib/ttt/interfaces/limelight/game_list/players/load_button.rb +10 -0
  36. data/lib/ttt/interfaces/limelight/game_list/props.rb +17 -0
  37. data/lib/ttt/interfaces/limelight/game_list/styles.rb +8 -0
  38. data/lib/ttt/interfaces/limelight/main_menu/players/exit_ttt.rb +3 -0
  39. data/lib/ttt/interfaces/limelight/main_menu/players/load_game.rb +3 -0
  40. data/lib/ttt/interfaces/limelight/main_menu/players/new_game.rb +3 -0
  41. data/lib/ttt/interfaces/limelight/main_menu/props.rb +17 -0
  42. data/lib/ttt/interfaces/limelight/new_game/players/board_type.rb +1 -0
  43. data/lib/ttt/interfaces/limelight/new_game/players/new_game.rb +5 -0
  44. data/lib/ttt/interfaces/limelight/new_game/players/player_type.rb +1 -0
  45. data/lib/ttt/interfaces/limelight/new_game/players/setup_button.rb +21 -0
  46. data/lib/ttt/interfaces/limelight/new_game/props.rb +21 -0
  47. data/lib/ttt/interfaces/limelight/new_game/styles.rb +23 -0
  48. data/lib/ttt/interfaces/limelight/partials/board_partial.rb +14 -0
  49. data/lib/ttt/interfaces/limelight/partials/menu_button_partial.rb +5 -0
  50. data/lib/ttt/interfaces/limelight/partials/move_history_partial.rb +6 -0
  51. data/lib/ttt/interfaces/limelight/partials/title_history_partial.rb +10 -0
  52. data/lib/ttt/interfaces/limelight/players/board.rb +3 -0
  53. data/lib/ttt/interfaces/limelight/players/game.rb +4 -0
  54. data/lib/ttt/interfaces/limelight/players/generic_move_history.rb +5 -0
  55. data/lib/ttt/interfaces/limelight/players/generic_player.rb +8 -0
  56. data/lib/ttt/interfaces/limelight/players/left_button.rb +3 -0
  57. data/lib/ttt/interfaces/limelight/players/main_menu.rb +3 -0
  58. data/lib/ttt/interfaces/limelight/players/right_button.rb +3 -0
  59. data/lib/ttt/interfaces/limelight/playscripts/game_playscript.rb +169 -0
  60. data/lib/ttt/interfaces/limelight/production.rb +14 -0
  61. data/lib/ttt/interfaces/limelight/spec/game_playscript_spec.rb +218 -0
  62. data/lib/ttt/interfaces/limelight/spec/main_menu/main_menu_spec.rb +38 -0
  63. data/lib/ttt/interfaces/limelight/spec/new_game/new_game_spec.rb +45 -0
  64. data/lib/ttt/interfaces/limelight/spec/spec_helper.rb +8 -0
  65. data/lib/ttt/interfaces/limelight/stages.rb +6 -0
  66. data/lib/ttt/interfaces/limelight/styles.rb +119 -0
  67. data/lib/ttt/interfaces/limelight/three_by_three/props.rb +1 -0
  68. data/lib/ttt/interfaces/limelight/three_by_three/styles.rb +39 -0
  69. data/lib/ttt/interfaces/limelight/three_by_three_by_three/props.rb +1 -0
  70. data/lib/ttt/interfaces/limelight/three_by_three_by_three/styles.rb +119 -0
  71. data/lib/ttt/interfaces/limelight/three_by_three_by_three_finished/props.rb +1 -0
  72. data/lib/ttt/interfaces/limelight/three_by_three_by_three_finished/styles.rb +119 -0
  73. data/lib/ttt/interfaces/limelight/three_by_three_finished/props.rb +1 -0
  74. data/lib/ttt/interfaces/limelight/three_by_three_finished/styles.rb +39 -0
  75. data/lib/ttt/interfaces/rails/app/controllers/application_controller.rb +3 -0
  76. data/lib/ttt/interfaces/rails/app/controllers/ttt_games_controller.rb +86 -0
  77. data/lib/ttt/interfaces/rails/app/helpers/application_helper.rb +2 -0
  78. data/lib/ttt/interfaces/rails/app/models/ttt_game.rb +34 -0
  79. data/lib/ttt/interfaces/rails/app/presenters/web_game_presenter.rb +159 -0
  80. data/lib/ttt/interfaces/rails/autotest/discover.rb +1 -0
  81. data/lib/ttt/interfaces/rails/config/application.rb +67 -0
  82. data/lib/ttt/interfaces/rails/config/boot.rb +6 -0
  83. data/lib/ttt/interfaces/rails/config/environment.rb +5 -0
  84. data/lib/ttt/interfaces/rails/config/environments/development.rb +37 -0
  85. data/lib/ttt/interfaces/rails/config/environments/production.rb +67 -0
  86. data/lib/ttt/interfaces/rails/config/environments/test.rb +37 -0
  87. data/lib/ttt/interfaces/rails/config/initializers/backtrace_silencers.rb +7 -0
  88. data/lib/ttt/interfaces/rails/config/initializers/inflections.rb +15 -0
  89. data/lib/ttt/interfaces/rails/config/initializers/mime_types.rb +5 -0
  90. data/lib/ttt/interfaces/rails/config/initializers/secret_token.rb +7 -0
  91. data/lib/ttt/interfaces/rails/config/initializers/session_store.rb +8 -0
  92. data/lib/ttt/interfaces/rails/config/initializers/wrap_parameters.rb +14 -0
  93. data/lib/ttt/interfaces/rails/config/routes.rb +49 -0
  94. data/lib/ttt/interfaces/rails/db/schema.rb +28 -0
  95. data/lib/ttt/interfaces/rails/db/seeds.rb +7 -0
  96. data/lib/ttt/interfaces/rails/spec/controllers/ttt_games_controller_spec.rb +211 -0
  97. data/lib/ttt/interfaces/rails/spec/models/ttt_game_spec.rb +76 -0
  98. data/lib/ttt/interfaces/rails/spec/presenters/web_game_presenter_spec.rb +52 -0
  99. data/lib/ttt/interfaces/rails/spec/spec_helper.rb +13 -0
  100. data/lib/ttt/interfaces/web_interface/html_generator.rb +76 -0
  101. data/lib/ttt/interfaces/web_interface/web_game_presenter.rb +0 -0
  102. data/lib/ttt/minimax.rb +46 -0
  103. data/lib/ttt/move_history.rb +10 -0
  104. data/lib/ttt/move_traverser.rb +49 -0
  105. data/lib/ttt/player.rb +15 -0
  106. data/lib/ttt/riak_db.rb +53 -0
  107. data/lib/ttt/setup.rb +59 -0
  108. data/lib/ttt/three_by_three.rb +35 -0
  109. data/lib/ttt/three_by_three_by_three.rb +37 -0
  110. data/spec/spec_helper.rb +22 -0
  111. data/spec/ttt/ai_easy_spec.rb +15 -0
  112. data/spec/ttt/ai_hard_spec.rb +76 -0
  113. data/spec/ttt/ai_medium_spec.rb +65 -0
  114. data/spec/ttt/ai_spec.rb +50 -0
  115. data/spec/ttt/board_spec.rb +96 -0
  116. data/spec/ttt/config_helper_spec.rb +54 -0
  117. data/spec/ttt/context_spec.rb +398 -0
  118. data/spec/ttt/four_by_four_spec.rb +112 -0
  119. data/spec/ttt/game_history_spec.rb +41 -0
  120. data/spec/ttt/game_interactor_spec.rb +197 -0
  121. data/spec/ttt/game_spec.rb +246 -0
  122. data/spec/ttt/human_spec.rb +18 -0
  123. data/spec/ttt/move_history_spec.rb +13 -0
  124. data/spec/ttt/move_traverser_spec.rb +75 -0
  125. data/spec/ttt/player_spec.rb +13 -0
  126. data/spec/ttt/riak_db_spec.rb +64 -0
  127. data/spec/ttt/setup_spec.rb +63 -0
  128. data/spec/ttt/three_by_three_by_three_spec.rb +130 -0
  129. data/spec/ttt/three_by_three_spec.rb +110 -0
  130. metadata +238 -0
metadata ADDED
@@ -0,0 +1,238 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bashrw_ttt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Rick Winfrey
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: pry
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: riak-client
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: See the README for instructions about setting up Riak.
79
+ email: rick.winfrey@gmail.com
80
+ executables: []
81
+ extensions: []
82
+ extra_rdoc_files: []
83
+ files:
84
+ - lib/ttt/ai.rb
85
+ - lib/ttt/ai_easy.rb
86
+ - lib/ttt/ai_hard.rb
87
+ - lib/ttt/ai_medium.rb
88
+ - lib/ttt/ai_medium_back.rb
89
+ - lib/ttt/board.rb
90
+ - lib/ttt/config_helper.rb
91
+ - lib/ttt/config_options.rb
92
+ - lib/ttt/context.rb
93
+ - lib/ttt/four_by_four.rb
94
+ - lib/ttt/game.rb
95
+ - lib/ttt/game_history.rb
96
+ - lib/ttt/game_interactor.rb
97
+ - lib/ttt/human.rb
98
+ - lib/ttt/interfaces/cli/lib/cli/board_selection.rb
99
+ - lib/ttt/interfaces/cli/lib/cli/cli_game.rb
100
+ - lib/ttt/interfaces/cli/lib/cli/cli_presenter.rb
101
+ - lib/ttt/interfaces/cli/lib/cli/clio.rb
102
+ - lib/ttt/interfaces/cli/lib/cli/play_again.rb
103
+ - lib/ttt/interfaces/cli/lib/cli/player_selection.rb
104
+ - lib/ttt/interfaces/cli/lib/cli/selection.rb
105
+ - lib/ttt/interfaces/cli/lib/cli/walk_history.rb
106
+ - lib/ttt/interfaces/cli/spec/cli/board_selection_spec.rb
107
+ - lib/ttt/interfaces/cli/spec/cli/cli_game_spec.rb
108
+ - lib/ttt/interfaces/cli/spec/cli/cli_presenter_spec.rb
109
+ - lib/ttt/interfaces/cli/spec/cli/play_again_spec.rb
110
+ - lib/ttt/interfaces/cli/spec/cli/player_selection_spec.rb
111
+ - lib/ttt/interfaces/cli/spec/cli/walk_history_spec.rb
112
+ - lib/ttt/interfaces/cli/spec/spec_helper.rb
113
+ - lib/ttt/interfaces/limelight/four_by_four/props.rb
114
+ - lib/ttt/interfaces/limelight/four_by_four/styles.rb
115
+ - lib/ttt/interfaces/limelight/four_by_four_finished/props.rb
116
+ - lib/ttt/interfaces/limelight/four_by_four_finished/styles.rb
117
+ - lib/ttt/interfaces/limelight/game_list/players/load_button.rb
118
+ - lib/ttt/interfaces/limelight/game_list/props.rb
119
+ - lib/ttt/interfaces/limelight/game_list/styles.rb
120
+ - lib/ttt/interfaces/limelight/main_menu/players/exit_ttt.rb
121
+ - lib/ttt/interfaces/limelight/main_menu/players/load_game.rb
122
+ - lib/ttt/interfaces/limelight/main_menu/players/new_game.rb
123
+ - lib/ttt/interfaces/limelight/main_menu/props.rb
124
+ - lib/ttt/interfaces/limelight/new_game/players/board_type.rb
125
+ - lib/ttt/interfaces/limelight/new_game/players/new_game.rb
126
+ - lib/ttt/interfaces/limelight/new_game/players/player_type.rb
127
+ - lib/ttt/interfaces/limelight/new_game/players/setup_button.rb
128
+ - lib/ttt/interfaces/limelight/new_game/props.rb
129
+ - lib/ttt/interfaces/limelight/new_game/styles.rb
130
+ - lib/ttt/interfaces/limelight/partials/board_partial.rb
131
+ - lib/ttt/interfaces/limelight/partials/menu_button_partial.rb
132
+ - lib/ttt/interfaces/limelight/partials/move_history_partial.rb
133
+ - lib/ttt/interfaces/limelight/partials/title_history_partial.rb
134
+ - lib/ttt/interfaces/limelight/players/board.rb
135
+ - lib/ttt/interfaces/limelight/players/game.rb
136
+ - lib/ttt/interfaces/limelight/players/generic_move_history.rb
137
+ - lib/ttt/interfaces/limelight/players/generic_player.rb
138
+ - lib/ttt/interfaces/limelight/players/left_button.rb
139
+ - lib/ttt/interfaces/limelight/players/main_menu.rb
140
+ - lib/ttt/interfaces/limelight/players/right_button.rb
141
+ - lib/ttt/interfaces/limelight/playscripts/game_playscript.rb
142
+ - lib/ttt/interfaces/limelight/production.rb
143
+ - lib/ttt/interfaces/limelight/spec/game_playscript_spec.rb
144
+ - lib/ttt/interfaces/limelight/spec/main_menu/main_menu_spec.rb
145
+ - lib/ttt/interfaces/limelight/spec/new_game/new_game_spec.rb
146
+ - lib/ttt/interfaces/limelight/spec/spec_helper.rb
147
+ - lib/ttt/interfaces/limelight/stages.rb
148
+ - lib/ttt/interfaces/limelight/styles.rb
149
+ - lib/ttt/interfaces/limelight/three_by_three/props.rb
150
+ - lib/ttt/interfaces/limelight/three_by_three/styles.rb
151
+ - lib/ttt/interfaces/limelight/three_by_three_by_three/props.rb
152
+ - lib/ttt/interfaces/limelight/three_by_three_by_three/styles.rb
153
+ - lib/ttt/interfaces/limelight/three_by_three_by_three_finished/props.rb
154
+ - lib/ttt/interfaces/limelight/three_by_three_by_three_finished/styles.rb
155
+ - lib/ttt/interfaces/limelight/three_by_three_finished/props.rb
156
+ - lib/ttt/interfaces/limelight/three_by_three_finished/styles.rb
157
+ - lib/ttt/interfaces/rails/app/controllers/application_controller.rb
158
+ - lib/ttt/interfaces/rails/app/controllers/ttt_games_controller.rb
159
+ - lib/ttt/interfaces/rails/app/helpers/application_helper.rb
160
+ - lib/ttt/interfaces/rails/app/models/ttt_game.rb
161
+ - lib/ttt/interfaces/rails/app/presenters/web_game_presenter.rb
162
+ - lib/ttt/interfaces/rails/autotest/discover.rb
163
+ - lib/ttt/interfaces/rails/config/application.rb
164
+ - lib/ttt/interfaces/rails/config/boot.rb
165
+ - lib/ttt/interfaces/rails/config/environment.rb
166
+ - lib/ttt/interfaces/rails/config/environments/development.rb
167
+ - lib/ttt/interfaces/rails/config/environments/production.rb
168
+ - lib/ttt/interfaces/rails/config/environments/test.rb
169
+ - lib/ttt/interfaces/rails/config/initializers/backtrace_silencers.rb
170
+ - lib/ttt/interfaces/rails/config/initializers/inflections.rb
171
+ - lib/ttt/interfaces/rails/config/initializers/mime_types.rb
172
+ - lib/ttt/interfaces/rails/config/initializers/secret_token.rb
173
+ - lib/ttt/interfaces/rails/config/initializers/session_store.rb
174
+ - lib/ttt/interfaces/rails/config/initializers/wrap_parameters.rb
175
+ - lib/ttt/interfaces/rails/config/routes.rb
176
+ - lib/ttt/interfaces/rails/db/schema.rb
177
+ - lib/ttt/interfaces/rails/db/seeds.rb
178
+ - lib/ttt/interfaces/rails/spec/controllers/ttt_games_controller_spec.rb
179
+ - lib/ttt/interfaces/rails/spec/models/ttt_game_spec.rb
180
+ - lib/ttt/interfaces/rails/spec/presenters/web_game_presenter_spec.rb
181
+ - lib/ttt/interfaces/rails/spec/spec_helper.rb
182
+ - lib/ttt/interfaces/web_interface/html_generator.rb
183
+ - lib/ttt/interfaces/web_interface/web_game_presenter.rb
184
+ - lib/ttt/minimax.rb
185
+ - lib/ttt/move_history.rb
186
+ - lib/ttt/move_traverser.rb
187
+ - lib/ttt/player.rb
188
+ - lib/ttt/riak_db.rb
189
+ - lib/ttt/setup.rb
190
+ - lib/ttt/three_by_three.rb
191
+ - lib/ttt/three_by_three_by_three.rb
192
+ - bin/play.rb
193
+ - spec/spec_helper.rb
194
+ - spec/ttt/ai_easy_spec.rb
195
+ - spec/ttt/ai_hard_spec.rb
196
+ - spec/ttt/ai_medium_spec.rb
197
+ - spec/ttt/ai_spec.rb
198
+ - spec/ttt/board_spec.rb
199
+ - spec/ttt/config_helper_spec.rb
200
+ - spec/ttt/context_spec.rb
201
+ - spec/ttt/four_by_four_spec.rb
202
+ - spec/ttt/game_history_spec.rb
203
+ - spec/ttt/game_interactor_spec.rb
204
+ - spec/ttt/game_spec.rb
205
+ - spec/ttt/human_spec.rb
206
+ - spec/ttt/move_history_spec.rb
207
+ - spec/ttt/move_traverser_spec.rb
208
+ - spec/ttt/player_spec.rb
209
+ - spec/ttt/riak_db_spec.rb
210
+ - spec/ttt/setup_spec.rb
211
+ - spec/ttt/three_by_three_by_three_spec.rb
212
+ - spec/ttt/three_by_three_spec.rb
213
+ homepage: http://rubygems.org/gems/bashrw_ttt
214
+ licenses: []
215
+ post_install_message:
216
+ rdoc_options: []
217
+ require_paths:
218
+ - lib
219
+ required_ruby_version: !ruby/object:Gem::Requirement
220
+ none: false
221
+ requirements:
222
+ - - ! '>='
223
+ - !ruby/object:Gem::Version
224
+ version: '0'
225
+ required_rubygems_version: !ruby/object:Gem::Requirement
226
+ none: false
227
+ requirements:
228
+ - - ! '>='
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ requirements: []
232
+ rubyforge_project:
233
+ rubygems_version: 1.8.25
234
+ signing_key:
235
+ specification_version: 3
236
+ summary: Ruby TTT library made for my 8th Light Apprenticeship. Contains a CLI, Rails
237
+ and Limelight interfaces.
238
+ test_files: []