1

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;
Little Girl
  • 27
  • 2
  • 8

1 Answers1

0

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

Gyrotank
  • 153
  • 1
  • 2
  • 9