spellsolver,fabaindaiz (2024)

spellsolver's Introduction

Spellsolver is a software that helps to search for the best possible word in Spellcast discord activity. Spellsolveruses a trie to store the valid words, and then iteratively tries all the possible combinations of letters on the board,discarding the ones that don't make valid words and keeping the ones that do.

  • Initialization of the trie in single swap mode takes 5 seconds and uses 150 MB of ram memory.
  • Once initialized, spellsolver runs almost all single swap queries in less than a second.

A message like this will be printed on the screen while Spellsolver starts

Spellsolver v1.15WordValidate is being initialized, this will take several secondsWordValidate successfully initialized (elapsed time: 4.8 seconds)
  • Inside the docs folder, you will find some documents that detail the operation of spellsolver, as well as notes on how the algorithm is implemented.

Requirements

  • python3 (3.9 or later)
  • marisa-trie (for store words)
  • tk (tkinter for graphicui.py)
  • fastapi (for webapi.py)
  • uvicorn (for webapi.py)

TODO

  • Add some spellsolver tests to avoid accidentally introducing new bugs
  • Document new changes to the spellsolver algorithm, improvements and bug fixes

instructions for use

  • The letters on the board must be written in a single line following the order left -> right and then up -> down withno spaces
  • To add a multiplier, the coordinates must be written as two numbers together (eg 34 or 01), multiple coordinates mustbe separated by a space (in the case of consoleui.py, you must use dots instead of spaces)

WebAPI

  1. From this folder execute webapi.py
  2. Navigate to localhost:8080/docs to test the endpoints

# Example solve request body{ "gameboard": "rslesrotvegifovxqmbabaaif", "swap": 1, "gems": "00 01 02 03 04", "x2_mult": "23", "dl_mult": "23", "tl_mult": ""}

GraphicUI

  1. From this folder execute graphicui.py
  2. Write the letters on the board in the interface table
  3. Use the right click to select letter modifiers or to delete them
  4. Click on one of the buttons to search for words according to the amount of swap you want to use

ConsoleUI using inputs

  1. From this folder execute consoleui.py
  2. Write the letters of the board and the rest of the data as indicated above
  3. The software will return an ordered list with the score, the word and the coordinate of the initial letter
Insert a gameboard: rslesrotvegifovxqmbabaaifInsert 2x coordinates: 23Insert DL coordinates: 23Insert TL coordinates: Use swap?: 1The following words have been found (elapsed time: 295.0 milliseconds)[(66 zoftig (2, 3) | z (2, 3)), (58 vomitory (4, 2) | y (0, 2)), (58 vomitous (4, 2) | u (0, 1)), (58 comfits (3, 3) | c (3, 3)), (58 jabots (2, 3) | j (2, 3)), (58 faqirs (2, 3) | f (2, 3)), (54 fimbria (2, 2) | r (4, 4)), (54 setiform (4, 0) | r (3, 3)), (54 comfit (3, 3) | c (3, 3)), (54 maxing (2, 3) | n (0, 1))]

ConsoleUI using arguments

  1. From this folder execute consoleui.py with the following arguments as indicated above
  2. The software will return an ordered list with the score, the word and the coordinate of the initial letter
positional arguments: game gameboard stringoptions: --swap SWAP enable swap mode --gems GEMS gem coordinates --ices ICES ice coordinates --x2 X2 X2 coordinates --dl DL dl coordinates --tl TL tl coordinatesexample: python consoleui.py rslesrotvegifovxqmbabaaif --swap 1 --x2 23 --dl 23 --gems 00.01.02.03.04

Run tests

Some tests have been included to verify the correct working of spellsolver and all its modulesTo run the tests you can use the following command

python -m unittest discover -s tests -t .

Acknowledgements

spellsolver's People

Contributors

Stargazers

Watchers

Forkers

joyte oloctus tmatee winnymanux amazingbaddletrabble senzawaa d0ggy1 tctcl xiaobool yilmazcabuk faresvip000 jaxon-delgado ddiste

spellsolver's Issues

Use static type checks with mypy

'graphicui' is not defined

Traceback (most recent call last):
File "", line 1, in
NameError: name 'graphicui' is not defined

Removal of WebAPI and Console Interfaces

Issue Description:

The WebAPI and Console interfaces currently exist within the project; however, it has been observed that these interfaces are considered redundant and have not demonstrated any meaningful usage or contribution to the project's functionality. As part of an ongoing effort to streamline the codebase and enhance maintainability, it is proposed to remove these interfaces.

Reasoning:

  1. Redundancy: The WebAPI and Console interfaces seem to duplicate functionality already provided by other components in the project, leading to unnecessary complexity.

  2. Lack of Usage: These interfaces are seldom utilized by users, suggesting that they may not provide significant value.

  3. Maintenance Burden: Keeping these interfaces in the codebase adds an unnecessary maintenance burden, especially when updates or changes are made to the project.

Proposed Action:

The proposed action is to initiate the removal of the WebAPI and Console interfaces from the codebase. This involves deleting relevant code files, updating documentation, and ensuring that the removal does not adversely impact other parts of the system.

Expected Benefits:

  1. Simplified Codebase: Removing redundant components will lead to a more straightforward and maintainable codebase.

  2. Improved Focus: By eliminating unused interfaces, developers can concentrate on enhancing and maintaining the core functionality of the project.

Can't execute graphicui.py

I'm trying to execute the graphicui.py option but I am running into crashes.
Here is the error that I have
spellsolver,fabaindaiz (24)

Separation of Concerns in Tkinter Widgets

Problem:

The current codebase for our Tkinter application is becoming increasingly crowded and hard to maintain. This is primarily due to the lack of separation of concerns within our Tkinter widgets. Without a clear separation, it's challenging to make changes, debug issues, and add new features to the application efficiently.

Proposed Solution:

To address this issue, we need to implement a clear separation of concerns in our Tkinter widgets. This separation of concerns should involve breaking down our code into distinct modules or classes that handle specific aspects of the application. This way, we can achieve better code organization, maintainability, and reusability.

Possible Steps:

  1. Identify the key concerns within our Tkinter widgets. This may include handling the GUI layout, user input, data processing, and interaction with external resources.

  2. Create separate modules or classes for each of these concerns. For example, we can have separate modules for GUI layout, event handling, and data processing.

  3. Refactor the existing code to move relevant code sections into the appropriate modules or classes.

  4. Ensure that these modules or classes are well-documented, making it easier for developers to understand their purpose and functionality.

  5. Update the application to use these separated concerns, ensuring that it works correctly after the refactoring.

Benefits:

  1. Improved code organization and maintainability.
  2. Easier debugging and troubleshooting of issues.
  3. Enhanced reusability of code components.
  4. Better collaboration among developers, as different concerns can be worked on independently.

Init WordValidate

How do I fix this issue every time I execute consoleui.py or graphicui.py?

add feature for adventure mode

can you add feature for adventure mode on blocking ice icon ?,, thankyou

Modify old trees to make them compatible with the new interface

type object not scriptable

on python 3.8.10

Traceback (most recent call last): File "graphicui.py", line 2, in <module> from src.interfaces.tkinterboard import TkinterBoard File "C:\Users\saiv2\Downloads\Spellsolver-1.8\Spellsolver-1.8\src\interfaces\tkinterboard.py", line 1, in <module> from src.interfaces.tkinterwidget import Board File "C:\Users\saiv2\Downloads\Spellsolver-1.8\Spellsolver-1.8\src\interfaces\tkinterwidget.py", line 4, in <module> from src.modules.resultlist import ResultWord File "C:\Users\saiv2\Downloads\Spellsolver-1.8\Spellsolver-1.8\src\modules\resultlist.py", line 2, in <module> from src.modules.gameboard import GameTile File "C:\Users\saiv2\Downloads\Spellsolver-1.8\Spellsolver-1.8\src\modules\gameboard.py", line 2, in <module> from src.utils.utils import get_coordinate, letter_points, valid_word File "C:\Users\saiv2\Downloads\Spellsolver-1.8\Spellsolver-1.8\src\utils\utils.py", line 3, in <module> def get_coordinate(aux_cord: int) -> tuple[int]: TypeError: 'type' object is not subscriptable

Implement a validate trie using a cpp library

Spellsolver: different runs of the solver return different results

I can't run graphicalui.py

Version 1.10 works fine for me. The newer version, any above 1.10, doesn't run. When I start graphicui.py, the command window appears but rapidly closes. Any ideas on how to solve this? Maybe it has to do with the python installed on my pc?

Multiple bonus and freemove with arrow keys

hai

  1. can you add some free move and replace because i sometime miss typing.
  2. and can you add some extra multiple DL and TL like a Gems function, because in adventure mode, sometime have 3TL / DL . maybe some multiple 2X too ??

tenkyu

Try to optimize multi processing

Using hover in graphicui replaces the current letters with the letters from the last solved board

Recommend Projects

  • React

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

  • Vue.js

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

  • Typescript

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

  • TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django

    The Web framework for perfectionists with deadlines.

  • Laravel

    A PHP framework for web artisans

  • 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.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook

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

  • Microsoft

    Open source projects and samples from Microsoft.

  • Google

    Google ❤️ Open Source for everyone.

  • Alibaba

    Alibaba Open Source for everyone

  • D3

    Data-Driven Documents codes.

  • Tencent

    China tencent open source team.

spellsolver,fabaindaiz (2024)
Top Articles
Latest Posts
Article information

Author: Ms. Lucile Johns

Last Updated:

Views: 6518

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Ms. Lucile Johns

Birthday: 1999-11-16

Address: Suite 237 56046 Walsh Coves, West Enid, VT 46557

Phone: +59115435987187

Job: Education Supervisor

Hobby: Genealogy, Stone skipping, Skydiving, Nordic skating, Couponing, Coloring, Gardening

Introduction: My name is Ms. Lucile Johns, I am a successful, friendly, friendly, homely, adventurous, handsome, delightful person who loves writing and wants to share my knowledge and understanding with you.