From 7af33026a457ffcd869616269184c35bd167a46c Mon Sep 17 00:00:00 2001 From: "Felix W. Dekker" Date: Tue, 25 Aug 2020 14:44:52 +0200 Subject: [PATCH] Display win percentage --- package.json | 2 +- src/main/js/Statistics.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6395cf2..d2a873d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minesweeper", - "version": "0.81.6", + "version": "0.81.7", "description": "Just Minesweeper!", "author": "Felix W. Dekker", "browser": "dist/bundle.js", diff --git a/src/main/js/Statistics.ts b/src/main/js/Statistics.ts index 780792e..17ddb85 100644 --- a/src/main/js/Statistics.ts +++ b/src/main/js/Statistics.ts @@ -198,11 +198,15 @@ export class LocalStatistics implements Statistics { Games completed - ${this.gamesWon} + + ${this.gamesWon} (${Math.round(100 * this.gamesWon / this.gamesStarted)}%) + Games completed without losing - ${this.gamesWonWithoutLosing} + + ${this.gamesWonWithoutLosing} (${Math.round(100 * this.gamesWonWithoutLosing / this.gamesStarted)}%) +