kittyverse 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70c6b5c648ee1718de835e129f15a847a66979b2
4
- data.tar.gz: 65b590568925c9948c3ed8f929eff8b4589c6ebc
3
+ metadata.gz: 2a18d03701f80f74f3e0d07c1a2177ea37f3413f
4
+ data.tar.gz: e4e073120dd606eb075bb1f4a7d8563a86523420
5
5
  SHA512:
6
- metadata.gz: 6216a9e6016f61e492300ed64e0791bbff10563800530b4898fda3a93d8028866d0c037ee56d9362264c6ecbc8901a6adcf8501f7d95a05489ded1ed88de6f22
7
- data.tar.gz: b6f629dfbbc8352a2e2abbec68f31dc5846064d982af3dac6300e0faa2e03e13f7b42b6a78db9b483c113381f7d238ee77c3df821ee1a3a3bbe43ca4c6d2d9c7
6
+ metadata.gz: 47cc05e33c8ab43eb07bc975044d49f3990f8b02a5483788b9cf057f3dd904c4c094f1c0a2ca67c4f6a92b50af93b392b1ecd9a5611cc9aa49d51774805c5955
7
+ data.tar.gz: 886566ffaa738a43188dfad37de848c9d5ce9769ca09329e3f95015ab398a0858a9b4a347aa479c193c445a2944f31a73176e2afd14be0bb0af9195735070822
@@ -4,7 +4,13 @@ Manifest.txt
4
4
  README.md
5
5
  Rakefile
6
6
  lib/kittyverse.rb
7
+ lib/kittyverse/catalog.rb
8
+ lib/kittyverse/fancies.rb
9
+ lib/kittyverse/links.rb
10
+ lib/kittyverse/mewtations.rb
11
+ lib/kittyverse/pages/genes.rb
7
12
  lib/kittyverse/traits.rb
13
+ lib/kittyverse/traits_timeline.rb
8
14
  lib/kittyverse/version.rb
9
15
  test/helper.rb
10
16
  test/test_traits.rb
data/README.md CHANGED
@@ -11,7 +11,67 @@ kittyverse library - helper classes for cattributes, trait types, traits, genes,
11
11
 
12
12
  ## Usage
13
13
 
