|
|
@ -90,17 +90,18 @@ impl Encodestate { |
|
|
for i in 0 .. 8 { |
|
|
for i in 0 .. 8 { |
|
|
if self.current.get_segment(i) != self.next.get_segment(i) { |
|
|
if self.current.get_segment(i) != self.next.get_segment(i) { |
|
|
let mut text = String::new(); |
|
|
let mut text = String::new(); |
|
|
text.push_str("setsegment "); |
|
|
text.push_str("set "); |
|
|
text.push(std::char::from_u32(('0' as u32) + i as u32).unwrap()); |
|
|
text.push(std::char::from_u32(('0' as u32) + i as u32).unwrap()); |
|
|
text.push(' '); |
|
|
text.push(' '); |
|
|
text.push_str(match self.next.get_segment(i) { |
|
|
text.push_str(match self.next.get_segment(i) { |
|
|
true => "on", |
|
|
true => "0", |
|
|
false => "off", |
|
|
false => "1", |
|
|
}); |
|
|
}); |
|
|
self.current.set_segment(i, self.next.get_segment(i)); |
|
|
self.current.set_segment(i, self.next.get_segment(i)); |
|
|
instructions.push(text); |
|
|
instructions.push(text); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
instructions.push(String::from("show")); |
|
|
instructions |
|
|
instructions |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|