1. Rock, Paper, Scissors
SKILLS: Variables, Boolean expressions, Conditional Statements, Loops, Functions, Logic/ Reason
Write a sketch that plays rock, paper, scissors.
SKILLS: Variables, Boolean expressions, Conditional Statements, Loops, Functions, Logic/ Reason
Write a sketch that plays rock, paper, scissors.
- Player 1 (user) picks a number between 1-3
- rock
- paper
- scissors
- Player 2 (computer) randomly selects a number between 1 and 3
- compare the results and display the winner
- repeat until the user decides to stop (while continue == "yes")
- Each process should be in its own function (user selects a number, computer selects a number, pick a winner...
- draw a picture in the display window of the selected object
- Use an image (picture data type) to display selected objects in the window
- Play the "Big Bang Theory" version (Rock, Paper, Scissors, Lizard, Spock)
2. The Flipper
Flipper Problem Description: You are trying to pass the time while at the optometrist. You notice there is a grid of four colours. You see lots of mirrors and lenses at the optometrist, and wonder how flipping the grid horizontally or vertically would change the grid. In your display window draw the initial orientation as the image on the right. |
Specifically, a “horizontal” flip (across the horizontal centre line) would take the original grid of four colours. A “vertical” flip (across the vertical centre line) would take the original grid of four colours. Your task is to determine the final orientation of the numbers in the grid after a sequence of horizontal and vertical flips. Display the orientation of the colours after each flip in your display window.
Input Specification
Accept input from the user as a H for horizontal flip or V for vertical flip. Repeat until the user types E foe End.
Output Specification:
Output the final orientation of the four Colours as rectangles in the display window.
Hints:
1. Choose a display window size that's easily divided into 4 quadrant. (ex, size(400,400))
2. Use function to draw a rectangle, pass the colour and quadrant as parameters
Input Specification
Accept input from the user as a H for horizontal flip or V for vertical flip. Repeat until the user types E foe End.
Output Specification:
Output the final orientation of the four Colours as rectangles in the display window.
Hints:
1. Choose a display window size that's easily divided into 4 quadrant. (ex, size(400,400))
2. Use function to draw a rectangle, pass the colour and quadrant as parameters