Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Quiz Example
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default Quiz Example - 01-07-2010, 11:00 PM

Here's a small example of a quiz-type program. By adding questions to the list called "questions" and the corresponding answers in the list called "answers," you can generate a question and it's answer with only one random number. Then, with a few more random numbers (and some comparisons to ensure that none of the numbers are identical), you can generate several wrong answers and make a quiz like program.

All you need to do now is write some code to allow the user to click on the answers and have the game react accordingly depending on if it's right or wrong.
Attached Files
File Type: a2w quizExample.a2w (51.2 KB, 36 views)


(')>
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 01-08-2010, 08:29 AM

Oh ok, cool, could make a really big game with this


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 01-17-2010, 09:51 PM

this would be good for a trivia game or possibly a puzzle game.
   
Reply With Quote
Old
heysparky
Guest
 
Status:
Posts: n/a
Default 01-27-2010, 04:02 PM

In x2495iiii's world.generate...

What is the purpose of the If statement near the top of that method that, if any of the values it checks are true, calls itself?

Thanks in advance.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 01-27-2010, 07:08 PM

That's to prevent the correct answer from being generated as one of the possible wrong answers.


(')>
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 02-01-2010, 12:37 PM

Also to help your self when making variables or so, add comments


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
heysparky
Guest
 
Status:
Posts: n/a
Default 02-01-2010, 01:06 PM

Thanks for clarification and advice.
   
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump



Copyright ©2021, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.