Drawing Cards?

Blitz3D Forums/Blitz3D Beginners Area/Drawing Cards?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

thats kinda what i've been doing but i need to draw new cards every turn out of the deck and be able to draw cards out of the discard pile randomly for this card game.

anyways this is kinda working:
Function DrawHand(drawnum)

Local x=1

.Draw
drawrand=Rand(1,total)
Print drawrand
For c.card=Each card
If c\num=drawrand And c\where$="" Then 
	c\where$="hand"
	c\x=x*100
	c\y=GraphicsHeight()-100
	DebugLog  "Card "+x+" Found"
	If x<drawnum Then x=x+1:Else If x=drawnum Then Return  
Else 
Goto Draw
EndIf
Next 


End Function 


...but it results in finding one card and then gets stuck in an endless loop