Page 1 of 1

Playing Card Demo

Posted: Mon Mar 18, 2013 8:02 pm
by Ref
Re-inventing the wheel.
Want to create a number of card games sooo... need some playing card functions.
Result - a preliminary card library.

Code: Select all

local c = require 'cards'
and

Code: Select all

deck, order = c:createDeck()
returns:
a deck of 52 cards (quads)
order - a table of 52 randum numbers
The order in deck is:
1-13 are clubs (A 1 2 3 4 5 6 7 8 9 10 J Q K )
14-26 are diamonds
27-39 are spades
40-52 are hearts
Some other preliminary functions are provided for the display of the cards.
Edit: Changed dealing with a tweening function (outQuint).

Re: Playing Card Demo

Posted: Tue Mar 19, 2013 5:03 am
by xXxMoNkEyMaNxXx
No way. I had the exact same idea, except I only wrote documentation for a library that doesn't exist. Cool!