Loading RustViz Engine...
Represent terminal commands (Move, Write, Delete) as an enum and apply to canvas.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
pub enum Command {
Move { x: i32, y: i32 },
Write(String),
Clear,
}
pub fn execute(cmd: Command) {
match cmd {
Command::Move { x, y } => println!("Move to {x}, {y}"),
Command::Write(s) => println!("Write {s}"),
Command::Clear => println!("Clear"),
}
}