Join Mark Niemann-Ross for an in-depth discussion in this video Introduction: Eight queens, part of Code Clinic: R.
(digital whirring) - [Instructor] Hello and welcome to the third problem of the Code Clinic series. This challenge is a computer science classic The Eight Queens. It an excellent example of the use of recursion, subroutines, loops, and functions, rather than using one large monolithic set of instructions. In addition because this is a classic problem, proposed in 1848, it's already been solved for almost every programming language ever created.
And as a result is a way to compare the advantages and disadvantages of many approaches. The problem is simple, start with a standard chess board and eight queens. Place the eight queens on the board so that no queens can attack each other. If you've never played chess, you'll need to understand that a queen can attack by moving an unlimited number of spaces horizontally, vertically, or diagonally. This means that no two queens can share a column, row, or diagonal line.
For the eight queens problem there are 92 solutions. In the following videos our authors will show you how they approach the problem, some of the hurdles they encountered, the visual representation of their solution, and an explanation of why they chose a particular solution. You may want to pause this course and attempt a solution of your own. Having some personal hands-on experience will help you appreciate the authors explanation. So don't sit back, be part of the game.
Can you solve the eight queens problem?
- Identify when to use the vector model.
- Describe how to efficiently store results.
- Explain the functionality TCL/TK provides.
- Summarize dashboard solutions.
- Cite the role of the Shiny Server.
- Name the package containing Date Intervals.