14
- to be done
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
+ For trait types (e.g. fur, pattern, eye color, eye shape, base color, etc.)
46
+ use:
47
+
48
+ ``` ruby
49
+ t = Traits[ :body ]
50
+ p t.class #=> TraitType
51
+ p t.name #=> "Fur"
52
+ p t.code #=> "FU"
53
+ p t.genes #=> "0-3"
54
+
55
+ # -or-
56
+
57
+ t = TraitType.find_by_key( :body )
58
+ t = TraitType.find_by( key: 'body' )
59
+ ```
60
+
61
+
62
+
63
+
64
+ ## Real World Usage
65
+
66
+ 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
67
+
68
+
69
+ ## More Documentation / Articles / Samples
70
+
71
+ - [Programming Crypto Collectibles Step-by-Step Book / Guide](https://github.com/cryptocopycats/programming-cryptocollectibles) -
72
+ Let's start with CryptoKitties & Copycats. Inside Unique Bits & Bytes on the Blockchain...
73
+ - [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!
74
+
15
75
 
16
76
 
17
77
 
@@ -6,7 +6,13 @@ require 'base32-alphabets'
6
6
  ## our own code
7
7
  require 'kittyverse/version' # note: let version always go first
8
8
  require 'kittyverse/traits'
9
+ require 'kittyverse/traits_timeline'
10
+ require 'kittyverse/mewtations'
11
+ require 'kittyverse/fancies'
12
+ require 'kittyverse/catalog'
9
13
 
14
+ require 'kittyverse/links'
15
+ require 'kittyverse/pages/genes'
10
16
 
11
17
 
12
18
  class Trait
@@ -0,0 +1,33 @@
1
+ # encoding: utf-8
2
+
3
+
4
+ class Catalog ## todo: use a module - move to its own file - why? why not?
5
+
6
+ @@specials = {} # special edition fancies
7
+ @@exclusives = {} # exclusive fancies
8
+ @@fancies = {} # "normal" fancies
9
+
10
+ @@prestiges = {} # purrstige cattributes
11
+
12
+
13
+ ## use special_cats, exclusive_cats, etc. - why? why not?
14
+ def self.specials() @@specials; end
15
+ def self.exclusives() @@exclusives; end
16
+ def self.fancies() @@fancies; end
17
+
18
+ ## use prestige(purrstige)_cattributes - why? why not?
19
+ def self.prestiges() @@prestiges; end
20
+
21
+
22
+ FANCIES.each do |key,h|
23
+ if h[:special]
24
+ specials[key] = h
25
+ elsif h[:exclusive]
26
+ exclusives[key] = h
27
+ elsif h[:prestige]
28
+ prestiges[key] = h
29
+ else
30
+ fancies[key] = h
31
+ end
32
+ end
33
+ end # class Catalog
@@ -0,0 +1,212 @@
1
+ # encoding: utf-8
2
+
3
+ ###
4
+ #
5
+ # for latest updates on new fancies/exclusives see:
6
+ # https://updates.cryptokitties.co (official latest updates/timeline)
7
+ #
8
+ # or see
9
+ # https://blog.kotobaza.co/timeline/
10
+
11
+
12
+ ##
13
+ ## note:
14
+ ## for time limits for fancies use:
15
+ ## e.g. time: { end: '2018-12-07' } # until dec/7
16
+ ##
17
+ ## for overflows for limited edition use:
18
+ ## e.g. overflow: 1 # 888+1 (=889)
19
+
20
+
21
+ ## use open - to mark "breedable" fancies - why? why not?
22
+ ## open: true or use limit: nil ????
23
+ ##
24
+
25
+ FANCIES =
26
+ {
27
+ ## 2019
28
+ ## January
29
+
30
+
31
+ ## 2018
32
+ ## December
33
+ catzy: { name: 'Catzy', date: '2018-12-31', limit: 10, ids: (1137653..1137662).to_a,
34
+ special: true,
35
+ desc: 'Changpeng "CZ" Zhao - CEO of Binance - Top 10 Blockchain Influencer of the Year 2018 by CoinDesk' },
36
+ purremyallaire: { name: 'Purremy Allaire', date: '2018-12-31', limit: 10, ids: (1137663..1137672).to_a,
37
+ special: true,
38
+ desc: 'Jeremy Allaire - Top 10 Blockchain Influencer of the Year 2018 by CoinDesk' },
39
+ genedough: { name: 'Gene Dough', date: '2018-12-23', time: { end: '2019-01-07' },
40
+ traits: ['hotcocoa', 'mittens', 'frosting'],
41
+ open: true },
42
+ pawrula: { name: 'Pawrula the Bright', date: '2018-12-15', time: { start: '2018-12-15', end: '2019-11-30' },
43
+ traits: ['camo', 'butterscotch', 'fox'],
44
+ desc: 'Neha Narula - Director of the Digital Currency Initiative at the MIT Media Lab',
45
+ open: true },
46
+ reindeer: { name: 'Reindeer', date: '2018-12-14',
47
+ time: { start: '2018-12-14', end: '2019-01-07' }, prestige: true,
48
+ traits: ['elk', ['PU24','PU25','PU26','PU27']],
49
+ open: true },
50
+ holidaycheer: { name: 'Holidaycheer', date: '2018-12-14',
51
+ time: { start: '2018-12-14', end: '2019-01-07' }, prestige: true,
52
+ traits: ['elk', ['PU28','PU29']],
53
+ open: true },
54
+ lit: { name: 'Lit', date: '2018-12-14',
55
+ time: { start: '2018-12-14', end: '2019-01-07' }, prestige: true,
56
+ traits: ['elk', 'PU30'],
57
+ open: true },
58
+
59
+ ## November
60
+ draco: { name: 'Draco', date: '2018-11-30', limit: 1115, time: { end: '2018-12-07' },
61
+ traits: ['toyger', 'martian', 'peppermint', 'dragonwings', 'SE03']},
62
+ dracothemagnificent: { name: 'Draco The Magnificent', date: '2018-11-27', limit: 12, exclusive: true, ids: (270..281).to_a },
63
+ bugcatv2: { name: 'Bug Cat V2', date: '2018-11-27', limit: 20, exclusive: true, ids: (167..186).to_a, desc: 'Bug Bounty II (Offers Contract) Kitty' },
64
+ dracojunior: { name: 'Draco Junior', date: '2018-11-26', limit: 1398, time: { end: '2018-12-07' },
65
+ traits: ['lynx', 'verdigris', 'dragontail', 'SE03']},
66
+ dreggo: { name: 'Dreggo', date: '2018-11-21', limit: 3624, time: { end: '2018-12-07' },
67
+ traits: ['siberian', 'bananacream', 'SE03']},
68
+ pickles: { name: 'Pickles', date: '2018-11-14', limit: 303,
69
+ traits: ['lynx', 'martian', 'highsociety', 'emeraldgreen']},
70
+ lilbub: { name: 'Lil Bub Ub Bub (BUB)', date: '2018-11-13', limit: 468, special: true }, ## for search use specialedition:
71
+
72
+ lilbubthemagicalspacecat: { name: 'Lil Bub Ub Bub (BUB) The Magical Space Cat', date: '2018-11-13', limit: 3, exclusive: true, ids: [266,267,268] },
73
+
74
+ ## October
75
+ thatsawrap: { name: 'Thatsawrap', date: '2018-10-21', limit: 615, time: { start: '2018-10-20', end: '2018-11-06' }, prestige: true,
76
+ traits: ['bobtail','WE00','PU28']},
77
+ duckduckcat: { name: 'Duckduckcat', date: '2018-10-19', limit: 1249, time: { start: '2018-10-20', end: '2018-11-15' }, prestige: true,
78
+ traits: ['neckbeard',['PU24','PU25','PU26']]}, ## Purrstige: PU24 / PU25 / PU26
79
+
80
+ dukecat: { name: 'Dukecat', date: '2018-10-18', limit: 1366,
81
+ traits: ['cymric', 'periwinkle', 'simple', 'tongue']},
82
+ sheilapurren: { name: 'Sheila Purren', date: '2018-10-04', limit: 1971, desc: 'Sheila Warren Kitty-fied - Head of Blockchain and Distributed Ledger Technology at the World Economic Forum (WEF)',
83
+ traits: ['mauveover', 'icy', 'wingtips', 'fangtastic']},
84
+
85
+ ## September
86
+ pawzilla: { name: 'Pawzilla', date: '2018-09-22', limit: 1185,
87
+ traits: ['jaguar', 'universe', 'atlantis', 'littlefoot']},
88
+ prune: { name: 'Prune', date: '2018-09-19', limit: 921, time: { start: '2018-09-18', end: '2018-09-30' }, prestige: true,
89
+ traits: ['norwegianforest', 'totesbasic', 'PU25']}, ## todo/fix: check totesbasic - three genes!!! - check which one PA15?
90
+ furball: { name: 'Furball', date: '2018-09-19', limit: 998, time: { start: '2018-09-19', end: '2018-09-30' }, prestige: true,
91
+ traits: ['norwegianforest', 'totesbasic', 'PU26']}, ## todo/fix: check totesbasic - three genes!!! - check which one PA15?
92
+ vulcat: { name: 'Vulcat', date: '2018-09-12', limit: 1, exclusive: true, ids: [1000000], desc: '1 000 000th Kitty' },
93
+ meowstro: { name: 'Meowstro', date: '2018-09-09', limit: 1698,
94
+ traits: ['onyx', 'wowza', 'eclipse']},
95
+ atlas: { name: 'Atlas', date: '2018-09-07', limit: 998,
96
+ traits: ['highlander', 'kittencream', 'swarley', 'topoftheworld']},
97
+
98
+ ## August
99
+ vulcant: { name: 'Vulcant', date: '2018-08-31', limit: 20, exclusive: true, ids: [932914,937360,938299,946526,948925,949058,950617,952280,952981,956374,956908,958570,964205,967234,983046,984451,990713,992861,995745,997469] },
100
+ purrity: { name: 'Purrity', date: '2018-08-23', limit: 5984,
101
+ traits: ['selkirk', 'chronic', 'cloudwhite', 'cheeky']},
102
+ rabbidkitty: { name: 'Rabbid Kitty', date: '2018-08-23', limit: 6, exclusive: true, ids: (260..265).to_a, desc: 'Ubisoft Blockchain Heroes Hackathon' },
103
+ squiddlesworth: { name: 'Squiddlesworth', date: '2018-08-16', limit: 1510, desc: 'Lava Squid Cat',
104
+ traits: ['sphynx', 'redvelvet', 'patrickstarfish', 'dragontail']},
105
+
106
+ ## July
107
+ purrspero: { name: 'Purrspero', date: '2018-07-27', limit: 4448,
108
+ traits: ['dippedcone', 'googly', 'royalpurple', 'beard']},
109
+ catbury: { name: 'Catbury', date: '2018-07-25', limit: 76,
110
+ traits: ['ragdoll', 'crazy', 'chocolate', 'mintmacaron', 'yokel', 'WE02']},
111
+ honu: { name: 'Honu', date: '2018-07-20', limit: 1, exclusive: true, ids: [251], desc: 'Kitties for Good - Save Turtle Habitats' },
112
+ victoire: { name: 'Victoire', date: '2018-07-18', limit: 1, exclusive: true, ids: [402], desc: 'France Football World Cup Champion' },
113
+ lulu: { name: 'Lulu', date: '2018-07-13', limit: 999,
114
+ traits: ['cyan', 'verdigris', 'turtleback', 'salty']},
115
+ boot: { name: 'Boot', date: '2018-07-05', limit: 1440, desc: 'Football World Cup',
116
+ traits: ['ganado', 'wiley', 'cerulian', 'rollercoaster'],
117
+ variants: {
118
+ belgium: { name: 'Belgium', limit: 97, traits: [['orangesoda','onyx']]}, ## Base Color: Orangesoda / Onyx
119
+ brazil: { name: 'Brazil', limit: 195, traits: [['hintomint','bananacream','verdigris']]}, ## Base Color: Hintomint / Bananacream / Verdigris
120
+ croatia: { name: 'Croatia', limit: 253, traits: [['cottoncandy','mauveover','oldlace']]}, ## Base Color: Cottoncandy / Mauveover / Oldlace
121
+ england: { name: 'England', limit: 168, traits: [['greymatter','martian']]}, ## Base Color: Greymatter / Martian
122
+ france: { name: 'France', limit: 317, traits: [['harbourfog','cinderella','lavender']]}, ## Base Color: Harbourfog / Cinderella / Lavender
123
+ russia: { name: 'Russia', limit: 94, traits: [['shadowgrey','salmon','cloudwhite']]}, ## Base Color: Shadowgrey / Salmon/ Cloudwhite
124
+ sweden: { name: 'Sweden', limit: 123, traits: [['brownies','dragonfruit','redvelvet']]}, ## Base Color: Brownies / Dragonfruit / Redvelvet
125
+ uruguay: { name: 'Uruguay', limit: 193, traits: [['aquamarine','nachocheez','koala']]}, ## Base Color: Aquamarine / Nachocheez / Koala
126
+ },
127
+ },
128
+ ## note: boot - different variants for world cup teams
129
+ ## Although there are 8 unique Fancies, they're actually each a variant on the same Fancy - Boot.
130
+ ## Their colours are different, and you can collect all 8 as a set
131
+
132
+ ## June
133
+ raspoutine: { name: 'Raspoutine', date: '2018-06-28', limit: 1867,
134
+ traits: ['buzzed', 'nachocheez', 'sandalwood', 'belch']},
135
+ furlin: { name: 'Furlin', date: '2018-06-26', limit: 52, exclusive: true, ids: (115..126).to_a + (128..166).to_a },
136
+ kittypride: { name: 'Kitty Pride', date: '2018-06-21', limit: 1316,
137
+ traits: ['fabulous','cinderella','garnet']},
138
+ furrmingo: { name: 'Furrmingo', date: '2018-06-14', limit: 333,
139
+ traits: ['bobtail', 'egyptiankohl', 'flamingo', 'whixtensions']},
140
+
141
+ ## May
142
+ page: { name: 'Page', date: '2018-05-31', limit: 50_000,
143
+ traits: ['rascal', 'peach', 'wasntme' ]},
144
+ "schrödingerscat": { name: "Schrödinger's Cat", date: '2018-05-20', limit: 73,
145
+ traits: ['forgetmenot','tinybox','PU20','SE25']},
146
+ chatplongeur: { name: 'Chat Plongeur', date: '2018-05-19', limit: 1910,
147
+ traits: ['aquamarine', 'skyblue', 'seafoam']},
148
+ docpurr: { name: 'Doc Purr', date: '2018-05-16', limit: 250,
149
+ traits: ['persian','spock','raisedbrow','violet','tongue']},
150
+ celestialcyberdimension: { name: 'Celestial Cyber Dimension', date: '2018-05-12', limit: 1, exclusive: true, ids: [127] },
151
+ swish: { name: 'Swish', date: '2018-05-08', limit: 2880,
152
+ traits: ['norwegianforest', 'luckystripe', 'thicccbrowz', 'orangesoda']},
153
+
154
+ ## April
155
+ flutterbee: { name: 'Flutterbee', date: '2018-04-28', limit: 275,
156
+ traits: ['cloudwhite','jaguar','lemonade','azaleablush','WE14']},
157
+ vernon: { name: 'Vernon', date: '2018-04-16', limit: 320, desc: 'Spring Equinox Kitty',
158
+ traits: ['amur','fabulous','cottoncandy','springcrocus','belleblue','soserious']}, ## first, see https://www.cryptokitties.co/kitty/696398
159
+
160
+ ## March
161
+ berry: { name: 'Berry', date: '2018-03-16', limit: 200,
162
+ traits: ['dragonfruit','thunderstruck','emeraldgreen','apricot','simple']},
163
+ pussforprogress: { name: 'Puss For Progress', date: '2018-03-08', limit: 1920, desc: "Women's Day",
164
+ traits: ['himalayan','peach','safetyvest','gerbil']},
165
+ fortunecat: { name: 'Fortune Cat', name_cn: '红包喵', date: '2018-03-08', limit: 888,
166
+ traits: ['harbourfog','calicool','swampgreen','sapphire','beard']}, ## todo: check date for china launch specials!!!
167
+ goldendragoncat: { name: 'Golden Dragon Cat', name_cn: '帝龙喵', date: '2018-03-08', limit: 1, exclusive: true, ids: [888], desc: 'China Launch' }, ## todo: check date for china launch specials!!!
168
+ goldendogcat: { name: 'Golden Dog Cat', name_cn: '旺财汪', date: '2018-03-08', limit: 11, exclusive: true, ids: [1802,1803,1805,1806,1808,1809,1812,1816]+(1825..1828).to_a, desc: 'China Launch' }, ## todo: check date for china launch specials!!!
169
+ liondance: { name: 'Lion Dance', name_cn: '咚咚锵', date: '2018-03-07', limit: 888, overflow: 1,
170
+ traits: ['manx','royalblue','googly','starstruck']},
171
+ dogcat: { name: 'Dog Cat', name_cn: '汪星爷', date: '2018-03-02', limit: 88, desc: 'Year of the Dog (Greater China)',
172
+ traits: ['tigerpunk','periwinkle','barkbrown','sweetmeloncakes','yokel']},
173
+ knightkitty: { name: 'Knight Kitty', date: '2018-03-01', limit: 11, exclusive: true, ids: (104..114).to_a },
174
+
175
+ ## February
176
+ tabby: { name: 'Tabby', date: '2018-02-26', limit: 250,
177
+ traits: ['ragamuffin','morningglory','otaku','cheeky']},
178
+ yuricatsuki: { name: 'Yuri Catsuki', date: '2018-02-20', limit: 250, desc: 'Figure Scating Kitty - Winter Olympics (Korea)',
179
+ traits: ['cymric','tiger','neckbeard','elk']},
180
+ misterpurrfect: { name: 'Mister Purrfect', date: '2018-02-14', limit: 1000, desc: "Valentine's Day",
181
+ traits: ['chocolate','baddate','strawberry','wuvme']},
182
+ earnie: { name: 'Earnie', date: '2018-02-13', limit: 500, desc: 'Earn.com - Golden Kitty Award (Product Hunt)',
183
+ traits: ['birman','orangesoda','hotrod','grim']},
184
+ cathena: { name: 'Cathena', date: '2018-02-06', limit: 1, exclusive: true, ids: [500000], desc: '500 000th Kitty' },
185
+
186
+ ## January
187
+ 'momo-chan': { name: 'Momo-chan', date: '2018-01-31', limit: 500, desc: 'Ninja Kitty',
188
+ traits: ['onyx','henna','bloodred','wolfgrey','sass']},
189
+ negato: { name: 'Negato', date: '2018-01-29', limit: 500, desc: 'Ninja Kitty',
190
+ traits: ['onyx','henna','wolfgrey','slyboots']},
191
+ stitches: { name: 'Stitches', date: '2018-01-10', limit: 500, desc: 'Zombie Kitty',
192
+ traits: ['hintomint','seafoam','swampgreen','saycheese']},
193
+
194
+ ## 2017
195
+ ## December
196
+ phuziqaat: { name: 'Phu Ziqaat', date: '2017-12-31', limit: 1000, desc: 'Alien Kitty',
197
+ traits: ['chartreux','spock','alien','pouty']},
198
+ santaclaws: { name: 'Santa Claws', date: '2017-12-12', limit: 1000, overflow: 2, desc: 'Ho Ho Ho - Santa Claus Kitty',
199
+ traits: ['cloudwhite','scarlet','beard','wild_d']},
200
+ mistletoe: { name: 'Mistletoe', date: '2017-12-09', limit: 2000, desc: "XMas Kitty",
201
+ traits: ['oldlace','crazy','gerbil']},
202
+ dracula: { name: 'Dracula', date: '2017-12-01', limit: 2000,
203
+ traits: ['laperm','spock','strawberry','WE01']},
204
+
205
+ ## November
206
+ ducat: { name: 'Du Cat', date: '2017-11-29', limit: 10_000,
207
+ traits: ['cymric','tongue']},
208
+ genesis: { name: 'Genesis', date: '2017-11-24', limit: 1, exclusive: true, ids: [1], desc: '1st Kitty'},
209
+ shipcat: { name: 'Ship Cat', date: '2017-11-23', limit: 2000,
210
+ traits: ['sphynx','orangesoda','luckystripe','crazy']},
211
+ bugcat: { name: 'Bug Cat', date: '2017-11-23', limit: 3, exclusive: true, ids: [101,102,103], desc: 'Bug Bounty Kitty' },
212
+ }
@@ -0,0 +1,52 @@
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( key, h ) ## todo: find a better name - why? why not?
20
+ ## todo/fix: add h[:name] to hash (no need for key)
21
+
22
+ ## note: use (official) chinese name for search param if present
23
+ param = h[:name_cn] ? h[:name_cn] : key
24
+
25
+ if h[:special]
26
+ q = "specialedition:#{param}" ## todo: urlescape param - why? why not?
27
+ elsif h[:exclusive] ## just use fancy too - why? why not?
28
+ q = "exclusive:#{param}"
29
+ elsif h[:prestige]
30
+ q = "purrstige:#{param}"
31
+ else ## assume fancy
32
+ q = "fancy:#{param}"
33
+ end
34
+
35
+ "https://www.cryptokitties.co/search?include=sale,sire,other&search=#{q}"
36
+ end
37
+
38
+ ## alias :kitties_special_search_url :kitties_fancy_search_url
39
+ def kitties_special_search_url( key, h ) kitties_fancy_search_url( key, h); end
40
+
41
+
42
+
43
+ ################################
44
+ # /media - image links
45
+
46
+ def media_fancy_pic_url( key, variant_key=nil ) ### todo: find a better name - why? why not?
47
+ if variant_key
48
+ "https://cryptocopycats.github.io/media/kitties/100x100/fancy-#{key}-#{variant_key}.png"
49
+ else
50
+ "https://cryptocopycats.github.io/media/kitties/100x100/fancy-#{key}.png"
51
+ end
52
+ end
@@ -0,0 +1,117 @@
1
+ # encoding: utf-8
2
+
3
+
4
+ ##################################
5
+ # Tier 0 (Base) (1-g)
6
+ # Tier 1 (Mewtation I) (h-p)
7
+ # Tier 2 (Mewtation II) (q-t)
8
+ # Tier 3 (Mewtation III) (u,v)
9
+ # Tier 4 (Mewtation IIII) (w)
10
+ #
11
+ TIER = { ## todo/fix: use an algo to calculate - why? why not?
12
+ '1' => 0,
13
+ '2' => 0,
14
+ '3' => 0,
15
+ '4' => 0,
16
+ '5' => 0,
17
+ '6' => 0,
18
+ '7' => 0,
19
+ '8' => 0,
20
+ '9' => 0,
21
+ 'a' => 0,
22
+ 'b' => 0,
23
+ 'c' => 0,
24
+ 'd' => 0,
25
+ 'e' => 0,
26
+ 'f' => 0,
27
+ 'g' => 0,
28
+ 'h' => 1,
29
+ 'i' => 1,
30
+ 'j' => 1,
31
+ 'k' => 1,
32
+ 'm' => 1,
33
+ 'n' => 1,
34
+ 'o' => 1,
35
+ 'p' => 1,
36
+ 'q' => 2,
37
+ 'r' => 2,
38
+ 's' => 2,
39
+ 't' => 2,
40
+ 'u' => 3,
41
+ 'v' => 3,
42
+ 'w' => 4,
43
+ 'x' => nil
44
+ }
45
+
46
+ ## (quick 'n' dirty) kai to mutation/mewtation level (I,II,III,IIII)
47
+ MUTATION_LEVEL = {
48
+ '1' => '',
49
+ '2' => '',
50
+ '3' => '',
51
+ '4' => '',
52
+ '5' => '',
53
+ '6' => '',
54
+ '7' => '',
55
+ '8' => '',
56
+ '9' => '',
57
+ 'a' => '',
58
+ 'b' => '',
59
+ 'c' => '',
60
+ 'd' => '',
61
+ 'e' => '',
62
+ 'f' => '',
63
+ 'g' => '',
64
+ 'h' => 'I',
65
+ 'i' => 'I',
66
+ 'j' => 'I',
67
+ 'k' => 'I',
68
+ 'm' => 'I',
69
+ 'n' => 'I',
70
+ 'o' => 'I',
71
+ 'p' => 'I',
72
+ 'q' => 'II',
73
+ 'r' => 'II',
74
+ 's' => 'II',
75
+ 't' => 'II',
76
+ 'u' => 'III',
77
+ 'v' => 'III',
78
+ 'w' => 'IIII',
79
+ 'x' => ''
80
+ }
81
+ MEWTATION_LEVEL = MUTATION_LEVEL ## add alias
82
+
83
+ MUTATION_PAIR = {
84
+ '1' => '', ## todo: use nil for "" - why? why not?
85
+ '2' => '',
86
+ '3' => '',
87
+ '4' => '',
88
+ '5' => '',
89
+ '6' => '',
90
+ '7' => '',
91
+ '8' => '',
92
+ '9' => '',
93
+ 'a' => '',
94
+ 'b' => '',
95
+ 'c' => '',
96
+ 'd' => '',
97
+ 'e' => '',
98
+ 'f' => '',
99
+ 'g' => '',
100
+ 'h' => '1+2',
101
+ 'i' => '3+4',
102
+ 'j' => '5+6',
103
+ 'k' => '7+8',
104
+ 'm' => '9+a',
105
+ 'n' => 'b+c',
106
+ 'o' => 'd+e',
107
+ 'p' => 'f+g',
108
+ 'q' => 'h+i',
109
+ 'r' => 'j+k',
110
+ 's' => 'm+n',
111
+ 't' => 'o+p',
112
+ 'u' => 'q+r',
113
+ 'v' => 's+t',
114
+ 'w' => 'u+v',
115
+ 'x' => ''
116
+ }
117
+ MEWTATION_PAIR = MUTATION_PAIR ## add alias
@@ -0,0 +1,108 @@
1
+ # encoding: utf-8
2
+
3
+
4
+ class GenesPage
5
+
6
+ def build
7
+ buf = ""
8
+ buf << "# Genes (#{TRAITS.keys.size} x 4)\n\n"
9
+
10
+ headings = []
11
+ TRAITS.values.each do |trait|
12
+ headings << "#{trait[:name]} (#{trait[:genes]})"
13
+ end
14
+
15
+ buf << headings.join( " • " )
16
+ buf << "\n\n"
17
+
18
+
19
+ TRAITS.values.each do |trait|
20
+
21
+ puts "Kai Name"
22
+ items = []
23
+ Kai::ALPHABET.each do |kai|
24
+ value = trait[:kai][kai]
25
+ code = "#{trait[:code]}%02d" % Kai::NUMBER[kai] ## e.g. FU00, FU01, FU02, etc.
26
+ if value =~ /_[0-9a-z]$/
27
+ if value.start_with?( "totesbasic" ) ## note: special case for three totesbasic traits
28
+ else
29
+ value = '?'
30
+ end
31
+ end
32
+ items << [kai, code, value]
33
+ end
34
+
35
+ items.each do |item|
36
+ puts "#{item[0]} #{item[1]} #{item[2]}"
37
+ end
38
+
39
+ buf << "## #{trait[:name]} (#{trait[:code]}) - Genes #{trait[:genes]}\n\n"
40
+ buf << make_table( items )
41
+ buf << "\n\n"
42
+ end
43
+
44
+ puts buf
45
+
46
+ buf
47
+ end ## method build
48
+
49
+
50
+
51
+ def make_table( items )
52
+ rows = make_rows( items, columns: 2 ) ## was 4
53
+ pp rows
54
+
55
+ buf = ""
56
+ buf << "|Kai|Code|Name |Kai|Code|Name |\n"
57
+ buf << "|--:|---:|-------------|--:|---:|------------|\n"
58
+
59
+ rows.each do |row|
60
+ buf << "| "
61
+
62
+ parts = row.map do |item|
63
+ kai = item[0]
64
+ name = item[2]
65
+
66
+ if name == '?'
67
+ cattribute = "?"
68
+ else
69
+ if name.start_with?( "totesbasic" ) ## note: special case for three totesbasic traits
70
+ q = "totesbasic"
71
+ else
72
+ q = name
73
+ end
74
+ cattribute = "**[#{name}](#{kitties_search_url(q)})** #{MEWTATION_LEVEL[kai]}"
75
+ end
76
+
77
+ "#{item[0]} | #{item[1]} | #{cattribute}"
78
+ end
79
+
80
+ buf << parts.join( " | " )
81
+ buf << " |\n"
82
+ end
83
+
84
+ buf
85
+ end
86
+
87
+
88
+ ## helpers
89
+ def make_rows( items, columns: 2 )
90
+ offset = items.size / columns
91
+ pp offset
92
+
93
+ rows = []
94
+ offset.times.with_index do |row|
95
+ ## note: construct [items[row],items[offset+row],items[offset*2+row], ...]
96
+ rows << columns.times.with_index.map { |col| items[offset*col+row] }
97
+ end
98
+ rows
99
+ end
100
+
101
+
102
+ def save( path )
103
+ File.open( path, "w:utf-8" ) do |f|
104
+ f.write build
105
+ end
106
+ end
107
+
108
+ end # class GenesPage
@@ -0,0 +1,294 @@
1
+ # encoding: utf-8
2
+
3
+
4
+ TRAITS_TIMELINE =
5
+ {
6
+ ## 2018
7
+ ## november
8
+ dune: { date: '2018-11-21' },
9
+ secretgarden: { date: '2018-11-21' },
10
+ floorislava: { date: '2018-11-21' },
11
+ junglebook: { date: '2018-11-21' },
12
+
13
+ meowgarine: { date: '2018-11-16' },
14
+ cornflower: { date: '2018-11-16' },
15
+ icicle: { date: '2018-11-16' },
16
+ hotcocoa: { date: '2018-11-16' },
17
+ firstblush: { date: '2018-11-16' },
18
+
19
+ featherbrain: { date: '2018-11-13' },
20
+ foghornpawhorn: { date: '2018-11-13' },
21
+ alicorn: { date: '2018-11-13' },
22
+ wyrm: { date: '2018-11-13' },
23
+
24
+ mittens: { date: '2018-11-06' },
25
+ arcreactor: { date: '2018-11-06' },
26
+ allyouneed: { date: '2018-11-06' },
27
+ gyre: { date: '2018-11-06' },
28
+ moonrise: { date: '2018-11-06' },
29
+
30
+ ## october
31
+ metime: { date: '2018-10-26' },
32
+ jacked: { date: '2018-10-26' },
33
+ prism: { date: '2018-10-26' },
34
+
35
+ isotope: { date: '2018-10-23' },
36
+ bridesmaid: { date: '2018-10-23' },
37
+ downbythebay: { date: '2018-10-23' },
38
+ gemini: { date: '2018-10-23' },
39
+ kaleidoscope: { date: '2018-10-23' },
40
+
41
+ ## thatsawrap: { date: '2018-10-21' }, ## todo: move prestige to fancies!!!
42
+ ## duckduckcat: { date: '2018-10-19' }, ## todo: move prestige to fancies!!!
43
+
44
+ siberian: { date: '2018-10-17' },
45
+ lynx: { date: '2018-10-17' },
46
+ toyger: { date: '2018-10-17' },
47
+ burmilla: { date: '2018-10-17' },
48
+ liger: { date: '2018-10-17' },
49
+
50
+ moue: { date: '2018-10-10' },
51
+ majestic: { date: '2018-10-10' },
52
+ satiated: { date: '2018-10-10' },
53
+ struck: { date: '2018-10-10' },
54
+ delite: { date: '2018-10-10' },
55
+
56
+ myparade: { date: '2018-10-03' },
57
+ roadtogold: { date: '2018-10-03' },
58
+
59
+
60
+ ## september
61
+ dreamboat: { date: '2018-09-21' },
62
+ fallspice: { date: '2018-09-21' },
63
+ mallowflower: { date: '2018-09-21' },
64
+ hanauma: { date: '2018-09-21' },
65
+ summerbonnet: { date: '2018-09-21' },
66
+
67
+ ## prune: { date: '2018-09-19' }, ## todo: move prestige to fancies!!!
68
+ ## furball: { date: '2018-09-19' }, ## todo: move prestige to fancies!!!
69
+
70
+ firedup: { date: '2018-09-06' },
71
+ hacker: { date: '2018-09-06' },
72
+ drama: { date: '2018-09-06' },
73
+ candyshoppe: { date: '2018-09-06' },
74
+
75
+ asif: { date: '2018-09-05' },
76
+
77
+ ## august
78
+ dragonwings: { date: '2018-08-29' },
79
+ aflutter: { date: '2018-08-29' },
80
+ ducky: { date: '2018-08-29' },
81
+
82
+ chantilly: { date: '2018-08-23' },
83
+ mekong: { date: '2018-08-23' },
84
+ fox: { date: '2018-08-23' },
85
+ lykoi: { date: '2018-08-23' },
86
+
87
+ tundra: { date: '2018-08-17' },
88
+ glacier: { date: '2018-08-17' },
89
+ hyacinth: { date: '2018-08-17' },
90
+ shamrock: { date: '2018-08-17' },
91
+
92
+ inflatablepool: { date: '2018-08-08' },
93
+ peppermint: { date: '2018-08-08' },
94
+ ooze: { date: '2018-08-08' },
95
+ cyborg: { date: '2018-08-08' },
96
+
97
+ scorpius: { date: '2018-08-01' },
98
+ splat: { date: '2018-08-01' },
99
+ vigilante: { date: '2018-08-01' },
100
+ avatar: { date: '2018-08-01' },
101
+
102
+ ## july
103
+ topoftheworld: { date: '2018-07-25' },
104
+ confuzzled: { date: '2018-07-25' },
105
+ samwise: { date: '2018-07-25' },
106
+ walrus: { date: '2018-07-25' },
107
+
108
+ olive: { date: '2018-07-20' },
109
+ pinefresh: { date: '2018-07-20' },
110
+ oasis: { date: '2018-07-20' },
111
+ dioscuri: { date: '2018-07-20' },
112
+
113
+ juju: { date: '2018-07-18' },
114
+ frozen: { date: '2018-07-18' },
115
+
116
+ kalahari: { date: '2018-07-13' },
117
+ atlantis: { date: '2018-07-13' },
118
+
119
+ fangtastic: { date: '2018-07-06' },
120
+
121
+ ## june
122
+ littlefoot: { date: '2018-06-29' },
123
+ dragontail: { date: '2018-06-29' },
124
+
125
+ padparadscha: { date: '2018-06-28' },
126
+ rosequartz: { date: '2018-06-28' },
127
+ universe: { date: '2018-06-28' },
128
+
129
+ martian: { date: '2018-06-22' },
130
+ redvelvet: { date: '2018-06-22' },
131
+ brownies: { date: '2018-06-22' },
132
+
133
+ wowza: { date: '2018-06-19' },
134
+ tendertears: { date: '2018-06-19' },
135
+
136
+ impish: { date: '2018-06-14' },
137
+
138
+ finalfrontier: { date: '2018-06-11' },
139
+
140
+ cobalt: { date: '2018-06-09' },
141
+ cashewmilk: { date: '2018-06-09' },
142
+ buttercup: { date: '2018-06-09' },
143
+
144
+ manul: { date: '2018-06-05' },
145
+ balinese: { date: '2018-06-05' },
146
+ kurilian: { date: '2018-06-05' },
147
+
148
+ ## may
149
+ unicorn: { date: '2018-05-31' },
150
+ flapflap: { date: '2018-05-31' },
151
+
152
+ dahlia: { date: '2018-05-29' },
153
+ palejade: { date: '2018-05-29' },
154
+ autumnmoon: { date: '2018-05-29' },
155
+
156
+ razzledazzle: { date: '2018-05-24' },
157
+ highsociety: { date: '2018-05-24' },
158
+ rorschach: { date: '2018-05-24' },
159
+
160
+ tinybox: { date: '2018-05-19' },
161
+
162
+ butterscotch: { date: '2018-05-10' },
163
+ garnet: { date: '2018-05-10' },
164
+ mertail: { date: '2018-05-10' },
165
+ pearl: { date: '2018-05-10' },
166
+
167
+ highlander: { date: '2018-05-08' },
168
+ koladiviya: { date: '2018-05-08' },
169
+
170
+ swarley: { date: '2018-05-04' },
171
+ oceanid: { date: '2018-05-04' },
172
+ chameleon: { date: '2018-05-04' },
173
+ bornwithit: { date: '2018-05-04' },
174
+
175
+ ## april
176
+ cinderella: { date: '2018-04-27' },
177
+ lavender: { date: '2018-04-27' },
178
+
179
+ daemonhorns: { date: '2018-04-24' },
180
+ salty: { date: '2018-04-24' },
181
+
182
+ shale: { date: '2018-04-19' },
183
+
184
+ eclipse: { date: '2018-04-17' },
185
+ parakeet: { date: '2018-04-17' },
186
+
187
+ daemonwings: { date: '2018-04-13' },
188
+
189
+ caffeine: { date: '2018-04-10' },
190
+
191
+ frosting: { date: '2018-04-02' },
192
+ patrickstarfish: { date: '2018-04-02' },
193
+ mintmacaron: { date: '2018-04-02' },
194
+
195
+
196
+ ## march
197
+ doridnudibranch: { date: '2018-03-30' },
198
+
199
+ springcrocus: { date: '2018-03-20' },
200
+
201
+ thunderstruck: { date: '2018-03-16' },
202
+ rascal: { date: '2018-03-16' },
203
+
204
+ dragonfruit: { date: '2018-03-14' },
205
+
206
+ belch: { date: '2018-03-09' },
207
+
208
+ pixiebob: { date: '2018-03-08' },
209
+ poisonberry: { date: '2018-03-08' },
210
+ safetyvest: { date: '2018-03-08' },
211
+
212
+ cyan: { date: '2018-03-05' },
213
+
214
+
215
+ ## february
216
+ missmuffett: { date: '2018-02-28' },
217
+ wiley: { date: '2018-02-28' },
218
+
219
+ dippedcone: { date: '2018-02-23' },
220
+ leopard: { date: '2018-02-23' },
221
+
222
+ harbourfog: { date: '2018-02-20' },
223
+
224
+ baddate: { date: '2018-02-13' },
225
+
226
+ wuvme: { date: '2018-02-12' },
227
+ yokel: { date: '2018-02-12' },
228
+ starstruck: { date: '2018-02-12' },
229
+
230
+ egyptiankohl: { date: '2018-02-09' },
231
+ bobtail: { date: '2018-02-09' },
232
+
233
+ tiger: { date: '2018-02-06' },
234
+
235
+ birman: { date: '2018-02-02' },
236
+ coralsunrise: { date: '2018-02-02' },
237
+
238
+ ## january
239
+ forgetmenot: { date: '2018-01-30' },
240
+ savannah: { date: '2018-01-30' },
241
+ norwegianforest: { date: '2018-01-30' },
242
+ twilightsparkle: { date: '2018-01-30' },
243
+
244
+ trioculus: { date: '2018-01-26' },
245
+
246
+ morningglory: { date: '2018-01-20' },
247
+ apricot: { date: '2018-01-20' },
248
+ turtleback: { date: '2018-01-20' },
249
+ wasntme: { date: '2018-01-20' },
250
+ cheeky: { date: '2018-01-20' },
251
+
252
+ sapphire: { date: '2018-01-17' },
253
+
254
+ nachocheez: { date: '2018-01-14' },
255
+ koala: { date: '2018-01-14' },
256
+ chronic: { date: '2018-01-14' },
257
+ onyx: { date: '2018-01-14' },
258
+ sass: { date: '2018-01-14' },
259
+
260
+ slyboots: { date: '2018-01-13' },
261
+
262
+ azaleablush: { date: '2018-01-10' },
263
+ spangled: { date: '2018-01-10' },
264
+
265
+ lilac: { date: '2018-01-09' },
266
+ bananacream: { date: '2018-01-09' },
267
+ verdigris: { date: '2018-01-09' },
268
+
269
+ neckbeard: { date: '2018-01-06' },
270
+ grim: { date: '2018-01-06' },
271
+ grimace: { date: '2018-01-06' },
272
+ stunned: { date: '2018-01-06' },
273
+
274
+ wonky: { date: '2018-01-04' },
275
+ babypuke: { date: '2018-01-04' },
276
+ pumpkin: { date: '2018-01-04' },
277
+
278
+ thundergrey: { date: '2018-01-03' },
279
+
280
+
281
+ ## 2017
282
+ ## december
283
+ selkirk: { date: '2017-12-31' },
284
+ icy: { date: '2017-12-31' },
285
+ flamingo: { date: '2017-12-31' },
286
+ seafoam: { date: '2017-12-31' },
287
+
288
+ elk: { date: '2017-12-28' },
289
+
290
+ hintomint: { date: '2017-12-22' },
291
+
292
+ serpent: { date: '2017-12-20' },
293
+ alien: { date: '2017-12-20' },
294
+ }
@@ -4,7 +4,7 @@
4
4
  class Kittyverse
5
5
 
6
6
  MAJOR = 0
7
- MINOR = 1
7
+ MINOR = 2
8
8
  PATCH = 0
9
9
  VERSION = [MAJOR,MINOR,PATCH].join('.')
10
10
 
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: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
@@ -69,7 +69,13 @@ files:
69
69
  - README.md
70
70
  - Rakefile
71
71
  - lib/kittyverse.rb
72
+ - lib/kittyverse/catalog.rb
73
+ - lib/kittyverse/fancies.rb
74
+ - lib/kittyverse/links.rb
75
+ - lib/kittyverse/mewtations.rb
76
+ - lib/kittyverse/pages/genes.rb
72
77
  - lib/kittyverse/traits.rb
78
+ - lib/kittyverse/traits_timeline.rb
73
79
  - lib/kittyverse/version.rb
74
80
  - test/helper.rb
75
81
  - test/test_traits.rb