GithubHelp home page GithubHelp logo

ivancaez / wordle Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 908 KB

Terminal game done in Kotlin

License: GNU Affero General Public License v3.0

Kotlin 15.27% HTML 52.51% JavaScript 13.26% CSS 18.96%
game kotlin terminal-game wordle wordle-kotlin

wordle's Introduction

Wordle

Description

This project consist of the famous game called Wordle where a random word is generated and the user has X tries to guess the word.

Based on the character position of the entered word it will display a colored background on that character. Displaying:

  • A gray background if the character doesn't exist in the word.
  • A yellow background if the character exists in the word but isn't in the right position.
  • A green background if the character exists and is in the right position.

It had been developed in IntelliJ IDEA with the Kotlin language.


Author

Ivan Martinez Cañero


Installing

Use git to clone this repository into your computer.

git clone https://gitlab.com/ivan.martinez.7e6/wordle


Running the project

Open the project with IntelliJ IDEA and run the file.

Formatting the Output

In this project we will make use of variables to color the foreground and background of each character when needed.

Usage

  • Write the name or names of the constants you want to use before the next word or character
  • Use the variable reset after the desired word or character to end the formatting

How To Play

  • The user has 6 tries to guess the right word
  • Each word has 5 characters
  • If the background of the character of the guessed word changes to gray it means it doesn't exist in the word.
  • If changes to yellow it means it exists in the word but is not in the correct position.
  • If changes to green it means it is in the correct position.

The Menu

The menu will be the first thing the user sees.

  • Will greet the user and will offer them a list of options they can choose:
    • PLAY Will start the game
    • HELP Will explain the rules
    • HISTORY Will call the menu for filtering the history of games than were saved
    • RANKING Will print the ranking of the users who saved their games
    • EXIT Will end the program

alt text

The Game

  • The user can choose to play in Catalan or in English.
  • First will ask the user to type their username.
  • Then will take a random word from the wordPool of the choosen language and will ask the user for a word.
  • If the word doesn't have a length of 5 chars or has chars that aren't alphabetical, it will throw a warning and will ask for a word again.
When the word is accepted and isn't the right guess
  • It will scan every char at the userGuess word and compare the position with the same position of the char of the random word.
  • At the same time will be colored based on the position and added to a variable called history
  • Then it will be added to a list called historyList and with each iteration will print the content of the list creating the history of the game
  • The program will also print the number of the current round.
  • Last it will rest 1 try and will communicate to the user how many tries has.

alt text

When the word is the right word

Will print a congratulation message and will show the tries used.

alt text alt text

When the user spends all their tries

Will end the program and the game with a lose.

alt text alt text

After the game

If the tries reach 0 or the user guesses the word it will ask if the user wants to save the game to the database.

alt text

Then will ask to continue playing, return to the menu or stop playing.

alt text

The History

When the user types HISTORY in the main menu, it will show options to filter the database.

And will filter by the instruction

alt text

The Ranking

When the user types RANKING in the main menu, it will show the ranking.

Will only show the users who won their games.

alt text


License

This project is licensed under the GNU Affero General Public License v3.0

See the LICENSE.md file for details

wordle's People

Contributors

ivancaez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.