Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   The Lounge (http://www.alice.org/community/forumdisplay.php?f=4)
-   -   Spinning frog & dialog box (http://www.alice.org/community/showthread.php?t=5771)

rkfoote 12-26-2010 12:54 PM

Spinning frog & dialog box
 
1 Attachment(s)
I just finished another assignment for DCCCD programming logic course. This one has a frog that asks the user for a number, then jumps up and spins around the number of times that the user entered. Then the frog asks the user if he/she wants to run the program again, and based on the answer, either starts all over again or stops.

Everything worked fine for me on this assignment. I used a loop in the main method to determine whether the program would restart or stop, and another loop to make the frog spin the required number of times. The only issue/problem was that when I close the world and reopen it, before I click on "Play", a dialog box pops up and asks me to enter yes or no...not sure why this is happening. Any ideas? I'll attach the file.

amueller 12-27-2010 10:14 AM

I just looked at it. World looks good and everything works fine. Good job!
I didn't think about the possibility of adding files to posts here. I'm gonna do that for assignment 7 which I just finished :)

timsally 12-28-2010 10:04 PM

Ahsum!
 
Rebecca,

I like that you posted your world because it showed a more compact way for me to solve that problem of "yes", "Yes", and "YES" as three equal responses. Where did you learn how to do that?

What I did seems amateurish now....

I created an IF/ELSE IF/ELSE IF equation where IF was "yes", the first ELSE IF was "Yes" and the second ELSE IF was "YES".

You did a great job!

Tim S.

Oh, the reason it's bringing that up is that it's going through the boolean operations for some reason....expecting you to enter a VALUE in order for it to show you the program. I don't know why it doesn't do the same for entering a number....but I think it only does it for variables that require a STRING. It happened in mine also.

rkfoote 01-01-2011 12:28 PM

frog
 
Hi Tim,

Weird that it wants that value entered before the program runs. I thought maybe it was just something with my particular install of Alice, but I guess not since you had the same issue.

I knew about "or" logic from some programming that I've already done, and then just trial and error in Alice. :)

Rebecca


All times are GMT -5. The time now is 05:40 AM.

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