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 "nqueens".…

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 "./nqueens" 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 solutions for a different size board,…

Resume Transcript Auto-Scroll

Author

Updated

6/25/2015

Released

4/23/2015

Successful programmers know more than a computer language. They also know how to think about solving problems. They use "computational thinking": breaking a problem down into segments that lend themselves to technical solutions. Code Clinic is a series of ten courses where authors solve the same problems using different programming languages. Here, Dan Gookin works with C.

Dan introduces challenges and then provides an overview of his solutions in C. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.

Visit other courses in the series to see how to solve the exact same challenges in languages like C++, C#, JavaScript, PHP, Python, R, Ruby, and Swift.

Skill Level Beginner

1h 14m

Duration

91,320

Views

Show MoreShow Less

Q: I am unable to access the Lake Pend Oreille data from outside the U.S.

A: A static copy of this data is provided here for lynda.com members outside of the U.S.