[Community Puzzle] Tennis score

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @VilBoub,validated by @rc95401,@Kellthazar and @LantarSidonis.
If you have any issues, feel free to ping them.

In the last test case, when Bequ consecutively scores two times:

I.Begu scores 1 point
I.Begu… 4 6 6 | 6
J.Paolini… 6 1 6 | 5

I.Begu scores 1 point
I.Begu… 4 6 7 | 0
J.Paolini… 6 1 6 | 0

When the points change from 6:5 to 7:5, why it did not define Bequ winning one more game like the above?

In the tie-break rules: ā€œā€¦ unless it is the last game …, in this case there it takes at least 10 points to win the game.ā€
Actually, here ā€˜last game’ was meant to be ā€˜last set’.

2 Likes

I see…the rules are more complicated than expected.
In the ā€œTie Breakā€ test case, I got steps as below. It looks like I was out-tracked somewhere. Could you spot the problem?

A.Sasnovich scores 1 point
M.Trevisan..... 6 | 3
A.Sasnovich.... 6 | 4
M.Trevisan scores 1 point
M.Trevisan..... 6 | 4
A.Sasnovich.... 6 | 4
M.Trevisan scores 1 point
M.Trevisan..... 6 | 5
A.Sasnovich.... 6 | 4
A.Sasnovich scores 1 point
M.Trevisan..... 6 | 5
A.Sasnovich.... 6 | 5
M.Trevisan scores 1 point
M.Trevisan..... 6 | 6
A.Sasnovich.... 6 | 5
A.Sasnovich scores 1 point
M.Trevisan..... 6 | 6
A.Sasnovich.... 6 | 6
M.Trevisan scores 1 point
M.Trevisan..... 6 | 7
A.Sasnovich.... 6 | 6
A.Sasnovich scores 1 point
M.Trevisan..... 6 | 7
A.Sasnovich.... 6 | 7
M.Trevisan scores 1 point
M.Trevisan..... 6 | 8
A.Sasnovich.... 6 | 7
A.Sasnovich scores 1 point
M.Trevisan..... 6 | 8
A.Sasnovich.... 6 | 8
A.Sasnovich scores 1 point
M.Trevisan..... 6 | 8
A.Sasnovich.... 6 | 9
M.Trevisan scores 1 point
M.Trevisan..... 6 | 9
A.Sasnovich.... 6 | 9
M.Trevisan scores 1 point
M.Trevisan..... 6 | 10
A.Sasnovich.... 6 | 9
A.Sasnovich scores 1 point
M.Trevisan..... 6 | 10
A.Sasnovich.... 6 | 10
M.Trevisan scores 1 point
M.Trevisan..... 6 | 11
A.Sasnovich.... 6 | 10
M.Trevisan scores 1 point
M.Trevisan..... 7 | 0
A.Sasnovich.... 6 | 0
A.Sasnovich scores 1 point
M.Trevisan..... 7 | 0
A.Sasnovich.... 6 | 1
A.Sasnovich scores 1 point
M.Trevisan..... 7 | 0
A.Sasnovich.... 6 | 2
A.Sasnovich scores 1 point
M.Trevisan..... 7 | 0
A.Sasnovich.... 6 | 3
M.Trevisan scores 1 point
M.Trevisan..... 7 | 1
A.Sasnovich.... 6 | 3
M.Trevisan scores 1 point
M.Trevisan..... 7 | 2
A.Sasnovich.... 6 | 3
A.Sasnovich scores 1 point
M.Trevisan..... 7 | 2
A.Sasnovich.... 6 | 4
M.Trevisan scores 1 point
M.Trevisan..... 7 | 3
A.Sasnovich.... 6 | 4
M.Trevisan scores 1 point
M.Trevisan..... 7 | 4
A.Sasnovich.... 6 | 4
M.Trevisan scores 1 point
M.Trevisan..... 7 | 5
A.Sasnovich.... 6 | 4
M.Trevisan scores 1 point
M.Trevisan..... 7 | 6
A.Sasnovich.... 6 | 4
A.Sasnovich scores 1 point
M.Trevisan..... 7 | 6
A.Sasnovich.... 6 | 5
A.Sasnovich scores 1 point
M.Trevisan..... 7 | 6
A.Sasnovich.... 6 | 6
M.Trevisan scores 1 point
M.Trevisan..... 7 | 7
A.Sasnovich.... 6 | 6

Thanks

M.Trevisan..... 6 | 11
A.Sasnovich.... 6 | 10
M.Trevisan scores 1 point
M.Trevisan..... 7 | 0
A.Sasnovich.... 6 | 0
A.Sasnovich scores 1 point
M.Trevisan..... 7 | 0
A.Sasnovich.... 6 | 1

Here, after Trevisan wins the tie-break with 12:10 and thus wins the whole set with 7:6, a new set begins, so the next game should count the points again as 0,15,30,40,AD, etc

Indeed, tennis scoring is not very logical. They play for hours, but the match might be decided on a very few important points, and the winner might have scored much less total points than the loser… But maybe that makes it more exciting. A player might come back and win the match even from 0:6 0:6 0:5

PS: my suggestion for puzzle creators as the next ā€˜game scoring’ puzzle: chess swiss tournament with Buchholz or Sonneborn–Berger tie-break rules… :slight_smile:

1 Like

I.Begu vs J.Paolini : Infosys Match Centre - Roland-Garros - Le site officiel du Tournoi de Roland-Garros 2023

M.Trevisan vs A.Sasnovich : Infosys Match Centre - Roland-Garros - Le site officiel du Tournoi de Roland-Garros 2023

if I didn’t make any mistakes when transcribing the points…

I passed all the test cases and all the validators except the second, and I don’t know what the problem can be. Any suggestions to find where the error is?

1 Like

Validator 2 is similar to test 2, and the differences are in the third line of input. Maybe you can create some custom cases by changing that line to test your code?

I passed all the test cases but after submitting, the last test ā€œMatch pointā€ failed. I have no idea why as I cannot see any input.
Any ideas?

I also encounter an issue with the last validator. I am not sure that the validators are implemented correctly…this is pretty frustrating. All other tests pass

*** Tie-break rules:**
when we arrive at the score 6 6 in a set, then a ā€œtie-breakā€ is played. it no longer takes 4 points but 7 points to win the game (always with a difference of at least two points, the score in the tie-break is unlimited !) unless it is the last game (the 3rd for women, the 5th for men), in this case there it takes at least 10 points to win the game.
The winner of the game then wins the set on the score 7 6.

I implemented that case too (the last test ā€œIt’s not finishā€ is green) but still the ā€œMatch pointā€ validator test fails

It’s the match point of the game in the previous link : .V.Azarenka vs J.Teichmann

I am stucked in the validator ā€œLong Gameā€ even if all the tests passed correctly. Is it possible to give tips ?

@VilBoub Is it possible to give the match related to the ā€œLong Gameā€ validator ?

the validator ā€œLong Gameā€ : J.Isner vs Q.Halys (Rolland Garros 2022_05_22)

Thank you!

My mistake was related to this rule

the score in the tie-break is unlimited !) unless it is the last game (the 3rd for women, the 5th for men), in this case there it takes at least 10 points to win the game.

It is at least 10 points for the last set, not for the last match winning set.
Hard to debug but finally succeded!