You are on page 1of 4

AL101 – ALGORITHMS AND COMPLEXITY

Week # 6
NAME:Vida, John Paul S. SCORE PERCENTAGE

STUDENT NO: 20-2167

YEAR/SECTION:”3rdYear/SBIT-3L
DATE: February 23, 2023

Flowchart:
Pseudocode:

1.) Display the Tower of Hanoi Game


2.) Ask the user for a move from the tower a to b or c.
3.) Check user moves if it is valid.
4.) If the user’s move is valid then continue
5.) If the user’s move is violating the rule, then ask the user for a move until it’s valid
6.) Checking if the user solves the disk.
7.) if the user solves the disk, then
8.) Display, you have solved the puzzle! Well done!

Source Code:
QUEZON CITY UNIVERSITY
COLLEGE OF COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
Displaying the game, Tower of Hanoi.
Rules: the big disk can’t be put on top of a smaller
disk.
The user can’t make a move if the chosen tower is
empty, it will ask the user infinitely until they
make a valid move.

You might also like