-
Rust연습❤️“rust spinning rod animation in text” Code Answer코딩Coding/Rust연습 2022. 8. 13. 23:43728x90
fn main() { let characters = ['|', '/', '-', '\\']; let mut current = 0; println!("{}[2J", 27 as char); // Clear screen. loop { println!("{}[;H{}", 27 as char, characters[current]); // Move cursor to 1,1 and output the next character. current += 1; // Advance current character. if current == 4 { current = 0; } // If we reached the end of the array, start from the beginning. std::thread::sleep(std::time::Duration::from_millis(250)); // Sleep 250 ms. } }
/ 이게 회전함. ㅎㅎㅎ 신기하다. ㅋㅋ
https://www.codegrepper.com/code-examples/rust/rust+spinning+rod+animation+in+text
반응형'코딩Coding > Rust연습' 카테고리의 다른 글
Rust연습_H가 같은줄에 출력에서 앞으로 계속 쌓임. (0) 2022.08.14 Rust연습❤️물어보고 출력 무한 loop (0) 2022.08.14 Rust Machine learning code 불완전함 (0) 2022.08.13 러스트연습❤️ 뭔가 제자리에서 출력되는거 (0) 2022.08.13 Rust연습❤️Processing 0~100%올라가는 프린트 ㅎㅎ (0) 2022.08.13 Rust연습❤️HashMap, Arc, Mutex, thread연습 (0) 2022.08.13 Rust연습❤️] Hello from asm__assembly코드 연습 (0) 2022.07.03 Rust연습❤️] Displaying raw pointers (0) 2022.07.03