Skip to content

Instantly share code, notes, and snippets.

@iwillspeak
Created February 25, 2017 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iwillspeak/a3146ae87b6a5d26d6d06d8c73614e0d to your computer and use it in GitHub Desktop.
Save iwillspeak/a3146ae87b6a5d26d6d06d8c73614e0d to your computer and use it in GitHub Desktop.
Yop Yop Yop
[package]
name = "yop"
version = "0.1.0"
authors = ["Will Speak <lithiumflame@gmail.com>"]
[dependencies]
[[bin]]
name = "yop"
path = "yop.rs"
use std::{thread, time, io};
use std::io::prelude::*;
const CHOICES: [char;4] = [
'⠸',
'⠪',
'⠇',
'⠕',
];
fn main() {
let delay = time::Duration::from_millis(500);
let mut choice = 0;
while true {
print!(" {}\r", CHOICES[choice]);
io::stdout().flush().unwrap();
thread::sleep(delay);
choice = (choice + 1) % 4;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment