I thought it was hardcoded too until I restart and found out each level have preset number to guess. We really just got lucky.