Computer Science Canada

need some help.. thank-you all who try

Author:  mother teresa [ Wed Feb 03, 2010 10:34 pm ]
Post subject:  need some help.. thank-you all who try

need to input a counter for right and wrong answers, every-time i doo i mess it up

Author:  D_homes [ Wed Feb 03, 2010 11:39 pm ]
Post subject:  RE:need some help.. thank-you all who try

please include the images so we can run your program to see whats wrong.

For a counter, its pretty straight forward, create two variables, one for right answers and one for wrong. If the user gets the right answer then do something like this:

Turing:

var right : int := 0
var wrong : int := 0

if answer1 = "b" then
        put "yes, you are correct ;)"
        right += 1      % adds 1 to counter (right)
    elsif  answer1 = "a" then
        put " no sorry thats not right... :("
        wrong += 1   % adds 1 to counter (wrong)
 end if

Author:  Turing_Gamer [ Thu Feb 04, 2010 8:39 am ]
Post subject:  Re: need some help.. thank-you all who try

You have a very confusing program but as D-homes put it, you need to have 1 - 2 variables.
If you use one you can do the following:
Turing:
var counter := 0

loop
    %Ask questions
    %If right answer, then counter := counter + 1 -or- counter += 1
    %After 10 questions
    put "You got " + intstr (counter) + " answers right and " + intstr (10 - counter) + " wrong..."
    exit when game_over = true
end loop

Author:  mother teresa [ Thu Feb 04, 2010 11:53 am ]
Post subject:  RE:need some help.. thank-you all who try

thaaaaaannnnkkk youuuu!!!! soo much omg

Author:  mother teresa [ Thu Feb 04, 2010 11:55 am ]
Post subject:  RE:need some help.. thank-you all who try

guys im sorry i just relized i put up the old vertion of my trivia game ill re put the new one that works wihtout the counter sorrryyyyy

Author:  Turing_Gamer [ Thu Feb 04, 2010 12:38 pm ]
Post subject:  Re: need some help.. thank-you all who try

Please no double posting. Use the Edit button...
Secondly, If you have numerous attachments and/or programs, PLEASE try and put all of them in one topic.
For example:
Topic -- Beginner Programmer Submissions
Attachments -- tax calculator, name program, etc.

Sorry for being so serious but it isn't a social network site.

Author:  mother teresa [ Thu Feb 04, 2010 3:34 pm ]
Post subject:  RE:need some help.. thank-you all who try

ahh so i would have to put the music and pic for background in one folder then attach that?

Author:  mother teresa [ Thu Feb 04, 2010 3:35 pm ]
Post subject:  RE:need some help.. thank-you all who try

and it says i cant edit a post that has been replied to...

Author:  TheGuardian001 [ Thu Feb 04, 2010 3:44 pm ]
Post subject:  Re: need some help.. thank-you all who try

He means the ones where you reply to yourself (like you just did)

Author:  mother teresa [ Thu Feb 04, 2010 3:49 pm ]
Post subject:  RE:need some help.. thank-you all who try

ic..... sorry still new at this


: