use coordinates::hex_map; use std::path::PathBuf; #[derive(Clone)] struct MapVal; impl Default for MapVal { fn default() -> Self { Self } } impl From for String { fn from(_val: MapVal) -> Self { ".".to_owned() } } fn main() { let mut args = std::env::args().skip(1); let filename = args .next() .map(|p| PathBuf::from(p)) .expect("A filename is required"); let size = args .next() .and_then(|s| s.parse::().ok()) .unwrap_or(3); let map: hex_map::Map = hex_map::Map::new_hexagonal(size); hex_map::write_file(filename, map); }