1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
#![deny(trivial_casts, trivial_numeric_casts, unsafe_code)] #![warn( missing_crate_level_docs, missing_docs, missing_debug_implementations, missing_copy_implementations, unused_crate_dependencies, unused_extern_crates, unused_import_braces, unused_lifetimes, unused_qualifications, unused_results )] //! This is a collection of different maze generation algorithms. //! //! The project's main goal is to provide an easy-to-use API to different algorithms with different characteristics. //! //! # Examples //! ``` //! // Generate a 3 by 3 maze using a provided seed and the recursive-backtracking algorithm //! use maze_generator::prelude::*; //! use maze_generator::recursive_backtracking::RbGenerator; //! //! let mut generator = RbGenerator::new(Some([42; 32])); //! let grid = generator.generate(3, 3); //! //! assert_eq!(format!("{:?}", grid), //! "·-·-·-· //! |S| | //! · ·-· · //! | | //! ·-·-· · //! | | //! ·-·-·-· //! "); //! ``` //! //! ``` //! // Retrieve information about a specific cell from the maze //! use maze_generator::prelude::*; //! use maze_generator::recursive_backtracking::RbGenerator; //! //! let mut generator = RbGenerator::new(Some([42; 32])); //! let grid = generator.generate(3, 3); //! //! assert_eq!(format!("{:?}", grid.get_field(grid.get_start()).unwrap()), //! "RbField { north: \"wall\", east: \"wall\", south: \"passage\", west: \"wall\" }"); //! ``` //! #[macro_use] pub mod prelude; pub mod recursive_backtracking; mod util; #[macro_use] extern crate bitflags; #[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } }