{"id":772,"date":"2014-04-17T22:23:08","date_gmt":"2014-04-17T22:23:08","guid":{"rendered":"http:\/\/blogs.evergreen.edu\/candc14\/?page_id=772"},"modified":"2017-04-17T11:09:35","modified_gmt":"2017-04-17T18:09:35","slug":"number-guess-and-while","status":"publish","type":"page","link":"https:\/\/sites.evergreen.edu\/compcog17\/communications-2\/forums\/classes\/april-19\/number-guess-and-while\/","title":{"rendered":"Number Guess and While"},"content":{"rendered":"<h2><a href=\"http:\/\/myfiles.evergreen.edu\/academics\/programs\/\/compcog-s17\/Handouts\/numguess1.html\">Number guess program 1<\/a><\/h2>\n<p><a href=\"http:\/\/myfiles.evergreen.edu\/academics\/programs\/\/compcog-s17\/Handouts\/numguess2Loops.html\">Number Guess program 2<\/a><\/p>\n<div>\n<div>\n<p>In this assignment, you will finish the number guess assignment we started in class. Make SURE you start by looking at the number guess template. Understand this program and evolve it into the code you want. Again, here are the rules- Remember, each line of english has a JavaScript equivalent. You need to translate.<\/p>\n<p>Have the computer pick a random number between 1 and 100<br \/>\nGet a bet from the user<br \/>\nGet a guess from the user<br \/>\nWhile the player has less than 6 guesses and is not correct<br \/>\n\u2014tell the user if they are too high or low<br \/>\n\u2014add 1 to the guesses<br \/>\n\u2014get another guess<\/p>\n<p>If the player got the number on the first guess<br \/>\n\u2014add 4 times their bet to their total<br \/>\nIf the player got the number on the second guess<br \/>\n\u2014add 3 times their bet to their total<br \/>\nIf the player got the number on the third guess<br \/>\nadd 2 times their bet to their total<br \/>\nIf the player got the number on the 4th guess<br \/>\n\u2014add the bet to their total<br \/>\nIf the player got the number on the 5th guess<br \/>\n\u2014tell the player they tied the computer<br \/>\nIf the player never guessed the number<br \/>\n\u2014subtract their bet from the total<\/p>\n<p>Tell the user how much money they have<\/p>\n<p>Extensions: See if you can play over and over (put the game in a while loop and ask if they want to play again) See if you can limit their bet to how much money they have- start at, say $500. Add other features if you can<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Number guess program 1 Number Guess program 2 In this assignment, you will finish the number guess assignment we started in class. Make SURE you start by looking at the number guess template. Understand this program and evolve it into the code you want. Again, here are the rules- Remember, each line of english has [&hellip;]<\/p>\n","protected":false},"author":274,"featured_media":0,"parent":556,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_mi_skip_tracking":false},"_links":{"self":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages\/772"}],"collection":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/users\/274"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/comments?post=772"}],"version-history":[{"count":0,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages\/772\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/pages\/556"}],"wp:attachment":[{"href":"https:\/\/sites.evergreen.edu\/compcog17\/wp-json\/wp\/v2\/media?parent=772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}