Lab 6

Click HERE to view my Problem #1

Click HERE to view my Problem #3

Lab 6 Overview

This lab was based on conditionals in scratch. We worked with "if, then" statements as well as "and, or" statements. I chose to complete problems 1 and 3. In problem 1 I had to create an etch a sketch. A sprite needed to draw as it was being controlled by the up, down, left and right keys. If the spacebar was pressed, the screen needed to be cleared and the sprite had to return to the center of the screen. For problem 3, I was asked to create a spelling bee. The sprite on the screen was supposed to ask for a word, and then spell this word back to the user 1 letter at a time. If the user typed in a word that had more than 10 letters, the sprite should ask for a shorter word.

My Solution

For my etch a sketch, I created 5 "if, then" conditionals within a forever loop. For each conditional, if a key was pressed(up, down, left, or right) the sprite would place the pen down and move in that direction for as long as the key is pressed. The final conditional was if the spacebar was pressed, the sprite would return to (0,0), and clear the screen. In the spelling bee, I have a sprite ask the user to type in a word. The answer is then stored as a variable "word". If the answer was longer than 10 letters, the sprite would ask for a shorter word. When the user finally types in a word less than 10 letters, the sprite would spell the answer out on letter at a time.

Questions

1) In an if, else statement, no matter what an animation will occur. In just an if conditional, the animation will only occur if the if statement is true.

2) The simplest way to write the code is to take out the 10 steps part, and just create an "if" statment with the "say" animation, and then after this, have a move 10 steps animation.

3) This conditional applies to anyone on the soccer team or in band that are not Seniors

4) This conditional opens it up to seniors in band or on the soccer team.

5) Put the variable in the first space, then 15 in the second place, and if it comes out with 0, the variable is divisible by 15

Click HERE to return to homepage.