Carrots. So. Many. Carrots
Minkolang 0.10, Befunge-93, ><>; 3 2D languages, 321 bytes
v[1]: http://i.stack.imgur.com/mecHl.png
v[![][1]][1]
>\$$>~:1+!#v_:"^"-#v_1>:34*`#v_v
// ^ ,<0 < >:0g,1+v
v# ,,:*52< ^+1 ,g1:<@_^#`*85:<1
>!v#(od"^"=,34*&34*[i1+1qO]!O$I)lO58*[i1+0qO].
>i:0(?v:"^"-?v1>:34*)?vv
^ o<0 < > :0go1+v
oo:*52< ^+1og1: <^;?)*85:<1
Interpreters: Minkolang, Befunge-93, ><>.
I'll go into detail on each component if anyone wants, but what's important is that all of them read the first and second lines of the codebox and output the characters at the appropriate times. Also, I decide between Befunge and Minkolang/><> by the use of \
, which swaps the top two values of the stack in the first and is a mirror in the other two. To separate Minkolang and ><>, I use !v#
. !
is an unconditional trampoline in both languages, but #
is an omni-directional mirror in ><> and a no-op in Minkolang. From then on, each language executes code in its own component.
Python, Befunge 98, Lisp, and Javascript - 829 827 +2 (-x flag in python) = 831 829 bytes
"^\
";/*";
""""(defun q (string part replacement &key (test #'char=))(with-output-to-string (out) (loop with part-length = (length part) for old-pos = 0 then (+ pos part-length) for pos = (search part string :start2 old-pos :test test) do (write-string string out :start old-pos :end (or pos (length string))) when pos do (write-string replacement out) while pos)))(princ "[1]:http://tinyurl.com/qczsjtl
")(ignore-errors (loop (princ (q (read-line) "^" "[![][1]][1]"))))""";import sys;i=sys.stdin.read();print '[1]:http://tinyurl.com/qczsjtl\n'+i.replace('^','[![][1]][1]');"""" """
1;'''
;#<v"[1]:http://tinyurl.com/qczsjtl"$$$
;X v,<
;X >:|XXXXX>v
;vXXX>a,#
;>#@~>:10g-|>,#
;^ XXXXXXXX>$"]1[]]1[][![">:# ,# _#
;X */alert("[1]:http://tinyurl.com/qczsjtl\n"+prompt().split("^").join("[![][1]][1]"));/*
;>^"'''#*/
Requires the -x
command line flag when run with python. the X
s can be replaced with any character. The end-of-line number signs (and the number sign at the beginning of the first line that starts with a semicolon) are present to avoid befunge trying to execute the invalid instruction ;
(which starts a comment in lisp). There is no trailing space on any of the lines.
Saved two bytes by replacing 55+
with a
to print a newline.
Carrot, 60 58 bytes
#^A^S"[![][1]][1]"^[1]: http://i.stack.imgur.com/mecHl.png
I know it is only one language at the moment but I thought we can't really have a challenge about carrots that isn't answered in Carrot.
Saved 2 bytes thanks to @KritixiLithos.
Explanation:
# // Set the stack to the input
^ // Change to operations mode
A^ // Convert to array mode by splitting on ^
S"[![][1]][1]" // Convert to string mode by joining on
// the literal string supplied
^[1]: http://i.stack.imgur.com/mecHl.png // Switch back to stack mode and
// append the string literal