今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Storing board solutions
- [Instructor] So it's finally time to fire everything up, and then start to work with our interface to display some of our items here. So let's start out by saying let myBoard is going to be equal to this new board. So this is calling the method that we created that's going to generate a new board with all of the solutions, and then we're gonna start out by initializing. So myBoard, tryNewQueen, which is the method that fires everything up. And then we're gonna get the amount of solutions we get back from our board. So we'll say solutions quantity is going to be equal to myBoard solutions length. So that's gonna start the board, calculate all the solutions, and then give that back to us in a variable. Once we have that then we can start filling out how our interface displays those elements. So we'll say document querySelector. We're gonna target here the element called currentSolution, inner, and change the HTML of the current solution to one. So what that's gonna do is sort of…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
(已锁定)
Intro: Eight queens1 分钟 45 秒
-
(已锁定)
Solution overview1 分钟 31 秒
-
(已锁定)
Preparing the board6 分钟 46 秒
-
(已锁定)
Setting up the board4 分钟 17 秒
-
(已锁定)
Computing solutions3 分钟 56 秒
-
(已锁定)
Finishing calculations7 分钟 23 秒
-
(已锁定)
Storing board solutions4 分钟 1 秒
-
(已锁定)
Display solutions4 分钟 7 秒
-
(已锁定)
Navigating through solutions3 分钟 32 秒
-
(已锁定)
-
-
-