From the course: Code Clinic: JavaScript
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Intro: Eight queens - JavaScript Tutorial
From the course: Code Clinic: JavaScript
Intro: Eight queens
(electrical chiming) - [Narrator] Hello and welcome to the third problem of the code clinic series. This challenge is a computer science classic, The Eight Queens. It's an excellent example of the use of recursive 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, it's 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 attach 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Intro: Eight queens1m 45s
-
(Locked)
Solution overview1m 31s
-
(Locked)
Preparing the board6m 46s
-
(Locked)
Setting up the board4m 17s
-
(Locked)
Computing solutions3m 56s
-
(Locked)
Finishing calculations7m 23s
-
(Locked)
Storing board solutions4m 1s
-
(Locked)
Display solutions4m 7s
-
(Locked)
Navigating through solutions3m 32s
-
(Locked)
-
-
-