Beta
Derpcode Interpreter
40 of 55beniolenio
Description:
Create a function that interprets code in the esoteric language Derpcode
The Language
Derpcode has five commands (although for this kata, we will be using only four), although an expansion to achieve Turing-complete status is planned.
- Each memory cell in derpcode can hold exactly one bit
- All cells initialize with a value of 0
- There are infinitely many cells in the positive direction.
- Each derpcode program starts with
derp a-derp.
. This is to be ignored in terms of executing the code. - A derpcode program is terminated by flipping the 0 cell, decrementing the pointer into the -1 cell, and executing the print command. The last line that will be executed of all derpcode programs is therefore
herp a-derp.
. (Make sure not to print a letter when this ending code executes) - All programs tested for will end. You do not have to worry about cases where this ending does not occur.
- Make sure to end execution when this program ending occurs.
- For this kata, you will only be tested on raw derpcode. You do not have to worry about non-command characters and words.
Command | Description |
---|---|
herp | Flip the current bit. |
derp | Increment the pointer. |
a-derp | Decrement the pointer. |
. | Write the current bit and the next seven bits to stdout as an ASCII character. This does not increase the position of the pointer. The cell value that the pointer is at is the leading digit in the conversion to a character. |
Click Here to Learn More
Yes, I believe derpcode is meant to be as impractical as it is.
Esoteric Languages
Interpreters
Algorithms
Similar Kata:
Stats:
Created | Mar 1, 2020 |
Published | Mar 3, 2020 |
Warriors Trained | 315 |
Total Skips | 79 |
Total Code Submissions | 381 |
Total Times Completed | 55 |
Python Completions | 40 |
Rust Completions | 17 |
Total Stars | 7 |
% of votes with a positive feedback rating | 76% of 35 |
Total "Very Satisfied" Votes | 22 |
Total "Somewhat Satisfied" Votes | 9 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 31 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |