This is a tiny browser game, that we’re using to assess basic JavaScript competencies, prior to an actual interview.
Salam wants to enter your house through one of the eight available doors, in order to sing manele. If you see him entering several doors at once, do not panic! That’s how he’s rolling when he feels the artistic urge. Though, once he’s succeeded entering through a door, the game is over.
Implement the following missing game feature: If the user clicks an open door, the door will close, preventing Salam from getting in. Note that it shouldn’t matter if Salam is already on the doorstep or not.
- Make it so that once a door has been closed by the user, Salam will be able to attempt entering it in the future. Numberless times.
- Count how many times Salam is denied, and display that number, in real time, as a score.