Struct mycon::Program [−][src]
pub struct Program<'env> { /* fields omitted */ }
An instance of a Befunge-98 program.
This manages all data associated to the running program, like the addressable space, all currently active instruction pointers and program configuration.
Methods
impl<'env> Program<'env>
[src]
impl<'env> Program<'env>
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new empty Program
.
pub fn read(code: &str) -> Self
[src]
pub fn read(code: &str) -> Self
Initializes a Program
with the given source code.
pub fn config(self, config: Config<'env>) -> Self
[src]
pub fn config(self, config: Config<'env>) -> Self
Sets the Program
's Config
.
pub fn step_single(&mut self)
[src]
pub fn step_single(&mut self)
Executes the current instruction of a single instruction pointer.
The IP will execute a single 'tick' as defined by the Funge-98 specification and then advance its position up to the next command, skipping any intermediate spaces and areas delimited by semicolons and wrapping around to the other side of the program if it steps out of the program area.
pub fn step_all(&mut self)
[src]
pub fn step_all(&mut self)
Executes the current instruction of every active instruction pointer.
Similarly to step_single
, each IP will be advanced to its next
command.
pub fn run(&mut self) -> i32
[src]
pub fn run(&mut self) -> i32
Runs the program to completion.
Instructions will continuously be executed until the program encounters
an error, all instruction pointers stop by encountering an
@
instruction or the program is stopped with a q
instruction.