I wasn't saying that your code wouldn't work... well actually it didn't as you posted it as there are a few colons missing and some undimensioned array errors!
But once you've fixed those, it works fine!
So yes, it works - I was just saying it's not the most eloquent way to do it and isn't ideal example for a newcomer. I'll always be happy if someone offers me a better way to do something - including my example.
First of all, in your code, you don't seed the random number generator. Without this, the cards will always be dealt in the same order each time you run the program - not ideal for a card game!
Also, you are using the Rnd command to select a random value which will fail more and more as all the cards are dealt. When it does fail you are using Goto to repeat the Rnd until it hits a valid number.
I don't like Goto (as you may already know) - it encourages sloppy programming and you can
always avoid it, so you should.
Sorry - I'm notorious for whinging about the use of Goto, but I've never yet been shown a program that cannot be written without using it!
All this slows your program down - not much admittedly, but when you add more and more every little bit helps!
You program on my machine completes in 1326 milliseconds.
My example sets up the screen mode, initiaizes the random seed and prints the cards using colours (using the notoriously slow Ink command) - yet still completes in 513 milliseconds.
If I alter my program to do exactly what yours does, it completes in 51 milliseconds! What's that, 26 times faster? What's more, by adding Sync Rate 0 after the Sync On, it drops to 26 milliseconds.
T1=Timer()
Sync On
Hearts$= "AH2H3H4H5H6H7H8H9HTHJHQHKH"
Clubs$= "AC2C3C4C5C6C7C8C9CTCJCQCKC"
Diamonds$="AD2D3D4D5D6D7D8D9DTDJDQDKD"
Spades$= "AS2S3S4S5S6S7S8S9STSJSQSKS"
Pack$=Hearts$+Clubs$+Diamonds$+Spades$
For N=1 To 52
NextCard=Rnd(Len(Pack$)/2-1)
Card$=Mid$(Pack$,NextCard*2+1)+Mid$(Pack$,NextCard*2+2)
Pack$=Left$(Pack$,NextCard*2)+Right$(Pack$,Len(Pack$)-NextCard*2+2)
Print Card$;" ";
Next N
Sync
T2=Timer()
Print:Print
Print T2-t1; " milliseconds"
Finally, 10044 didn't mean a lot to me really, whereas KH for King of Hearts or 8C for the Eight of Clubs does.
So, I'm not saying your snippet was wrong or calling it useless or anything like that - I was just pointing out an alternative method to do it.
There's no right and wrong way to write a program - it's just that some ways are better than others and in this game, 'better' usually means 'faster'.
TDK_Man