flood

Flood fill puzzle game for linux terminals
git clone https://git.ce9e.org/flood.git

commit
5cfe8b97739f433a1d15c5dd4db9b4913f563877
parent
c9ffdd7054fbbddaefc59d874e71ebb9aaaf56ee
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-04-16 21:31
do not count noop actions as steps

Diffstat

M flood.rs 7 ++++++-

1 files changed, 6 insertions, 1 deletions


diff --git a/flood.rs b/flood.rs

@@ -124,7 +124,8 @@ fn play(seed: u64) -> bool {
  124   124     }
  125   125 
  126   126     println!("\x1b[2J");
  127    -1     for step in 0..=STEPS {
   -1   127     let mut step = 0;
   -1   128     while step <= STEPS {
  128   129         // move cursor to top left and clear screen
  129   130         print!("\x1b[H\x1b[J");
  130   131         render_status(step);
@@ -135,8 +136,12 @@ fn play(seed: u64) -> bool {
  135   136         }
  136   137         if step < STEPS {
  137   138             let new = input_num("> ", 1, 7) - 1;
   -1   139             if new == map[0] {
   -1   140                 continue;
   -1   141             }
  138   142             flood(&mut map, new);
  139   143         }
   -1   144         step += 1;
  140   145     }
  141   146     return false;
  142   147 }