CHALLENGE+PROJECTS!

=CHALLENGE PROJECTS!= These projects are for if you want an extra challenge. If you can complete these you're well on your way to mastering Processing. Note. These are **not** easy. They're not designed to be easy. They're supposed to be hard. These are more than I expect from you and will require substantial independent study to complete.

Where possible I'll include references, but you will very likely need to do some research on your own. Don't feel that you have to limit yourself to Processing references. Processing is based on Java, so many of the same concepts apply!

If you're working on these, I would love to help you - but students that are working on more basic skills will always have my priority. I will be happy to correspond with you over e-mail though! You can even paste your code into a Google Document and I can post comments and hints.

There will be two types of projects listed below: terminal projects and graphical projects. Terminal projects will have more emphasis on the fundamental programming skills and mostly take place in that little black box where errors pop up. Graphical projects will put more emphasis on the cool graphical things that processing can do.

Challenge Project #1 - Conditional Statements (Terminal Project) [Jan 31]
Write a program to play a simple game of rock, paper scissors. I've set up the base of the code for you below. To do this project you will have to learn how to use if and else and logical operators It will also help you in the future if you learn how to use random For added difficulty, have your program display the result on the main window.

code format="java" /*** * Title: RPS Skeleton * Author: Lyle Kozloff * Description: The bare bones for an RPS program. * Assumptions: 0 = rock, 1 = scissors, 2 = paper * ***/

int playerChoice = 0; //by default player chooses rock, change this if you like int computerChoice;

String rock="rock"; String paper="paper"; String scissors="scissors"; String chosenWords = "no choice yet!"; //default value

computerChoice = int(random(2)); //randomly select a number from 0 to 2

print("The computer chose: "); println(chosenWords); //use if and computerChoice to make it say the right word

print("You chose: "); println(chosenWords); //use if and playerChoice to make it say the right word

//something should go here so the computer will only print one of these println("You win!");

println("You lose!");

println("It's a draw!"); code

Challenge Project #2 - Tic Tac Toe (Graphical Project) [Feb 15]
Create the game of Tic-Tac-Toe! Assume players will trade off. X will go first, then O, followed by X. When a player wins, a message like "X Wins!" When there is a draw, an appropriate message should be displayed.

Ms. Hines created the following example for you to download and experiment with.

To complete this project you will need to know how to:
 * use if and else and logical operators
 * create functions and how to use the return statement
 * display text on screen