# aaronharnly/girlsrockcomputerscience

Redirect to Canvas enrollment

aharnly-amplify committed Sep 30, 2013
1 parent cf639ba commit 120fbfded76cc7c6ebce6039ed6a05dc13242e43
Showing with 9 additions and 103 deletions.
1. +9 −103 index.html
 @@ -1,104 +1,10 @@ - - - Computer Science - - - -
-

Computer Science, 2013-09-26

-

Do Now

-

Click to Do Now

-
-
-

Snap Setup

-

Remember, your Snap! username is: ywls-{firstname}{lastinitial}. For example, Alicia Smith would be ywls-alicias.

-

-

-

Start Snap!

-
-
-

Conditionals: Lotto

-

Your challenge: Create a Lottery program.

-

It should set a variable (named 'secret') to a random number between 1 and 5.

-

Then ask the user for a guess.

-

If the guess equals the secret, have the sprite say "You won!".

-

Otherwise, the sprite should say, "Sorry, play again."

-

Blocks you will use:

-

-

-

-

Conditionals: Lotto with Hints

-

Now make your Lotto program allow the user to keep guessing until they're right

-

It should still pick a random secret. This time, maybe between 1 and 10, or even 1 and 100.

-

But now, if the user's guess is too low, it should say, "Too low!" and let them try again.

-

If the user's guess is too high, it should say, "Too high!" and let them try again.

-

If the user guesses the number exactly, it should congratulate them and stop.

-

Blocks you will use:

-

- -

Painting the Stage

-

You can draw on the stage by following these 3 steps:

-
-
1. Click on the stage button
2. -
3. Click the costumes tab
4. -
5. Click the paint button
6. -
- - -

Draw three overlapping squares so that your stage looks like this:

- - -

Now, select your sprite again to go back to editing code for your sprite:

- - -

Boolean Operators: AND, OR, and NOT

-

You can combine booleans (remember, a boolean is something that is either TRUE or FALSE) using the AND and OR blocks, and you can take the opposite of a boolean using the NOT block.

- -

Program your sprite so that it does the following:

-
-
1. Say "red" if your sprite is touching the red square.
2. -
3. Say "not blue" if your sprite is not touching the blue square.
4. -
5. Say "red or green" if your sprite is touching the red square or the green square (or both!)
6. -
7. CHALLENGE: Say "colorful!" if your sprite is touching all three squares at the same time.
8. -
- -

You can drag and drop your sprite around the stage to test this out.

- -

Blocks you will use:

-

-

(Why is it important that the say block has a duration?)

-

-

-

-

-

-
- - + + + Computer Science + + + + Enroll in the Course Site + +