deckcrystel 1.0 → 1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/deckcrystel.rb +53 -0
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '037186f018366a70ac2500a21244c347769a0289f50b3f90391cd91c7f8b14e3'
4
- data.tar.gz: 4e7884eafc79cc864a083da9e6005bb2d2cfc76852b258affcedd9536e84488c
3
+ metadata.gz: d26abd475662cf83b26ae103158de2a449d6edc97a48279dbca9135e1d3e4628
4
+ data.tar.gz: 3d2743bdd5e9b4bfb5d85222ff5863a2414d5de546c5f40beedbd9966a3d774b
5
5
  SHA512:
6
- metadata.gz: a6e2685d88e56752863624fc79149bb7fa6406763af431aafc621b8b3216e18339e6a87e8dab17d0565baf66ce255dd6fe590e91ca844ed4da46b36ac64d9905
7
- data.tar.gz: fd12a01ba9bc2e8863cde5b22286249a4d049ee7dd6d733aaddd24362a5d7703b1943e1b91b18d081abba8599266fea6f1077b464c44a65ec4fca9f95806b146
6
+ metadata.gz: fdacc82314c13db1dd46a205ad91c0c556ebf35e33b0107a5176ad5d033d8c0e56c73f606881ea52bb47341fb800215777a0e0964c2d71cad7b5e2a58daa7ea2
7
+ data.tar.gz: 408d9056cfcd2811890da7c5c06459e84477585b94b2b9dac3e599dfc0d0ab43cb075baa227cf3596c89a09a5be46f786a6a2624edab57afcb718757d7a08eb4
@@ -56,6 +56,19 @@ class Deck
56
56
  def deal_in
57
57
  combine
58
58
  end
59
+ def group_no(group, top_no, place, placein=1)
60
+ if (1..@groups.length).include?(place)
61
+ @groups[place-1].insert(placein-1, @groups[group-1][0...top_no]).flatten!
62
+ @groups[group-1][0...top_no].each do |card|
63
+ @groups[group-1].delete(card)
64
+ end
65
+ else
66
+ @position.insert(placein-1, @groups[group-1][0...top_no]).flatten!
67
+ @groups[group-1][0...top_no].each do |card|
68
+ @groups[group-1].delete(card)
69
+ end
70
+ end
71
+ end
59
72
  end
60
73
  class EukerDeck < Deck
61
74
  def initialize
@@ -68,4 +81,44 @@ class EukerDeck < Deck
68
81
  end
69
82
  shuffle
70
83
  end
84
+ end
85
+ class ExplodingDeck < Deck
86
+ def initialize
87
+ @position = []
88
+ @groups = []
89
+ ['exp', 'fvr', 'shf', 'atk', 'skp', 'tac', 'mlc', 'bdc', 'rrc', 'hpc'].each do |card|
90
+ for x in 0...4
91
+ @position.push(card)
92
+ end
93
+ end
94
+ ['nop', 'fut'].each do |card|
95
+ for x in 0...5
96
+ @position.push(card)
97
+ end
98
+ end
99
+ for x in 0...6
100
+ @position.push('def')
101
+ end
102
+ shuffle
103
+ end
104
+ def deal(hands)
105
+ deal_in
106
+ @groups = []
107
+ @position.delete('def')
108
+ @position.delete('exp')
109
+ for x in 0...hands
110
+ @groups.push([])
111
+ @groups[x].push('def')
112
+ for y in 0...7
113
+ @groups[x].push(@position.shift)
114
+ end
115
+ end
116
+ for x in 0...(6-hands)
117
+ @position.insert(rand(@position.size), 'def')
118
+ end
119
+ for x in 0...(hands-1)
120
+ @position.insert(rand(@position.size), 'exp')
121
+ end
122
+ self
123
+ end
71
124
  end
metadata CHANGED
@@ -1,23 +1,23 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deckcrystel
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin M
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-17 00:00:00.000000000 Z
11
+ date: 2020-09-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: I made this originally as a subset of my other gem, crystel. It acts
14
- as a virtual deck of cards.
14
+ as a virtual deck of cards. Now with Euker and Exploding Kittens decks!
15
15
  email: benjaminnner@icloud.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
- - lib/deckcrystel.rb
20
+ - "./lib/deckcrystel.rb"
21
21
  homepage: https://github.com/benjaminner/Ruby/tree/master/crystel/deckcrystel
22
22
  licenses: []
23
23
  metadata: {}