The Legendary Duel of Stonevale
In the mystical realm of Stonevale, two warriors, Rok and Papyra, are chosen for a duel that determines the fate of their tribes for the next century. The arena, known as Scissoria, is where each move carries weight and consequences.
Your task is to simulate the duel between Rok and Papyra. Each warrior makes a series of moves, and each move has a specific outcome. To win the duel, a warrior must accumulate the highest score over a series of rounds.
- Moves and Points:
- Each warrior can make one of three moves: rock, paper, or scissors.
- A rock win = 1 point
- A paper win = 2 points
- A scissors win = 3 points
- Duel Dynamics:
- When both warriors choose the same move, it’s a draw, and no points are awarded.
- Rock crushes scissors, paper covers rock, and scissors cut paper.
- Points are awarded based on the winning move.
- The duel consists of 5 rounds.
- The goal is to accumulate the highest score over these rounds to win the duel.
Moves for Rok (Player 1)
Moves for Paprya (Player 2)
- Advanced Features (if time permits):
- Implement a hint system that suggests a move to the player.
- Players can select their move for each round rather than it being automated.
- Write the simulation using GitHub Copilot and any language you choose. Try learning a new language if you’re up for the challenge!
- Ensure efficient algorithms to handle the duel dynamics. Ask GitHub Copilot/Chat, “How can I make this code more readable and maintainable?”.
- Providing a graphical user interface for the simulation is optional.
Summary of High-Level Tasks to Perform
- Use a console application to render the output.
- Initialize scores for both warriors.
- Each warrior selects a move for each round.
- Determine the winner of each round and award the points.
- Tally the scores after 5 rounds.
- Declare the overall winner of the duel.
Tips to Get Started
- If you’re using a GitHub Codespace, you’re ready to go!
- If running locally, ensure that you have your target language/framework installed.
- Create a folder for your code.
stonevale and add a file named
- Python: Create a folder called
stonevale and add a file named
- C#: Create a folder called
stonevale and run
dotnet new console.
GitHub Copilot Tips
Use Copilot to improve efficiency
See if you can use Copilot to find out the complexity (BigO notation) of the code.
Open the GitHub Copilot Chat view in the sidebar if it’s not already open. Make sure your solution file is still open as well.
Ask Copilot Chat what the complexity of the code is.
Ask Copilot Chat to make the code more efficient.
Ask for the complexity again - is it better?
Highlight all of the code with Ctrl/Cmd+A.
Press Ctrl/Cmd+I to open the inline chat.
Ask Copilot Chat to document the function.
Use Copilot to simplify your code
Open GitHub Copilot Chat in the sidebar.
Type “/simplify” and press Enter. You can also add any text you want after the “/simplify” to give Copilot more instructions.
What did Copilot Chat suggest you do to make it simpler?
Copilot Chat can help with that too! Just copy the error message and paste it into Chat. Often that’s all Copilot needs to resolve your issue.