diff options
Diffstat (limited to 'third_party/rust/termion/examples/commie.rs')
-rw-r--r-- | third_party/rust/termion/examples/commie.rs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/third_party/rust/termion/examples/commie.rs b/third_party/rust/termion/examples/commie.rs new file mode 100644 index 0000000000..32f8820e50 --- /dev/null +++ b/third_party/rust/termion/examples/commie.rs @@ -0,0 +1,51 @@ +extern crate termion; + +use termion::{clear, color, cursor}; + +use std::{time, thread}; + +const COMMUNISM: &'static str = r#" + !######### # + !########! ##! + !########! ### + !########## #### + ######### ##### ###### + !###! !####! ###### + ! ##### ######! + !####! ####### + ##### ####### + !####! #######! + ####!######## + ## ########## + ,######! !############# + ,#### ########################!####! + ,####' ##################!' ##### + ,####' ####### !####! + ####' ##### + ~## ##~ +"#; + +fn main() { + let mut state = 0; + + println!("\n{}{}{}{}{}{}", + cursor::Hide, + clear::All, + cursor::Goto(1, 1), + color::Fg(color::Black), + color::Bg(color::Red), + COMMUNISM); + loop { + println!("{}{} ☭ GAY ☭ SPACE ☭ COMMUNISM ☭ ", + cursor::Goto(1, 1), + color::Bg(color::AnsiValue(state))); + println!("{}{} WILL PREVAIL, COMRADES! ", + cursor::Goto(1, 20), + color::Bg(color::AnsiValue(state))); + + state += 1; + state %= 8; + + thread::sleep(time::Duration::from_millis(90)); + } +} |