| [ next ] [ prev ] [ contents ] [ skip to Story Two Tests ] | XP-Cinti TDD Workshop |
The changes the customer gave us changed the mental model we had been using. Instead of tying knots on a net, we are now placing colored tokens there. Mark and I decided to change the name of our methods to reflect the new scheme.
Here's our first pass ...
Token values can be ...
(see note on Ruby Symbols)
After some reflection, we decided we weren't happy with the get/set names. Since the net object was looking more and more like a two-dimensional array, we decided to drop the get/set methods and implement an array-like notation for the net object using Ruby Operators. Accessing the net might look like this ...
net[2,3] = :BLACK # Set location (2,3) to the Black token
if net[1,4] == :EMPTY # Test if location (1,4) is empty
do_something
end
|
| [ next ] [ prev ] [ contents ] [ skip to Story Two Tests ] | Copyright 2003 by Jim Weirich.![]() |