khetai 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4180faa9b1b6f2e37a105b4d10d086e4ff0abcc56965a3859d6cbf17c3457041
4
- data.tar.gz: 337d513e93969ba3d2bbdf69d6aef355709716ef389aa141f4d5b15f4a938987
3
+ metadata.gz: 6b6b55f09eb592401e3d7dfea8be7e7d37b57b1e2e044927a7799909c24f5209
4
+ data.tar.gz: 49c029e6025742e996b1d7dc2ad363fca5c6b4ea9c8b8dd5893090c60ad0abb0
5
5
  SHA512:
6
- metadata.gz: 5183344cf972f36b283f2045adcf1bbdc876fefdd8aab1f9433e72b3d5df2e17ede6d6f78e1d1560a7c9012458cba1456f4a1e7a15db42ea95491a554376e75e
7
- data.tar.gz: 35a431bb7de2dca1080468af770da146acb1883a8123fac542a46f1ea2cf2c528fd1b43b1a9d300be9a86fb822c60c9d2632d1d74ddf0ba45ddfcfb69360ea98
6
+ metadata.gz: '0149f6e1840a2062a4570d0e80203588b6f707ad30e311ee4d21908f0f7e5bf004c8794e0f3ee8fce6417e45c94e04d2eb6ac490ddae8b18f75c96ee287b1d9b'
7
+ data.tar.gz: 557a79c1fe3292ebd16bb9a45a99643bb496f12c9f27ed64e26c08594a08e77e4bbb0bae2d3e7b9059f32201b917759b36f97091ae5241926b2e95d54a7a1977
data/.gitignore CHANGED
@@ -16,6 +16,7 @@
16
16
  **/compile_commands.json
17
17
  /ext/khetai/dev/sdl-ui/commands.txt
18
18
  .vscode
19
+ .zed
19
20
  *.so
20
21
  *.o
21
22
  khet
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- khetai (0.3.5)
4
+ khetai (0.3.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -87,11 +87,8 @@ int alphabeta(int depth, enum Player player, int alpha, int beta) {
87
87
  Move valid_moves[NUM_VALID_MOVES] = {0};
88
88
  int vi = 0;
89
89
 
90
- int table_depth = initial_depth - depth;
91
90
  HashEntry *entry = search_table(hashes[hashes_index]);
92
- if (entry->key == hashes[hashes_index] && entry->depth > table_depth && is_move_legal(entry->move)) {
93
- valid_moves[vi++] = entry->move;
94
-
91
+ if (entry->key == hashes[hashes_index] && entry->depth >= depth) {
95
92
  if (entry->flag == EXACT)
96
93
  return entry->score;
97
94
  else if (entry->flag == LOWERBOUND && entry->score > alpha)
@@ -101,6 +98,9 @@ int alphabeta(int depth, enum Player player, int alpha, int beta) {
101
98
 
102
99
  if (alpha >= beta)
103
100
  return entry->score;
101
+
102
+ if (is_move_legal(entry->move))
103
+ valid_moves[vi++] = entry->move;
104
104
  }
105
105
 
106
106
  find_valid_moves(valid_moves, &vi);
@@ -130,14 +130,14 @@ int alphabeta(int depth, enum Player player, int alpha, int beta) {
130
130
  else if (best_score >= beta)
131
131
  flag = LOWERBOUND;
132
132
 
133
- insert_table(entry, hashes[hashes_index], table_depth, flag, best_score, best_move);
133
+ insert_table(entry, hashes[hashes_index], depth, flag, best_score, best_move);
134
134
  return best_score;
135
135
  }
136
136
 
137
- void insert_table(HashEntry *entry, uint64_t key, int table_depth, int flag, int score, Move move) {
138
- if (entry->key == 0 || table_depth > entry->depth) {
137
+ void insert_table(HashEntry *entry, uint64_t key, int depth, int flag, int score, Move move) {
138
+ if (entry->key == 0 || depth >= entry->depth) {
139
139
  entry->key = key;
140
- entry->depth = table_depth;
140
+ entry->depth = depth;
141
141
  entry->flag = flag;
142
142
  entry->score = score;
143
143
  entry->move = move;
@@ -1,3 +1,3 @@
1
1
  module KhetAI
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
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.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - jkugs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-02-14 00:00:00.000000000 Z
11
+ date: 2026-03-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: