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.

Elephant

From Esolang
Jump to navigation Jump to search

Elephant is an esoteric programming language made by User:Dragoneater67. It was based on the idea of rewriting images.

Overview

The program is a square grid represented by a raster image. The rewrite rules are encoded in the columns: The leftmost column is the separator. The rest of the columns are rewrite rules, each separated by the separator. The initial string is encoded in the rows where each row is a symbol, the first symbol is at the top, and the last symbol is therefore, at the bottom. An example is provided to better show how this works:

01011
01001
01011
01001
01011

This defines the replacement rule:

11111 -> 10101,11111

With initial string:

01011,01001,01011,01001,01011

The interpreter iterates over each replacement rule of the list, it searches for the leftmost occurence of the left part of the rule in the initial string, then replaces it with the right part of the rule. Upon reaching the last element, it goes back to the start of the list. The program halts when there are no applicable rules.