From 680bcbdda852e9009531f17d2b702bc07abeb2c8 Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Sun, 24 Jun 2018 19:22:11 +0300 Subject: [PATCH] Add moves count --- source/Predictor.js | 4 ++++ source/index.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/Predictor.js b/source/Predictor.js index 87a9d6f..a689371 100644 --- a/source/Predictor.js +++ b/source/Predictor.js @@ -38,4 +38,8 @@ export default class Predictor { this.journal.makeMove(value, prediction); return prediction; } + + stepCount() { + return this.journal.length; + } } diff --git a/source/index.js b/source/index.js index 8a88ba9..0f69324 100644 --- a/source/index.js +++ b/source/index.js @@ -24,7 +24,8 @@ new Vue({ }, pass(value) { const prediction = this.predictor.pass(value); - console.log('PREDICTED', prediction, 'PASS', value); + const step = this.predictor.stepCount(); + console.log('STEP', step, 'PREDICTED', prediction, 'PASS', value); }, }, });