Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在编写一个 cpn ml 语言代码,我几乎是一个初学者。我想知道如何在 if 语句中编写 2 个或多个条件?我的意思是我想“和”几个条件,以便它们都应该同时正确。这是代码。我可以使用 ; 分隔条件吗?作为解决方案?
fun EvalD(Xw,Yw,Xb,Yb) = if Xw=8 then false else if (Xw=7;Yw=1;Xb=8;Yb=1) then false else if (Xw=7;Yw=2;Xb=8;Yb=2) then false else true;
在 CPN ML 中有用于此目的的关键字“andalso”和“orelse”。