<jupyter_start><jupyter_text>First install ludopy<jupyter_code>!pip install ludopy<jupyter_output><empty_output><jupyter_text>Import ludopy and some others<jupyter_code>import ludopy
import numpy as np
from tqdm import tqdm<jupyter_output><empty_output><jupyter_text>Run the random walk<jupyter_code>g = ludopy.Game()
there_is_a_winner = False

while not there_is_a_winner:
    (dice, move_pieces, player_pieces, enemy_pieces, player_is_a_winner, there_is_a_winner), player_i = g.get_observation()

    if len(move_pieces):
        piece_to_move = move_pieces[np.random.randint(0, len(move_pieces))]
    else:
        piece_to_move = -1

    _, _, _, _, _, there_is_a_winner = g.answer_observation(piece_to_move)

print("Saving history to numpy file")
g.save_hist(f"game_history.npy")
print("Saving game video")
g.save_hist_video(f"game_video.mp4")<jupyter_output><empty_output><jupyter_text>Now you can download the video<jupyter_code>from google.colab import files
files.download('game_video.mp4')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10204081632653061, 'fraction_numerical': 0.003887269193391642, 'mean_word_length': 7.306451612903226, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '49115', 'license': 'MIT', 'n_tokens_mistral': 403, 'n_tokens_neox': 388, 'n_words': 64, 'path': 'demo/random_walk.ipynb', 'repo_name': 'kulus96/ludo_game_AI2', 'size': '1029'}