Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 616 Bytes

magic-square.md

File metadata and controls

30 lines (24 loc) · 616 Bytes

Magic Square Kata

Source: Magic square

Intro

This puzzle comes from Lewis Carroll.

The magic part is when the values on a square are arranged so that adding them up in any direction results in a constant sum.

Instruction

You have the following values:

1.0
1.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0

You need to arrange them in a 3 x 3 matrix so that:

  • The sums of numbers in each row = magic number
  • The sums of numbers in each column = magic number
  • The sums of numbers in each diagonal = magic number