PlayRockPaperScissorsGame 2.8.3 → 2.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 763a5c51b1bb097612408a1e4a81d678082c1ab2
4
- data.tar.gz: 3b1012f1a080d12cd3614ff1cca89d68a0b76560
3
+ metadata.gz: 59ea96679884a652ab68bf5849cff6f5ce250dcb
4
+ data.tar.gz: 4f77d25f38237b94a73470ce392f99682934164e
5
5
  SHA512:
6
- metadata.gz: 9255d2a90ab9f12469c319d042ad8f7bdc57cfcc1bf6c9c524bd9e7ef1688e27be912da0133d334492890a32f39c7a174244dd2c6cc8c8ae30d7e7c68306d5d1
7
- data.tar.gz: fe4a82a3cd4d97e3009a1dfa3822a3e2f164ad468cccbdca3e108e3d24227e576829db03c23e82c3ad7d4535d22b9a46f66e3e4fd4764b1889d1a05f4f4292aa
6
+ metadata.gz: 520b9e13c1856dca04812439cc6b33b59575afe8d23e7b930f7557db9c4b230c02e8053fa2198f609418c68377045f389eb6b36d7845ba39e76f4fb19f1f7117
7
+ data.tar.gz: 70581259dbc2bce8ecf4b1632d8b91c4fbf8cb385ac64a1c6040474823e1d664af2d3d4441f84f035ae7d6214340d3e777e6508eb68b02cbf41a0e8d799a16c1
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- |#�O?y� _J��.�-�{��41C�V4�^�O^ə�2�[�?{��O��4:&3�]�PWנy�G��QZ+�;�ޏ��\��m�H�b��ϲ ��$+iû˵��y���frӯ8/�B�[��H�5@D�����@����e1���8�k�~���!��V�m�����>!b��}l>��"���D�`�ZC�^ba�(��觲���&M\�\�Ԡ)���i����A�*;@+
1
+ ���
data/docs/Code.md CHANGED
@@ -35,7 +35,7 @@ Master Code
35
35
  class PlayRockPaperScissorsGame
36
36
 
37
37
  module RockPaperScissors
38
- VERSION = "2.8.3"
38
+ VERSION = "2.8.4"
39
39
  end
40
40
 
41
41
  # import the colorize gem
