test avoid bulled game

Dependencies:   C12832_lcd LCD_fonts mbed mbed-rtos

Revision:
53:2dbce16ffdaa
Parent:
51:07cf2a4bacd0
--- a/Stage.cpp	Tue Dec 13 14:34:27 2016 +0000
+++ b/Stage.cpp	Wed Dec 14 03:02:34 2016 +0000
@@ -43,9 +43,19 @@
 }
 
 int Stage::nextStep(){
+    if(stage[LCD_X - 1] == 0){
+        int t = rand()%6;
+        if(t % 2==0){
+            t++;
+        }
+        return t;
+    }
     if(stage[LCD_X - 1] == stage[LCD_X - 2 - ONE_STEP_SIZE]){
         return stage[LCD_X - 1] + 4;
     }else{
+        if(rand()%10 == 0){
+            return 0;
+        }
         int start = stage[LCD_X - 1] - 8;
         if(start < 0){
             start = 0;