Computer Science Canada Need sum quick help |
Author: | bullets [ Wed Jun 08, 2005 12:29 pm ] |
Post subject: | Need sum quick help |
Ok first thing What grade are you guys in that are doing games in turing?? anyways moving along to what i need help with i need to make this quiz thing and i know theres an easier way to do it but i just cant sem to get it (this needs to be for 10 questions) heres what i wrote up for 2 questions quickly var a1, a2, a3, a4, a5, a6, a7, a8, a9, a0, total : int var guess, guess1 , guess2 , guess3 : int := 0 locate (2, 25) put "Quiz on Ironclads" loop guess := guess + 1 locate (4, 1) put " Question 1: Is blah blah blah blah" put " 1. " put " 2. " put " 3. " put " 4. " put "Please enter the correct number" get a1 if a1 = 1 then cls locate (10, 23) put "Correct, Now for the Next Question" elsif a1 >= 2 then put "Incorrect" end if if guess = 3 and a1 >= 2 then put "NiCe TrY" end if exit when a1 = 1 or guess = 3 end loop delay (1000) cls locate (2, 25) put "Quiz on Ironclads" loop guess1 := guess1 + 1 locate (4, 1) put " Question 2: Is blah blah blah blah" put " 1. " put " 2. " put " 3. " put " 4. " put "Please enter the correct number" get a2 if a2 = 2 then cls locate (10, 23) put "Correct, Now for the Next Question" elsif a2 >= 2 then put "Incorrect" end if if guess1 = 3 then put "NiCe TrY" end if exit when a2 = 1 or guess1 = 3 end loop delay (1000) cls also what would i type to make it so any key that is pressed that it would go back to the main page another thing (haha sry ![]() |
Author: | jamonathin [ Wed Jun 08, 2005 1:00 pm ] | ||
Post subject: | |||
Array's are very useful. Use them for your program (like I did). Now for your loading question. Yes it is very possible. All you have to do is save the 1. questions, 2. correct answers, and 3. possible answers. Worry about one thing at a time tho. You can look that stuff up in the Tutorials, and if you cannot find it, look for the sticky on Turing Walkthrough. Anyways, take a look at this.
|
Author: | bullets [ Wed Jun 08, 2005 4:03 pm ] |
Post subject: | |
what does this do?? array 1 .. 10 of int := init nvr seen this used before also this "answers (q, a) := intstr (Rand.Int (1, maxint)) %This just generates a random number for each answer" dont understand the point of this thanks for the help we didnt learn arrays n all that jazz in my class unfortunately[/b] |
Author: | Cervantes [ Wed Jun 08, 2005 4:36 pm ] |
Post subject: | |
Well, if you've never seen it before, a good thing to do is look it up in the Turing Help file. Surprisingly, it's helpful! Learning keywords such as init and round and Math.Distance (etc.) from the help file is fine, but learning concepts such as variables, arrays, classes, etc. is more difficult. That's why we've got tutorials. Check for the arrays tutorial (we've actually got two). There's a link to it in the Turing Walkthrough (at the top). Cheers! |
Author: | bullets [ Wed Jun 08, 2005 5:12 pm ] |
Post subject: | |
help file from turing?? doesnt work for us so i dont know any of the keywords and or what they do |
Author: | Cervantes [ Wed Jun 08, 2005 5:19 pm ] | ||
Post subject: | |||
Are you sure? Hitting F10 while in Turing does nothing? Clicking Help -> Turing Reference does nothing/it does not exist? What version of turing do you have? In any case, init is used to initialize the elements of an array. If you have an array from 1 to 5 of integers, and you want to assign them values without doing each one individually, you can do it like this:
Note that if you use init, you have to have as many parameters as there are elements of that array. |
Author: | bullets [ Wed Jun 08, 2005 5:22 pm ] |
Post subject: | |
When i go to the help menu the first 3 options are grey and whn i hit f10 nothing happens using 4.0 |
Author: | jamonathin [ Thu Jun 09, 2005 6:00 am ] |
Post subject: | |
Well then stick to the Tutorials, cuz they're pretty much, just as good, and in some cases beter. |