Giter Club home page Giter Club logo

robots's Introduction

Robots!

Robots! is a multi-round, completely autonomous game played by two robots taking turns moving across a 7x7 game board in search of a randomly placed prize token.

ezgif com-optimize

1. Used Stack and Concepts

• UIKit • Swift • Protocols and delegates • MVC • Threads and Grand Central Dispatch • Graphs, nodes, and queues • Breadth First Search Algorithm • XCTest and UITest

2. Bonus

You can change the target by tapping one of the available nodes, so the robots change the path and try to reach the new goal.

3. Architecture

Screen Shot 2023-03-31 at 12 28 36 AM

4. Breadth First Search Algorithm

A dungeon has a board size of R x C and you start at cell ’0,0’ and there’s an exit at cell ‘4,3’. Blockers are indicated by a ’#’ and empty cells are represented by a ’.’.

Screen Shot 2023-03-31 at 12 29 14 AM

Start at the start node coordinate by adding (sr, sc) to the queue:

Screen Shot 2023-03-31 at 12 29 43 AM

Keep adding to the queue:

Screen Shot 2023-03-31 at 12 30 07 AM

Screen Shot 2023-03-31 at 12 30 31 AM

We have reached the end, and if we had a 2D prev matrix we could regenerate the path by retracing our steps:

Screen Shot 2023-03-31 at 12 30 57 AM

robots's People

Contributors

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