Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Programe working fine until emojis and LOTR letters ;-;

R
RAON2812 (230 points)
2 4 5
in HW2 by (230 points)
I tought my progra was running just fine up until i started testing with the random charcater tests (the ones in japanese and emoji etc)

example

the test test_emoji_5_10_100 has an expecting result of:
[3, 0, 1, 2, 4]  according to the test program

But i get:

[2, 3, 4, 0, 1]

Out of the 16 test runned by the test program, 10 come out as fail

and I really cant pin point WHY

Has anyone had the same problem?
372 views

4 Answers

a
angelaob (1190 points)
2 4 7
by (1.2k points)
Hi, I had the same problem. I realized I didn't write the code for summing the values of the whole strings correctly if two players have the same number of points, and also my code for the ranking list was wrong. Read carefully that part of the instructions for homework, because you have to fulfill two conditions at the same time: first the total number of matches won, in descending order, form most to least number of wins, but when two players have the same number of wins you order them according to their initial position, which is basically ascending order of indexes. Hope this helps!
gianluca5539 (9820 points)
4 6 44
by (9.8k points)
Be sure to handle the ties in the final leaderboard as requested, that caused the same problem in my case.
KilianS (3590 points)
7 10 27
by (3.6k points)
try printing out the emojis acsii values and check if it returns the right values. are you sure the error only occurs with the emojis and japanese thingies? i thought i had the same error, but for me the problem was just that it was the longer strings.
Simone Russolillo (5790 points)
7 10 22
by (5.8k points)
I've got the same problem and I can't see the reason why it happens. I thought the problem was in case of tie but instead the final scores are wrong. The thing is they are wrong just for some tests while for the others it works fine.
a
angelaob (1190 points)
2 4 7
by (1.2k points)
final scores you mean the final ranking list? it could be that you have a problem with the ranking list only when some players have the same number of matches won, which happens in some tests and not in others. so your program works well when every player has a different number of matches won