Giter Site home page Giter Site logo

luanprins / vanity-quest Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.36 MB

A game project featuring a simple parsing mechanic to interpret sentences input by the user. In the spirit of old-school text-based adventures like Zork, read descriptions of the world around you and type in what you want your character to do to advance through levels.

Python 100.00%

vanity-quest's Introduction

VANITY QUEST README

LAST PYTHON VERSION USED 3.9.6

DEPENDENCIES Pyinstaller version 4.3 is to be used for compiling to executables.

STANDARD LIBRARY MODULES USED

  • pickle (for saving game progress)
  • sys (for the exit function that works with compiled executables as the builtin exit/quit functions are designed for interpreter sessions)
  • textwrap (for dedenting long strings)
  • unittest

ABOUT Vanity Quest is built up to the third chapter of the storyline and tested up to the first. The executable version in the folder named dist is compiled for Windows, though I've only tested it on one machine.

The project is fit to run from source code using the Python interpreter. The steps are:

  1. Clone this repo.
  2. Run main.py using the Python interpreter.
  3. If there are errors, check that it doesn't have to do with a mismatch for the last Python version used to develop this project (see "LAST PYTHON VERSION USED"). I'd be interested to see reports of any other errors.

Game saves are created using the pickle module from the Python standard library.

TESTING

To run the unit tests, be sure to navigate to the root directory. From there, use the command python -m unittest tests/test_everything.py (for Windows) or python3 -m unittest tests/test_everything.py (for Mac/Linux). To run an individual unit test, replace the "test_everything.py" with the chosen test script in the above command.

Here's a unit testing checklist to use:

  1. Objects are initialized with the expected values and attributes.
  2. Functions that only output text are called when the associated input is made (by making them MagicMock objects using the @patch decorator and checking they were called using their assert_called_once method).
  3. If a function mutates a variable, the variable is tested for a new value using assertEqual.
  4. If a function's behaviour is conditional, make sure that it does what is expected under every condition.
  5. If a function results in another function call, that call should be made a mock, and its function should be tested individually.
  6. If additional test tools need to be created, such as by modifying unittest features, include them in tests/vanity_test_tools.py.

vanity-quest's People

Contributors

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