This is a Python solver for the game Wordle, which recently received its PT-BR version

Overview

PT_BR_Wordle_Solver

Este é um solver feito em Python do jogo Wordle, que recebeu sua versão PT-BR recentemente.

Onde jogar

Os sites para se jogar mais famosos até agora são:

Arquivos

  • Um arquivo .csv, que contém uma lista de aproximadamente 6 mil palavras da lingua portuguesa que contém cinco letras. As palavras não contém acento, nem letras maiúsculas, e apenas 5 caracteres por célula.
  • Um arqivo .py, que é o próprio solver.

Funcionamento

Parte 1:

A partir da primeira tentativa do usuário, teremos no resultado o que chamei de "acertos": acerto verdes, amarelos e vermelhos. De início, o usuário terá que indicar o número de cada acerto. Veja que a somatória do número de acertos é sempre 5. Em seguida, será requisitado quais letras correspondem a cada acerto, e as posições dos acertos verdes e amarelos, variando de 0 à 4. Isto é, a primeira posição equivale a 0, a segunda a 1, e assim por diante.

Com essas informações em mãos, já é possível filtrar a base de dados, a partir dos seguintes filtros encadeados

  • Filtro verde:

    • Procura todas as palavras na base de dados que tem a letra informada no local informado
  • Filtro amarelo:

    • Do conjunto de palavras resultante do filtro verde, procura todas as palavras que contém a letra informada, e que não estão no local informado.
  • Filtro vermelho:

    • Do conjunto de palavras resultante do filtro amarelo, procura todas as palavras que não contém a letra informdada.

Finalmente, obtendo uma lista de todas as palavras da base de dados que atendem às restrições anteriores.

Parte 2:

Como o objetivo do jogo é acertar todas as letras da palavra, e não necessariamente acertar a palavra toda diretamente, podemos usar a frequência das letras nas palavras da lingua portuguesa a nosso favor.

Veja que podemos atribuir à cada letra uma "frequência", explicitada no site https://pt.wikipedia.org/wiki/Frequ%C3%AAncia_de_letras.

Como pode ser visto, a letra "a" tem a maior frequência de aparição na língua portuguesa, por volta de 14%. Isto nos dis que, ao pegar uma palavra aleatória da língua portuguesa, há aproximadamente 14% de chance de ser uma palavra com a letra "a".

Assim, naturalmente, palavras que contém letras que são mais frequentes na língua portuguesa tem mais chances de acertar alguma letra da palavra secreta do jogo.

Finalmente, é atribuído para cada letra do alfabeto um escalar correspondente a sua frequência, e para cada palavra no conjunto resultante dos filtros, soma-se esses valores de cada letra de uma palavra, e atribúi-se o valor da soma à palavra.

Desta forma, palaras com um valor maior tem mais chance de conter alguma letra que está na palavra secreta do jogo.

Por fim, todas as palavras do conjunto são mostradas, assim como o valor da soma associada, e começa-se a próxima iteração.

Observações:

  • Coloque o arquivo .csv e o Script na mesma pasta em seu computador para que o solver funcione.
  • A base de dados ainda é pequena. Não funciona em 100% dos casos, mas é bem satisfatória.
  • A rotina está bem infantil. Utilizei a oportunidade para REVISAR Python, então há muito espaço para aprimoramento, mesmo com poucas linhas de código.
Owner
Vinicius Jameli
I'm a 21 years old researcher, finishing my major in applied mathematics at IMECC.
Vinicius Jameli
Turtle Road Crossing Game in Turtle(python module)

Turtle Road Crossing Game in Turtle(python module) In this project we have built a road crossin game in python with Object-Oriebted Programming. This

Jhenil Parihar 3 Jun 15, 2022
A script to install a Windows game through GOG on Linux

proton-gog-install A script to install a Windows game through GOG on Linux. Based on this gist. Tested on Arch, might work elsewhere. Requirements: Im

5 Dec 28, 2022
I got bored and wrote a wordle solver... Its pretty good though, just saying

