how to write multiple conditions in if statement in cpn ml?

924 Views Asked by At

I'm writing a cpn ml language code and I'm almost a beginner. I wanted to know how can I write 2 or several conditions in if statement? I mean I want to "and" several condition so that all of them should be correct simultaneously. Here is the code. Can I separate conditions using ; as a solution?

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;
1

There are 1 best solutions below

0
On

In CPN ML there are keywords 'andalso' and 'orelse' for this purpose.