-
Notifications
You must be signed in to change notification settings - Fork 0
/
BgCommon.h
38 lines (30 loc) · 825 Bytes
/
BgCommon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#if !defined __BG_COMMON_H
#define __BG_COMMON_H
#pragma once
#define NUM_OUTPUTS 5
#define NUM_ROLLOUT_OUTPUTS 6
#define OUTPUT_WIN 0
#define OUTPUT_WINGAMMON 1
#define OUTPUT_WINBACKGAMMON 2
#define OUTPUT_LOSEGAMMON 3
#define OUTPUT_LOSEBACKGAMMON 4
//NB: neural nets do not output equity, only rollouts do
#define OUTPUT_EQUITY 5
enum bgvariation
{
VARIATION_STANDARD, /* standard backgammon */
VARIATION_NACKGAMMON, /* standard backgammon with nackgammon starting position */
VARIATION_HYPERGAMMON_1, /* 1-chequer hypergammon */
VARIATION_HYPERGAMMON_2, /* 2-chequer hypergammon */
VARIATION_HYPERGAMMON_3, /* 3-chequer hypergammon */
NUM_VARIATIONS
};
#if defined(HUGE_VAL)
#define ERR_VAL (-HUGE_VAL)
#else
#define ERR_VAL (-FLT_MAX)
#endif
#ifndef SGN
#define SGN(x) ((x) > 0 ? 1 : -1)
#endif
#endif