1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 1x 2x 2x 4x 4x 1x 4x | /// Auto incrementing class that maintains its current position export class SequenceGenerator { i: number; constructor(initialValue: number = 0) { this.i = initialValue; } next = () => { this.i++; if ( this.i > 255 ) { this.i = 1; } return this.i; } } |