Skip to content

Commit

Permalink
trim trailing whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sun-yuliang committed Jul 16, 2020
1 parent b35fe9a commit 61cc153
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion board.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static void lookup_update(Board* bd, const Pos pos)
Pos a2 = bd->seg[c - 1][3][pos].end;
Pos a3 = bd->seg[oc - 1][3][pos].sta;
Pos a4 = bd->seg[oc - 1][3][pos].end;

pat_reset(ppinc(bd));
score(bd)[0] = bd->sc[num(bd) - 1][0];
score(bd)[1] = bd->sc[num(bd) - 1][1];
Expand Down
2 changes: 1 addition & 1 deletion board.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef struct
u16 num[2]; // stone number
Pos board[BD_SIZE]; // board array
Pos mlist[BD_SIZE]; // move array

Pattern pinc; // pattern increment
Segment seg[2][4][BD_SIZE]; // segment array for each color, direction and position

Expand Down
2 changes: 1 addition & 1 deletion display.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void print_board(Board* bd)
printf("(%d, %d) ", bd->mlist[i] % BD_SIDE, bd->mlist[i] / BD_SIDE);
putchar('\n');
#endif

#if DISPLAY_CAND
print_mvlist(pcand(bd));
#endif
Expand Down
56 changes: 28 additions & 28 deletions index.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pattab.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ static void generate_pattern_defending(u8* tab, const Rule ru, const u8 len, con
i8 bd8 = len - 7;
i8 bd9 = len - 8;
u8 i, j, ind1 = PAT_START, ind2 = AD_START;

// reset to COL_INVALID
memset(tab, -1, PATTAB_SIZE);

Expand Down Expand Up @@ -686,7 +686,7 @@ static void generate_pattern_defending(u8* tab, const Rule ru, const u8 len, con
if (b4_7[sev[i]].is && !((mask >> i) & PatternList[b4_7[sev[i]].index][3]))
{
for (j = 5; j < PatternList[b4_7[sev[i]].index][4]; j++)
{
{
tab[ind2++] = PatternList[b4_7[sev[i]].index][j] + i;
tab[ind2++] = B4d;
}
Expand Down
2 changes: 1 addition & 1 deletion pattab.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern "C" {
#define PAT_START 3
#define AD_START (3 + PAT_SIZE)
#define PATTAB_SIZE (3 + PAT_SIZE + AD_SIZE)

extern u8 Pat5f[IIE5][PATTAB_SIZE];
extern u8 Pat6f[IIE6][PATTAB_SIZE];
extern u8 Pat7f[IIE7][PATTAB_SIZE];
Expand Down
2 changes: 1 addition & 1 deletion public.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
#define SEARCH_INFO 1
#define MESSAGE_STAT 0
#define RANDOM_PCT 0.0

// Search setting.
#define ITERATIVE_DEEPENING 1
#define SEARCH_DEPTH_MAX 256
Expand Down
14 changes: 7 additions & 7 deletions search.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Score evaluate(const Board* bd)
ev2 = score(bd)[opp(bd->next) - 1];
ev3 = bd->sc[num(bd) - 1][bd->next - 1];
ev4 = bd->sc[num(bd) - 1][opp(bd->next) - 1];

return (ev1 - ev2 + ev3 - ev4) / 2;
}

Expand All @@ -65,7 +65,7 @@ static Score alphabeta(Board* bd, Pos* best, const u16 dep, Score alpha, Score b
bd->node_cnt++;
if (num(bd) > bd->stone_max)
bd->stone_max = num(bd);

// Check WLD.
u8 offset = 0;
Color wld = check_wld(bd, &offset);
Expand Down Expand Up @@ -173,7 +173,7 @@ static Score alphabeta(Board* bd, Pos* best, const u16 dep, Score alpha, Score b
ev = -alphabeta(bd, &tmp, dep_new, -beta, -alpha);
undo(bd);
}

if (bd->timeout)
return alpha;

Expand Down Expand Up @@ -240,7 +240,7 @@ static Score iterative(Board* bd, Pos* best, u16* dep)
// if victory move is found
flag = true;
if (*dep > VICTORY_REPEAT - 1)
{
{
for (u16 i = 0; i < VICTORY_REPEAT; i++)
if (abs(ev_arr[*dep - 1 - i]) < VAL_VTHRE)
flag = false;
Expand Down Expand Up @@ -269,7 +269,7 @@ Pos get_best(Board* bd)
bd->stone_ini = num(bd);
bd->stone_max = num(bd);
bd->node_cnt = 0;

// Check if first move.
if (num(bd) == 0)
{
Expand Down Expand Up @@ -317,7 +317,7 @@ Pos get_best(Board* bd)
bd->t_end = get_ms();
print_message(bd, bd->search_dep, bd->stone_max - bd->stone_ini, ev, bd->node_cnt, bd->t_end - bd->t_begin);
#endif

#if MESSAGE_STAT
Pos ptmp;
Score ev0 = VAL_INVALID, ev1 = VAL_INVALID;
Expand All @@ -342,7 +342,7 @@ Pos get_best(Board* bd)
// break;
// }
// }

// CutThreshold
// ev0 = cand(bd).list[0].val; // largest ev in mvlist
// printf("MESSAGE %d\n", ev0 - ev1);
Expand Down
2 changes: 1 addition & 1 deletion test.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifdef __cplusplus
extern "C" {
#endif

void nei_table_test();

void mvlist_test();
Expand Down

0 comments on commit 61cc153

Please sign in to comment.