previous | start | next

New More Object-Oriented Swarm Version:

Create classes where bit strings are to be stored.  (see BitVector class, or BFcast class which accesses it)
Create interfaces to these classes with obvious names, as in

(void) setConditionsbit: (int) bit To: (int) x
-(int) getConditionsbit: (int)bit
-(void) switchConditionsbit: (int) bit

The "trits" are  translated into and from integer values according to a table like this:
 

binary value  integer equivalent   meaning
00  0  # or "don't care"
01 NO
 10  2  YES
 11    3 not in use, a place holder value

All of the bit math is confined to the BitVector class, all other operations to get or set the bit values are used in a standard object oriented way.  Create a conditions object from the BFcast class, and tell that one to set the third bit to integer value 1.

 [conditions setConditionsbit: 3 To: 1];
 



previous | start | next