GithubHelp home page GithubHelp logo

airport_challenge's Introduction

#Airport Challenge

The aim of this challenge was to develop an 'airport', 'plane' and 'weather' that interacts with each other. It was not part of the challenge but this project also includes a 'traffic_control'.

###airport Airport accepts planes to the terminal (if it is not full) when landed, and releases a plane from the terminal when plane takes off. It does not allow an empty terminal to release a plane.

The airport capacity is '10' by default but this can be changed, when a new airport is instantiated (e.g. airport = Airport.new(5))

###plane Plane lands or takes off depending on the permission received from the traffic control. It raises an error if it has already landed/taken off and a request to land/take off has been made.

###traffic_control Traffic_control checks the weather, and grants permission for landing or take off if weather is sunny.

###weather Changes its weather state between sunny and stormy randomly.

##How to use it in irb?

1- After cloning this repository do `gem install bundle` and then `bundle` in your command line
2- Start irb
3- Require the "airport.rb" file
4- airport = Airport.new
5- plane = Plane.new
6- traffic_control = TrafficControl.new
7- weather = Weather.new
8- traffic_control.allow_landing_and_take_off_depending_on(weather)
9- plane.land(traffic_control)
10- a) if plane successfully landed: airport.plane_arrival(plane) =>        this will add the plane to the terminal.
    b) if plane did not successfully land due to stormy weather, then try again. As the weather state is random, it will land eventually.
11- airport.plane_departure(plane), should release the specific plane that is already in the terminal. It will raise an error if plane is not in the terminal.

airport_challenge's People

Contributors

anitacanita avatar bebbs avatar dbugsy avatar leoallen85 avatar michaellennox avatar mihailiviucojocar avatar mtaner avatar nikeshashar avatar silvabox avatar spike01 avatar tansaku avatar

Watchers

 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.