2016-11-17

posted Nov 17, 2016, 7:01 AM by Samuel Konstantinovich   [ updated Nov 18, 2016, 2:17 PM ]
GOAL: Practice AP question / Quiz Question!!!!!

My goal is to have you do well, so my proposition:
1. Give a practice quiz now, and get you all acclimated to AP style questions. 
2. Move the quiz to Monday. So you can frontload your project time, and spread your studying over more days.

Try this first (only @ stuy)
file:///home/support/konstans/public/APQuestion.pdf

Otherwise Try the file attached at the bottom of the post!

SOLUTION:
public Crossword(boolean[][] blackSquares){
    //Simplify your life, make extra variables!
    int rows = blackSquares.length;
    int cols = blackSquares[0].length;

    puzzle = new Square[rows][cols];
    int num = 1;

    for (int r = 0; r < rows; r++){
      for (int c = 0; c < cols; c++){
        if (toBeLabeled(r, c, blackSquares)){
          puzzle[r][c] = new Square(false, num);
          num++;
        }
        else{
          //this is simpler than you thought
          puzzle[r][c] = new Square(blackSquares[r][c], 0);
        }
      }
    }
}


Ċ
Samuel Konstantinovich,
Nov 17, 2016, 7:01 AM
Comments