This commit is contained in:
2019-12-19 14:24:34 -08:00
parent 0840e8e642
commit b6e51ee8d1
5 changed files with 246 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
mod arcade;
mod args;
mod endchannel;
mod fuel;
@@ -7,12 +8,14 @@ mod orbits;
mod robot;
mod wiremap;
use crate::arcade::{auto_move, Move};
use crate::args::Command;
use crate::endchannel::channel;
use crate::fuel::calculate_fuel;
use crate::orbits::Object;
use crate::wiremap::WireMap;
use std::cmp::{max,min};
use terminal_graphics::Display;
fn main() {
match Command::get() {
@@ -157,5 +160,16 @@ fn main() {
println!("Multiplied together is {}", one_digits * two_digits);
image.draw();
}
Command::Arcade(mut arcade) => {
let mut screen = Display::new(40, 40);
screen.clear();
while arcade.process_update(auto_move) {
arcade.draw(&mut screen);
screen.print();
}
println!("Final score: {}", arcade.score);
}
}
}