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

Username:   Password: 
 RegisterRegister   
 How can I make this 2 player?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Nameless_man




PostPosted: Thu Jan 20, 2005 8:00 pm   Post subject: How can I make this 2 player?

Hmm i got my codings done....(well roughly)
now how do i make it so that it works as two player?
rules: player1 starts, if they get it right, still their turn, if wrong, player2 plays, and etc and etc over and over again until the game is done.
thought about using a variable to count the turns but ive realized how dumb the user can be and can get every single try wrong so that failed.
Arrays? dunno wtf they are and how i use em so HELP PLEASE!!!



concentration.t
 Description:

Download
 Filename:  concentration.t
 Filesize:  248.97 KB
 Downloaded:  144 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Thu Jan 20, 2005 8:25 pm   Post subject: (No subject)

Oww, 7000 lines of code the same code over and over again. Hit Wall
A simple way to do this would simply be to have a variable, that can be either 1 or 2, to keep track of who's turn it is. If they answer right, keep it as it is and add to the score of that player. Otherwise, change it.
Nameless_man




PostPosted: Thu Jan 20, 2005 8:59 pm   Post subject: (No subject)

heh sry if u had to read all my junky lines
but i decided to do a scenario type game
=P
basketball4ever




PostPosted: Thu Jan 20, 2005 11:30 pm   Post subject: (No subject)

do a variable: playerturn :=1
if playerturn = 1 then
your whole code thing
playerturn :=2
elsif playerturn = 2 then
your whole code thing
playerturn :=1
end if

[/code]
Cervantes




PostPosted: Fri Jan 21, 2005 3:46 pm   Post subject: (No subject)

No... That's not very line-friendly. Even if you put the whole code in a procedure and call it within the if statement, it's not a good way to do it.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: