Challenge 01 - Introduction to GitHub Copilot
< Previous Challenge - Home - Next Challenge >
Pre-requisites
Ensure that GitHub Copilot is installed in your IDE as part of Challenge 0. This challenge assumes that you have Copilot ready and functioning in your IDE.
Introduction
Now that you’ve installed GitHub Copilot, it’s time to delve into its capabilities. In this challenge, you’ll write your first program with the help of Copilot and explore how it can assist you in this task. We recommend considering taking one of two approaches when selecting the language you will be using:
- Working with a Familiar Language: Opt for a programming language you’re already comfortable with to directly experience how GitHub Copilot can boost your development speed and efficiency. This choice allows you to focus on Copilot’s ability to enhance your existing coding skills and streamline tasks you’re accustomed to.
- Exploring a New Language: Choose a programming language you’re less familiar with, or entirely new to you, to explore how GitHub Copilot can facilitate your learning process and ease the transition into unfamiliar coding territories.
Description
The aim is to construct a “Whack-a-Mole” game and see how Copilot can help you on this journey. As you progress, focus on how Copilot:
- Boosts Productivity: Observe how Copilot accelerates your development process, especially in crafting boilerplate code, or setting up project structures.
- Understanding Contextual Sensitivity: Pay close attention to how context influences Copilot’s behavior, whether it be your coding style, the changes you make, and the context you provide. See how its suggestions evolve based on your interactions.
- Interaction Flexibility: Explore different ways to interact with Copilot. Whether it’s accepting, modifying, or rejecting its suggestions, discover how each interaction molds the development experience.
- Refining Suggestions: Learn to effectively modify Copilot’s suggestions. See how it responds to your changes and note how it aligns its subsequent suggestions with your coding style and preferences.
This challenge invites you to engage with Copilot’s recommendations actively, integrating the ones that elevate your project while critically evaluating its limitations. Feel free to include additional features to interact with Copilot in different ways.
Whack-a-Mole Game Requirements:
- Create a game board where moles will appear.
- Implement logic to randomly display moles in the grid at set intervals.
- Allow players to “whack” moles by selecting them, increasing their score for each successful hit.
- Display the current score prominently on the game screen.
- Implement a timer that defines the duration of each game session.
Success Criteria
You have successfully completed this challenge when you can:
- The “Whack-a-Mole” game functions correctly, displaying moles and allowing the user to whack them, with a working score counter.
- You can describe how GitHub Copilot assisted in the development process, providing specific examples of its contributions.
- Show the different ways you interacted with GitHub Copilot, demonstrating at least 3 different interaction styles.
- Explain the strategies you used to leverage Copilot, highlighting how your inputs and modifications steered its suggestions.
Learning Resources
Tips
- Take note of how Copilot’s suggestions can vary greatly depending on the context of your code and the specific language syntax.
- If Copilot’s suggestions don’t immediately align with your expectations, experiment with adjusting your code or comments to give it better context.
- Remember, Copilot is a tool to aid your coding, not to replace the need for understanding the code itself. Use this opportunity to learn and understand the suggestions it provides.
Advanced Challenges (Optional)
Looking for an Extra Challenge?: Consider switching gears for a broader experience. If your initial approach involved using a language you know well, try completing this challenge in one that is less familiar. Conversely, if you started with a language that was new to you, circle back and see the difference in speed when using GitHub Copilot with a language you’re proficient in.