game_shuffle_cards 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +10 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +123 -0
  6. data/Rakefile +2 -0
  7. data/doc/GameShuffleCards/Card.html +622 -0
  8. data/doc/GameShuffleCards/Game.html +1094 -0
  9. data/doc/GameShuffleCards/NotEnoughCardsPerPlayersError.html +123 -0
  10. data/doc/GameShuffleCards/NotEnoughPlayersError.html +123 -0
  11. data/doc/GameShuffleCards/ToManyCardsPerPlayerError.html +123 -0
  12. data/doc/GameShuffleCards/ToManyPlayersError.html +123 -0
  13. data/doc/GameShuffleCards/TooManyCardsDemandedError.html +123 -0
  14. data/doc/GameShuffleCards/ValidateGame.html +438 -0
  15. data/doc/GameShuffleCards.html +129 -0
  16. data/doc/_index.html +198 -0
  17. data/doc/class_list.html +58 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +57 -0
  20. data/doc/css/style.css +339 -0
  21. data/doc/file.README.html +196 -0
  22. data/doc/file_list.html +60 -0
  23. data/doc/frames.html +26 -0
  24. data/doc/index.html +196 -0
  25. data/doc/js/app.js +219 -0
  26. data/doc/js/full_list.js +181 -0
  27. data/doc/js/jquery.js +4 -0
  28. data/doc/method_list.html +159 -0
  29. data/doc/top-level-namespace.html +131 -0
  30. data/features/deck_of_cards.feature +58 -0
  31. data/features/initial_settings.feature +76 -0
  32. data/features/step_definitions/deck_of_cards_step.rb +21 -0
  33. data/features/step_definitions/initial_settings_step.rb +44 -0
  34. data/features/step_definitions/step.rb +2 -0
  35. data/game_shuffle_cards.gemspec +24 -0
  36. data/lib/game_shuffle_cards/card.rb +26 -0
  37. data/lib/game_shuffle_cards/exceptions.rb +9 -0
  38. data/lib/game_shuffle_cards/game.rb +84 -0
  39. data/lib/game_shuffle_cards/validate_game.rb +43 -0
  40. data/lib/game_shuffle_cards/version.rb +5 -0
  41. data/lib/game_shuffle_cards.rb +2 -0
  42. metadata +119 -0
