From 8915093ce1ed103cc52481118e1ab47bec663236 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Sun, 17 Jan 2021 21:06:04 -0500 Subject: Revert "Starting work on MCU port" This reverts commit 43eec01361eb6174142180c29afef960e041514e. --- src/ctaklm.c | 4 ++-- src/mcu.c | 76 ------------------------------------------------------------ 2 files changed, 2 insertions(+), 78 deletions(-) delete mode 100644 src/mcu.c (limited to 'src') diff --git a/src/ctaklm.c b/src/ctaklm.c index 9f5af4d..d2208a0 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -198,8 +198,8 @@ handle_turn(char *line) { uint8_t new_win = (won == 0xFF); switch (do_ptn(line)) { // Errors - case PTN_INVALID: { puts("Invalid PTN."); return EXIT_FAILURE; break; } - case ACT_ILLEGAL: { puts("Illegal action."); return EXIT_FAILURE; break; } + case PTN_INVALID: { puts("Invalid PTN."); return -1; break; } + case ACT_ILLEGAL: { puts("Illegal action."); return -1; break; } case ACT_OVERFLOW: { puts("Move would cause internal overflow, select another."); return EXIT_FAILURE; diff --git a/src/mcu.c b/src/mcu.c deleted file mode 100644 index 7248200..0000000 --- a/src/mcu.c +++ /dev/null @@ -1,76 +0,0 @@ -#include -#include -#include - -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE -1 - -/* - * static int - * handle_turn(char *line) { - * // Track win state - * uint8_t new_win = (won == 0xFF); - * switch (do_ptn(line)) { - * // Errors - * case PTN_INVALID: { return EXIT_FAILURE; break; } - * case ACT_ILLEGAL: { return EXIT_FAILURE; break; } - * case ACT_OVERFLOW: { return EXIT_FAILURE; break; } - * // Game has ended - * case GAME_END: { - * // Did it end this turn? - * if (new_win) { - * switch (won) { - * case WIN_DRAW: { break; } - * case WIN_FLAT_BLACK: { break; } - * case WIN_FLAT_WHITE: { break; } - * case WIN_ROAD_BLACK: { break; } - * case WIN_ROAD_WHITE: { break; } - * } - * } - * if (! new_win) return EXIT_FAILURE; - * break; - * } - * // Valid, append to game log - * case PTN_VALID: - * case ACT_OK: { break; } - * } - * return EXIT_SUCCESS; - * } - */ - -static void -dot(const uint8_t depth) { - PORTD ^= _BV(4); -} - - -static int -ct1986_turn(const uint8_t max_depth) { - // Prepare progress bar - // Run the minimax - float minimax = ct1986_generate(max_depth); - // Failed to find a move? - if ((minimax <= -infty && (ply & 1) == 1) - ||(minimax >= infty && (ply & 1) == 0)) { - // puts("] Opponent concedes!"); - return EXIT_FAILURE; - } else { - do_ptn(ct1986_ptn); - return EXIT_SUCCESS; - } -} - - -int main(void) { - DDRD = _BV(0) | _BV(4); - PORTD = 0; - - reset_state(5); - ct1986_display_progress = ˙ - PORTD = _BV(0) | _BV(4); - ct1986_turn(1); - PORTD = 0; - - while (1); - return 0; -} -- cgit v1.3.1