Beta
Derpcode Interpreter
40 of 55beniolenio
Loading description...
Esoteric Languages
Interpreters
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.
Should it be possible to access bits at negative indices, i.e. by flipping or printing them? The instructions seem to imply that negative indices are purely notional, used only for the program termination process. But the random tests (at least for the Rust version of this kata) have input like "derp a-derp. a-derp herp a-derp derp herp", which requires flipping the bit at -1 twice, as well as moving the bit pointer to -2 temporarily.
I think this should either be clarified in the kata description (e.g. making it clear that the bit "tape" should be accessible in both positive and negative directions), or the random tests should be fixed so that they don't require access to negative indices.
I probably should not have approved a rust translation I am incapable of editing. I don't know rust.
Let's see if the rust translator replies to this issue, then. Otherwise I might have a look at it myself if I have time.
Nevermind, it was just a string. I can edit strings. I've fixed the offending code.
Cool, thanks.
Some tests have
.
for values greater than 127.What tests?
The test expecting
'p0æs'
,æ
is non-ASCII. (And the return type isstr
, so there's no way to convert it without knowing the expected encoding.)is 'æ' not ascii 230? I was under the impression that python's chr and ord functions used ascii codes.
ASCII has 128 characters. Python uses Unicode.
Or the current kata issue is the other way:
From description:
but the first sample test ("h") ends with
herp derp a-derp.
You shouldn't be executing code by that point. That code literally begins "derp a-derp." Then ends "herp a-derp."
After you flip the zero bit, decrement the pointer, then print to output, you shouldn't execute any more code.
Rust translation
Approved by someone
there is either an overspecification or a lack of test about the end of the program. Compare my solution with yours, for example. => is it possible to go to a negative index for the pointer at any other moment or not? If not, you should talk about it. If it can, that needs to be tested (in the random tests too)
I wanted it to be possible, but Voile pointed out that the official language states that the negative cell value only exists for structural purposes (to end the code).
her
instead ofherp
in the input of the 10th testThank you.
Also, the value at the pointer is not supposed to switch when an octet is printed to the output. This does not happen.
Sample test has syntax error: first line is missing
"
at the end.Thank you.
Fixed.
Needs random tests.
Done! I hope everything is fixed now. It's hard to make a kata error free at first publish. Thanks for all your feedback.
Not random enough
What is the bit order?
Bit that the pointer is on and the next 7 bits in the positive direction.
This directly contradicts the official documentation you linked to:
Fixed.