Simple tool to brute force 3x+1 for a new loop.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix -h and add a README

+37 -2
+35
README.md
··· 1 + 2 + # Rust 3x+1 3 + 4 + Simple tool to bruteforce 3x+1 for a second loop. Only takes positive numbers. 5 + 6 + 7 + ## Usage 8 + 9 + ```bash 10 + USAGE: 11 + rust-3xp1.exe [OPTIONS] 12 + 13 + OPTIONS: 14 + -c, --count <COUNT> Number of times to try [default: 50000] 15 + -d, --double-verbose Weather to output current number every step of 3x+1 16 + -h, --help Print help information 17 + -s, --start <START> Number to start at [default: 195147905179352825856] 18 + -v, --verbose Weather to output current number each time 19 + -V, --version Print version information 20 + ``` 21 + 22 + 23 + ## Demo 24 + 25 + ![](https://files.buymymojo.net/ussgwsivh9co.gif) 26 + ## FAQ 27 + 28 + #### What is 3x+1? 29 + 30 + check out [this](https://youtu.be/094y1Z2wpJg) viceo by Veritasium 31 + 32 + #### Why? 33 + 34 + 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. 35 +
+2 -2
src/main.rs
··· 4 4 use tracing_subscriber; 5 5 use clap::Parser; 6 6 7 - /// Simple program to greet a person 7 + /// Simple tool to bruteforce 3x+1 for a second loop. Only takes positive numbers 8 8 #[derive(Parser, Debug)] 9 9 #[clap(author, version, about, long_about = None)] 10 10 struct Args { ··· 36 36 event!(Level::INFO, "Starting number: {}", args.start); 37 37 event!(Level::INFO, "Amount of numbers to try: {}", args.count); 38 38 39 - if args.verbose{ 39 + if args.verbose & !args.double_verbose{ 40 40 for current_num in args.start..max_num{ 41 41 event!(Level::INFO, "Processing {}", current_num); 42 42 let (smallest_num, largest_num) = txpo(current_num);