Alice Community  

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

Reply
 
Thread Tools Display Modes
if/else_comparing user answer validity and providing result
Old
charliebrownsmom
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jun 2012
Default if/else_comparing user answer validity and providing result - 07-22-2012, 08:01 PM

I will try and explain my problem. I do not seem to be good at explaining.

I need to create a if/else to determine if the user's guess is incorrect/correct. I created a Boolean variable, and I set this Boolean variable as the users guess using the "ask user function yes or no."

I have tried numerous ways to get the Boolean to correspond with a word and an animal on the screen. I can get the if/else to either say correct or incorrect, but this isn't based on the actual correctness of the input.

I am uploading the program, so if anyone could steer me in the correct direction that would be terrific. I have searched these forums, but I cannot find an specific solution; and I followed all the tutorials on the Duke site.
Attached Files
File Type: a2w Spanish_Animal_Game_7_22_12_42k.a2w (1.08 MB, 4 views)
   
Reply With Quote
Solution
Old
charliebrownsmom
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jun 2012
Default Solution - 07-22-2012, 10:19 PM

I have been working on this program for over 20 hours. I am weird it has been almost straight through. This solution came not after being intelligent enough to solve it through a process of cognition rather just hard headed trial and error. This post is to help everyone who has had a similar problem searched in vain and...

OPACITY is the key. While I was using the Boolean, setting it to "ask user yes and no," setting it to true, taking the Boolean=true & animal = name, I gave no thought to the opacity of my animals or the opacity of my names.

Hence setting the Boolean=true & animal.opacity=1 & name.opacity=1 will create a proper if/else which leads to the above being true. The animal and name opacity can be set up through their entirety to run the full logical scheme.

So, when programming in Alice, be sure to look at opacity when objects are invisible.
   
Reply With Quote
Reply

Tags
boolean, ifelse

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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.