Comlpex if 语句在 tibasic 中不起作用

问题描述

我正在制作一个需要一些复杂 if 语句的游戏,这是不起作用的代码

If K=25 and not(Y=1) and not([A](X,Y-1)=1)
Then
... Other Code ...
End

但是当我这样做时它有效

If K=25 and not(Y=1)
Then
If not([A](X,Y-1)=1)
Then
.. Other Code ..
End
End

有什么问题吗?

解决方法

诸如 not(Y=1) and not([A](X,Y-1)=1) 之类的条件的问题(顺便说一下,您可以使用 运算符而不是将 not(= 组合)是 TI-BASIC 中 and 的边总是被评估(与它在许多其他语言中的工作方式相反)。这意味着如果 Y 实际上是 1,那么右侧的表达式仍然会被计算,但它会失败并返回 INVALID DIM 错误。因此,不幸的是,必须拆分这样的条件。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...