Try   HackMD

RPS Analysis Rubric

Table of Contents

Notes About Grading (Important)

  • If there are two or more errors in a given step that allocate differing amounts of points with no indication as to how to recocile this, defer to the more egregious error.

    E.g. If someone makes two types of errors in which one awards 2 points and the other awards 1 point, only 1 point should be awarded for this step.

  • If there are novel errors unaddressed by the rubric and there are no other errors to defer to, award HALF of the max number of points possible. If this results in a decimal value, keep the decimal.

    Note: Please make sure to read all parts of the rubric carefully before deferring to this option. For instance, not every example of a possible typo is listed for every step. Please exercise your best judgement when awarding points.

  • If a subject consistently makes a typo in every instance of that variable, the first instance will be penalized a point and all following instances of that typo will be ignored.

    • If a typo is not consistent, i.e. ther are some instances of "opt" and other instances of "options", then all instances of the typo "opt" would result in point dedeuctions.

    In the example below, we see for every instance that should be "options", "opt" is used incorrectly, but consistently instead. So, only the first instance of the typo would be penalized - 1-point would be deducted for the line where opt = ["ROCK", "PAPER", "SCISSORS"]. In all the following instances of "opt", the typo alone would not result in a point deduction.

    ​​​​from random import randint
    ​​​​
    ​​​​opt = ["ROCK", "PAPER", "SCISSORS"]
    ​​​​
    ​​​​message = {
    ​​​​    "tie": "Yawn, it's a tie!", 
    ​​​​    "won": "Yay you won!", 
    ​​​​    "lost": "Aww you lost!"}
    ​​​​
    ​​​​def decide_winner(user_choice, computer_choice):
    ​​​​    print "you selected: %d" % user_choice
    ​​​​    print "computer selected: %d" % computer_choice
    ​​​​    
    ​​​​    if user_choice == computer_choice: 
    ​​​​        print message["tie"]
    ​​​​    elif user_choice == opt[0] and computer_choice == opt[2]:
    ​​​​        print message["won"]
    ​​​​    elif user_choice == opt[1] and computer_choice == opt[0]:
    ​​​​        print message["won"]
    ​​​​    elif user_choice == opt[2] and computer_choice == opt[1]: 
    ​​​​        print message["won"]
    ​​​​    else:
    ​​​​        print message["lost"]
    ​​​​
    ​​​​def play_RPS():
    ​​​​    user_choice = raw_input("Enter Rock, Paper, or Scissors: ")
    ​​​​    user_choice = user_choice.upper()
    ​​​​    computer_choice = opt[randint(0,2)]
    ​​​​    
    ​​​​decide_winner(user_choice, computer_choice)
    ​​​​play_RPS()
    

Rock, Paper, Scissors Intro Instructions

In this project we'll build Rock-Paper-Scissors! The program should do the following:

  1. Prompt the user to select either Rock, Paper, or Scissors.
  2. Instruct the computer to randomly select Rock, Paper, or Scissors.
  3. Compare the user's choice and the computer's choice.
  4. Determine a winner (the user or the computer).
  5. Inform the user who the winner is.

Happy coding!

Scoring

Step 1 - Multi-line comment [3 pts max]

Instructions: Begin by writing a multi-line comment that describes what this program will do.

  • 3 points (max)

    Multi-line comments are bookended by either three double quotations or three single quotations. Either format is fine as long as it is consistent (i.e. you cannot begin with double quotations and close with single quotations).

    ​​​​"""
    ​​​​Rock Paper Scissors Game
    ​​​​This game will allow the user to play rock, paper, scissors with the computer.
    ​​​​"""
    

    or

    ​​​​'''
    ​​​​Rock Paper Scissors Game
    ​​​​This game will allow the user to play rock, paper scissors with the computer.
    ​​​​'''
    
  • 2 points

    • There are multi-line comments but they are all prefaced by hashtags instead of bookended by triple quotations.
    ​​​​# Rock Paper Scissors Game
    ​​​​# This game will allow the user to play rock, paper, scissors with the computer. 
    
  • 1 point

    • There is a single-line comment prefaced by a hastag.
    ​​​​# This game will allow the user to play rock, paper, scissors with the computer.
    
    • There are multi-line comments that are bookended by the incorrect number of quotations.
    ​​​​""Rock Paper Scissors game
    ​​​​This game will allow the user to play rock, paper, scissors with the computer. 
    ​​​​""
    
    • There are multi-line comments that are bookended by inconsistent quotations.
    ​​​​    """
    ​​​​    This game will allow the user to play, rock, paper, scissors with the computer. 
    ​​​​    '''
    ​​​​    """
    
  • 0 points

    • There are no comments included in the code.

