6 kyu
Thue-Morse Sequence
268 of 743SandQueen
Loading description...
Strings
Binary
Algorithms
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.
Haskell translation
Won't run under python - Msg follows: STDERR: Traceback (most recent call last): File "/workspace/default/tests.py", line 2, in from solution import thue_morse ImportError: cannot import name 'thue_morse' from 'solution' (/workspace/default/solution.py)
It'll run as long as you don't change the function name in the initial code.
Would an eviler edition of this kata targetting the last digit be feasible?
Couldn't make that evil enough. A too simple generating function exists.
done
C translation (author gone)
Approved
Python new test framework should be used (Refer this & this for more detail)
Ruby 3.0 should be enabled (Refer this & this for more detail)
Python update
.
I don't understand why thue_morse(5) should return "01101" and not "0110100110010110"
I think this explains it well :)
Indeed, my mistake :) Thanks for the answer
[CSharp] Test cases clearly go against Kata Description. Kata Description states input will always be
1 <= n <= 10000
but I included this line in C# code:... and it throws
ArgumentException
in random tests. Please either (1) modify the Description to reflect this or (2) modify the C# random tests to use smaller values compliant to the original Specification.This comment has been hidden.
No instruction. Copying-pasting is fine, but only a link is not enough :/
I avoided adding that because I would just copy/paste the first sentince from Wikipeadia (the link provided). Do you think that it's still worth adding?
Here a kata from
@myjinxin2015
about Thue Morse sequence. It has a simpler sentence describing the algorithm to construct the sequence and also some examples.If you want another way to describe it, you can also say that this sequence is known as "parity sequence", the parity of number of 1's in binary representation of n and let players check how to construct this sequence.
Feel free to add any information or even a link to
@myjinxin2015
's kata: it's easier than yours so it can be useful to do it before this one.Alright, I added something. If you think it's enough, feel free to mark this issue as resolved. Otherwise, I'm open to more suggestions :)
Lovely!
Example test cases formatting are wrong.
Should be fine now. :)