As part of CS50, I had to submit a description of my Scratch program. Here is that description:
My project mainly works by creating many clones of one sprite, and having them interact with each other. When the flag is clicked, only the start screen's and the speaker's scripts start running. Both do basic setup steps, like going to the correct position and and changing to the correct costume. The code in SoundToggle just tells the sprite that when it is clicked, first it must switch to the next costume, then either broadcast soundOff or soundOn. The Start Screen waits to be clicked; and when it is it switches to the background costume and tells Tiles to start. First, Tiles set all variables to zero and clear all the lists. Then, it hide and makes 16 clones. The blocks under "when I start as a clone" trigger each time a clone is created. The scripts give each clone an ID based on how many clones have been made so far. Then, they run my "findSpot" block, which gives each clone a random position and adds that position to the list of ta ken spots. Finally, they run a forever loop that tells them to disappear when a pair is made (more on this later). The findSpot block runs by picking x and y coordinates until it finds two that are not taken, the going to that position and adding the x-pos * 10 + the y-pos to the taken spots list. The reason that I am multiplying by 10 is that this is the only way that I am aware of to save two numbers in one spot on a list.
The rest of the code is basically in under the "when this sprite clicked" block. When one of the clones is clicked, first the program checks to make sure that there are either 0 or 1 flipped tile already and that the clicked clone wasn't already flipped. To find which costume that clone should switch to, the program checks if the tile's ID is odd or even, then calculates the corresponding costume. From there it adds the number now visible to a list of visible numbers, then checks to see how many tiles have already been flipped. If there are two already flipped, the program checks to see if they are a pair. If the are, They hide, if not, it broadcasts "FlipDown!" telling all clones to turn to turn back to their blank side.
This is a blog created by, me, Max N., about my experience at my new learning program. This blog is also about my life regarding my learning at home and out of CSCL (http://www.partsandcrafts.org/scl/), the homeschool resource center I am attending. On this blog, I will be posting short articles relating to the labels below. You can sign up to get daily emails letting you know about recent posts by submitting your email in the box below on the right. Enjoy the blog!!!
Wait! What? OK but most people will not understand much if any of this Max. But what we all will understand is YOUR understanding of this technical programing language and coding procedures. What also is demonstrated here is your excellent writing capabilities. But remember rule #1 when communication a message: Know Your Audience.
ReplyDeleteRue
This is very complicated; it's great that you understand it and are fluent in Scratch. I had never seen a computer language that uses a graphical user interface and makes it hard to make grammatical errors.
ReplyDelete