RUBY Scramble Program

Feb 3rd, 2012
Studypool Tutor
Price: $20 USD

Tutor description

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

Word Count: 130
Showing Page: 1/1
------------------------------------words.txt FILE------------------------------------mary twinkle star row your boat gently down the stream life but dream ruby------------------------------------RUBy Script------------------------------------choice = 'Y'counter = 1words = Array.newFile.o

Review from student

Studypool Student
" This tutor is great! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1819 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors