Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .instructions/1. setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ OPTIONAL: CodeTour is a **Visual Studio Code extension**, which allows you to pl
1. Navigate to the [Copilot-rock-paper-scissors repo](https://github.com/copilot-workshops/copilot-rock-paper-scissors)
2. Clone this repo to your local machine using your preferred method. You can find options by clicking the Code drop down and clicking on the local tab.

<img alt="URL for cloning is https://github.com/copilot-workshops/copilot-rock-paper-scissors.git" width="400" src="../assets/Cloning the repo.png" />

![Cloning the repo](../assets/Cloning the repo.png)

</details>

Expand Down
28 changes: 14 additions & 14 deletions .instructions/2. core exercises.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ The following exercises will help you get started with GitHub Copilot. You must

1. Ensure you can see the files in the **Explorer view**. If not, click the **Explorer View icon** on the left sidebar of your editor.

<img width="398" alt="Code Explorer View" src="../assets/Code Explorer View.png">


![Code Explorer View](../assets/Code%20Explorer%20View.png)

2. Open the ```main.py``` file if it's not already open in the editor.
3. Let's start by adding the following comment to provide some context for the code we're about to write:
Expand All @@ -24,8 +26,7 @@ The following exercises will help you get started with GitHub Copilot. You must

5. When you press **Enter** after typing the previous comment, GitHub Copilot will suggest some code for you. Select the first suggestion by pressing **TAB** then **Enter** again.


<img width="529" alt="Copilot Suggestion - Import Random" src="../assets/Copilot Suggestion - Import Random.png">
![Copilot Suggestion - Import Random]("../assets/Copilot Suggestion - Import Random.png")

6. Now we're going to prompt GitHub Copilot to suggest code for us by typing the following:

Expand All @@ -35,17 +36,14 @@ The following exercises will help you get started with GitHub Copilot. You must
8. **Pause briefly** while Copilot creates up to 10 suggestions for you. You should see the Copilot icon in the lower right corner of the editor spinning. When Copilot displays the first suggestion, we're going to open the GitHub Copilot suggestion panel by pressing **CTRL + ENTER**.
9. Scroll down the list of suggestions that GitHub Copilot has made and choose the one that looks like the best option for our Rock, Paper, Scissors game. When you see the suggestion you want, click **Accept Solution** to have that code snippet inserted into your code file.

<img width="906" alt="Copilot Suggestion - Accept Solution" src="../assets/Copilot Suggestion - Accept Solution.png">


![Copilot Suggestion - Accept Solution](../assets/Copilot Suggestion - Accept Solution.png)
10. On the line following the last snippet, let's prompt GitHub Copilot to suggest the final line of code for us by typing the following:

```# call main function``` :leftwards_arrow_with_hook:

11. When you press Enter after typing the previous comment, GitHub Copilot will suggest some code for you. Select the first suggestion by pressing TAB then Enter again.

<img width="498" alt="Copilot Suggestion - def main" src="../assets/Copilot Suggestion - def main.png">

![Copilot Suggestion - Call main function]("../assets/Copilot Suggestion - def main.png")

**Now we're ready to see if this code executes** :thumbsup:

Expand All @@ -57,7 +55,8 @@ The following exercises will help you get started with GitHub Copilot. You must

Here's an example of what the completed game might look like.

<img width="645" alt="Running the game" src="../assets/Running the game.png">

![Running the game](../assets/Running%20the%20game.png)

---

Expand All @@ -82,24 +81,25 @@ You're now ready to start the [challenge exercises](<./3. challenge exercises.md

1. Ensure you can see the files in the **Explorer view**. If not, click the **Explorer View icon** on the left sidebar of your editor.

<img width="398" alt="Code Explorer View" src="../assets/Code Explorer View.png">

![Code explorer view](../assets/Code Explorer View.png)

2. At the bottom of the Explorer view panel, click **CodeTour** to expand the CodeTour panel.

<img width="427" alt="Expand CodeTour panel" src="../assets/Expand CodeTour panel.png">
![CodeTour Panel](../assets/Expand%20CodeTour%20anel.png)


3. In the CodeTour panel, press the “**Play button**” to start the tour.

<img width="428" alt="Play the CodeTour" src="../assets/Play the CodeTour.png">
![Play the CodeTour](../assets/CodeTour%20Starting.png)

4. Your CodeTour will begin! Follow the CodeTour’s steps in the main code window to learn how to use GitHub Copilot.

<img width="674" alt="CodeTour Starts" src="../assets/CodeTour Starts.png">
![CodeTour Starts](../assets/CodeTour%20Starts.png")

5. When you've completed each step, click the **Next** button to move to the next step in the CodeTour.

<img width="674" alt="CodeTour Navigation" src="../assets/CodeTour Navigation.png">
![CodeTour Navigation](../assets/CodeTour%20Navigation.png)

6. Work your way through each of the steps in the CodeTour to complete this exercise.

Expand Down
10 changes: 5 additions & 5 deletions .tours/main.tour
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
{
"file": "main.py",
"line": 2,
"description": "Now, let's prompt Copilot to import the `random` module. Add this comment on a new line.\n\n```python\n# import random module\n```\n\n\nPress enter to create a new line and press __TAB__ to accept Copilot's suggestion. \n\n\nPress __Next__ to to get continue 👇"
"description": "Now, let's prompt Copilot to import the `random` module. Add this comment on a new line.\nPress __ENTER__ to create a new line and and click on insert code\n```python\n# import random module\n```\n\nPress __ENTER__ to create a new line \n\nPress now __TAB__ to accept Copilot's suggestion. \n\nPress __Next__ to to get continue 👇"
},
{
"file": "main.py",
"line": 4,
"description": "Now, let's prompt Copilot to create a main function that handles the logic of the game. Enter the following comment to provide context to GitHub Copilot \n\n```python\n# define main function that handles all the logic\n```\n\n\nPress enter to create a new line and __TAB__ to accept Copilot's suggestion. Wait until the Copilot icon stops spinning in the lower right corner of VSCode and you should see another code suggestion.\n\n\n[Open the Copilot suggestions panel](command:github.copilot.generate) and choose the suggestion that seems more appropriate (usually the first).\n\nPress `Next` to to get continue 👇",
"description": "Now, let's prompt Copilot to create a main function that handles the logic of the game. Enter the following comment to provide context to GitHub Copilot \n\nPress ___ENTER to insert a new line\n\nClick insert code\n\n```python\n# define main function that handles all the logic\n```\n\nInsert a newline press __ENTER__\n\n Press __TAB__ to accept Copilot's suggestion. Wait until the Copilot icon stops spinning in the lower right corner of VSCode and you should see another code suggestion.\n\n\n[Open the Copilot suggestions panel](command:github.copilot.generate) and choose the suggestion that seems more appropriate (usually the first).\n\nYou have to click on \"Accept solution\" at the top of the selected solution\n\nPress `Next` to to get continue 👇",
"selection": {
"start": {
"line": 8,
Expand All @@ -34,12 +34,12 @@
{
"file": "main.py",
"line": 64,
"description": "Now, let's prompt Copilot to call the main function. Add the following comment to a new line.\n\n```python\n# call main function\n``` \n\n\nPress enter to create a new line and press __TAB__ to accept Copilot's suggestion. \n\nPress `Next` to to get continue 👇"
"description": "Now, let's prompt Copilot to call the main function. Add the following comment to a new line.\n\n```python\n# call main function\n``` \n\n\nPress __ENTER__ to create a new line and press __TAB__ to accept Copilot's suggestion. \n\nPress `Next` to to get continue 👇"
},
{
"title": "Try it out!",
"description": "Let's run the code to see if it works. Click the follow hyperlink to execute your main.py file. It should start the rock, paper, scissors game. \n\n>> python3 main.py\n\nMission complete! You've used GitHub Copilot to create a rock, paper, scissor game"
"description": "Let's run the code to see if it works. Click the follow hyperlink to execute your main.py file. It should start the rock, paper, scissors game. \n\n>> python main.py\n\nMission complete! You've used GitHub Copilot to create a rock, paper, scissor game"
}
],
"ref": "main"
}
}
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,27 @@

## Build a Rock, Paper, Scissors game from scratch with GitHub Copilot

<img width="400" alt="Rock Paper Scissors image" src="./assets/Rock Paper Scissors image.png">
![Rock Paper Scissors image](./assets/game.jpeg)

In this fun workshop, you will learn how to use GitHub Copilot to build a simple game in Python, with little to no coding experience required.

Estimated time to complete: `10 to 60 minutes`
Estimated time to complete: `10 to 60 minutes` ( depends on the participant's experience and the time available :)

Participants will be guided to install the GitHub Copilot VS Code extension, follow a CodeTour to learn how to interact with GitHub Copilot, and then use GitHub Copilot to build a Rock, Paper, Scissors game from scratch.
Participants will be guided :
- to install the GitHub Copilot VS Code extension
- follow a CodeTour to learn how to interact with GitHub Copilot
- use GitHub Copilot to build a Rock, Paper, Scissors game from scratch.

Depending on the time available, participants will be able to complete the game or just get started, from a simple version all the way to introducing additional logic to make the game more interesting complete, with unit tests and REST API endpoints.
__or__

Launch codespace direcly on yout browser , you don't have to install anything in your laptop.


You will use the CodeTour to learn how to interact with GitHub Copilot and build a Rock, Paper, Scissors game from scratch.

### Time workshop
Depending on the time available, participants will be able to complete the game or just get started,
from a simple version all the way to introducing additional logic to make the game more interesting complete, with unit tests and REST API endpoints.



Expand All @@ -20,15 +32,16 @@ Inside the `.instructions` folder you will find a number of markdown files that

Filename | Description
--- | ---
[1. setup.md](</.instructions/1. setup.md>) | Instructions for installing the GitHub Copilot VS Code extension and joining the GitHub Copilot trial.
[1. setup.md](</.instructions/1. setup.md>) | Instructions for installing the GitHub Copilot VS Code extension and joining the GitHub Copilot trial or launch codespace in browser
[2. core exercises.md](</.instructions/2. core exercises.md>) | Instructions for getting started with GitHub Copilot.
[3. challenge exercises.md](</.instructions/3. challenge exercises.md>) | Challenge exercises for participants to complete.
[4. additional resources.md](</.instructions/4. additional resources.md>) | Additional resources for participants to explore after the workshop.


## Running a workshop?

If you're planning to run a GitHub Copilot workshop, please review the [workshop guide](</.instructions/workshop organisers.md>) for tips and tricks to help you run a successful workshop.
If you're planning to run a GitHub Copilot workshop,
Please review the [workshop guide](</.instructions/workshop organisers.md>) for tips and tricks to help you run a successful workshop.


## Project Structure
Expand All @@ -40,9 +53,8 @@ In this project you will find:
* an `.instructions` folder all the instructions for this workshop.
* an `assets` folder containing images used in this workshop documentation.
* a `.tours` folder that includes the CodeTour file if you wish to use it.



* a `python` notebook to experiment with GitHub Copilot in Jupyter notebook (optional) ( inside [notebook](dalle-3/rockdalle3.ipynb) folder)
- a `dalle-3` folder that includes a notebook python to experiment AzureopneAi / dalle3 in context wit the game rock paper scissors (optional) ( inside [notebook](dalle-3/rockdalle3.ipynb) folder)

## FAQ

Expand All @@ -55,10 +67,6 @@ In this project you will find:

## Acknowledgements

A special thanks to the following awesome Hubbers who have contributed in many different ways to our workshops.
[blackgirlbytes](https://github.com/blackgirlbytes), [pierluigi](https://github.com/pierluigi), [yuichielectric](https://github.com/yuichielectric), [dchomh](https://github.com/dchomh), [nolecram](https://github.com/nolecram), [rsymo](https://github.com/rsymo), [damovisa](https://github.com/damovisa) and anyone else I've inadvertently missed.

Enjoy your workshop!
[anthonyborton](https://github.com/anthonyborton)
Fork from this repository

_v1.0 Released May, 2023_
_v1.1 Released May, 2023_ updated February
Binary file removed assets/Rock Paper Scissors image.png
Binary file not shown.
Binary file added assets/game.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/models.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions dalle-3/azure.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Azure Open AI
OPENAI_API_BASE = "tobecompleted"
OPENAI_API_KEY = "tobecompleted"

# Azure Computer Vision
AZURE_CV_ENDPOINT = "tobecompleted"
AZURE_CV_API_KEY = "tobecompleted"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading