Coder Social home page Coder Social logo

rubygolf's Introduction

Ruby Golf

Requirements

  • Ruby 2.1
  • RSpec 2.14

Setup

How to play

Ruby Golf is a game whereby the player is required to solve a number of problems (holes) in the fewest characters possible. The course consists of nine holes that you must implement. The holes are static methods that need to written for the Golf class (lib/golf.rb). The requirements for these methods is specified by a set of RSpec examples for each hole (spec/golf_spec.rb). To run the specs, simply run:

rake

The first time you run this, all tests will fail. The aim is to get all test to pass. Building will also report the number of characters you took to complete the course. The fewer characters you use, the better.

  • The winning team must have completed all holes (with all tests passing).
  • If more than one team completes all holes, the winner is the team with fewest characters in the Golf class.
  • Teams will then be ranked by number of holes completed.

Example - course complete

rubygolf git:(master) โœ— rake
/Users/dwaller/.rvm/rubies/ruby-2.1.1/bin/ruby -S rspec spec/golf_spec.rb
...........................

Finished in 0.00462 seconds
27 examples, 0 failures
-----------------------------------------------
| Congratulations, you've completed the course.
| Total characters: 522
-----------------------------------------------

Rules

  • Whitespace isn't counted
  • No requires, includes, backticks etc. Use only the ruby standard library.
  • Metaprogramming is allowed (for the Golf class only)
  • The only file you are allowed to modify is lib/golf.rb
  • No hard-coding return values!
  • If in doubt, ask.

rubygolf's People

Contributors

andrewmcdonough avatar dwaller avatar yarmand 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.