Skip to content

Fun little CoPilot lab creating a rock paper scissor lab++

Notifications You must be signed in to change notification settings

jnus/github-copilot-lab-rock-paper-scissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

GitHub CoPilot Rock-Paper-Scissor-Lizard-Spock lab

Creating a simple Rock, Paper, Scissors Game

Welcome to GitHub Copilot!

For this first dive, we will take a look at a very familiar game and see if we can leverage GitHub Copilot to help us create all the functioning code necessary to setup Rock, Paper, Scissors with a little twist. This is a cli game and use any scripting language of your choice e.g. python, bash, pwsh etc.

image

Prerequisites

  • CoPilot license

Objectives of the game

  1. Create a terminal rock paper scissor game for 2 players: computer and user
  2. Let the game continue until the user wants to quit
  3. Add a leader board that sums up the score
  4. Refactor and optimize. Keep it DRY
  5. See if you can refactor and add unit tests to some of the logic
  6. Add lizard and Spock choices as well.
  7. Add the option to input emoji icons as input as well. Hint: image

Getting started (at least if you are doing it in python)

  1. Let's start with giving GitHub Copilot some context about what we're building. Write this comment # Write a rock, paper, scissors, game at the top of your main.py file.
  2. Now, let's prompt Copilot to import the random module. Write this comment # import random module on the next line. You will probably need this module! Press enter to create a new line and accept Copilot's suggestion.
  3. From this point one, craft a prompt to define the main function with all the logic and call the main function. Use either inline CoPilot or CoPilot chat to add feature based on the objectives in an iterative manner, step by step. Don't worry if you do not know python and use CoPilot to learn.
  4. Good luck!

You need hints?

In case you get stuck, have a look at this workshop repository. There are more instructions on how to progress and even a codetour and a codespace with python installed. https://github.com/copilot-workshops/copilot-rock-paper-scissors

About

Fun little CoPilot lab creating a rock paper scissor lab++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages