+ 2
[CHALLENGE] Magic Hypercube
Let's write a program that inputs: 1. Number of dimensions that a hypercube has 2. Length of edge of the hypercube 3. Set of numbers And outputs: 1. Is it possible to arrange numbers so that they form a magic hypercube (YES or NO) 2. (If YES) Number of configurations that form a magic hypercube 3. (if YES) list of configurations that apply Over this: We don't want to have situation like this: Input: 2/2/1,1,1,1 Output: Yes/24 configurtions / {1,1}{1,1}->printed 24 times
6 ответов
+ 4
I think I've had a magic hypercube (or at least an interesting progression) hidden away in Private codes for a week or so; when I wrote a Java solution for word permutations (a convenient hypercube base: 2x2x2x2, easily generalized to any dimension and side length).
Because the array interleaving is hard to visualize (and I figured, only fascinating to me), I stalled to work on a manual 3D projection and got pulled into equipment issues / forum stuff...I'll see what I have to fix and come back.
Not in C# though ... I did c++ and javascript, inspired by Java. So, I won't meet the language requirement, just the concept.
+ 2
Does this mean that the sum of all sets of elements with all but one fixed indexes is constant? That is, here is the analogy with the magic square?
+ 1
This is analogic to the magic square, but in any number of dimensions.
+ 1
For exampe:
int[,,] arr = new int[,,]{{{26, 6, 10},{12, 25, 5},{4, 11, 12}},{{15, 19, 8},{7, 14, 21},{20, 9, 13}},{{1, 17, 24},{23, 3, 16},{18, 22, 2}}};
Example of magic cube rewritten from https://www.google.pl/search?q=magic+hypercube&client=ms-android-huawei&prmd=ivsn&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjUwbrc0__XAhUPGuwKHfU6BqgQ_AUIESgB&biw=360&bih=511#imgrc=Un-_k6Pq5YCqhM:
+ 1
@Kirk Schafer Good luck!
0
The condition of the problem is unclear. What does it mean for the numbers "they form a magic hypercube"?