
-----------------------------------
koolkid98
Tue May 16, 2006 8:51 am

need help desperately again
-----------------------------------
ok im having trouble with this program..... I need help with getting this program to run, also i was wondering how i can get a point system to work with this program, i am trying to make a TRIVIA program for 2 players. I need help cuz this is my summative and if i dont get this to work i fail the grade....


var music : string
var point : int
var song : string
var p1point:int
var p2point:int
var player:string
var z:string
var m:string
put "This is a two players Trivia game followed by a point system, person who answers the most questions correctly wins."
put "The buzzer buttons are z for player 1 and m for player2"
Music.PlayFile("D:\\POD - Will You.mp3")
get player
if player=z then
put "What song is currently playing, player 1  ?"
get song 
if song = "Bitter Sweet Symphony" then
put "correct player 1 you have", p1point=p1point+1
elsif player=m then 
put "What song is currently playing, player 2  ?"
get song
if song = "Bitter Sweet Symphony" then
put "correct player 2 you have", p2point=p2point+1
end if
thnks

-----------------------------------
codemage
Tue May 16, 2006 9:15 am


-----------------------------------

if song = "Bitter Sweet Symphony" then
put "correct player 1 you have", p1point=p1point+1 


You can't do an assignment and a put on the same line in Turing.
Do This:


if song = "Bitter Sweet Symphony" then
  p1point:=p1point+1 
  put "correct player 1 you have ", p1point


-----------------------------------
Delos
Tue May 16, 2006 1:02 pm


-----------------------------------
Please do not use titles such as "Please help!" in your posts.  These are uninformative and serve no purpose.  Also, learn how to use 
if player=z then 

Will not work since z is unintialized.  Additionally, what are you trying to achieve by comparing two variables?  This makes no sense.  If you want to distinguish between players, then you're better off using the system that you've used for songs:

if player = "Player 1" then


-----------------------------------
Clayton
Tue May 16, 2006 3:16 pm


-----------------------------------
actually delos, i think he is trying to say 

var keys:array char of boolean
ask the question
Input.KeyDown (keys)
if keys ('z') then
    get the answer
    check to see if the answer is right or wrong
end if
if keys ('m') then
    get answer
    check to see if the answer is right or wrong
end if

look through the Turing Walkthrough to check out the tutorial on checking for characters etc. good luck
