Skip to content

Commit

Permalink
Lesson 9: conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
aharnly-amplify committed Sep 25, 2013
1 parent 8db1e82 commit ab71492
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 35 deletions.
79 changes: 79 additions & 0 deletions 2013-09-24.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,79 @@

<html><head>
<title>Computer Science</title>
<style type="text/css">
body {
background-color: #1B3E59;
}
h2 {
color: #AB7300;
}
body {
color: #494A4A;
}
a, a:hover, a:visited {
color: #0000ee;
}
.section {
padding: 1em;
background-color: #E1DFE3;
width: 30em;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
}
.screenshot {
width: 400px;
}
.block { width: 300px; }
</style>
</head>
<body>
<div class="section">
<h2>Do Now</h2>
<p><a target="donow" href="https://docs.google.com/forms/d/1iwC9Iibm3lOPP9TjYyTaCxcLaqv9njj5W2X9MVjOL4o/viewform">Do Now</a></p>
</div>
<div class="section">
<h2>Snap Setup</h2>
<p>Remember, your Snap! username is: ywls-{firstname}{lastinitial}. For example, Alicia Smith would be ywls-alicias.</p>
<p>Your password is 'teals2013'.</p>
<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>Loops: N-Sided Polygon</h2>
<p>Your challenge: Create a program that</p>
<ul>
<li>Asks you how many sides you want in your polygon</li>
<li>Sets a variable for the number of sides</li>
<li>Sets another variable with the angle to turn at each side</li>
<li>Uses a loop to draw each side of the polygon, and turn to prepare to draw the next side</li>
<li><em>Make sure</em> to initialize your program with "clear" and "go to 0, 0" blocks so you
have a clean stage each time.</li>
</ul>
<p>Here is an example of running the N-Sided Polygon program and choosing 4 sides:</p>
<p><img src="http://i.imgur.com/uHnTWKT.png" class="screenshot">
<img src="http://i.imgur.com/W8Fd5j1.png" class="screenshot"></p>

<p>Here I run it again, but choose 8 sides:</p>
<p><img src="http://i.imgur.com/DwwhFrC.png" class="screenshot">
<img src="http://i.imgur.com/EMsrQeO.png" class="screenshot"></p>

<p>This is my program (made blurry so you don't just copy it!):</p>
<p><img src="http://i.imgur.com/FBShXMA.png" class="screenshot"></p>
</div>
<div class="section">
<h2>Conditionals</h2>
<p>Your challenge: Create a program that counts up from 1 to 10</p>
<p>Use:
<img src="http://i.imgur.com/88cPi4s.png" class="block">
<img src="http://i.imgur.com/soEEjFj.png" class="block">
</p>
<p>Output the numbers using: </p>
<img src="http://i.imgur.com/ynwobQY.png" class="block">
</div>


</body></html>


38 changes: 3 additions & 35 deletions index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
</head> </head>
<body> <body>
<div class="section"> <div class="section">
<h1>Computer Science, 2013-09-25</h1>
<h2>Do Now</h2> <h2>Do Now</h2>
<p><a target="donow" href="https://docs.google.com/forms/d/1iwC9Iibm3lOPP9TjYyTaCxcLaqv9njj5W2X9MVjOL4o/viewform">Do Now</a></p> <p>Click to <a target="donow"
href="https://docs.google.com/forms/d/1J9_JaQuAqltGUI30xPriQqWU2Q8SCNtuHQyYNE9_ncE/viewform">Do Now</a></p>
</div> </div>
<div class="section"> <div class="section">
<h2>Snap Setup</h2> <h2>Snap Setup</h2>
Expand All @@ -40,40 +42,6 @@ <h2>Snap Setup</h2>
<p>Before doing anything else, log in.</p> <p>Before doing anything else, log in.</p>
<p><a target="snap" href="http://snap.berkeley.edu/run">Start Snap!</a></p> <p><a target="snap" href="http://snap.berkeley.edu/run">Start Snap!</a></p>
</div> </div>
<div class="section">
<h2>Loops: N-Sided Polygon</h2>
<p>Your challenge: Create a program that</p>
<ul>
<li>Asks you how many sides you want in your polygon</li>
<li>Sets a variable for the number of sides</li>
<li>Sets another variable with the angle to turn at each side</li>
<li>Uses a loop to draw each side of the polygon, and turn to prepare to draw the next side</li>
<li><em>Make sure</em> to initialize your program with "clear" and "go to 0, 0" blocks so you
have a clean stage each time.</li>
</ul>
<p>Here is an example of running the N-Sided Polygon program and choosing 4 sides:</p>
<p><img src="http://i.imgur.com/uHnTWKT.png" class="screenshot">
<img src="http://i.imgur.com/W8Fd5j1.png" class="screenshot"></p>

<p>Here I run it again, but choose 8 sides:</p>
<p><img src="http://i.imgur.com/DwwhFrC.png" class="screenshot">
<img src="http://i.imgur.com/EMsrQeO.png" class="screenshot"></p>

<p>This is my program (made blurry so you don't just copy it!):</p>
<p><img src="http://i.imgur.com/FBShXMA.png" class="screenshot"></p>
</div>
<div class="section">
<h2>Conditionals</h2>
<p>Your challenge: Create a program that counts up from 1 to 10</p>
<p>Use:
<img src="http://i.imgur.com/88cPi4s.png" class="block">
<img src="http://i.imgur.com/soEEjFj.png" class="block">
</p>
<p>Output the numbers using: </p>
<img src="http://i.imgur.com/ynwobQY.png" class="block">
</div>


</body></html> </body></html>




0 comments on commit ab71492

Please sign in to comment.