Code Monkey home page Code Monkey logo

animal-game's Introduction

animal game for Tulane CMPS 1600

Author: Steven Shea [email protected]

compiling instructions:

this project has no preexisting dependencies aside from a modern C/C++ compiler, git, and cmake. Git can fetch the googletest as a submodule, which cmake will compile along with the project itself

to build the project:

#clone project
git clone https://github.com/dangerbird2/animal-game.git animal-game
cd animal-game

# download submodules
git submodule init
git submodule update

#create cmake build directory
mkdir build && cd build

#build with cmake
cmake ..
make

to build documentation:

doxygen ./doxyfile.in
# open docs/html/index.html in browser

Animal game algorithm pseudocode:

  • Store node data as a struct with two fields -- a boolean field indicating whether the node represents a specific species or a descriptor(eg. does it quack, is it green, etc.). The second field is the node's name

    • nodes that are species must be leaf nodes.
  • Begin by calling a ask_user routine on the head node

  • subroutine ask_user(node):

    • ask "are you thinking of a [node description]?"
    • if node is a leaf and user responds "yes", end game
    • else, call traverse-node on node and response and set current node to returned value
  • subroutine traverse-node

    • match response YES with right node, NO with left node
    • if matching node is non-null, return matching node
    • else, if node is a category(branch), ask user for the animal the user is thinking of, and attach new node with user's animal to matching node
    • else, if node is an animal(leaf) ask what differentiates user's animal from given animal. replace animal node with new category node, and place the old animal node with the non-matching node.
    • return tree's head node (starting process over)

animal-game's People

Contributors

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