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
A zombie game using Kinetic. You can control players using fingers

This is Eden Park's portpolio: Works, projects and practices This repository can be used to show the potential employers to check my works, code and p

Eden Park 4 May 16, 2022
Battle of Saiyans: Goku v Vegeta is a 1 v 1, (Player vs CPU) 2D Martial arts fighting game

Battle of Saiyans: Goku v Vegeta is a 1 v 1, (Player vs CPU) 2D Martial arts fighting game inspired by the popular anime series Dragon Ball Z The game

ARZ 3 Feb 16, 2022
Small game I made in 2019 using python/pygame.

Kill-The-Blokk // Shoot or Die This is a small game I made in gr.10 (2019) for my high school computer science class; the game was coded in python usi

1 Nov 13, 2021
Pygame Raycaster made by me.

Pygame Raycaster made by me.

Sable 0 Jan 10, 2022
Use different orders of N-gram model to play Hangman game.

Hangman game The Hangman game is a game whereby one person thinks of a word, which is kept secret from another person, who tries to guess the word one

ZavierYang 4 Oct 11, 2022
Multiple hacks that breaks the game

Blooket-Hack All of the cheats are based on a game mode.

glizzz_y 484 Feb 25, 2022
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
Brawl Stars v31.96 server emulator written in Python.

Brawl Stars v31 Brawl Stars v31.96 server emulator written in Python. Requirements: Python 3.7 or higher pymongo dnspython colorama MongoDB configurat

9 Nov 26, 2021
This is a classic guess coin game (Heads or Tails) implemented by the Chialisp.

This is a classic guess coin game (Heads or Tails) implemented by the Chialisp. It is an absolutely fair P2P game based on the Chia blockchain. You can play with anyone in the world without custody.

Kronus91 14 Jul 02, 2022
Jogo da velha com interface gráfica desenvolvida em Python utilizando pygame e IA(Inteligência Artificial)

Jogo-da-Velha Sobre o projeto Jogo da velha com interface gráfica desenvolvida em Python utilizando pygame e IA(Inteligência Artificial) Layout tela d

Matheus Maia Alvarez 6 Apr 09, 2022
AI Mario challenges you to clear all stage of Super Mario game.

mario-ai-challenge Challenge AI Mario to clear all stages of Super Mario. GitHub Pages Site Rules Enjoy building AI Mario. Share information. Use Goog

karaage 48 Dec 10, 2022
MiTM proxy server for Darza's Dominion

Midnight A MiTM proxy server for Darza's Dominion, PC version. See this video for a demonstration of godmode: https://youtu.be/uoqvSxmnCJk How to use

2 Oct 24, 2022
A visualization of how much Manchester United fans enjoyed each game from the first half of the 21/22 Premier League season.

Man-Utd-Fan-Satisfaction-Levels-First-19-games A visualization of how much Manchester United fans enjoyed each game from the first half of the 21/22 P

1 Jan 19, 2022
The Original Snake Game. Maneuver a snake in its burrow and earn points while avoiding the snake itself and the walls of the snake burrow.

Maneuver a snake in its burrow and earn points while avoiding the snake itself and the walls of the snake burrow. The snake grows when it eats an apple by default which can be disabled in the setting

17 Nov 12, 2022
Memory game in Python

Concentration - Memory Game Concentration is a memory game written in Python, inspired by memory-game. Description As stated in the introduction of th

Marco Colonna 0 Jul 21, 2022
Mastermind-Game - A game to test programming and logical skills

Bem vindo ao jogo Mastermind! O jogo consiste em adivinhar uma senha que será ge

Marcelo Daros 0 Jan 27, 2022
Abandoned plan for a clone of the old Flash game Star Relic

space-grid When I was in middle school, I was a fan of the Flash game Star Relic (no longer playable in modern browsers, but it works alright in Flash

Radon Rosborough 3 Aug 23, 2021
Snake game made in python with the pygame library.

Pygame snake Snake game made in python with the pygame library. Requirements pip pygame Pygame Installation On the command line, type: pip install pyg

Ayza 3 Oct 02, 2022
Python code that gives the fastest path from point a to point b of a chess horse

PERSONAL-PROJECTS CARLOS MAGALLANES-ARANDA'S PERSONAL PROJECTS kchess.py is the code. its input is the start and the end. EXMPLE - a1 d5 its output is

Carlos Magallanes-Aranda 1 Dec 26, 2021
狼人杀,线下面杀用,服务端语音播报,浏览器操作,移动端友好。不再需要真人法官~

Wolf 狼人杀面杀法官系统 Preview 如何使用 安装 Python 3.5.2 版本及以上(PyWebIO 要求) pip install -r requirements.txt python main.py 所有玩家访问 Web 服务 TODO,欢迎PR TTS 目前仅支持 macOS 未

Lake Chan 33 Nov 11, 2022