Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title Rock, Paper, Scissors, batch version by GL1TCH3D.
- md "%userprofile%\documents\GL1TCH3D" 2>nul 1>nul
- set x="%userprofile%\documents\GL1TCH3D\settings.bat"
- set y="%userprofile%\documents\GL1TCH3D\set.vbs"
- :top
- if not exist %x% (
- echo @echo off >%x%
- echo set win=0 >>%x%
- echo set loss=0 >>%x%
- echo set tie=0 >>%x%
- echo set total=0 >>%x%
- echo set score=0 >>%x%
- echo set rock=0 >>%x%
- echo set paper=0 >>%x%
- echo set scissors=0 >>%x%
- )
- call %x%
- set /a totalc=%win%+%loss%+%tie%
- if not "%totalc%"=="%total%" (
- echo do > %y%
- echo msgbox("Detected tampering of the score.") >> %y%
- echo loop >> %y%
- start %y%
- PING 1.1.1.1 -n 1 -w 1000 >NUL
- del /f /q %y% > nul
- del /f /q %x% > nul
- )
- set /a totalp=(2*%win%)+(%tie%)+((-2)*%loss%)
- if not %totalp%==%score% (
- echo do > %y%
- echo msgbox("Detected tampering of the score.") >> %y%
- echo loop >> %y%
- start %y%
- PING 1.1.1.1 -n 1 -w 1000 >NUL
- del /f /q %y% > nul
- del /f /q %x% > nul
- )
- :loop
- ping -n 3 localhost > nul
- cls
- if %total%==0 (
- set winpct=0
- set losspct=0
- set tiepct=0
- goto skip
- )
- set /a winpct=(%win%*100)/%total%
- set /a losspct=(%loss%*100)/%total%
- set /a tiepct=(%tie%*100)/%total%
- :skip
- echo Statistics: Number: Percentage:
- echo Wins: %win% %winpct%%%
- echo Losses: %loss% %losspct%%%
- echo Ties: %tie% %tiepct%%%
- echo Total Games: %total%
- echo Total Score: %score%
- echo.
- echo You chose
- echo Rock: %rock% time(s)
- echo Paper: %paper% time(s)
- echo Scissors: %scissors% time(s)
- echo.
- echo This is rock, paper, scissors made by GL1TCH3D.
- echo You will be playing against the computer.
- echo Rock beats Scissors, Scissors beats Paper and Paper beats Rock.
- echo A win counts as 2 points. A tie counts as 1 point. A loss counts as -3 points.
- echo Keep in mind batch always rounds down. Therefore the percentage may be off by 1%.
- echo Type "reset" to reset all the statistics.
- echo Type "delete" to remove this batch and all secondary batches from your conputer.
- echo Press 1 for Rock, 2 for Paper and 3 for Scissors then press Enter.
- set /p input=
- set /a cpu=%random% %% 3 + 1
- if %input%==1 goto rock
- if %input%==2 goto paper
- if %input%==3 goto scissors
- if /i "%input%"=="reset" (
- del /q /f %x% > nul
- goto top
- )
- if /i "%input%"=="delete" (
- del /q /f %x% > nul
- del /q /f %0 > nul
- exit
- )
- echo Invalid input. Please try again.
- goto loop
- :rock
- echo You chose rock.
- set /a rock+=1
- if %cpu%==1 set cput=Rock
- if %cpu%==2 set cput=Paper
- if %cpu%==3 set cput=scissors
- echo The computer chose...
- ping -n 3 localhost > nul
- echo %cput%
- if %cpu%==3 goto win
- if %cpu%==2 goto loss
- if %cpu%==1 goto tie
- :paper
- echo You chose Paper.
- set /a paper+=1
- if %cpu%==1 set cput=Rock
- if %cpu%==2 set cput=Paper
- if %cpu%==3 set cput=scissors
- echo The computer chose...
- ping -n 3 localhost > nul
- echo %cput%
- if %cpu%==3 goto loss
- if %cpu%==2 goto tie
- if %cpu%==1 goto win
- :scissors
- echo You chose Scissors.
- set /a scissors+=1
- if %cpu%==1 set cput=Rock
- if %cpu%==2 set cput=Paper
- if %cpu%==3 set cput=scissors
- echo The computer chose...
- ping -n 3 localhost > nul
- echo %cput%
- if %cpu%==3 goto tie
- if %cpu%==2 goto win
- if %cpu%==1 goto loss
- :win
- echo You won!
- set /a win+=1
- set /a total+=1
- set /a score+=2
- goto config
- :loss
- echo You lost!
- set /a loss+=1
- set /a total+=1
- set /a score-=3
- goto config
- :tie
- echo You tied!
- set /a tie+=1
- set /a total+=1
- set /a score+=1
- goto config
- :config
- echo @echo off >%x%
- echo set win=%win% >>%x%
- echo set loss=%loss% >>%x%
- echo set tie=%tie% >>%x%
- echo set total=%total% >>%x%
- echo set score=%score% >>%x%
- echo set rock=%rock% >>%x%
- echo set paper=%paper% >>%x%
- echo set scissors=%scissors% >>%x%
- goto loop
Advertisement
Add Comment
Please, Sign In to add comment