aboutsummaryrefslogtreecommitdiff
path: root/include/negamax.c
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-25 23:48:42 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit9c151da7ce0d00ecf04e4be9c395604d4c8882ad (patch)
treecb306bff965d517ca9b7c068040ed883bedf375c /include/negamax.c
parentfa382246017019bd2f0f3a303241bd2990c3cbdd (diff)
Stripping debug stuff
Diffstat (limited to 'include/negamax.c')
-rw-r--r--include/negamax.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/include/negamax.c b/include/negamax.c
index abb4e27..912705d 100644
--- a/include/negamax.c
+++ b/include/negamax.c
@@ -115,16 +115,11 @@ negamax(const uint8_t cur_depth, float alpha, float beta,
const float colour) {
float value = -infty;
-
- data_t bd[5*5];
- colour_stack_t bc[25];
-
action_list_t *list = action_list_generate();
if (list == NULL) return value; // ???
for (action_node_t *node=list->head; node!=NULL; node=node->next) {
- for (int k=0; k<25; k++) { bd[k]=celldat[k]; bc[k]=colours[k]; }
action_take(node);
// Compute the value of the node
@@ -143,31 +138,6 @@ negamax(const uint8_t cur_depth, float alpha, float beta,
}
action_undo(node);
- for (int k=0; k<25; k++) {
- if (bd[k]!=celldat[k]) {
- printf("Depth %d %.3f %.3f %d: { .type = %s, .loc = 0x%02X, .data0 = 0x%02X, .data1 = 0x%02X} DIFF 0x%02X \n",
- cur_depth,
- alpha,
- beta,
- ply,
- (node->type == A_PLACE) ? "A_PLACE" : "A_MOVE",
- node->loc,
- node->data0,
- node->data1,
- k);
- puts("Before:");
- for (int j=0; j<25;j++) printf("0x%02X ",bd[j]);
- putchar('\n');
- for (int j=0; j<25;j++) printf("0x%02X ",bc[j]);
- putchar('\n');
- puts("After:");
- for (int j=0; j<25;j++) printf("0x%02X ",celldat[j]);
- putchar('\n');
- for (int j=0; j<25;j++) printf("0x%02X ",colours[j]);
- putchar('\n');
- exit(1);
- }
- }
negamax_display_progress(cur_depth, list->length);
@@ -178,7 +148,7 @@ negamax(const uint8_t cur_depth, float alpha, float beta,
if (alpha >= beta) break;
}
}
- prune:
+
action_list_free(list);
return value;
}