PlayRockPaperScissorsGame 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78bf8c09ea90185dc255a22beed8d25a2b57f9af
4
- data.tar.gz: 68844fc512004f60ea5a08198cb0a8b8e5a1975f
3
+ metadata.gz: 6477f600cb00e3938eb3d7b49a3652ef75a6a42a
4
+ data.tar.gz: df1885d09eac8ec673d0596cb02e8621754ab11f
5
5
  SHA512:
6
- metadata.gz: bb0a377db9ce29649b72de91fd988cc22ccba2b105ad752554fe4ab550cd8eeb01711e4604f5982641c34324b61280c3d8fcca4a02ebf635a658a88243ca11f6
7
- data.tar.gz: ce88df6496da5e83df0d319d7d1f9fd5d0cb3fbfd2f2b6d449e3ad92a8890973635d37a60e720c97ec9ea72f1fc7503563a02debc04f63cc990dffff4d7c2e98
6
+ metadata.gz: 1a6a2aeb3e598ed4606caa7985ce2985aecbfe1adbc273ec2bf145628d6eb3fb0ab1b4587ece60490cf853af25266ac363dd78c23e22c9d8deafa800efb566a2
7
+ data.tar.gz: 1010d4bd35b358b2c0fe56c3dc64d1282e0dfc35e87bdad1904fc9edd429765383ac60462f5abf8bd3b0b118a31a6a4ff6f28a961ae5c2997d0c139fe9ca7487
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- 1
2
- NӋ�!"��λ�jg��f&��{�&"3x��y�P���ɠ��c��0���$��拭?X͂E$B������+��x^�U ����j>�愴绁u╊wnG�S�ԟ�H�),�M8,<|�#
1
+ ~E�Ю�=8����:�<^�|Y/ys��˸k%!q��2F)b-���S��-�ڶ��Ww̧��^�̀0$ c(Q����n���rM)�,"Lb<
2
+ ~�0<��������ҥ�hS�� ��;�����WAnWh ��Gс&"H��λ:���J=��w�Џ�ע��"N5C
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- �ą��T��跌e�0[�:�#= ��Z�{WuNB�=��M`3�ÿ4//#w�D�&{p��~�ə�� ���A��ʯ�A�x�Y\Y@�����3;ތtA�m��W�Rқ�˷��򐧵^�G{�D��Q��`4@�̲F> ���l?E�&��ܬ�o�[;�i�i��No ���mR�#~����R_P s�b\���ˏcׄd1Ȉ荹��>������_D�n"�q������f��|��X�|`�ɟ���y�O�C
1
+ ��N��)�%FP[��\���ę)���=��Z
data/Gemfile CHANGED
@@ -1,5 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- ruby '>= 2.0.0'
3
2
  platform :ruby do
4
3
  gemspec
5
4
  group :test do
data/docs/Code.md CHANGED
@@ -9,6 +9,11 @@ title: Master Code - Play Rock Paper Scissors Game
9
9
 
10
10
  **The master code will look like this:**
11
11
 
12
+ [//]: # (`$ rps`)
13
+ [//]: # (`> rps`)
14
+
15
+ __`% rps`__
16
+
12
17
  ```ruby
13
18
  #!/usr/bin/env ruby
14
19
 
@@ -24,7 +29,7 @@ title: Master Code - Play Rock Paper Scissors Game
24
29
  class PlayRockPaperScissorsGame # define master class
25
30
 
26
31
  module RockPaperScissors
27
- VERSION = "2.4.0" # define version constant
32
+ VERSION = "2.4.1" # define version constant
28
33
  end
29
34
 
30
35
  # intiate the colorize gem
@@ -43,8 +48,8 @@ class PlayRockPaperScissorsGame # define master class
43
48
  WINNERS = [ # define winners
44
49
  # format: player choice, computer choice
45
50
  [:SCISSORS, :PAPER],
46
- [:PAPER, :ROCK],
47
- [:ROCK, :SCISSORS]
51
+ [:PAPER , :ROCK],
52
+ [:ROCK , :SCISSORS]
48
53
  ]
49
54
  LOSERS = WINNERS.map { |wp,lp| [lp,wp] } # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
50
55
  INIT_STRINGS = [
@@ -56,7 +61,7 @@ class PlayRockPaperScissorsGame # define master class
56
61
 
57
62
  protected_methods :Constants # make the constants module protected
58
63
 
59
- class << self # define a self calling method in the parent class
64
+ class << self # define a self calling method within the parent class
60
65
  def continue(str1,str2,str3) # pass in 3 parameters
61
66
  puts ColorizedString[str1].colorize(:color => :green)
62
67
  print ColorizedString[str2].colorize(:color => :green)
@@ -129,7 +134,7 @@ class PlayRockPaperScissorsGame # define master class
129
134
  def player_outcome(plays) # define method for the player's outcome while passing in a parameter of type array
130
135
  return :WIN if Constants::WINNERS.include?(plays) # return a win if the one of the sub-arrays in the winners array is called
131
136
  return :LOSE if Constants::LOSERS.include?(plays) # return a loss if any of the mapped sub-arrays in the losers constant is present
132
- return :TIE if !:WIN | !:LOSE
137
+ return :TIE if !:WIN | !:LOSE # return a tie if not (!x) win or if not loose
133
138
  end
134
139
  def final_outcome(pl,co) # define final outcome method
135
140
  return :WIN if pl > co
@@ -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=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8ade7247dbbaa777a46e6b2b762a86575087bb4a">
11
11
  </head>
12
12
  <body>
13
13
  <section class="page-header">
@@ -15,7 +15,7 @@
15
15
  <h2 class="project-tagline">A Ruby Programmed Rock Paper Scissors Game</h2>
16
16
 
17
17
  <a href="http://github.com/bag3318/RockPaperScissors" class="btn">View on GitHub</a>
18
- <a href="http://github.com/bag3318/RockPaperScissors/issues" class="btn">Report a Bug</a>
18
+ <a href="" class="btn">Report a Bug</a>
19
19
 
20
20
 
21
21
  <a href="http://github.com/bag3318/RockPaperScissors/zipball/gh-pages" class="btn">Download .zip</a>
@@ -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=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8ade7247dbbaa777a46e6b2b762a86575087bb4a">
11
11
  </head>
12
12
  <body>
13
13
  <section class="page-header">
@@ -15,7 +15,7 @@
15
15
  <h2 class="project-tagline">A Ruby Programmed Rock Paper Scissors Game</h2>
16
16
 
17
17
  <a href="http://github.com/bag3318/RockPaperScissors" class="btn">View on GitHub</a>
18
- <a href="http://github.com/bag3318/RockPaperScissors/issues" class="btn">Report a Bug</a>
18
+ <a href="" class="btn">Report a Bug</a>
19
19
 
20
20
 
21
21
  <a href="http://github.com/bag3318/RockPaperScissors/zipball/gh-pages" class="btn">Download .zip</a>
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=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8ade7247dbbaa777a46e6b2b762a86575087bb4a">
11
11
  </head>
12
12
  <body>
13
13
  <section class="page-header">
@@ -15,7 +15,7 @@
15
15
  <h2 class="project-tagline">A Ruby Programmed Rock Paper Scissors Game</h2>
16
16
 
17
17
  <a href="http://github.com/bag3318/RockPaperScissors" class="btn">View on GitHub</a>
18
- <a href="http://github.com/bag3318/RockPaperScissors/issues" class="btn">Report a Bug</a>
18
+ <a href="" class="btn">Report a Bug</a>
19
19
 
20
20
 
21
21
  <a href="http://github.com/bag3318/RockPaperScissors/zipball/gh-pages" class="btn">Download .zip</a>
@@ -36,6 +36,8 @@
36
36
 
37
37
  <p><strong>The master code will look like this:</strong></p>
38
38
 
39
+ <p><strong><code class="highlighter-rouge">% rps</code></strong></p>
40
+
39
41
  <div class="language-ruby highlighter-rouge"><pre class="highlight"><code><span class="c1">#!/usr/bin/env ruby</span>
40
42
 
41
43
  <span class="cm">=begin
@@ -50,7 +52,7 @@
50
52
  <span class="k">class</span> <span class="nc">PlayRockPaperScissorsGame</span> <span class="c1"># define master class</span>
51
53
 
52
54
  <span class="k">module</span> <span class="nn">RockPaperScissors</span>
53
- <span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"2.4.0"</span> <span class="c1"># define version constant</span>
55
+ <span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"2.4.1"</span> <span class="c1"># define version constant</span>
54
56
  <span class="k">end</span>
55
57
 
56
58
  <span class="c1"># intiate the colorize gem</span>
@@ -69,8 +71,8 @@
69
71
  <span class="no">WINNERS</span> <span class="o">=</span> <span class="p">[</span> <span class="c1"># define winners</span>
70
72
  <span class="c1"># format: player choice, computer choice</span>
71
73
  <span class="p">[</span><span class="ss">:SCISSORS</span><span class="p">,</span> <span class="ss">:PAPER</span><span class="p">],</span>
72
- <span class="p">[</span><span class="ss">:PAPER</span><span class="p">,</span> <span class="ss">:ROCK</span><span class="p">],</span>
73
- <span class="p">[</span><span class="ss">:ROCK</span><span class="p">,</span> <span class="ss">:SCISSORS</span><span class="p">]</span>
74
+ <span class="p">[</span><span class="ss">:PAPER</span> <span class="p">,</span> <span class="ss">:ROCK</span><span class="p">],</span>
75
+ <span class="p">[</span><span class="ss">:ROCK</span> <span class="p">,</span> <span class="ss">:SCISSORS</span><span class="p">]</span>
74
76
  <span class="p">]</span>
75
77
  <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">wp</span><span class="p">,</span><span class="n">lp</span><span class="o">|</span> <span class="p">[</span><span class="n">lp</span><span class="p">,</span><span class="n">wp</span><span class="p">]</span> <span class="p">}</span> <span class="c1"># this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player</span>
76
78
  <span class="no">INIT_STRINGS</span> <span class="o">=</span> <span class="p">[</span>
@@ -82,7 +84,7 @@
82
84
 
83
85
  <span class="nb">protected_methods</span> <span class="ss">:Constants</span> <span class="c1"># make the constants module protected</span>
84
86
 
85
- <span class="k">class</span> <span class="o">&lt;&lt;</span> <span class="nb">self</span> <span class="c1"># define a self calling method in the parent class</span>
87
+ <span class="k">class</span> <span class="o">&lt;&lt;</span> <span class="nb">self</span> <span class="c1"># define a self calling method within the parent class</span>
86
88
  <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> <span class="c1"># pass in 3 parameters</span>
87
89
  <span class="nb">puts</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="n">str1</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:color</span> <span class="o">=&gt;</span> <span class="ss">:green</span><span class="p">)</span>
88
90
  <span class="nb">print</span> <span class="no">ColorizedString</span><span class="p">[</span><span class="n">str2</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:color</span> <span class="o">=&gt;</span> <span class="ss">:green</span><span class="p">)</span>
@@ -155,7 +157,7 @@
155
157
  <span class="k">def</span> <span class="nf">player_outcome</span><span class="p">(</span><span class="n">plays</span><span class="p">)</span> <span class="c1"># define method for the player's outcome while passing in a parameter of type array</span>
156
158
  <span class="k">return</span> <span class="ss">:WIN</span> <span class="k">if</span> <span class="no">Constants</span><span class="o">::</span><span class="no">WINNERS</span><span class="p">.</span><span class="nf">include?</span><span class="p">(</span><span class="n">plays</span><span class="p">)</span> <span class="c1"># return a win if the one of the sub-arrays in the winners array is called</span>
157
159
  <span class="k">return</span> <span class="ss">:LOSE</span> <span class="k">if</span> <span class="no">Constants</span><span class="o">::</span><span class="no">LOSERS</span><span class="p">.</span><span class="nf">include?</span><span class="p">(</span><span class="n">plays</span><span class="p">)</span> <span class="c1"># return a loss if any of the mapped sub-arrays in the losers constant is present</span>
158
- <span class="k">return</span> <span class="ss">:TIE</span> <span class="k">if</span> <span class="o">!</span><span class="ss">:WIN</span> <span class="o">|</span> <span class="o">!</span><span class="ss">:LOSE</span>
160
+ <span class="k">return</span> <span class="ss">:TIE</span> <span class="k">if</span> <span class="o">!</span><span class="ss">:WIN</span> <span class="o">|</span> <span class="o">!</span><span class="ss">:LOSE</span> <span class="c1"># return a tie if not (!x) win or if not loose</span>
159
161
  <span class="k">end</span>
160
162
  <span class="k">def</span> <span class="nf">final_outcome</span><span class="p">(</span><span class="n">pl</span><span class="p">,</span><span class="n">co</span><span class="p">)</span> <span class="c1"># define final outcome method</span>
161
163
  <span class="k">return</span> <span class="ss">:WIN</span> <span class="k">if</span> <span class="n">pl</span> <span class="o">&gt;</span> <span class="n">co</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=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8ade7247dbbaa777a46e6b2b762a86575087bb4a">
11
11
  </head>
12
12
  <body>
13
13
  <section class="page-header">
@@ -15,7 +15,7 @@
15
15
  <h2 class="project-tagline">A Ruby Programmed Rock Paper Scissors Game</h2>
16
16
 
17
17
  <a href="http://github.com/bag3318/RockPaperScissors" class="btn">View on GitHub</a>
18
- <a href="http://github.com/bag3318/RockPaperScissors/issues" class="btn">Report a Bug</a>
18
+ <a href="" class="btn">Report a Bug</a>
19
19
 
20
20
 
21
21
  <a href="http://github.com/bag3318/RockPaperScissors/zipball/gh-pages" class="btn">Download .zip</a>
@@ -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=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8ade7247dbbaa777a46e6b2b762a86575087bb4a">
11
11
  </head>
12
12
  <body>
13
13
  <section class="page-header">
@@ -15,7 +15,7 @@
15
15
  <h2 class="project-tagline">A Ruby Programmed Rock Paper Scissors Game</h2>
16
16
 
17
17
  <a href="http://github.com/bag3318/RockPaperScissors" class="btn">View on GitHub</a>
18
- <a href="http://github.com/bag3318/RockPaperScissors/issues" class="btn">Report a Bug</a>
18
+ <a href="" class="btn">Report a Bug</a>
19
19
 
20
20
 
21
21
  <a href="http://github.com/bag3318/RockPaperScissors/zipball/gh-pages" class="btn">Download .zip</a>
@@ -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=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
10
+ <link rel="stylesheet" href="/assets/css/style.css?v=8ade7247dbbaa777a46e6b2b762a86575087bb4a">
11
11
  </head>
12
12
  <body>
13
13
  <section class="page-header">
@@ -15,7 +15,7 @@
15
15
  <h2 class="project-tagline">A Ruby Programmed Rock Paper Scissors Game</h2>
16
16
 
17
17
  <a href="http://github.com/bag3318/RockPaperScissors" class="btn">View on GitHub</a>
18
- <a href="http://github.com/bag3318/RockPaperScissors/issues" class="btn">Report a Bug</a>
18
+ <a href="" class="btn">Report a Bug</a>
19
19
 
20
20
 
21
21
  <a href="http://github.com/bag3318/RockPaperScissors/zipball/gh-pages" class="btn">Download .zip</a>
data/lib/rps/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RockPaperScissors
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
data/rps.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "PlayRockPaperScissorsGame"
3
- spec.version = "2.4.0"
3
+ spec.version = "2.4.1"
4
4
  spec.date = "2017-04-05"
5
5
  spec.summary = "A Rock Paper Scissors Ruby Gem"
6
6
  spec.description = <<-EOF
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.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - bag3318
metadata.gz.sig CHANGED
Binary file