doc/RockPaperScissors.html in RPSrb-0.1.3 vs doc/RockPaperScissors.html in RPSrb-0.1.4
- old
+ new
@@ -179,19 +179,17 @@
</div>
<div class="method-description">
- <h2 id="method-c-continue-label-Define+entry+point+for+game">Define entry point for game<span><a href="#method-c-continue-label-Define+entry+point+for+game">¶</a> <a href="#top">↑</a></span></h2>
-
-<p>this will provide a game intro</p>
+
<div class="method-source-code" id="continue-source">
- <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 41</span>
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 42</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">continue</span>(<span class="ruby-identifier">str1</span>,<span class="ruby-identifier">str2</span>,<span class="ruby-identifier">str3</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">str1</span>
<span class="ruby-identifier">print</span> <span class="ruby-identifier">str2</span>
<span class="ruby-identifier">gets</span>
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">str3</span>
@@ -223,11 +221,11 @@
<div class="method-source-code" id="new-source">
- <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 52</span>
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 53</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
<span class="ruby-ivar">@player_score</span> = <span class="ruby-ivar">@computer_score</span> = <span class="ruby-ivar">@ties</span> = <span class="ruby-value">0</span>
<span class="ruby-keyword">end</span></pre>
</div>
@@ -266,11 +264,11 @@
<div class="method-source-code" id="final_outcome-source">
- <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 116</span>
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 117</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">final_outcome</span>(<span class="ruby-identifier">pl</span>, <span class="ruby-identifier">co</span>)
<span class="ruby-keyword">return</span> <span class="ruby-value">:WIN</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">pl</span> <span class="ruby-operator">></span> <span class="ruby-identifier">co</span>
<span class="ruby-keyword">return</span> <span class="ruby-value">:LOSE</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">pl</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">co</span>
<span class="ruby-keyword">end</span></pre>
</div>
@@ -302,11 +300,11 @@
<div class="method-source-code" id="play-source">
- <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 58</span>
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 59</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">play</span>(<span class="ruby-identifier">winning_score</span>)
<span class="ruby-keyword">while</span> <span class="ruby-ivar">@player_score</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">winning_score</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@computer_score</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">winning_score</span>
<span class="ruby-identifier">puts</span> <span class="ruby-node">"\nPlayer score: #{@player_score}, "</span> <span class="ruby-operator">+</span>
<span class="ruby-node">"Computer score: #{@computer_score}, Ties: #{@ties}.\n"</span>
<span class="ruby-identifier">player</span> = <span class="ruby-identifier">player_choice</span>
@@ -365,11 +363,11 @@
<div class="method-source-code" id="player_choice-source">
- <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 92</span>
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 93</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">player_choice</span>
<span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
<span class="ruby-identifier">print</span> <span class="ruby-string">"\nChoose: Rock (r), Paper (p), or Scissors (s): "</span>
<span class="ruby-identifier">choice</span> = <span class="ruby-identifier">gets</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">downcase</span>
<span class="ruby-keyword">if</span> <span class="ruby-constant">NTRY_TO_SYM</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">choice</span>)
@@ -410,10 +408,10 @@
<div class="method-source-code" id="player_outcome-source">
- <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 108</span>
+ <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 109</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">player_outcome</span>(<span class="ruby-identifier">plays</span>)
<span class="ruby-keyword">return</span> <span class="ruby-value">:WIN</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">WINNERS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">plays</span>)
<span class="ruby-keyword">return</span> <span class="ruby-value">:LOSE</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">LOSERS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">plays</span>)
<span class="ruby-keyword">return</span> <span class="ruby-value">:TIE</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-value">:WIN</span> <span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-value">:LOSE</span>
<span class="ruby-keyword">end</span></pre>