game-of-death

antagonistic game of life  https://xi.github.io/game-of-death/
git clone https://git.ce9e.org/game-of-death.git

commit
155153aa15399321f5d788dd7d89fbbf57ad173b
parent
56d86693909f49ecd334a8bcf90fc6ebd56f6052
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-10-26 16:10
use template literals instead of string concatination

Diffstat

M src/template.js 6 +++---

1 files changed, 3 insertions, 3 deletions


diff --git a/src/template.js b/src/template.js

@@ -11,7 +11,7 @@ const renderBoard = function(state) {
   11    11             {'class': 'board-row'},
   12    12             row.map(player => h(
   13    13                 'div',
   14    -1                 {'class': 'board-cell bg-' + player}
   -1    14                 {'class': `board-cell bg-${player}`}
   15    15             ))
   16    16         ))
   17    17     );
@@ -30,7 +30,7 @@ const renderControls = function(state) {
   30    30             ' ',
   31    31             h('button', {'class': 'js-play'}, state.game.playing ? 'Pause' : 'Play'),
   32    32             ' ',
   33    -1             h('button', {'class': 'js-current-player fg-' + state.game.currentPlayer}, 'Current Player'),
   -1    33             h('button', {'class': `js-current-player fg-${state.game.currentPlayer}`}, 'Current Player'),
   34    34             ' ',
   35    35             h('button', {'class': 'js-export'}, 'Export'),
   36    36             ' ',
@@ -59,7 +59,7 @@ const renderMenu = function(state) {
   59    59     ].concat(scenarios.map((scenario, i) => h(
   60    60         'button',
   61    61         {'class': 'js-menu-scenario', 'data-scenario': i},
   62    -1         'Start scenario: ' + scenario.title,
   -1    62         `Start scenario: ${scenario.title}`,
   63    63     ))));
   64    64 };
   65    65