4 kyu
Play Tetris : Shape anastomosis
Loading description...
Games
Puzzles
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.
For some reason few random tests are failing with expected '' for JavaScript, even though there is a clear solution it happens with 7-12 cases out of 100 only
You forgot to check for the 'anastomosis' part in your code (last paragraphs in the explanation). So, the issue here is your code. Closing this issue.
I was able to solve this kata while my algo was not complete.
block:
board:
To fix this issue, I suggest to add more constant test cases where each cell in the board that is adjacent to a block's empty cell outside the block is either
'■'
or'□'
(only adjacent blocks that I consider as an "outer corner", i.e., not to the left/right/top/bottom of the block's empty cell.For example, if we take the board above, we need the following test cases where the above board is the same, except for the following cells:
So, for the test case where
board[9][5] = '□',
the board will look like this:This will ensure that my method of solving this kata will not randomly pass the test cases.
Guys, don't mutate the function inputs (board & block), otherwise the tests will fail! IMO, it should be mentioned in the description.
Great kata, brushed up on finding boundaires concept
I think formatting in the description got messed up... A pity, because I would like to try the kata but now I have no idea what it is about ;)
kata is still solvable if you look at the tests and know the game ..give it a try
and if you still dont get idea then comment me back i'll explain you...
Fixed.
It appears that none of the random tests are working. They all required me to return "", even when there was an obvious solution.
Please don't modify the input.
Great kata! I love Tetris!
;-)
Interesting kata, voted, ranked, approved.
Older than one year - well done:-)!
Hi gabbek,
can you please check my kata (https://www.codewars.com/kata/probable-prime-or-composite-much-bigger-primes) and give me your opinion? Thank you.
@smiks I'll try it out most likely tomorrow.
Thanks tester,moderator ;-)
I'll try minesweeper in a few days, so stay tuned! :)
This comment has been hidden.
Thanks for your suggestion, but I think output type is not a big problem in this kata, maybe someone can solve this kata by a diffrent way(did not use the array). Also, use the string to verify the answer is more convenient than using an array of verification, with little time to convert an array of strings
OK, no problem.
Why is that?
assertSimilar
works well for arrays.You can imagine that the author is your boss ;-) He always had some strange requests. Such as reverse a string, making a palindrome string, count the vowel characters... All you can do is output data as required, and don't complain about why it's not a different format. Hahaha! :D:D:D
Very nice, sapid and hard kata! Awesome!
I was really inspired while solving :)
Please add some examples of input and output. I don't usually start Katas without it.
I will add This at example testcase ,but I'm busy now , add it later
So... nice one again;-) Many thanks for the good katas!... But something is wrong with my solution or your random tests (probably my solution, which was very quick done, without optimizations;-))... First submit was ok, changed some useless things before final, second submit with no code changes throws one random error and third submit again ok... So no great thing, but a little "issue" i think;-)
Thanks to your work and feedback. I copy your solution and run it, by contrast, I found that my code boundary check is wrong , I've fixed it. And, Your code is not exactly correct, when there are more than one of the same block appears, your code is returned the second one(I added this to the example test.)
Thanks for your response... yes i know this (only second, generally only last one is recognized), but i stopped it, because it was accepted;-)... It's not difficult to complete this, perhaps i do it, perhaps not:-)... Nice one, seems to me, you have fun in publishing...:-)
So, fixed it;-)... If you delete the second if- condition (see my comment in code) it finds every same block position inside the board, not only the first (or as before the last);-). Than it simply combines the second-, third- positionlist a.s.o behind the first one;-)... Code is bad, i know, but normally i would not submit again if tastcases change and code perhaps needs more new work;-)