home *** CD-ROM | disk | FTP | other *** search
/ Dream 57 / Amiga_Dream_57.iso / Amiga / Jeux / Reflexion / Crafty-15.19.lha / crafty-15.19 / src / data.c < prev    next >
C/C++ Source or Header  |  1998-09-13  |  41KB  |  882 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "chess.h"
  4. #include "evaluate.h"
  5.   
  6.    FILE           *input_stream;
  7.    FILE           *book_file;
  8.    FILE           *books_file;
  9.    FILE           *history_file;
  10.    FILE           *log_file;
  11.    FILE           *auto_file;
  12.    FILE           *book_lrn_file;
  13.    FILE           *position_file;
  14.    FILE           *position_lrn_file;
  15.    char           whisper_text[512];
  16.    int            whisper_value;
  17.    int            whisper_depth;
  18.    int            total_moves;
  19.    int            last_mate_score;
  20.    int            time_abort;
  21.    int            auto232;
  22.    int            auto232_delay;
  23.    signed char    abort_search;
  24.    char           log_filename[64];
  25.    char           history_filename[64];
  26.    int            number_of_solutions;
  27.    int            solutions[10];
  28.    int            solution_type;
  29.    char           cmd_buffer[512];
  30.    char           *args[32];
  31.    char           buffer[512];
  32.    int            nargs;
  33.    int            iteration_depth;
  34.    int            previous_search_value;
  35.    int            search_failed_high;
  36.    int            search_failed_low;
  37.    int            root_alpha;
  38.    int            root_beta;
  39.    int            root_value;
  40.    int            root_wtm;
  41.    int            root_move;
  42.    int            root_total_white_pieces;
  43.    int            root_total_white_pawns;
  44.    int            root_total_black_pieces;
  45.    int            root_total_black_pawns;
  46.    int            cpu_percent;
  47.    int            easy_move;
  48.    int            absolute_time_limit;
  49.    int            search_time_limit;
  50.    int            next_time_check;
  51.    int            burp;
  52.    int            ponder_move;
  53.    int            made_predicted_move;
  54.    int            ponder_moves[220];
  55.    int            num_ponder_moves;
  56.    unsigned int   opponent_start_time, opponent_end_time;
  57.    unsigned int   program_start_time, program_end_time;
  58.    unsigned int   start_time, end_time;
  59.    unsigned int   elapsed_start, elapsed_end;
  60.    unsigned int   evaluations;
  61.    int            book_move;
  62.    int            book_learn_eval[LEARN_INTERVAL];
  63.    int            book_learn_depth[LEARN_INTERVAL];
  64.    int            hash_maska;
  65.    int            hash_maskb;
  66.    unsigned int   pawn_hash_mask;
  67.    HASH_ENTRY      *trans_ref_wa;
  68.    HASH_ENTRY      *trans_ref_wb;
  69.    HASH_ENTRY      *trans_ref_ba;
  70.    HASH_ENTRY      *trans_ref_bb;
  71.    PAWN_HASH_ENTRY *pawn_hash_table;
  72.    int            history_w[4096], history_b[4096];
  73.    signed char    searched_this_root_move[256];
  74.    unsigned int   root_nodes[256];
  75.    PATH           pv[MAXPLY];
  76.    PATH           last_pv;
  77.    int            last_value;
  78.    int            pawn_advance[8];
  79.    int            pawn_value_b[64];
  80.    int            knight_value_b[64];
  81.    int            bishop_value_b[64];
  82.    int            rook_value_b[64];
  83.    int            queen_value_b[64];
  84.    int            king_value_b[64];
  85.    signed char    directions[64][64];
  86.    BITBOARD       w_pawn_attacks[64];
  87.    BITBOARD       b_pawn_attacks[64];
  88.    BITBOARD       knight_attacks[64];
  89.    BITBOARD       bishop_attacks[64];
  90.  
  91. #if defined(COMPACT_ATTACKS)
  92.   /* Stuff these into a structure to make the addressing slightly cheaper */
  93.   struct at at;
  94.   BITBOARD       diag_attack_bitboards[NDIAG_ATTACKS];
  95.   BITBOARD       anti_diag_attack_bitboards[NDIAG_ATTACKS];
  96.   DIAG_INFO      diag_info[64];
  97. #else
  98.   BITBOARD       bishop_attacks_rl45[64][256];
  99.   BITBOARD       bishop_attacks_rr45[64][256];
  100.   int            bishop_mobility_rl45[64][256];
  101.   int            bishop_mobility_rr45[64][256];
  102. #endif
  103.   BITBOARD       rook_attacks[64];
  104. #if !defined(COMPACT_ATTACKS)
  105.   BITBOARD       rook_attacks_r0[64][256];
  106.   BITBOARD       rook_attacks_rl90[64][256];
  107.   int            rook_mobility_r0[64][256];
  108.   int            rook_mobility_rl90[64][256];
  109. #endif
  110.  
  111.    POSITION       search;
  112.    POSITION       display;
  113.    BITBOARD       queen_attacks[64];
  114.    BITBOARD       king_attacks[64];
  115.    BITBOARD       king_attacks_1[64];
  116.    BITBOARD       king_attacks_2[64];
  117.    BITBOARD       obstructed[64][64];
  118.    unsigned int   w_pawn_random32[64];
  119.    unsigned int   b_pawn_random32[64];
  120.    BITBOARD       w_pawn_random[64];
  121.    BITBOARD       b_pawn_random[64];
  122.    BITBOARD       w_knight_random[64];
  123.    BITBOARD       b_knight_random[64];
  124.    BITBOARD       w_bishop_random[64];
  125.    BITBOARD       b_bishop_random[64];
  126.    BITBOARD       w_rook_random[64];
  127.    BITBOARD       b_rook_random[64];
  128.    BITBOARD       w_queen_random[64];
  129.    BITBOARD       b_queen_random[64];
  130.    BITBOARD       w_king_random[64];
  131.    BITBOARD       b_king_random[64];
  132.    BITBOARD       enpassant_random[65];
  133.    BITBOARD       castle_random_w[2];
  134.    BITBOARD       castle_random_b[2];
  135.    BITBOARD       wtm_random[2];
  136.    BITBOARD       endgame_random_w;
  137.    BITBOARD       endgame_random_b;
  138.    BITBOARD       w_rooks_random;
  139.    BITBOARD       b_rooks_random;
  140.    BITBOARD       threat_flag;
  141.    BITBOARD       clear_mask[65];
  142.    BITBOARD       clear_mask_rl45[65];
  143.    BITBOARD       clear_mask_rr45[65];
  144.    BITBOARD       clear_mask_rl90[65];
  145.    BITBOARD       set_mask[65];
  146.    BITBOARD       set_mask_rl45[65];
  147.    BITBOARD       set_mask_rr45[65];
  148.    BITBOARD       set_mask_rl90[65];
  149.    BITBOARD       file_mask[8];
  150.    BITBOARD       rank_mask[8];
  151.    BITBOARD       mask_not_rank8;
  152.    BITBOARD       mask_not_rank1;
  153.    BITBOARD       right_side_mask[8];
  154.    BITBOARD       left_side_mask[8];
  155.    BITBOARD       right_side_empty_mask[8];
  156.    BITBOARD       left_side_empty_mask[8];
  157.    BITBOARD       right_half_mask, left_half_mask;
  158.    BITBOARD       mask_abs7_w, mask_abs7_b;
  159.    BITBOARD       pawns_cramp_black;
  160.    BITBOARD       pawns_cramp_white;
  161.    BITBOARD       mask_advance_2_w;
  162.    BITBOARD       mask_advance_2_b;
  163.    BITBOARD       mask_left_edge;
  164.    BITBOARD       mask_right_edge;
  165.    BITBOARD       mask_corner_squares;
  166.    BITBOARD       promote_mask_w;
  167.    BITBOARD       promote_mask_b;
  168.    BITBOARD       mask_G2G3;
  169.    BITBOARD       mask_B2B3;
  170.    BITBOARD       mask_G6G7;
  171.    BITBOARD       mask_B6B7;
  172.    BITBOARD       mask_A7H7;
  173.    BITBOARD       mask_A2H2;
  174.    BITBOARD       center;
  175.    BITBOARD       stonewall_white;
  176.    BITBOARD       stonewall_black;
  177.    BITBOARD       mask_kr_trapped_w[3];
  178.    BITBOARD       mask_qr_trapped_w[3];
  179.    BITBOARD       mask_kr_trapped_b[3];
  180.    BITBOARD       mask_qr_trapped_b[3];
  181.    BITBOARD       good_bishop_kw;
  182.    BITBOARD       good_bishop_qw;
  183.    BITBOARD       good_bishop_kb;
  184.    BITBOARD       good_bishop_qb;
  185.    BITBOARD       light_squares;
  186.    BITBOARD       dark_squares;
  187.    BITBOARD       not_rook_pawns;
  188.    BITBOARD       plus1dir[65];
  189.    BITBOARD       plus7dir[65];
  190.    BITBOARD       plus8dir[65];
  191.    BITBOARD       plus9dir[65];
  192.    BITBOARD       minus1dir[65];
  193.    BITBOARD       minus7dir[65];
  194.    BITBOARD       minus8dir[65];
  195.    BITBOARD       minus9dir[65];
  196.    BITBOARD       mask_eptest[64];
  197.  
  198. #  if !defined(CRAY1)
  199.      BITBOARD       mask_1;
  200.      BITBOARD       mask_2;
  201.      BITBOARD       mask_3;
  202.      BITBOARD       mask_4;
  203.      BITBOARD       mask_8;
  204.      BITBOARD       mask_16;
  205.      BITBOARD       mask_32;
  206.      BITBOARD       mask_72;
  207.      BITBOARD       mask_80;
  208.      BITBOARD       mask_85;
  209.      BITBOARD       mask_96;
  210.      BITBOARD       mask_107;
  211.      BITBOARD       mask_108;
  212.      BITBOARD       mask_112;
  213.      BITBOARD       mask_118;
  214.      BITBOARD       mask_120;
  215.      BITBOARD       mask_121;
  216.      BITBOARD       mask_127;
  217. #  endif
  218.  
  219.    BITBOARD       mask_clear_entry;
  220.  
  221. #  if !defined(CRAY1)
  222.      unsigned char  first_ones[65536];
  223.      unsigned char  last_ones[65536];
  224. #  endif
  225.  
  226.    unsigned char  first_ones_8bit[256];
  227.    unsigned char  last_ones_8bit[256];
  228.    unsigned char  connected_passed[256];
  229.    BITBOARD       mask_kingside_attack_w1;
  230.    BITBOARD       mask_kingside_attack_w2;
  231.    BITBOARD       mask_kingside_attack_b1;
  232.    BITBOARD       mask_kingside_attack_b2;
  233.    BITBOARD       mask_queenside_attack_w1;
  234.    BITBOARD       mask_queenside_attack_w2;
  235.    BITBOARD       mask_queenside_attack_b1;
  236.    BITBOARD       mask_queenside_attack_b2;
  237.    BITBOARD       mask_pawn_protected_b[64];
  238.    BITBOARD       mask_pawn_protected_w[64];
  239.    BITBOARD       mask_pawn_isolated[64];
  240.    BITBOARD       mask_pawn_passed_w[64];
  241.    BITBOARD       mask_pawn_passed_b[64];
  242.    BITBOARD       mask_promotion_threat_w[64];
  243.    BITBOARD       mask_promotion_threat_b[64];
  244.    BITBOARD       mask_pawn_connected[64];
  245.    BITBOARD       mask_no_pawn_attacks_w[64];
  246.    BITBOARD       mask_no_pawn_attacks_b[64];
  247.    BITBOARD       mask_a1_corner;
  248.    BITBOARD       mask_a8_corner;
  249.    BITBOARD       mask_h1_corner;
  250.    BITBOARD       mask_h8_corner;
  251.    BITBOARD       white_minor_pieces;
  252.    BITBOARD       black_minor_pieces;
  253.    BITBOARD       white_center_pawns;
  254.    BITBOARD       black_center_pawns;
  255.    BITBOARD       white_pawn_race_wtm[64];
  256.    BITBOARD       white_pawn_race_btm[64];
  257.    BITBOARD       black_pawn_race_wtm[64];
  258.    BITBOARD       black_pawn_race_btm[64];
  259.    BITBOARD       mask_wk_4th, mask_wq_4th, mask_bk_4th, mask_bq_4th;
  260.    BITBOARD       mask_wk_5th, mask_wq_5th, mask_bk_5th, mask_bq_5th;
  261.    BOOK_POSITION  book_buffer[BOOK_CLUSTER_SIZE];
  262.    BOOK_POSITION  books_buffer[BOOK_CLUSTER_SIZE];
  263.    unsigned int   thread_start_time[CPUS];
  264.  
  265. #  if defined(SMP)
  266.    TREE           *local[MAX_BLOCKS+1];
  267.    TREE           *volatile thread[CPUS];
  268.    lock_t         lock_hasha, lock_hashb, lock_pawn_hash, lock_smp, lock_io;
  269.    pthread_attr_t pthread_attr;
  270. #  else
  271.    TREE           *local[1];
  272. #  endif
  273.  
  274. # define    VERSION                            "15.19"
  275.   char      version[6] =                    {VERSION};
  276.   PLAYING_MODE mode =                     normal_mode;
  277.  
  278. #if defined(SMP)
  279.   volatile int smp_idle =                           0;
  280.   volatile int smp_threads =                        0;
  281. #endif
  282.  
  283.   int       batch_mode =                            0; /* no asynch reads */
  284.   int       call_flag =                             0;
  285.   int       crafty_rating =                      2500;
  286.   int       opponent_rating =                    2500;
  287.   int       last_search_value =                     0;
  288.   int       pgn_suggested_percent =                 0;
  289.   char      pgn_event[32] = {"?"};
  290.   char      pgn_site[32] = {"?"};
  291.   char      pgn_date[32] = {"????.??.??"};
  292.   char      pgn_round[32] = {"?"};
  293.   char      pgn_white[64] = {"unknown"};
  294.   char      pgn_white_elo[32] = {""};
  295.   char      pgn_black[64] = {"Crafty " VERSION};
  296.   char      pgn_black_elo[32] = {""};
  297.   char      pgn_result[32] = {"*"};
  298.  
  299.   int       number_of_specials =                    3;
  300.  
  301.   char      special_list[512][20] = {
  302.                                       {"bughousemansion"},
  303.                                       {"mercilous"},
  304.                                       {"crissaegrim"}};
  305.  
  306.   int       number_auto_kibitzers =                11;
  307.  
  308.   char      auto_kibitz_list[64][20] = {
  309.                                       {"diepx"},
  310.                                       {"ferret"},
  311.                                       {"hossa"},
  312.                                       {"judgeturpin"},
  313.                                       {"knightc"},
  314.                                       {"knightcap"},
  315.                                       {"mink"},
  316.                                       {"otter"},
  317.                                       {"rajah"},
  318.                                       {"tcb"},
  319.                                       {"zarkovx"}};
  320.   
  321.  
  322.   int       number_of_computers =                  95;
  323.   char      computer_list[512][20] = {
  324.                                       {"abner"},
  325.                                       {"aha"},
  326.                                       {"afisher"},
  327.                                       {"aragorn"},
  328.                                       {"babyblue"},
  329.                                       {"ban"},
  330.                                       {"bigblue"},
  331.                                       {"bikerbabe"},
  332.                                       {"bobbyfischer"},
  333.                                       {"bountyhunter"},
  334.                                       {"braincan"},
  335.                                       {"brause"},
  336.                                       {"carokann"},
  337.                                       {"chameleon"},
  338.                                       {"chesskid"},
  339.                                       {"chesst"},
  340.                                       {"chessica"},
  341.                                       {"chesscomputer"},
  342.                                       {"chinook"},
  343.                                       {"comet"},
  344.                                       {"crazyb"},
  345.                                       {"crazyknight"},
  346.                                       {"cstal-x"},
  347.                                       {"deep-modem"},
  348.                                       {"deepviolet"},
  349.                                       {"diep"},
  350.                                       {"diepx"},
  351.                                       {"destroyer"},
  352.                                       {"doctorwho"},
  353.                                       {"dominator"},
  354.                                       {"dustbin"},
  355.                                       {"ego-crusher"},
  356.                                       {"ferret"},
  357.                                       {"fitter"},
  358.                                       {"fritzpentium"},
  359.                                       {"futuregm"},
  360.                                       {"gammaray"},
  361.                                       {"gazaboy"},
  362.                                       {"gballa"},
  363.                                       {"gnusurf"},
  364.                                       {"hiarcs"},
  365.                                       {"jacdion"},
  366.                                       {"judgeturpin"},
  367.                                       {"kerrigan"},
  368.                                       {"knightattack"},
  369.                                       {"knightc"},
  370.                                       {"knightcap"},
  371.                                       {"kingtwoft"},
  372.                                       {"killerchess"},
  373.                                       {"killergrob"},
  374.                                       {"klamath"},
  375.                                       {"lightpurple"},
  376.                                       {"lonnie"},
  377.                                       {"lynnett"},
  378.                                       {"mchesspro"},
  379.                                       {"mephistoiii"},
  380.                                       {"mink"},
  381.                                       {"netsurfer"},
  382.                                       {"norpico"},
  383.                                       {"nowx"},
  384.                                       {"otter"},
  385.                                       {"pecabale"},
  386.                                       {"pescao"},
  387.                                       {"phibs"},
  388.                                       {"penguinwarden"},
  389.                                       {"purigr"},
  390.                                       {"rajah"},
  391.                                       {"ratbert"},
  392.                                       {"rdx"},
  393.                                       {"rebel"},
  394.                                       {"rebel8"},
  395.                                       {"robocop"},
  396.                                       {"roborvl"},
  397.                                       {"selectric"},
  398.                                       {"shredder"},
  399.                                       {"silmaril"},
  400.                                       {"spectronic"},
  401.                                       {"stobor"},
  402.                                       {"stuspar"},
  403.                                       {"tcb"},
  404.                                       {"theextreme"},
  405.                                       {"tingle"},
  406.                                       {"tommypa"},
  407.                                       {"turbocrafty"},
  408.                                       {"turbogm"},
  409.                                       {"ultragnu"},
  410.                                       {"vangelis"},
  411.                                       {"viktor2000"},
  412.                                       {"virtualmachine"},
  413.                                       {"wchess"},
  414.                                       {"wchessx"},
  415.                                       {"wheeler"},
  416.                                       {"whoknows"},
  417.                                       {"zarkovx"},
  418.                                       {"zuntsu"}};
  419.  
  420.   int       number_of_GMs =                       125;
  421.   char      GM_list[512][20] =       {{"agdestein"},
  422.                                       {"airgun"},
  423.                                       {"alexandrel"},
  424.                                       {"anat"},
  425.                                       {"andersson"},
  426.                                       {"anxions"},
  427.                                       {"ariela"},
  428.                                       {"attackgm"},
  429.                                       {"babyboss"},
  430.                                       {"badviking"},
  431.                                       {"bareev"},
  432.                                       {"baskmask"},
  433.                                       {"benyehuda"},
  434.                                       {"berliner"},
  435.                                       {"bigd"},
  436.                                       {"blatny"},
  437.                                       {"blow"},
  438.                                       {"bluedog"},
  439.                                       {"buzzcut"},
  440.                                       {"cambala"},
  441.                                       {"conguito"},
  442.                                       {"davenogood"},
  443.                                       {"davinci"},
  444.                                       {"deep-blue"},
  445.                                       {"dgurevich"},
  446.                                       {"dirtyharry"},
  447.                                       {"dixon"},
  448.                                       {"dlugy"},
  449.                                       {"dr"},
  450.                                       {"dranov"},
  451.                                       {"dumbo"},
  452.                                       {"feeai"},
  453.                                       {"figo"},
  454.                                       {"flamingskull"},
  455.                                       {"fosti"},
  456.                                       {"fright"},
  457.                                       {"gasch"},
  458.                                       {"gatakamsky"},
  459.                                       {"gatotkaca"},
  460.                                       {"gelfand"},
  461.                                       {"geysir"},
  462.                                       {"gmalex"},
  463.                                       {"gmdavies"},
  464.                                       {"gmsoffer"},
  465.                                       {"gref"},
  466.                                       {"gulko"},
  467.                                       {"handokoe"},
  468.                                       {"harzvi"},
  469.                                       {"heine"},
  470.                                       {"helgi"},
  471.                                       {"henley"},
  472.                                       {"hernandez"},
  473.                                       {"hugo"},
  474.                                       {"infochess"},
  475.                                       {"inov"},
  476.                                       {"jacaglaca"},
  477.                                       {"jantonio"},
  478.                                       {"jaque13"},
  479.                                       {"judgedredd"},
  480.                                       {"juditpolgar"},
  481.                                       {"juliogranda"},
  482.                                       {"julius"},
  483.                                       {"junior"},
  484.                                       {"kaidanov"},
  485.                                       {"karpov"},
  486.                                       {"kasparov"},
  487.                                       {"kc"},
  488.                                       {"kempka"},
  489.                                       {"kevlar"},
  490.                                       {"kingloek"},
  491.                                       {"knez"},
  492.                                       {"kotronias"},
  493.                                       {"kramnik"},
  494.                                       {"krogius"},
  495.                                       {"kudrin"},
  496.                                       {"lein"},
  497.                                       {"leon"},
  498.                                       {"leop"},
  499.                                       {"lev"},
  500.                                       {"levalburt"},
  501.                                       {"lombardy"},
  502.                                       {"lycan"},
  503.                                       {"margeir"},
  504.                                       {"mgur"},
  505.                                       {"moggy"},
  506.                                       {"mquinteros"},
  507.                                       {"mysko"},
  508.                                       {"nikolaidis"},
  509.                                       {"olafsson"},
  510.                                       {"phips"},
  511.                                       {"psakhis"},
  512.                                       {"racp"},
  513.                                       {"ree"},
  514.                                       {"repref"},
  515.                                       {"ricardi"},
  516.                                       {"rohde"},
  517.                                       {"sagalchik"},
  518.                                       {"sagdestein"},
  519.                                       {"scratchy"},
  520.                                       {"securitron"},
  521.                                       {"seinfeld"},
  522.                                       {"serper"},
  523.                                       {"shamkovich"},
  524.                                       {"shirov"},
  525.                                       {"short"},
  526.                                       {"sorokin"},
  527.                                       {"spangenberg"},
  528.                                       {"spanish-champ"},
  529.                                       {"spicegirl"},
  530.                                       {"stefansson"},
  531.                                       {"sweere"},
  532.                                       {"taimanov"},
  533.                                       {"tigre"},
  534.                                       {"tioro"},
  535.                                       {"tisdall"},
  536.                                       {"topalov"},
  537.                                       {"ttivel"},
  538.                                       {"uandersson"},
  539.                                       {"vagr"},
  540.                                       {"wbrowne"},
  541.                                       {"wilder"},
  542.                                       {"wojtkiewicz"},
  543.                                       {"yan"},
  544.                                       {"yermo"},
  545.                                       {"younglasker"}};
  546.  
  547.   int       number_of_IMs =                        11;
  548.   char      IM_list[512][20] =       {
  549.                                       {"adolf"},
  550.                                       {"badviking"},
  551.                                       {"bandora"},
  552.                                       {"imorlov"},
  553.                                       {"impolzin"},
  554.                                       {"laflair"},
  555.                                       {"lsokol"},
  556.                                       {"oed"},
  557.                                       {"thutters"},
  558.                                       {"thumpster"},
  559.                                       {"tim"}};
  560.  
  561.   int       ics =                                   0;
  562.   int       output_format =                         0;
  563.   int       EGTBlimit =                             5;
  564.   int       EGTB_use =                              5;
  565.   int       EGTB_draw =                             0;
  566.   int       xboard =                                0;
  567.   int       whisper =                               0;
  568.   int       channel =                               0;
  569.   int       early_exit =                           99;
  570.   int       new_game =                              0;
  571.   char      channel_title[32] =                  {""};
  572.   char      book_path[128] =                {BOOKDIR};
  573.   char      log_path[128] =                  {LOGDIR};
  574.   char      tb_path[128] =                    {TBDIR};
  575.   int       initialized =                           0;
  576.   int       kibitz =                                0;
  577.   int       post =                                  0;
  578.   int       log_id =                                1;
  579.   int       move_number =                           1;
  580.   int       wtm =                                   1;
  581.   int       crafty_is_white =                       0;
  582.   int       last_opponent_move =                    0;
  583.   int       incheck_depth =                        60;
  584.   int       onerep_depth =                         45;
  585.   int       recap_depth =                          45;
  586.   int       pushpp_depth =                         45;
  587.   int       threat_depth =                         45;
  588.   int       singular_depth =                       45;
  589.   int       largest_positional_score =            100;
  590.   int       search_depth =                          0;
  591.   int       search_move =                           0;
  592.   TIME_TYPE time_type =                       elapsed;
  593.   int       nodes_between_time_checks =         10000;
  594.   int       nodes_per_second =                  10000;
  595.   int       predicted =                             0;
  596.  
  597.   int       time_used =                             0;
  598.   int       time_used_opponent =                    0;
  599.   int       cpu_time_used =                         0;
  600.   int       auto_kibitzing =                        0;
  601.   signed char transposition_id =                    0;
  602.  
  603.   int       opening =                               1;
  604.   int       middle_game =                           0;
  605.   int       end_game =                              0;
  606.   signed char thinking =                            0;
  607.   signed char pondering =                           0;
  608.   signed char puzzling =                            0;
  609.   signed char booking =                             0;
  610.   int       analyze_mode =                          0;
  611.   int       annotate_mode =                         0;
  612.   int       test_mode =                             0;
  613.   int       analyze_move_read =                     0;
  614.   signed char resign =                              9;
  615.   signed char resign_counter =                      0;
  616.   signed char resign_count =                        5;
  617.   signed char draw_counter =                        0;
  618.   signed char draw_count =                         10;
  619.   int       tc_moves =                             60;
  620.   int       tc_time =                          180000;
  621.   int       tc_time_remaining =                180000;
  622.   int       tc_time_remaining_opponent =       180000;
  623.   int       tc_moves_remaining =                   60;
  624.   int       tc_secondary_moves =                   30;
  625.   int       tc_secondary_time =                 90000;
  626.   int       tc_increment =                          0;
  627.   int       tc_sudden_death =                       0;
  628.   int       tc_operator_time =                      0;
  629.   int       tc_safety_margin =                      0;
  630.   int       time_limit =                          100;
  631.   int       force =                                 0;
  632.   char      initial_position[80] =               {""};
  633.   char      hint[512] =                          {""};
  634.   char      book_hint[512] =                     {""};;
  635.   int       over =                                  0;
  636.   int       no_tricks =                             1;
  637.   int       computer_opponent =                     0;
  638.   int       draw_score_normal =                     0;
  639.   int       usage_level =                           0;
  640.   char      audible_alarm =                      0x07;
  641. #if defined(MACOS)
  642.   int       ansi =                                  0;
  643. #else
  644.   int       ansi =                                  1;
  645. #endif
  646.   int       book_accept_mask =                    ~03;
  647.   int       book_reject_mask =                      3;
  648.   int       book_random =                           1;
  649.   float     book_weight_freq =                    1.0;
  650.   float     book_weight_eval =                    0.1;
  651.   float     book_weight_learn =                   0.3;
  652.   int       book_search_trigger =                  20;
  653.   int       learning =                              7;
  654.   int       moves_out_of_book =                     0;
  655.   int       show_book =                             0;
  656.   int       book_selection_width =                  5;
  657.   int       ponder =                                1;
  658.   int       trace_level =                           0;
  659.   int       display_options =                    4095;
  660.   int       max_threads =                           0;
  661.   int       min_thread_depth =        2*INCREMENT_PLY;
  662.   unsigned int noise_level =                    10000;
  663.  
  664.   int       hash_table_size =                   65536;
  665.   int       log_hash =                             16;
  666.   int       pawn_hash_table_size =              32768;
  667.   int       log_pawn_hash =                        15;
  668.  
  669.   int       default_draw_score =                 DRAW;
  670.   int       accept_draws =                          0;
  671.  
  672.   int       passed_pawn_value[8] = { 0,
  673.                                      PAWN_PASSED, PAWN_PASSED*2,
  674.                                      PAWN_PASSED*3, PAWN_PASSED*6,
  675.                                      PAWN_PASSED*8,PAWN_PASSED*16,
  676.                                      0};
  677.  
  678.   int       isolated_pawn_value[9] = { 0,
  679.                                        -PAWN_ISOLATED,   -PAWN_ISOLATED*2,
  680.                                        -PAWN_ISOLATED*4, -PAWN_ISOLATED*7,
  681.                                        -PAWN_ISOLATED*10,-PAWN_ISOLATED*15,
  682.                                        -PAWN_ISOLATED*20,-PAWN_ISOLATED*25};
  683.  
  684.   int       supported_passer[8] =  { 0,
  685.                                      PAWN_SUPPORTED_PASSED_RANK2,
  686.                                      PAWN_SUPPORTED_PASSED_RANK3,
  687.                                      PAWN_SUPPORTED_PASSED_RANK4,
  688.                                      PAWN_SUPPORTED_PASSED_RANK5,
  689.                                      PAWN_SUPPORTED_PASSED_RANK6,
  690.                                      PAWN_SUPPORTED_PASSED_RANK7,
  691.                                      0};
  692.  
  693.   int       reduced_material_passer[20] = { 10,10,9,9,8,8,7,7,6,6,
  694.                                              5,5,4,4,3,3,2,2,1,1};
  695.  
  696.   int       outside_passed[128] = { 80, 50, 50, 50, 45, 42, 40, 40,
  697.                                     36, 36, 32, 32, 28, 28, 24, 24,
  698.                                     20, 20, 16, 16, 12, 12, 12, 12,
  699.                                     12, 12, 12, 12, 12, 12, 12, 12,
  700.                                     12, 12, 12, 12, 12, 12, 12, 12,
  701.                                     12, 12, 12, 12, 12, 12, 12, 12,
  702.                                     12, 12, 12, 12, 12, 12, 12, 12,
  703.                                     12, 12, 12, 12, 12, 12, 12, 12,
  704.                                     12, 12, 12, 12, 12, 12, 12, 12,
  705.                                     12, 12, 12, 12, 12, 12, 12, 12,
  706.                                     12, 12, 12, 12, 12, 12, 12, 12,
  707.                                     12, 12, 12, 12, 12, 12, 12, 12,
  708.                                     12, 12, 12, 12, 12, 12, 12, 12,
  709.                                     12, 12, 12, 12, 12, 12, 12, 12,
  710.                                     12, 12, 12, 12, 12, 12, 12, 12,
  711.                                     12, 12, 12, 12, 12, 12, 12, 12};
  712.  
  713.   char      square_color[64]  = { 1, 0, 1, 0, 1, 0, 1, 0,
  714.                                   0, 1, 0, 1, 0, 1, 0, 1,
  715.                                   1, 0, 1, 0, 1, 0, 1, 0,
  716.                                   0, 1, 0, 1, 0, 1, 0, 1,
  717.                                   1, 0, 1, 0, 1, 0, 1, 0,
  718.                                   0, 1, 0, 1, 0, 1, 0, 1,
  719.                                   1, 0, 1, 0, 1, 0, 1, 0,
  720.                                   0, 1, 0, 1, 0, 1, 0, 1 };
  721.  
  722.   int       b_n_mate_dark_squares[64] = 
  723.                              { 20, 15, 10,  5, -5,-10,-15,-20,
  724.                                15, 15, 10,  5, -5,-10,-15,-15,
  725.                                10, 10, 10,  5, -5,-10,-10,-10,
  726.                                 5,  5,  5,  5, -5, -5, -5, -5,
  727.                                -5, -5, -5, -5,  5,  5,  5,  5,
  728.                               -10,-10,-10, -5,  5, 10, 10, 10,
  729.                               -15,-15,-10, -5,  5, 10, 15, 15,
  730.                               -20,-15,-10, -5,  5, 10, 15, 20};
  731.  
  732.   int       b_n_mate_light_squares[64] =
  733.                              {-20,-15,-10, -5,  5, 10, 15, 20,
  734.                               -15,-15,-10, -5,  5, 10, 15, 15,
  735.                               -10,-10,-10, -5,  5, 10, 10, 10,
  736.                                -5, -5, -5, -5,  5,  5,  5,  5,
  737.                                 5,  5,  5,  5, -5, -5, -5, -5,
  738.                                10, 10, 10,  5, -5,-10,-10,-10,
  739.                                15, 15, 10,  5, -5,-10,-15,-15,
  740.                                20, 15, 10,  5, -5,-10,-15,-20};
  741.  
  742.   int       mate[64] =        {28, 26, 24, 22, 22, 24, 26, 28,
  743.                                26, 16, 14, 12, 12, 14, 16, 26,
  744.                                24, 14,  4,  2,  2,  4, 14, 24,
  745.                                22, 12,  2,  0,  0,  2, 12, 22,
  746.                                22, 12,  2,  0,  0,  2, 12, 22,
  747.                                24, 14,  4,  2,  2,  4, 14, 24,
  748.                                26, 16, 14, 12, 12, 14, 16, 26,
  749.                                28, 26, 24, 22, 22, 24, 26, 28};
  750.  
  751.   char            white_outpost[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
  752.                                         0, 0, 0, 0, 0, 0, 0, 0,
  753.                                         0, 0, 0, 0, 0, 0, 0, 0,
  754.                                         0, 0, 0, 2, 2, 0, 0, 0,
  755.                                         0, 0, 4, 5, 5, 4, 0, 0,
  756.                                         0, 0, 3, 6, 6, 3, 0, 0,
  757.                                         0, 0, 0, 1, 1, 0, 0, 0,
  758.                                         0, 0, 0, 0, 0, 0, 0, 0 };
  759.  
  760.   char            black_outpost[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
  761.                                         0, 0, 0, 1, 1, 0, 0, 0,
  762.                                         0, 0, 3, 6, 6, 3, 0, 0,
  763.                                         0, 0, 4, 5, 5, 4, 0, 0,
  764.                                         0, 0, 0, 2, 2, 0, 0, 0,
  765.                                         0, 0, 0, 0, 0, 0, 0, 0,
  766.                                         0, 0, 0, 0, 0, 0, 0, 0,
  767.                                         0, 0, 0, 0, 0, 0, 0, 0 };
  768.  
  769.   char           push_extensions[64] = { 0, 0, 0, 0, 0, 0, 0, 0,
  770.                                          1, 1, 1, 1, 1, 1, 1, 1,
  771.                                          0, 0, 0, 0, 0, 0, 0, 0,
  772.                                          0, 0, 0, 0, 0, 0, 0, 0,
  773.                                          0, 0, 0, 0, 0, 0, 0, 0,
  774.                                          0, 0, 0, 0, 0, 0, 0, 0,
  775.                                          1, 1, 1, 1, 1, 1, 1, 1,
  776.                                          0, 0, 0, 0, 0, 0, 0, 0 };
  777.  
  778.   int    pawn_value_w[64] = { 0,  0,  0,  0,  0,  0,  0,  0,
  779.                               0,  0,  0,  0,  0,  0,  0,  0,
  780.                               0,  0,  0,  0,  0,  0,  0,  0,
  781.                               0,  0,  0,  6,  6,  0,  0,  0,
  782.                               0,  0,  3,  6,  6,  0,  0,  0,
  783.                               0,  0,  3,  3,  3,  0,  0,  0,
  784.                               0,  0,  0,  0,  0,  0,  0,  0,
  785.                               0,  0,  0,  0,  0,  0,  0,  0};
  786.  
  787.   int  knight_value_w[64] = { 10, 10, 18, 18, 18, 18, 10, 10,
  788.                               10, 10, 22, 22, 22, 22, 10, 10,
  789.                               18, 22, 25, 25, 25, 25, 22, 18,
  790.                               18, 22, 25, 28, 28, 25, 22, 18,
  791.                               18, 22, 25, 28, 28, 25, 22, 18,
  792.                               18, 22, 25, 25, 25, 25, 22, 18,
  793.                                0,  0, 22, 22, 22, 22,  0,  0,
  794.                                0,  0, 18, 18, 18, 18,  0,  0};
  795.  
  796.   int  bishop_value_w[64] = { 10, 18, 18, 18, 18, 18, 18, 10,
  797.                               18, 22, 22, 22, 22, 22, 22, 18,
  798.                               18, 22, 25, 25, 25, 25, 22, 18,
  799.                               18, 22, 25, 25, 25, 25, 22, 18,
  800.                               18, 22, 25, 25, 25, 25, 22, 18,
  801.                               18, 22, 25, 25, 25, 25, 22, 18,
  802.                               18, 22, 22, 22, 22, 22, 22, 18,
  803.                               10, 18, 18, 18, 18, 18, 18, 10};
  804.  
  805.   int    rook_value_w[64] = {  0,  2,  3,  4,  4,  3,  2,  0,
  806.                               -4,  2,  3,  4,  4,  3,  2, -4,
  807.                               -4,  2,  3,  4,  4,  3,  2, -4,
  808.                               -4,  2,  3,  4,  4,  3,  2, -4,
  809.                                0,  2,  3,  4,  4,  3,  2,  0,
  810.                                0,  2,  3,  4,  4,  3,  2,  0,
  811.                                0,  2,  3,  4,  4,  3,  2,  0,
  812.                                0,  2,  3,  4,  4,  3,  2,  0};
  813.  
  814.   int   queen_value_w[64] = {-10, -8,  0,  0,  0,  0, -8,-10,
  815.                              -10,  2,  2,  2,  2,  2,  2,-10,
  816.                              -10,-10,  4,  5,  5,  4,-10,-10,
  817.                              -10,  2,  4,  6,  6,  4,  2,-10,
  818.                                0,  2,  4,  6,  6,  4,  2,  0,
  819.                                0,  2,  4,  6,  6,  4,  2,  0,
  820.                                0,  2,  4,  5,  5,  4,  2,  0,
  821.                                0,  0,  0,  0,  0,  0,  0,  0};
  822.  
  823.   int    king_value_w[64] = {-50,-40,-30,-20,-20,-30,-40,-50,
  824.                              -30,-20,-10,  0,  0,-10,-20,-30,
  825.                              -30,-10,  0, 10, 10,  0,-10,-30,
  826.                              -30,-10, 10, 20, 20, 10,-10,-30,
  827.                              -30,-10, 20, 30, 30, 20,-10,-30,
  828.                              -30,-10, 20, 30, 30, 20,-10,-30,
  829.                              -30,-30,-10,-10,-10,-10,-30,-30,
  830.                              -50,-30,-30,-30,-30,-30,-30,-50};
  831.  
  832. /* note that black piece/square values are copied from white, but
  833.    reflected */
  834.  
  835.    char king_defects_w[64]= { 4, 2, 3, 5, 5, 2, 1, 2,
  836.                               4, 3, 3, 7, 7, 3, 2, 2,
  837.                               6, 4, 6, 7, 7, 6, 4, 6,
  838.                               8, 5, 6, 8, 8, 6, 5, 8,
  839.                               8, 5, 6, 8, 8, 6, 5, 8,
  840.                               8, 5, 6, 8, 8, 6, 5, 8,
  841.                               8, 5, 6, 8, 8, 6, 5, 8,
  842.                               8, 5, 6, 8, 8, 6, 5, 8};
  843.  
  844.    char king_defects_b[64]= { 8, 5, 6, 8, 8, 6, 5, 8,
  845.                               8, 5, 6, 8, 8, 6, 5, 8,
  846.                               8, 5, 6, 8, 8, 6, 5, 8,
  847.                               8, 5, 6, 8, 8, 6, 5, 8,
  848.                               8, 5, 6, 8, 8, 6, 5, 8,
  849.                               6, 4, 6, 7, 7, 6, 4, 6,
  850.                               4, 3, 3, 7, 7, 3, 2, 2,
  851.                               4, 2, 3, 5, 5, 2, 1, 2};
  852.  
  853.   int       p_values[15] =       {QUEEN_VALUE,ROOK_VALUE,BISHOP_VALUE,0,
  854.                                   KING_VALUE,KNIGHT_VALUE,PAWN_VALUE,
  855.                                   0,PAWN_VALUE,KNIGHT_VALUE,KING_VALUE,
  856.                                   0, BISHOP_VALUE,ROOK_VALUE,QUEEN_VALUE};
  857.  
  858.   int       unblocked_pawns[9] = {-PAWN_UNBLOCKED*2,0,PAWN_UNBLOCKED*2,
  859.                                    PAWN_UNBLOCKED*3,  PAWN_UNBLOCKED*4,
  860.                                    PAWN_UNBLOCKED*4,  PAWN_UNBLOCKED*4,
  861.                                    PAWN_UNBLOCKED*4,  PAWN_UNBLOCKED*4};
  862.  
  863. #if !defined(COMPACT_ATTACKS)
  864.   int            bishop_shift_rl45[64] = { 63, 61, 58, 54, 49, 43, 36, 28,
  865.                                            61, 58, 54, 49, 43, 36, 28, 21,
  866.                                            58, 54, 49, 43, 36, 28, 21, 15,
  867.                                            54, 49, 43, 36, 28, 21, 15, 10,
  868.                                            49, 43, 36, 28, 21, 15, 10,  6,
  869.                                            43, 36, 28, 21, 15, 10,  6,  3,
  870.                                            36, 28, 21, 15, 10,  6,  3,  1,
  871.                                            28, 21, 15, 10,  6,  3,  1,  0 };
  872.  
  873.   int            bishop_shift_rr45[64] = { 28, 36, 43, 49, 54, 58, 61, 63,
  874.                                            21, 28, 36, 43, 49, 54, 58, 61,
  875.                                            15, 21, 28, 36, 43, 49, 54, 58,
  876.                                            10, 15, 21, 28, 36, 43, 49, 54,
  877.                                             6, 10, 15, 21, 28, 36, 43, 49,
  878.                                             3,  6, 10, 15, 21, 28, 36, 43,
  879.                                             1,  3,  6, 10, 15, 21, 28, 36,
  880.                                             0,  1,  3,  6, 10, 15, 21, 28 };
  881. #endif
  882.