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

Username:   Password: 
 RegisterRegister   
 Scoring System
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mr. T




PostPosted: Fri May 27, 2005 9:25 pm   Post subject: Scoring System

My scoring system is a bit buggy. I do a reset but it still seems to continue on where it left off. Here's the jist of the code.
code:

var scoreLevel : int := 50
var score : int :=0
if score >= scoreLevel %ready to enter next level
then cls %clears the screen for the scoring updates
       
        %scoring system (after each completed level)
        put "Your score is: ", score %score with out additional time bonus
        var bonus:int:=60 %1 min to get bonus (bonus = 60000 milliseconds = 60 seconds =1 min)
        var timeBonus:int :=bonus-Time.Elapsed div 1000 %1 min timer (Time.Elapsed = 1000 milliseconds = 1 min)
        put "Your time bonus is: ", timeBonus %time bonus
        score:=score+timeBonus %updated score = score as of to that point + time bonus
        put "Your overall score is: ", score %score as of to that point + time bonus
        put "[press enter to continue to next round]" %gives the user time to read the score
scoreLevel:=score+50 %next level will be completed after an additional 50 points
end if
Sponsor
Sponsor
Sponsor
sponsor
Mr. T




PostPosted: Fri May 27, 2005 10:17 pm   Post subject: Alex's Opinion

YAY i solved the problem by myself... heres what i did.
code:

var score : int :=0 %score
var bonus:int:=60 %1 min
var scoreLevel : int := 50


if score >= scoreLevel
then cls %clears the screen for the scoring updates
       
        %scoring system (after each completed level)
        put "Your score is: ", score %score with out additional time bonus
         
        var timeBonus:int :=bonus-Time.Elapsed div 1000 %1 min timer (Time.Elapsed = 1000 milliseconds = 1 min)
        put "Your time bonus is: ", timeBonus %time bonus
        score:=score+timeBonus %updated score = score as of to that point + time bonus
        put "Your overall score is: ", score %score as of to that point + time bonus
        bonus:=60+(Time.Elapsed div 1000) %bonus reset
        put "[press enter to continue to next round]" %gives the user time to read the score
end if
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  [ 2 Posts ]
Jump to:   


Style:  
Search: