Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 02f980078d
Fetching contributors…

Cannot retrieve contributors at this time

executable file 32 lines (26 sloc) 0.622 kB
#!/usr/bin/env io
// By Jason Sackett
Random setSeed(Date clone now asNumber)
List shuffle := method(
for(i, 1, size - 1,
swapIndices(i, Random value(0, size) floor)
)
)
Deck := Object clone do(
init := method(
self cards := List clone
list("h", "d", "c", "s") foreach(suit,
for(value, 2, 14, cards append(value asString .. suit))
)
)
init
shuffle := method(cards shuffle)
dealCard := method(cards pop)
show := method(cards foreach(i, card, write(card, " ")); "\n" print)
)
Deck show
Deck shuffle
Deck show
Deck dealCard println
Deck dealCard println
Deck dealCard println
Jump to Line
Something went wrong with that request. Please try again.