Skip to content

Instantly share code, notes, and snippets.

@clavin
Created February 7, 2020 20:36
Show Gist options
  • Save clavin/215ca896e46893aae909a3393af55294 to your computer and use it in GitHub Desktop.
Save clavin/215ca896e46893aae909a3393af55294 to your computer and use it in GitHub Desktop.
use std::io::{stdin, BufRead, BufReader};
const CROW: &str = r#"
▒▒▒▒▒▒▓▓▓▓▒▒
▓▓▒▒▓▓▒▒
▓▓▓▓▓▓▓▓▒▒
▓▓████▓▓████▓▓▒▒
▓▓▓▓▓▓▓▓▓▓██▓▓████
▓▓▓▓▓▓▒▒▓▓▓▓▓▓▓▓████
▓▓▓▓▓▓▒▒▓▓▒▒▒▒████▓▓▓▓
██▓▓▓▓▒▒▓▓▒▒▓▓▓▓▓▓▓▓██▓▓
██▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▓▓
▓▓▒▒▓▓▓▓▓▓██▓▓██▓▓▓▓▓▓▓▓▓▓▓▓██
▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▓▓▓▓▓▓██████▓▓
▓▓▓▓▓▓██▓▓▓▓▓▓██████▓▓██▓▓██████
▓▓██▒▒▓▓████████ ██████▓▓████
▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓██
██▒▒ ██ ██▒▒
▓▓ ▓▓
▓▓ ▓▓
▒▒ ▓▓
██▓▓▒▒██ ▓▓▒▒
▒▒
"#;
fn main() -> Result<(), std::io::Error> {
let mut crow_lines = CROW.lines().skip(1);
let mut last_crow_line = "";
for line in BufReader::new(stdin()).lines() {
let crow_line = match crow_lines.next() {
Some(crow_line) => {
last_crow_line = crow_line;
crow_line
}
None => last_crow_line,
};
println!("{} {}", crow_line, line?);
}
for crow_line in crow_lines {
println!("{}", crow_line);
}
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment