Skip to content

Instantly share code, notes, and snippets.

@panicbit
Last active January 11, 2017 14:18
Show Gist options
  • Save panicbit/7d83e87f678d3ff68fec05ab8fbaadb9 to your computer and use it in GitHub Desktop.
Save panicbit/7d83e87f678d3ff68fec05ab8fbaadb9 to your computer and use it in GitHub Desktop.
Invert UTF8 QR-Codes
#![feature(io)]
use std::io::{stdin,Read};
fn translate(ch: char) -> char {
match ch {
' ' => '█',
'█' => ' ',
'▀' => '▄',
'▄' => '▀',
_ => ch,
}
}
fn main() {
for ch in stdin().chars() {
print!("{}", translate(ch.unwrap()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment