Assignments

Rock, Paper, Scissors, Code!

Introduce students to the fundamentals of Python programming through a text-based rock, paper, scissors game, using ChatGPT as a code evaluation tool to find the edge cases of their program.

Learning Objectives

  • Reflect on the effectiveness of using ChatGPT as a tool for improving code reliability

Prerequisites

Students should have an understanding of variables, inputs, edge cases, if statements, and Python’s random library before attempting this assignment.

Instructions

  1. Write a Python program that lets the user play a game of rock, paper, scissors. The program must accept user input, randomize the computer’s response, and print the result of the match.
  2. Input your code into ChatGPT and ask it to identify the program’s edge cases (i.e., points of possible failure in your code or user inputs that could return an error and break the program).
  3. Assess ChatGPT’s response and determine if there are any edge cases ChatGPT missed. Write out your own list of possible edge case inputs that could break your program. 
  4. Fix any edge cases identified through this process and test them against the edge cases you and ChatGPT found. 
  5. Submit the original program, ChatGPT’s response, your list of edge case inputs, and the final file with implemented fixes.
  6. Written reflection (200 words): Reflect on the effectiveness of ChatGPT as a tool for improving the reliability of your program. What aspects of coding did ChatGPT excel at, and where did it fall short?

Using This Assignment

This assignment is licensed under the Creative Commons BY-NC-SA 4.0 license. Learn more about what this license means, what you can and cannot do with this assignment, and how to properly attribute on our Using Our Content page.

Suggested Citation

Sebastian Rodriguez. Rock, Paper, Scissors, Code!. AI Pedagogy Project. https://aipedagogy.org/assignment/rock-paper-scissors-code/. Licensed under Creative Commons BY-NC-SA 4.0.

Related Assignments