Giter VIP home page Giter VIP logo

rock-paper-scissors-copilot-react's Introduction

Build a Rock, Paper, Scissors Game with GitHub Copilot

Description

This is a self-guided tutorial to help folks learn how to use GitHub Copilot. In this project you will find:

  • a main.py file with no contents
  • a devcontainer that installs CodeTour and GitHub Copilot when the Codespace is created
  • a CodeTour to guide the developer through using GitHub Copilot to develop a rock, paper, scissors game.

To complete this tutorial, you will need:

How does this work?

The CodeTour prompts developers to write comments and lines of code that trigger GitHub Copilot to generate code to create a rock, paper, scissors game.

How to use the guided CodeTour

  1. Choose 'Use this template', and 'Open in a codespace'

Open in a codespace image

  1. Choose the “Explorer Icon” on the left sidebar of your editor.

Highlighting the Explorer Icon

  1. Toggle the CodeTour panel

Highlighting the Code Tour panel

  1. Press the “Play button” to start the tour.

Highlighting the Play button

  1. Your CodeTour will begin! Follow the CodeTour’s steps to learn how to use GitHub Copilot.

Highlighting the start of a CodeTour

Your CodeTour will take you through the following steps

  1. Introduction: Hi there! this is a guided tour to help you learn GitHub Copilot. We will build a rock, paper, scissors game with Python.

  2. Let's give 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.

Write a rock paper scissors game comment

Now, let's prompt Copilot to import the random module. Write this comment # import random module on the next line. Press enter to create a new line and accept Copilot's suggestion.

Screen Shot 2023-03-03 at 6 58 46 AM

  1. Now, let's prompt Copilot to create a main function that handles the logic of the game with a comment that says # define main function that handles all the logic. Press enter to create a new line and accept Copilot's suggestion.

define main function

  1. Now, let's prompt Copilot to call the main function. Write this comment # call main function on the next line. Press enter to create a new line and accept Copilot's suggestion.

Call main function

  1. Try it out! Let's run the code to see if it works. In your terminal, run python3 main.py. It should start the rock, paper, scissors game. Mission complete! You've used GitHub Copilot to create a rock, paper, scissors game in Python!

Playing the game in the terminal

rock-paper-scissors-copilot-react's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.