Computer Science Canada ingnoring the IF statement but I want the if statement to work |
Author: | avakann [ Thu Jun 04, 2009 12:23 pm ] | ||
Post subject: | ingnoring the IF statement but I want the if statement to work | ||
help please What is the problem you are having? the progeramme doesn't do what I want it to do Describe what you have tried to solve this problem I've changed the variable, I even copied a part of the programme that worked the way I want it to work and even that didn't help
Please specify what version of Turing you are using the version is 4.0.5 |
Author: | Tony [ Thu Jun 04, 2009 1:01 pm ] |
Post subject: | Re: ingnoring the IF statement but I want the if statement to work |
avakann @ Thu Jun 04, 2009 12:23 pm wrote: the progeramme doesn't do what I want it to do It doesn't have to. It does do exactly what you've told it to do though. Sometimes there's discrepancy though. What is it that you want it to do? And how is that different from what you've told it to do? |
Author: | avakann [ Fri Jun 05, 2009 11:47 am ] |
Post subject: | Re: ingnoring the IF statement but I want the if statement to work |
Ok it doesn't do what I thought that I told it to do for some reason it is ignoring the if statement and and I don't think that I told the programme to do that |
Author: | jbking [ Fri Jun 05, 2009 1:20 pm ] |
Post subject: | Re: ingnoring the IF statement but I want the if statement to work |
There are 8 "if" statements in the code. Which one(s) are you meaning? What kinds of things have you done to try to isolate the problem? What is the expected and actual results you get and with what input? These are just a few basic questions that would help some of us as well as show good faith that you do try to figure out your own problems as this is one of the big pillars of programming to my mind: Being able to fix mistakes in your own software. |
Author: | Wolf_Destiny [ Fri Jun 05, 2009 9:52 pm ] |
Post subject: | Re: ingnoring the IF statement but I want the if statement to work |
So....it worked perfectly for me, (in)correct answers were dealt with appropriately, indicating success or failure, or invalid input where appropriate. Not really sure what the problem is at all, it didn't skip a single if statement when I ran it. Just for whatever sort of reference it might be worth, I'm running V4.0.3 ~Wolf_Destiny |
Author: | avakann [ Wed Jun 10, 2009 12:00 pm ] |
Post subject: | RE:ingnoring the IF statement but I want the if statement to work |
it is ignoring the "if" statement for this line if independent1= "D" or independent1= "d" then put "Curiosity killed the cat" delay (200) put "WRONG ANSWER ", name1 elsif independent1= "A" or independent1= "a" or independent1= "B" or independent1= "b" or independent1= "C" or independent1= "c" then put "that is correct ", name1 else put "not even an answer" end if what am I doing wrong |
Author: | Tony [ Wed Jun 10, 2009 12:07 pm ] | ||||
Post subject: | RE:ingnoring the IF statement but I want the if statement to work | ||||
a good debugging technique is to output all the conditional variables, to inspect yourself. It will look something like
If it seems visually correct, you can further try testing for conditional statements
|