Skip to content
An implementation of Cellular Automata Method for generating random cave-like level written in Rust.
Rust
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Cargo.toml
LICENSE.md
README.md

README.md

Cave Map

A port of the Cellular Automata Method for generating random cave-like levels to Rust.

Example

cave_map 45 45 45 5 1 6
W[0](p) = rand[0, 100) < 45

Repeat 6: W'(p) = R[1](p) >= 5 || R[2](p) <= 1

#############################################
#.#####....#####...##.......####...###..###.#
#######....#####..####.....######..###..#####
#.#####.....###...####....#######..###..###.#
#...###..#........#####...##...##..###..###.#
#....##..###.....###.#######.......####..##.#
###..##..#####..####.######.......#####..##.#
###..##..#####..###########......######..####
#....###........##########........#.......###
#...####.........##..#####...###............#
#...####..#####.......####...####....#..#...#
#....##..#######.......##....####.......##..#
###......#######...##.........##..#.....#...#
###......#######..####...###......##........#
#.##......#####...####..####.....#........###
#.##...............##....##...............###
###...##.....................##...##......###
###..###.....####......##...###..####.....###
#....###....##############..###..#####......#
#....###....##############..###..######.....#
#...#####....############....#....#####...###
#..######.......########..........##..##..###
#.#######..##....#######..##...#..##..##..###
#..#####..#####...#######..#####..######..###
#..####...######..#######..#####..#####..##.#
#..###...#######..######..###..##..####..##.#
#.###...#######....####...#.........##..###.#
#.##...######............##..##.....##..###.#
####..######.....##....####..##....###...####
###..######.......########...##...#####...#.#
###..######....#..######..........######..#.#
###...#####...###..#####..###......##########
####...###.....#...#####..######....##..#####
#####..###..#.....######..#######...##..#####
######..##..##....######......##...###..###.#
######..##..#.....##..##..........####..###.#
#####..####....#..........##.....#####.####.#
#.#....####...###...##...####....##########.#
#.....####.....#...####..####.........#######
##...####.........#####...##.............####
##..####..###......###..........##........###
##..###...####..........##......###.......###
#...###..######........######..#######....###
#...###...#####........######...######....#.#
#############################################
You can’t perform that action at this time.