[Community Puzzle] Video Assistant Referee

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @_yel_p,validated by @Timinator,@Aldoggen and @Lanfeust.
If you have any issues, feel free to ping them.

I have a trouble with this puzzle :(, even if I unjoyed to find my solution.
My program is able to pass all the test cases but is failing for 4 validators (3, 5, 7 and 10). I’m abit surprised by this difference.
would you see any specificity for these compared to test cases / other validators?
Thank you by advance

I was found mistake like below

onside or offside , but not both solution at the same time

The puzzle statement makes a distinction between being in an offside position (first line of output) and having an actual offside offence (second line). There is no contradiction, just re-read the statement carefully. Maybe the chosen wording in the output is not the best.

What language are you using?

Hi Timinator,
I’m using Python3

I found a way to validate validators 5 and 10 in game player were not check to be in there side for official validation. So this case is not covered by initial tests. Now I’m chasing my other miss…

I’ll send you a PM.

Hi, I’ve got 93 % score in this puzzle, in my case #12: Socios is wrong solution. Could You share more data link with this example becouse I dont know what is problem . My local test case result was 100%.
I meant could You share for case#12 socios input and output data ?

I will send you a PM.

Thank You so much, I’ve fix my solution and I’ve 100% score.

1 Like

for scenario 2(#2 cafu,the right back) there is not an active player in the offside position however the expected result is a player in the offside position
Do we consider that player a (non-active) is in the offside position?

Yes, the player is in an offside position. However, because the player is not active, the VAR ruling is ONSIDE.

Enjoyable puzzle… There were two important details that I thought were unclear in the problem statement; I think it would be a good idea to be more explicit about them:

  • When you say “nearer to the opponent’s goal line”, you mean “nearer to the goal line that is being defended by the opponent.” A reasonable person might expect a team’s goal to be defined as the goal they are pushing the ball towards. Similarly, a team’s “half of the pitch” is defined as the half they are defending, which is less than clear.

  • A player can only be offiside if they are a member of the team defined as “attacking” based on the ball being “o” or “O”, even if they are on the opponent’s half of the pitch. You hint at that but not in a very clear way when you say: “The offside rule applies only to players in the opponent’s half of the pitch. This makes sense since you can’t be offside if you are positioned in your own camp. Only players who “transgress” the middle line and “attack” the other camp might fall in an offside trap”