Here is the code:
Code: Select all
@echo off &setlocal
title RockPaperScissors
set/a wins=0
set/a lost=0
set/a draws=0
:rps1
cls
set/a spr=%random% %% 3
if %spr%==1 GOTO paper
if %spr%==2 GOTO scissors
:rock
cls
SET INPUT=
ECHO Make a choice
echo type stats to see wins and losses
SET /P input=rock/paper/scissors:
if /i "%input%"=="rock" GOTO draw
if /i "%input%"=="paper" GOTO win
if /i "%input%"=="scissors" GOTO loss
if /i "%input%"=="stats" goto stats
GOTO rps1
:paper
cls
SET INPUT=
ECHO Make a choice
echo type stats to see wins and losses
SET /P input=rock/paper/scissors:
if /i "%input%"=="rock" GOTO draw
if /i "%input%"=="paper" GOTO win
if /i "%input%"=="scissors" GOTO loss
if /i "%input%"=="stats" goto stats
GOTO rps1
:scissors
cls
SET INPUT=
ECHO Make a choice
echo type stats to see wins and losses
SET /P input=rock/paper/scissors:
if /i "%input%"=="rock" GOTO draw
if /i "%input%"=="paper" GOTO win
if /i "%input%"=="scissors" GOTO loss
if /i "%input%"=="stats" goto stats
GOTO rps1
:win
cls
SET INPUT=
set/a wins=%wins% + 1
ECHO You have won. play again
set /p input=y/n:
if /i "%input%"=="y" GOTO rps1
if /i "%input%"=="n" GOTO :eof
GOTO win
:loss
cls
SET INPUT=
set/a lost=%lost% + 1
ECHO You have been defeated. play again
set /p input=y/n:
if /i "%input%"=="y" GOTO rps1
if /i "%input%"=="n" GOTO :eof
GOTO loss
:draw
cls
SET INPUT=
set/a draws=%draws% + 1
ECHO The game ended in a draw. play again
set /p input=y/n:
if /i "%input%"=="y" GOTO rps1
if /i "%input%"=="n" GOTO :eof
GOTO draw
:stats
cls
echo you have won %wins% game(s)
echo you have lost %lost% game(s)
echo you have drawn on %draws% occasion(s)
pause
goto rps1
I am currently working on a super rock paper scissors for more hands(e.g.rock,paper,scissors) would be greatly apreciated.BatMaster