Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Magic Squares

newbie103newbie103 Member Posts: 1
I am trying to write a program in VB 2005 that will determine if an array(n*n) is a magic square. My problem is the creation, adding, and accessing the arrays. The algorithm is proving problematic as well. My ignorance is boundless when it comes to programming. Appreciate any help.

Thank you.

Comments

  • DrMartenDrMarten Member Posts: 748
    [b][red]This message was edited by DrMarten at 2006-12-17 1:55:47[/red][/b][hr]
    : I am trying to write a program in VB 2005 that will determine if an array(n*n) is a magic square. My problem is the creation, adding, and accessing the arrays. The algorithm is proving problematic as well. My ignorance is boundless when it comes to programming. Appreciate any help.
    :
    : Thank you.

    _______________________________________________________________________

    Hi,

    As far as i know there are two types of magic square i think.

    Those with odd number of sides where the diagonals add up to a certain number too.

    Arrays in VB.Net start at index zero (0) so a 3 x 3 array
    can be held in

    Dim myArray(2,2)

    What i'd need to know is;

    1) Do you just want the array of numbers checking so that all columns and rows are checked?

    2) Or checked against a specific value?

    3) Do you want the program dynamic to check for any size of array?

    I believe all the numbers in a magic square have to be different too?
    See these links.>>
    http://mathworld.wolfram.com/MagicSquare.html

    http://theory.cs.uvic.ca/amof/e_magiI.htm

    and> http://www.google.co.uk/search?hl=en&ie=ISO-8859-1&q=magic+square+example&meta=



    Regards,

    Dr M.
Sign In or Register to comment.