Alice Community  

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

Reply
 
Thread Tools Display Modes
Confused
Old
Bricemiller89
Guest
 
Status:
Posts: n/a
Default Confused - 12-08-2009, 09:29 PM

Im doing a project and Im trying to create a game. In the game there is a word that you are trying to figure out. The user guesses a letter and if he/she guesses a correct one, than a question mark spins into a letter. I have created a list of letters that are in the word. I need to know how to have it check through the letters. any help would be greatly appreciated.
-Brice
   
Reply With Quote
Old
lanceA
Guest
 
Status:
Posts: n/a
Default 12-08-2009, 10:15 PM

Quote:
Originally Posted by Bricemiller89 View Post
Im doing a project and Im trying to create a game. In the game there is a word that you are trying to figure out. The user guesses a letter and if he/she guesses a correct one, than a question mark spins into a letter. I have created a list of letters that are in the word. I need to know how to have it check through the letters. any help would be greatly appreciated.
-Brice
When using a LIST you can use the method list contains You pass an argument to this function and it returns true if the argument is in the list, or false otherwise.

I can't provide the code but I hope this helps.
   
Reply With Quote
Old
Bricemiller89
Guest
 
Status:
Posts: n/a
Default 12-08-2009, 11:13 PM

I couldnt find any code within alice to do that. Any other suggestions?


UPDATE: I figured out how to do the list contain. But for some reason, when I try it and enter one of the letters that is contained within the list, it doesnt come up with true. Any ideas?

Last edited by Bricemiller89; 12-08-2009 at 11:39 PM.
   
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 12-09-2009, 12:28 AM

You'll have to attach your world so we can see it.


(')>
   
Reply With Quote
Old
Bricemiller89
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 12:38 AM

Here it is
Attached Files
File Type: a2w project.a2w (1.32 MB, 4 views)
   
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 12-09-2009, 12:59 AM

That's a bug. Here's the workaround.
Attached Files
File Type: a2w confused.a2w (1.34 MB, 4 views)


(')>
   
Reply With Quote
Old
Bricemiller89
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 01:29 AM

Perfect! Thanks that helped a bunch!
   
Reply With Quote
Old
Bricemiller89
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 04:59 PM

Ok, you guys helped so much last time, I figured I'd try back again.

Im working on the attached world. Now that you showed me how to search through the list, I need to figure out how to have the loop stop when either of the characters moves 8 times. In other words, if the player guesses wrong 8 times then the player loses. If they guess all 8 letters in the list, then they win. Any suggestions?
Attached Files
File Type: a2w confused.a2w (1.35 MB, 0 views)
   
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 12-09-2009, 06:22 PM

Yeah, use two number variables, that increment when they move. You should know what to do from there.


(')>
   
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.