PDA

View Full Version : Lab 2


alexcampbell
12-30-2015, 04:57 PM
Getting my person to jump and spin based on user input was simple enough, but I had to dig a little to figure out the best way to loop. I used a while loop and the "ask user yes or no" function because it was the simplest way to eliminate the user input variance. I hope I wasn't supposed to use an if/else loop for this exercise.

RavenOfCode
12-30-2015, 07:18 PM
Unless your teacher specified a specific type of statement you should be using, it really doesnt matter. There is generally many "right" ways of doing something, and from what you said about the assignment it seems either would work fine, I would probably use an if/else just for performance reasons, but a while would work better in some cases too.