You are playing a card game (with a standard deck of cards) in which you are initially given 13 random cards. You want to organize the cards in increasing order of the rank of the cards. (Ace comes first, then 2, then 3, ..., king last.)
Drescribe the process of you go about moving the cards in your hand to accomplish this.
You want to write a function
void pixelate(int x, int y, int size){...}
The purpose of the function is to look at the sizeXsize
block of pixels centred at the (x,y) coordinates given
as input and change the colour of each of these pixels with the
average colour of all the pixels in this block. The input size
will always be an odd positive integer (so that having a
sizeXsize block centred about (x,y) always makes sense).
For example, calling pixelate(width/2,height/2,3)
will change the pixel colours for the 9 pixels in the 3X3 block
of pixels centred at the centre of the screen. And, calling
pixelate(width/2, height/2, width) will change all
pixels on the screen to be the average colour of all the pixels
on the screen initially (assuming width == height, and width
is an odd number).
Write pseudocode for this function using the get() and
set() for this.
Write a second pseudocode for this function using the pixels
array.
Pet class. Give your class at least 3 attributes/fields
and define a constructor for it that has at least one input parameter.
Note: For each question, add the processing folder with your sketch to your ZIP file, not just your sketch (.pde file). Label each folder/sketch as Question4, Question5, etc. Do not put a space between "Question" and the number.
Note: For all of your sketches, the output window should have width and height at least 300 (but do not make them extremely large).
Note: For this and the remaining assignments, it is expected that you
WILL use setup() and draw()
unless specifically asked not to.
Add a button to the side panel to "cheat" in the game. Pressing this button (at any time in the game) should reveal the face side of every card on the playing field. Pressing the button again, turns all the cards face down (that were face down the first time the button was pressed). If any cards were face up when the button is first pressed, they will remain face up when the rest are turned face down. This button should toggle between a cheat state (all cards face up) and regular state (most cards face down) and can be pressed as many times during a game as the players wish.
Extensions and bonus remain the same as A7.