Parameters and Return Make
Name(s)_______________________________________________ Period ______ Date ___________________
Activity Guide - Parameters and Return Make |
Step 1 - Try the app
Try playing the game. Pay attention to:
Step 2 - Plan
This Make project is a little different than other ones. Instead of writing all of the code yourself, most of it has already been written for you. There are just three functions at the bottom that have been designed and have comments explaining how they should work but the code for each function is incomplete or only works for some inputs. Read the comments for these three functions carefully. You can also quickly read the rest of the program if you like.
In the table below record any notes for how you will build each function
Notes for Building this Function | |
findIcon() | The icons were already displayed at the top. We coded for every time the specific icon was pressed the right picture would come up. The varIcons was in a list. In our code, every icon had a specific number in that list and that's why we used icons [0] and so on. |
randomChoose() | We used a random list access pattern so that the computer will randomly choose an item in this case being rock, paper, or scissors. |
decideWinner() | Make an if else statement to show when the player chooses one icon that whatever icon the computer has will either win or lose. If neither the computer or user wins then it will display it as a draw. |
Step 3 - Write Your Code
Step 4 - Submit
Before your submit check the rubric below to make sure your program
Category | Extensive Evidence | Convincing Evidence | Limited Evidence | No Evidence |
findIcon Function | The function returns the correct values for all input values. | The function returns the correct values for most input values. | The function returns the correct values for some input values. | The function does not return correct values for any input values. |
randomChoose Function | The function returns the correct values for all input values. | The function returns the correct values for most input values. | The function returns the correct values for some input values. | The function does not return correct values for any input values. |
decideWinner Function | The function returns the correct values for all combinations of inputs. | The function returns the correct values for most combinations of inputs. | The function returns the correct values for some combination of inputs. | The function does not return correct values for any combination of inputs |
Code runs without errors. | No errors are present in the required code. | Some errors are present in the required code. | Many errors are present in the required code. | The code does not run. |
Coding Comments | Comments are used to correctly explain the purpose and functionality of all functions. | Comments are used to explain the purpose and functionality of most functions. | Comments are present, but are not used to explain the purpose or functionality of any functions. | Comments are not present. |
Computer Science Principles