Coder Social home page Coder Social logo

japanese-mosaic-logic-puzzle's Introduction

Japanese Mosaic Logic Puzzle

For rules and examples of the Japanese Mosaic problem you should take a look at the Cucumber acceptance tests.

features/mosaic.feature

If you’re not sure what Cucumber is take a quick peek here http://cukes.info/

We will use these Examples to drive the development of your solution.

1 Prerequisites

The acceptance tests for these examples require Ruby and Cucumber.

So we need the following installed:

  1. Git (and a github account: http://github.com)
  2. Ruby (or JRuby whatever floats your boat)
  3. Rubygems (http://rubygems.org/pages/download)

2 Setup

  1. Fork my repository on Github (http://github.com/josephwilk/japanese-mosaic-logic-puzzle)
  2. git clone your repository
  3. gem install bundler
  4. cd japanese-mosaic-logic-puzzle && bundle install

We can now run that Cucumber specification:

cucumber features/mosaic.feature

You should be greeted with lots of fails. Right here the work starts, work your way down the scenarios getting each to pass in turn.

3 Coding

You have to ensure that executing “bin/mosaic” prints the solution on the command line.

The file “bin/mosaic” will be executed with a filename which will contain the input string.

4 First steps

bin/mosaic file:

#!/usr/bin/env ruby
filename = ARGV[0] # The first argument is the filename with the input table string
File.open(filename) do |f|
  string_input_table = f.read
  input_array = string_input_table.split("\n").map{|row| row.split("|")[1..-1]}
end

puts “I should output the solution here.”

japanese-mosaic-logic-puzzle's People

Contributors

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