|
MTMS main
Modern Turing Machine Simulator
|
Implementation of the interactive CLI session loops. More...
Go to the source code of this file.
Functions | |
| void | clear_viewport () |
| Flushes the active terminal frame using standard ANSI escape codes. | |
| void | render_dashboard (const TuringMachine &machine, int steps) |
| Renders the consolidated simulation status metrics and stacked tapes layout. | |
| int | run_cli_session (TuringMachine &machine, std::string_view input_word, bool interactive) |
| Executes the simulation via the terminal view layer. | |
Implementation of the interactive CLI session loops.
Definition in file cli.cpp.
|
inline |
Flushes the active terminal frame using standard ANSI escape codes.
Highly performant viewport reset preventing rendering flickering sequences.
Definition at line 23 of file cli.cpp.
Referenced by render_dashboard().
| void render_dashboard | ( | const TuringMachine & | machine, |
| int | steps | ||
| ) |
Renders the consolidated simulation status metrics and stacked tapes layout.
Definition at line 28 of file cli.cpp.
References clear_viewport(), TuringMachine::get_current_state(), State::get_label(), and TuringMachine::get_tapes().
Referenced by run_cli_session().
| int run_cli_session | ( | TuringMachine & | machine, |
| std::string_view | input_word, | ||
| bool | interactive | ||
| ) |
Executes the simulation via the terminal view layer.
| machine | The initialized Multi-Tape Turing Machine engine instance. |
| input_word | The raw string sequence to process. |
| interactive | If true, steps interactively. If false, executes instantly (batch mode). |
Definition at line 53 of file cli.cpp.
References TuringMachine::get_current_state(), State::get_label(), State::is_accept(), TuringMachine::load_input(), render_dashboard(), and TuringMachine::step().
Referenced by main().