rust version of word

This commit is contained in:
Uğur Küpeli
2022-05-03 10:12:18 +03:00
parent e513b77ac5
commit 056312f359
4 changed files with 195 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
pub struct Progress {
chars: [char; 5],
}
impl Progress {
pub fn new() -> Self {
Progress { chars: ['-'; 5] }
}
pub fn set_char_at(&mut self, c: char, i: usize) {
self.chars[i] = c;
}
pub fn print(&self) {
for c in self.chars {
print!("{}", c);
}
}
}