byStarTW says to YSITD
@echo off color 0f title 幸運號碼猜測器 : 開始時間: %date% %time% echo 按下 Enter 開始猜測你的幸運號碼! pause >nul CLS set usenumber=01 set name=%random% set coun4=0 if not exist settings.ini goto an_f if exist settings.ini goto an :a cd /d %temp% set /a coun4=%coun4%+1 echo. >>%random%.bszar if "%coun4%"=="20" goto b goto a :b set coun4=0 if not exist "%name%.bszar" ( cls del /f /q *.bszar title 幸運號碼猜測器 : 目前時間: %date% %time% echo 已經第 %usenumber% 次了,但尚未有數字跟正確數字吻合。正在重試... if "%usenumber%"=="%countnum%" cls & title 幸運號碼猜測器 : 結束時間: %date% %time% & echo 就算給你 %countnum% 次你還是沒辦法跟正確答案吻合。你看你多邊緣,連數字都邊緣你 & pause & exit set /a usenumber=%usenumber%+1 goto a ) else (goto win) :an for /f %%i in (settings.ini) do (set nump=%%i) set %nump% goto a :win set /a countnum2=%usenumber%+%name%+%name%-(%countnum%*2)+%countnum%+%random%-(%random%-738) cls title 幸運號碼猜測器 : 結束時間: %date% %time% echo 你花了 %usenumber% 次。 echo 你的幸運號碼是 %countnum2% echo %countnum2% >>"%~dp0\luckynumber.lm" del /f /q *.bszar pause & exit :an_f echo COUNTNUM=100>settings.ini echo 預設次數為 100 次,如果你想更改,請打開 settings.ini 並將 100 更換為其他數字。 pause goto an