[Community Puzzle] Street Fighter : Level I - Puzzle discussion

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @nguyen.lam,validated by @JeZzElLutin,@kayou and @Regulus136.
If you have any issues, feel free to ping them.

Instructions do not specify what the attack options are. The example shows only “KICK” and “PUNCH” but does not explain that “SPECIAL” means to use the special attack.

Instructions do not specify the win condition, only that there will always be a winner. Losing all health is clearly an immediate lose condition, making the other player the winner. But in cases where both survive, is the winner based on the number of hits, the total damage delivered, or total health remaining? Given that various sports use different win conditions, this should be specified.

if there is no KO, the winner is the one with more life.

Should add that to the instructions.

The special attacks are a little bit ill defined. For solving the problem, you needed to know that Vlad’s attack is based on the opponent’s rage BEFORE you hit, and then the rage is added. It is also not clear whether the opponent’s rage should be set to zero, and then you add one rage point for a hit, or whether it should remain zero. For the attack which is based on damage, it is unclear whether this is total damage, or damage from the previous successful attack. I assumed the former, but I don’t know if this is important for any of the tests,

For all attacks:

  • you apply the attack that means you remove the number of points according to the attack: Kick=4 means: you remove 4 life’s points. That’s it.
  • Then the champion who received the attack has his rage increases by 1.
    IT is written in rules: “- When a champion is hit, his/her rage increases by one.”

When a champion uses his SPECIAL attack:

  • you apply the SPECIAL attack then you increase the rage for the champion who receives the hit.
    For VLAD’s special attack it is written: the hit value is : 2 x (VLAD’s rage + opponent’s rage) then vlad’s rage = 0 (cf rule: - When a champion uses special attack, his/her rage restarts at 0.) then opponent rage = 0, so the opponent rage is also reset to 0.

For all champions, when using a special attack:
the champion’s rage is reset to zero (cf rule: When a champion uses special attack, his/her rage restarts at 0.)
the opponent’s rage is increased by one (cf rule: When a champion is hit, his/her rage increases by one)
That’s it !

“the opponent’s rage should be set to zero” => it is never the case except for Vlad’s opponent and it is written in the special attack for vlad: (2*(rage+opp.rage);opp.rage=0)

I agree, this should be added to the instructions.

At least, mention the facts that

  • rage of the kicked one is increased after the damage is applied (which is particularly important for vlad special attack).
  • Knowing that, if the opp.rage increases after being kicked by vlad special attack, or not. Is it reseted to 0 then increased because being kicked, or just set to 0 and not increased at all ? (i know the answer, but it should be in the instructions)

Similarly, when does the number of kicks of the kicker increase ? before or after applying the damages ? Could change JADE special attack damages.

Cool puzzle though, thanks.

I think that is a cool puzzle and I figured out all the mentioned things without needing any further instructions. Anyone should be able to think when to add damage, when to increase hits, increase or decrease rage… Adding more instructions will give too many clues on how to solve it. Im not the smartest one and I just needed to move one line to make it work in all cases, and after moving it I instantly thought “its logical”…