This is more of a challenge lab than a guided lab. See if you can get the code better, without writing a single line of code yourself. You are only allowed to write queries for GitHub Copilot, until you have the result you want.
Of course, copying and pasting is allowed.
- Explore Copilot in IntelliJ IDEA
- Understand the code
- Simple renaming
- More complex refactors
- Test your code
- Optimize the algorithm
Make sure the plugin for the chat and license are installed and activated. Explore the features, even experiment with the inline generator for a second. You can toggle everything via the GitHub Copilot menu at the bottom.
Also make sure to explore the GitHub Copilot Chat function, as we expect you to use the chat.
Let Copilot explain you the code.
Using the guidelines in the docs folder,
make sure Copilot regenerates better names for both
the Algorithm class and its only field (seed
).
Refactor the current code so it becomes more readable. Copilot should use the Style and Reference guide from the docs folder, to do this refactor. Make sure the refactors follow these guidelines.
Watch out, the code should work the same way. Mind negative numbers.
Let Copilot create the needed tests. And be mindful of how the code right now is written.
Now query for other options for the algorithm, as we have chosen the least optimized version. Let Copilot advise you and implement your choice. Make sure all tests keep running!