We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

ciltfoln

From Esolang
Jump to navigation Jump to search

ciltfoln is an accumulator-based esolang created by User:bröd.

Instructions

ciltfoln works with the accumulator using these commands:

Command Description
0–4 Subtract the digit's value from the accumulator.
5–9 Add the digit's value to the accumulator.

When the program ends, the accumulator's value is printed. Commands that are not 0123456789 are ignored and considered as comment.

Implementation

Perl

$s+=$_>4?$_:-$_ for<>=~/\d/g;print$s

Haskell

main=interact$show.sum.map(\a->let d=fromEnum a-48in if d>4then d else-d).filter(`elem`['0'..'9'])