Skip to content

Instantly share code, notes, and snippets.

@saintech
saintech / dungeon_rooms_generator.rs
Last active April 4, 2020 22:26
A primitive procedural map generator for maps based on rooms, like in The Binding of Isaac - https://play.rust-lang.org/?gist=59e250109f7844e980291a3b99e58310&edition=2018
use rand::seq::SliceRandom as _;
use rand::Rng;
use std::ops::Range;
const NUMBER_OF_ROOMS: Range<usize> = 9..12;
const SCREEN_WIDTH: usize = 80;
const SCREEN_HEIGHT: usize = SCREEN_WIDTH;
struct Room {
top: bool,