There is a button missing from the forum interface.. I can choose the file, but then I need to attach it to the post, and there is no option to perform this last step. I can post the entire script in a code tag here, but as I said, the problem is illustrated fully inside (note), which is the bit I quoted in the last post. And I'm actually using (exact) in this game, I just used (range) inside (note) when I wanted to pinpoint the issue.
Edit: Oh, nice. This time the file was actually attached.
Code:
(define "DistanceToNearestIceberg"
(count Steps
("OntoEmptyOrIceberg")
(from)
(sites Occupied by:Neutral)
)
)
(define "NearestIcebergs"
(intersection
(sites Occupied by:Neutral)
(sites Distance
("OntoEmptyOrIceberg")
from:(from)
(exact ("DistanceToNearestIceberg"))
)
)
)
(define "OntoEmptyOrIceberg"
(step
(to
if:(or
(= (id Neutral) (who at:(to)))
(is Empty (to))
)
)
)
)
(game "Icebreaker"
(players 2)
(equipment
{
(board (hex 5))
(piece "Disc" Each
(move Step
(to
if:(and
(or
(= (id Neutral) (who at:(to)))
(is Empty (to))
)
(= 1
(-
(count Steps
("OntoEmptyOrIceberg")
(from)
("NearestIcebergs")
)
(count Steps
("OntoEmptyOrIceberg")
(to)
("NearestIcebergs")
)
)
)
)
(apply
(if
(= (id Neutral) (who at:(to)))
(and
(remove (to))
(addScore Mover 1)
)
)
)
)
)
)
(piece "Disc" Neutral)
}
)
(rules
(start {
(place "Disc0" (difference (sites Board) (sites Corners)))
(place "Disc1" (intersection (sites Corners) (sites Phase 0)))
(place "Disc2" (intersection (sites Corners) (sites Phase 1)))
})
(play
(forEach Piece Mover
(then
(note
(sites Distance
(step (to if:(= (id Neutral) (who at:(to)))))
from:(centrePoint)
(range 2)
)
)
)
)
)
(end
(if
(no Pieces Neutral)
(byScore)
)
)
)
)
(metadata
(graphics {
(player Colour Neutral (colour White))
(player Colour P1 (colour Red))
(player Colour P2 (colour Black))
})
)
Edit: Oh, nice. This time the file was actually attached.