Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'ve been given a 2^k * 2^k tiled board, with one of the tiles removed making i

ID: 3529203 • Letter: I

Question

I've been given a 2^k * 2^k tiled board, with one of the tiles removed making it a deficient board. My goal is to fill it with "trominos" which are an L-shaped figure consisting of three colored tiles. The method of doing this is with a recursive algorithm. If the board is 2x2, it simply takes one tromino to fill it. For any size greater, the board is divided into four 2^(k-1) sized boards. One of them is deficient, so a tromino is placed at the center-point of the non-deficient quadrants. Now that each one has a filled in square, the board can be recursively filled with trominos until every tile is filled. Since this is done in Java, a link to this stackoverflow post will give further information along with the code. Any assistance would be greatly appreciated. http://stackoverflow.com/questions/15103429/recursively-tiling-a-deficient-board-in-java

Explanation / Answer

public class BoardViewer extends JFrame { private static final int WIDTH = 1024; private static final int HEIGHT = 768; private static final int OFFSET = 30; public static final int UPVERT = 1; public static final int DNVERT = 2; public static final int RHORIZ = 4; public static final int LHORIZ = 8; public static final int FILL = 16; private Color [][] board; public BoardViewer(DeficientBoard db) { super(); setSize(WIDTH + (OFFSET*2), HEIGHT + (OFFSET*2)); setDefaultCloseOperation(EXIT_ON_CLOSE); setResizable(false); board = db.getBoardColor(); } public void paint(Graphics g) { super.paint(g); int width = WIDTH/board[0].length; int height = HEIGHT/board.length; for (int r = 0; r
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote