Lab 2 ITSE 1429 -
07-25-2014, 05:36 PM
More fun with user inputted variables! This one I created a dojo with a ninja who shows you how to do a roundhouse kick. Users beware of the "evil ninja" object if you are looking for a class of human that is in a prone and in a symmetrical position when it is dropped in the world. His right leg is slightly askew and when he performs any movements with his leg the leg will not return to it's initial starting position. I had already wrote his methods so I had to stick with him and call a few extra methods to get him to move back to a standard position. As far as the assignment went, I enjoyed writing methods with loops and working in variables that require user input. I'm becoming more comfortable with variables and am starting to see the potentials of the various functions for other object possibilities! It took some figuring to get a functional if/else statement to accept three separate forms of yes, including "YES", "Yes", and finally "yes" , as string inputs from the user. I ultimately nested together the three if/else statements to make this happen. Is there a simpler way to accomplish this? Also, I wanted the ninja to say "This concludes our lesson" as the else statement, but when I incorporated this it would sometimes randomly show up after typing in "yes" and still continue on with the loop to repeat the initial method. Any thoughts?
|