Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Basic, but I still need help!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jessica43999




PostPosted: Wed Mar 22, 2006 12:26 pm   Post subject: Basic, but I still need help!

Alright, this is a really basic problem... but, the turing "help" on my computer isn't working and I need help!

I am working on a 'pong' program for my gr 11/12 computer science class. And, i just can't figure out how to get a 'score' br outputted on the same line over and over again... can anyone help?! Embarassed I'm a total newbie. Crying or Very sad

Thanks, Jess.
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Wed Mar 22, 2006 12:49 pm   Post subject: (No subject)

locate (r,c)
put score

decide where you want the score outputted, and type it in the locate parameters, then put the score right after
NikG




PostPosted: Wed Mar 22, 2006 1:47 pm   Post subject: (No subject)

Obviously, those two lines will have to be in your main game loop or else they'll only show once.

Also, unless you're using cls to clear the screen, you may want to write a blank at the same location after your delay to avoid weird display errors. i.e:
code:

loop
  locate(1,1)
  put score
  delay(100)
  locate(1,1)
  put "               "
end loop
Jessica43999




PostPosted: Wed Mar 22, 2006 2:18 pm   Post subject: (No subject)

Thanks guys!!! That totally helped allot Smile Razz
do_pete




PostPosted: Wed Mar 22, 2006 2:47 pm   Post subject: (No subject)

NikG wrote:
Obviously, those two lines will have to be in your main game loop or else they'll only show once.

Also, unless you're using cls to clear the screen, you may want to write a blank at the same location after your delay to avoid weird display errors. i.e:
code:

loop
  locate(1,1)
  put score
  delay(100)
  locate(1,1)
  put "               "
end loop

No, this is Unnecessary because "put score" clears the entire line, whereas "put score.." doesn't
NikG




PostPosted: Wed Mar 22, 2006 3:22 pm   Post subject: (No subject)

hmmmm good point do_pete, i forgot that. Embarassed
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: