如果块崩溃?
IF Block crashing?
我为我的无能道歉,因为我刚刚开始使用批处理,但是这个 IF 块每次运行时都会崩溃我的程序,并出现语法不正确的错误。我找不到错误,有人可以帮忙吗?
echo What is the scale of this conflict? (Determines length of game)
echo 1. Small (Quick)
echo 2. Medium (Normal)
echo 3. Large (Extended)
SET /P difficulty="Type 1, 2, or 3, then press ENTER:"
IF %DIFF% == 3 (
set /a troops = %random% %%52 +45
set cities = 10
)
IF %DIFF% == 2 (
set /a troops = %random% %%32 +25
set cities = 6
)
IF %DIFF% == 1 (
set /a troops = %random% %%17 +10
set cities = 3
)
没有 DIFF
variable.May 如果你需要这个:
echo What is the scale of this conflict? (Determines length of game)
echo 1. Small (Quick)
echo 2. Medium (Normal)
echo 3. Large (Extended)
SET /P difficulty="Type 1, 2, or 3, then press ENTER:"
IF %difficulty% == 3 (
set /a troops = %random% %%52 +45
set cities = 10
)
IF %difficulty% == 2 (
set /a troops = %random% %%32 +25
set cities = 6
)
IF %difficulty% == 1 (
set /a troops = %random% %%17 +10
set cities = 3
)
我为我的无能道歉,因为我刚刚开始使用批处理,但是这个 IF 块每次运行时都会崩溃我的程序,并出现语法不正确的错误。我找不到错误,有人可以帮忙吗?
echo What is the scale of this conflict? (Determines length of game)
echo 1. Small (Quick)
echo 2. Medium (Normal)
echo 3. Large (Extended)
SET /P difficulty="Type 1, 2, or 3, then press ENTER:"
IF %DIFF% == 3 (
set /a troops = %random% %%52 +45
set cities = 10
)
IF %DIFF% == 2 (
set /a troops = %random% %%32 +25
set cities = 6
)
IF %DIFF% == 1 (
set /a troops = %random% %%17 +10
set cities = 3
)
没有 DIFF
variable.May 如果你需要这个:
echo What is the scale of this conflict? (Determines length of game)
echo 1. Small (Quick)
echo 2. Medium (Normal)
echo 3. Large (Extended)
SET /P difficulty="Type 1, 2, or 3, then press ENTER:"
IF %difficulty% == 3 (
set /a troops = %random% %%52 +45
set cities = 10
)
IF %difficulty% == 2 (
set /a troops = %random% %%32 +25
set cities = 6
)
IF %difficulty% == 1 (
set /a troops = %random% %%17 +10
set cities = 3
)