Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to play past puzzles #10

Merged
merged 4 commits into from
Apr 18, 2024
Merged

Conversation

Vankata453
Copy link
Contributor

@Vankata453 Vankata453 commented Apr 11, 2024

Logic and a GUI have been added to allow selecting past puzzles (with past words as answers), based on ID.

Past puzzles popup window with selector

Past puzzles are not counted towards statistics. Their data can be loaded from/saved to localStorage by the JS layer.

Personally, I see the ability to play past puzzles being really beneficial in certain cases:

  • They give players a way to practice more extensively.
  • They allow a player to compete with others on a past puzzle, despite having missed it.
  • They allow a player to solve a past puzzle, if they wish to keep up with the game daily.

In the popup window, holding the arrows with the left mouse button, or holding the respective arrow key on the keyboard allow for moving quickly through IDs.

Additionally:

  • If a daily pool word list is missing, the chosen word is now truly random - srand is provided the current timestamp.
  • Game input is no longer detected, when a popup window is active.
  • Mutual properties and visible(float T) function between popup windows are now inherited from a base struct.
  • The workaround for the issue with the word "пряка", added in 4efdde7, was commented out. Perhaps it can be applied to the hidden daily pool list, avoiding hardcoding? If not, I will uncomment it.

The `State::Puzzle` struct allows storing a puzzle's data separately from the main game state data.

Data for multiple puzzles can now be stored in an array. Data for multiple puzzles can be loaded/saved to `localStorage` by the JS layer.

Additionally, if a daily pool word list is missing, the chosen word is now truly random - `srand` is provided the current timestamp.
Logic and a GUI have been added to allow selecting past puzzles, based on ID.

Past puzzles are not counted towards statistics. Their intended use is to give the player a way to practice, or compete with others, despite having missed the day of the puzzle.

Additionally:

* Game input is no longer detected, when a popup window is active.
* Mutual properties and `visible(float T)` function between popup windows are now inherited from a base struct.
Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work!

I've deployed this at: https://ggerganov.com/wordle-test/

Let's give this a test for a few days and if everything is fine will merge and update the main site. Thanks!

@ggerganov
Copy link
Owner

The workaround for the issue with the word "пряка", added in 4efdde7, was commented out. Perhaps it can be applied to the hidden daily pool list, avoiding hardcoding? If not, I will uncomment it.

I fixed the word in the private list back then, so it should be all good

The word was confirmed to have been fixed in the private daily pool.
@ggerganov ggerganov merged commit b8379bc into ggerganov:master Apr 18, 2024
@Vankata453 Vankata453 deleted the past-puzzles branch April 18, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants