gpt4 book ai didi

windows - 缺少运算符 -3 无法识别为内部或外部命令。 - 批

转载 作者:可可西里 更新时间:2023-11-01 10:34:54 24 4
gpt4 key购买 nike

我有这段代码,它按预期运行和完成。但在错误之后给出错误。

Missing operator.
'-3' is not recognized as an internal or external command,
operable program or batch file.
Missing operator.
'-3' is not recognized as an internal or external command,
operable program or batch file.
r.6.5.mca

它确实回应了正确的答案,虽然它是 r.6.5.mca

这是代码

SET /a minrand=-3
SET /a maxrand=3
set /a placeobject=0
set /a createname=0
set /a oldX=5
set /a oldY=2

SET /a shiftX=%RANDOM% %% (maxrand-minrand+1)+minrand rem will set shiftX to number between %maxrand% & %minrand%
SET /a shiftY=%RANDOM% %% (maxrand-minrand+1)+minrand rem will set shiftY to number between %maxrand% & %minrand%
SET /a newX= (oldX+shiftX)
SET /a newY= (oldY+shiftY)

echo r.%newX%.%newY%.mca
pause

我注意到的一件事是,如果 minrand 是正数,问题就不会发生。对于这个程序,虽然它必须是一个负数。请记住它有效但会引发错误。

最佳答案

你不能在这样的行中使用 rem。将它们移到单独的一行,您所有的麻烦都将消失。

关于windows - 缺少运算符 -3 无法识别为内部或外部命令。 - 批,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32775351/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com