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.
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ā.
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ā¦
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?
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 ?
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!
Iām trying to code this in C# and wondering how to convert the hexadecimal (ā1Aā) to the string ā0001 1010ā. Any help is appreciated.
Peter
static string HexToBinary(string hex)
{
hex = hex.Replace(" ", "");
string binary = "";
foreach (char c in hex)
{
int value = Convert.ToInt32(c.ToString(), 16);
binary += Convert.ToString(value, 2).PadLeft(4, '0');
}
return binary;
}
I ran into the problem of passing all except Validator 2 as well, and by checking the contribution found out the following:
Probably @Nostale, a long time ago, encounter the same problem: seeing 40 as valid score, but it should be ā-ā since the other player is over the edge of valid game scores (i.e. outputting 40/AV while it should be -/AV).
Apologies, I donāt know the tennis lingo so quite possibly I am explaining it wrong.
So, a small imbalance in test vs validator (validator is testing an edge case not covered in the cases) - but still I liked this puzzle a lot.