+state = {
+ card_types: [
+ {text: "Rusty Camel"}
+ {text: "Angry Ocelot"}
+ {text: "Unruly Parsnip"}
+ ],
+ # values are indexes into card_types array
+ my_cards: [0, 0, 0, 1, 1, 2],
+ your_cards: [0, 1, 1, 2, 2, 2],
+ auto_shuffle: true
+}
+
+unless Array::shuffle?
+ Array::shuffle = ->
+ return if @length is 0
+ top = @length
+
+ while --top
+ current = Math.floor(Math.random() * (top + 1))
+ tmp = @[current]
+ @[current] = @[top]
+ @[top] = tmp
+ return
+