khetai 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 152a53d7588c5ecc8b763bf457852092ddebc3b10b2de158aa25695b1ce8436e
4
- data.tar.gz: 59de4c1797063aa6d952cdc3c954b093e63a5ad874c605d891532da32fb7cd77
3
+ metadata.gz: d169f4a004e24dd36c20cc0483e97089288c37d9a883102902e57ad90b9da52c
4
+ data.tar.gz: 4220a784bde8231944b7cd856839f651c7b7d0491748e6597a1d6a94c58c468d
5
5
  SHA512:
6
- metadata.gz: a59d6d2ee6d67b3938e9fe2caa8270094dbd88f2a36efbef9c70824da7684b61baca3b64ece435d659b2c83e54940c644b67acfd1efbcbdfef2a0d32355a36c1
7
- data.tar.gz: b92b7efea628fc6cc072b9ff74dfd3a9156c6ef1a9bec5fcc1e86d801254e1fd445d914f00c43399afa3b1ab4e3190dd435703c7798e811ad3645831cc06f059
6
+ metadata.gz: 74a55ef185db9d73c58e9e148a3e124f5850da6304be611d7466d8951e43b6d3165e9fbf5ae98654c12861a49e3281bf6a299f03f0b55e9d63ee51c6b76d2793
7
+ data.tar.gz: 6409ac627699d0daa5a7cacb4ce1da174be6f433228466b7cd0ffd04e7c47d9830f11de41e629313b38b776dd7a41647aa82e405f49dc18d69e03f23a14a8f65
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- khetai (0.2.2)
4
+ khetai (0.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -51,16 +51,19 @@ The internals of the gem are written in C, located in `ext/khetai`.
51
51
  $ bundle exec rake build
52
52
  $ gem install pkg/khetai-<version>.gem
53
53
 
54
- Once tested and verified, bump the version number in `lib/khetai/version.rb`
54
+ Once tested and verified, bump the version number in `lib/khetai/version.rb` and commit changes.
55
55
 
56
56
  To release and push to rubygems.org:
57
57
 
58
58
  $ bundle exec rake release
59
+
60
+ To push a pre-built gem manually:
61
+
59
62
  $ gem push pkg/<gem>
60
63
 
61
64
  ## Manual Testing
62
65
 
63
- There is a GUI test harness written in C++ using FLTK available in the `ext/khetai/dev/fltk-ui` directory.
66
+ There is a GUI test harness written in C++ using FLTK available in the [ext/khetai/dev/fltk-ui](/ext/khetai/dev/fltk-ui) directory.
64
67
 
65
68
  ### Why does this exist?
66
69
 
@@ -52,6 +52,11 @@ void (*AILoader::get_init_zobrist())()
52
52
  return reinterpret_cast<void (*)()>(get_symbol("init_zobrist"));
53
53
  }
54
54
 
55
+ void (*AILoader::get_reset_undo())()
56
+ {
57
+ return reinterpret_cast<void (*)()>(get_symbol("reset_undo"));
58
+ }
59
+
55
60
  void (*AILoader::get_setup_board())(char **)
56
61
  {
57
62
  return reinterpret_cast<void (*)(char **)>(get_symbol("setup_board"));
@@ -13,6 +13,7 @@ public:
13
13
  ~AILoader();
14
14
 
15
15
  void (*get_init_zobrist())();
16
+ void (*get_reset_undo())();
16
17
  void (*get_setup_board())(char **);
17
18
  void (*get_print_board())();
18
19
  void (*get_set_time_parameters())(int, time_t);
@@ -54,6 +54,7 @@ void free_c_array(char **c_array, size_t size)
54
54
  Move call_ai_move(AILoader &ai_loader, const std::vector<std::vector<std::string>> &board_pieces, Player player, int max_depth, int max_time)
55
55
  {
56
56
  auto init_zobrist = ai_loader.get_init_zobrist();
57
+ auto reset_undo = ai_loader.get_reset_undo();
57
58
  auto setup_board = ai_loader.get_setup_board();
58
59
  auto print_board = ai_loader.get_print_board();
59
60
  auto set_time_parameters = ai_loader.get_set_time_parameters();
@@ -65,6 +66,7 @@ Move call_ai_move(AILoader &ai_loader, const std::vector<std::vector<std::string
65
66
 
66
67
  char **c_board = vector_to_c_array(flatten_2d_vector_with_buffer(board_pieces));
67
68
 
69
+ reset_undo();
68
70
  init_zobrist();
69
71
  srand((unsigned)time(NULL));
70
72
 
@@ -471,6 +471,7 @@ void reset_undo()
471
471
 
472
472
  void setup_board(char *init_board[120])
473
473
  {
474
+ move_num = 0;
474
475
  uint64_t hash = 0;
475
476
  for (int i = 0; i < 120; i++)
476
477
  {
@@ -1,3 +1,3 @@
1
1
  module KhetAI
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: khetai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jkugs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-03 00:00:00.000000000 Z
11
+ date: 2024-11-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: