6 kyu
Piano Kata, Part 1
1,058 of 3,454tachyonlabs
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.
Remember that an 88-key piano starts at A, not C. That threw me off
The picture in the details is not available anymore.
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRIa1D3hB1KhokoIouxdifqclgELwWAOQxYBg&s
python new test framework
Approved
I understand that you need to look at this small picture and consider where are the white keys and where are the black ones? Otherwise, I can’t understand the location of whites and blacks in any way.
TL;DR
SQL Translation
88-key keyboard:
https://shademark.ru/wp-content/uploads/2019/01/88d05c3e129bc327b13f9c6475dfb6ba.jpg
COBOL translation.
approved
what note does it start?
A0
in this case the 89 key must be black because (89 mod 12) = 5
At first I was puzzled too. Then I realized that he treated key 88X + Y as Y (Because his piano only has 88 keys XD)
I didn't even think about it. Thanks.
picture does not load
It does. Must be a problem from your browser or connection rate.
It does not load for me either, probably my browser rejects it as a mixed content referenced via HTTP from a HTTPS page.
thanks, as I understand there was a problem with the browser.
mocha
+chai
) should be enabled (Refer this and this for more info)Fixed in this fork
This was certainly written by a programmer who doesn't think like a keyboardist lol
There is a gross mistake in the given piano and the definition this kata assumes. NOT EPIC.
what is it?
The description bothers me, because playing ascending chromatic scales you would only use your thumb, index, and middle fingers.
Java test cases should inlcude border examples as my solution is wrong and i have passed the kata.
Please specify which test would break your solution
Hi,
Each time when I run submit tests I get random test failures but when I try to run the same test in test playground it works for me. And the pressKeyCount in the failed test could be different, it includes a small number and number greater than 88
-> GO lang
"but it works locally!"
not a kata issue
So iteresting kata, but from not native english warrior description is very difficult . At first, i can't understand how key will be pressed after 88: 1st or 88th, 87th and e.t.c.
i'm too(((
This comment has been hidden.
Thanks a lot! Really enjoyed this Kata.
You're welcome, I'm glad you enjoyed it!
I tried to train with this kata in Haskell - but it doesn't have a Haskell implementation stub or unit tests. Should I just move on or should this be not marked for Haskell? /shrug
Thanks for the report! If I edit the kata I can see that the Haskell initial solution, tests, and example tests are all there, but I can definitely reproduce your problem in that if I train on the kata and select Haskell, nothing is coming up. :-( On one hand, Codewars is having server problems right now period, so I will check again when they are cleared up and see if things look better, but on the other hand it also looks suspicious that the only Haskell completion was the person who did the translation, whereas for another of my katas with a Haskell translation that I just checked, there have been 20 Haskell completions. So I'll get back to you on this.
Seems fixed
I had to look at a real piano before I realized I used wrong number of keys per scale. Great kata.
Thanks, I'm glad you enjoyed it!
hi, I have problem on the random test. I see error like 7696 should be white. My code actually return white for that input. Same error with a lot of different input value. I added 7696 (or the other values) to the BasicTests and all of them pass. I am using the language Go. Thanks!
Ok my code had a bug so it was my fault. But most of the errors printed in the RandomTest are incorrect. I don't know how it works, but if the code pass 99% of the tests I expect to read only 1 error. Instead RandomTest prints a long list of false positive. Anyway this was a fun kata! Thanks 🤓
Yes, 7696 should be white. Along the lines of what I had said below to a similar question about the Java tests a few days ago, although bugs can always turn up, there have been 41 successful completions in Go so far. Do you want to post your code as a reply (marking it as a spoiler) and then I can take a look at it and see what is going on?
The problem was that my bugged code worked well for 7696 and a lot of other cases printed as errors. In the middle of this "false positive" I finally found the real one that let me find the bug. Thanks for your time
I see we were typing our responses at the same time. :-) I'm glad you figured out your bug and that you enjoyed the kata, but because of the repeating-patterns aspect of the black and white keys it seems very unlikely to me that a bug would cause a solution to fail only one random test. If you still have the version of your code that was failing, you could post it and I could see exactly what was happening with it and the random tests, but if not, I will close the issue seeing as your code passed once you fixed your bug.
This comment has been hidden.
Not a kata issue
This comment has been hidden.
Hi! What language are you using?
Java
On one hand there have been 91 successful Java completions so far, so I assume the random tests are OK, but on the other hand bugs can always turn up. Do you want to try posting your solution as a reply, and then marking it as a spoiler, and I can take a look at it? (I haven't asked anyone to do that before, but I would think that as the kata author I should be able to see comments marked as spoilers.)
Case close. It was my fault. Edge case :) Very good Kata :)
Thanks -- I'm glad you enjoyed it and that you figured out the problem!
Hi tachyonlabs. Haskell solution kumited for release.
Thank you, a Haskell version will be a great addition! Though before approving it I have some things I want to ask you about -- I will ask in a comment on your translation.
This comment has been hidden.
No, the description says, "Once you get to the rightmost/highest, 88th, key, you start all over again with your left little finger on the first key.", so rather than it being some kind of infinite keyboard, you keep wrapping back to that first low A.
Thank you for clearing that up. I apologize for misreading the description.
Confused. All my tests pass but the test window border stays red and I can't submit my solution. Is there some kind of constraint that tests should run at or faster than an unspecified benchmark?
Even the custom tests I wrote "Fail" even though each individual test passes:
Time: 385ms Passed: 11 Failed: 0 Test Results: Example tests ✔ Test Passed: Value == "white" ✔ Test Passed: Value == "black" ✔ Test Passed: Value == "black" ✔ Test Passed: Value == "white" ✔ Test Passed: Value == "white" ✔ Test Passed: Value == "white" ✔ Test Passed: Value == "white" ✔ Test Passed: Value == "black" ✔ Test Passed: Value == "white" ✔ Test Passed: Value == "black" ✔ Test Passed: Value == "white" Completed in 2ms
Currently Codewars platform is experiencing issues.
https://github.com/Codewars/codewars.com/issues/893
Yeah, there was a general CodeWars bug preventing any katas from being completed/submitted. It is fixed now, so go ahead and resubmit!
I don't get the solution, keep getting errors. Been trying for over an half hour but still stuck withthis kata
Good luck -- I know that feeling! Hopefully you will figure it out soon, or otherwise take a break from it and later think, oh, I get it, and get back to it.
Great kata! And it was funny to code golf the solution :-D
Thanks!