Description of this paper

RUBY Scramble




Given a word scramble and a dictionary of words, find the best possible solutions to each word.;Both the dictionary and the wordscramble are a set of words, one per line. The script should output one or more solutions. An example wordscramble and solution are provided, below.;1. You must provide a hard coded dictionary in your program.;for example, this might be your dictionary: mary twinkle star row your boat gently down the stream life but dream ruby;2. An array of arrays, filled with single characters composing the word may be used.;a = %w[m a r y] #=> ['m', 'a', 'r', 'y'] or;a = Array ['m' 'a' 'r' 'y'] #=> ['m', 'a', 'r', 'y'];3. The length of each dictionary word may be useful for starting to unscramble the word.;['m', 'a', 'r', 'y'].length # => 4;4.Report an error if a word is not the dictionary (i.e cannot be unscrambled).;EXAMPLE;*******;The scrambled word is: arym;Guess the word....;You have 5 guesses left....;army;Your guess is incorrect. 4 left...;********;The scrambled word is: arym;mary;You got it!;ti continue ir to stop;N;*******;Game ends!


Paper#63944 | Written in 18-Jul-2015

Price : $27