aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--life.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/life.cc b/life.cc
index 58d1c49..5e9b52c 100644
--- a/life.cc
+++ b/life.cc
@@ -28,10 +28,12 @@ void draw(
for ( std::size_t i = 0; i < HEIGHT; i++ ) {
for ( std::size_t j = 0; j < WIDTH; j++ ) {
+ const char density{std::to_string(world.lifeDensityAt(j,i))[0]};
+
if ( world.isLifeAt(j,i) ) {
- tb_change_cell(x+j, y+i, 0x2588, TB_BLACK, TB_GREEN);
+ tb_change_cell(x+j, y+i, density, TB_BLACK, TB_GREEN);
} else {
- tb_change_cell(x+j, y+i, 0x2591, TB_BLACK, TB_BLUE);
+ tb_change_cell(x+j, y+i, density, TB_BLACK, TB_BLUE);
}
}
}