June 2003
Beginner
504 pages
10h 49m
English
The next problem was figuring the line of sight through a hexgrid. Imagine the situation: Tank #1 is at coordinates C4 and Tank #2 is at F9. Can Tank #1 see Tank #2? To put it in more computationally rigorous terms, can Tank #1 trace an unblocked line of sight to Tank #2? See Figure 13.2.

The solution to this problem turns out to be rather complicated and mathematical, so I will not delve into its gory details. The problem was exacerbated by the requirement to operate in an 8-bit CPU with no hardware multiplication or division; everything had to be done with logical operations ...
Read now
Unlock full access