(我將編輯或刪除這篇文章,如果我寫的東西不好) 所以我有這個代碼,我似乎無法正確拉出。看看它。批量編程:隨機轉到代碼的隨機部分
set /a num=%random% %%9 +1
set /p start="Do you want to start? "
if %start% ==yes goto %random%
if %start% ==no exit
:1
echo Tu turi %score% tasku (-us)!
set /p answer="6 x 5 = "
if %answer% equ 30 (
echo Teisingai! Gavai 1 taska!
set /a score+=1
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:2
echo Tu turi %score% tasku (-us)!
set /p answer="123 x 3 = "
if %answer% equ 369 (
echo Teisingai! Gavai 1 taska!
set /a score+=1
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:3
echo Tu turi %score% tasku (-us)!
set /p answer="-93128 + 993128 = "
if %answer% equ 900000 (
echo Teisingai! gavai 5 taskus!
set /a score+=5
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:4
echo Tu turi %score% tasku!
set /p answer="35734534757357 x 0 = "
if %answer% equ 0 (
echo Teisingai! gavai 2 taskus!
set /a score+=2
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:5
echo Tu turi %score% tasku!
set /p answer="6 + 8 x 3 = "
if %answer% equ 30 (
echo Teisingai! gavai 3 taskus!
set /a score+=3
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:6
echo Tu turi %score% tasku!
set /p answer="X + 1234 = 2468. Koks skaicius yra X?"
if %answer% equ 1234 (
echo Teisingai! gavai 4 taskus!
set /a score+=4
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:7
echo Tu turi %score% tasku!
set /p answer="-9 x -9 = "
if %answer% equ 81 (
echo Teisingai! gavai 5 taskus!
set /a score+=5
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:8
echo Tu turi %score% tasku!
set /p answer="1 + 1 x (111 x 3) = "
if %answer% equ 666 (
echo Teisingai! gavai 6 taskus!
set /a score+=6
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
:9
echo Tu turi %score% tasku!
set /p answer="634745645634576456457645657 x 0 = "
if %answer% equ 0 (
echo Teisingai! gavai 2 taskus!
set /a score+=2
echo %score% > %player%.sav
) else (
echo Neteisingai :(Atsakymas buvo %answer%!
echo %score% > %player%.sav
)
它主要是用不同的語言。抱歉。基本上我想這樣做,如果你在開始時寫「是」,它會去一個隨機的數學問題(從1到9)。我希望有人會理解這一點,因爲我不擅長解釋的東西:(
是的,而不是'goto%random%'' – Aacini
似乎並不奏效。它只是退出遊戲 – user2812596