doc/RockPaperScissors.html in RPSrb-0.1.2 vs doc/RockPaperScissors.html in RPSrb-0.1.3

- old
+ new

@@ -69,10 +69,12 @@ <div id="method-list-section" class="nav-section"> <h3>Methods</h3> <ul class="link-list" role="directory"> + <li ><a href="#method-c-continue">::continue</a> + <li ><a href="#method-c-new">::new</a> <li ><a href="#method-i-final_outcome">#final_outcome</a> <li ><a href="#method-i-play">#play</a> @@ -164,10 +166,48 @@ <header> <h3>Public Class Methods</h3> </header> + <div id="method-c-continue" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">continue</span><span + class="method-args">(str1,str2,str3)</span> + + <span class="method-click-advice">click to toggle source</span> + + </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">&para;</a> <a href="#top">&uarr;</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> +<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> +<span class="ruby-keyword">end</span></pre> + </div> + + </div> + + + + + </div> + + <div id="method-c-new" class="method-detail "> <div class="method-heading"> <span class="method-name">new</span><span class="method-args">()</span> @@ -183,11 +223,11 @@ <div class="method-source-code" id="new-source"> - <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 53</span> + <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 52</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> @@ -205,10 +245,46 @@ <header> <h3>Public Instance Methods</h3> </header> + <div id="method-i-final_outcome" class="method-detail "> + + <div class="method-heading"> + <span class="method-name">final_outcome</span><span + class="method-args">(pl, co)</span> + + <span class="method-click-advice">click to toggle source</span> + + </div> + + + <div class="method-description"> + + <h2 id="method-i-final_outcome-label-Define+final+outcome+function">Define final outcome function<span><a href="#method-i-final_outcome-label-Define+final+outcome+function">&para;</a> <a href="#top">&uarr;</a></span></h2> + +<p>this will determine who wins the whole match in the end</p> + + + + + <div class="method-source-code" id="final_outcome-source"> + <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 116</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">&gt;</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">&lt;</span> <span class="ruby-identifier">co</span> +<span class="ruby-keyword">end</span></pre> + </div> + + </div> + + + + + </div> + + <div id="method-i-play" class="method-detail "> <div class="method-heading"> <span class="method-name">play</span><span class="method-args">(winning_score)</span> @@ -220,18 +296,17 @@ <div class="method-description"> <h2 id="method-i-play-label-Define+play+game+method">Define play game method<span><a href="#method-i-play-label-Define+play+game+method">&para;</a> <a href="#top">&uarr;</a></span></h2> -<p>this method will be public it will also constain most of the “play” -functioonality for this game</p> +<p>it will also constain most of the “play” functioonality for this game</p> <div class="method-source-code" id="play-source"> - <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 61</span> + <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 58</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">&lt;</span> <span class="ruby-identifier">winning_score</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@computer_score</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">winning_score</span> <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\nPlayer score: #{@player_score}, &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-node">&quot;Computer score: #{@computer_score}, Ties: #{@ties}.\n&quot;</span> <span class="ruby-identifier">player</span> = <span class="ruby-identifier">player_choice</span> @@ -269,55 +344,10 @@ </div> - </section> - - <section id="protected-instance-5Buntitled-5D-method-details" class="method-section"> - <header> - <h3>Protected Instance Methods</h3> - </header> - - - <div id="method-i-final_outcome" class="method-detail "> - - <div class="method-heading"> - <span class="method-name">final_outcome</span><span - class="method-args">(pl, co)</span> - - <span class="method-click-advice">click to toggle source</span> - - </div> - - - <div class="method-description"> - - <h2 id="method-i-final_outcome-label-Define+final+outcome+function">Define final outcome function<span><a href="#method-i-final_outcome-label-Define+final+outcome+function">&para;</a> <a href="#top">&uarr;</a></span></h2> - -<p>this method is protected this will determine who wins the whole match in -the end</p> - - - - - <div class="method-source-code" id="final_outcome-source"> - <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 125</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">&gt;</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">&lt;</span> <span class="ruby-identifier">co</span> -<span class="ruby-keyword">end</span></pre> - </div> - - </div> - - - - - </div> - - <div id="method-i-player_choice" class="method-detail "> <div class="method-heading"> <span class="method-name">player_choice</span><span class="method-args">()</span> @@ -329,17 +359,17 @@ <div class="method-description"> <h2 id="method-i-player_choice-label-Make+player+choice+method">Make player choice method<span><a href="#method-i-player_choice-label-Make+player+choice+method">&para;</a> <a href="#top">&uarr;</a></span></h2> -<p>this method will be protected this will sanity check the user&#39;s choice</p> +<p>this will sanity check the user&#39;s choice</p> <div class="method-source-code" id="player_choice-source"> - <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 97</span> + <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 92</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">&quot;\nChoose: Rock (r), Paper (p), or Scissors (s): &quot;</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>) @@ -374,16 +404,16 @@ <div class="method-description"> <h2 id="method-i-player_outcome-label-Define+player+outcome">Define player outcome<span><a href="#method-i-player_outcome-label-Define+player+outcome">&para;</a> <a href="#top">&uarr;</a></span></h2> -<p>this method is protected this defines the round outcome of the game</p> +<p>this defines the round outcome of the game</p> <div class="method-source-code" id="player_outcome-source"> - <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 115</span> + <pre><span class="ruby-comment"># File lib/RockPaperScissors.rb, line 108</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>