All pastes #63631 Raw Edit

Miscellany

public text v1 · immutable
#63631 ·published 2006-06-10 11:52 UTC
rendered paste body
Rem Project: cards
Rem Created: 18/03/2006 09:58:02

Rem ***** Main Source File *****
#constant clubs 1
#constant diamonds 2
#constant hearts 3
#constant spades 4

randomize timer()

jokers = 2
cards=51+jokers
dim deck(cards)

for t=0 to cards
  deck(t)=t+1
next t

for t=0 to 400
a=rnd(cards)
b=rnd(cards)
tmp=deck(a)
deck(a) = deck(b)
deck(b) = tmp
next t

x=20
y=20

for t = 0 to cards
 if deck(t)>0
  value=deck(t)+1
  suit$=" clubs"
  ink rgb(255,255,255),0
 endif
 if deck(t)>12
  value=deck(t)-11
  suit$=" diamonds"
  ink rgb(255,0,0),0
 endif
 if deck(t)>25
  value=deck(t)-24
  suit$=" hearts"
  ink rgb(255,0,0),0
 endif
 if deck(t)>38
  value=deck(t)-37
  suit$=" spades"
  ink rgb(255,255,255),0
 endif
 if deck(t)>51
  value=deck(t)-50
  suit$="Joker"
  ink rgb(0,255,255),0
 endif
text x,y,str$(value)+suit$
inc y,20
if y=13*20+20 then inc x,100 : y=20
next t

wait key