Skip to content

Commit

Permalink
add generate leveldb script
Browse files Browse the repository at this point in the history
  • Loading branch information
fucusy committed Nov 8, 2024
1 parent 2d6c793 commit 21292b5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gomoku/script/generate_database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from divided_solution_manager import get_all_step_str2action_tuple, board_str2steps, normalize_steps_str

if __name__ == "__main__":
limit = 50000000
i = 0
path = "/Users/qiang/Documents/github/gomoku-move-database-compressor/moves.full.txt"
with open(path, 'w') as file:
for key, value in get_all_step_str2action_tuple():
norm_step_seq = normalize_steps_str(board_str2steps(key))
file.write(f"{norm_step_seq}:{value}\n")
i += 1
if i > limit:
break

0 comments on commit 21292b5

Please sign in to comment.