Results 1 to 5 of 5
Thread: Magic Square!!!... :D
- 02-24-2010, 03:24 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 2
- Rep Power
- 0
Magic Square!!!... :D
Hello people!.
You might be interested for coding this program!... I'm new to the 2d array thing and I can't code using it, it's kind a confusing.
It is a program that can generate a magic square with an odd number of rows. The number of rows should be entered by the user of the program at run time. The minimum number of rows that may be entered is 3. You may provide a limit to the number of rows (You may set the maximum number of rows that may be entered.)
A magic square is an array of integers where the sums of columns, rows and diagonals are equal.
Examples of magic squares (with the grids on it)
3-row magic square
8 1 6
3 5 7
4 9 2
5-row magic square
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
could you give me the code?
thanksLast edited by joms999; 02-24-2010 at 04:36 PM.
- 02-24-2010, 03:34 PM #2
Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
The Ubiquitous Newbie Tips
- 02-24-2010, 04:17 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
-
- 02-25-2010, 07:55 AM #5
Senior Member
- Join Date
- Oct 2009
- Location
- California,US
- Posts
- 201
- Rep Power
- 4
Nice try! but
if you are having trouble with 2d arrays make some small programs that might clear your doubts. Read some books or articles on that. Its not too hard neither is the question over here.Its not rocket science. Just need to spend some time on programming over the question. That should do the trick
Similar Threads
-
Magic Eightball
By sachmow in forum New To JavaReplies: 1Last Post: 11-15-2009, 04:37 PM -
Jar files and a magic error.
By dudejonne in forum Java AppletsReplies: 2Last Post: 10-31-2009, 02:28 PM -
[SOLVED] Magic Points Game
By jimmy7 in forum Java AppletsReplies: 6Last Post: 04-26-2009, 11:40 PM -
Problem using buttons to creat a magic square game
By goldman in forum New To JavaReplies: 5Last Post: 05-05-2008, 04:04 AM -
Incompatible magic value 1008821359
By willemjav in forum Java AppletsReplies: 2Last Post: 03-21-2008, 09:41 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks