Giter VIP home page Giter VIP logo

ds-final-project's Introduction

NOTE: This code has been adapted from code borrowed, with permission, from Ryan Michalec. The queue.c and queue.h files, as well as the pathfind() function were all written by this group, but the underlying hag interface was created by Ryan before our modifications. If you want to see the code before any changes were made, the original version of it is stored in the source branch of this repository. The source code can also be found at https://github.com/a3qz/hag.

Compiling

In order to compile, ensure that lncurses and C89 are installed on the machine which compiles the program. Lncurses is the gui interface which is used to run hag, so it is necessary to have it installed, and the program is compiled in C89, so it should also have that. The student machines automatically have both lncurses and C89 installed, so compiling should not be an issue on those machines, however on a personal machine there might be some graphical issues if they are not installed.

Testing

In order to perform testing on this project, first cd into the testing directory, which has its own makefile. In this, make the program, then run ./test in order to get the time it takes to run through Dijkstra's Algorithm. The distance to move is modifiable, and can be changed from a distance of 0-15 (the max sight range of an enemy) by running "./text dx dy", where dx and dy are the distance the enemy is from the player in the x and y directions, respectively. If a number greater than 15 is entered, it will create an uninitialized value error, as this is a case which is never encountered in the actual running of the program.

There is a README file in the testing folder which has some baseline values for the average running times of linear vs the Dijkstra's Algorithm searching. Due to its speed, there is no time test for the linear search in the testing folder, as it most often takes between 0 and 2 nanoseconds to compute. The README in the testing folder also contains an example of valgrind --leak-check=full being run on the test program.

If valgrind is run on hag itself, there will be bytes lost but still reachable. This is because the source code does not free the memory which it allocates. The testing folder contains both the queue class and the pathfind() function compiled in the test executable, which both displays the run-time of the algorithm and shows the memory usage of the code we wrote.

ds-final-project's People

Contributors

bonadawg avatar

Watchers

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