7 kyu
Simple Fun #106: Is Thue Morse?
235 of 694myjinxin2015
Loading description...
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.
i can't understand(
i understood. haD to read topic description in my native language))
In Haskell the function is called
isThueMorse
, notthueMorse
Fixed
my test dont work correct (in haskell)
test/ThueMorseSpec.hs:12:14: error: • Variable not in scope: isThueMorse :: p -> t • Perhaps you meant ‘thueMorse’ (imported from ThueMorse) | 12 | actual = isThueMorse ns | ^^^^^^^^^^^
the test was incorrect. this has been fixed now.
Haskell : https://www.codewars.com/kumite/5bda8ea106a8a6624a000063?sel=5bda8ea106a8a6624a000063
(and now with monoids !)
I approved the last fork version, because I didn't see the spell
don't approve me
O_oNo worries, I didn't like the way I wrote the thueMorse sequence and asked Johan if there was a less dorky way to write it. He also pointed out though that the test generator I used for the randoms is really weak as there are pretty poor solutions which can pass it. I will fix that now.
I fixed the Description back. Cliff had it saved in his first translation.
Updated generator : https://www.codewars.com/kumite/5bdaafc130f84396740000c9?sel=5bdb0c3106a8a62bd3000382
Approved again...
It looks that i have to improve my english once again as i can't understand the meaning of this kata :/
You are given a sequence, see if it is the start of another sequence.
This seemed a little harder than regular 7kyu imho.
A lot of his white ones are harder than a lot of yellow ones, a bunch of the "can you guess what I did here" ones are crazy difficult (or where for me anyway).
Crystal translation kumited, cheers :)
Approved. Cheers ;-)
Even though the description says
[input] integer array seq -- An non-empty array.
, the C# test cases can still generate empty arrays. The problem is inbad2()
where it saysidx2=rand(0,79)
, which means that it might choose 0 as a value to pass toTake
, resulting in an empty array. (As it happens, an empty sequence is technically good, but that's irrelevant, since you rely on the return value of your own test, not the name of the function that generated a sequence.)Thanks for your feedback ;-) changed
idx2=rand(0,79)
toidx2=rand(21,79)
(just a typo in the translate process)