From e6a299906ae98313e6a4b8d568638971ebc8ab4c Mon Sep 17 00:00:00 2001 From: Josh Ashton Date: Thu, 21 Mar 2024 15:21:34 -0600 Subject: [PATCH] project organization/optimization/documentation. began implementing basic board class. --- src/App.java | 4 +--- src/gui/Board.java | 12 ++++++++++-- src/run.ps1 | 6 +++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/App.java b/src/App.java index 3e87fdd..321b190 100644 --- a/src/App.java +++ b/src/App.java @@ -7,7 +7,6 @@ import gui.backend.Settings; import gui.backend.SudokuChecker; import java.awt.BorderLayout; -import java.awt.Dimension; /** * Runner class for the Sudoku App, managing the GUI and coordinating @@ -19,7 +18,6 @@ public class App extends JFrame { // Data fields private Settings s; - private SudokuChecker checker; /** * Create a new App object, initializing the GUI and internal logic. @@ -79,7 +77,7 @@ public class App extends JFrame { */ public static void cli() { Nav nav = new Nav(new Settings(), true); - SudokuChecker check = new SudokuChecker(nav.getLoadedGrid()); + new SudokuChecker(nav.getLoadedGrid()); } /** diff --git a/src/gui/Board.java b/src/gui/Board.java index f3c33ff..01f64fc 100644 --- a/src/gui/Board.java +++ b/src/gui/Board.java @@ -1,5 +1,7 @@ package gui; +import java.awt.GridLayout; + import javax.swing.JPanel; import gui.backend.Settings; @@ -17,15 +19,17 @@ import gui.backend.Settings; */ public class Board extends JPanel { private Settings s; + private Cell[][] grid; /** * Create a new Board object with the default styling from settings. * * @param s */ - public Board(Settings s) { - super(); + public Board(Settings s, Cell[][] grid) { + super(new GridLayout(9, 9)); this.s = s; + this.grid = grid; style(); } @@ -35,4 +39,8 @@ public class Board extends JPanel { private void style() { // TODO: Style the Board Panel. } + + private void createBoard() { + // TODO: Create the board with the given grid. + } } diff --git a/src/run.ps1 b/src/run.ps1 index 8c74113..f1f6007 100644 --- a/src/run.ps1 +++ b/src/run.ps1 @@ -4,9 +4,9 @@ function Run { ) javac *.java java App $flag - rm *.class - rm gui/*.class - rm gui/backend/*.class + Remove-Item *.class + Remove-Item gui/*.class + Remove-Item gui/backend/*.class } if ($args.Length -eq 1) {