Skip to main content

Posts

Showing posts from April, 2022

How to build wordle?

  Following the latest trend in the game, I decided to create my own wordle game. The primary difference between my game and the original is that you have 100 chances to guess the word instead of only 6. Furthermore, you are not limited to a single word every day; you are free to play as much as you wish. Here's how I like to organize my directories and files: Let's begin with a simple class that will house our main logic. The class will be called "wordle," and it will include the following features. - Choose a word at random. Validate the user's input and provide a proper response (green, yellow & grey colours will be used to indicate whether the words are in the right positions represented by 2, 1, 0 respectively). Check the game's progress. The code above is in charge of picking a random word. It's worth noting that the source file and our wordle logic have been separated. This is to reduce code coupling and will be handy if we need to give an al...