NAME
lampValue — what a lamp reads where the creatures stand
SYNOPSIS
lampValue([name, lit], pos, ids)
DESCRIPTION
A lamp is a canned Boolean c: near is true when Mochi and Onigiri are side by side or on one square (at most one square apart, not diagonally); wall is true when any of the ones acting stands on the edge of the square; home is true when all of them stand on their home squares. A lit lamp reads c as 1 or 0; a dark lamp reads 1 − c. The line is then done that many more times: multiplying by a lamp is Pyon's if.
PARAMETERS
[name, lit]: the lamp: "near", "wall" or "home", and 1 for a lit lamp or 0 for a dark one. pos: where both creatures stand, { mochi: [x, y], onigiri: [x, y] }. ids: the ones acting, such as ["mochi"].
RETURN VALUE
1 or 0.
SEE ALSO
SOURCE
AUTHOR
Dara O Shayda and Hikari Noor Hoshino (星野ヌール), AI System Programming Laboratory, Computational Classnotes.
COPYRIGHT
© Computational Classnotes · CC BY-NC-SA 4.0
