From ba5eb0a0966cfaa74fb84dfd91e443b5da78fa8d Mon Sep 17 00:00:00 2001 From: Arthaud Date: Sun, 17 Sep 2023 02:17:41 +0200 Subject: [PATCH] style: better display in shell --- game.js | 2 +- game.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/game.js b/game.js index 18305ed..8dda68f 100644 --- a/game.js +++ b/game.js @@ -9,7 +9,7 @@ const FRAME_INTERVAL = 1500; function matrixToString(matrix) { return matrix.map(row => - row.map(ceil => ceil === ALIVE ? "■" : "□").join(' ') + row.map(ceil => ceil === ALIVE ? "■" : " ").join(' ') ).join("\n") } diff --git a/game.test.js b/game.test.js index 27c8588..d5ce5fc 100644 --- a/game.test.js +++ b/game.test.js @@ -9,7 +9,7 @@ describe('matToString', () => { [DEAD, DEAD, ALIVE], ] - expect(matrixToString(matrix)).toBe("□ ■ □\n□ □ □\n□ □ ■"); + expect(matrixToString(matrix)).toBe(" ■ \n \n ■"); }) });