kittyverse 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +0 -2
- data/README.md +0 -16
- data/lib/kittyverse.rb +0 -4
- data/lib/kittyverse/cattributes.rb +0 -8
- data/lib/kittyverse/fancies.rb +0 -2
- data/lib/kittyverse/gene.rb +0 -2
- data/lib/kittyverse/genome.rb +0 -60
- data/lib/kittyverse/mewtations.rb +0 -2
- data/lib/kittyverse/recipes.rb +0 -2
- data/lib/kittyverse/traits.rb +0 -2
- data/lib/kittyverse/version.rb +1 -1
- metadata +1 -3
- 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
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
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/Manifest.txt
CHANGED
@@ -14,9 +14,7 @@ lib/kittyverse/config/traits_timeline.rb
|
|
14
14
|
lib/kittyverse/fancies.rb
|
15
15
|
lib/kittyverse/gene.rb
|
16
16
|
lib/kittyverse/genome.rb
|
17
|
-
lib/kittyverse/links.rb
|
18
17
|
lib/kittyverse/mewtations.rb
|
19
|
-
lib/kittyverse/pages/genes.rb
|
20
18
|
lib/kittyverse/recipes.rb
|
21
19
|
lib/kittyverse/traits.rb
|
22
20
|
lib/kittyverse/version.rb
|
data/README.md
CHANGED
@@ -390,22 +390,6 @@ and so on and so forth.
|
|
390
390
|
|
391
391
|
## Real World Usage
|
392
392
|
|
393
|
-
### Reference Pages / Cheat Sheets @ Kittypedia
|
394
|
-
|
395
|
-
Auto-generated reference pages / cheat sheets
|
396
|
-
in the [Kittypedia - The Free CryptoKitties Encyclopedia](https://github.com/cryptocopycats/kittypedia) include:
|
397
|
-
|
398
|
-
- [Cattributes Rarity / Popularity Statistics](https://github.com/cryptocopycats/kittypedia/blob/master/CATTRIBUTES.md)
|
399
|
-
- [Genome / Genes Cheat Sheet](https://github.com/cryptocopycats/kittypedia/blob/master/GENES.md) - Fur (FU) · Pattern (PA) · Eye Color (EC) · Eye Shape (ES) · Base Color (BC) · Highlight Color (HC) · Accent Color (AC) · Wild Element (WE) · Mouth (MO) · Environment (EN) · Secret Y Gene (SE) · Purrstige (PU)
|
400
|
-
- [Traits Cheat Sheet (with Codes, Mewtation Levels / Tiers, Search Links and More)](https://github.com/cryptocopycats/kittypedia/blob/master/TRAITS.md)
|
401
|
-
- [Fancy / Exclusive / Special Edition Cats - Timeline](https://github.com/cryptocopycats/kittypedia/blob/master/TIMELINE-FANCIES.md)
|
402
|
-
- [Purrstige Trait Recipes / Formulas - Timeline](https://github.com/cryptocopycats/kittypedia/blob/master/TIMELINE-PURRSTIGES.md)
|
403
|
-
- and others
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
### More
|
409
393
|
|
410
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
|
411
395
|
|
data/lib/kittyverse.rb
CHANGED
@@ -22,11 +22,7 @@ require 'kittyverse/config/fancies'
|
|
22
22
|
require 'kittyverse/config/purrstiges'
|
23
23
|
require 'kittyverse/config/colors'
|
24
24
|
|
25
|
-
|
26
25
|
require 'kittyverse/mewtations'
|
27
|
-
require 'kittyverse/links'
|
28
|
-
|
29
|
-
require 'kittyverse/pages/genes'
|
30
26
|
|
31
27
|
require 'kittyverse/recipes'
|
32
28
|
require 'kittyverse/traits'
|
data/lib/kittyverse/fancies.rb
CHANGED
data/lib/kittyverse/gene.rb
CHANGED
data/lib/kittyverse/genome.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
|
3
2
|
|
4
3
|
class Genome
|
@@ -173,64 +172,5 @@ class Genome
|
|
173
172
|
@genes[index(key)]
|
174
173
|
end
|
175
174
|
end
|
176
|
-
|
177
|
-
|
178
|
-
def build_tables() GenomeTables.new( self ).build; end
|
179
175
|
end # class Genome
|
180
176
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
class GenomeTables
|
185
|
-
def initialize( genome )
|
186
|
-
@genome = genome
|
187
|
-
end
|
188
|
-
|
189
|
-
def build
|
190
|
-
pos = 0
|
191
|
-
buf = ""
|
192
|
-
buf << "Genes (256-Bit Integer Number):\n"
|
193
|
-
buf << "- Base 10 (Decimal): #{@genome.num}\n"
|
194
|
-
buf << "- Base 2 (Binary): #{@genome.binary}\n"
|
195
|
-
buf << "- Base 2⁵ = 32\n"
|
196
|
-
buf << " - (Kai): #{@genome.kai}\n"
|
197
|
-
buf << " - (Codes): #{@genome.codes}\n"
|
198
|
-
buf << "\n\n"
|
199
|
-
|
200
|
-
@genome.each do |slice|
|
201
|
-
tt = slice.type
|
202
|
-
|
203
|
-
buf << "#{tt.name} (#{tt.code}) - Genes #{tt.genes}\n\n"
|
204
|
-
|
205
|
-
###
|
206
|
-
## fix/todo: add stars for purity?
|
207
|
-
## **** - all traits the same
|
208
|
-
## *** - two same pairs of traits
|
209
|
-
## ** - one pair of same traits
|
210
|
-
|
211
|
-
buf << "|Gene |Binary |Kai |Code | Name | |\n"
|
212
|
-
buf << "|------|---------|-----|-----|----------|---|\n"
|
213
|
-
buf << "| #{pos} | #{slice.d.binary} | #{slice.d.kai} | #{slice.d.code} |**#{fmt_trait(slice.d)}** | d |\n"; pos+=1
|
214
|
-
buf << "| #{pos} | #{slice.r1.binary} | #{slice.r1.kai} | #{slice.r1.code} |#{fmt_trait(slice.r1)} | r1 |\n"; pos+=1
|
215
|
-
buf << "| #{pos} | #{slice.r2.binary} | #{slice.r2.kai} | #{slice.r2.code} |#{fmt_trait(slice.r2)} | r2 |\n"; pos+=1
|
216
|
-
buf << "| #{pos} | #{slice.r3.binary} | #{slice.r3.kai} | #{slice.r3.code} |#{fmt_trait(slice.r3)} | r3 |\n"; pos+=1
|
217
|
-
buf << "\n"
|
218
|
-
|
219
|
-
if tt.key == :body ## add legend for first entry
|
220
|
-
buf << "d = dominant, r1 = 1st order recessive, r2 = 2nd order recessive, r3 = 3rd order recessive\n\n"
|
221
|
-
end
|
222
|
-
end
|
223
|
-
|
224
|
-
buf
|
225
|
-
end
|
226
|
-
|
227
|
-
####################
|
228
|
-
## helpers
|
229
|
-
|
230
|
-
def fmt_trait( trait )
|
231
|
-
buf = ""
|
232
|
-
buf << (trait.name || '∅')
|
233
|
-
buf << " #{trait.tier_roman}" if trait.tier > 0
|
234
|
-
buf
|
235
|
-
end
|
236
|
-
end # class GenomeTables
|
data/lib/kittyverse/recipes.rb
CHANGED
data/lib/kittyverse/traits.rb
CHANGED
data/lib/kittyverse/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kittyverse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
@@ -84,9 +84,7 @@ files:
|
|
84
84
|
- lib/kittyverse/fancies.rb
|
85
85
|
- lib/kittyverse/gene.rb
|
86
86
|
- lib/kittyverse/genome.rb
|
87
|
-
- lib/kittyverse/links.rb
|
88
87
|
- lib/kittyverse/mewtations.rb
|
89
|
-
- lib/kittyverse/pages/genes.rb
|
90
88
|
- lib/kittyverse/recipes.rb
|
91
89
|
- lib/kittyverse/traits.rb
|
92
90
|
- lib/kittyverse/version.rb
|
data/lib/kittyverse/links.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
|
4
|
-
###############################
|
5
|
-
# cryptokitties.co links
|
6
|
-
|
7
|
-
def kitties_kitty_url( id )
|
8
|
-
"https://www.cryptokitties.co/kitty/#{id}"
|
9
|
-
end
|
10
|
-
|
11
|
-
|
12
|
-
def kitties_search_url( q )
|
13
|
-
"https://www.cryptokitties.co/search?include=sale,sire,other&search=#{q}"
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
def kitties_fancy_search_url( fancy ) ## todo: find a better name - why? why not?
|
20
|
-
|
21
|
-
## note: use (official) chinese name for search param if present
|
22
|
-
param = fancy.name_cn ? fancy.name_cn : fancy.key
|
23
|
-
|
24
|
-
if fancy.special_edition?
|
25
|
-
q = "specialedition:#{param}" ## todo: urlescape param - why? why not?
|
26
|
-
elsif fancy.exclusive? ## just use fancy too - why? why not?
|
27
|
-
q = "exclusive:#{param}"
|
28
|
-
else ## assume "normal/regular" fancy
|
29
|
-
q = "fancy:#{param}"
|
30
|
-
end
|
31
|
-
|
32
|
-
"https://www.cryptokitties.co/search?include=sale,sire,other&search=#{q}"
|
33
|
-
end
|
34
|
-
|
35
|
-
## alias :kitties_special_search_url :kitties_fancy_search_url
|
36
|
-
def kitties_specialedition_search_url( fancy ) kitties_fancy_search_url( fancy ); end
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
################################
|
41
|
-
# /media - image links
|
42
|
-
|
43
|
-
def media_fancy_url( key, variant_key=nil ) ### todo: find a better name - why? why not?
|
44
|
-
if variant_key
|
45
|
-
"https://cryptocopycats.github.io/media/kitties/100x100/fancy-#{key}-#{variant_key}.png"
|
46
|
-
else
|
47
|
-
"https://cryptocopycats.github.io/media/kitties/100x100/fancy-#{key}.png"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
## (old) alias for media_fany_url
|
52
|
-
def media_fancy_pic_url( key, variant_key=nil ) media_fancy_url( key, variant_key ); end
|
53
|
-
|
54
|
-
|
55
|
-
def media_icon_url( key ) ## note: use :unlocked, :locked, etc.
|
56
|
-
"https://cryptocopycats.github.io/media/icons/18x18/#{key}.png"
|
57
|
-
end
|
@@ -1,101 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
|
4
|
-
class GenesPage
|
5
|
-
|
6
|
-
def build
|
7
|
-
buf = ""
|
8
|
-
buf << "# Genes (#{TraitType.size} x 4)\n\n"
|
9
|
-
|
10
|
-
headings = []
|
11
|
-
TraitType.each do |tt|
|
12
|
-
anchor = "#{tt.name} #{tt.code}".downcase.gsub( ' ', '-' )
|
13
|
-
headings << "[#{tt.name} (#{tt.code})](##{anchor})"
|
14
|
-
end
|
15
|
-
|
16
|
-
buf << headings.join( " • " )
|
17
|
-
buf << "\n\n"
|
18
|
-
|
19
|
-
|
20
|
-
TraitType.each do |tt|
|
21
|
-
buf << "## #{tt.name} (#{tt.code})\n\n"
|
22
|
-
buf << "_Genes #{tt.genes}_\n\n"
|
23
|
-
buf << make_table( tt.traits )
|
24
|
-
buf << "\n\n"
|
25
|
-
end
|
26
|
-
|
27
|
-
puts buf
|
28
|
-
|
29
|
-
buf
|
30
|
-
end ## method build
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
def make_table( traits )
|
35
|
-
rows = make_rows( traits, columns: 2 ) ## was 4
|
36
|
-
## pp rows
|
37
|
-
|
38
|
-
buf = ""
|
39
|
-
buf << "|Kai|Code|Name |Kai|Code|Name |\n"
|
40
|
-
buf << "|--:|---:|-------------|--:|---:|------------|\n"
|
41
|
-
|
42
|
-
rows.each do |row|
|
43
|
-
buf << "| "
|
44
|
-
|
45
|
-
parts = row.map do |trait|
|
46
|
-
kai = trait.kai
|
47
|
-
## binary = "%05b" % Kai::NUM[kai]
|
48
|
-
code = trait.code
|
49
|
-
name = trait.name
|
50
|
-
tier = trait.tier_roman ## e.g. I,II,III, etc. : String
|
51
|
-
|
52
|
-
if name.nil?
|
53
|
-
## note: so far x/31 trait is unknown/undefined!!!
|
54
|
-
if kai == "x"
|
55
|
-
cattribute = "?"
|
56
|
-
elsif trait.type.key == :secret
|
57
|
-
cattribute = "? #{tier}" ## unknown unknown
|
58
|
-
else ## "anonymous / unnamed" gene / trait
|
59
|
-
cattribute = "∅ #{tier}" ## known unknown :-)
|
60
|
-
end
|
61
|
-
else
|
62
|
-
if name.downcase.start_with?( "totesbasic" ) ## note: special case for three totesbasic traits
|
63
|
-
q = "totesbasic"
|
64
|
-
else
|
65
|
-
q = name
|
66
|
-
end
|
67
|
-
cattribute = "**[#{name}](#{kitties_search_url(q)})** #{tier}"
|
68
|
-
end
|
69
|
-
|
70
|
-
"#{kai} | #{code} | #{cattribute}"
|
71
|
-
end
|
72
|
-
|
73
|
-
buf << parts.join( " | " )
|
74
|
-
buf << " |\n"
|
75
|
-
end
|
76
|
-
|
77
|
-
buf
|
78
|
-
end
|
79
|
-
|
80
|
-
|
81
|
-
## helpers
|
82
|
-
def make_rows( items, columns: 2 )
|
83
|
-
offset = items.size / columns
|
84
|
-
pp offset
|
85
|
-
|
86
|
-
rows = []
|
87
|
-
offset.times.with_index do |row|
|
88
|
-
## note: construct [items[row],items[offset+row],items[offset*2+row], ...]
|
89
|
-
rows << columns.times.with_index.map { |col| items[offset*col+row] }
|
90
|
-
end
|
91
|
-
rows
|
92
|
-
end
|
93
|
-
|
94
|
-
|
95
|
-
def save( path )
|
96
|
-
File.open( path, "w:utf-8" ) do |f|
|
97
|
-
f.write build
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
end # class GenesPage
|