GithubHelp home page GithubHelp logo

sonhyangji / dying_maze Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dldbdud314/dying_maze

1.0 0.0 0.0 19 KB

This is a game where you find your way through the maze, playing small quizzes and games on the way

C++ 100.00%

dying_maze's Introduction

dying_maze

This is a game where you find your way through the maze, playing small quizzes and games on the way

We focused on...

1. Using important algorithms: DFS/BFS algorithm

DFS(Depth-First Search)
This is about searching as deeply as you could. Once there is a deadend(if you can't go further), you go back to the latest crossroad(where there were more choice of path) and continue with the search.
In order to go back to the crossroad, it is crucial that you store the node you visited by using stack implicitly.
However, this search algorithm could be time-consuming in that it implements recursion, especially if the key is in the last node of last path.

BFS(Breadth-First Search)
Breadth-First Search is more about speading to different paths, rather than digging in deeply(like DFS). Therefore, you use queue to store the nodes to visit in the future.
This algorithm has advantage in that it is less time-consuming compared to DFS algorithm. However, DFS would perform better if the key node is in the last node of first path.

2. Tracking movements with struct array

Struct is similar to class, except that it lacks function. That is, it is composed with data only.
Array is a data structure where you could store many data of same type.
Therefore, Struct array refers to array of struct type.


struct XY{
       int a;
       int b;
    }; //struct
    
struct XY his[MAX_STACK_SIZE]; //struct array 

Maze Implementation

Maze textfile
We used textfile with different numbers to display path and different traps as an input.
0 is a wall, 1 is the path, 2 and 3 is where the trap even occurs, 5 is the starting point and 9 is the end of maze. With the textfile as input, we allocated int arrays dynamically.

Class Diagram

dying_maze's People

Contributors

dldbdud314 avatar

Stargazers

 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.