Wordle Solver I got bored and wrote a wordle solver... Its pretty good though, just saying. Please go support Josh and have fun with Wordle on the off

Darrell Best 2 Jan 25, 2022
You want to uto-update your private minecraft client? Give this to developer and enjoy!

minecraft-hack-installer You want to uto-update your private minecraft client? Give this to developer and enjoy! Steps to do: Install libraries: pip i

EuropeStudio 1 Jun 03, 2022
Pygame for humans (pip install hooman) (25k+ downloads)

hooman ~ pygame for humans pip install hooman join discord: https://discord.gg/Q23ATve The package for clearer, shorter and cleaner PyGame codebases!

Abdur-Rahmaan Janhangeer 31 Nov 08, 2022
A Gomoku game GUI using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning

Gomoku A GUI based Gomoku game using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning. R

Mingyu Liu 1 Oct 30, 2021
This is game 2048 created with moudle of python tkinter and OOP.

Game 2048 This is game 2048 created with moudle of python tkinter and OOP. This game build on classes. For start this game run: If you have python ver

0 Nov 02, 2021
A python-based multi-player online educational game for students to play in a class or club setting.

Kurono (codename: aimmo) Code for Life has been developed by Ocado Technology as a free, open-source project to inspire the next generation of compute

Ocado Technology 108 Nov 07, 2022
Python Knots and Crosses game, with customizable markers and more!

Knot-and-Crosses Python Knots and Crosses game, with customizable markers and more! Features: Ability to change your marker Ability to change how many

4 Nov 07, 2021
Wordle-helper: python script to help solving wordle game

wordle-helper This is a python script to help solving wordle game 5-letter-word-

MD Nur Ahmed 2 Feb 08, 2022
A Tetris game made using PyGame as renderer only, for a school project.

Tetris_Python A Tetris game made using PyGame as renderer only, for a school project. Twist in the Game Blocks can pentrate through right and left bou

Ravi Arora 2 Jan 31, 2022
Implementation of Conway's game of life in python.

👾 👨🏻‍💻 Conway's Game of Life 👨🏻‍💻 👾 by FranciscoCharles An interactive simulator that implements the standard Conway Game of Life with a simpl

3 Oct 01, 2021
Racers-API - a game where you have to go around racing with your car, earning money

Racers-API About Racers API is a game where you have to go around racing with yo

3 Jan 09, 2022
A python game engine.

PursuedPyBear, also known as ppb, exists to be an educational resource. Most obviously used to teach computer science, it can be a useful tool for any topic that a simulation can be helpful.

PPB 235 Jan 08, 2023
Open source Brawl Stars server emulator for version 29 of the game!

Welcome to Classic-Brawl v29 Remake 👋 Open source Brawl Stars server emulator for version 29 of the game! (Remake) What's working ? Battles Trophies

CrossFire 4 Jan 19, 2022
An interactive pygame implementation of quadtree spatial quantization

QuadTree-py An interactive pygame implementation of quadtree spatial quantization Contents Installation Usage API Reference TODO Installation Clone th

Ethan 1 Dec 05, 2021
This is a Python solver for the game Wordle, which recently received its PT-BR version

PT_BR_Wordle_Solver Este é um solver feito em Python do jogo Wordle, que recebeu sua versão PT-BR recentemente. Onde jogar Os sites para se jogar mais

Vinicius Jameli 1 Jan 24, 2022
A small, Pygame-based library project intended for personal use.

EzyGame Version 0.0.1 A simple library project intended for personal use with Pygame. Warning: I am a very amateur programmer, so the code will probab

Dorbell 1 Jan 08, 2022
Play a game of Phazed with a bot or with other players or watch bots play with each other

Phazed Game and Player play a game of Phazed with a bot or with other players or watch bots play with each other Live Demo hosted on repl.it (makes su

Xin Yu 0 Aug 28, 2021
Playing memory game is fun and the more harder it is the more challenging it is.

Playing memory game is fun and the more harder it is the more challenging it is. Playing thi sgame make us stress free and also happy. So, I have decided to make a memory Game which people can play w

Shreejan Dolai 3 Nov 11, 2022