We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c44c4d2 commit 81b803aCopy full SHA for 81b803a
ui/src/game.rs
@@ -652,6 +652,26 @@ impl Game {
652
pub fn is_game_over(&self) -> bool {
653
self.retired
654
}
655
+
656
+ /// Return a monochrome text screenshot.
657
+ pub fn screenshot(&self) -> String {
658
+ let mut ret = String::new();
659
+ for y in 0..self.s.height() {
660
+ for x in 0..self.s.width() {
661
+ let mut c = char::from_u32(
662
+ self.s.data()[(x + y * self.s.width()) as usize].c as u32,
663
+ )
664
+ .unwrap_or(' ');
665
+ if c == '\0' {
666
+ c = ' ';
667
+ }
668
+ ret.push(c);
669
670
+ ret.push('\n');
671
672
673
+ ret
674
675
676
677
fn draw_anims(
0 commit comments