【发布时间】:2016-03-17 14:12:37
【问题描述】:
我为我的无能深表歉意,因为我刚刚开始使用批处理,但是这个 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
)
【问题讨论】:
标签: batch-file if-statement cmd syntax-error batch-processing