October 2021
Intermediate to advanced
336 pages
9h 16m
English
This chapter covers
In the previous chapter, I mentioned that we are not finished with updateTile. It violates several rules, most notably Never use if with else (R4.1.1). We also worked to preserve the ||s in the code because they expressed structure. In this chapter, we explore how to expose more such structures in the code.
This is updateTile at the moment.
Listing 5.1 Initial
function updateTile(x: number, y: number) {
if ((map[y][x].isStone() ...Read now
Unlock full access