我正在尝试根据合作社游戏创建一款小型文字游戏,其中一个拥有炸弹,另一个拥有指令。
我的程序每次启动时都会神秘地停止运行,并且由于我对批处理并不了解,所以我不知道问题出在哪里。
代码(的一部分),因为它有点长,并且从头开始停止:
@echo off
set Y = 18
set X = 1
set F1= Yellow wire
set F2= Blue wire
set F3= Green wire
set F4= Red wire
set F5= Orange wire
set F6= Pink wire
set F7= Black wire
set B1= Red button
set B2= Green button
set B3= Yellow button
set B4= Black button
set L1= Green lever
set L2= Red lever
title Bomb Defuser
color 0A
:menu
echo :==================:
echo :Bomb Defuser v1.0.0:
echo :==================:
pause>nul
echo How many interfaces for the bomb ? (min=2; max=5;)
set /p choie=
if %choie% == 2 (set Y=2)
if %choie% == 3 (set Y=3)
if %choie% == 4 (set Y=4)
if %choie% == 5 (set Y=5)
if %Y% EQU 18 exit
echo Start ? (y/n)
set /p choi=
if %choi% EQU y goto :InterfaceCreator
if %choi% NEQ n goto :menu
:InterfaceCreator /!!/it stops working when it comes here./!!/
set I = 0
set /a X= %Y%-1
for I<=X (
set /a AIO=%I%+1
set Rdm1= %Random% %% 9
if %Rdm1% EQU 0 set Mod1= %F1%
if %Rdm1% EQU 1 set Mod1= %F2%
if %Rdm1% EQU 2 set Mod1= %F3%
if %Rdm1% EQU 3 set Mod1= %F4%
if %Rdm1% EQU 4 set Mod1= %F5%
if %Rdm1% EQU 5 set Mod1= %F6%
if %Rdm1% EQU 6 set Mod1= %F7%
if %Rdm1% EQU 7 set Mod1= %L1%
if %Rdm1% EQU 8 set Mod1= %L2%