Skip to contents

Board

Construct and inspect a 4D tic-tac-toe board.

tsr_new_board()
Create a new, empty 4D tic-tac-toe board
is_ttt_board()
Test whether an object is a ttt_board

Moves and status

Play moves, undo, and read board state.

tsr_move()
Make a move on a 4D tic-tac-toe board
tsr_undo()
Undo the most recent moves on a board
tsr_legal_moves()
Legal moves on a board
tsr_check_win()
Detect a winner on the board
tsr_winning_line()
Indices of the first winning line on the board
tsr_is_full()
Whether the board has no empty cells
tsr_status()
Structured one-row status for a board

AI

Heuristic negamax opponent with adjustable difficulty.

tsr_ai_move()
AI move on a 4D tic-tac-toe board

Evaluation

The single source of truth for position scoring and win probability.

tsr_evaluate()
Evaluate a position
tsr_win_prob()
Calibrated win probability for a position
tsr_rate_moves()
Rate every legal move from a position

Simulation

Self-play between policies and opening statistics.

tsr_play_game()
Play a single game between two policies
tsr_simulate()
Simulate many games between two policies
tsr_opening_stats()
Opening statistics from a simulation
print(<tsr_game>)
Print method for a played game

Analysis

Move-by-move analysis and behavioral profiling.

tsr_analyze_game()
Analyze a played game move by move
tsr_turning_points()
Turning points from a game analysis
tsr_game_summary()
One-row summary for a played game
tsr_behavior_profile()
Aggregate behavioral profile for a side across many games
tsr_compare_profiles()
Combine multiple behavioral profiles
tsr_plot_winprob()
Win-probability trajectory for a game

Visualization

Render the hypercube as a grid of boards.

tsr_plot()
Plot a 4D tic-tac-toe board as a 4x4 grid of 4x4 boards
tsr_plot_slice()
Plot a 3D slice of a 4D tic-tac-toe board
autoplot(<ttt_board>)
Autoplot method for a 4D tic-tac-toe board
format(<ttt_board>) print(<ttt_board>) summary(<ttt_board>)
Print methods for a 4D tic-tac-toe board

App

Launch the interactive Shiny application.

tsr_run_app()
Launch the tesseractR Shiny app