From 9d53d8857eaa1c9405894a88ca75bc4657e42f35 Mon Sep 17 00:00:00 2001 From: msglm Date: Sat, 14 Jan 2023 05:31:48 -0600 Subject: Inital Commit --- Java/MagicSquare/MagicSquare.java | 75 +++++++++++++++++++++++++++++++++++++++ Java/MagicSquare/Main.java | 25 +++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 Java/MagicSquare/MagicSquare.java create mode 100644 Java/MagicSquare/Main.java (limited to 'Java/MagicSquare') diff --git a/Java/MagicSquare/MagicSquare.java b/Java/MagicSquare/MagicSquare.java new file mode 100644 index 0000000..934ade5 --- /dev/null +++ b/Java/MagicSquare/MagicSquare.java @@ -0,0 +1,75 @@ +class MagicSquare{ + +final int maxSize; +int size; +int mSquare [][]; +int row, col; + +public MagicSquare (int s){ +maxSize = 15; +if (s > maxSize) + size = maxSize; +else + size = s; + +mSquare = new int [size][size]; +row = col - 0; +intSquare(); +} + +private void intSquare(){ +int count, mid; + +for (row = 0; row