As Afzaal said, you need to do your own homework. I'll give you 2 hints. If I were going to do this I'd: 1. represent the genome as 64 Boolean values (only 8 can be true) representing the board state 2. the fitness function is based on how many queens are "safe"

N-Queens is actually much easier than that. It's actually one-dimensional; not two-dimensional as people assume. Find the Permutations of N things taken N at a time.

No, if that is your homework you need to do it yourself. We won't provide any code unless you show us what you did and where did it get your stuck. Here is the algorithm, https://en.wikipedia.org/wiki/Eight_queens_puzzle[^] (See solutions) and you may want to have a look at a few PDFs provided in this Google search[^].

I'll give you 2 hints.

If I were going to do this I'd:

1. represent the genome as 64 Boolean values (only 8 can be true) representing the board state

2. the fitness function is based on how many queens are "safe"