7 kyu
Paul's Misery
1,670 of 3,729PG1
Loading description...
Fundamentals
Arrays
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.
okay but a bit boring
Just attempted again and passed all 103 tests without changing anything, strange.
I'm passing 102 tests when attempting and failing on just 1 in JS, i think theres a problem with the tests its saying expected 'undefined' to equal 'misserable'. Somethings not right!
This means your code returned sometime
undefined
, when it should not. Attempt tests are random so it's likely your code only fails with determined inputs that random tests do no always generate. It's no use to open two threads for the same thing.Ah right i didn't realize, thanks for the info.
This hits close to home on an almost creepy level Maybe not the excellent coder part
man, paul really hates pete's progress
< 40 = 'Super happy!' < 70 >= 40 = 'Happy!' < 100 >= 70 = 'Sad!'
if overall score is 100, Paul should be miserable :)
I'm getting an error for the 3rd test-- I believe it's incorrect!
This comment has been hidden.
Hmmm.. seems like you need to add how many points each value will add for the final score, for example, how much score 'eating' will add.
Java's translation: https://www.codewars.com/kumite/61daf4e32fdc2a001f297659?sel=61daf4e32fdc2a001f297659
Approved, thanks
This comment has been hidden.
In js, always failing tests if score more than 70. So it's wrote on console, that's the string 'Sad', but expected 'Miserable!'. I think it's an error in tests
At the time of writing 677 people have solved this in JavaScript. The tests are unlikely to be the issue. Try sharing your code using the 'spoiler' tag or asking about a specific test case that is failing.
You say if the score is more than 70 then the error message is
'Sad', but expected 'Miserable!'
- note that if the score is more than 100 the correct string is indeedMiserable!'
- have you factored this into your solution?C++ translation kumited
Approved, thanks
maybe the description should be updated from =100 = 'Miserable!'
to />=100 = 'Miserable!'
Consider updating the description like so;
At first glance, I was thinking it was a single equality equation.
I agree. However, I think he didn't mean to write it inline because codewars weirdly ignores a single newline.
Done
Fifth and final triplet for today
Coffeescript
Crystal
Julia
All approved, have a rest
Thanks a trillion :)
definitely feeling like paul right now lol
Forked python translation with new test framework used and 3.8 enabled ~~
Haskell : https://www.codewars.com/kumite/5bc162bfa10a5ba7b8000013?sel=5bc162bfa10a5ba7b8000013
Approved :D
Ruby Test Results: Basic Tests Simple Cases (3 Passed, 0 Failed) Random Tests More Complex Cases Testing for [10, 10, 5, 5, 10, 0, 0, 0, 1, 0, 5, 5, 10, 1, 0, 5, 10, 1, 0, 0, 10, 5, 10, 0, 0, 1] (1 Passed, 0 Failed) #<TypeError: nil can't be coerced into Fixnum>
+'
block in paul_rand_tests'each'
paul_rand_tests'block (3 levels) in <main>'
each' `block (2 levels) inDo the More Complex Cases test for an array of integers? I thought it supposed to test for an array of strings like in basic tests. What I am missing? Thank you a lot
This comment has been hidden.
Does solving Kata "like a banshee" involve lots of wailing and screaming?
I can only imagine so
Are your calculations and testcases correct? Strange results or i misunderstand something;-)...
Just checked and look good to me... whats the issue?
For example: description: kata = 5 Petes kata = 10 life = 0 eating = 1 Test.assertEquals(raul(['life', 'Petes kata', 'Petes kata', 'Petes kata', 'eating']), 'Super happy!')
Surely i misunderstand your kind of calculation?
Ah you're right! updated the code but not the description! Hold on...
Fixed.. as ever - thanks for raising!
Thanks for fixing;-)... but it isn't... example tests ok, submit with error:
Who is paul;-)?
Ok, found the issue - i didnt change the initial solution. the input is 'paul', not 'raul'. Fixed
Thanks - works, but i'm a little bit disappointed... Paul?? Raul was much better and so my special last code-case (warning for a real well known person:-)) is unnecessary;-)...
Upvoted your solution. I like your style! :)