My Project
pathEncoding.cc
Go to the documentation of this file.
1/* pathEncoding.cc
2 */
3#include "osl/pathEncoding.h"
4#include "osl/random.h"
5#include "osl/oslConfig.h"
6#include <iostream>
7
9
10namespace
11{
15}
16
18init()
19{
20 for (size_t i=0; i<MaxEncodingLength; ++i)
21 {
22 for (size_t j=0; j<Square::SIZE; ++j)
23 {
24 for (int k=0; k<PTYPE_SIZE; ++k)
25 {
26 const unsigned long long h = random();
27 const unsigned int l = random();
28 assert(l);
29 assert(h << 32);
30 // 手番を表現するため下位1bitをあけておく
31 values[i][j][k] = (h << 32) + (l & (~1u));
32 }
33 }
34 }
35}
36
37#if (!defined MINIMAL ) || (defined DFPNSTATONE)
38std::ostream& osl::operator<<(std::ostream& os, const osl::PathEncoding& path)
39{
40 os << std::hex << path.getPath() << std::dec << " " << path.getDepth();
41 return os;
42}
43#endif
44/* ------------------------------------------------------------------------- */
45// ;;; Local Variables:
46// ;;; mode:c++
47// ;;; c-basic-offset:2
48// ;;; End:
static osl::SetUpRegister _initializer([](){ osl::Centering3x3::table.init();})
static const size_t MaxEncodingLength
unsigned long long getPath() const
int getDepth() const
const int PTYPE_SIZE
Definition basic_type.h:107
PathEncodingTable Path_Encoding_Table
std::ostream & operator<<(std::ostream &os, Player player)
Definition basic_type.cc:14