@@ -21,8 +21,8 @@ permalink: /comparing_code.html
21
21
  - [What Advanced Code Looks Like](#what-advanced-code-looks-like)
22
22
 
23
23
  <!--
24
- `rps`
25
- -->
24
+ `% rps`
25
+ -->
26
26
 
27
27
  ## Beginner's Code
28
28
 
@@ -125,15 +125,6 @@ Subtlety is usually painted all over advanced ruby code. While this does make th
125
125
 
126
126
  ```ruby
127
127
  class PlayRockPaperScissorsGame
128
-
129
- module RockPaperScissors
130
- VERSION = "2.8.3"
131
- end
132
-
133
- # import colorize gem
134
- require "colorized_string"
135
- ColorizedString.colors # import colors
136
- ColorizedString.modes # import modes (bold, italic, etc...)
137
128
 
138
129
  module Constants
139
130
  NTRY_TO_SYM = { # define entry to symbol (key to value)
@@ -151,8 +142,8 @@ class PlayRockPaperScissorsGame
151
142
  ]
152
143
  LOSERS = WINNERS.map { |player_choice,computer_choice| [computer_choice,player_choice] } # flip the values in the WINNERS array, returning a loss
153
144
  INIT_STRINGS = [
154
- ColorizedString["You are about to enter a rock-paper-scissors best of 3 match."].colorize(:green),
155
- ColorizedString["Press the return/enter key to continue..."].colorize(:green),
145
+ "You are about to enter a rock-paper-scissors best of 3 match.",
146
+ "Press the return/enter key to continue...",
156
147
  ""
157
148
  ]
158
149
  end
@@ -163,7 +154,7 @@ class PlayRockPaperScissorsGame
163
154
  def continue(str1,str2,str3)
164
155
  puts str1
165
156
  print str2
166
- gets
157
+ gets # press enter/return to continue
167
158
  puts str3
168
159
  end
169
160
  end
@@ -176,33 +167,33 @@ class PlayRockPaperScissorsGame
176
167
 
177
168
  def play(winning_score)
178
169
  while @player_score < winning_score && @computer_score < winning_score
179
- puts ColorizedString["Player score: #{@player_score}, "].colorize(:blue) +
180
- ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:blue)
170
+ puts "Player score: #{@player_score}, " +
171
+ "Computer score: #{@computer_score}, Ties: #{@ties}"
181
172
  player = PrivateMethods.player_choice
182
173
  computer = Constants::COMPUTER_CHOICES.sample # .sample = pick a random choice
183
- puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:blue)
184
- puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:blue)
174
+ puts "\nPlayer chooses #{player.to_s.downcase}"
175
+ puts "Computer chooses #{computer.to_s.downcase}"
185
176
  case PrivateMethods.player_outcome [player, computer]
186
177
  when :WIN
187
- puts ColorizedString["#{player.to_s.capitalize} beats #{computer.to_s.downcase}, player wins the round"].colorize(:red)
178
+ puts "#{player.to_s.capitalize} beats #{computer.to_s.downcase}, player wins the round"
188
179
  @player_score += 1
189
180
  when :LOSE
190
- puts ColorizedString["#{computer.to_s.capitalize} beats #{player.to_s.downcase}, computer wins the round"].colorize(:red)
181
+ puts "#{computer.to_s.capitalize} beats #{player.to_s.downcase}, computer wins the round"
191
182
  @computer_score += 1
192
183
  else
193
- puts ColorizedString["Tie, choose again"].colorize(:red)
184
+ puts "Tie, choose again"
194
185
  @ties += 1
195
186
  end
196
187
  end
197
- puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:blue) +
198
- ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:blue)
188
+ puts "\nFinal score: player: #{@player_score}, " +
189
+ "computer: #{@computer_score} (ties: #{@ties})"
199
190
  case PrivateMethods.final_outcome(@player_score, @computer_score)
200
191
  when :WIN
201
- puts ColorizedString["Player wins!"].colorize(:red)
192
+ puts "Player wins!"
202
193
  when :LOSE
203
- puts ColorizedString["Computer wins!"].colorize(:red)
194
+ puts "Computer wins!"
204
195
  else
205
- puts ColorizedString["It's a tie!"].colorize(:red)
196
+ puts "It's a tie!"
206
197
  end
207
198
  gets
208
199
  end
@@ -211,12 +202,12 @@ class PlayRockPaperScissorsGame
211
202
  class << self
212
203
  def player_choice
213
204
  loop do
214
- print ColorizedString["Choose rock (r), paper (p) or scissors (s): "].colorize(:green)
205
+ print "Choose rock (r), paper (p) or scissors (s): "
215
206
  choice = gets.chomp.downcase
216
207
  if Constants::NTRY_TO_SYM.key?(choice)
217
208
  return Constants::NTRY_TO_SYM[choice]
218
209
  elsif choice != Constants::VALID_ENTRIES
219
- puts ColorizedString["That entry is invalid. Please re-enter."].colorize(:red) entry message
210
+ puts "That entry is invalid. Please re-enter." entry message
220
211
  else
221
212
  return nil
222
213
  end
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=24681c868d0c9f04c3284da474a7c294ed887eef"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8b6a5cd2298ae3e6af5bd90a8bb56279a528d1b2"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
data/docs/_site/code.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=24681c868d0c9f04c3284da474a7c294ed887eef"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8b6a5cd2298ae3e6af5bd90a8bb56279a528d1b2"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -69,7 +69,7 @@
69
69
  <span class="k">class</span> <span class="nc">PlayRockPaperScissorsGame</span>
70
70
 
71
71
  <span class="k">module</span> <span class="nn">RockPaperScissors</span>
72
- <span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"2.8.3"</span>
72
+ <span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"2.8.4"</span>
73
73
  <span class="k">end</span>
74
74
 
75
75
  <span class="c1"># import the colorize gem</span>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=24681c868d0c9f04c3284da474a7c294ed887eef"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8b6a5cd2298ae3e6af5bd90a8bb56279a528d1b2"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -70,8 +70,8 @@
70
70
  </ul>
71
71
 
72
72
  <!--
73
- `rps`
74
- -->
73
+ `% rps`
74
+ -->
75
75
 
76
76
  <h2 id="beginners-code">Beginner’s Code</h2>
77
77
 
@@ -177,15 +177,6 @@
177
177
  </div>
178
178
 
179
179
  <div class="language-ruby highlighter-rouge"><pre class="highlight"><code><span class="k">class</span> <span class="nc">PlayRockPaperScissorsGame</span>
180
-
181
- <span class="k">module</span> <span class="nn">RockPaperScissors</span>
182
- <span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"2.8.3"</span>
183
- <span class="k">end</span>
184
-
185
- <span class="c1"># import colorize gem</span>
186
- <span class="nb">require</span> <span class="s2">"colorized_string"</span>
187
- <span class="no">ColorizedString</span><span class="p">.</span><span class="nf">colors</span> <span class="c1"># import colors</span>
188
- <span class="no">ColorizedString</span><span class="p">.</span><span class="nf">modes</span> <span class="c1"># import modes (bold, italic, etc...)</span>
189
180
 
190
181
  <span class="k">module</span> <span class="nn">Constants</span>
191
182
  <span class="no">NTRY_TO_SYM</span> <span class="o">=</span> <span class="p">{</span> <span class="c1"># define entry to symbol (key to value)</span>
@@ -203,8 +194,8 @@
203
194
  <span class="p">]</span>
204
195
  <span class="no">LOSERS</span> <span class="o">=</span> <span class="no">WINNERS</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">player_choice</span><span class="p">,</span><span class="n">computer_choice</span><span class="o">|</span> <span class="p">[</span><span class="n">computer_choice</span><span class="p">,</span><span class="n">player_choice</span><span class="p">]</span> <span class="p">}</span> <span class="c1"># flip the values in the WINNERS array, returning a loss</span>
205
196
  <span class="no">INIT_STRINGS</span> <span class="o">=</span> <span class="p">[</span>
206
- <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"You are about to enter a rock-paper-scissors best of 3 match."</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:green</span><span class="p">),</span>
207
- <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Press the return/enter key to continue..."</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:green</span><span class="p">),</span>
197
+ <span class="s2">"You are about to enter a rock-paper-scissors best of 3 match."</span><span class="p">,</span>
198
+ <span class="s2">"Press the return/enter key to continue..."</span><span class="p">,</span>
208
199
  <span class="s2">""</span>
209
200
  <span class="p">]</span>
210
201
  <span class="k">end</span>
@@ -215,7 +206,7 @@
215
206
  <span class="k">def</span> <span class="nf">continue</span><span class="p">(</span><span class="n">str1</span><span class="p">,</span><span class="n">str2</span><span class="p">,</span><span class="n">str3</span><span class="p">)</span>
216
207
  <span class="nb">puts</span> <span class="n">str1</span>
217
208
  <span class="nb">print</span> <span class="n">str2</span>
218
- <span class="nb">gets</span>
209
+ <span class="nb">gets</span> <span class="c1"># press enter/return to continue</span>
219
210
  <span class="nb">puts</span> <span class="n">str3</span>
220
211
  <span class="k">end</span>
221
212
  <span class="k">end</span>
@@ -228,33 +219,33 @@
228
219
 
229
220
  <span class="k">def</span> <span class="nf">play</span><span class="p">(</span><span class="n">winning_score</span><span class="p">)</span>
230
221
  <span class="k">while</span> <span class="vi">@player_score</span> <span class="o">&lt;</span> <span class="n">winning_score</span> <span class="o">&amp;&amp;</span> <span class="vi">@computer_score</span> <span class="o">&lt;</span> <span class="n">winning_score</span>
231
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Player score: </span><span class="si">#{</span><span class="vi">@player_score</span><span class="si">}</span><span class="s2">, "</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:blue</span><span class="p">)</span> <span class="o">+</span>
232
- <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Computer score: </span><span class="si">#{</span><span class="vi">@computer_score</span><span class="si">}</span><span class="s2">, Ties: </span><span class="si">#{</span><span class="vi">@ties</span><span class="si">}</span><span class="s2">"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:blue</span><span class="p">)</span>
222
+ <span class="nb">puts</span> <span class="s2">"Player score: </span><span class="si">#{</span><span class="vi">@player_score</span><span class="si">}</span><span class="s2">, "</span> <span class="o">+</span>
223
+ <span class="s2">"Computer score: </span><span class="si">#{</span><span class="vi">@computer_score</span><span class="si">}</span><span class="s2">, Ties: </span><span class="si">#{</span><span class="vi">@ties</span><span class="si">}</span><span class="s2">"</span>
233
224
  <span class="n">player</span> <span class="o">=</span> <span class="no">PrivateMethods</span><span class="p">.</span><span class="nf">player_choice</span>
234
225
  <span class="n">computer</span> <span class="o">=</span> <span class="no">Constants</span><span class="o">::</span><span class="no">COMPUTER_CHOICES</span><span class="p">.</span><span class="nf">sample</span> <span class="c1"># .sample = pick a random choice</span>
235
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"</span><span class="se">\n</span><span class="s2">Player chooses </span><span class="si">#{</span><span class="n">player</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:blue</span><span class="p">)</span>
236
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Computer chooses </span><span class="si">#{</span><span class="n">computer</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:blue</span><span class="p">)</span>
226
+ <span class="nb">puts</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">Player chooses </span><span class="si">#{</span><span class="n">player</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">"</span>
227
+ <span class="nb">puts</span> <span class="s2">"Computer chooses </span><span class="si">#{</span><span class="n">computer</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">"</span>
237
228
  <span class="k">case</span> <span class="no">PrivateMethods</span><span class="p">.</span><span class="nf">player_outcome</span> <span class="p">[</span><span class="n">player</span><span class="p">,</span> <span class="n">computer</span><span class="p">]</span>
238
229
  <span class="k">when</span> <span class="ss">:WIN</span>
239
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"</span><span class="si">#{</span><span class="n">player</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">capitalize</span><span class="si">}</span><span class="s2"> beats </span><span class="si">#{</span><span class="n">computer</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">, player wins the round"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:red</span><span class="p">)</span>
230
+ <span class="nb">puts</span> <span class="s2">"</span><span class="si">#{</span><span class="n">player</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">capitalize</span><span class="si">}</span><span class="s2"> beats </span><span class="si">#{</span><span class="n">computer</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">, player wins the round"</span>
240
231
  <span class="vi">@player_score</span> <span class="o">+=</span> <span class="mi">1</span>
241
232
  <span class="k">when</span> <span class="ss">:LOSE</span>
242
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"</span><span class="si">#{</span><span class="n">computer</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">capitalize</span><span class="si">}</span><span class="s2"> beats </span><span class="si">#{</span><span class="n">player</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">, computer wins the round"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:red</span><span class="p">)</span>
233
+ <span class="nb">puts</span> <span class="s2">"</span><span class="si">#{</span><span class="n">computer</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">capitalize</span><span class="si">}</span><span class="s2"> beats </span><span class="si">#{</span><span class="n">player</span><span class="p">.</span><span class="nf">to_s</span><span class="p">.</span><span class="nf">downcase</span><span class="si">}</span><span class="s2">, computer wins the round"</span>
243
234
  <span class="vi">@computer_score</span> <span class="o">+=</span> <span class="mi">1</span>
244
235
  <span class="k">else</span>
245
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Tie, choose again"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:red</span><span class="p">)</span>
236
+ <span class="nb">puts</span> <span class="s2">"Tie, choose again"</span>
246
237
  <span class="vi">@ties</span> <span class="o">+=</span> <span class="mi">1</span>
247
238
  <span class="k">end</span>
248
239
  <span class="k">end</span>
249
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"</span><span class="se">\n</span><span class="s2">Final score: player: </span><span class="si">#{</span><span class="vi">@player_score</span><span class="si">}</span><span class="s2">, "</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:blue</span><span class="p">)</span> <span class="o">+</span>
250
- <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"computer: </span><span class="si">#{</span><span class="vi">@computer_score</span><span class="si">}</span><span class="s2"> (ties: </span><span class="si">#{</span><span class="vi">@ties</span><span class="si">}</span><span class="s2">)"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:blue</span><span class="p">)</span>
240
+ <span class="nb">puts</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">Final score: player: </span><span class="si">#{</span><span class="vi">@player_score</span><span class="si">}</span><span class="s2">, "</span> <span class="o">+</span>
241
+ <span class="s2">"computer: </span><span class="si">#{</span><span class="vi">@computer_score</span><span class="si">}</span><span class="s2"> (ties: </span><span class="si">#{</span><span class="vi">@ties</span><span class="si">}</span><span class="s2">)"</span>
251
242
  <span class="k">case</span> <span class="no">PrivateMethods</span><span class="p">.</span><span class="nf">final_outcome</span><span class="p">(</span><span class="vi">@player_score</span><span class="p">,</span> <span class="vi">@computer_score</span><span class="p">)</span>
252
243
  <span class="k">when</span> <span class="ss">:WIN</span>
253
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Player wins!"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:red</span><span class="p">)</span>
244
+ <span class="nb">puts</span> <span class="s2">"Player wins!"</span>
254
245
  <span class="k">when</span> <span class="ss">:LOSE</span>
255
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Computer wins!"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:red</span><span class="p">)</span>
246
+ <span class="nb">puts</span> <span class="s2">"Computer wins!"</span>
256
247
  <span class="k">else</span>
257
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"It's a tie!"</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:red</span><span class="p">)</span>
248
+ <span class="nb">puts</span> <span class="s2">"It's a tie!"</span>
258
249
  <span class="k">end</span>
259
250
  <span class="nb">gets</span>
260
251
  <span class="k">end</span>
@@ -263,12 +254,12 @@
263
254
  <span class="k">class</span> <span class="o">&lt;&lt;</span> <span class="nb">self</span>
264
255
  <span class="k">def</span> <span class="nf">player_choice</span>
265
256
  <span class="kp">loop</span> <span class="k">do</span>
266
- <span class="nb">print</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Choose rock (r), paper (p) or scissors (s): "</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:green</span><span class="p">)</span>
257
+ <span class="nb">print</span> <span class="s2">"Choose rock (r), paper (p) or scissors (s): "</span>
267
258
  <span class="n">choice</span> <span class="o">=</span> <span class="nb">gets</span><span class="p">.</span><span class="nf">chomp</span><span class="p">.</span><span class="nf">downcase</span>
268
259
  <span class="k">if</span> <span class="no">Constants</span><span class="o">::</span><span class="no">NTRY_TO_SYM</span><span class="p">.</span><span class="nf">key?</span><span class="p">(</span><span class="n">choice</span><span class="p">)</span>
269
260
  <span class="k">return</span> <span class="no">Constants</span><span class="o">::</span><span class="no">NTRY_TO_SYM</span><span class="p">[</span><span class="n">choice</span><span class="p">]</span>
270
261
  <span class="k">elsif</span> <span class="n">choice</span> <span class="o">!=</span> <span class="no">Constants</span><span class="o">::</span><span class="no">VALID_ENTRIES</span>
271
- <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"That entry is invalid. Please re-enter."</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:red</span><span class="p">)</span> <span class="n">entry</span> <span class="n">message</span>
262
+ <span class="nb">puts</span> <span class="s2">"That entry is invalid. Please re-enter."</span> <span class="n">entry</span> <span class="n">message</span>
272
263
  <span class="k">else</span>
273
264
  <span class="k">return</span> <span class="kp">nil</span>
274
265
  <span class="k">end</span>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=24681c868d0c9f04c3284da474a7c294ed887eef"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8b6a5cd2298ae3e6af5bd90a8bb56279a528d1b2"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=24681c868d0c9f04c3284da474a7c294ed887eef"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8b6a5cd2298ae3e6af5bd90a8bb56279a528d1b2"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=24681c868d0c9f04c3284da474a7c294ed887eef"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8b6a5cd2298ae3e6af5bd90a8bb56279a528d1b2"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
@@ -7,7 +7,7 @@
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
8
8
  <meta name="theme-color" content="#157878"/>
9
9
  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />
10
- <link rel="stylesheet" href="/assets/css/style.css?v=24681c868d0c9f04c3284da474a7c294ed887eef"/>
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8b6a5cd2298ae3e6af5bd90a8bb56279a528d1b2"/>
11
11
  <script src="assets/js/pace.min.js"></script>
12
12
 
13
13
  <link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png"/>
data/lib/rps/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RockPaperScissors
2
- VERSION = "2.8.3"
2
+ VERSION = "2.8.4"
3
3
  end
data/rps.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "PlayRockPaperScissorsGame"
3
- spec.version = "2.8.3"
4
- spec.date = "2017-05-15"
3
+ spec.version = "2.8.4"
4
+ spec.date = "2017-05-19"
5
5
  spec.summary = "A Rock Paper Scissors Ruby Gem"
6
6
  spec.description = <<-EOF
7
7
  A Ruby-programmed rock paper scissors game.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PlayRockPaperScissorsGame
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.3
4
+ version: 2.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bag3318
@@ -30,7 +30,7 @@ cert_chain:
30
30
  ft+uhriUZSVDBJRLSlrQEH2f0866a9dA4oUmvvFU46Mh6pozDjOcLJIp/tCnbVOc
31
31
  HSdXPrjfOoDbhBPH/4wUd5P0rDoNKN1hxH4SzA==
32
32
  -----END CERTIFICATE-----
33
- date: 2017-05-15 00:00:00.000000000 Z
33
+ date: 2017-05-19 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: bundler
metadata.gz.sig CHANGED
Binary file