Alice Community Random Methods - help!

 Random Methods - help!
 blahblah87 Guest   Status: Posts: n/a Random Methods - help! - 04-24-2009, 09:50 AM I'm working with a student on an Alice project and we're both totally stumped. The assignment in the book asks for the student to create a number function to pick a random number between 1 and 100. It's basically a guessing game between 2 people: 1 asks the user for a number, and if it's too high or too low, the characters on the screen give the proper feedback. Then I'm supposed to create a sentinel loop to repeat the process if the number the user has chosen is unequal. The student's teacher gave her a file with a method already chosen...we're just confused on what to do next. I've worked with Alice before, but I never even got to the chapter explaining loops. Can someone point us in the right direction? Edit: We are using the textbook entitled Alice 2.0: Introductory Concepts and Techniques on page 181, Cases and Places 1. I have uploaded the file via Sendspace for you convenience. Any help is appreciated: http://www.sendspace.com/file/i22k4m Last edited by blahblah87; 04-24-2009 at 10:33 AM.
 Random Methods - help! - Here's a start
h4l0
Guest

Status:
Posts: n/a
Random Methods - help! - Here's a start - 04-25-2009, 09:59 AM

Have a look at this code. There is no error checking, it is assumed the user will input a correct number. The game is to guess a number between 1 and 40.

H4l0
Attached Files
 Case 3-1 random40.a2w (216.5 KB, 125 views)

 blahblah87 Guest   Status: Posts: n/a 04-25-2009, 01:55 PM Thank you so much for taking the time to respond. I'll take a look at the code.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge