diff options
| -rw-r--r-- | Makefile | 20 | ||||
| -rw-r--r-- | src/ctaklm.c | 13 |
2 files changed, 19 insertions, 14 deletions
@@ -11,24 +11,32 @@ STAT=pptdb BUILDROOT_DIR=buildroot-2020.11.1 -STRIP=$(BUILDROOT_DIR)/output/host/bin/arm-linux-strip -SIZE=$(BUILDROOT_DIR)/output/host/bin/arm-linux-size -CC=$(BUILDROOT_DIR)/output/host/bin/arm-linux-cc +ifeq ($(PLATFORM), pi) + STRIP=$(BUILDROOT_DIR)/output/host/bin/arm-linux-strip + SIZE=$(BUILDROOT_DIR)/output/host/bin/arm-linux-size + CC=$(BUILDROOT_DIR)/output/host/bin/arm-linux-cc +else + SIZE=size + STRIP=strip +endif %.o: %.c $(CC) -c $< -o $@ $(CFLAGS) +all: $(PROG) $(STAT) + $(PROG): src/$(PROG).o $(OBJS) $(CC) $(CFLAGS) src/$(PROG).o $(OBJS) -o $(PROG) $(STRIP) $(PROG) $(SIZE) $(PROG) +ifeq ($(PLATFORM), pi) + $(info Building the pi image) + ./do_buildroot.sh $(BUILDROOT_DIR) +endif $(STAT): src/$(STAT).o $(OBJS) $(CC) $(CFLAGS) src/$(STAT).o $(OBJS) -o $(STAT) -buildroot: $(PROG) - ./do_buildroot.sh $(BUILDROOT_DIR) - clean: rm -f $(PROG) rm -f $(STAT) diff --git a/src/ctaklm.c b/src/ctaklm.c index ff5b8b0..f1bb7cd 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -146,12 +146,9 @@ print_info(void) { (ply & 1) ? "Black" : "White", rst, (ply < 2) ? " (counter-play start)" : ""); - printf("Flats remaining: %s%02d%s, %s%02d%s\n", - wht,white_count & 127,rst, - blk,black_count & 127,rst); - printf("Caps remaining: %s%d%s, %s%d%s\n", - wht,white_count >> 7,rst, - blk,black_count >> 7,rst); + printf("Flats/Caps remaining: %s%02d/%d%s, %s%02d/%d%s\n", + wht, white_count & 127, white_count >> 7, rst, + blk, black_count & 127, black_count >> 7, rst); } static char *gamelog = 0; @@ -314,12 +311,12 @@ ct1986_turn(const uint8_t search_depth) { // Prepare progress bar fputs("Computing [", stdout); for (int k = 0; k < board_size * board_size; k++) putchar(' '); - fputs("]\033[26D",stdout); + fputs("] \033[s\033[27D",stdout); fflush(stdout); // Run the minimax sum_depth = 0; num_check = 0; float minimax = ct1986_generate(search_depth); - puts("]\033[1C"); + fputs("\033[u", stdout); // Failed to find a move? if ((minimax <= -infty && (ply & 1) == 1) ||(minimax >= infty && (ply & 1) == 0)) { |
