Are you missing a exit block or re-generate random number block here?? As per is see it will ultimately call prompt() method at line number 92. So user will again have to guess the number and the number is same as previous.