An AI agent built to do Ralph loops - plan mode for planning and ralph mode for implementing.
1const SPINNER_FRAMES: &[char] = &['◐', '◓', '◑', '◒'];
2
3pub struct Spinner {
4 frame: usize,
5}
6
7impl Spinner {
8 pub fn new() -> Self {
9 Self { frame: 0 }
10 }
11
12 pub fn tick(&mut self) {
13 self.frame = (self.frame + 1) % SPINNER_FRAMES.len();
14 }
15
16 pub fn current(&self) -> char {
17 SPINNER_FRAMES[self.frame]
18 }
19}
20
21impl Default for Spinner {
22 fn default() -> Self {
23 Self::new()
24 }
25}