
-----------------------------------
qmanjr5
Mon Nov 30, 2009 7:10 pm

A quick quiz
-----------------------------------
What is it you are trying to achieve?
A quiz with a score that will go up or down depending on your correct questions


What is the problem you are having?
Can't figure out quite how to do this


Describe what you have tried to solve this problem
I've asked my friends.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
I've only done a TINY bit, but, here it is.



var score := int = 0
var answer1 := int = 2
put ""
get answer1
if answer1 = "2" then
    procedure correct
end
procedure correct
    score + 1




Please specify what version of Turing you are using
4.1.1

-----------------------------------
Zren
Mon Nov 30, 2009 7:39 pm

Re: A quick quiz
-----------------------------------
Well first off. procedures should be declared before their used, and deffinitly not in a loop. Try sorting you code like this:

%Declare Variables
var number:int

%Procedures and Functions 
procedure incrementNumber
number += 1
end incrementNumber

%Initialize Variables
number := 0

% Main Program Code
put "I'm a number ",number
incrementNumber
put "Now I'm a number ",number

Honnestly your missing alot of the programming basics. Try running through the first few subjects of the Essentials in the [url=http://compsci.ca/v3/viewtopic.php?t=8808]Turing Walkthrough

-----------------------------------
qmanjr5
Mon Nov 30, 2009 7:59 pm

RE:A quick quiz
-----------------------------------
And I shall.

Thank you. :D
