Coder Social home page Coder Social logo

shashi278 / wordbase-hack Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.06 MB

Wordbase is a nice game but I'm just sooo bad at it!

Home Page: https://watney.pythonanywhere.com/wordbase-hack

License: GNU General Public License v3.0

HTML 0.08% Python 99.92%
wordbase-hack opencv boggle-solver

wordbase-hack's Introduction

Wordbase-Hack

A simple(well, kind of) script to hack into wordbase android game.

How does it work?

In short:
  • It takes up a screenshot image of the game along with your color(i.e. Blue or Orange) and provides you with possible words you can play. Also, you can choose to show only those words which intersects with the opposite color(with a cost of few extra seconds)
In not-so-short:
  • Creating training images
    • create_image from pre-process.py takes an image(screenshot) and breaks it up into 13*10 pieces containing individual letters and save them to a folder called train_images after resizing each of them to 19x16 followed by performing some thresholding stuffs.
  • Training the model
    • Take each image from train_images folder and associate corresponding labels to them(Labels are just respective alphabet letters).
    • Reshape(to 1D) and normalize(0 to 255 => 0 to 1) the image array.
    • Finally, train the model upon reshaped-array using LinearSVC method from sklearn.svm and save the model with the name svm_model in the root directory.
  • Generating letter grid
    • get_grid from pre-process.py uses the above trained model to produce an exact grid(2D-array) of letters from a given screenshot along with lists containing positions of blue and orange tiles.
  • Finally, getting words
    • Finally, solve from main.py uses the grid to filter out possible words starting from position of given-colour tiles.
    • It uses a list of English words, which is stored as a list in word_list.py, to compare for possible words.
    • Why not use word_list.txt directly rather than saving it in a .py file and then using the .py file? Because importing .py file will create a .pyc file upon first execution of the script which will be used in further execution thereby cutting down the execution time almost by a factor of 10.
    • For depth understanding of word-generation, consider reading the codebase :)

How to use?

  • Head to the src folder and run main.py after setting your-path-to-screenshot as the first argument and color as the second argument to solve. You can also specify the minimum length of the words(defaults to 4) and whether to get only words which intersect the opponent's base(defaults to True) by setting optional parameters min_length and only_intersection respectively of solve.
  • Or, you may just go to the above link in the description. Now, for some reasons the website doesn't work as expected in a row on a given image(meaning, you may need to close the current tab and open the link all over again, no promises tho)

wordbase-hack's People

Contributors

shashi278 avatar

Watchers

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