Loop Iteration in Php Game

后端 未结 5 1553
被撕碎了的回忆
被撕碎了的回忆 2021-01-28 23:37

Trying to get it to loop through 3 times and after the 3rd time (if not guessed right) show the right answer.

Currently - its going through the guesses, but isnt showing

5条回答
  •  伪装坚强ぢ
    2021-01-29 00:24

        if($guesscount < 3 && $guessedYear > $realyear){
            echo "Wrong, year too high";
        }
        if($guesscount < 3 && $guessedYear > $realyear){
            echo "Wrong, year too high";
        }
    

    duplicate code there. also i think you are looking for if{...}else if{..}else if{...}else{...}

    and your question has nothing to do with javascript.

提交回复
热议问题