|
Post by Azan on Aug 7, 2005 17:05:10 GMT -5
SeedRnd MilliSecs() ;1=rock ;2=paper Global pc=0 Global dc=0 Global cc=0 Global c Global z Global name$ name$=Input("What is your name? :") While Not KeyHit(1) i$=Input("(R)ock (P)aper or (S)izzors -->>") If i$="R" Or i$="r" Then z=1 EndIf If i$="P" Or i$="p" Then z=2 EndIf If i$="S" Or i$="s" Then z=3 EndIf c=Rnd(3) If c=1 Then If z=1 Then Print "draw" dc=dc+1 EndIf If z=2 Then Print "COMPUTER ROLLED ROCK" Print name$+" WINS!" pc=pc+1 EndIf If z=3 Then Print "COMPUTER ROLLED ROCK" Print "COMPUTER WINS!" cc=cc+1 EndIf EndIf If c=2 Then If z=2 Then Print "draw" dc=dc+1 EndIf If z=1 Then Print "COMPUTER ROLLED PAPER" Print "COMPUTER WINS!" cc=cc+1 EndIf If z=3 Then Print "COMPUTER ROLLED PAPER" Print name$+" WINS!" pc=pc+1 EndIf EndIf If c=3 Then If z=3 Then Print "draw" dc=dc+1 EndIf If z=2 Then Print "COMPUTER ROLLED SCIZZORS" Print "COMPUTER WINS!" cc=cc+1 EndIf If z=1 Then Print "COMPUTER ROLLED SCIZZORS" Print name$+" WINS!" pc=pc+1 EndIf EndIf If pc+cc+dc=10 Then Print "" Print "" Print name$+" won "+pc+" times" Print "Computer won "+cc+" times" Print "there were "+dc+" draws" WaitKey() End EndIf Wend
who knows I may make a version thats rigged
|
|
|
Post by Umbrafire on Aug 7, 2005 17:07:55 GMT -5
lol, ten bucks says I can make one with cleaner, shorter code
|
|
|
Post by Azan on Aug 7, 2005 17:10:54 GMT -5
im sure you can, but this is for people who are trying to learn. if I made the long strings variables and used data forloops and whatnot to record it it would be very hard to understand. (and that code is as about as clean as it can get, indents and everything )
|
|
|
Post by Umbrafire on Aug 7, 2005 17:16:33 GMT -5
lol, I was just kidding
|
|