rpsg 0.3.8 → 0.3.9
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 +4 -4
- data/doc/RockPaperScissorsGame.html +3 -3
- data/doc/created.rid +4 -4
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/docs/_pages/code.txt +2 -7
- data/docs/_site/bundler.html +1 -1
- data/docs/_site/code.html +3 -8
- data/docs/_site/index.html +1 -1
- data/docs/_site/install.html +1 -1
- data/docs/_site/readme.html +1 -1
- data/docs/_site/simple.html +1 -1
- data/docs/_site/test.html +1 -1
- data/docs/_site/uninstall.html +1 -1
- data/docs/_site/update.html +1 -1
- data/lib/Constants.rb +0 -5
- data/lib/Main.rb +2 -1
- data/lib/rpsg/version.rb +1 -1
- data/rpsg.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdadc690e76766a28edca57d221f5f5e5ffbea14
|
4
|
+
data.tar.gz: 573caea06a86c0922725efb01708a168dbcd74a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e4dcb5a95bf4aabecf2973c5816ffc120c2145e56fbcc4b9424d75d2c840ccb1ea90160cfc8d6b74a9249b4e253f2229460dac0a09c8829906b0f4a93658e5
|
7
|
+
data.tar.gz: bf2456dfe3454756678ceacc7b3659ae1d6b6ea1b0bfc0bf95ddacef1977488dffd72644cda2910ef5ff12e906351f75b8ed898bccf3598a15d4c5c30f4b2f54
|
@@ -133,7 +133,7 @@ scissors</p>
|
|
133
133
|
|
134
134
|
|
135
135
|
<div class="method-source-code" id="continue-source">
|
136
|
-
<pre><span class="ruby-comment"># File lib/Main.rb, line
|
136
|
+
<pre><span class="ruby-comment"># File lib/Main.rb, line 13</span>
|
137
137
|
<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>)
|
138
138
|
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">str1</span>
|
139
139
|
<span class="ruby-identifier">print</span> <span class="ruby-identifier">str2</span>
|
@@ -169,7 +169,7 @@ scissors</p>
|
|
169
169
|
|
170
170
|
|
171
171
|
<div class="method-source-code" id="new-source">
|
172
|
-
<pre><span class="ruby-comment"># File lib/Main.rb, line
|
172
|
+
<pre><span class="ruby-comment"># File lib/Main.rb, line 25</span>
|
173
173
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
|
174
174
|
<span class="ruby-comment"># initialize variables and set all equal to zero</span>
|
175
175
|
<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>
|
@@ -212,7 +212,7 @@ scissors</p>
|
|
212
212
|
|
213
213
|
|
214
214
|
<div class="method-source-code" id="play-source">
|
215
|
-
<pre><span class="ruby-comment"># File lib/Main.rb, line
|
215
|
+
<pre><span class="ruby-comment"># File lib/Main.rb, line 31</span>
|
216
216
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier">play</span>(<span class="ruby-identifier">winning_score</span>)
|
217
217
|
<span class="ruby-comment"># make while loop</span>
|
218
218
|
<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>
|
data/doc/created.rid
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
Sat, 28 Oct 2017 17:
|
2
|
-
lib/Constants.rb Sat, 28 Oct 2017
|
3
|
-
lib/Main.rb Sat, 28 Oct 2017
|
1
|
+
Sat, 28 Oct 2017 17:33:35 -0700
|
2
|
+
lib/Constants.rb Sat, 28 Oct 2017 17:32:30 -0700
|
3
|
+
lib/Main.rb Sat, 28 Oct 2017 17:32:37 -0700
|
4
4
|
lib/PrivateMethods.rb Sat, 28 Oct 2017 11:29:09 -0700
|
5
|
-
lib/rpsg/version.rb Sat, 28 Oct 2017 17:
|
5
|
+
lib/rpsg/version.rb Sat, 28 Oct 2017 17:32:42 -0700
|
data/doc/js/navigation.js.gz
CHANGED
Binary file
|
data/doc/js/search_index.js.gz
CHANGED
Binary file
|
data/doc/js/searcher.js.gz
CHANGED
Binary file
|
data/docs/_pages/code.txt
CHANGED
@@ -36,18 +36,16 @@ class RockPaperScissorsGame
|
|
36
36
|
# specify the version for the rubygem
|
37
37
|
module RPSG
|
38
38
|
# create version constant for the rubygem
|
39
|
-
VERSION = "0.3.
|
39
|
+
VERSION = "0.3.9"
|
40
40
|
end
|
41
41
|
|
42
42
|
# create module that holds all contents for this script
|
43
43
|
module ProtectedConstants
|
44
44
|
|
45
45
|
# create 2d list of choices
|
46
|
-
protected # make protected
|
47
46
|
CHOICES = [['r', 'rock'], ['p', 'paper'], ['s', 'scissors']]
|
48
47
|
|
49
48
|
# define entry to symbol (key to value) dictionary
|
50
|
-
protected # make protected
|
51
49
|
NTRY_TO_SYM = {
|
52
50
|
CHOICES[0][0] => :ROCK , CHOICES[0][1] => :ROCK ,
|
53
51
|
CHOICES[1][0] => :PAPER , CHOICES[1][1] => :PAPER ,
|
@@ -55,11 +53,9 @@ class RockPaperScissorsGame
|
|
55
53
|
}
|
56
54
|
|
57
55
|
# define valid entries
|
58
|
-
protected # make protected
|
59
56
|
VALID_ENTRIES = NTRY_TO_SYM.keys
|
60
57
|
|
61
58
|
# define computer choices
|
62
|
-
protected # make protected
|
63
59
|
COMPUTER_CHOICES = NTRY_TO_SYM.values
|
64
60
|
|
65
61
|
# create winners 2d list array with format: winning choice, losing choice
|
@@ -71,12 +67,11 @@ class RockPaperScissorsGame
|
|
71
67
|
]
|
72
68
|
|
73
69
|
# this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
|
74
|
-
protected # make protected
|
75
70
|
LOSERS = WINNERS.map { |winning_choice,losing_choice| [losing_choice,winning_choice] }
|
76
71
|
|
77
72
|
end
|
78
73
|
|
79
|
-
|
74
|
+
protected_methods :ProtectedConstants
|
80
75
|
|
81
76
|
class << self
|
82
77
|
# add continue method for asking the user if they want to play rock paper scissors
|
data/docs/_site/bundler.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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"/>
|
@@ -74,18 +74,16 @@
|
|
74
74
|
<span class="c1"># specify the version for the rubygem</span>
|
75
75
|
<span class="k">module</span> <span class="nn">RPSG</span>
|
76
76
|
<span class="c1"># create version constant for the rubygem</span>
|
77
|
-
<span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"0.3.
|
77
|
+
<span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"0.3.9"</span>
|
78
78
|
<span class="k">end</span>
|
79
79
|
|
80
80
|
<span class="c1"># create module that holds all contents for this script</span>
|
81
81
|
<span class="k">module</span> <span class="nn">ProtectedConstants</span>
|
82
82
|
|
83
83
|
<span class="c1"># create 2d list of choices</span>
|
84
|
-
<span class="kp">protected</span> <span class="c1"># make protected</span>
|
85
84
|
<span class="no">CHOICES</span> <span class="o">=</span> <span class="p">[[</span><span class="s1">'r'</span><span class="p">,</span> <span class="s1">'rock'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'p'</span><span class="p">,</span> <span class="s1">'paper'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'s'</span><span class="p">,</span> <span class="s1">'scissors'</span><span class="p">]]</span>
|
86
85
|
|
87
86
|
<span class="c1"># define entry to symbol (key to value) dictionary</span>
|
88
|
-
<span class="kp">protected</span> <span class="c1"># make protected</span>
|
89
87
|
<span class="no">NTRY_TO_SYM</span> <span class="o">=</span> <span class="p">{</span>
|
90
88
|
<span class="no">CHOICES</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=></span> <span class="ss">:ROCK</span> <span class="p">,</span> <span class="no">CHOICES</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=></span> <span class="ss">:ROCK</span> <span class="p">,</span>
|
91
89
|
<span class="no">CHOICES</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=></span> <span class="ss">:PAPER</span> <span class="p">,</span> <span class="no">CHOICES</span><span class="p">[</span><span class="mi">1</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">=></span> <span class="ss">:PAPER</span> <span class="p">,</span>
|
@@ -93,11 +91,9 @@
|
|
93
91
|
<span class="p">}</span>
|
94
92
|
|
95
93
|
<span class="c1"># define valid entries</span>
|
96
|
-
<span class="kp">protected</span> <span class="c1"># make protected</span>
|
97
94
|
<span class="no">VALID_ENTRIES</span> <span class="o">=</span> <span class="no">NTRY_TO_SYM</span><span class="p">.</span><span class="nf">keys</span>
|
98
95
|
|
99
96
|
<span class="c1"># define computer choices</span>
|
100
|
-
<span class="kp">protected</span> <span class="c1"># make protected</span>
|
101
97
|
<span class="no">COMPUTER_CHOICES</span> <span class="o">=</span> <span class="no">NTRY_TO_SYM</span><span class="p">.</span><span class="nf">values</span>
|
102
98
|
|
103
99
|
<span class="c1"># create winners 2d list array with format: winning choice, losing choice</span>
|
@@ -109,12 +105,11 @@
|
|
109
105
|
<span class="p">]</span>
|
110
106
|
|
111
107
|
<span class="c1"># this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player</span>
|
112
|
-
<span class="kp">protected</span> <span class="c1"># make protected</span>
|
113
108
|
<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">winning_choice</span><span class="p">,</span><span class="n">losing_choice</span><span class="o">|</span> <span class="p">[</span><span class="n">losing_choice</span><span class="p">,</span><span class="n">winning_choice</span><span class="p">]</span> <span class="p">}</span>
|
114
109
|
|
115
110
|
<span class="k">end</span>
|
116
111
|
|
117
|
-
<span class="
|
112
|
+
<span class="nb">protected_methods</span> <span class="ss">:ProtectedConstants</span>
|
118
113
|
|
119
114
|
<span class="k">class</span> <span class="o"><<</span> <span class="nb">self</span>
|
120
115
|
<span class="c1"># add continue method for asking the user if they want to play rock paper scissors</span>
|
data/docs/_site/index.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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/install.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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/readme.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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/simple.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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/test.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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/uninstall.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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/update.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=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=b38eec3e6fcf2e0b672ac1cb81d1d83c8d16d85d"/>
|
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/Constants.rb
CHANGED
@@ -2,11 +2,9 @@
|
|
2
2
|
module ProtectedConstants
|
3
3
|
|
4
4
|
# create 2d list of choices
|
5
|
-
protected # make protected
|
6
5
|
CHOICES = [['r', 'rock'], ['p', 'paper'], ['s', 'scissors']]
|
7
6
|
|
8
7
|
# define entry to symbol (key to value) dictionary
|
9
|
-
protected # make protected
|
10
8
|
NTRY_TO_SYM = {
|
11
9
|
CHOICES[0][0] => :ROCK , CHOICES[0][1] => :ROCK ,
|
12
10
|
CHOICES[1][0] => :PAPER , CHOICES[1][1] => :PAPER ,
|
@@ -14,11 +12,9 @@ module ProtectedConstants
|
|
14
12
|
}
|
15
13
|
|
16
14
|
# define valid entries
|
17
|
-
protected # make protected
|
18
15
|
VALID_ENTRIES = NTRY_TO_SYM.keys
|
19
16
|
|
20
17
|
# define computer choices
|
21
|
-
protected # make protected
|
22
18
|
COMPUTER_CHOICES = NTRY_TO_SYM.values
|
23
19
|
|
24
20
|
# create winners 2d list array with format: winning choice, losing choice
|
@@ -30,7 +26,6 @@ module ProtectedConstants
|
|
30
26
|
]
|
31
27
|
|
32
28
|
# this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
|
33
|
-
protected # make protected
|
34
29
|
LOSERS = WINNERS.map { |winning_choice,losing_choice| [losing_choice,winning_choice] }
|
35
30
|
|
36
31
|
end
|
data/lib/Main.rb
CHANGED
@@ -4,8 +4,9 @@ class RockPaperScissorsGame
|
|
4
4
|
require "rpsg/version.rb"
|
5
5
|
|
6
6
|
require "Constants.rb"
|
7
|
+
|
8
|
+
protected_methods :ProtectedConstants
|
7
9
|
|
8
|
-
# protected_methods :Constants
|
9
10
|
|
10
11
|
class << self
|
11
12
|
# add continue method for asking the user if they want to play rock paper scissors
|
data/lib/rpsg/version.rb
CHANGED
data/rpsg.gemspec
CHANGED