Assignment #10 - The Animal Game
Due Date: 11/27/2024 23:00
Submission and Grading Instructions:
- Read all the assignment specifications carefully.
- All assignments are designed to use only the features of Processing we’ve discussed so far to test your understanding of the material presented in class. Files using features that we have not covered in the lecture will be flagged as cheating. For example, you can never use the function translate.
- You cannot use generative AI to help you solve any part of the assignment.
- If you have questions, you must ask the instructor or the TAs. You cannot search for the answer on Google nor use YouTube videos or any other material not provided by us.
- Turn in the file(s) as described in the following specifications to Gradescope before the due date. Make sure to name the file exactly as this document specifies.
- You must use Gradescope as a backup. Upload to Gradescope frequently, and if you ever have issues with your computer, you can get your latest code by downloading your program from Gradescope.
- You should follow the coding style guidelines covered in the lecture. That means using proper comments and blank lines to separate the key parts of your code, proper indentation, variable names should be well-chosen, and using camelCase.
Specification of Assignment
Refresh this page constantly as we answer your questions from Piazza and clarify the requirements
The specifications for this assignment are given in this video.
The URLs to the images are:
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/species.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/cow.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/frog.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/penguin.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/puffer_fish.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/echidna.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/eagle.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/kangaroo.png
- https://profdiazh.github.io/cs101/static_files/assignments/10_animal_game/platypus.png
Disclosure: The images and decision tree for this assignment are property of grok academy
This is the decision tree that you should use to write the questions that your program will ask the player:
Use the following code as a template for the screens with questions:
void setup() {
size(800, 500);
background(255);
textAlign(CENTER, CENTER);
}
void draw() {
fill(0);
textSize(30);
text("WRITE YOUR QUESTION HERE", width / 2, height / 2 - 50);
// Draw the "Yes" and "No" rectangles
fill(255);
stroke(0);
rect(width / 2 - 120, height / 2, 100, 50);
rect(width / 2 + 20, height / 2, 100, 50);
fill(0);
textSize(22);
text("Yes", width / 2 - 70, height / 2 + 25);
text("No", width / 2 + 70, height / 2 + 25);
}
Name the file animal_game.pde
.
Grading Rubric
Points | Requirement |
---|---|
2 | Name the file correctly (autograder). |
4 | Style ((Header, Comments, Spaces, camelCase) |
6 | The First screen shows all the species and changes when pressing any key |
4 | The first question (“Has fur”?) is shown on the second screen and pressing the ‘y’ key shows the left question (“Lays eggs?”) |
4 | Pressing the ‘n’ key on the second screen shows the left question (“Has feathers?”) |
24 | The eight animals can be properly guessed |
You must use the provided templates to receive a grade on the assignment. You must use the URLs instead of a local file for us to be able to grade the assignment.