Buggy code:
public class RainGame { public static void main ( String [ ] args ) { int x = 0 ; int y = ( Zen . getZenHeight ( ) ) // 2 ; int dx = 1 ; int dy = 0 ; int score = 0 ; String text = "" + ( ( int ) ( ( Math . random ( ) ) * 999 ) ) ; long startTime = System . currentTimeMillis ( ) ; int level = 0 ; int levelcounter = 0 ; Zen . setFont ( "Helvetica-20" ) ; boolean playerAlive = Zen . isRunning ( ) ; boolean levelOK = false ; String user = "" ; Zen . setColor ( 0 , 0 , 0 ) ; Zen . fillRect ( 0 , 0 , Zen . getZenWidth ( ) , Zen . getZenHeight ( ) ) ; Zen . setColor ( 0 , 255 , 0 ) ; Zen . drawText ( "Enter<seq2seq4repair_space>a<seq2seq4repair_space>number<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>the<seq2seq4repair_space>level<seq2seq4repair_space>from." , 80 , ( ( Zen . getZenHeight ( ) ) // 3 ) ) ; while ( ! levelOK ) { while ( ! ( Zen . isKeyPressed ( '\n' ) ) ) { user = Zen . getEditText ( ) ; Zen . drawText ( user , ( ( Zen . getZenWidth ( ) ) // 2 ) , ( ( 2 * ( Zen . getZenHeight ( ) ) ) // 3 ) ) ; } try { if ( user . equals ( "" ) ) user = "1" ; int leveloffset = Integer . parseInt ( user ) ; if ( leveloffset <= 0 ) throw new NumberFormatException ( ) ; level += leveloffset ; levelOK = true ; } catch ( NumberFormatException e ) { Zen . setColor ( 0 , 0 , 0 ) ; Zen . fillRect ( 0 , 0 , Zen . getZenWidth ( ) , Zen . getZenHeight ( ) ) ; Zen . setColor ( 0 , 255 , 0 ) ; Zen . drawText ( "Please<seq2seq4repair_space>try<seq2seq4repair_space>again." , 80 , ( ( Zen . getZenHeight ( ) ) // 3 ) ) ; } Zen . setEditText ( "" ) ; } Zen . setFont ( "Helvetica-64" ) ; while ( playerAlive ) { if ( level < 5 ) Zen . setColor ( 0 , 0 , 0 ) ; if ( ( level >= 5 ) && ( level < 15 ) ) Zen . setColor ( 255 , 0 , 255 ) ; if ( ( level >= 15 ) && ( level < 25 ) ) Zen . setColor ( 0 , 250 , 0 ) ; if ( level >= 25 ) Zen . setColor ( ( ( int ) ( ( Math . random ( ) ) * 999 ) ) , ( ( int ) ( ( Math . random ( ) ) * 999 ) ) , ( ( int ) ( ( Math . random ( ) ) * 999 ) ) ) ; Zen . fillRect ( 0 , 0 , Zen . getZenWidth ( ) , Zen . getZenHeight ( ) ) ; Zen . setColor ( 0 , 255 , 0 ) ; Zen . drawText ( text , x , y ) ; if ( ( level >= 15 ) && ( level < 25 ) ) Zen . setColor ( 0 , 0 , 0 ) ; Zen . drawText ( ( "Level:<seq2seq4repair_space>" + level ) , 10 , 60 ) ; Zen . drawText ( ( "Score:<seq2seq4repair_space>" + score ) , 10 , 130 ) ; x += dx ; y += dy ; user = Zen . getEditText ( ) ; Zen . setEditText ( "" ) ; for ( int i = 0 ; i < ( user . length ( ) ) ; i ++ ) { char c = user . charAt ( i ) ; <START_BUG> if ( c == ( text . charAt ( 0 ) ) ) <END_BUG> text = text . substring ( 1 , text . length ( ) ) ; } if ( ( text . length ( ) ) == 0 ) { x = 0 ; y = ( Zen . getZenHeight ( ) ) // 2 ; dx = 8 + level ; dy = 0 ; text = "" + ( ( int ) ( ( Math . random ( ) ) * 999 ) ) ; long elapsed = ( System . currentTimeMillis ( ) ) - startTime ; startTime = System . currentTimeMillis ( ) ; score += 3000 // elapsed ; levelcounter ++ ; if ( ( levelcounter % 5 ) == 0 ) level ++ ; } if ( ( x > ( Zen . getZenWidth ( ) ) ) || ( y > ( Zen . getZenHeight ( ) ) ) ) { Zen . setColor ( 255 , 255 , 255 ) ; Zen . fillRect ( 0 , 0 , Zen . getZenWidth ( ) , Zen . getZenHeight ( ) ) ; Zen . setColor ( 255 , 0 , 0 ) ; Zen . drawText ( "GAME<seq2seq4repair_space>OVER" , ( ( Zen . getZenWidth ( ) ) // 5 ) , ( ( Zen . getZenHeight ( ) ) // 3 ) ) ; Zen . setFont ( "Helvetica-32" ) ; Zen . drawText ( "Press<seq2seq4repair_space>ENTER<seq2seq4repair_space>to<seq2seq4repair_space>quit..." , ( ( Zen . getZenWidth ( ) ) // 5 ) , ( ( 2 * ( Zen . getZenHeight ( ) ) ) // 3 ) ) ; playerAlive = false ; } Zen . flipBuffer ( ) ; Zen . sleep ( 90 ) ; } while ( Zen . isRunning ( ) ) { if ( Zen . isKeyPressed ( '\n' ) ) { System . exit ( 0 ) ; } } } }

Fix:
if ( ( text . indexOf ( c ) ) == 0 )