8 kyu
Grasshopper - Messi goals function
33,723 of 105,603danleavitt0
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Messi goal compilation 2014 my hearts a stereo
messi better
I can say, this task is about - who can make solution shorter.
ronaldo is better >>> factos👍👀
I liked this little exercise, but 8kyu seems to be either 1kyu or 16kyu in difficulty :)
What the hell
btw it was ez
This comment has been deleted.
n gostei n
C++ is free drug
SQL testing is bogus
Why
How
EZZZZZZZZZZZZZZZZZZ
I'm confused a bit with this kata! doing it with sql. when running test it's returning me correct values but in a different order and failing. when hit attempt the situation is more confusing - I'm getting some values matched some not and in different order. when I'm selecting all columns and their sum just to manually check sum, I'm seeing that in actual result my sum is correct, but expected is failing
Why is this 8kyu?
8kyu is the easiest tier of kata. Do you think it should be graded harder?
HALA MADRID SIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIU
i'll fork this for cr7. SIUUUUU
This comment has been hidden.
Cache issue. You need to refresh the page after a while if this happens. If the issue still persists, you may reach out to [mods on discord(https://discord.com/invite/mSwJWRvkHA)
You can add Major League Soccer after this season!
Crazy, did't take about columns with name res? WHAT, how is it to understant it?
Wait what? That was it?
SUIIIII EZZZZZ
sewY
That was really hard
Actual and expected are swapped in PHP
Fork approved, changes made:
Scrutinized tests
Added useful assertion messages
Swapped order of actual and expected
Added corresponding headers to be compatible with PHPUnit 9.5.2
This comment has been hidden.
This comment has been hidden.
The sample tests for TypeScript are pointless, for they don't cover the work of the function in question
Zero sample tests for CoffeeScript
Something has been broken. No result for sample tests, though code passes main tests.
took me an enntire day to finish
Nice, they made a function for the second best player in the world 👏🏼
thats true
But what about goals in Ligue 1 and at the World Cup..
This kata was made in 2015, and Messi began participating in Ligue 1 only in 2021, ergo the goals in Ligue 2021 shouldn't be accounted.
The World Cup, though... yeah, the first goal he scored at the World Cup was in 2014, so... =/
Nice kata
getting the sum of three inputs isn't too tricky if the three inputs are all numerical; when a non-numerical input is provided as one of the three, it gets trickier -- luckily it looks like the test only checks for numerical inputs
And why is it an issue?
Please read this: https://docs.codewars.com/training/troubleshooting/#kata-bug
still typing the var names..
The function itself is super easy. The chalenge is to get names for everything.
Instructions should be in the description not in the solution section as comment.
This comment has been hidden.
OP solved it, closing!
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Hi, anyone did this KATA in SQL recently? In test mode, expected return shows 2 rows: 0 and 58. However, after submitting, it returns error with expectation of 100 rows? Thanks for any hints!
Attempt tests have more rows, that's not an issue. Probably your query isn't right. I retested mine and it still works.
Thanks for your check! It motivated me to revisit the KATA and I found the bug. Thanks again!
The names for the columns were longer than my entire query... I really recommend using shorter names for an exercise such as this to avoid all the unnecessary typing
This comment has been hidden.
COBOL translation
решено
I think this might be too similar to other kata. I can't retire it, though, because I don't have enough honour.
Nothing can be done ~~
This comment has been hidden.
To have more than a single test?
The initial code is giving you all you're asking here:
A conditional block could be used in the kata description, but not everyone knows about them.
Fair point. I deleted the comment without reading to start from a clean slate, before trying to find the schema names.
BF translation: https://www.codewars.com/kumite/5fb7419ea5d7b50008423ec6?sel=5fb7419ea5d7b50008423ec6
Approved by someone
Vendo a solução, vi que o problema é a explicação, bem ruimmmmm
Não funciona em SQL ¬¬
No teste da isso, pior ainda na hora de enviar o resultado, pede mais de 100 linhas
Test Failed expected: 2 got: 1
The variable names should be in snake_case rather than camelCase for Python
Not sure why the hate on this Kata. We need a few super easy 8 Kyu's sprinkled in to get people sucked into the website. Then again, it's Messi, so some hate is valid...
Too hard for me
kata too easy - 10kyu? also football is a terrible, terrible sport
Blasphemer.
can't agree more
This comment has been hidden.
I think it's not working in SQL.
Test: expected return 2 rows: 0 and 58 (the right result).
Submit: expected return 100 rows (¿?)
And what's the issue with this?
Maybe I didn't understand the goal of the exercise...
Can you explain me what's the meaning of the rest of the rows?
It's supposed you have to return only the sum of all the goals, so just one row...
I can run my code in local SQL client very well but in codewar, it always told me "undefined method `[]' for nil:NilClass Simplified backtrace: block (4 levels) in spec". Really don't understand what is the issue.
Kata task in Ruby is different from other languages. Please change.
Please provide clearer info as currently the task in Ruby is equivalent among other languages
Why so difficult?
Kata's should be tagged with the level of dificulty, this one was way too easy , i though it would be something more challenging.
NASM translation
CFML Translation!
Prolog translation kumited. (author is inactive)
Another idiotic kata...
Why is there : int befor the opening code block. Not seen this before I'm a begginer. Thanks
It specifies the return type of the function.
C, Clojure, Elm, Java, SQL, and Shell translations
This comment has been hidden.
Factor translaiton as well
Haskell translation Crystal translation Dart translation Elixir translation Reason translation R translation
Bump.
Racket translation
Julia translation
Sample tests in Ruby are broken.
Fixed.
add example tests
Added.
I'd suggest adding test cases.
Some beginners are new to programming overall -- not just the syntax of a specific language. Therefore, a couple of simple test cases would save them the confusion of either skipping that step or of figuring out how test cases work.
Suggested language for description: Messi is a soccer player with goals in three leagues: LaLiga,Copa del Rey, and Champions. Complete the goals function to return his total goals for all three leagues.
Note: the parameter for this function will always be a valid number.
Rationale:
Typescript translation Kumited! please Accept :d
Typescript does not compile, unsure if it's the test or something else
It was because Codewars performed some changes on their containers, now you don't have to add the location of the libraries as a comment inside of your
node_modules
folder, it is only enforced on unit test, that's why choosing an elder TS version was the trick to pass. It's now fixed btw.Thanks for the fix!
Kata description is not clear
Duplicate.
Needs test cases.
Duplicate.
You should sort out the tests. Filling them in is a pain. Plus, who cares about Messi?!
Why do you feel the need the fill them in? If you dont care about writing your own tests just click submit.
The description specifies valid numbers are from 0-50 but doesn't implement it
That was updated.
I think this is a great beginner kata! We need more like this one. Translated into CoffeeScript and Ruby for your approval.
too easy
8 Kyu kata were supposed to be super easy. They are meant for users just learning to program.
This comment has been hidden.
Duplicate.
Who is Messi? The description doesn't make it clear what operation we should be doing for the output.
Sports are hard.
Messi is a soccer player
Duplicate.
It wasn't clear to me what the parameters ll, cdr and cl were meant to represent. I guessed that the three numbers should be added, but this wasn't clear from the description.
This comment has been hidden.