BSCS 2-B these are the activities given to us by our instructors.
Pair: Jude Melvin B. Grutas Arjay V. Begino
Title: Adventurer's Guild: Battle of Power
Theme: You are the leader of a renowned adventurer's guild. Your mission is to manage your team of warriors based on their power levels using heap operations. Recruit powerful adventurers, send the strongest into battle, and reorganize your team with fresh recruits from the guild. Keep your party strong and ready for any challenge!
Tasks: Recruit a New Adventurer
Insert a new adventurer with a given power level into the Max-Heap and display the updated party. Learning Goal: Practice maintaining a Max-Heap structure during insertions. Send the Strongest Adventurer to Battle
Remove the root of the Max-Heap (the strongest adventurer) and reorganize the heap to maintain its properties. Learning Goal: Understand how deletion works in heaps and how to restore the heap property. Recruit Random Adventurers and Organize Them
Generate a random list of adventurers with varying power levels, apply the heapify operation to organize them into a Max-Heap, and replace your current party. Learning Goal: Experience how random data can be converted into a structured Max-Heap using the heapify algorithm. View Your Current Party (Optional, Auxiliary Task)
Display the current state of the heap to visualize the structure and hierarchy of your adventurers. Learning Goal: Reinforce the concept of a Max-Heap by examining its properties in real-time.
INSTRUCTIONS:
- Recruit a New Adventurer (Insert) What It Does: Adds a new adventurer to your guild with the power level you specify. The program ensures that the adventurer fits into the party while maintaining the Max-Heap property.
How to Play:
Enter a number representing the power level of the adventurer (e.g., 75). The new adventurer will join your party, and the program will display the updated team. 2. Send the Strongest Adventurer to Battle (Remove) What It Does: Removes the most powerful adventurer (root of the Max-Heap) from the party. This represents sending the strongest warrior to a heroic mission or battle.
How to Play:
Select this option, and the program will automatically remove the strongest adventurer. The heap will reorganize itself to maintain the Max-Heap property. 3. View Your Current Party What It Does: Displays the current Max-Heap structure, showing all the adventurers' power levels in the team.
How to Play:
Simply select this option to see your party. This helps you strategize and keep track of your team's composition. 4. Recruit Random Adventurers and Organize Them (Heapify) What It Does: Recruits five random adventurers with randomly generated power levels and organizes them into a Max-Heap. This replaces your existing team with the new recruits.
How to Play:
Select this option, and the program will automatically generate and display the new team. 5. Exit Game What It Does: Ends the game session.
How to Play:
Choose this option when you're ready to stop playing. The program will display a goodbye message and terminate.