main (examples/pychess/main.py)¶
Overview · 7 steps, 2 lanes
All 7 steps
| # | caller | callee | what it does | frames | call site |
|---|---|---|---|---|---|
| 1 | main | game_loop | Initialize engine, alternate human/AI turns until game over. | try (line 181) | examples/pychess/main.py:181 |
| 2 | game_loop | create_engine | Instantiate EntropicEngine with pychess config. | — | examples/pychess/main.py:151 |
| 3 | game_loop | print_board | Display board state and move list to stdout. | — | examples/pychess/main.py:156 |
| 4 | game_loop | _play_human_turn | Prompt for move, push to board, display. | loop (line 158), if (line 160) | examples/pychess/main.py:160 |
| 5 | game_loop | _play_ai_turn | Run AI generation, fall back to manual input on failure. | loop (line 158) | examples/pychess/main.py:162 |
| 6 | game_loop | _print_game_result | Display winner or draw status. | if (line 166) | examples/pychess/main.py:166 |
| 7 | game_loop | shutdown | Destroy the C engine handle. | — | examples/pychess/main.py:168 |
Functions¶
8 functions
create_engineexamples/pychess/engine.pyshutdownexamples/pychess/engine.py_play_ai_turnexamples/pychess/main.py_play_human_turnexamples/pychess/main.py_print_game_resultexamples/pychess/main.pygame_loopexamples/pychess/main.pymainexamples/pychess/main.pyprint_boardexamples/pychess/main.py
This diagram as Mermaid · PlantUML · Graphviz DOT
Quick views¶
8 functions, each with its quick view
- create_engine
Instantiate EntropicEngine with pychess config.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/engine.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- shutdown
Destroy the C engine handle.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/engine.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _play_ai_turn
Run AI generation, fall back to manual input on failure.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/main.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _play_human_turn
Prompt for move, push to board, display.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/main.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _print_game_result
Display winner or draw status.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/main.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- game_loop
Initialize engine, alternate human/AI turns until game over.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/main.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- main
Run game loop, handle keyboard interrupt.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/main.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- print_board
Display board state and move list to stdout.
Map
Show it on the map, in its block's wedge.
Block
examples/pychess is the block holding
examples/pychess/main.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.