void Reinitialise_nearly_everything(void) { // except 'First_player_was' // init everything for consistency *and* to ensure a clean restart on next game Cancel_Request = 0; expected_move = 0; a_win = FALSE; search_limit = 3; SP = 0; VALUEB = 0; NODES = 0; // most of these probably don't need initialising... Dim=M=PIECE=DIF=MODIF=MORE=best_piece=best_move=best_take=JMAN=POS=OLDPOS=NEWPOS=LASTPOS=COMPOS=ply_number=expected_move=0; //A=B=C=0; STATE = STATE_CHOOSE_FIRST_PLAYER; // should alternate after the first game STATE_PieceNum = STATE_FromX = STATE_FromY = STATE_ToPos = STATE_ToX = STATE_ToY = STATE_icon_style = 0; Cursor_X = Cursor_Y = Flash = 0; REPLY (1) = REPLY (2) = ' '; REPLY (3) = 0x80; // setting up the pieces COMP_COLOUR = PLAYER1.COLOUR; OPP_COLOUR = PLAYER2.COLOUR; COMP_PLAYERNO = PLAYER1.PLAYERNO; OPP_PLAYERNO = PLAYER2.PLAYERNO; for (P = 1; P <= 12; P++) { COMP_POS (P) = PLAYER1_POS(P); OPP_POS (P) = PLAYER2_POS(P); COMP_TYPE (P) = CKTYPE(PLAYER1_TYPE(P)); OPP_TYPE (P) = CKTYPE(PLAYER2_TYPE(P)); } for (P = 1; P <= MAX_RECURSIVE_DEPTH; P++) { MAX(P) = MIN(P) = 0; } P = 0; COMP_NUM = PLAYER1.NUM; OPP_NUM = PLAYER2.NUM; COMP_NUMC = PLAYER1.NUMC; OPP_NUMC = PLAYER2.NUMC; STATE = STATE_CHOOSE_FIRST_PLAYER; }