extern crate rstm;
fn main() -> rstm::Result<()> {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::TRACE)
.with_target(false)
.with_timer(tracing_subscriber::fmt::time::uptime())
.init();
let input = [0, 0, 0, 0, 1, 0, 1, 1, 0, 1];
let mut tmh = rstm::tmh! {
#[default_state(0isize)]
program {
(0, 0) -> Right(1, 0),
(0, 1) -> Left(-1, 1),
(1, 0) -> Right(1, 1),
(1, 1) -> Right(0, 0),
(-1, 0) -> Left(<isize>::MAX, 0),
(-1, 1) -> Left(-1, 0),
}
};
tmh.program()
.expect("Failed to get program")
.export_json("./crates/rstm/examples/example.program.json")?;
tmh.extend_tape(input);
tmh.run()
}