Skip to content

nsobotka/Waffler

Repository files navigation

WAFFLE(R)

First and foremost, all ownership of the original game and design belongs to @JamesJessian.

Please check out the official Waffle and twitter at @thatwafflegame.

Created by Nathan Sobotka and Aviel Resnick.

Running

  • Clone the repository
  • Create a virtual environment
  • Install requirements from requirements.txt
  • Run the command flask run
  • Enjoy!

About This Project

We are a team of two developers who, after enjoying the Waffle, questioned whether every board was truly solvable in 10 moves (as the game claims).

We decided to implement the game and expand upon its features. This included adding in computer generated boards, optimal solutions, and move tracking, as some of the most important additions.

Notably, you can also import and optimally solve / play the daily Waffle. In finding optimal paths, we had to algorithmically solve the board - one of the key challenges of the project.

Implementation

We begin each Waffle by selecting 6 words and assembling the solved puzzle. Then, we scamble our puzzle according to trends from the official game; i.e. greens in all corners and the center. Furthermore, we ensure that each puzzle is minimally solvable in exactly 10 moves. After the puzzle is scrambled, we compare to the solved puzzle to determine the color of each square.

In addition to generating our own puzzles, we wanted to create a solver for any Waffle (including the daily Waffle). To do so, we created an algorithm which incorporates many heuristics, each of which narrows down the potential solutions based purely on the initial coloring of the board. We make use of all available data in the starting board to find a unique solution (if one exists, more on this later).

By combining our solver and web scraping, we are able to import a fully playable copy of the daily Waffle.

Finally, we designed an algorithm to solve each board in the minimum number of moves. This algorithm works by prioritizing moves that "correct" two squares in one swap, followed by three squares in two swaps, and so forth. This algorithm is used to ensure that our randomly generated boards are minimally solvable in exactly 10 moves, and to output solutions when the user requests them. We can show optimal paths not only from the start, but from any point in the game (or output that the game is no longer solvable).

Unsolvable Boards

There are two cases in which we are unable to solve the daily Waffle. The first is if the Waffle contains a word that is not in our word list. The second is if there are multiple correct solutions to the board. In both cases we display as much of the correct board as we can solve. Unfortunately, the other functionality of our website is not available when this happens.

About Us

Feel free to check out our websites: Nathan Sobotka and Aviel Resnick.

File structure

  • 5LetterWords.txt : word bank
  • boardGeneration.py : creates new boards
  • waffleLogic.py : solves boards
  • shortestPath.py : finds optimal moves
  • scrape.py : web scraping
  • viz.py : visualizers for debugging
  • testBoards.py : past official Waffles

About

Finds the optimal solution to the waffle game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •