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

Username:   Password: 
 RegisterRegister   
 War games
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Rudiger




PostPosted: Thu Dec 04, 2003 7:21 pm   Post subject: War games

ok i have started my game.So have to make map in the bback ground and stuff like that.. if its to hard to ask though can ou help me for a little more Very Happy. yeah i have to have random numbers like dice so you can take over other poepls counterys so how you do that...
Sponsor
Sponsor
Sponsor
sponsor
poly




PostPosted: Thu Dec 04, 2003 7:52 pm   Post subject: (No subject)

you could do it this was (i believe this is not very efficient, cause i dont like being efficient)
code:
var p1die, p2die : int
randint (p1die, 1, 6)   %die for player 1
randint (p2die, 1, 6)   %die for player 2
put "Player 1 rolled a ", p1die %p1 rolls
put "Player 2 rolled a ", p2die %p2 rolls
if p1die > p2die then   %if p1die is great than p2die then p1 wins
put "Player 1 wins"
elsif p1die < p2die then    %if p2die is great than p1die then p1 wins
put "Player 2 wins"
elsif p1die =p2die then %if both p1 & p2 die same than roll again
%blah blah
end if
Rudiger




PostPosted: Mon Dec 08, 2003 10:51 pm   Post subject: (No subject)

ok i have about 8 player game and i need to make them have turns how do i do that?
poly




PostPosted: Mon Dec 08, 2003 11:26 pm   Post subject: (No subject)

well just expand it... so youll have 8 variables, 8 different dice and have it so the screen says like "Player x hit enter to roll dice" than after he rolls, it asks say player 2 to roll the dice etc
Rudiger




PostPosted: Tue Dec 09, 2003 4:49 pm   Post subject: (No subject)

k thanx
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: