Git Product home page Git Product logo

unscramble's Introduction

Unscramble

We're gonna write a program that can unscramble a word. Inspired by the "Jumble" puzzle in the newspaper, the program should accept a single, scrambled word and return a matching entry from the English dictionary.

> ./unscramble cofer
force
> ./unscramble sasewe
seesaw

Basic guidelines:

  1. A scrambled or jumbled word has only one valid answer.
  2. Use the contents of /usr/share/dict/words as a dictionary.

Bonus points:

  1. Make it fast (try testing longer words, for example).
  2. Complete the exercise using a programming language that is new to you.

To start:

  1. Clone this repository.
  2. Create a directory based on the name of your implementation language (e.g. languages/C)
  3. Create a simple Rakefile that has, at a minimum, a build task within your language's namespace (e.g. C:build). You should check the environment and fail fast if dependencies aren't met.
  4. Create your implementation.
  5. From the project root run rake run[<language>] to test your language (e.g. rake run[bash]; zsh users will have to quote the argument, e.g. rake run'[bash]'), or rake to test all languages.

Note that the tests run against English words. If you use a different language, symlink /usr/share/dict/words to an English word list to run the tests. If your system does not come with an English word list installed, install wamerican or wbritish (e.g. Ubuntu apt-get install wamerican); english-words's words.txt will do as well.

Example Rakefile

namespace :C do
  task :check do
    `which cc`
    raise "Please ensure that you have a valid C compiler" unless $?.success?
  end

  task :build => :check do
    path = File.dirname(__FILE__)
    `cd #{path}; make unscramble`
  end
end

unscramble's People

Contributors

cwmanning avatar solomonhawk avatar dce avatar joeyjoejoejr avatar olets avatar 5h44n avatar yaychris avatar averyvery avatar reagent avatar prayash avatar

Watchers

Elliott Muñoz avatar Dylan Lederle-Ensign avatar James Cloos avatar Paul Koch avatar  avatar Brian Williams avatar Peyton Chance 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.