Ludii Forum
{} v. () - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13)
+--- Forum: About the Ludii Grammar (https://ludii.games/forums/forumdisplay.php?fid=15)
+--- Thread: {} v. () (/showthread.php?tid=10)



{} v. () - unhandyandy - 11-30-2019

When does one use {} rather than ()?


RE: {} v. () - Eric Piette - 12-01-2019

{} is to describe an array. For example {1 2 3} is an array of size 3 with the values 1, 2 and 3.

() is just to know what are the parameters of a ludeme.
For example for
Code:
(slide along:(in (step) (empty)))

The ludemes "step" and "empty" have no parameter. The ludeme "in" has the ludemes "step" and "empty" for parameters.
And the ludeme "slide" has the ludeme "in" for the parameter corresponding to "along".

Again all of that will be describe in our future version of the documentation in January for the release.


RE: {} v. () - unhandyandy - 12-01-2019

One thing that confuses me is that

Code:
(and (isPiece (to) "Jarl2") (in (to) (expand origin:(middle) 1 Orthogonal)))


but

Code:
(or {(isFriend (who (step))) (in (step) (corners)) (and (in (step) (centre)) (isZero (what (step))))})


Are the {} really necessary with "or"?


RE: {} v. () - Eric Piette - 12-01-2019

If you have only two elements in an Or or an And, no they are not necessary. If this is more, the ludeme is applied to an array, so yes there are necessary in this case because you have three ludemes on it.