TGC Codebase Backup



Random numbers once Cards by HomerS

3rd Nov 2012 4:03
Summary

If you want to shuffel cards, use this. Change "COUNT=10" in the number of cards you have/want. Hard to find on the internet, so made one myself for darkbasic classic.



Description

If you want to shuffel cards, use this. Change "COUNT" in the number of cards you have.
Hard to find on the internet, so made one myself for darkbasic classic.
Onley have to manage it in a Function. Suggestions are welcome.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    `*********************
`**RANDOM COUNT ONCE**
`*********************

repeat

COUNT=10
 cls
 dim CARD(COUNT)

 for t=1 to COUNT

 start:
		CARD_CHOISE=rnd(COUNT-1)+1

		for r=1 to t
			read CARD(r)
			if CARD(r)=CARD_CHOISE
				goto start
			endif
		next r
			CARD(t)=CARD_CHOISE

 next t

 for d=1 to COUNT
	print CARD(d)
 next d

 wait key

 undim CARD(COUNT)

until escapekey()=1

end