private int rational ( int n ) { while ( n >= shapes . size ( ) ) { n -= shapes . size ( ) ; } while ( n < 0 ) { n += shapes . size ( ) ; } return n ; }
Get an index that is rational i . e . fits inside this set of shapes