aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--life.cc6
2 files changed, 6 insertions, 2 deletions
diff --git a/README.md b/README.md
index 831d505..a8e3d8a 100644
--- a/README.md
+++ b/README.md
@@ -2,4 +2,4 @@
...is a straight forward toy implementation of Conway's Game of Life. It is written in C++ using `termbox` for drawing in the terminal. _Divine intervention_ i.e. manipulating the world state is supported using the mouse.
-[![asciicast](https://asciinema.org/a/b8ikx32sc5fe427b86y7kjgh7.png)](https://asciinema.org/a/b8ikx32sc5fe427b86y7kjgh7)
+[![asciicast](https://asciinema.org/a/f4nc8r6v1tf2m97s6m81ci37q.png)](https://asciinema.org/a/f4nc8r6v1tf2m97s6m81ci37q)
diff --git a/life.cc b/life.cc
index ad69d56..ee522ec 100644
--- a/life.cc
+++ b/life.cc
@@ -22,7 +22,11 @@ void draw(
if ( world.isLifeAt(i-x, j-y) ) {
tb_change_cell(i, j, 48+density, TB_BLACK, TB_GREEN);
} else {
- tb_change_cell(i, j, 48+density, TB_BLACK, TB_BLUE);
+ if ( density == 0 ) {
+ tb_change_cell(i, j, ' ', TB_BLACK, TB_BLUE);
+ } else {
+ tb_change_cell(i, j, 48+density, TB_BLACK, TB_BLUE);
+ }
}
});