Day 13!
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user