RProgN , 142 바이트, 비경쟁
function tostack 'b' asoc stack 'a' asoc 0 'v' asoc b pop byte 'o' asoc b len while [ v o b pop byte ] 'o' asoc - + 'v' asoc b len end [ v end
이 도전 과제를 발견 한 후 'tostack'명령이 추가되었으므로 경쟁이 아닙니다 (바이트 수가 끔찍하더라도).
테스트 사례
Hello, World!
-39
Cool, huh?
-4
설명
function # Push the function between this and end to the stack
tostack 'b' asoc # Convert the implicit input to a stack, associate it with 'b'
0 'v' asoc # Push 0 to the stack, associate it with 'v'
b pop byte 'o' asoc # Pop the top value of b (The end of the input), get the byte value, associate it with 'o'.
b len # Push the size of b to the stack
while [ # While the top of the stack is truthy, pop the top of the stack
v # Push v to the stack
o # Push o to the stack
b pop byte # Pop the top value of b, push the byte value of that to the stack
] 'o' asoc # Push a copy of the top of the stack, associate it with 'o'
- # Subtract the top of the stack from one underneith that, In this case, the old value of o and the byte.
+ # Sum the top of the stack and underneith that, that is, the difference of the old value and new, and the total value
'v' asoc # Associate it with 'v'
b len # Push the size of b to the stack (which acts as the conditional for the next itteration)
end [ # Pop the top of the stack, which will likely be the left over size of b
v # Push the value of v to the top of the stack
end # Implicitely returned / printed
RProgN은 역 폴란드 표기법을 염두에두고 작업 한 난해한 언어입니다. 변수 할당이 4자인 현재는 매우 장황하지만 앞으로는 약간의 syntatic sugar를 추가 할 계획입니다.
또한 RProgN은 스택에서 인수에 암시 적으로 액세스하여 동일한 방식으로 반환합니다. 프로그램이 완료된 후 스택에 남아있는 문자열 데이터는 내재적으로 인쇄됩니다.