lminc 2.0.1

An assembler and interpreter for the Little Minion Computer model created by Professor Magnus Bordewich of Durham University, based on the Little Man Computer created by Dr. Stuart Madnick of M.I.T. in 1965
Documentation
#[cfg(all(feature = "std", feature = "extended"))]
mod example {
    use lminc::{assembler, runner::stdio::Runner};

    /// Imported assembly
    const ASSEMBLY: &str = include_str!("extended_input.txt");

    pub fn main() {
        // Assemble the assembly
        let memory = assembler::assemble_from_text(ASSEMBLY)
            .expect("failed to parse")
            .expect("failed to assemble");

        // Create the runner, which also initialises the computer
        let mut runner = Runner::new(memory);

        // Run the computer
        if let Err(error) = runner.run() {
            eprintln!("{error}");
        }
    }
}

#[cfg(not(all(feature = "std", feature = "extended")))]
mod example {
    pub fn main() {
        eprintln!("To run this example, the `std` and `extended` features must be enabled!");
    }
}

/// Takes an input character and a number and repeats the character that many times
fn main() {
    example::main();
}