Alice Community  

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

Thread Tools Display Modes
Beginner problem
Junior Member
Status: Offline
Posts: 1
Join Date: Mar 2012
Location: Sweden
Default Beginner problem - 03-04-2012, 04:20 PM

So, I'm working my way through a book for absolute beginners in programming (which teaches objective-c, but also starts out with some Alice). I started four days ago, so I'm Really new at this
Right now, I'm doing a simple program in Alice 3.0 Beta that creates a random number and then makes the player guess the number. When the player has guessed right I have a boolean that asks if the player wants to play again, and the player can then click on true or false and then OK.

I have been trying to make that choice look better. To have it say, "play again? Y / N". So the player can write Y or N to play again or not.

But I realise this won't work with boolean or integer, since they only use numbers, right? I tried using getStringFromUser, and I got a box where I could write Y or N, but in the code I couldn't (find a way to) tell the program what Y and N meant. I tried creating textStrings but I couldn't seem to fit them into my if (statement? thingy, box...) to tell it that Y == this and no that.

I have only learned about booleans and integers so far, so this is a bit out of my league (I'm a musician, not an engineer, damnit! )

I've attached my project in which I use a boolean, with the True/false-choice in the end, which I would like to change. As zip, since Alice 3-format isn't supported by the forum.


Edit: Maybe I should ask a question also... Is there a way to get the player to make a Y / N -choice instead of a true/false?
Attached Files
File Type: zip (40.4 KB, 0 views)

Last edited by Highmountain; 03-05-2012 at 01:22 AM.
Reply With Quote

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