February 2019
Intermediate to advanced
292 pages
6h 55m
English
A ring pattern depends on two dimensions, x and z, to decide which color to return. It works similarly to stripes, but instead of testing the distance of the point in just x, it tests the distance of the point in both x and z, which results in this pattern of concentric circles as shown in the figure.

Write the following test for this. You’re checking to make sure that these rings extend in both x and z.
| | Scenario: A ring should extend in both x and z |
| | Given pattern ← ring_pattern(white, black) |
| | Then pattern_at(pattern, point(0, 0, 0)) = white |
| | And pattern_at(pattern, point(1, 0, 0)) = ... |
Read now
Unlock full access