diff --git a/README.md b/README.md new file mode 100644 index 0000000..69bbf60 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ + +# Rust 3x+1 + +Simple tool to bruteforce 3x+1 for a second loop. Only takes positive numbers. + + +## Usage + +```bash +USAGE: + rust-3xp1.exe [OPTIONS] + +OPTIONS: + -c, --count Number of times to try [default: 50000] + -d, --double-verbose Weather to output current number every step of 3x+1 + -h, --help Print help information + -s, --start Number to start at [default: 195147905179352825856] + -v, --verbose Weather to output current number each time + -V, --version Print version information +``` + + +## Demo + +![](https://files.buymymojo.net/ussgwsivh9co.gif) +## FAQ + +#### What is 3x+1? + +check out [this](https://youtu.be/094y1Z2wpJg) viceo by Veritasium + +#### Why? + +This hasn't left my brain since I saw the video, I wanted to mess around with a tool to brute force for a new loop. + diff --git a/src/main.rs b/src/main.rs index 508c68a..ceaa00a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use tracing::{Level, instrument, event}; use tracing_subscriber; use clap::Parser; -/// Simple program to greet a person +/// Simple tool to bruteforce 3x+1 for a second loop. Only takes positive numbers #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] struct Args { @@ -36,7 +36,7 @@ fn main() { event!(Level::INFO, "Starting number: {}", args.start); event!(Level::INFO, "Amount of numbers to try: {}", args.count); - if args.verbose{ + if args.verbose & !args.double_verbose{ for current_num in args.start..max_num{ event!(Level::INFO, "Processing {}", current_num); let (smallest_num, largest_num) = txpo(current_num);