diff options
author | Guillaume Pasquet <guillaume.pasquet@eggplant.io> | 2019-11-11 12:06:48 +0100 |
---|---|---|
committer | Guillaume Pasquet <guillaume.pasquet@eggplant.io> | 2019-11-11 12:06:48 +0100 |
commit | f120065b7f202fab2166085970ad91915ca930ff (patch) | |
tree | 17da25b916d08999faefb9c655f82b4b3a35a962 /src/main.rs | |
parent | c46dd9c0c14c211801f9ead3e7da735b4dde4711 (diff) |
Fixing corridors
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index 0293951..24a4bcb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,16 +38,35 @@ fn render_world(window: &Window, world: &World) { } } +fn debug_world(world: &World) { + let grid = world.to_tilegrid(); + + for (line) in grid.raw_data().iter() { + for block in line.iter() { + print!("{}", match block { + TileType::Floor => ".", + TileType::Wall => "█", + TileType::Corridor => "#", + TileType::Empty => " ", + _ => "?" + }); + } + print!("\n"); + } +} + fn main() { let mut world = World::new(24); world.generate(); - let window = initscr(); + debug_world(&world); + + // let window = initscr(); - render_world(&window, &world); + // render_world(&window, &world); - window.refresh(); + // window.refresh(); - window.getch(); - endwin(); + // window.getch(); + // endwin(); } |