Difference between revisions of "AP Computer Science"
From WLCS
Line 1: | Line 1: | ||
+ | == Friday (1/10/20) == | ||
+ | '''Agenda:''' | ||
+ | * Demonstrate a Brick Breaker game that uses arrays of objects | ||
+ | ** [] single dimensional array of objects gives you partial credit | ||
+ | ** [][] two-dimensional array of objects gives you full credit | ||
+ | ** Challenge: implement a two-dimensional grid of Bricks using a single dimensional array (Hint: You determine row and column number from the object's index and how many Bricks are in a row) | ||
+ | * ButtonGrid --> Minesweeper | ||
+ | ** We will first create a single Button object that can be pressed in and out (pressed and depressed) | ||
+ | *** What appropriate characters (instance variables) should we have for a Button? | ||
+ | *** What appropriate behaviors (methods) should we have for a Button? | ||
+ | ** We will then create a row of Button objects that can be pressed in and out | ||
+ | ** We will then create a simple grid of Button objects on the screen | ||
+ | * Design and implement a fully working Minesweeper program | ||
+ | |||
== Wednesday (1/8/20) == | == Wednesday (1/8/20) == | ||
'''Warmup:''' | '''Warmup:''' |
Revision as of 06:14, 10 January 2020
Contents
Friday (1/10/20)
Agenda:
- Demonstrate a Brick Breaker game that uses arrays of objects
- [] single dimensional array of objects gives you partial credit
- [][] two-dimensional array of objects gives you full credit
- Challenge: implement a two-dimensional grid of Bricks using a single dimensional array (Hint: You determine row and column number from the object's index and how many Bricks are in a row)
- ButtonGrid --> Minesweeper
- We will first create a single Button object that can be pressed in and out (pressed and depressed)
- What appropriate characters (instance variables) should we have for a Button?
- What appropriate behaviors (methods) should we have for a Button?
- We will then create a row of Button objects that can be pressed in and out
- We will then create a simple grid of Button objects on the screen
- We will first create a single Button object that can be pressed in and out (pressed and depressed)
- Design and implement a fully working Minesweeper program
Wednesday (1/8/20)
Warmup:
- Take out a piece of paper
- Draft the layout of one or more rows of Brick
- Include the x-y coordinates of each Brick
- Include the dimensions of the window, each Brick, and any gaps
- Number each Brick from 0, 1, 2, etc. horizontally (top-most left Brick is 0)
- Find a pattern!
Agenda:
- for-loop initialization tricks
- Two-dimensional for-loop tricks
- boolean checkWin(Brick[] bricks) method
- What are the different ways to determine if a we have cleared all the Brick objects?
- Re-implement Brick Breaker such that it utilizes an array of Brick objects
- Be sure to create a new sketch and do *not* to lose or overwrite your old program
- Implement a one row of Brick in your object arrays Brick Breaker
- Implement and demonstrate a multi-row Brick Breaker game that has winning and losing
Monday (1/6/20)
Agenda:
- Re-familiarize yourself with everything
- CSTA/ACM Cutler-Bell Scholarship
- Object-oriented programming review
- Brick Breaker (bad) demo and debrief
- null keyword review
- Arrays of objects
- Object array instantiation (creation)
- Object array initialization
- Object array usage
- Iteration through an object array
- for-loop initialization tricks
- Two-dimensional for-loop tricks
- Re-implement Brick Breaker such that it utilizes an array of Brick objects
- Be sure to create a new sketch and do *not* to lose or overwrite your old program