Implemented fmt::Binary.
This commit is contained in:
parent
c730e0d1bd
commit
31143cac1d
|
@ -68,6 +68,18 @@ impl fmt::Display for BasicRegister {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Binary for BasicRegister {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "Memory: ")?;
|
||||
|
||||
for v in self.memory.iter() {
|
||||
write!(f, "{}", *v as u8)?;
|
||||
}
|
||||
|
||||
write!(f, "")
|
||||
}
|
||||
}
|
||||
|
||||
fn read_vec(variable_name: &str) -> Vec<char> {
|
||||
loop {
|
||||
print!("Enter {variable_name}: ");
|
||||
|
|
Loading…
Reference in New Issue