Step 2 - Function import

Instructions: Since the computer will select rock, paper, or scissors randomly, we will need the randint function - which is not built-in. Use a function import to import randint from the random module.

  • 3 points (max)

    • Correct code must be in the following order, on one line, with all the components show and nothing else added.
    ​​​​from random import randint
    
  • 2 points

    • All components are in the correct order, but there are minor typos.
    ​​​​from random iport randint
    
    • All components are in the correct order, but there are unnecessary additions like parentheses or brackets.
    ​​​​from random import (randint)
    
  • 1 point

    • All components are included but they are in the incorrect order.
    ​​​​import randint from random
    
    • Only randint is imported with no trace of random.
    ​​​​import randint
    
  • 0 points

    • Only random is mentioned with no traced of randint.
    ​​​​import random
    
    • There is no attempt to import anything.

Step 3 - List creation

Instructions: We've imported the code that we will use later. Let's move on!
Create a list called options and store "ROCK", "PAPER", and "SCISSORS" as strings.

  • 4 points (max)

    • The list with "ROCK", "PAPER", and "SCISSORS" is encased in hard brackets. THe quotations can be either doubled or single quotations as long as they are consistenf for each individual entry (e.g. the list can read: "ROCK", 'PAPER', "SCISSORS", but not "ROCK", "Paper', "SCISSORS"). This list is stored in the variable "options". All of the following components must be included with the list coming after the variable options.
    ​​​​options = ["ROCK", "PAPER", "SCISSORS"]
    

    or

    ​​​​options = ['ROCK', 'PAPER', 'SCISSORS']
    
  • 3 points
    All components are included, with only one of the following errors:

    • A colon (or something else) is used instead of an equal sign.

      ​​​​​​​options: ["ROCK", "PAPER", "SCISSORS"]
      
    • There is a missing comma in the list.

      ​​​​​​​​options = ["ROCK", "PAPER" "SCISSORS"]
      
    • One of the brackets is mistyped (e.g. as a parenthesis or as a squiggly bracket.)

      ​​​​​​​​options = ["ROCK", "PAPER", "SCISSORS")
      
      • There is a missing quotation in the list.
      ​​​​​​​​options = ["ROCK", PAPER", "SCISSORS"]
      
    • An entry is misspelled.

  • 2 points
    All components are included but there are repeated/multiple typos/errors.

    • Anything other than hard brackets are used to encase the list on both ends.
      ​​​​​​​​options = ("ROCK", "PAPER", SCISSORS)
      
    • Combination of various errors listed on the previous slide.
      ​​​​​​​​options: ["ROCK", PAPER", "SCISSORS"]
      
  • 1 point

    • Missing an equal sign, the list is not stored in the variable "options".
      ​​​​​​​​options["ROCK", "PAPER", "SCISSORS"]
      
  • 0 points

    • There are no brackets encasing the list.
      ​​​​​​​​options = "ROCK", "PAPER", "SCISSORS"
      
    • There is no attempt to create a list.

Step 4 - Dictionary creation

Instructions:
The user will either win or lose the game, so the program will need to print win/lose message to the user later. Create a dictionary called message with three key-value pairs:

  • Key "tie" points to value "Yawn it's a tie!"

  • Key "won" points to value "Yay you won!"

  • Key "lost" points to value "Aww you lost!"

  • 4 points (max)
    The dictionary, with all of the messages, is encased in squiggly brackets and stored in the variable "message". All of the following components are included:

    ​​​​message = {"tie": "Yawn it's a tie!", 
    ​​​​​          "won": "Yay you won!", 
    ​​​​​          "lost": "Aww you lost!"}
    
    • The squiggly brackets do NOT have to be on the same line as the beginning/end of the dictionary, as long as everything is correct.

      ​​​​​​​​message = {
      ​​​​​​​​    "tie": "Yawn it's a tie!", 
      ​​​​​​​​    "won": "Yay you won!", 
      ​​​​​​​​    "lost": "Aww you lost!"
      ​​​​​​​​}
      
    • The quotations marks can be either double or single quotations as long as they are consistent. If the coder uses single quotation marks, they must include the backwards slash before the apostrophe in the word "it's". It must read: 'Yawn it\'s a tie!' rather than 'Yawn it's a tie!'.

      ​​​​​​​​ message = {'tie': 'Yawn it\'s a tie!', 
      ​​​​​​​​            'won': 'Yay you won!', 
      ​​​​​​​​            'lost': 'Aww you lost!'}
      
    • The messages can also all be stored on one line as long as they are seperated by commas.

      ​​​​​​​​message = {"tie": "Yawn it's a tie!", "won": "Yay you won!", "lost": "Aww you lost!"}
      
  • 3 points
    All components are included in the correct order with one minor typo/error.

    • A colon (or something else) is used instead of an equal sign after message.

      ​​​​​​​​message : {"tie": "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!"}
      
    • One of the brackets is mistyped (e.g. as a parenthesis or as a hard bracket).

      ​​​​​​​​message = {"tie": "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!")
      
    • There is a missing comma in the list.

      ​​​​​​​​message = {"tie": "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!" 
      ​​​​​​​​           "lost": "Aww you lost!"}
      
    • There is ONE missing quotation in the list.

      ​​​​​​​​message = {"tie": "Yawn it's a tie!", 
      ​​​​​​​​           won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!"}
      
    • Any misspelling of the entry contents - all misspellings are counted as ONE typo/error as long as there are not any other types of errors.

  • 2 points
    All components are included but there are **repeated or multiple **typos/errors.

    • Anything other than squiggly brackets are used to encase the list on both ends.
      ​​​​​​​​message = ("tie": "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!")
      
    • ONE colon is missing or replaced with something else.
      ​​​​​​​​message = {"tie" "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!"}
      
    • Combination of minor errors.
      ​​​​​​​​message : {"tie": "Yawn it's a tie!", 
      ​​​​​​​​           won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!"}
      
    • Missing TWO or MORE quotations (e.g. not quotation marks around tie, won, or lost).
  • 1 point

    • Missing an equal sign after message, i.e. the dictionary is not stored in a variable "message".
      ​​​​​​​​message  {"tie": "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!"}
      
    • TWO or MORE colons in the dictionary are missing or replaced by something else.
      ​​​​​​​​message = {"tie" = "Yawn it's a tie!", 
      ​​​​​​​​           "won" = "Yay you won!", 
      ​​​​​​​​           "lost" = "Aww you lost!"}
      
    • Any sort of unnecessary additions that drastically alters the structure (e.g. putting brackets around every individual entry in the dictionary).
  • 0 points

    • There are no squiggly brackets encasing the dictionary.
      ​​​​​​​​message = "tie": "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!", 
      ​​​​​​​​           "lost": "Aww you lost!"
      
    • ONE or MORE of the keys and/or values are missing.
      ​​​​​​​​message = {"tie": "Yawn it's a tie!", 
      ​​​​​​​​           "won": "Yay you won!", 
      ​​​​​​​​           "lost" }
      
    • User attempts to define the dictionary as a function.
      ​​​​​​​​def message: {
      ​​​​​​​​    "tie": "Yawn it's a tie!", 
      ​​​​​​​​    "won": "Yay you won!",
      ​​​​​​​​    "lost": "Aww you lost!"
      ​​​​​​​​}
      
    • There is no attempt to create a dictionary / missing entirely.

Step 5 - Creating function with parameters

Instructions:
Let's write a function that decides who the winner is.
Create a function called decide_winner. The function should take two parameters: user_choice and computer_choice.

Note: Step 5 only reders to the first line in the example below. The print statements are part of steps 6 and step 7, but are included here to show what part of the decide_winner function will look like, if done correctly. In order to recieve full points for Step 5, all of the components in the highlighted portion must be present and in the correct order.

def decide_winner(user_choice, computer_choice): 
    print "you selected: %s" % user_choice
    print "computer selected: %s" % computer_choice
  • 4 points (max)

  • 3 points
    All components are included in the correct order with one minor typo/error.

    • One of the parantheses is mistyped.
    ​​​​    def decide_winner(user_choice, computer_choice]: 
    
    • There is a semicolon at the end of the statement instead of a colon.
    ​​​​    def decide_winner(user_choice, computer_choice);
    
    • The print statements that follow are not indented (regardless of the content of the print statements).
    ​​​​def decide_winner(user_choice, computer_choice): 
    ​​​​print "you selected: %s" % user_choice
    ​​​​print "computer selected: %s" % computer_choice
    
    • The user defines user_choice and computer_choice using different words.
  • 2 points
    All components are included but there are repeated or multiple typos/errors.

    • Anything other than parentheses are used on both ends.
    ​​​​    def decide_winner[user_choice, computer_choice]:
    
    • Combintion of various minor errors.
    ​​​​    def decide_winner(user_choice, computer_choice];
    
  • 1 point

    • No parameters are included.
    ​​​​    def decide_winner():
    
    • Missing colon at the end.
    ​​​​    def decide_winner(user_choice, computer_choice)
    
    • Adding an equal sign (or any symbol) after decide_winner.
    ​​​​    def decide_winner = (user_choice, computer_choice):
    
  • 0 points

    • Improper defintion of the decide_winner function, missing def at the beginning. If def is missing, the rest of the statement does not matter - the coder automatically receives 0 points.
    • There is no attempt at defining the function / function is missing.

Steps 6 & 7 - String formatting

Instructions:
Step 6:
Let's start building the decide_winner function.
First, print the user_choice, the first parameter, using string formatting.

Step 7:
On the next line, print the computer_choice, the second parameter, using string formatting.

  • 3 points (max)
    Steps 6 & 7 only refer to lines 2 and 3 in the example below. The first line is part of step 5 and included here to show how part of the decide_winner function will look, if done correctly. In order to recieve full points, all of the components must be present and in the correct order.

    ​​​​def decide_winner(user_choice, computer_choice): 
    ​​​​    print "you selected: %s" % user_choice
    ​​​​    print "computer selected: %s" % computer_choice
    
    • "you selected" and "computer selected" do not need to be used for the coder to recieve full credit. They may use alternative tezt, as long as the text makes it clear which print statement is associated with the user's choice and which print statement is associated with the computer's choice.
    ​​​​    print "Your choice: %s" % user_choice
    ​​​​    print "Computer's choice: %s" % computer_choice
    
  • 2 points
    All components are included in the correct order with ONE minor typo/error.

    • Did not include %s inside the quotations.
    ​​​​    print "you selected: %s" % user_choice
    ​​​​    print "computer selected: %s" % computer_choice
    
    • Did not include % between %s and user_choice or computer_choice.
    ​​​​    print "you selected: %s"  user_choice
    ​​​​    print "computer selected: %s" % computer_choice
    
    • Missing user_choice or computer_choice at the end.
    ​​​​    print "you selected: %s" % 
    ​​​​    print "computer selected: %s" % 
    
    • Used a letter other than "s" when typing %s inside the quotations.
    ​​​​    print "you selected: %s" % user_choice
    ​​​​    print "Computer's choice: %d" % computer_choice
    
    • Used return instead of print.
    ​​​​    return "you selected: %s" % user_choice
    ​​​​    return "computer selected: %s" % computer_choice
    
  • 1 point
    There are multiple/repeated minor errors.

    ​​​​    print "you selected:"  user_choice
    ​​​​    print "computer selected:" computer_choice
    

    or

    ​​​​    print "you selected: %s"
    ​​​​    print "computer selected: %s"
    
  • 0 points

    • Coder does not use or attempt the proper string formatting syntax requested by the activity.

      ​​​​​​​​print str(user_choice)
      ​​​​​​​​print str(computer_choice)
      

      or

      ​​​​​​​​print user_choice
      ​​​​​​​​print computer_choice
      
    • There is no attempt to create print statements.


Steps 8-11 - Conditions and List/Dictionary Calls

Note: Because these steps are very intertwined, this rubric separates them by concept rather than explicity step-by-step.

Concepts:

  • If statement - Step 8 [3pts max]
  • Elif statements - Steps 9 & 10 [3pts max]
  • Else statement - Step 11 [2pts max]
  • Dictionary calls - Steps 8-11 [3pts max]
  • List calls - Steps 9 & 10 [3pts max]

if Statement

  • 3 points (max)
    ​​​​if user_choice == computer_choice: 
    
  • 2 points
    All components are included in the correct order with one minor typo/error.
    • The if statement is not aligned with the previous statements.

      ​​​​​​​​print "you selected: %s" % user_choice
      ​​​​​​​​print "computer selected: %s" % computer_choice
      
      ​​​​​​​​    if user_choice == computer_choice:
      
    • Used a single equal sign instead of two.

      ​​​​​​​​if user_choice = computer_choice:
      
    • Used a semicolon at the end instead of a colon.

      ​​​​​​​​if user_choice == computer_choice;
      
    • The print statement that follows is not indented (regardless of the content of the print statement).

      ​​​​​​​​if user_choice == computer_choice: 
      ​​​​​​​​print message["tie"]        
      
    • Used elif instead of if.

      ​​​​​​​​elif user_choice == computer_choice:
      
  • 1 point
    • There is no colon at the end.
      ​​​​​​​​if user_choice == computer_choice
      
    • Combination of minor errors.
      ​​​​​​​​if user_choice = computer_choice;
      
      or
      ​​​​​​​​elif user_choice = computer_choice: 
      
  • 0 points
    • if is not used at the beginning of the statement.
      ​​​​​​​​user_choice == computer_choice:
      
    • There is no attempt to create an if statement.

elif Statement

  • 3 points (max)
    This part of the rubric refers to the highlighted portion only. There should be a total of three elif statements and they are to be graded as a whole. All components in the highlighted area must be included to recieve full credit.

  • 2 points
    All components are included in the correct order with one minor typo/error.

    • elif statements are not aligned with one another.

      ​​​​​​​​elif user_choice == options[0] and computer_choice == options[2]: 
      ​​​​​​​​    print message["won"]
      ​​​​​​​​    elif user_choice == options[1] and computer_choice == options[0]:
      ​​​​​​​​        print message["won"]
      ​​​​​​​​    elif user_choice == options[2] and computer_choice == options[1]:
      ​​​​​​​​        print message["won"]
      
    • Used a single equal sign instead of two.

      ​​​​​​​​elif user_choice = options[0] and computer_choice = options[2]:
      
    • Used a semicolon at the end instead of a colon.

    ​​​​ elif user_choice == options[0] and computer_choice == options[2];
    
    • The print statement that follows is not indented (regardless of the content of the print statement).
    ​​​​elif user_choice == options[0] and computer_choice == options[2]: 
    ​​​​print message["won"]
    
    • Used & instead of and.
    ​​​​elif user_choice == options[0] & computer_choice == options[2]: 
    
    • Used if instead of elif.
    ​​​​if user_choice == options[0] and computer_choice == options[2]: 
    
  • 1 point

    • There is no colon at the end of the statements.
    ​​​​elif user_choice == options[0] and computer_choice == options[2]
    
    • Combination of minor typo/errors.
    ​​​​elif user_choice == options[0] & computer_choice == options[2];
    
    ​​​​if user_choice = options[0] and computer_choice = options[2]: 
    
  • 0 points

    • elif is not at the beginning of one or more of the statements.
    ​​​​user_choice == options[0] and computer_choice == options[2]: 
    
    • One or more of the statements is missing its second condition/component.
    ​​​​ elif user_choice == options[0]: 
    
    • There are NO equal signs AT ALL.
    ​​​​elif user_choice [0] and computer_choice[2]: 
    
    • There is no attempt to create any elif statement, or there are fewer than three elif statements.

else Statements

  • 2 points (max)
    This portion of the rubric refers to the highlighted portion only. All components in the highlighted area must be included to receive full credit.

  • 1 point

    • There is no colon at the end of the statement.

      ​​​​​​​​else
      
    • The print statement that follows is not indented (regardless of the content of the print statement).

      ​​​​​​​​else: 
      ​​​​​​​​print message["lost"]
      
    • The else statement is not aligned eith the elif statements.

      ​​​​​​​​elif user_choice == options[2] and computer_choice == options[1]: 
      ​​​​​​​​​   print message["won"]
      ​​​​​​​​​   else:
      ​​​​​​​​​       print message["lost"]
      
  • 0 points

    • other statements (e.g. elif, if) are used instead of else.
      ​​​​​​​​elif:
      ​​​​​​​​if:
      
    • There is no attempt to create any else statement.

Dictionary Calls

  • 3 points (max)
    This part of the rubric refers to the highlighted portion only. There should be a total of five print statements: the first prints "tie" and is under the if statemeent, the middle three print "won" are under the elif statements, and the last prints "lost" and is under the else statement.

  • 2 points
    All components are included in the correct order with one minor typo/error. These errors can happen in one or all five of the print statements as long as it is the same type of error committed throughout.

    • One of the hard brackets is mistyped (e.g. as a parenthesis or as a squiggly bracket).

      ​​​​​​​​print message["tie")
      
    • One of the quotations is missing or mistyped.

      ​​​​​​​​print message["tie']
      
    • The word "message" or "print" is misspelled.

      ​​​​​​​​print mesage["tie"]
      
    • Used return instead of print.

      ​​​​​​​​return message["tie"]
      
  • 1 point

    • Anything other than hard brackets are used on both ends for one or more of the print statements.

      ​​​​​​​​print message("tie")
      
    • No quotations are used.

      ​​​​​​​​print message[tie]
      
    • Combination of errors listed on the previous slide for one or more of the print statements; inconsistent formatting throughout the print statements.

      ​​​​​​​​print message[tie"]
      ​​​​​​​​print mesage["tie']
      ​​​​​​​​return mesage["tie"]
      
  • 0 points

    • Mismatched keys are called ("tie" should be under the if statement, "won" should be under the elif statements, "lost" should be under the else statement).

    • Incorrect use of dictionary calls, e.g. uses numbers instead.

      ​​​​​​​​print message[0]
      
    • No keys are called within the brackets.

      ​​​​​​​​print message[]
      
    • There is no attempt to use dictionary calls.

List Calls

This part of the rubric refers to the highlighted portions only. There should be a total of six list calls with two in each row of elif statements. These list calls have numbers inside hard brackets that refer back to the nth item in the "options" list that the coder created in step 3 (included below). The first item in the list has an index of 0, the next item has an index of 1, etc. As such, the list calls must call the correct items from the list in order to fulfill the three scenarios that a user might win against the computer (rock[0] > scissors[2], paper[1] > rock[0], scissors[2] > paper[1]). It does not matter which pairings of numbers in which elif statement as in as long as the order of numbers within those airings are not switched around (e.g. you cannot have options[1] first and options[2] second in the same row because paper does not beat scissors.)

  • 3 points (max)

  • 2 points
    All components are included in the correct order (including the correct number of pairings) with one minor typo/error. These errors can happen in one or all of the ist calls as long as it is the same type of error commited throughout.

    • One of the hardbrackets is mistype (e.g. as a parenthesis or as a squiggly bracket).
      ​​​​​​​​elif user_choice == options[0) and computer_choice == option[2):
      ​​​​​​​​    print message["won"]
      
    • Unnecessary additions (e.g. individual quotations).
      ​​​​​​​​elif user_choice == options[1'] and computer_choice == options[0]:
      ​​​​​​​​    print message["won"]
      
    • The word "options" is misspelled.
      ​​​​​​​​elif user_choice == optios[2] and computer_choice == options[1]:
      ​​​​​​​​    print message["won"]
      
  • 1 point

    • Mismatched logic, wrong pairings of numbers within one or more elif statements.
      ​​​​​​​​elif user_choice == options[1] and computer_choice == options[2]:
      ​​​​​​​​    print message["won"]
      
    • One of the list calls in each elif statement uses strings/text instead of the appropriate list call format (e.g. "ROCK" is used instead of options[0]).
      ​​​​​​​​elif user_choice == "PAPER" and computer_choice == options[0]:
      ​​​​​​​​    print message["won"]
      
    • Anything other than hard brackets are used on both ends for one or more of the list calls.
      ​​​​​​​​elif user_choice == options(2) and computer_choice == options(1): 
      ​​​​​​​​    print message["won"]
      
    • Combination of errors listed on the previous slide.
      ​​​​​​​​elif user_choice == optios[0) and computer_choice == optios[2):
      
      ​​​​​​​​elif user_choice == options[1'] and computer_choicee == optios[0]: 
      
  • 0 points

    • Indices used are out of bounds of the list.
      ​​​​​​​​elif user_choice == options[4] and computer_choicee == options[6]:
      
    • Incorrectly uses text/strings inside of the hard brackets instead of numbers.
      ​​​​​​​​elif user_choice == options[ROCK] and computer_choice == options[SCISSORS]:
      
    • Both of the list calls in each elif statement use strings/text instead of the correct list call format, i.e. does not attempt to do list calls.
      ​​​​​​​​elif user_choice == "ROCK" and computer_choice == "SCISSORS":
      
    • There is no attempt to do list calls, this includes not referencing options and only including the indices.
      ​​​​​​​​elif user_choice[0] and computer_choice[2]:
      

Step 12 - Creating Function w/o parameters

Instructions:
Great! We have the function that will decide who the winner is between the user and the computer, but we haven't written a function that actually starts the game. Let's do that now.
Create a new function called play_RPS().

  • 3 points (max)
    This part of the rubric refers to the highlighted portion only. All components in the highlighted area must be included and in the correct order in order to recieve full points. The rest of the code shows what the remaining steps will look like when completed.

Note: all of the lines following the highlighted line must be indented except for the final line play_RPS() in order to receive full points.

  • 2 points
    All components are included in the correct order with one minor typo/error.

    • One of the parentheses is mistyped.
      ​​​​​​​​def play_RPS(]:
      
    • There is a semicolon at the end of the statement instead of a colon.
      ​​​​​​​​def play_RPS();
      
    • The statements that follow (except for play_RPS()) are not indented, regardless of the content of the statements.
      ​​​​​​​​def play_RPS(): 
      ​​​​​​​​user_choice = raw_input("Enter Rock, Paper, or Scissors")
      ​​​​​​​​user_choice = user_choice.upper()
      ​​​​​​​​computer_choice = options[randint(0,2)]
      ​​​​​​​​decide_winner(user_choice, computer_choice)
      
  • 1 point

    • Anything other than parentheses are used on both ends.
      ​​​​​​​​def play_RPS[]:
      
    • Missing colon at the end.
      ​​​​​​​​def play_RPS()
      
    • Combination of minor errors (previously listed).
      ​​​​​​​​def play_RPS(];
      
    • Included parameters.
      ​​​​​​​​def play_RPS(anything included in here is wrong):
      
  • 0 points

    • def is not used (did not properly define the function play_RPS). If def is missing, the rest of the statement does not matter - the coder automatically receives 0 points.
      ​​​​​​​​play_RPS():
      
    • There is no attempt at defining the function.

Step 13 - User Input

Instructions:
Inside the function, we'll have to prompt the user for their selection.
Prompt them with the message: "Enter Rock, Paper, or Scissors:".
Store their input in a variable called user_choice.

  • 3 points (max)
    This part of rubric refers to the highlighted portion only. All components in the highlighted area must be included and in the correct order to recieve full points. The rest of the code shows what the reamining steps will liik like when completed.

    ​​​​user_choice = raw_input("Enter Rock, Paper, or Scissors")
    
  • 2 points
    All components are included in the correct order with one minor typo/error.

    • Parentheses are replaced with something else.
      ​​​​​​​​user_choice = raw_input["Enter Rock, Paper, or Scissors"]
      
    • Quotations are mistyped/missing.
      ​​​​​​​​​   user_choice = raw_input(Enter Rock, Paper, or Scissors)
      
    • Misspellings of words or function.
    ​​​​user_choice = rw_input("Enter Rock, Paper, or Scissors")
    
  • 1 point

    • Missing raw_input() function, however:

      • the attempt at raw_input() is on the same line as the text prompt.
      • the input is stored in the variable user_choice.
      ​​​​​​​​​   user_choice = input("Enter Rock, Paper, or Scissors")
      
    • Combination of one or more minor errors listed previosuly.

  • 0 points

    • Missing raw_input() function and the attempt at raw_input() is not on the same line as the text prompt.

      ​​​​​​​​play_RPS("Enter Rock, Paper, or Scissors")
      ​​​​​​​​play_RPS() = user_choice
      

      or

      ​​​​​​​​play_RPS("Enter Rock, Paper, or Scissors")
      ​​​​​​​​input = user_choice
      
    • Does not store anything in the variable user_choice.

      ​​​​​​​​raw_input("Enter Rock, Paper, or Scissors")
      
    • Entire statement missing.


Step 14 - Converting to Uppercase

Instructions:
Convert the user's choice to uppercase in case they type lowercase rock, paper, or scissors.

  • 3 points (max)
    ​​​​user_choice = user_choice.upper()
    
  • 2 points
    All components are included in the correct order with one minor typo/error.
    • Parentheses are mistyped, e.g. replaced with brackets.
      ​​​​​​​​user_choice = user_choice.upper[]
      
    • Misspelling of words.
      ​​​​​​​​user_choice = usr_choice.upper()
      
  • 1 point
    • Has .upper() at the end of the statement and stores result in a variable called "user_choice", but everything else is incorrect.
      ​​​​​​​​user_choice = input.upper()
      ​​​​​​​​user_choice = user.upper()
      
    • Missing both parentheses after .upper
      ​​​​​​​​user_choice = user_choice.upper
      
    • Combination of one or more minor errors previosuly listed.
  • 0 points
    • .upper() is at the beginning and not the end.
      ​​​​​​​​user_choice = upper().user_choice.
      
    • user_choice is put inside of the parentheses of .upper().
      ​​​​​​​​user_choice = upper(user_choice)
      
    • Does not store anything in the variable user_choice.
      ​​​​​​​​user_choice.upper()
      
    • Entire statement is missing.

Step 15 - Using randint

Instructions:
The computer has to play too! Remember, the computer's choice has to be random, so we'll make use of randint to accomplish that.
Remember, this is how the randint function works: randint(low,high).
On the next line, create a variable called computer_choice. Set the variable equal to an item in options at a random index (0 to 2).

  • 3 points (max)
    Either of the two answers below are correct, but the numbers must be in the order specified in the examples.
    ​​​​computer_choice = options[randint(0,2)]
    
    or
    ​​​​computer_choice = options[randint(0,2,1)]
    
  • 2 points
    All components arre included in the correct order with one minor typo/error.
    • Brackets or parentheses are mistyped.
      ​​​​​​​​computer_choice = options(randint(0,2))
      ​​​​​​​​computer_choice = options[randint[0,2]]
      
    • Misspelling of words.
      ​​​​​​​​computer_choice = options[rndint(0,2)]
      
  • 1 point
    • Has some form of randint and it is stored in a variable called computer_choice, but everything else is incorrect.
      ​​​​​​​​computer_choice = randint(0,2).options
      ​​​​​​​​computer_choice = options.randint(0,2)
      ​​​​​​​​computer_choice = randint(0,2)
      
    • Range of numbers referenced are incorrect (i.e. neither 0,2 nor 0,2,1 - in those orders), but the format of the statement in correct.
      ​​​​​​​​computer_choice = options[randint(0,1,2)]
      ​​​​​​​​computer_choice = options[randint(4,6)]
      ​​​​​​​​computer_choice = options[randint(low,high)]
      
    • Combination of minor errors.
  • 0 points
    • No attempt to use randint, "random" or "rand" are given 0 points.
      ​​​​​​​​computer_choice = options(0,2)
      ​​​​​​​​computer_choice = rand(0,2)
      
    • Does not store anything in the variable computer_choice.
      ​​​​​​​​options[randint(0,2)]
      
    • Entire statement missing.

Step 16 - Calling Function with Arguments

Instructions:
Great! The user has now submitted their choice and the computer has also made a random choice. It's time to determine a winner. Thankfully, we already wrote a function that can do that.
On the next line, call the decide_winner function. Pass in user_choice as the first argument and computer_choice as the second argument.

  • 2 points (max)
    ​​​​decide_winner(user_choice, computer_choice)
    
  • 1 point
    • Does not include arguements (there is nothing inside the parentheses).
      ​​​​​​​​decide_winner()
      
    • Uses anything other than parentheses, e.g. hard brackets or squiggly brackets.
      ​​​​​​​​decide_winner[user_choice, computer_choice]
      
    • Any sort of minor error, e.g. misspellings or adding a colon at the end.
      ​​​​​​​​decide_winner(user_choice, computer_choice):
      ​​​​​​​​decide_winer(user_choice, computer_choice)
      
  • 0 points
    • Only has decide_winner (no attempt to pass arguments or include parentheses).

      ​​​​​​​​decide_winner
      
    • User attempts to define a new function (def is included before decide_winner).

      ​​​​​​​​def decide_winner(user_choice, computer_choice)
      
    • User attempts to return the function.

      ​​​​​​​​return decide_winner(useer_choice, computer_choice)
      
    • If there are combinations of multiple errors previosuly listed, award 0 points.

    • There is no attempt to call the function.


Step 17 - Calling Function without Arguments

Instructions:
Our program won't unless we call the correct function! On the next line, call the play_RPS() function. Make sure it's outside of any other function.

  • 2 points (max)
    • Note: This line must be flushed left with no indent. If the coder indented this line under the def play_RPS(): function along with the other statements from steps 13-17, subtract one point.

      ​​​​​​​​play_RPS()
      
  • 1 point
    • Includes arguments, i.e. anything placed within the parentheses.
      ​​​​​​​​play_RPS(user_choice, computer_choice)
      
    • Uses anything other than parentheses, e.g. hard brackets or squiggly brackets.
      ​​​​​​​​play_RPS[]
      
    • Any sort of minor error, e.g. misspellings or adding a colon at the end.
      ​​​​​​​​ply_RPS()
      ​​​​​​​​play_RPS():
      
  • 0 points
    • Does not include parentheses.
      ​​​​​​​​play_RPS
      
    • User attempts to define a new function (def is included before play_RPS()).
      ​​​​​​​​def play_RPS():
      
    • User attempts to return the function.
      ​​​​​​​​return play_RPS()
      
    • If there are combinations of mulitple errors listed on the previous slide, award 0 points.
    • There is not attempt to call the function.

Marked text
Marked text
Marked text