Create a Deck Shuffler in Scratch

Welcome back! In this tutorial we will be creating a deck shuffler and visualizing the shuffled deck. You may notice that the deck within the costumes is in random order in the graphical template but whether or not the deck is ordered at the start does not affect the shuffling. The interface has a dual-fit screen one to visualize the card product on the right and one to visualize the numerical representation of what is going on/how the shuffling is occurring on the left.

Objective: To learn about the list datatype, important features of lists, and the temporary SWAP variable.

Final Product (one whole deck shuffling):


Graphical Template: Link

Scripts:

Deck Shuffling Scratch Scripts
Deck Shuffling Scripts
Focus: See if you can understand the function of the different individual pieces of code What is the purpose of "visualize deck" broadcasting statement? the first repeat 52 block? the repeat 1000 block? What happens if you were to change the repeat 1000 to another number? What do you expect will happen to the deck if the number of very low? very high?

Completed Project: Link


Comments