From 216fc014abee0572c155cddd64850800c401ee40 Mon Sep 17 00:00:00 2001 From: none Date: Wed, 18 May 2022 16:23:35 +0900 Subject: [PATCH] fix typo in magic, add magic to all --- all.hhs | 1 + magic.hhs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/all.hhs b/all.hhs index 91426a5..bc676e1 100644 --- a/all.hhs +++ b/all.hhs @@ -43,5 +43,6 @@ *import math:multinomial *import math:reshape *import math:is_diag + *import math:magic *import math:check_input diff --git a/magic.hhs b/magic.hhs index e86d80b..7502a00 100644 --- a/magic.hhs +++ b/magic.hhs @@ -24,11 +24,11 @@ function magic(input) } // 1x1 magic square is called trivial if(input === 1) return (new Mat([1])); - // 2x2 magic square do not exist, retrun a default matrix + // 2x2 magic square do not exist, return a default matrix if(input === 2) return (new Mat([[1, 2], [3, 4]])); /* - The method of generating magic matrix depends on the rank + The method of generating magic matrix depends on the order it should be consider as odd, 4M+2, 4M, M is an integer greater than 1 mode = 0 : the input is 4M, use generate_square_doubly_even mode = 2 : the input is 4M+2, use generate_square_even