Computer Science Canada Strangest error ever |
Author: | packocrayons [ Thu Feb 28, 2013 3:23 pm ] | ||
Post subject: | Strangest error ever | ||
What is it you are trying to achieve? get an answer and separate it into command and subcommand, and go to a process based on command What is the problem you are having? When certain subcommand and command combinations are used, an if statement isn't entered. When "drop burger" is entered, the for loop runs twice, erroring the first time (as it should), and then doesn't enter the if statement the second time at all. the program jumps right to "Invalid command" "drop potato" runs the for loop 3 times, working the first two and then jumping to "invalid command" "take axe" errors, but "drop axe" does not most other attempted "drop" commands work. all other commands work, drop and take are the only issues as of yet Describe what you have tried to solve this problem I have added put statements and the delay in the loop to make it run at troubleshoot speed, I really don't know how to address the problem. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using Tried on both 4.1.2 and 4.1.1, using 4.1.2 now. |
Author: | Dreadnought [ Thu Feb 28, 2013 3:43 pm ] | ||
Post subject: | Re: Strangest error ever | ||
What are you asking the program to do here?
|
Author: | Nacoty [ Thu Feb 28, 2013 5:59 pm ] | ||
Post subject: | Re: Strangest error ever | ||
Dreadnought @ Thu Feb 28, 2013 3:43 pm wrote: What are you asking the program to do here?
It is checking if the letter that the for loop is currently checking is the last letter in the string. At least I'm pretty sure it is. |
Author: | Dreadnought [ Fri Mar 01, 2013 11:53 am ] |
Post subject: | Re: Strangest error ever |
Suppose you have a sting "yolo". clearly string(1) not= string(*) what about string(2) and string(*)? |
Author: | Nacoty [ Fri Mar 01, 2013 2:58 pm ] |
Post subject: | RE:Strangest error ever |
We fixed it, it's fine. |