subject

A classic puzzle is called the Tower of Hanoi. To solve the puzzle, you must move all of the rings from the peg on the left to the peg on the right. Sound easy? The trick is that all of the pieces are different sizes, and you aren’t allowed to put a larger piece on top of a smaller piece. Just like with the Traveling Salesman Problem that you were introduced to in this unit, the Tower of Hanoi is the kind of problem that a computer is good at solving. An algorithm really helps! But the Tower of Hanoi is still fun to work out on your own. For this lab, you will use a virtual Tower of Hanoi to solve the puzzle. Step 1 Solve the puzzle at least three times. Start with only three discs. You must also solve the 4-disc puzzle, and then challenge yourself with any number of discs greater than 4. (Change the number of discs by clicking the arrows in the top left corner of the game.) Screenshot each of your solutions, showing the completed puzzle and the number of moves it took you to reach that point. It is okay if your number of moves are above the minimum number of moves listed. Step 2 After you have solved the Tower of Hanoi at least three times, write an algorithm with clear, numbered steps that would guide another player through the steps of solving the puzzle. Here is a clue to get you started: The first step should be: move the smallest ring to the middle peg. Step 3 After you write the algorithm, write a few sentences reflecting on your experience: What was tricky about writing the algorithm? Did you find that having a written algorithm made it easier to solve the puzzle? Why or why not? Step 4 Do some online research and discover another famous algorithm or coding puzzle to share. Write a brief summary of the puzzle, as well as what you find interesting about it. Include the link to the source where you found the puzzle.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 08:00
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
question
Computers and Technology, 23.06.2019 13:00
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. â–ş print out all positive integers from 1 to 100, inclusive and in order. â–ş print messages to standard output, matching the sample output below. â–ş in the output, state whether the each integer is 'odd' or 'even' in the output. â–ş if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. â–ş if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. â–ş design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
You know the right answer?
A classic puzzle is called the Tower of Hanoi. To solve the puzzle, you must move all of the rings f...
Questions
question
Mathematics, 04.09.2020 22:01
question
Social Studies, 04.09.2020 22:01
question
Social Studies, 04.09.2020 22:01
question
Mathematics, 04.09.2020 22:01