Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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