<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Look at the following algorithm<div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">   </span>declare <b class="">gameOver</b> variable to <b class="">false</b></div><div class=""><span class="Apple-tab-span" style="font-weight: bold; white-space: pre;">       </span>declare<b class=""> score </b>variable and<b class=""> </b>set to<b class=""> 0</b></div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>declare <b class="">currentTime</b> variable and set to <b class="">20</b><i class=""> seconds </i>  </div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span><b class="">mouse click event</b></div><div class=""><span class="Apple-tab-span" style="white-space:pre">           </span>if mouse clicked on mole</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                  </span>increase <b class="">score</b> by 1</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                 </span>if <b class="">score</b> is equal to 5</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                              </span>set <b class="">gameOver</b> to <b class="">true</b></div><div class="">     </div><div class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span><b class="">while (currentTime > 0 and not gameOver)</b></div><div class="">            <span class="Apple-tab-span" style="white-space:pre">       </span><b class="">doTogether-></b></div><div class="">            <span class="Apple-tab-span" style="white-space:pre">              </span><i class="">show and hide the mole</i></div><div class=""><span class="Apple-tab-span" style="white-space:pre">                      </span><b class="">do in order -></b></div><div class="">                <span class="Apple-tab-span" style="white-space:pre">           </span><i class="">display time</i></div><div class="">                <span class="Apple-tab-span" style="white-space:pre">           </span><b class="">wait 1 second</b></div><div class="">               <span class="Apple-tab-span" style="white-space:pre">                        </span>s<i class="">ubtract 1 from </i><b class="">currentTime</b></div></div><div class=""><span class="Apple-tab-span" style="white-space:pre">                       </span>// end of do in order</div><div class=""><span class="Apple-tab-span" style="white-space:pre">             </span>// end of do Together</div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>// end of while</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span>if <b class="">score</b> is equal to 5</div><div class=""><span class="Apple-tab-span" style="white-space:pre">              </span>player wins</div><div class=""><span class="Apple-tab-span" style="white-space:pre">       </span></div><div class="">Let me know if you have any questions…</div><div class=""><br class=""></div><div class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Verdana; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">Don Slater</div><div class=""><br class="">Alice Team<br class="">Carnegie Mellon University<br class="">Entertainment Technology Center<br class="">700 Technology Drive<br class="">Pittsburgh, PA 15219<br class=""><br class="">Email: <a href="mailto:dslater@cmu.edu" class="">dslater@cmu.edu</a></div><div class=""><br class=""></div><div class="">I have learned this at least by my experiment: that if one advances confidently in the direction of his dreams, and endeavors to live the life he has imagined, he will meet with a success unexpected in common hours.<br class="">--- Henry David Thoreau</div></div><div class=""><br class=""></div><div class="">The true object of all human life is play. -- G.K. Chesterton<br class=""><br class=""></div></div></span></div></span></div></span></div></span></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Dec 1, 2015, at 10:29 AM, Jennifer Leaver via alice-teachers <<a href="mailto:alice-teachers@lists.andrew.cmu.edu" class="">alice-teachers@lists.andrew.cmu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class="">This is my first year using and teaching Alice.  My students are creating games and are stuck on how to get a timer to work correctly with the game.  For example, one student is making a whack-a-mole game.  She has a timer counting down from 20 seconds.  The player wins if s/he whacks 5 moles.  How does she get the timer to stop and text to display, "You won!" if the player clicks the mole 5 times?  We've been trying if/else statements with no success.  If the timer runs down to zero, she wants the display to read, "You lose."</div><div class=""><br class=""></div><div class="">Thank you so much for your help!</div><div class=""><br class=""></div><div class="">Jenni Leaver</div><div class="">Margaretville Central School</div><div class="">Margaretville, NY 12455</div></div>
_______________________________________________<br class="">alice-teachers mailing list<br class=""><a href="mailto:alice-teachers@lists.andrew.cmu.edu" class="">alice-teachers@lists.andrew.cmu.edu</a><br class="">https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers<br class=""></div></blockquote></div><br class=""></div></body></html>