All pastes #63619 Raw Edit

Miscellany

public text v1 · immutable
#63619 ·published 2006-06-10 11:29 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 pack(cards)
for t = 0 to cards
pack(cards)=0
next t

dim deck(cards)
for t=0 to cards
 repeat
 card=rnd(cards)
 if pack(card)=0 then deck(t)=card else fail=1
 until fail=0
next t

x=20
y=20

for t = 1 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$=" clubs"
  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