termion/examples/commie.rs

52 lines
1.7 KiB
Rust
Raw Normal View History

2016-11-02 17:46:54 +00:00
extern crate termion;
use termion::{clear, color, cursor};
use std::{time, thread};
const COMMUNISM: &'static str = r#"
!######### #
!########! ##!
!########! ###
!########## ####
######### ##### ######
!###! !####! ######
! ##### ######!
!####! #######
##### #######
!####! #######!
####!########
## ##########
,######! !#############
,#### ########################!####!
,####' ##################!' #####
,####' ####### !####!
####' #####
~## ##~
"#;
fn main() {
let mut state = 0;
2017-03-24 20:53:05 +00:00
println!("\n{}{}{}{}{}{}",
cursor::Hide,
clear::All,
cursor::Goto(1, 1),
color::Fg(color::Black),
color::Bg(color::Red),
COMMUNISM);
2016-11-02 17:46:54 +00:00
loop {
2017-03-24 20:53:05 +00:00
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)));
2016-11-02 17:46:54 +00:00
state += 1;
state %= 8;
thread::sleep(time::Duration::from_millis(90));
}
}