I thought I'd try implementing Martian Chess (the pyramid game) in order to experiment with this very fascinating system, but I have run into a stumbling block: how to do movement of shared pieces.
I first tried something like this (equipment ... (piece "Queen" Shared (move Slide)) ... but then the (play (forEach Pieces)) would never show any available moves.
So then I tried coding the moves for each piece in the (play) section, but I'm having trouble getting the movement logic to work. I can't use the Step or Slide ludemes, since they throw null pointer exceptions at me. Maybe they can't handle from:(sites ...) rather than a singular site? The only thing I could get to work is (move <from> <to>) like this:
(move
(from (intersection (sites Mover) (sites Occupied by:Shared component:"Pawn")))
(to (sites Direction from:(from) Diagonal stop:(and (is Occupied at:(to)) (is In (to) (sites Mover))) distance:1)))
In Martian Chess, piece ownership is defined by where on the board they are located. This means I can remove a piece if it is moved into an opposing region, and add a new matching opponent piece at the same location. I feel there must be a more elegant solution hiding somewhere, though.
Are there any consideration of open sourcing the code? It would help immensely in trying to figure out what the ludemes do, since the documentation is a bit lacking in detail at points.
I first tried something like this (equipment ... (piece "Queen" Shared (move Slide)) ... but then the (play (forEach Pieces)) would never show any available moves.
So then I tried coding the moves for each piece in the (play) section, but I'm having trouble getting the movement logic to work. I can't use the Step or Slide ludemes, since they throw null pointer exceptions at me. Maybe they can't handle from:(sites ...) rather than a singular site? The only thing I could get to work is (move <from> <to>) like this:
(move
(from (intersection (sites Mover) (sites Occupied by:Shared component:"Pawn")))
(to (sites Direction from:(from) Diagonal stop:(and (is Occupied at:(to)) (is In (to) (sites Mover))) distance:1)))
In Martian Chess, piece ownership is defined by where on the board they are located. This means I can remove a piece if it is moved into an opposing region, and add a new matching opponent piece at the same location. I feel there must be a more elegant solution hiding somewhere, though.
Are there any consideration of open sourcing the code? It would help immensely in trying to figure out what the ludemes do, since the documentation is a bit lacking in detail at points.