~ajpaon/squell

21cba727a04b7df9f9768f60cd33ba2fdf3221f7 — Andrew Paon 10 months ago 654da4c
clarify gridfield_place's return value
1 files changed, 2 insertions(+), 0 deletions(-)

M main.c
M main.c => main.c +2 -0
@@ 154,6 154,8 @@ GridField allowed_moves(GridField g, struct Piece p) {
  return allowed;
}

// Returns a gridfield that with the piece added at the given coordinates.
// If the move is illegal, it returns the original field.
GridField gridfield_place(GridField g, struct Piece p, int x, int y) {
  if ((x > 9 - p.width) || (y > 9 - p.height)) {
    // invalid location