This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-26 12:13:47

racypy
Scratcher
Registered: 2012-03-17
Posts: 28

Something is wrong, but I don't know what.

I've made a little project that generates a pack of cards, shuffles it and then deals out some hands.
http://scratch.mit.edu/projects/racypy/2637063

It seems to work okay until you ask it to do a large deal (over 5 hands of 5 cards for example).
The fact that it works for the lover numbers made me think that the basic method I've used is okay, but maybe I'd missed something.

Any help appreciated!
mark
smile

Offline

 

#2 2012-06-26 12:17:14

racypy
Scratcher
Registered: 2012-03-17
Posts: 28

Re: Something is wrong, but I don't know what.

Sorry, forgot to make the link clickable
cards

Offline

 

#3 2012-06-26 14:17:18

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Something is wrong, but I don't know what.

in your "deal" script, you've got hands and cards per hand all mixed up so your vector calculation places the cards over the wrong place holders - very neat algorithm apart from that  smile

Offline

 

#4 2012-06-27 00:10:29

racypy
Scratcher
Registered: 2012-03-17
Posts: 28

Re: Something is wrong, but I don't know what.

Ratty1967UK wrote:

in your "deal" script, you've got hands and cards per hand all mixed up so your vector calculation places the cards over the wrong place holders

Thanks Ratty1967, I'll look at this again and see if I can fix it!
mark

Offline

 

#5 2012-06-27 01:33:06

racypy
Scratcher
Registered: 2012-03-17
Posts: 28

Re: Something is wrong, but I don't know what.

Hi Ratty,
Many thanks for your comment! I've switched the variable around and it now works!
thanks

Offline

 

Board footer