kittyverse 0.4.3 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +3 -3
- data/Manifest.txt +5 -5
- data/README.md +416 -240
- data/Rakefile +30 -30
- data/lib/kittyverse.rb +39 -44
- data/lib/kittyverse/cattributes.rb +123 -131
- data/lib/kittyverse/config/colors.rb +146 -132
- data/lib/kittyverse/config/exclusives.rb +197 -0
- data/lib/kittyverse/config/fancies.rb +379 -174
- data/lib/kittyverse/config/purrstiges.rb +392 -200
- data/lib/kittyverse/config/special_editions.rb +135 -0
- data/lib/kittyverse/config/traits.rb +12 -0
- data/lib/kittyverse/config/traits_timeline.rb +288 -294
- data/lib/kittyverse/fancies.rb +206 -205
- data/lib/kittyverse/gene.rb +53 -0
- data/lib/kittyverse/genome.rb +176 -0
- data/lib/kittyverse/mewtations.rb +118 -120
- data/lib/kittyverse/recipes.rb +0 -2
- data/lib/kittyverse/traits.rb +0 -2
- data/lib/kittyverse/version.rb +20 -23
- data/test/helper.rb +10 -10
- data/test/test_cattributes.rb +0 -2
- data/test/test_fancies.rb +16 -2
- data/test/test_genome.rb +65 -0
- data/test/test_traits.rb +172 -174
- metadata +21 -17
- data/LICENSE.md +0 -116
- data/lib/kittyverse/api/client.rb +0 -149
- data/lib/kittyverse/api/versions.rb +0 -90
- data/lib/kittyverse/links.rb +0 -57
- data/lib/kittyverse/pages/genes.rb +0 -101
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dacd0a0a5f7be35ca76a335fddf0132bac31bf0b9abe45a96e28cdd1d8d7835e
|
4
|
+
data.tar.gz: 3feed388c41c6da0f570335797c66739519d73e0c4ed579fa952c00e7c32a58c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6275bb517145ac46b79990c01ce388ef328b57dfc3e54b47ad59b33c123ba0f4e1f7f1fae824b29cb71c04c9d3a4339f6c7192f2f25f69b7203f3cc28b694a72
|
7
|
+
data.tar.gz: e059e6a891dfea2ee859838caaaf252206492ac2886ba0b88f3c35d8a089de27dcd7026763f7f0c8d58195e577a2e214c07d3d71c116191d1c64ac2a68c1c3ef
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
### 0.0.1 / 2019-01-11
|
2
|
-
|
3
|
-
* Everything is new. First release
|
1
|
+
### 0.0.1 / 2019-01-11
|
2
|
+
|
3
|
+
* Everything is new. First release
|
data/Manifest.txt
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
CHANGELOG.md
|
2
|
-
LICENSE.md
|
3
2
|
Manifest.txt
|
4
3
|
README.md
|
5
4
|
Rakefile
|
6
5
|
lib/kittyverse.rb
|
7
|
-
lib/kittyverse/api/client.rb
|
8
|
-
lib/kittyverse/api/versions.rb
|
9
6
|
lib/kittyverse/cattributes.rb
|
10
7
|
lib/kittyverse/config/colors.rb
|
8
|
+
lib/kittyverse/config/exclusives.rb
|
11
9
|
lib/kittyverse/config/fancies.rb
|
12
10
|
lib/kittyverse/config/purrstiges.rb
|
11
|
+
lib/kittyverse/config/special_editions.rb
|
13
12
|
lib/kittyverse/config/traits.rb
|
14
13
|
lib/kittyverse/config/traits_timeline.rb
|
15
14
|
lib/kittyverse/fancies.rb
|
16
|
-
lib/kittyverse/
|
15
|
+
lib/kittyverse/gene.rb
|
16
|
+
lib/kittyverse/genome.rb
|
17
17
|
lib/kittyverse/mewtations.rb
|
18
|
-
lib/kittyverse/pages/genes.rb
|
19
18
|
lib/kittyverse/recipes.rb
|
20
19
|
lib/kittyverse/traits.rb
|
21
20
|
lib/kittyverse/version.rb
|
22
21
|
test/helper.rb
|
23
22
|
test/test_cattributes.rb
|
24
23
|
test/test_fancies.rb
|
24
|
+
test/test_genome.rb
|
25
25
|
test/test_traits.rb
|
data/README.md
CHANGED
@@ -1,240 +1,416 @@
|
|
1
|
-
# Kittyverse
|
2
|
-
|
3
|
-
|
4
|
-
kittyverse
|
5
|
-
|
6
|
-
* home :: [github.com/cryptocopycats/kittyverse](https://github.com/cryptocopycats/kittyverse)
|
7
|
-
* bugs :: [github.com/cryptocopycats/kittyverse/issues](https://github.com/cryptocopycats/kittyverse/issues)
|
8
|
-
* gem :: [rubygems.org/gems/kittyverse](https://rubygems.org/gems/kittyverse)
|
9
|
-
* rdoc :: [rubydoc.info/gems/kittyverse](http://rubydoc.info/gems/kittyverse)
|
10
|
-
|
11
|
-
|
12
|
-
## Usage
|
13
|
-
|
14
|
-
### Traits
|
15
|
-
|
16
|
-
Use the `Traits` helper class to lookup trait types (e.g. fur, pattern, eye color, eye shape, base color, etc.) and traits (e.g. savannah, selkirk, chantilly, etc.):
|
17
|
-
|
18
|
-
``` ruby
|
19
|
-
t = Traits[ 'FU00' ]
|
20
|
-
p t.class #=> Trait
|
21
|
-
p t.name #=> "Savannah"
|
22
|
-
p t.type.name #=> "Fur"
|
23
|
-
p t.code #=> "FU00"
|
24
|
-
p t.kai #=> "1"
|
25
|
-
|
26
|
-
# -or-
|
27
|
-
|
28
|
-
t = Trait.find_by_code( 'FU00' )
|
29
|
-
t = Trait.find_by( code: 'FU00' )
|
30
|
-
t = Traits[ 'savannah' ]
|
31
|
-
t = Traits[ 'Savannah' ]
|
32
|
-
t = Trait.find_by_name( 'Savannah' )
|
33
|
-
t = Trait.find_by( name: 'Savannah' )
|
34
|
-
t = Traits[ :body ][ '1' ]
|
35
|
-
t = Traits[ :body ][ '00' ]
|
36
|
-
t = Traits[ :body ][ 0 ]
|
37
|
-
t = Traits[ 'FU' ][ '00' ]
|
38
|
-
t = Traits[ 'FU' ][0]
|
39
|
-
t = Traits[ :FU ][0]
|
40
|
-
t = Traits[ :FU00 ]
|
41
|
-
t = Traits[ 'Fur' ][0]
|
42
|
-
# ...
|
43
|
-
```
|
44
|
-
|
45
|
-
#### What about `totesbasic`?
|
46
|
-
|
47
|
-
Note, the `totesbasic` pattern cattribute has _three_ traits, that is, `totesbasic 1` with the code `PA14`
|
48
|
-
and `totesbasic 2` with `PA15` and `totesbasic 3` with `PA23`.
|
49
|
-
Use:
|
50
|
-
|
51
|
-
``` ruby
|
52
|
-
t = Traits[ 'PA14' ]
|
53
|
-
p t.class #=> Trait
|
54
|
-
p t.name #=> "Totesbasic 1"
|
55
|
-
p t.type.name #=> "Pattern"
|
56
|
-
p t.code #=> "PA14"
|
57
|
-
p t.kai #=> "f"
|
58
|
-
|
59
|
-
# -or-
|
60
|
-
|
61
|
-
t = Trait.find_by_code( 'PA14' )
|
62
|
-
t = Trait.find_by( code: 'PA14' )
|
63
|
-
t = Traits[ 'totesbasic 1' ]
|
64
|
-
t = Traits[ 'Totesbasic 1' ]
|
65
|
-
t = Trait.find_by_name( 'Totesbasic 1' )
|
66
|
-
t = Trait.find_by( name: 'Totesbasic 1' )
|
67
|
-
t = Traits[ :body ][ 'f' ]
|
68
|
-
t = Traits[ :body ][ '14' ]
|
69
|
-
t = Traits[ :body ][ 14 ]
|
70
|
-
# ...
|
71
|
-
```
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
For trait types (e.g. fur, pattern, eye color, eye shape, base color, etc.)
|
76
|
-
use:
|
77
|
-
|
78
|
-
``` ruby
|
79
|
-
tt = Traits[ :body ]
|
80
|
-
p tt.class #=> TraitType
|
81
|
-
p tt.name #=> "Fur"
|
82
|
-
p tt.code #=> "FU"
|
83
|
-
p tt.genes #=> "0-3"
|
84
|
-
|
85
|
-
# -or-
|
86
|
-
|
87
|
-
tt = TraitType.find_by_key( :body )
|
88
|
-
tt = TraitType.find_by( key: 'body' )
|
89
|
-
tt = Traits[ 'Fur' ]
|
90
|
-
tt = TraitType.find_by_name( 'Fur' )
|
91
|
-
tt = TraitType.find_by( name: 'Fur' )
|
92
|
-
tt = Traits[ 'FU' ]
|
93
|
-
tt = Traits[ :FU ]
|
94
|
-
tt = TraitType.find_by_code( 'FU' )
|
95
|
-
tt = TraitType.find_by( code: 'FU' )
|
96
|
-
# ...
|
97
|
-
```
|
98
|
-
|
99
|
-
|
100
|
-
### Cattributes
|
101
|
-
|
102
|
-
Use the `Cattribute` helper class to lookup cattributes incl. purrstige cattributes with timed trait recipes / forumlas:
|
103
|
-
|
104
|
-
``` ruby
|
105
|
-
c = Cattribute[ 'savannah' ]
|
106
|
-
p c.class #=> Cattribute
|
107
|
-
p c.name #=> "Savannah"
|
108
|
-
p c.type.name #=> "Fur"
|
109
|
-
p c.traits.size #=> 1
|
110
|
-
p c.traits #=> ["Savannah"]
|
111
|
-
p c.traits[0].code #=> "FU00"
|
112
|
-
# ...
|
113
|
-
|
114
|
-
c = Cattribute[ 'totesbasic' ]
|
115
|
-
p c.class #=> Cattribute
|
116
|
-
p c.name #=> "Totesbasic"
|
117
|
-
p c.type.name #=> "Pattern"
|
118
|
-
p c.traits.size #=> 3
|
119
|
-
p c.traits #=> ["Totesbasic 1", "Totesbasic 2", "Totesbasic 3"]
|
120
|
-
p c.traits[0].code #=> "PA14"
|
121
|
-
p c.traits[1].code #=> "PA15"
|
122
|
-
p c.traits[2].code #=> "PA23"
|
123
|
-
# ...
|
124
|
-
|
125
|
-
c = Cattribute[ 'bionic' ]
|
126
|
-
p c.class #=> Cattribute
|
127
|
-
p c.name #=> "Bionic"
|
128
|
-
p c.type.name #=> "Purrstige"
|
129
|
-
p c.traits.size #=> 0
|
130
|
-
p c.traits #=> []
|
131
|
-
p c.recipe #=> {time: {start: "2019-05-01", end: "2019-08-31"},
|
132
|
-
# traits: ["Ragdoll",
|
133
|
-
# "WE05",
|
134
|
-
# ["Totesbasic 1", "Totesbasic 2", "Totesbasic 3"],
|
135
|
-
# "PU30"]}
|
136
|
-
|
137
|
-
# ...
|
138
|
-
```
|
139
|
-
|
140
|
-
### Fancies
|
141
|
-
|
142
|
-
Use the `Fancy` helper class to lookup fancy or exclusive or special edition cats incl. timed trait recipes / forumlas, counts, limits, ids and more:
|
143
|
-
|
144
|
-
``` ruby
|
145
|
-
f = Fancy[ :genesis ]
|
146
|
-
p f.class #=> Fancy
|
147
|
-
p f.name #=> "Genesis"
|
148
|
-
p f.key #=> :genesis
|
149
|
-
p f.exlusive? #=> true
|
150
|
-
p f.ids.size #=> 1
|
151
|
-
p f.ids #=> [1]
|
152
|
-
#...
|
153
|
-
|
154
|
-
# -or-
|
155
|
-
|
156
|
-
f = Fancy.find_by_key( :genesis )
|
157
|
-
f = Fancy.find_by( key: 'genesis' )
|
158
|
-
f = Fancy[ 'Genesis' ]
|
159
|
-
f = Fancy.find_by_name( 'Genesis' )
|
160
|
-
f = Fancy.find_by( name: 'Genesis' )
|
161
|
-
# ...
|
162
|
-
|
163
|
-
f = Fancy[ :bugcat ]
|
164
|
-
p f.class #=> Fancy
|
165
|
-
p f.name #=> "Bug Cat"
|
166
|
-
p f.key #=> :bugcat
|
167
|
-
p f.exlusive? #=> true
|
168
|
-
p f.ids.size #=> 3
|
169
|
-
p f.ids #=> [101,102,103]
|
170
|
-
#...
|
171
|
-
|
172
|
-
# -or-
|
173
|
-
|
174
|
-
f = Fancy[ 'Bug Cat' ]
|
175
|
-
f = Fancy[ 'BugCat' ]
|
176
|
-
f = Fancy[ 'bugcat' ]
|
177
|
-
f = Fancy.find_by_name( 'Bug Cat' )
|
178
|
-
f = Fancy.find_by( name: 'Bug Cat' )
|
179
|
-
# ...
|
180
|
-
```
|
181
|
-
|
182
|
-
**Fancy Cat Types**
|
183
|
-
|
184
|
-
``` ruby
|
185
|
-
p Fancy.size #=> 83
|
186
|
-
p Fancy.exclusives.size #=> 22
|
187
|
-
p Fancy.special_editions.size #=> 5
|
188
|
-
p Fancy.fancies.size #=> 56
|
189
|
-
```
|
190
|
-
|
191
|
-
Loop over all fancies:
|
192
|
-
|
193
|
-
``` ruby
|
194
|
-
Fancy.each do |fancy|
|
195
|
-
p fancy.name
|
196
|
-
end
|
197
|
-
|
198
|
-
# ...
|
199
|
-
```
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
1
|
+
# Kittyverse
|
2
|
+
|
3
|
+
|
4
|
+
kittyverse - helper classes for cattributes, trait types, traits, genes, genomes and more for cryptokitties and copycats
|
5
|
+
|
6
|
+
* home :: [github.com/cryptocopycats/kittyverse](https://github.com/cryptocopycats/kittyverse)
|
7
|
+
* bugs :: [github.com/cryptocopycats/kittyverse/issues](https://github.com/cryptocopycats/kittyverse/issues)
|
8
|
+
* gem :: [rubygems.org/gems/kittyverse](https://rubygems.org/gems/kittyverse)
|
9
|
+
* rdoc :: [rubydoc.info/gems/kittyverse](http://rubydoc.info/gems/kittyverse)
|
10
|
+
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
### Traits
|
15
|
+
|
16
|
+
Use the `Traits` helper class to lookup trait types (e.g. fur, pattern, eye color, eye shape, base color, etc.) and traits (e.g. savannah, selkirk, chantilly, etc.):
|
17
|
+
|
18
|
+
``` ruby
|
19
|
+
t = Traits[ 'FU00' ]
|
20
|
+
p t.class #=> Trait
|
21
|
+
p t.name #=> "Savannah"
|
22
|
+
p t.type.name #=> "Fur"
|
23
|
+
p t.code #=> "FU00"
|
24
|
+
p t.kai #=> "1"
|
25
|
+
|
26
|
+
# -or-
|
27
|
+
|
28
|
+
t = Trait.find_by_code( 'FU00' )
|
29
|
+
t = Trait.find_by( code: 'FU00' )
|
30
|
+
t = Traits[ 'savannah' ]
|
31
|
+
t = Traits[ 'Savannah' ]
|
32
|
+
t = Trait.find_by_name( 'Savannah' )
|
33
|
+
t = Trait.find_by( name: 'Savannah' )
|
34
|
+
t = Traits[ :body ][ '1' ]
|
35
|
+
t = Traits[ :body ][ '00' ]
|
36
|
+
t = Traits[ :body ][ 0 ]
|
37
|
+
t = Traits[ 'FU' ][ '00' ]
|
38
|
+
t = Traits[ 'FU' ][0]
|
39
|
+
t = Traits[ :FU ][0]
|
40
|
+
t = Traits[ :FU00 ]
|
41
|
+
t = Traits[ 'Fur' ][0]
|
42
|
+
# ...
|
43
|
+
```
|
44
|
+
|
45
|
+
#### What about `totesbasic`?
|
46
|
+
|
47
|
+
Note, the `totesbasic` pattern cattribute has _three_ traits, that is, `totesbasic 1` with the code `PA14`
|
48
|
+
and `totesbasic 2` with `PA15` and `totesbasic 3` with `PA23`.
|
49
|
+
Use:
|
50
|
+
|
51
|
+
``` ruby
|
52
|
+
t = Traits[ 'PA14' ]
|
53
|
+
p t.class #=> Trait
|
54
|
+
p t.name #=> "Totesbasic 1"
|
55
|
+
p t.type.name #=> "Pattern"
|
56
|
+
p t.code #=> "PA14"
|
57
|
+
p t.kai #=> "f"
|
58
|
+
|
59
|
+
# -or-
|
60
|
+
|
61
|
+
t = Trait.find_by_code( 'PA14' )
|
62
|
+
t = Trait.find_by( code: 'PA14' )
|
63
|
+
t = Traits[ 'totesbasic 1' ]
|
64
|
+
t = Traits[ 'Totesbasic 1' ]
|
65
|
+
t = Trait.find_by_name( 'Totesbasic 1' )
|
66
|
+
t = Trait.find_by( name: 'Totesbasic 1' )
|
67
|
+
t = Traits[ :body ][ 'f' ]
|
68
|
+
t = Traits[ :body ][ '14' ]
|
69
|
+
t = Traits[ :body ][ 14 ]
|
70
|
+
# ...
|
71
|
+
```
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
For trait types (e.g. fur, pattern, eye color, eye shape, base color, etc.)
|
76
|
+
use:
|
77
|
+
|
78
|
+
``` ruby
|
79
|
+
tt = Traits[ :body ]
|
80
|
+
p tt.class #=> TraitType
|
81
|
+
p tt.name #=> "Fur"
|
82
|
+
p tt.code #=> "FU"
|
83
|
+
p tt.genes #=> "0-3"
|
84
|
+
|
85
|
+
# -or-
|
86
|
+
|
87
|
+
tt = TraitType.find_by_key( :body )
|
88
|
+
tt = TraitType.find_by( key: 'body' )
|
89
|
+
tt = Traits[ 'Fur' ]
|
90
|
+
tt = TraitType.find_by_name( 'Fur' )
|
91
|
+
tt = TraitType.find_by( name: 'Fur' )
|
92
|
+
tt = Traits[ 'FU' ]
|
93
|
+
tt = Traits[ :FU ]
|
94
|
+
tt = TraitType.find_by_code( 'FU' )
|
95
|
+
tt = TraitType.find_by( code: 'FU' )
|
96
|
+
# ...
|
97
|
+
```
|
98
|
+
|
99
|
+
|
100
|
+
### Cattributes
|
101
|
+
|
102
|
+
Use the `Cattribute` helper class to lookup cattributes incl. purrstige cattributes with timed trait recipes / forumlas:
|
103
|
+
|
104
|
+
``` ruby
|
105
|
+
c = Cattribute[ 'savannah' ]
|
106
|
+
p c.class #=> Cattribute
|
107
|
+
p c.name #=> "Savannah"
|
108
|
+
p c.type.name #=> "Fur"
|
109
|
+
p c.traits.size #=> 1
|
110
|
+
p c.traits #=> ["Savannah"]
|
111
|
+
p c.traits[0].code #=> "FU00"
|
112
|
+
# ...
|
113
|
+
|
114
|
+
c = Cattribute[ 'totesbasic' ]
|
115
|
+
p c.class #=> Cattribute
|
116
|
+
p c.name #=> "Totesbasic"
|
117
|
+
p c.type.name #=> "Pattern"
|
118
|
+
p c.traits.size #=> 3
|
119
|
+
p c.traits #=> ["Totesbasic 1", "Totesbasic 2", "Totesbasic 3"]
|
120
|
+
p c.traits[0].code #=> "PA14"
|
121
|
+
p c.traits[1].code #=> "PA15"
|
122
|
+
p c.traits[2].code #=> "PA23"
|
123
|
+
# ...
|
124
|
+
|
125
|
+
c = Cattribute[ 'bionic' ]
|
126
|
+
p c.class #=> Cattribute
|
127
|
+
p c.name #=> "Bionic"
|
128
|
+
p c.type.name #=> "Purrstige"
|
129
|
+
p c.traits.size #=> 0
|
130
|
+
p c.traits #=> []
|
131
|
+
p c.recipe #=> {time: {start: "2019-05-01", end: "2019-08-31"},
|
132
|
+
# traits: ["Ragdoll",
|
133
|
+
# "WE05",
|
134
|
+
# ["Totesbasic 1", "Totesbasic 2", "Totesbasic 3"],
|
135
|
+
# "PU30"]}
|
136
|
+
|
137
|
+
# ...
|
138
|
+
```
|
139
|
+
|
140
|
+
### Fancies
|
141
|
+
|
142
|
+
Use the `Fancy` helper class to lookup fancy or exclusive or special edition cats incl. timed trait recipes / forumlas, counts, limits, ids and more:
|
143
|
+
|
144
|
+
``` ruby
|
145
|
+
f = Fancy[ :genesis ]
|
146
|
+
p f.class #=> Fancy
|
147
|
+
p f.name #=> "Genesis"
|
148
|
+
p f.key #=> :genesis
|
149
|
+
p f.exlusive? #=> true
|
150
|
+
p f.ids.size #=> 1
|
151
|
+
p f.ids #=> [1]
|
152
|
+
#...
|
153
|
+
|
154
|
+
# -or-
|
155
|
+
|
156
|
+
f = Fancy.find_by_key( :genesis )
|
157
|
+
f = Fancy.find_by( key: 'genesis' )
|
158
|
+
f = Fancy[ 'Genesis' ]
|
159
|
+
f = Fancy.find_by_name( 'Genesis' )
|
160
|
+
f = Fancy.find_by( name: 'Genesis' )
|
161
|
+
# ...
|
162
|
+
|
163
|
+
f = Fancy[ :bugcat ]
|
164
|
+
p f.class #=> Fancy
|
165
|
+
p f.name #=> "Bug Cat"
|
166
|
+
p f.key #=> :bugcat
|
167
|
+
p f.exlusive? #=> true
|
168
|
+
p f.ids.size #=> 3
|
169
|
+
p f.ids #=> [101,102,103]
|
170
|
+
#...
|
171
|
+
|
172
|
+
# -or-
|
173
|
+
|
174
|
+
f = Fancy[ 'Bug Cat' ]
|
175
|
+
f = Fancy[ 'BugCat' ]
|
176
|
+
f = Fancy[ 'bugcat' ]
|
177
|
+
f = Fancy.find_by_name( 'Bug Cat' )
|
178
|
+
f = Fancy.find_by( name: 'Bug Cat' )
|
179
|
+
# ...
|
180
|
+
```
|
181
|
+
|
182
|
+
**Fancy Cat Types**
|
183
|
+
|
184
|
+
``` ruby
|
185
|
+
p Fancy.size #=> 83
|
186
|
+
p Fancy.exclusives.size #=> 22
|
187
|
+
p Fancy.special_editions.size #=> 5
|
188
|
+
p Fancy.fancies.size #=> 56
|
189
|
+
```
|
190
|
+
|
191
|
+
Loop over all fancies:
|
192
|
+
|
193
|
+
``` ruby
|
194
|
+
Fancy.each do |fancy|
|
195
|
+
p fancy.name
|
196
|
+
end
|
197
|
+
|
198
|
+
# ...
|
199
|
+
```
|
200
|
+
|
201
|
+
|
202
|
+
### Genome
|
203
|
+
|
204
|
+
Use the `Genome` helper class to
|
205
|
+
decipher the genes and lookup traits, mewtation tiers / levels,
|
206
|
+
recessive / hidden genes and more.
|
207
|
+
|
208
|
+
Let's build a gene reader. Pass in the "magic" 256-bit integer number for kitty #1001
|
209
|
+
from the blockchain
|
210
|
+
and get all 48 genes deciphered in 12x4 slices / blocks:
|
211
|
+
|
212
|
+
``` ruby
|
213
|
+
# kitty 1001
|
214
|
+
genome = Genome.new( 512955438081049600613224346938352058409509756310147795204209859701881294 )
|
215
|
+
|
216
|
+
genome.kai
|
217
|
+
#=> "aaaa 7885 22f2 agff 1661 7755 e979 2441 6667 7664 a9aa cfff"
|
218
|
+
|
219
|
+
genome.codes
|
220
|
+
#=> "09-09-09-09 06-07-07-04 01-01-14-01 09-15-14-14 00-05-05-00 06-06-04-04
|
221
|
+
# 13-08-06-08 01-03-03-00 05-05-05-06 06-05-05-03 09-08-09-09 11-14-14-14"
|
222
|
+
|
223
|
+
genome.binary
|
224
|
+
#=> "01001-01001-01001-01001 00110-00111-00111-00100 00001-00001-01110-00001
|
225
|
+
# 01001-01111-01110-01110 00000-00101-00101-00000 00110-00110-00100-00100
|
226
|
+
# 01101-01000-00110-01000 00001-00011-00011-00000 00101-00101-00101-00110
|
227
|
+
# 00110-00101-00101-00011 01001-01000-01001-01001 01011-01110-01110-01110"
|
228
|
+
|
229
|
+
genome.each_with_index do |slice,i|
|
230
|
+
offset = i*4
|
231
|
+
puts "#{slice.type.name} (#{slice.type.code}) - Genes #{slice.type.genes}:"
|
232
|
+
puts "#{'%2d' % (0+offset)} | #{slice.d.name || '∅'} (#{slice.d.code})"
|
233
|
+
puts "#{'%2d' % (1+offset)} | #{slice.r1.name || '∅'} (#{slice.r1.code})"
|
234
|
+
puts "#{'%2d' % (2+offset)} | #{slice.r2.name || '∅'} (#{slice.r2.code})"
|
235
|
+
puts "#{'%2d' % (3+offset)} | #{slice.r3.name || '∅'} (#{slice.r3.code})"
|
236
|
+
puts
|
237
|
+
end
|
238
|
+
```
|
239
|
+
|
240
|
+
|
241
|
+
resulting in:
|
242
|
+
|
243
|
+
```
|
244
|
+
Fur (FU) - Genes 0-3:
|
245
|
+
0 | Ragamuffin (FU14)
|
246
|
+
1 | Ragamuffin (FU14)
|
247
|
+
2 | Ragamuffin (FU14)
|
248
|
+
3 | Himalayan (FU11)
|
249
|
+
|
250
|
+
Pattern (PA) - Genes 4-7:
|
251
|
+
4 | Luckystripe (PA09)
|
252
|
+
5 | Luckystripe (PA09)
|
253
|
+
6 | Calicool (PA08)
|
254
|
+
7 | Luckystripe (PA09)
|
255
|
+
|
256
|
+
Eye Color (EC) - Genes 8-11:
|
257
|
+
8 | Mintgreen (EC03)
|
258
|
+
9 | Sizzurp (EC05)
|
259
|
+
10 | Sizzurp (EC05)
|
260
|
+
11 | Chestnut (EC06)
|
261
|
+
|
262
|
+
Eye Shape (ES) - Genes 12-15:
|
263
|
+
12 | Crazy (ES06)
|
264
|
+
13 | Simple (ES05)
|
265
|
+
14 | Simple (ES05)
|
266
|
+
15 | Simple (ES05)
|
267
|
+
|
268
|
+
Base Color (BC) - Genes 16-19:
|
269
|
+
16 | Shadowgrey (BC00)
|
270
|
+
17 | Orangesoda (BC03)
|
271
|
+
18 | Orangesoda (BC03)
|
272
|
+
19 | Salmon (BC01)
|
273
|
+
|
274
|
+
Highlight Color (HC) - Genes 20-23:
|
275
|
+
20 | Swampgreen (HC08)
|
276
|
+
21 | Royalpurple (HC06)
|
277
|
+
22 | Swampgreen (HC08)
|
278
|
+
23 | Lemonade (HC13)
|
279
|
+
|
280
|
+
Accent Color (AC) - Genes 24-27:
|
281
|
+
24 | Granitegrey (AC04)
|
282
|
+
25 | Granitegrey (AC04)
|
283
|
+
26 | Kittencream (AC06)
|
284
|
+
27 | Kittencream (AC06)
|
285
|
+
|
286
|
+
Wild Element (WE) - Genes 28-31:
|
287
|
+
28 | ∅ (WE00)
|
288
|
+
29 | ∅ (WE05)
|
289
|
+
30 | ∅ (WE05)
|
290
|
+
31 | ∅ (WE00)
|
291
|
+
|
292
|
+
Mouth (MO) - Genes 32-35:
|
293
|
+
32 | Happygokitty (MO14)
|
294
|
+
33 | Happygokitty (MO14)
|
295
|
+
34 | Soserious (MO15)
|
296
|
+
35 | Pouty (MO09)
|
297
|
+
|
298
|
+
Environment (EN) - Genes 36-39:
|
299
|
+
36 | ∅ (EN01)
|
300
|
+
37 | ∅ (EN14)
|
301
|
+
38 | ∅ (EN01)
|
302
|
+
39 | ∅ (EN01)
|
303
|
+
|
304
|
+
Secret Y Gene (SE) - Genes 40-43:
|
305
|
+
40 | ∅ (SE04)
|
306
|
+
41 | ∅ (SE07)
|
307
|
+
42 | ∅ (SE07)
|
308
|
+
43 | ∅ (SE06)
|
309
|
+
|
310
|
+
Purrstige (PU) - Genes 44-47:
|
311
|
+
44 | ∅ (PU09)
|
312
|
+
45 | ∅ (PU09)
|
313
|
+
46 | ∅ (PU09)
|
314
|
+
47 | ∅ (PU09)
|
315
|
+
```
|
316
|
+
|
317
|
+
|
318
|
+
Tip: See the chapter 2 in the
|
319
|
+
"[Programming Crypto Collectibles Step-by-Step Book / Guide. Let's start with CryptoKitties & Copycats. Inside Unique Bits & Bytes on the Blockchain...](https://github.com/cryptocopycats/programming-crypto-collectibles/blob/master/02_genereader.md)"
|
320
|
+
for how to create your own gene reader from scratch.
|
321
|
+
|
322
|
+
|
323
|
+
More ways to slice and dice the genome / genes:
|
324
|
+
|
325
|
+
``` ruby
|
326
|
+
genome[0].class #=> Trait
|
327
|
+
genome[0].name #=> "Ragamuffin"
|
328
|
+
genome[0].code #=> "FU14"
|
329
|
+
|
330
|
+
genome[5].class #=> Trait
|
331
|
+
genome[5].name #=> "Luckystripe"
|
332
|
+
genome[5].code #=> "PA09"
|
333
|
+
|
334
|
+
genome[40].class #=> Trait
|
335
|
+
genome[40].name #=> nil
|
336
|
+
genome[40].code #=> "SE04"
|
337
|
+
|
338
|
+
genome.body.class #=> Gene::Slice
|
339
|
+
genome.body.type.name #=> "Fur"
|
340
|
+
genome.body.type.code #=> "FU"
|
341
|
+
# -or-
|
342
|
+
genome[:body].class #=> Gene::Slice
|
343
|
+
genome[:body].type.name #=> "Fur"
|
344
|
+
genome[:body].type.code #=> "FU"
|
345
|
+
# -or-
|
346
|
+
genome.fu.class #=> Gene::Slice
|
347
|
+
genome.fu.type.name #=> "Fur"
|
348
|
+
genome.fu.type.code #=> "FU"
|
349
|
+
# -or-
|
350
|
+
genome[:FU].class #=> Gene::Slice
|
351
|
+
genome[:FU].type.name #=> "Fur"
|
352
|
+
genome[:FU].type.code #=> "FU"
|
353
|
+
|
354
|
+
genome.body.d.class #=> Trait
|
355
|
+
genome.body.d.name #=> "Ragamuffin"
|
356
|
+
genome.body.d.code #=> "FU14"
|
357
|
+
# -or-
|
358
|
+
genome[:body].d.class #=> Trait
|
359
|
+
genome[:body].d.name #=> "Ragamuffin"
|
360
|
+
genome[:body].d.code #=> "FU14"
|
361
|
+
# -or-
|
362
|
+
genome.body[0].class #=> Trait
|
363
|
+
genome.body[0].name #=> "Ragamuffin"
|
364
|
+
genome.body[0].code #=> "FU14"
|
365
|
+
# -or-
|
366
|
+
genome[:body][0].class #=> Trait
|
367
|
+
genome[:body][0].name #=> "Ragamuffin"
|
368
|
+
genome[:body][0].code #=> "FU14"
|
369
|
+
# -or-
|
370
|
+
genome.fu.d.class #=> Trait
|
371
|
+
genome.fu.d.name #=> "Ragamuffin"
|
372
|
+
genome.fu.d.code #=> "FU14"
|
373
|
+
# -or-
|
374
|
+
genome.fu[0].class #=> Trait
|
375
|
+
genome.fu[0].name #=> "Ragamuffin"
|
376
|
+
genome.fu[0].code #=> "FU14"
|
377
|
+
|
378
|
+
genome.fu.r1.class #=> Trait
|
379
|
+
genome.fu.r1.name #=> "Ragamuffin"
|
380
|
+
genome.fu.r1.code #=> "FU14"
|
381
|
+
# -or-
|
382
|
+
genome.body[1].class #=> Trait
|
383
|
+
genome.body[1].name #=> "Ragamuffin"
|
384
|
+
genome.body[1].code #=> "FU14"
|
385
|
+
```
|
386
|
+
|
387
|
+
and so on and so forth.
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
## Real World Usage
|
392
|
+
|
393
|
+
|
394
|
+
See the [copycats command line tool (and core library)](https://github.com/cryptocopycats/copycats) - crypto cats / kitties collectibles unchained - buy! sell! hodl! sire! - play for free - runs off the blockchain - no ether / gas required
|
395
|
+
|
396
|
+
|
397
|
+
## More Documentation / Articles / Samples
|
398
|
+
|
399
|
+
- [Programming Crypto Collectibles Step-by-Step Book / Guide](https://github.com/cryptocopycats/programming-crypto-collectibles) -
|
400
|
+
Let's start with CryptoKitties & Copycats. Inside Unique Bits & Bytes on the Blockchain...
|
401
|
+
- [Ruby Quiz - Challenge #8 - Base32 Alphabet](https://github.com/planetruby/quiz/tree/master/008) - Convert the Super "Sekretoooo" 256-Bit CryptoKitties Genome to Kai Notation - Annipurrsary!
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
## License
|
407
|
+
|
408
|
+
![](https://publicdomainworks.github.io/buttons/zero88x31.png)
|
409
|
+
|
410
|
+
The `kittyverse` scripts are dedicated to the public domain.
|
411
|
+
Use it as you please with no restrictions whatsoever.
|
412
|
+
|
413
|
+
|
414
|
+
## Questions? Comments?
|
415
|
+
|
416
|
+
Post them on the [cryptokitties reddit](https://www.reddit.com/r/cryptokitties). Thanks.
|