badcards 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89fc14a4fc5e0a46a7f8be3555bee622dd5d84df
4
- data.tar.gz: 5e225d4f3469c8d8b26c3009d4bc8db24c20da80
3
+ metadata.gz: 7cadcfcac73dbd3e230df74f605e784ce9e6676d
4
+ data.tar.gz: b809b76868941beea96fd610dc2a9537d3b459c2
5
5
  SHA512:
6
- metadata.gz: da6eb1534c4bf7a28623de6303f77f7ee17925ee0843f1793e7a8f88f89e17b237285eae1ac4da5bf9da47a6d09ca36dccffd44d8220e2ab6488a23e54a70cee
7
- data.tar.gz: 3002e00a023841691af2903c7f4275ea4009e3f5520353875a7e920866e93d0dd7e4ac0bd38cab6a5cae931b6732f84594a0c06bd6e7b7679cb750f9a001c3ed
6
+ metadata.gz: 3bbfcf32b2209ad685a24799d858658242bb37062cbc593c3a63bbaeb47e795a9233a60b50dc972f81e4eb112396b91e429fed7aba387cb5a5a4969f00c6bf5d
7
+ data.tar.gz: 5e80af7a7b1eb93e81861065475bd1c8f6b36ae1561554a29adb8ecbbfbe99c3a416989e7a3a7b114c79402de12fe829082763df82cc89fc438ae89ca718d687
@@ -24,7 +24,9 @@ class Deck
24
24
  end
25
25
  end
26
26
 
27
- def shuffle(num_times = 12)
27
+ # Defaults to seven 'rounds' of shuffling, determined to be the optimal value
28
+ # per Diaconis (http://en.wikipedia.org/wiki/Persi_Diaconis#Card_shuffling)
29
+ def shuffle(num_times = 7)
28
30
  num_times.times do
29
31
  @cards.each_with_index do |card, index|
30
32
  switch = rand(size)
@@ -1,3 +1,3 @@
1
1
  module Badcards
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -65,6 +65,12 @@ describe Deck do
65
65
  top_card = @deck.peek
66
66
  @deck.cards.count.should == @card_count
67
67
  end
68
+
69
+ it 'should return multiple cards when specified' do
70
+ num_to_peek = 5
71
+ top_cards = @deck.peek(num_to_peek)
72
+ top_cards.count.should == num_to_peek
73
+ end
68
74
  end
69
75
 
70
76
  describe 'single' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badcards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Hsieh, Ben's Potatoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-31 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler