Beta

Magic Squares

Description:

Magic squares are square arrangements of numbers such that they satisfy certain mathematical properties. An n by n magic square is a 2-dimensional array of numbers such that:

  1. The set of numbers in the magic square are n^2 consecutive numbers.
  2. Each row, column and diagonal of the magic square have the same sum of numbers in them.

Task:

Create a function magicSquare which takes in a number n and returns a n by n magic square.


Limits:

3<=n<=100

Puzzles

Stats:

CreatedFeb 12, 2017
PublishedFeb 12, 2017
Warriors Trained429
Total Skips190
Total Code Submissions130
Total Times Completed10
JavaScript Completions10
Total Stars3
% of votes with a positive feedback rating80% of 5
Total "Very Satisfied" Votes3
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes0
Total Rank Assessments4
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Element118 Avatar
Ad