From the course: Code Clinic: JavaScript
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Display solutions - JavaScript Tutorial
From the course: Code Clinic: JavaScript
Display solutions
- [Announcer] Alright, so it's time to start displaying our solutions. So, right after this, I'm gonna start by creating a function called display Solution, and it's going to have a solution, or at least be passed along as solution ID. So this is what's gonna show all of the pieces on the board, so we'll create a loop to loop through the different positions. So we're gonna start by looping through all of the available solutions and then in here we'll just do a query Selector and we will find the item with an ID of hashtag plus the index of the solution, so if you take a look at index at html, and you take a look at the board, you'll notice that every sort of square has an ID that corresponds to the letter as well as the number. There's A one, B one, C one, et cetera, et cetera, and then once you get past eight sort of positions, then you start with the A two, et cetera, et cetera, so that's what we're doing here. Alright, so, inside all of the different solution positions here, each…
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 42s
-
(Locked)
Solution overview1m 28s
-
(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)
-
-
-