forked from bslatkin/template-perf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cats.go
205 lines (200 loc) · 3.87 KB
/
cats.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
package main
import (
"math/rand"
"time"
)
var (
// From http://en.wikipedia.org/wiki/Popular_cat_names
names = []string{
"Alfie",
"Angel",
"Baby",
"Bella",
"Blackie",
"Blacky",
"Buddy",
"Caramel",
"Casper",
"Chanel",
"Charlie",
"Charlotte",
"Charly",
"Chloe",
"Cleo",
"Daisy",
"Felix",
"Fluffy",
"Fraidy",
"Félix",
"Ginger",
"Grisou",
"Jack",
"Jasper",
"Kitty",
"Lily",
"Lisa",
"Lucky",
"Lucy",
"Maggie",
"Max",
"Millie",
"Mimi",
"Minette",
"Minka",
"Minou",
"Missy",
"Misty",
"Molly",
"Moritz",
"Muffin",
"Muschi",
"Oliver",
"Oreo",
"Oscar",
"Pacha",
"Patch",
"Patches",
"Poppy",
"Princess",
"Puss",
"Sam",
"Samantha",
"Sammy",
"Sassy",
"Scaredy",
"Shadow",
"Simba",
"Simon",
"Smokey",
"Smudge",
"Sooty",
"Sophie",
"Susi",
"Sylvester",
"Ti-Mine",
"Tiger",
"Tigger",
"Tom",
"Whiskers",
}
// From http://www.seregiontica.org/Colors/intro.htm
colors = []string{
"Bengal",
"Black",
"Black Classic Tabby with White",
"Black Classic Torbie with White",
"Black Mac Tabby",
"Black Mackerel Tabby",
"Black Mackerel Torbie with White",
"Black Spotted Tabby",
"Black Ticked Tabby",
"Black Tortie",
"Black Tortie with White",
"Black with White",
"Black with White (van pattern)",
"Black with White (Van Pattern)",
"Blue",
"Blue & Black Mac Tabby",
"Blue and a Brown Mackerel Tabby",
"Blue Classic Tabby",
"Blue Cream Tortie",
"Blue Cream with White",
"Blue Lynx Point",
"Blue Mackerel Tabby",
"Blue Mackerel Tabby with White",
"Blue Point",
"Blue Spotted Tabby",
"Blue Tortie",
"Blue Tortie with White",
"Brown Classic Tabby",
"Brown Classic Tabby with White",
"Brown Classic Torbie",
"Brown Classic Torbie with White",
"Brown Mackeral Torbie",
"Brown Mackerel Tabby",
"Brown Mackerel Tabby with White",
"Brown Mackerel Torbie",
"Brown Mackerel Torbie with White",
"Brown Spotted Tabby",
"Brown Spotted Torbie with White",
"Brown Ticked Tabby",
"Chocolate",
"Classic Tabby",
"Cream",
"Cream Classic Tabby",
"Cream Point",
"Cream Spotted Tabby",
"Cream with White",
"Pointed with White",
"Red",
"Red & Black Classic Tabby",
"Red & Brown Classic Tabby",
"Red and a Cream Mackerel Tabby",
"Red and Cream Mac Tabby",
"Red Classic Tabby",
"Red Classic Tabby with White",
"Red Mackerel Tabby",
"Red Point",
"Red Ticked Tabby",
"Red Ticked Tabby with White",
"Seal & Blue Point with White (Bi-Color Pattern)",
"Seal Blue Point with White",
"Seal Lynx Point",
"Seal Point",
"Seal Point with White (Mitted Pattern)",
"Seal Tortie Point with White",
"Silver Classic Tabby",
"Silver Classic Torbie",
"Silver Classic Torbie with White",
"Silver Mackerel Tabby",
"Silver Spotted Tabby",
"Silver Tabby with White",
"Silver Tabby with White (Van Pattern)",
"Silver Ticked Tabby",
"Siver Ticked Tabby",
"Solid Black",
"Solid Chocolate",
"Solid White",
"Spotted Tabby",
"Tabby with White",
"Ticked Tabby",
"Tortie/Torbie with White",
"White",
}
sexes = []string{
"Male",
"Male (neutered)",
"Female",
"Female (neutered)",
"Other",
"Unknown",
}
legOptions []int
)
func init() {
rand.Seed(time.Now().UnixNano())
for i := 0; i < 100; i++ {
legOptions = append(legOptions, 4)
}
for i := 0; i < 10; i++ {
legOptions = append(legOptions, 3)
}
for i := 0; i < 5; i++ {
legOptions = append(legOptions, 2)
}
for i := 0; i < 2; i++ {
legOptions = append(legOptions, 2)
}
legOptions = append(legOptions, 0)
}
func getCats(count int) []Data {
result := make([]Data, 0, count)
for i := 0; i < count; i++ {
name := names[rand.Intn(len(names))]
color := colors[rand.Intn(len(colors))]
sex := sexes[rand.Intn(len(sexes))]
legs := legOptions[rand.Intn(len(legOptions))]
result = append(result, Data{name, color, sex, legs})
}
return result
}