Crates.io | maze |
lib.rs | maze |
version | 0.1.2 |
source | src |
created_at | 2016-11-13 11:58:46.794725 |
updated_at | 2016-11-14 01:15:30.565985 |
description | Maze Generator |
homepage | |
repository | https://github.com/korczis/maze-rs |
max_upload_size | |
id | 7235 |
size | 33,449 |
Maze for Programmers (Rust)
$ ./target/debug/maze -h
Maze Generator 0.1.2
Tomas Korcak <korczis@gmail.com>
USAGE:
maze [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
-r, --rest Run REST Server
-V, --version Prints version information
-v, --verbose Verbose mode
OPTIONS:
-a, --algorithm <algorithm> Algorithm to use [default: aldous-broder] [values:
aldous-broder, binary, sidewinder]
-c, --cell-size <cell-size> Size of Cell [default: 80]
--color-cell <color-cell> Color of Cell [default: #fff]
--color-wall <color-wall> Color of Wall [default: #000]
-f, --format <format> Output format to use [default: ascii] [values: ascii, json,
png]
-y, --height <height> Height of Maze [default: 5]
-p, --rest-port <rest-port> REST Port [default: 5000]
-w, --wall-size <wall-size> Size of Wall [default: 20]
-x, --width <width> Width of Maze [default: 5]
$ cd dev/maze-rs/
tomaskorcak@kx-mac ~/dev/maze-rs$ cargo bench
Finished release [optimized] target(s) in 0.0 secs
Running target/release/deps/maze-0b23e703e6e9e01c
running 6 tests
test generator::aldous_broder::tests::bench_generate_100x100 ... bench: 61,610,364 ns/iter (+/- 24,858,439)
test generator::aldous_broder::tests::bench_generate_10x10 ... bench: 214,587 ns/iter (+/- 59,722)
test generator::binary::tests::bench_generate_100x100 ... bench: 5,123,808 ns/iter (+/- 976,614)
test generator::binary::tests::bench_generate_10x10 ... bench: 38,307 ns/iter (+/- 10,100)
test generator::sidewinder::tests::bench_generate_100x100 ... bench: 5,063,132 ns/iter (+/- 1,187,545)
test generator::sidewinder::tests::bench_generate_10x10 ... bench: 38,009 ns/iter (+/- 9,281)
test result: ok. 0 passed; 0 failed; 0 ignored; 6 measured
Running target/release/maze-1018e5569854def3
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
$ time ./target/release/maze -a aldous-broder -x 1000 -y 1000 > maze.txt
real 0m16.928s
user 0m13.188s
sys 0m3.555s
$ time ./target/release/maze -a binary -x 1000 -y 1000 > maze.txt
real 0m1.804s
user 0m1.476s
sys 0m0.268s
$ time ./target/release/maze -a sidewinder -x 1000 -y 1000 > maze.txt
real 0m1.953s
user 0m1.539s
sys 0m0.299s
$ ./target/debug/maze -x 20 -y 20
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| | | | | | | | | |
+ +---+ + + + +---+ + + + + + +---+---+---+---+ +---+ +
| | | | | | | | | |
+---+---+ +---+ +---+ +---+---+---+ + +---+ + +---+ +---+---+ +
| | | | | | | | | | | |
+ + + + + + +---+ +---+---+ +---+ + + +---+ + +---+ +
| | | | | | | | | | | | | | | |
+ + +---+ +---+ + +---+ + +---+---+---+ + + +---+---+ +---+
| | | | | | | | |
+---+---+---+---+ +---+ + +---+ + + +---+ + + +---+ + + +
| | | | | | | | |
+ + +---+ + +---+---+---+---+---+---+---+ + +---+ + +---+ +---+
| | | | | | | | | | | | |
+ + +---+---+ + +---+---+ + + + + +---+---+ +---+---+---+---+
| | | | | | | | | | | |
+---+---+ +---+---+---+ +---+ +---+---+ + + +---+ + + + + +
| | | | | | | | | | | |
+ +---+ + + + +---+ +---+---+---+---+ + + +---+ +---+---+ +
| | | | | | | | | | | | |
+ +---+---+---+ + + +---+ +---+---+ +---+---+ +---+---+ +---+ +
| | | | | | | | | | |
+---+ + + + +---+---+ + +---+ +---+ + +---+ + +---+ + +
| | | | | | | | | | | | |
+---+ + +---+---+ +---+ + +---+ + +---+---+---+ + + +---+---+
| | | | | | | | |
+ +---+ + +---+---+ +---+ +---+---+ + + +---+ + +---+ + +
| | | | | | | | | | | | | | | |
+---+---+ +---+ + + + + + + +---+ +---+ + + + +---+---+
| | | | | | | | | | |
+---+ +---+ +---+---+---+ +---+---+ + + + + +---+---+ +---+ +
| | | | | | | | | | |
+ + +---+---+ +---+ +---+---+---+ + +---+---+---+ + +---+---+ +
| | | | | | | | | | | | |
+ +---+ + + + +---+---+ +---+ + + +---+---+ + + +---+ +
| | | | | | | | | | | | |
+ +---+---+ +---+---+ + + +---+---+---+ + + + + + + + +
| | | | | | | | | | |
+ +---+ +---+---+ +---+---+---+---+ + +---+---+ +---+---+ + + +
| | | | | | | |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+