Git Product home page Git Product logo

abeltoolit / hangman-ai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evelynjgao/hangman-ai

0.0 0.0 0.0 31 KB

A Hangman AI written in Python that accesses a provided API through HTTP posts and requests. It guesses lyrics to rap songs with a win rate of at least 20% for 100 games played. My code hangman.py implements the dictionary that I sourced from the lyrics through playing this game, dict. I began building this dictionary by running the game about 500 times and appending the lyrics to the file in a certain format, namely only alphabetical characters with each word on a new line. I then reset. As the program runs, the dictionary improves as does the win rate. This dictionary includes repeats so that more frequently occuring words are more likely to be guessed. I split the phrase into words and worked on solving the ones with the least unknown characters first. Based off the words in the dictionary, I checked to see which words can fit and the frequency of letters that can occur in these possibilities to make the best educated guess. I also sourced a most frequently appearing letter string from sorting the dictionary and using a counter to get the frequencies of the letter appearences within the dictionary itself. This is the current state of dict after 200 runs since reset of the win rate and games played, with a win rate of exactly 25%.

Python 100.00%

hangman-ai's People

Contributors

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