Giter Club home page Giter Club logo

fast-hangman's Introduction

Command-line hangman game with strategy built in. NOTE: Needs to broken out better into functional pieces - as the design is a bit monolithic at the moment.

The initial strategy was:

1. Guess the most common letter from the list of n-letter words in the dictionary (where n is the length of the hidden word). If more than one letter has the same frequency, guess the most common in dictionary frequency.
2. Filter out non-matching words as letters are guessed.

Examples:
$ java PlayHangman -f words.txt -baseline

$ java PlayHangman -f words.txt wonderful
			
----E----; score=1; status=KEEP_GUESSING

----E----; score=2; status=KEEP_GUESSING

----E----; score=3; status=KEEP_GUESSING

----E---L; score=4; status=KEEP_GUESSING

----E-F-L; score=5; status=KEEP_GUESSING

----E-FUL; score=6; status=KEEP_GUESSING

---DE-FUL; score=7; status=KEEP_GUESSING

W--DE-FUL; score=8; status=KEEP_GUESSING

WONDERFUL; score=8; status=GAME_WON

Usage:
$ java PlayHangman -h
Usage: Please enter a hangman word and optionally '-v'
if the verbose mode is desired or specify a list of hangman words

<Simple>
java PlayHangman -h
java PlayHangman -f dictionary.txt [-v] $word1
java PlayHangman -f dictionary.txt $word1 ... [$wordN]
java PlayHangman -f dictionary.txt -baseline
java PlayHangman -f dictionary.txt -batch large.txt

<Advanced A>
java PlayHangman -f dictionary.txt [(-lt)(-lv)(-v)(-v2)] [-clk2] $word1

(v2 = more verbose output)
(v = verbose output)
(lv = less verbose output)
(lt = less terse output)
(clk = high level timing output)

<Advanced B>
java PlayHangman -f dictionary.txt [[-clk][-clk2]] $word1 ... $wordN
(clk2 = lower level timing output)

<Initialize stumper finding strategy>
(for 175k words takes ~ 45 mins)
java PlayHangman -f dictionary.txt -init:stumpers

fast-hangman's People

Contributors

brpandey avatar

Watchers

James Cloos 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.