colour prediction game algorithm