Write a program for the wordscramble game

Assignment Help Programming Languages
Reference no: EM13781143

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!

<Y> ti continue ir <N> to stop

N

*******

Game ends!

Reference no: EM13781143

Questions Cloud

Discuss how you would have approached the particular topic : discuss how you would have approached this particular topic if you were to write a middle ground argument, instead of a Toulmin or Rogerian argument.
Problems related to theology and philosophy : What are the similarities and differences between your personal beliefs about God and the accounts of God we have studied this week?
Help on pc desk : You are the Chief Information Officer (CIO) of a medium sized business that provides an online data base to Internet subscribers. By then end of the current business quarter, you must propose a design for the implementation of client operating sy..
Language and forms of cultural organization : Based on your reading about language and forms of cultural organization, please write a brief essay of 2 pages answering the following questions:
Write a program for the wordscramble game : 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.
Distinguish technical efficiency from economic efficiency : Distinguish the various cost curves and describe the relationships among them - Explain the role of the firm in economic analysis and describe the production process in the short run - Distinguish technical efficiency from economic efficiency.
Explain the structure of the appellate courts in your state : Include in your discussion an explanation of the jurisdiction (authority to hear cases) of these various trial courts. Specifically, explain in what trial court(s) in the state you would file specific types of claims. Additionally, explain the str..
Analyze the basic issues of human biology : In 200-250 words, analyze the basic issues of human biology as they relate to chronic conditions and describe the interaction between disability, disease, and behavior.
Behaviors about a number of conditions including cancer : Our stage of life, intellectual/cognitive abilities, and sociocultural position in life, affect our perspectives and resultant behaviors about a number of conditions including cancer.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd