GithubHelp home page GithubHelp logo

wwz's Introduction

World War Z++

Problem: Many things, such as death and taxes, are inevitable. Another thing that's inevitable, in the scope of this problem, is the Zombie Apocalypse. You are the lone survivor (good job, go you!), but you're stuck on the top floor of a warehouse (a vertical maze) full of the brain munching monsters. That sucks.

Rules: Build a function that runs through the maze, that takes into account not just walls, but also zombies. Luckily, zombies can't move (they're hungry, you don't like moving when you're hungry either, don't judge).

Moving:

  • You can move one space in any direction (that you are able) during a step.
  • You can move through gaps in the floor (" ").
  • You will start at the S position and finish at the F position.
  • You cannot move through walls (" | "), as they are solid.
  • If you hit a wall, or a Zombie (" Z "), you will need to switch directions on the next step.

NOTE: You do not need to create a function to go up floors, but you are welcome to give it a shot for extra credit.

Requirements: Your function should take in the following maze grid (which is 12 rows by 10 columns), which is an array of strings. You do not need to rewrite this maze grid on a whiteboard (that would be cruel and unusual punishment), but it is here for your reference.

Example Maze Grid:

var mazeGrid = 
["         S  ",
"|________ __|",
"| _________Z|", 
"| Z_________|",
"| |_____Z___|",
"| _________Z|",
"|__ __Z_____|",
"|_____ ___Z_|",
"| |__| _____|",
"| ________Z_|",
" F           "]

wwz's People

Contributors

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