Though one downside I personally found with the book is that in certain chapters the author uses very complex and convoluted examples to demonstrate the usage of JavaScript. It covers a lot of topics and is divided into isolated chapters so it's great as a reference as well. In regards to the book Eloquent JavaScript by Marijn Haverbeke, yes it's definitely a great book. In chapter 2, there are three activities. Here's a non-exhaustive list of things you can do with chessboard.js: Use chessboard.js to show game positions alongside your expert commentary. It is designed to be 'just a board' and expose a powerful API so that it can be used in different ways. I think the codecademy provides you with the basics, but the book ‘Eloquent Javascript’ is fantastic. What is chessboard.js chessboard.js is a standalone JavaScript Chess Board. Both Sarah and I went through the codecademy Javascript course while on holidays last month. So for example the first square in the top left would be (0 + 0) % 2 resulting in 0 so print a space, and the next square over would be (1 + 0) % 2 would be 1 so print a #. The Chessboard Activity on Eloquent Javascript. If the result is equal to 0 then it had no remainder, and thus is an even number so log out a space, otherwise log out a #, building your chess board pattern. The if ((x + y) % 2 = 0) uses the % (modulo) to determine whether the x + y divided by 2 has a remainder. Problem with the chessboard of eloquent javascript Hi there, I started learning web development about two months ago with The Odin Project, got into the js section and in their problems I got stuck, rather than checking the solution and continue I decided to get a book which is supposed to deeply teach js, that is eloquent javascript. Each loop of the outer loops creates another row, and each loop of the inner loop creates another column in said row. Write a program that creates a string that represents an 8×8 grid, using newline characters to separate lines. TechNinjaWeb / ChessBoardafter Created 8 years ago 0 Fork 0 Code Revisions 1 Download ZIP Eloquent Javascript Exercises Raw chapter 3 answers / Minimum The previous chapter introduced the standard function Math. Fizzbuzz, creating triangles, and creating a chessboard. GitHub Instantly share code, notes, and snippets.You can think of the outer loop as the rows (the numbers on the board) and the inner loop as the columns (the alphabet on the board). My solutions to the three example problems in Chapter 2 of Eloquent JavaScript, by Marijn Haverbeke. The two loops are required to construct the two dimensions of the board.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |