C@ (cat) is an esolang speedran by User:BoundedBeans. Let’s see how long it takes to write this exclusive specification.
All characters of input are pushed onto the stack at the start of the program.
: duplicate / swap $ discard . print Anything else: push to the stack.
.....
.
This is normally a one character cat taking the last character, but if the input is ., this program is a quine. In fact, any program consisting of only dots is a quine if given only dots as the last (program length) characters of input.
/..
C@ cannot create any larger cats than two characters, though it can make text reversers, and it can make quines of any size.
Will scramble the last 10 characters of text
/../../../../../../../../../..
Works with 10 characters.
C.A.T..C.A.T..C.A.T..C.A.T..C.A.T..C.A.T..C.A.T..C.A.T..C.A.T..C.A.T..
H.e.l.l.o. .w.o.r.l.d.!.
Alternatively:
!dlrow olleH............
This may be a somewhat useful language for text-processing algorithms that:
Implementation in Python (which I'm just learning, so forgive me if it's bad):
program = "....." #<- insert program here
stack = input("")
output = ""
for i in program:
if i == ":":
stack += stack[-1]
elif i == "/":
stack = stack[:-2] + stack[-1] + stack[-2]
elif i == "$":
stack = stack[:-1]
elif i == ".":
output += stack[-1]
stack = stack[:-1]
else:
stack += i
print(output)
#input command is here so that you can see the output when directly running the file through File Explorer
#as soon as you press enter the program will end
input("")