File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -191,19 +191,18 @@ function render() {
191
191
}
192
192
193
193
const circles = arr
194
- const score = {
195
- // todo this is slow, use something better when we use some more efficient board representation
196
- white : circles . reduce ( ( count : number , circle : Circle ) => circle . color === 'white' ? count + 1 : count , 0 ) ,
197
- black : circles . reduce ( ( count : number , circle : Circle ) => circle . color === 'black' ? count + 1 : count , 0 )
198
- }
194
+
195
+ // todo this is slow, use something better when we use some more efficient board representation
196
+ const score_white = circles . reduce ( ( count : number , circle : Circle ) => circle . color === 'white' ? count + 1 : count , 0 )
197
+ const score_black = circles . reduce ( ( count : number , circle : Circle ) => circle . color === 'black' ? count + 1 : count , 0 )
199
198
200
199
const circlesHtml = circles . map ( circle => {
201
200
return `<circle r="${ circle . r } " cx="${ circle . cx } " cy="${ circle . cy } " style="fill: ${ circle . color } "></circle>`
202
201
} ) . join ( '' )
203
202
204
203
document . getElementById ( 'circles' ) ! . innerHTML = circlesHtml
205
- document . getElementById ( 'score-black' ) ! . innerText = '' + score . black
206
- document . getElementById ( 'score-white' ) ! . innerText = '' + score . white
204
+ document . getElementById ( 'score-black' ) ! . innerText = '' + score_black
205
+ document . getElementById ( 'score-white' ) ! . innerText = '' + score_white
207
206
208
207
const evalsHtml = evals_ . map ( eval_ => {
209
208
return `<text x="${ eval_ . x } " y="${ eval_ . y } " style="fill: ${ eval_ . color } ; font-size: 50px">${ eval_ . text } </text>`
You can’t perform that action at this time.
0 commit comments