Última actividad 4 days ago

Generate a deck of cards.

june's Avatar june revisó este gist 4 days ago. Ir a la revisión

1 file changed, 25 insertions

deck.nv(archivo creado)

@@ -0,0 +1,25 @@
1 + ||:: form a deck :suits: (spades hearts diamonds clubs)
2 + :ranks: (2 3 4 5 6 7 8 9 jack queen king ace)
3 +
4 + |:: form a deck? :suits: $suit|
5 + :: match $suit to a rank
6 + :used suits: $suit
7 + |:: form a deck|
8 + :: reset suits
9 +
10 + |:: match $suit to a rank? :ranks: $rank|
11 + :: create a $suit $rank card
12 + :used ranks: $rank
13 + |:: match $suit to a rank|
14 + :: reset ranks
15 +
16 + |:: create a $suit $rank card|
17 + :deck: $rank of $suit
18 +
19 + |:: reset ranks? :used ranks: $rank|
20 + :ranks: $rank
21 + |:: reset ranks|
22 +
23 + |:: reset suits? :used suits: $suit|
24 + :suits: $suit
25 + |:: reset suits|
Siguiente Anterior