Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- call :barra t . "Vida restante"
- ping -n 2 logalhost >nul
- :ini
- cls
- set n1=%random:~0,3%
- ping -n 0,5 logalhost >nul
- set n2=%random:~0,3%
- ping -n 0,5 logalhost >nul
- set /a resu=%n1%+%n2%
- set /p "Soma=A soma de %n1% + %n2%= ? >: "
- if %Soma%==%resu% (call :barra + 2 "Resposta certa") else (call :barra - 2 "Resposta errada")
- ping -n 2 logalhost >nul
- goto :ini
- :barra
- setlocal enabledelayedexpansion
- if exist t.txt ( set /p tot=<t.txt ) else ( set tot=79 )
- if "%1"=="T" ( goto segue ) else (
- if %1==+ ( set /a tot=%tot%+%2 )
- if %1==- ( set /a tot=%tot%-%2 )
- )
- :segue
- color 0A
- set i=30
- FOR /l %%a in (30,1,79) do set j=!j!²
- FOR /l %%a in (30,1,79) do set j=!j!
- Echo %~3
- (Set /P j=!j!) < NUL
- :startshow
- call :show %i%
- :put
- set /a i = i + 1
- if /i %i% leq %tot% goto startshow
- echo %tot%>t.txt
- endlocal
- ECHO.
- goto :EOF
- :show
- set /a p=(%1*100)/79
- title !p!%% de vida restante
- (Set /P j=Û) < NUL
- exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement