From the course: Code Clinic: C

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution overview

Solution overview - C Tutorial

From the course: Code Clinic: C

Start my 1-month free trial

Solution overview

- The eight queens challenge is a classic programming puzzle, one that the C language is more than capable of handling. No fancy graphics, no extra libraries, just pure programming proficiency. Solutions vary, and because C can be an extremely cryptic language, quite a few of the code samples you may find, take great pains to be nearly unreadable. I suppose there's a charm in that, and I'll discuss specifics in a later movie. For now, my approach was to write a program called N Queens. The name comes from the n in number, meaning that the program can handle more than one size chess board, that's because as you'll discover should you attempt your own solution, once you get a solution for an 8x8 chessboard, you can easily change the number of squares, and run the solution on any size board. The interface is simple, type N Queens and the code searches for solutions on a standard 64 square or 8x8 board. Here you see that 92 solutions are found which is the proper number. If you wanna find…

Contents