kangoroo_robot 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +3 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +131 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/kangoroo_robot.gemspec +28 -0
- data/lib/kangoroo_robot/version.rb +3 -0
- data/lib/kangoroo_robot.rb +17 -0
- metadata +85 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 142b9ff41c89f3b726732224dc9ca5da085f74e8
         | 
| 4 | 
            +
              data.tar.gz: d6d06cfa5b796c80dd4d1f6f96b24748707c5dbd
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 1358260f8d2307a97cd60ce6be517ffef8ffb6326a92346791ed6b4abd15c7aef65e6a07a6897680c3abc7fccfdc3426b842b5b335060e38d58f18f43824c3ed
         | 
| 7 | 
            +
              data.tar.gz: b81cb1bc2daafc83c16496e9263a6c07889f6364b92f9688d11ceb7628cc4416b92a0c1134fad078f2971b9b42bc3f3746dc037acb3d27f77a92314f2b07687c
         | 
    
        data/.gitignore
    ADDED
    
    
    
        data/.rspec
    ADDED
    
    
    
        data/.travis.yml
    ADDED
    
    
    
        data/CODE_OF_CONDUCT.md
    ADDED
    
    | @@ -0,0 +1,13 @@ | |
| 1 | 
            +
            # Contributor Code of Conduct
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
         | 
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            The MIT License (MIT)
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Copyright (c) 2015 Herve Tatche
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy
         | 
| 6 | 
            +
            of this software and associated documentation files (the "Software"), to deal
         | 
| 7 | 
            +
            in the Software without restriction, including without limitation the rights
         | 
| 8 | 
            +
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         | 
| 9 | 
            +
            copies of the Software, and to permit persons to whom the Software is
         | 
| 10 | 
            +
            furnished to do so, subject to the following conditions:
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            The above copyright notice and this permission notice shall be included in
         | 
| 13 | 
            +
            all copies or substantial portions of the Software.
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         | 
| 16 | 
            +
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         | 
| 17 | 
            +
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         | 
| 18 | 
            +
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         | 
| 19 | 
            +
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         | 
| 20 | 
            +
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         | 
| 21 | 
            +
            THE SOFTWARE.
         | 
    
        data/README.md
    ADDED
    
    | @@ -0,0 +1,131 @@ | |
| 1 | 
            +
            # KangorooRobot
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            The only purpose of this gem is to serve as a code exercise for Lookahead, (Sydney, Australia)
         | 
| 4 | 
            +
             | 
| 5 | 
            +
                              | Kangaroo Robot |
         | 
| 6 | 
            +
                    | Herve Tatche's exercice for Lookahead |
         | 
| 7 | 
            +
                                     .
         | 
| 8 | 
            +
                                 /\ /l
         | 
| 9 | 
            +
                                ((.Y(!
         | 
| 10 | 
            +
                                 \ |/
         | 
| 11 | 
            +
                                 /  6~6,
         | 
| 12 | 
            +
                                 \ _    +-.
         | 
| 13 | 
            +
                                  \`-=--^-'
         | 
| 14 | 
            +
                                  _/  \ 
         | 
| 15 | 
            +
                                  (  .  Y
         | 
| 16 | 
            +
                                /"\ `--^--v--.
         | 
| 17 | 
            +
                               / _ `--"T~\/~\/
         | 
| 18 | 
            +
                              / " ~\.  !
         | 
| 19 | 
            +
                        _    Y      Y./'
         | 
| 20 | 
            +
                       Y^|   |      |~~7
         | 
| 21 | 
            +
                       | l   |     / ./'
         | 
| 22 | 
            +
                       | `L  | Y .^/~T
         | 
| 23 | 
            +
                       |  l  ! | |/| |
         | 
| 24 | 
            +
                       | .`\/' | Y | !   
         | 
| 25 | 
            +
                       l  "~   j l j_L______
         | 
| 26 | 
            +
                        \,____{ __"~ __ ,\_,\_
         | 
| 27 | 
            +
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
         | 
| 28 | 
            +
             | 
| 29 | 
            +
            ## Installation
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            Add this line to your application's Gemfile:
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            ```ruby
         | 
| 34 | 
            +
            gem 'kangoroo_robot'
         | 
| 35 | 
            +
            ```
         | 
| 36 | 
            +
             | 
| 37 | 
            +
            And then execute:
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                $ bundle
         | 
| 40 | 
            +
             | 
| 41 | 
            +
            Or install it yourself as:
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                $ gem install kangoroo_robot
         | 
| 44 | 
            +
             | 
| 45 | 
            +
            ## Usage
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            Run `bin/kangoroo_robot` and you will be presented with a command prompt.
         | 
| 48 | 
            +
             | 
| 49 | 
            +
            ## Instructions
         | 
| 50 | 
            +
             | 
| 51 | 
            +
            Kangoroo robot can receive different options to freely move around on a 5x5 table.
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            1. PLACE
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            This is the first command and it is mandatory to run it before giving any other instruction,
         | 
| 56 | 
            +
            it will place the robot on the table with the coordinates and direction that we give it.
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            ```
         | 
| 59 | 
            +
            PLACE x,y,cardinal_point
         | 
| 60 | 
            +
            ```
         | 
| 61 | 
            +
             | 
| 62 | 
            +
            Examples
         | 
| 63 | 
            +
             | 
| 64 | 
            +
            ```
         | 
| 65 | 
            +
            PLACE 1,1,NORTH
         | 
| 66 | 
            +
            PLACE 3,5,EAST
         | 
| 67 | 
            +
            PLACE 3,0,SOUTH
         | 
| 68 | 
            +
            ```
         | 
| 69 | 
            +
             | 
| 70 | 
            +
            2. MOVE
         | 
| 71 | 
            +
             | 
| 72 | 
            +
            Once the robot has been placed on the map, it is free to move around. With move, the robot
         | 
| 73 | 
            +
            will go one step further in the direction he is aiming to.
         | 
| 74 | 
            +
             | 
| 75 | 
            +
            ```
         | 
| 76 | 
            +
            MOVE
         | 
| 77 | 
            +
            ```
         | 
| 78 | 
            +
             | 
| 79 | 
            +
            3. LEFT
         | 
| 80 | 
            +
             | 
| 81 | 
            +
            We can rotate the robot 90 degrees to the left so he points to a different cardinal point. This
         | 
| 82 | 
            +
            way if he was pointing NORTH he will then aim to WEST
         | 
| 83 | 
            +
             | 
| 84 | 
            +
            ```
         | 
| 85 | 
            +
            LEFT
         | 
| 86 | 
            +
            ```
         | 
| 87 | 
            +
             | 
| 88 | 
            +
            4. RIGHT
         | 
| 89 | 
            +
             | 
| 90 | 
            +
            We can rotate the robot 90 degrees to the right so he points to a different cardinal point. This
         | 
| 91 | 
            +
            way if he was pointing NORTH he will then aim to EAST
         | 
| 92 | 
            +
             | 
| 93 | 
            +
            ```
         | 
| 94 | 
            +
            LEFT
         | 
| 95 | 
            +
            ```
         | 
| 96 | 
            +
             | 
| 97 | 
            +
            5. REPORT
         | 
| 98 | 
            +
             | 
| 99 | 
            +
            The robot will inform you of his current position and direction.
         | 
| 100 | 
            +
             | 
| 101 | 
            +
            ```
         | 
| 102 | 
            +
            REPORT
         | 
| 103 | 
            +
            ```
         | 
| 104 | 
            +
             | 
| 105 | 
            +
            Examples
         | 
| 106 | 
            +
             | 
| 107 | 
            +
            ```
         | 
| 108 | 
            +
            PLACE 1,2,WEST
         | 
| 109 | 
            +
            REPORT
         | 
| 110 | 
            +
            1,2,WEST
         | 
| 111 | 
            +
             | 
| 112 | 
            +
            MOVE
         | 
| 113 | 
            +
            REPORT
         | 
| 114 | 
            +
            0,2,WEST
         | 
| 115 | 
            +
            ```
         | 
| 116 | 
            +
             | 
| 117 | 
            +
            ## Development
         | 
| 118 | 
            +
             | 
| 119 | 
            +
            To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
         | 
| 120 | 
            +
             | 
| 121 | 
            +
            ## Contributing
         | 
| 122 | 
            +
             | 
| 123 | 
            +
            1. Fork it ( https://github.com/[my-github-username]/kangoroo_robot/fork )
         | 
| 124 | 
            +
            2. Create your feature branch (`git checkout -b my-new-feature`)
         | 
| 125 | 
            +
            3. Commit your changes (`git commit -am 'Add some feature'`)
         | 
| 126 | 
            +
            4. Push to the branch (`git push origin my-new-feature`)
         | 
| 127 | 
            +
            5. Create a new Pull Request
         | 
| 128 | 
            +
             | 
| 129 | 
            +
            ## Credits
         | 
| 130 | 
            +
             | 
| 131 | 
            +
            Kangoroo ASCII art was made by [Rowan Crawford](http://www.retrojunkie.com/asciiart/animals/kangaroo.htm).
         | 
    
        data/Rakefile
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            require "bundler/gem_tasks"
         | 
    
        data/bin/console
    ADDED
    
    | @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require "bundler/setup"
         | 
| 4 | 
            +
            require "kangoroo_robot"
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            # You can add fixtures and/or initialization code here to make experimenting
         | 
| 7 | 
            +
            # with your gem easier. You can also use a different console, if you like.
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            # (If you use this, don't forget to add pry to your Gemfile!)
         | 
| 10 | 
            +
            # require "pry"
         | 
| 11 | 
            +
            # Pry.start
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            require "irb"
         | 
| 14 | 
            +
            IRB.start
         | 
    
        data/bin/setup
    ADDED
    
    
| @@ -0,0 +1,28 @@ | |
| 1 | 
            +
            # coding: utf-8
         | 
| 2 | 
            +
            lib = File.expand_path('../lib', __FILE__)
         | 
| 3 | 
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         | 
| 4 | 
            +
            require 'kangoroo_robot/version'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            Gem::Specification.new do |spec|
         | 
| 7 | 
            +
              spec.name          = "kangoroo_robot"
         | 
| 8 | 
            +
              spec.version       = KangorooRobot::VERSION
         | 
| 9 | 
            +
              spec.authors       = ["Herve Tatche"]
         | 
| 10 | 
            +
              spec.email         = ["herve.tatche@gmail.com"]
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              spec.summary       = %q{Coding exercise for Lookahead}
         | 
| 13 | 
            +
              spec.description   = %q{Robot game controlled by giving him commands through the STDIN}
         | 
| 14 | 
            +
              spec.homepage      = "https://github.com/htatche/kangoroo_robot"
         | 
| 15 | 
            +
              spec.license       = "MIT"
         | 
| 16 | 
            +
             | 
| 17 | 
            +
              spec.files         = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
         | 
| 18 | 
            +
              spec.bindir        = "exe"
         | 
| 19 | 
            +
              spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
         | 
| 20 | 
            +
              spec.require_paths = ["lib"]
         | 
| 21 | 
            +
             | 
| 22 | 
            +
              # if spec.respond_to?(:metadata)
         | 
| 23 | 
            +
              #   spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
         | 
| 24 | 
            +
              # end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
              spec.add_development_dependency "bundler", "~> 1.9"
         | 
| 27 | 
            +
              spec.add_development_dependency "rake", "~> 10.0"
         | 
| 28 | 
            +
            end
         | 
| @@ -0,0 +1,17 @@ | |
| 1 | 
            +
            require_relative "kangoroo_robot/version"
         | 
| 2 | 
            +
            require_relative "kangoroo_robot/robot"
         | 
| 3 | 
            +
            require_relative "kangoroo_robot/direction"
         | 
| 4 | 
            +
            require_relative "kangoroo_robot/instruction"
         | 
| 5 | 
            +
            require_relative "kangoroo_robot/parser"
         | 
| 6 | 
            +
            require_relative "kangoroo_robot/position"
         | 
| 7 | 
            +
            require_relative "kangoroo_robot/robot"
         | 
| 8 | 
            +
            require_relative "kangoroo_robot/table"
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            require_relative "kangoroo_robot/instructions/left"
         | 
| 11 | 
            +
            require_relative "kangoroo_robot/instructions/right"
         | 
| 12 | 
            +
            require_relative "kangoroo_robot/instructions/move"
         | 
| 13 | 
            +
            require_relative "kangoroo_robot/instructions/place"
         | 
| 14 | 
            +
            require_relative "kangoroo_robot/instructions/report"
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            module KangorooRobot
         | 
| 17 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,85 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: kangoroo_robot
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Herve Tatche
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: exe
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2015-06-07 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: bundler
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - "~>"
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: '1.9'
         | 
| 20 | 
            +
              type: :development
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - "~>"
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: '1.9'
         | 
| 27 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: rake
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - "~>"
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: '10.0'
         | 
| 34 | 
            +
              type: :development
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - "~>"
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '10.0'
         | 
| 41 | 
            +
            description: Robot game controlled by giving him commands through the STDIN
         | 
| 42 | 
            +
            email:
         | 
| 43 | 
            +
            - herve.tatche@gmail.com
         | 
| 44 | 
            +
            executables: []
         | 
| 45 | 
            +
            extensions: []
         | 
| 46 | 
            +
            extra_rdoc_files: []
         | 
| 47 | 
            +
            files:
         | 
| 48 | 
            +
            - ".gitignore"
         | 
| 49 | 
            +
            - ".rspec"
         | 
| 50 | 
            +
            - ".travis.yml"
         | 
| 51 | 
            +
            - CODE_OF_CONDUCT.md
         | 
| 52 | 
            +
            - Gemfile
         | 
| 53 | 
            +
            - LICENSE.txt
         | 
| 54 | 
            +
            - README.md
         | 
| 55 | 
            +
            - Rakefile
         | 
| 56 | 
            +
            - bin/console
         | 
| 57 | 
            +
            - bin/setup
         | 
| 58 | 
            +
            - kangoroo_robot.gemspec
         | 
| 59 | 
            +
            - lib/kangoroo_robot.rb
         | 
| 60 | 
            +
            - lib/kangoroo_robot/version.rb
         | 
| 61 | 
            +
            homepage: https://github.com/htatche/kangoroo_robot
         | 
| 62 | 
            +
            licenses:
         | 
| 63 | 
            +
            - MIT
         | 
| 64 | 
            +
            metadata: {}
         | 
| 65 | 
            +
            post_install_message: 
         | 
| 66 | 
            +
            rdoc_options: []
         | 
| 67 | 
            +
            require_paths:
         | 
| 68 | 
            +
            - lib
         | 
| 69 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 70 | 
            +
              requirements:
         | 
| 71 | 
            +
              - - ">="
         | 
| 72 | 
            +
                - !ruby/object:Gem::Version
         | 
| 73 | 
            +
                  version: '0'
         | 
| 74 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 75 | 
            +
              requirements:
         | 
| 76 | 
            +
              - - ">="
         | 
| 77 | 
            +
                - !ruby/object:Gem::Version
         | 
| 78 | 
            +
                  version: '0'
         | 
| 79 | 
            +
            requirements: []
         | 
| 80 | 
            +
            rubyforge_project: 
         | 
| 81 | 
            +
            rubygems_version: 2.4.6
         | 
| 82 | 
            +
            signing_key: 
         | 
| 83 | 
            +
            specification_version: 4
         | 
| 84 | 
            +
            summary: Coding exercise for Lookahead
         | 
| 85 | 
            +
            test_files: []
         |