-
+
+
diff --git a/static/js/semantle.js b/static/js/semantle.js
index 035256d..bcebd21 100644
--- a/static/js/semantle.js
+++ b/static/js/semantle.js
@@ -61,6 +61,8 @@ let Semantle = (function() {
let guessed = new Set();
let firstGuess = true;
let guesses = [];
+ let guessesByID = [];
+ let progress_view = false;
let guessCount = 0;
let gameOver = false;
const handleStats = false;
@@ -186,14 +188,20 @@ let Semantle = (function() {
$("#settings-close")[0].focus();
}
- function updateGuesses(guess) {
- let inner = `
-
#
-
ניחוש
-
קרבה
-
מתחמם?
`;
- /* This is dumb: first we find the most-recent word, and put
- it at the top. Then we do the rest. */
+ function toggleProgressView(event) {
+ var element = event.target;
+ if (element.className.includes("progress-button")){
+ progress_view = !progress_view
+ updateGuesses()
+ }
+ }
+
+ function showGuesses(){
+ let inner = ''
+ if (guessesByID.length == 0){
+ return inner;
+ }
+ let guess = guessesByID[guessesByID.length - 1][1]
for (let entry of guesses) {
let [similarity, oldGuess, guessNumber, percentile, egg] = entry;
if (oldGuess == guess) {
@@ -207,6 +215,41 @@ let Semantle = (function() {
inner += guessRow(similarity, oldGuess, percentile, guessNumber, guess, egg);
}
}
+ return inner
+ }
+
+ function showProgress(){
+ let highest_simlirity = Number.MIN_SAFE_INTEGER
+ let gusses = [];
+ for (let entry of guessesByID) {
+ let [similarity, oldGuess, guessNumber, percentile, egg] = entry;
+ if (similarity < highest_simlirity) {
+ continue
+ }
+ highest_simlirity = similarity
+ gusses.push(guessRow(similarity, oldGuess, percentile, guessNumber, guess, egg));
+ }
+ return gusses.reverse().join("")
+ }
+
+ function updateGuesses() {
+ let header = `