set code guess in loop