-
-
Save solson/8aa24b4e3dace7a1c931c7cd770c5b11 to your computer and use it in GitHub Desktop.
Rust code shared from the playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const _INPUT: usize = 3; | |
| const INPUT: usize = 369; | |
| fn main() { | |
| let mut after_0 = None; | |
| let mut pos = 0; | |
| let mut buffer_len = 1; | |
| for new_val in 1..50000001 { | |
| pos = (pos + INPUT) % buffer_len; | |
| if pos == 0 { | |
| after_0 = Some(new_val); | |
| } | |
| buffer_len += 1; | |
| pos += 1; | |
| } | |
| println!("{}", after_0.unwrap()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment