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.



CommandDescription
herpFlip the current bit.
derpIncrement the pointer.
a-derpDecrement 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

Stats:

CreatedMar 1, 2020
PublishedMar 3, 2020
Warriors Trained315
Total Skips79
Total Code Submissions381
Total Times Completed55
Python Completions40
Rust Completions17
Total Stars7
% of votes with a positive feedback rating76% of 35
Total "Very Satisfied" Votes22
Total "Somewhat Satisfied" Votes9
Total "Not Satisfied" Votes4
Total Rank Assessments31
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • beniolenio Avatar
  • chucksys Avatar
  • imjasonmiller Avatar
Ad