@@ -0,0 +1,196 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>
7
+ File: README
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!file.README.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+ <span class="title">File: README</span>
36
+
37
+
38
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
+ </div>
40
+
41
+ <div id="search">
42
+
43
+ <a class="full_list_link" id="class_list_link"
44
+ href="class_list.html">
45
+ Class List
46
+ </a>
47
+
48
+ <a class="full_list_link" id="method_list_link"
49
+ href="method_list.html">
50
+ Method List
51
+ </a>
52
+
53
+ <a class="full_list_link" id="file_list_link"
54
+ href="file_list.html">
55
+ File List
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame"></iframe>
63
+
64
+ <div id="content"><div id='filecontents'><h1>GameShuffleCards</h1>
65
+
66
+ <p>A Game to shuffle a deck of cards and presents the result
67
+ With the class Game you can handle a deck of cards and setting the players and the cards per player. And shuffle the deak of cards.</p>
68
+
69
+ <h2>Installation</h2>
70
+
71
+ <p>Add this line to your application&#39;s Gemfile:</p>
72
+
73
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>game_shuffle_cards</span><span class='tstring_end'>&#39;</span></span>
74
+ </code></pre>
75
+
76
+ <p>And then execute:</p>
77
+
78
+ <pre class="code ruby"><code class="ruby">$ bundle
79
+ </code></pre>
80
+
81
+ <p>Or install it yourself as:</p>
82
+
83
+ <pre class="code ruby"><code class="ruby">$ gem install game_shuffle_cards
84
+ </code></pre>
85
+
86
+ <h2>Usage</h2>
87
+
88
+ <pre class="code ruby"><code class="ruby"><span class='comment'># create a new game with 5 players and 3 cards per player
89
+ </span><span class='id identifier rubyid_game'>game</span> <span class='op'>=</span> <span class='const'>Game</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span><span class='int'>3</span><span class='rparen'>)</span>
90
+ <span class='comment'># to shuffle a deck of cards , 3 cards per player , to 5 players
91
+ </span><span class='id identifier rubyid_game'>game</span><span class='period'>.</span><span class='id identifier rubyid_results'>results</span>
92
+
93
+ <span class='lbrace'>{</span><span class='int'>0</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>8 of spades</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Q of clubs</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>5 of diamonds</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>3 of hearts</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>9 of spades</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>5 of clubs</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>9 of clubs</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>J of clubs</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rbrace'>}</span>
94
+ </code></pre>
95
+
96
+ <p>If you repeat the <code>game.result</code> the deck will go emptying</p>
97
+
98
+ <pre class="code bash"><code class="bash">2.2.0 :003 &gt; g.results
99
+ =&gt; {0=&gt;[&quot;8 of spades&quot;, &quot;Q of clubs&quot;, &quot;5 of diamonds&quot;, &quot;3 of hearts&quot;], 1=&gt;[&quot;9 of spades&quot;, &quot;5 of clubs&quot;, &quot;9 of clubs&quot;, &quot;J of clubs&quot;]}
100
+ 2.2.0 :004 &gt; g.results
101
+ =&gt; {0=&gt;[&quot;10 of clubs&quot;, &quot;A of clubs&quot;, &quot;5 of hearts&quot;, &quot;4 of spades&quot;], 1=&gt;[&quot;Q of diamonds&quot;, &quot;2 of hearts&quot;, &quot;3 of spades&quot;, &quot;8 of clubs&quot;]}
102
+ 2.2.0 :005 &gt; g.results
103
+ =&gt; {0=&gt;[&quot;6 of clubs&quot;, &quot;A of diamonds&quot;, &quot;10 of diamonds&quot;, &quot;J of hearts&quot;], 1=&gt;[&quot;7 of spades&quot;, &quot;8 of hearts&quot;, &quot;K of diamonds&quot;, &quot;4 of clubs&quot;]}
104
+ 2.2.0 :006 &gt; g.results
105
+ =&gt; {0=&gt;[&quot;Q of hearts&quot;, &quot;7 of diamonds&quot;, &quot;9 of hearts&quot;, &quot;10 of hearts&quot;], 1=&gt;[&quot;2 of clubs&quot;, &quot;4 of hearts&quot;, &quot;4 of diamonds&quot;, &quot;7 of clubs&quot;]}
106
+ 2.2.0 :007 &gt; g.results
107
+ =&gt; {0=&gt;[&quot;5 of spades&quot;, &quot;J of spades&quot;, &quot;9 of diamonds&quot;, &quot;10 of spades&quot;], 1=&gt;[&quot;2 of diamonds&quot;, &quot;A of hearts&quot;, &quot;K of clubs&quot;, &quot;3 of diamonds&quot;]}
108
+ 2.2.0 :008 &gt; g.results
109
+ =&gt; {0=&gt;[&quot;2 of spades&quot;, &quot;6 of diamonds&quot;, &quot;6 of spades&quot;, &quot;K of hearts&quot;], 1=&gt;[&quot;A of spades&quot;, &quot;3 of clubs&quot;, &quot;8 of diamonds&quot;, &quot;K of spades&quot;]}
110
+ 2.2.0 :009 &gt; g.results
111
+ =&gt; {0=&gt;[&quot;J of diamonds&quot;, &quot;7 of hearts&quot;, &quot;Q of spades&quot;, &quot;6 of hearts&quot;], 1=&gt;[]}
112
+ 2.2.0 :010 &gt; g.results
113
+ =&gt; {0=&gt;[], 1=&gt;[]}
114
+ </code></pre>
115
+
116
+ <p>If you want to repeat the operation with the same deck, you could instantiate an object again</p>
117
+
118
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_game'>game</span> <span class='op'>=</span> <span class='const'>Game</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
119
+ </code></pre>
120
+
121
+ <p>And the deck will be full again.</p>
122
+
123
+ <p>The deck has defined in class Game the constants you can change it to another type of deck.
124
+ By default there are 52 cards: 4 suits and 13 values, they are
125
+ |A of clubs |
126
+ |2 of clubs |
127
+ |3 of clubs |
128
+ |4 of clubs |
129
+ |5 of clubs |
130
+ |6 of clubs |
131
+ |7 of clubs |
132
+ |8 of clubs |
133
+ |9 of clubs |
134
+ |10 of clubs |
135
+ |J of clubs |
136
+ |K of clubs |
137
+ |Q of clubs |
138
+ |A of hearts |
139
+ |2 of hearts |
140
+ |3 of hearts |
141
+ |4 of hearts |
142
+ |5 of hearts |
143
+ |6 of hearts |
144
+ |7 of hearts |
145
+ |8 of hearts |
146
+ |9 of hearts |
147
+ |10 of hearts |
148
+ |J of hearts |
149
+ |K of hearts |
150
+ |Q of hearts |
151
+ |A of spades |
152
+ |2 of spades |
153
+ |3 of spades |
154
+ |4 of spades |
155
+ |5 of spades |
156
+ |6 of spades |
157
+ |7 of spades |
158
+ |8 of spades |
159
+ |9 of spades |
160
+ |10 of spades |
161
+ |J of spades |
162
+ |K of spades |
163
+ |Q of spades |
164
+ |A of diamonds |
165
+ |2 of diamonds |
166
+ |3 of diamonds |
167
+ |4 of diamonds |
168
+ |5 of diamonds |
169
+ |6 of diamonds |
170
+ |7 of diamonds |
171
+ |8 of diamonds |
172
+ |9 of diamonds |
173
+ |10 of diamonds |
174
+ |J of diamonds |
175
+ |K of diamonds |
176
+ |Q of diamonds |</p>
177
+
178
+ <h2>Contributing</h2>
179
+
180
+ <ol>
181
+ <li>Fork it ( <a href="https://github.com/diegopiccinini/game_shuffle_cards/fork">https://github.com/diegopiccinini/game_shuffle_cards/fork</a> )</li>
182
+ <li>Create your feature branch (<code>git checkout -b my-new-feature</code>)</li>
183
+ <li>Commit your changes (<code>git commit -am &#39;Add some feature&#39;</code>)</li>
184
+ <li>Push to the branch (<code>git push origin my-new-feature</code>)</li>
185
+ <li>Create a new Pull Request</li>
186
+ </ol>
187
+ </div></div>
188
+
189
+ <div id="footer">
190
+ Generated on Thu Apr 2 16:38:00 2015 by
191
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
192
+ 0.8.7.6 (ruby-2.2.0).
193
+ </div>
194
+
195
+ </body>
196
+ </html>
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
18
+ <title>File List</title>
19
+ <base id="base_target" target="_parent" />
20
+ </head>
21
+ <body>
22
+ <script type="text/javascript" charset="utf-8">
23
+ var hasFrames = false;
24
+ try {
25
+ hasFrames = window.top.frames.main ? true : false;
26
+ } catch (e) { }
27
+ if (hasFrames) {
28
+ document.getElementById('base_target').target = 'main';
29
+ document.body.className = 'frames';
30
+ }
31
+ </script>
32
+ <div id="content">
33
+ <h1 id="full_list_header">File List</h1>
34
+ <div id="nav">
35
+
36
+ <span><a target="_self" href="class_list.html">
37
+ Classes
38
+ </a></span>
39
+
40
+ <span><a target="_self" href="method_list.html">
41
+ Methods
42
+ </a></span>
43
+
44
+ <span><a target="_self" href="file_list.html">
45
+ Files
46
+ </a></span>
47
+
48
+ </div>
49
+ <div id="search">Search: <input type="text" /></div>
50
+
51
+ <ul id="full_list" class="file">
52
+
53
+
54
+ <li class="r1"><span class="object_link"><a href="index.html" title="README">README</a></a></li>
55
+
56
+
57
+ </ul>
58
+ </div>
59
+ </body>
60
+ </html>
data/doc/frames.html ADDED
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+ <title>Documentation by YARD 0.8.7.6</title>
8
+ </head>
9
+ <script type="text/javascript" charset="utf-8">
10
+ window.onload = function() {
11
+ var match = unescape(window.location.hash).match(/^#!(.+)/);
12
+ var name = match ? match[1] : 'index.html';
13
+ name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
14
+ document.writeln('<frameset cols="20%,*">' +
15
+ '<frame name="list" src="class_list.html" />' +
16
+ '<frame name="main" src="' + escape(name) + '" />' +
17
+ '</frameset>');
18
+ }
19
+ </script>
20
+ <noscript>
21
+ <frameset cols="20%,*">
22
+ <frame name="list" src="class_list.html" />
23
+ <frame name="main" src="index.html" />
24
+ </frameset>
25
+ </noscript>
26
+ </html>
data/doc/index.html ADDED
@@ -0,0 +1,196 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>
7
+ File: README
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!file.README.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+ <span class="title">File: README</span>
36
+
37
+
38
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
+ </div>
40
+
41
+ <div id="search">
42
+
43
+ <a class="full_list_link" id="class_list_link"
44
+ href="class_list.html">
45
+ Class List
46
+ </a>
47
+
48
+ <a class="full_list_link" id="method_list_link"
49
+ href="method_list.html">
50
+ Method List
51
+ </a>
52
+
53
+ <a class="full_list_link" id="file_list_link"
54
+ href="file_list.html">
55
+ File List
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame"></iframe>
63
+
64
+ <div id="content"><div id='filecontents'><h1>GameShuffleCards</h1>
65
+
66
+ <p>A Game to shuffle a deck of cards and presents the result
67
+ With the class Game you can handle a deck of cards and setting the players and the cards per player. And shuffle the deak of cards.</p>
68
+
69
+ <h2>Installation</h2>
70
+
71
+ <p>Add this line to your application&#39;s Gemfile:</p>
72
+
73
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>game_shuffle_cards</span><span class='tstring_end'>&#39;</span></span>
74
+ </code></pre>
75
+
76
+ <p>And then execute:</p>
77
+
78
+ <pre class="code ruby"><code class="ruby">$ bundle
79
+ </code></pre>
80
+
81
+ <p>Or install it yourself as:</p>
82
+
83
+ <pre class="code ruby"><code class="ruby">$ gem install game_shuffle_cards
84
+ </code></pre>
85
+
86
+ <h2>Usage</h2>
87
+
88
+ <pre class="code ruby"><code class="ruby"><span class='comment'># create a new game with 5 players and 3 cards per player
89
+ </span><span class='id identifier rubyid_game'>game</span> <span class='op'>=</span> <span class='const'>Game</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>5</span><span class='comma'>,</span><span class='int'>3</span><span class='rparen'>)</span>
90
+ <span class='comment'># to shuffle a deck of cards , 3 cards per player , to 5 players
91
+ </span><span class='id identifier rubyid_game'>game</span><span class='period'>.</span><span class='id identifier rubyid_results'>results</span>
92
+
93
+ <span class='lbrace'>{</span><span class='int'>0</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>8 of spades</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Q of clubs</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>5 of diamonds</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>3 of hearts</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='int'>1</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>9 of spades</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>5 of clubs</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>9 of clubs</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>J of clubs</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='rbrace'>}</span>
94
+ </code></pre>
95
+
96
+ <p>If you repeat the <code>game.result</code> the deck will go emptying</p>
97
+
98
+ <pre class="code bash"><code class="bash">2.2.0 :003 &gt; g.results
99
+ =&gt; {0=&gt;[&quot;8 of spades&quot;, &quot;Q of clubs&quot;, &quot;5 of diamonds&quot;, &quot;3 of hearts&quot;], 1=&gt;[&quot;9 of spades&quot;, &quot;5 of clubs&quot;, &quot;9 of clubs&quot;, &quot;J of clubs&quot;]}
100
+ 2.2.0 :004 &gt; g.results
101
+ =&gt; {0=&gt;[&quot;10 of clubs&quot;, &quot;A of clubs&quot;, &quot;5 of hearts&quot;, &quot;4 of spades&quot;], 1=&gt;[&quot;Q of diamonds&quot;, &quot;2 of hearts&quot;, &quot;3 of spades&quot;, &quot;8 of clubs&quot;]}
102
+ 2.2.0 :005 &gt; g.results
103
+ =&gt; {0=&gt;[&quot;6 of clubs&quot;, &quot;A of diamonds&quot;, &quot;10 of diamonds&quot;, &quot;J of hearts&quot;], 1=&gt;[&quot;7 of spades&quot;, &quot;8 of hearts&quot;, &quot;K of diamonds&quot;, &quot;4 of clubs&quot;]}
104
+ 2.2.0 :006 &gt; g.results
105
+ =&gt; {0=&gt;[&quot;Q of hearts&quot;, &quot;7 of diamonds&quot;, &quot;9 of hearts&quot;, &quot;10 of hearts&quot;], 1=&gt;[&quot;2 of clubs&quot;, &quot;4 of hearts&quot;, &quot;4 of diamonds&quot;, &quot;7 of clubs&quot;]}
106
+ 2.2.0 :007 &gt; g.results
107
+ =&gt; {0=&gt;[&quot;5 of spades&quot;, &quot;J of spades&quot;, &quot;9 of diamonds&quot;, &quot;10 of spades&quot;], 1=&gt;[&quot;2 of diamonds&quot;, &quot;A of hearts&quot;, &quot;K of clubs&quot;, &quot;3 of diamonds&quot;]}
108
+ 2.2.0 :008 &gt; g.results
109
+ =&gt; {0=&gt;[&quot;2 of spades&quot;, &quot;6 of diamonds&quot;, &quot;6 of spades&quot;, &quot;K of hearts&quot;], 1=&gt;[&quot;A of spades&quot;, &quot;3 of clubs&quot;, &quot;8 of diamonds&quot;, &quot;K of spades&quot;]}
110
+ 2.2.0 :009 &gt; g.results
111
+ =&gt; {0=&gt;[&quot;J of diamonds&quot;, &quot;7 of hearts&quot;, &quot;Q of spades&quot;, &quot;6 of hearts&quot;], 1=&gt;[]}
112
+ 2.2.0 :010 &gt; g.results
113
+ =&gt; {0=&gt;[], 1=&gt;[]}
114
+ </code></pre>
115
+
116
+ <p>If you want to repeat the operation with the same deck, you could instantiate an object again</p>
117
+
118
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_game'>game</span> <span class='op'>=</span> <span class='const'>Game</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
119
+ </code></pre>
120
+
121
+ <p>And the deck will be full again.</p>
122
+
123
+ <p>The deck has defined in class Game the constants you can change it to another type of deck.
124
+ By default there are 52 cards: 4 suits and 13 values, they are
125
+ |A of clubs |
126
+ |2 of clubs |
127
+ |3 of clubs |
128
+ |4 of clubs |
129
+ |5 of clubs |
130
+ |6 of clubs |
131
+ |7 of clubs |
132
+ |8 of clubs |
133
+ |9 of clubs |
134
+ |10 of clubs |
135
+ |J of clubs |
136
+ |K of clubs |
137
+ |Q of clubs |
138
+ |A of hearts |
139
+ |2 of hearts |
140
+ |3 of hearts |
141
+ |4 of hearts |
142
+ |5 of hearts |
143
+ |6 of hearts |
144
+ |7 of hearts |
145
+ |8 of hearts |
146
+ |9 of hearts |
147
+ |10 of hearts |
148
+ |J of hearts |
149
+ |K of hearts |
150
+ |Q of hearts |
151
+ |A of spades |
152
+ |2 of spades |
153
+ |3 of spades |
154
+ |4 of spades |
155
+ |5 of spades |
156
+ |6 of spades |
157
+ |7 of spades |
158
+ |8 of spades |
159
+ |9 of spades |
160
+ |10 of spades |
161
+ |J of spades |
162
+ |K of spades |
163
+ |Q of spades |
164
+ |A of diamonds |
165
+ |2 of diamonds |
166
+ |3 of diamonds |
167
+ |4 of diamonds |
168
+ |5 of diamonds |
169
+ |6 of diamonds |
170
+ |7 of diamonds |
171
+ |8 of diamonds |
172
+ |9 of diamonds |
173
+ |10 of diamonds |
174
+ |J of diamonds |
175
+ |K of diamonds |
176
+ |Q of diamonds |</p>
177
+
178
+ <h2>Contributing</h2>
179
+
180
+ <ol>
181
+ <li>Fork it ( <a href="https://github.com/diegopiccinini/game_shuffle_cards/fork">https://github.com/diegopiccinini/game_shuffle_cards/fork</a> )</li>
182
+ <li>Create your feature branch (<code>git checkout -b my-new-feature</code>)</li>
183
+ <li>Commit your changes (<code>git commit -am &#39;Add some feature&#39;</code>)</li>
184
+ <li>Push to the branch (<code>git push origin my-new-feature</code>)</li>
185
+ <li>Create a new Pull Request</li>
186
+ </ol>
187
+ </div></div>
188
+
189
+ <div id="footer">
190
+ Generated on Thu Apr 2 16:38:00 2015 by
191
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
192
+ 0.8.7.6 (ruby-2.2.0).
193
+ </div>
194
+
195
+ </body>
196
+ </html>