Crates.io | mms-rs |
lib.rs | mms-rs |
version | 2.0.0 |
source | src |
created_at | 2023-06-05 15:26:31.712392 |
updated_at | 2023-06-06 09:46:51.496348 |
description | A port of the mms-cpp library for the micromouse simulator mms |
homepage | |
repository | https://github.com/hardliner66/mms-rs |
max_upload_size | |
id | 883115 |
size | 192,550 |
A simple library to use rust for mms.
Directory
to the code you checked out.Build Command
use: cargo build --release --example minimal-mouse
Run Command
use: ./target/release/examples/minimal-mouse
After that you can run the example from within mms.
Add mms-rs
to your dependencies with cargo add mms-rs
. Then you can use the api in your own code.
use mms_rs::MmsApi as Mouse;
fn main() -> Result<(), Box<dyn std::error::Error>> {
eprintln!("Running...");
Mouse::set_color(0, 0, &mms_rs::CellColor::DarkGreen)?;
Mouse::set_text(0, 0, "abc")?;
loop {
if !Mouse::wall_left()? {
Mouse::turn_left()?;
}
while Mouse::wall_front()? {
Mouse::turn_right()?;
}
Mouse::move_forward(None);
}
}