Giter Site home page Giter Site logo

text_adventure's Introduction

Leiper: A Homebrew Text Adventure Game

To whom it may concern:

I've always loved retro games. One of my favorites is Zork, the Underground Empire. As a neat way to learn some of the basics of Object Oriented Python programming as well as some web-development, I decided to make my own shameless rip-off of Zork.

At the moment, I've only implemented the "scaffolding" of the game (the parser, each class, etc) so there isn't much to "play". But all that is to come.

A brief history (skip, if the details bore you)

My initial plan was to utilize the Natural Language Toolkit (nltk) to write some badass parsing scripts which could handle a variety of complex sentences with ease. But I found the vanilla pos_tag to be quite inaccurate (i.e., it always though 'blue' was a noun no matter how it was used) and using ML to accomplish the problem felt like overkill. So I decided to write my own using the re library and some shameless lists. It's not as fancy as something you could do with nltk, but it gets the job done well enough and provides output that is considerably more helpful than "INVALID COMMAND" etc. when it doesn't understand a sentence. Maybe one day I will bust out the machine learning to make something more elegant, but for now this will suffice.

This program uses the following non-standard libraries:

re
nltk
flask

To run the program, just enter python launch.py <mode> where mode is either:

  • "local", if you would like to run the program in a terminal window or
  • "server", if you would like to run the flask application associated with the program and play the game in a browser (http://localhost:5000).

Enjoy!

text_adventure's People

Contributors

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