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.

Meta Cat Program

From Esolang
Jump to navigation Jump to search

This is my SECOND programming problem I've written. yay. I guess. 5anz (talk)

Given an input, a Meta Cat Program outputs a program that outputs the original input. Both programs (The Meta Cat Program and the output of it) must be in the same language. For example, Python cannot print JavaScript code. I mean, it definitely can, but then it wouldn't be a Meta Cat Program. Well, unless it outputs a Polyglot, but we're getting too technical, and we're missing the point

Below is a diagram (that I made in MS paint) that explains a bit how this works, because I'm not confident in my ability to explain things.

Text --in--> Meta Cat --out--> MC Output --out--> The original text but I can't exactly show that in text though, can I?


This is also kind of a combination of a Cat Program and a print("Hello, World!") program, and unlike those, this can actually be somewhat useful.

Implementations

Add an implementation in you're own language if possible.

1nteger

SET inp
WHILE int > 0
    PNT 1347310624
    PNT int / 100 + 48
    PNT int / 10 % 10 + 48
    PNT int % 10 + 48
    PNT 10
    SET inp
END

Brainfuck

+++++++++[>++++++++++<-]+>[<+>>+<-]>+++>>+++++++++[>+++++<-]>[<+<+<<+>>>>-]<<+>-->,[<<<<<.>.>.>>>[<.>-]<<.>>,]

Python

#actually programmed this at school.
outOut = input()

print("out = \"\"")
for char in outOut:
    print("out += chr(" + str(ord(char)) + ")")

print("print(out)")

><>

i1+:?!v1-'0'o>:      ?v'o'o
      >';'o;!^-1oo'1+'<

Septem Lingua

@import stdin from process
let t<-stdin.read()
for i in t do
    print "print ascii_decode(",ascii_encode(i),"),end<-\"\"" 
end

Free2Edit

gcwsp*p0ws-1p+p1wepopcgcwe

See Also