1. ## Latin square

Can you give me a logic of how I could print a latin square using recursion for any number of 'n'.

Example for Latin square for 3x3

1 2 3
2 3 1
3 1 2

2. Have you tried printing all permutations of an array length n?

It might help you to find out what permutation means, and after that, implement it as your solution.

3. ## Re:

I'm not sure how to perform permutation .
Could you give me a heads up
Thanks.

4. Permutation via Mathworld. Might be of some use to you.

5. Im not sure of what you are saying.

I need to know the method to do Latin squares with 'recursions'. I really hate doing recursions, even though it makes tasks faster.

6. Originally Posted by Ron
Im not sure of what you are saying.

I need to know the method to do Latin squares with 'recursions'. I really hate doing recursions, even though it makes tasks faster.

Please do my work for me.
You already know what a Latin square is. If you read the source kermit gave you, you'd know what permutation is. Permutation is easily made recursive. What is stopping you from opening up your compiler and trying to get these ideas to work in programming?
Code:
```#include <stdio.h>
#include <stdlib.h>
static void swap(int *a, int *b) {
/* the code */
}

static void latin_square(int *array, size_t place) {
/* the code */
}

int main(int argc, char *argv[]) {
...```

7. Kool, I got it.
Thanks