Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Created July 1, 2021 13:15
Show Gist options
  • Save AJFaraday/e193454230414f0a4c5e183da7cc4e95 to your computer and use it in GitHub Desktop.
Save AJFaraday/e193454230414f0a4c5e183da7cc4e95 to your computer and use it in GitHub Desktop.
module.exports = class {
constructor(controller, utils) {
this.controller = controller;
this.side = controller.side;
this.utils = utils;
}
turn() {
let p = this.controller.pieces()[0];
let m = this.controller.check_space(p.x, p.y).moves[0] || false;
if (p && m) {
this.controller.select_space(p.x, p.y);
this.controller.move(m.x, m.y);
} else {
this.controller.declare(true);
}
}
end_turn() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment