mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
666 B
34 lines
666 B
6 years ago
|
## eightqueens
|
||
6 years ago
|
|
||
5 years ago
|
### Instructions
|
||
6 years ago
|
|
||
|
Write a function that prints the solutions to the [eight queens puzzle](https://en.wikipedia.org/wiki/Eight_queens_puzzle).
|
||
|
|
||
|
Recursivity must be used to solve this problem.
|
||
|
|
||
|
It should print something like this :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
6 years ago
|
15863724
|
||
|
16837425
|
||
|
17468253
|
||
|
...
|
||
|
```
|
||
|
|
||
|
Each solution will be on a single line.
|
||
|
The index of the placement of a queen starts at 1.
|
||
|
It reads from left to right and each digit is the position for each column.
|
||
|
The solutions will be printed in ascending order.
|
||
|
|
||
6 years ago
|
### Expected function
|
||
6 years ago
|
|
||
|
```go
|
||
5 years ago
|
package piscine
|
||
6 years ago
|
|
||
|
func EightQueens() {
|
||
|
|
||
|
}
|
||
|
```
|