The latest version of the book is P1.0, released over 3 years ago. If you've bought a PDF of the book and would like to update it to this version (for free), visit your home page.
By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:
If you've found a new error, please submit it.
- Reported in: P1.0 (04-Jul-15)
PDF page: 18
Spent a lot of time getting the sample code to run with Ruby. It seems that the require statement has changed since Ruby 1.9 to not include the local directory. Supposed to use require_relative instead. This was fixed quite a while ago in Ruby since 1.9 due to security issue. Not sure why the code is still using the old format? --Tony Dahbura
- Reported in: P1.0 (24-Dec-15)
Paper page: 22
The rationale for the column value in the random_cell method would be useful to explain. It took me awhile to realize it was for non-rectangular grids, since you didn't just use
column = rand(@columns)--Matt Ray
- Reported in: B7.0 (27-Jun-15)
PDF page: 24
Code examples with line numbers would read more nicely in the kindle version if you label the first line "1" instead of "Line 1".
As it is currently, the extra characters mess up the formatting of the first line in each of the code examples that have line numbers.--Nick Lavers
- Reported in: P1.0 (11-Mar-16)
Paper page: 30
Parameters use the equal sign to assign default values.
So the method declaration should read:
def to_png( cell_size = 10 )--Holger
- Reported in: P1.0 (16-Aug-15)
PDF page: 43
Quoting from the text:
Each iteration of that loop examines all of the linked
neighbors of the current cell (line 8), looking for one that is closer to the root
This, however, does not seem to be (strictly speaking) the case, since the code includes a break at line 12.
I think the result will be the same, since this is a perfect maze, but I was a bit confused by this.
- Reported in: P1.0 (20-Jul-15)
PDF page: 71
Text "(for example, binary_tree_demo.rb or wilsons.rb)". It should read wilsons_demo.rb.--Carl
- Reported in: P1.0 (13-Nov-18)
Paper page: 134
Dijkstra's name is misspelled in the header on this page. "Dikstra"
- Reported in: P1.0 (14-Feb-17)
Paper page: 200
The vertical bias in attributed to the recursive subdivision algorithm is consequence of the implementation rather than the nature of the algorithm itself
The code for the recursive subdivision algorithm (page 200 & online) indicates that a section is split horizontally if & only if the section height is greater than its width, otherwise it it split vertically. As a result, any case in which the section width & height are equal, the section will always be split vertically. The lack of random chance in the case of equality results in biasing the maze to have vertical passages. Changing the code to give square sections a 50/50 chance to split vertically or horizontally will remove the bias.
Subsequently, the comparison of recursive subdivision algorithm to other algorithms in Appendix 2 (pages 260-261), describes & illustrates the bias found in the implementation as given in the text, but would be incorrect if the implementation is fixed as described above.--Jonathan Pikalek