Here is paper scissors rock 20 liner that I made:
AIMove = rnd(2) : Randomize Timer() : Do : Text screen width()/2-100,30,"Paper, Scissors, Rock" : Set Cursor 120,150 : Print "Score ",PlayerScore," - ",AIScore : Text screen width()/2-80,55,"Enter "1" to exit" : Set Cursor 120,180 : Input "Your move: ",Choice$ : Choice$ = Upper$(Choice$) : If Choice$ = "1" then end
If Choice$ = "PAPER" then Move = 0
If Choice$ = "SCISSORS" then Move = 1
If Choice$ = "ROCK" then Move = 2
AIMove = rnd(2) : Power = rnd(2) : If Power = 2 then AIMove = Move - 1
If Power = 1 then AIMove = Move + 1
If AIMove > 2 then AIMove = 0
If AIMove < 0 then AIMove = 2
If AIMove = 0 then AIChoice$ = "PAPER"
If AIMove = 1 then AIChoice$ = "SCISSORS"
If AIMove = 2 then AIChoice$ = "ROCK"
Winner(a,b) : Result = Winner(Move,AIMove) : Text$ = Choice$ : Set Cursor 120,200 : If result = -1 : Text$ = Text$ + " is beaten by " : AIScore = AIScore + 1 : Else
If result = 1 : Text$ = Text$ + " beats " : PlayerScore = PlayerScore + 1 : Else
If result = 0 : Text$ = Text$ + " draws with " : EndIf : EndIf : EndIf : Text$ = Text$ + AIChoice$ : Print Text$ : Wait key : cls : sync : loop
Function Winner(a,b) : c = (a+3-b) mod 3 : If c = 2 then c = -1
EndFunction c
UnCompressed code with functions
`PAPER, SCISSSORS, ROCK!!!!!!!!!!
`Written by Daniel
`Date: September 21
Global Text$ : Global Move : Global Result : Global Choice$
Global AIChoice$ : Global AIMove : Global PlayerScore : Global AIScore
AIMove = rnd(2) : Randomize Timer()
Do
Text screen width()/2-100,30,"Paper, Scissors, Rock"
Set Cursor 120,150
Print "Score ",PlayerScore," - ",AIScore
Text screen width()/2-80,55,"Enter "1" to exit"
PlayerMove()
ComputerMove()
Winner(a,b)
Result = Winner(Move,AIMove)
ShowResult()
sync
cls
loop
Function PlayerMove()
Set Cursor 120,180
Input "Your move: ",Choice$
Choice$ = Upper$(Choice$)
If Choice$ = "1" then end
If Choice$ = "PAPER" then Move = 0
If Choice$ = "SCISSORS" then Move = 1
If Choice$ = "ROCK" then Move = 2
EndFunction
Function ComputerMove()
Power = rnd(2)
If Power = 2
AIMove = Move - 1
Else
If Power = 1 then AIMove = Move + 1
EndIf
If AIMove > 2 Then AIMove = 0
If AIMove < 0 Then AIMove = 2
If AIMove = 0 then AIChoice$ = "PAPER"
If AIMove = 1 then AIChoice$ = "SCISSORS"
If AIMove = 2 then AIChoice$ = "ROCK"
EndFunction
Function Winner(a,b)
rem Returns +1 if 'a' wins, -1 if 'b' wins, 0 if they draw
c = (a+3-b) mod 3
If c = 2 then c = -1
EndFunction c
Function ShowResult()
Text$ = Choice$
Set Cursor 120,200
If result = -1
Text$ = Text$ + " is beaten by "
AIScore = AIScore + 1
Else
If result = 1
Text$ = Text$ + " beats "
PlayerScore = PlayerScore + 1
Else
If result = 0
Text$ = Text$ + " draws with "
EndIf
EndIf
EndIf
Text$ = Text$ + AIChoice$
Print Text$
Wait key
cls
EndFunction
*Note* I am a noob and as such any suggestions are welcome!