From 9aaa5a6f49eb925ca5182cdf051381a00adfacf7 Mon Sep 17 00:00:00 2001 From: AUnicornWithNoLife Date: Sat, 10 Jul 2021 15:26:23 +0100 Subject: [PATCH] some comments - need more --- src/predict.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/predict.js b/src/predict.js index 5819d5b..f8aa754 100644 --- a/src/predict.js +++ b/src/predict.js @@ -1,6 +1,14 @@ +// invert a playing charcter + +function invertPlayer(inp) { return (inp == 1) ? 2 : 1 } + +// given side to like, it will give a recomneded move + function calculate(like) { - const dislike = (like == 1) ? 2 : 1; + // invert like to work out who to dislike + + const dislike = invertPlayer(like); //LIKE