# RPS Analysis Rubric ## Table of Contents * Notes About Grading (Please Read) * Rock, Paper, Scissors Intro Instructions * [Step 1](#step1) [3 pts] * [Step 2](#step2) [3 pts] * [Step 3](#step3) [4 pts] * [Step 4](#step4) [4 pts] * [Step 5](#step5) [4 pts] * [Steps 6 & 7](#steps6and7) [3 pts, graded together] * Steps 8-11 * [If statement](#ifstatement) [3 pts] * [Elif statements](#elifstatement) [3 pts] * [Else statement](#elsestatement) [2 pts] * [Dictionary calls](#dictionarycalls) [3 pts] * [List calls](#listcalls) [3 pts] * [Step 12](#step12) [3 pts] * [Step 13](#step13) [3 pts] * [Step 14](#step14) [3 pts] * [Step 15](#step15) [3 pts] * [Step 16](#step16) [2 pts] * [Step 17](#step17) [2 pts] ## 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. ``` python 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 <div id='step1'/> ### 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). ``` python """ Rock Paper Scissors Game This game will allow the user to play rock, paper, scissors with the computer. """ ``` or ``` python ''' 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. ``` python # 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. ```python # 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. ```python ""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. ```python """ This game will allow the user to play, rock, paper, scissors with the computer. ''' """ ``` * ***0 points*** * There are no comments included in the code. --- <div id='step2'/> ### 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. ```python from random import randint ``` * ***2 points*** * All components are in the correct order, but there are minor typos. ```python from random iport randint ``` * All components are in the correct order, but there are unnecessary additions like parentheses or brackets. ```python from random import (randint) ``` * ***1 point*** * All components are included but they are in the *incorrect order*. ```python import randint from random ``` * Only `randint` is imported with no trace of `random`. ```python import randint ``` * ***0 points*** * Only `random` is mentioned with no traced of randint. ```python import random ``` * There is no attempt to import anything. --- <div id='step3'/> ### 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. ```python options = ["ROCK", "PAPER", "SCISSORS"] ``` or ```python 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. ```python options: ["ROCK", "PAPER", "SCISSORS"] ``` * There is a missing comma in the list. ```python options = ["ROCK", "PAPER" "SCISSORS"] ``` * One of the brackets is mistyped (e.g. as a parenthesis or as a squiggly bracket.) ```python options = ["ROCK", "PAPER", "SCISSORS") ``` * There is a missing quotation in the list. ```python 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. ```python options = ("ROCK", "PAPER", SCISSORS) ``` * Combination of various errors listed on the previous slide. ```python options: ["ROCK", PAPER", "SCISSORS"] ``` * ***1 point*** * Missing an equal sign, the list is not stored in the variable "options". ```python options["ROCK", "PAPER", "SCISSORS"] ``` * ***0 points*** * There are no brackets encasing the list. ```python options = "ROCK", "PAPER", "SCISSORS" ``` * There is no attempt to create a list. --- <div id='step4'/> ### 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: ```python 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. ```python 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!'`. ```python 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. ```python 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```. ```python 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). ```python message = {"tie": "Yawn it's a tie!", "won": "Yay you won!", "lost": "Aww you lost!") ``` * There is a missing comma in the list. ```python message = {"tie": "Yawn it's a tie!", "won": "Yay you won!" "lost": "Aww you lost!"} ``` * There is ONE missing quotation in the list. ```python 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. ```python message = ("tie": "Yawn it's a tie!", "won": "Yay you won!", "lost": "Aww you lost!") ``` * ONE colon is missing or replaced with something else. ```python message = {"tie" "Yawn it's a tie!", "won": "Yay you won!", "lost": "Aww you lost!"} ``` * Combination of minor errors. ```python 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". ```python 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. ```python 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. ```python 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. ```python message = {"tie": "Yawn it's a tie!", "won": "Yay you won!", "lost" } ``` * User attempts to define the dictionary as a function. ```python 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. --- <div id='step5'/> ### 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. ```python 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. ```python def decide_winner(user_choice, computer_choice]: ``` * There is a semicolon at the end of the statement instead of a colon. ```python def decide_winner(user_choice, computer_choice); ``` * The ```print``` statements that follow are not indented (regardless of the content of the print statements). ```python 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. ```python def decide_winner[user_choice, computer_choice]: ``` * Combintion of various minor errors. ```python def decide_winner(user_choice, computer_choice]; ``` * ***1 point*** * No parameters are included. ```python def decide_winner(): ``` * Missing colon at the end. ```python def decide_winner(user_choice, computer_choice) ``` * Adding an equal sign (or any symbol) after ```decide_winner```. ```python 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. --- <div id='steps6and7'/> ### 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. ```python 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. ```python 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. ```python print "you selected: %s" % user_choice print "computer selected: %s" % computer_choice ``` * Did not include ```%``` between ```%s``` and ```user_choice``` or ```computer_choice```. ```python print "you selected: %s" user_choice print "computer selected: %s" % computer_choice ``` * Missing ```user_choice``` or ```computer_choice``` at the end. ```python print "you selected: %s" % print "computer selected: %s" % ``` * Used a letter other than "s" when typing ```%s``` inside the quotations. ```python print "you selected: %s" % user_choice print "Computer's choice: %d" % computer_choice ``` * Used ```return``` instead of ```print```. ```python return "you selected: %s" % user_choice return "computer selected: %s" % computer_choice ``` * ***1 point*** There are multiple/repeated minor errors. ```python print "you selected:" user_choice print "computer selected:" computer_choice ``` or ```python 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. ```python print str(user_choice) print str(computer_choice) ``` or ```python print user_choice print computer_choice ``` * There is no attempt to create print statements. --- <div id='steps8-11'/> ### 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 <div id='ifstatement'/> * ***3 points (max)*** ```python 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. ```python 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. ```python if user_choice = computer_choice: ``` * Used a semicolon at the end instead of a colon. ```python if user_choice == computer_choice; ``` * The ```print``` statement that follows is not indented (regardless of the content of the print statement). ```python if user_choice == computer_choice: print message["tie"] ``` * Used ```elif``` instead of ```if```. ```python elif user_choice == computer_choice: ``` * ***1 point*** * There is no colon at the end. ```python if user_choice == computer_choice ``` * Combination of minor errors. ```python if user_choice = computer_choice; ``` or ```python elif user_choice = computer_choice: ``` * ***0 points*** * ```if``` is not used at the beginning of the statement. ```python user_choice == computer_choice: ``` * There is no attempt to create an ```if``` statement. #### ```elif``` Statement <div id='elifstatement'/> * ***3 points (max)*** This part of the rubric refers to the <span style="background-color: #FFFACD">highlighted</span> 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. ![](https://i.imgur.com/xFXvCOw.png) * ***2 points*** All components are included in the correct order with *one* minor typo/error. * ```elif``` statements are not aligned with one another. ```python 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. ```python elif user_choice = options[0] and computer_choice = options[2]: ``` * Used a semicolon at the end instead of a colon. ```python 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). ```python elif user_choice == options[0] and computer_choice == options[2]: print message["won"] ``` * Used ```&``` instead of ```and```. ```python elif user_choice == options[0] & computer_choice == options[2]: ``` * Used ```if``` instead of ```elif```. ```python if user_choice == options[0] and computer_choice == options[2]: ``` * ***1 point*** * There is no colon at the end of the statements. ```python elif user_choice == options[0] and computer_choice == options[2] ``` * Combination of minor typo/errors. ```python 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. ```python user_choice == options[0] and computer_choice == options[2]: ``` * One or more of the statements is missing its second condition/component. ```python elif user_choice == options[0]: ``` * There are NO equal signs AT ALL. ```python 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. <div id='elsestatement'/> #### ```else``` Statements * ***2 points (max)*** This portion of the rubric refers to the <span style="background-color: #FFFACD">highlighted</span> portion only. All components in the highlighted area must be included to receive full credit. ![](https://i.imgur.com/9GdMDrN.png) * ***1 point*** * There is no colon at the end of the statement. ```python else ``` * The ```print``` statement that follows is not indented (regardless of the content of the ```print``` statement). ```python else: print message["lost"] ``` * The ```else``` statement is not aligned eith the ```elif``` statements. ```python 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```. ```python elif: if: ``` * There is no attempt to create any ```else``` statement. <div id='dictionarycalls'/> #### Dictionary Calls * ***3 points (max)*** This part of the rubric refers to the <span style="background-color: #FFFACD">highlighted</span> 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. ![](https://i.imgur.com/0Q7oEWE.png) * ***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). ```python print message["tie") ``` * One of the quotations is missing or mistyped. ```python print message["tie'] ``` * The word "message" or "print" is misspelled. ```python print mesage["tie"] ``` * Used ```return``` instead of ```print```. ```python return message["tie"] ``` * ***1 point*** * Anything other than hard brackets are used on *both* ends for one or more of the ```print``` statements. ```python print message("tie") ``` * No quotations are used. ```python 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. ```python 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). ![](https://i.imgur.com/eYTGFHW.png) * Incorrect use of dictionary calls, e.g. uses numbers instead. ```python print message[0] ``` * No keys are called within the brackets. ```python print message[] ``` * There is no attempt to use dictionary calls. #### List Calls <div id='listcalls'/> This part of the rubric refers to the <span style="background-color: #FFFACD">highlighted</span> 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 *n*th 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.) ![](https://i.imgur.com/4zYpVAp.png) * ***3 points (max)*** ![](https://i.imgur.com/4Bs2aU9.png) * ***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). ```python elif user_choice == options[0) and computer_choice == option[2): print message["won"] ``` * Unnecessary additions (e.g. individual quotations). ```python elif user_choice == options[1'] and computer_choice == options[0]: print message["won"] ``` * The word "options" is misspelled. ```python 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. ```python 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]). ```python 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. ```python elif user_choice == options(2) and computer_choice == options(1): print message["won"] ``` * Combination of errors listed on the previous slide. ```python 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. ```python elif user_choice == options[4] and computer_choicee == options[6]: ``` * Incorrectly uses text/strings inside of the hard brackets instead of numbers. ```python 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. ```python 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*. ```python elif user_choice[0] and computer_choice[2]: ``` --- <div id='step12'/> ### 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 <span style="background-color: #FFFACD">highlighted</span> 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. ![](https://i.imgur.com/Flbafgd.png) 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. ```python def play_RPS(]: ``` * There is a semicolon at the end of the statement instead of a colon. ```python def play_RPS(); ``` * The statements that follow (except for ```play_RPS()```) are not indented, regardless of the content of the statements. ```python 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. ```python def play_RPS[]: ``` * Missing colon at the end. ```python def play_RPS() ``` * Combination of minor errors (previously listed). ```python def play_RPS(]; ``` * Included parameters. ```python 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. ```python play_RPS(): ``` * There is no attempt at defining the function. --- <div id='step13'/> ### 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```. ![](https://i.imgur.com/NiRAVhz.png) * ***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. ```python 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. ```python user_choice = raw_input["Enter Rock, Paper, or Scissors"] ``` * Quotations are mistyped/missing. ```python user_choice = raw_input(Enter Rock, Paper, or Scissors) ``` * Misspellings of words or function. ```python 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. ```python 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. ```python play_RPS("Enter Rock, Paper, or Scissors") play_RPS() = user_choice ``` or ```python play_RPS("Enter Rock, Paper, or Scissors") input = user_choice ``` * Does not store anything in the variable ```user_choice```. ```python raw_input("Enter Rock, Paper, or Scissors") ``` * Entire statement missing. --- <div id='step14'/> ### 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)*** ```python 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. ```python user_choice = user_choice.upper[] ``` * Misspelling of words. ```python 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. ```python user_choice = input.upper() user_choice = user.upper() ``` * Missing *both* parentheses after ```.upper``` ```python 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. ```python user_choice = upper().user_choice. ``` * ```user_choice``` is put inside of the parentheses of ```.upper()```. ```python user_choice = upper(user_choice) ``` * Does not store anything in the variable ```user_choice```. ```python user_choice.upper() ``` * Entire statement is missing. --- <div id='step15'/> ### 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. ```python computer_choice = options[randint(0,2)] ``` or ```python 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. ```python computer_choice = options(randint(0,2)) computer_choice = options[randint[0,2]] ``` * Misspelling of words. ```python 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. ```python 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. ```python 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. ```python computer_choice = options(0,2) computer_choice = rand(0,2) ``` * Does not store anything in the variable ```computer_choice```. ```python options[randint(0,2)] ``` * Entire statement missing. --- <div id='step16'/> ### 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)*** ```python decide_winner(user_choice, computer_choice) ``` * ***1 point*** * Does not include arguements (there is nothing inside the parentheses). ```python decide_winner() ``` * Uses anything other than parentheses, e.g. hard brackets or squiggly brackets. ```python decide_winner[user_choice, computer_choice] ``` * Any sort of minor error, e.g. misspellings or adding a colon at the end. ```python 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). ```python decide_winner ``` * User attempts to define a new function (```def``` is included before ```decide_winner```). ```python def decide_winner(user_choice, computer_choice) ``` * User attempts to return the function. ```python 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. --- <div id='step17'/> ### 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. ```python play_RPS() ``` * ***1 point*** * Includes arguments, i.e. anything placed within the parentheses. ```python play_RPS(user_choice, computer_choice) ``` * Uses anything other than parentheses, e.g. hard brackets or squiggly brackets. ```python play_RPS[] ``` * Any sort of minor error, e.g. misspellings or adding a colon at the end. ```python ply_RPS() play_RPS(): ``` * ***0 points*** * Does not include parentheses. ```python play_RPS ``` * User attempts to define a new function (```def``` is included before ```play_RPS()```). ```python def play_RPS(): ``` * User attempts to return the function. ```python 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. <mark style = "background-color: orange">Marked text</mark> <span style="background-color: #FFFACD ">Marked text</span> <span style="background-color: pale yellow">Marked text</span>