Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lesson 9: Lotto and Lotto with Hints

  • Loading branch information...
commit 4144e466ff28a1c90290da7f309fc1743e22aaf3 1 parent ab71492
Aaron Harnly authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 index.html
20 index.html
View
@@ -42,6 +42,26 @@
<p>Before doing anything else, log in.</p>
<p><a target="snap" href="http://snap.berkeley.edu/run">Start Snap!</a></p>
</div>
+ <div class="section">
+ <h2>Conditionals: Lotto</h2>
+ <p>Your challenge: Create a Lottery program.</p>
+ <p>It should set a variable (named 'secret') to a random number between 1 and 5.</p>
+ <p>Then ask the user for a guess.</p>
+ <p>If the guess equals the secret, have the sprite say "You won!".</p>
+ <p>Otherwise, the sprite should say, "Sorry, play again."</p>
+ <p>Blocks you will use: </p>
+ <p><img src="http://i.imgur.com/cAm8c6Y.png"></p>
+ <p><img src="http://i.imgur.com/HzmhMEi.png"></p>
+ <p><img src="http://i.imgur.com/m157HPs.png"></p>
+ <h2>Conditionals: Lotto with Hints</h2>
+ <p>Now make your Lotto program allow the user to keep guessing until they're right</p>
+ <p>It should still pick a random secret. This time, maybe between 1 and 10, or even 1 and 100.</p>
+ <p>But now, if the user's guess is too low, it should say, "Too low!" and let them try again.</p>
+ <p>If the user's guess is too high, it should say, "Too high!" and let them try again.</p>
+ <p>If the user guesses the number exactly, it should congratulate them and stop.</p>
+ <p>Blocks you will use:</p>
+ <p><img src="http://i.imgur.com/WVM76LK.png"></p>
+ </div>
</body></html>
Please sign in to comment.
Something went wrong with that request. Please try again.