Lab 2
I just completed a lab where I had to create a character that would ask you for a random number and then he would jump up and spin that many times in the air. We were supposed to use loops but I accidently found a way to accomplish the same thing without using a loop. Basically I created a pop-up that asks the user to click either 'Yes' or 'No'. If 'Yes' the program will start over, if 'No' it will end.
Hope I get credit for being innovative! :rolleyes: |
I ended up doing the same thing because I kept getting stuck in infinite loops when trying to get the user to enter yes, YES, or Yes. I spent too many hours trying to figure this out I finally gave up.:confused:
|
You can just use a while loop with the condition to continue be set to yes.
|
Lab2
Mann! This one was kind of difficult, well at least it was to me. I got the jump and spin part down without a problem even though I am sure it could've been done smoother. When it came to the looping the jump and spin method on the answer of yes, Yes, or YES was like :eek:. I couldn't ask the user the proper question and the jump/spin method would loop no matter what the user type for their answer. Finally with the help of my professor I was able to get the program to come together hopefully good enough for the extra credit.
|
All times are GMT -5. The time now is 04:12 PM. |
Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.