p="#include ^nP#include ^nP#include ^nPchar * desanitize(const char *str) { char *output = malloc(strlen(str)); char *output^current^pos = output; for (char *ptr = (char*) str; *ptr != '^bP0'; ptr++) { char output^char = *ptr; if (*ptr == '^' && ptr[2] == 'C' && ptr[3] == '-') { if (ptr[1] == 'b') output^char = '^bP^bP'; else if (ptr[1] == 'q') output^char = '^qP'; else if (ptr[1] == 'n') output^char = '^bPn'; ptr += 3; } *output^current^pos++ = output^char; } return output; } int main(void) { FILE *file = fopen(^qPSDQR.cpp^qP, ^qPw^qP); fprintf(file, ^qP%s^qP, desanitize(^qP#include ^nC-#include ^nC-#include ^nC-std::string desanitize(std::string str) { std::string tmp1 = std::regex^replace(str,std::regex(^qC-^qCP^qC-),^qC-^bC-^qC-^qC-); std::string tmp2 = std::regex^replace(tmp1,std::regex(^qC-^nCP^qC-),^qC-^bC-n^qC-); return std::regex^replace(tmp2,std::regex(^qC-^bCP^qC-),^qC-^bC-^bC-^qC-); } int main() { std::ofstream outfile; outfile.open(^qC-SDQR.cs^qC-); outfile << desanitize(^qC-class MainClass { static void Main(string[] args) { System.IO.File.WriteAllText(^qCPSDQR.lisp^qCP, ^qCP(defun replace-all (string part replacement-char &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-char replacement-char out) while pos))) (defun desanitize (string) (replace-all (replace-all (replace-all string ^qC#^nL^qC# #^bC#linefeed) ^qC#^qL^qC# #^bC#^qC#) ^qC#^bL^qC# #^bC#^bC#)) (with-open-file (stream ^qC#next^qC# :direction :output :if-exists :supersede) (format stream ^qC#~d^qC# (desanitize ^qC#p=^qL^RWP^qL; p2=p.replace(^qL^bLu005e^qL,^qL^bLu005f^qL).replace(^qL^bLu005f^bLu0062^bLu0050^qL,^qL^bL^bL^qL).replace(^qL^bLu005f^bLu006e^bLu0050^qL,^qL^bLn^qL).replace(^qL^bLu005f^bLu0071^bLu0050^qL,^qL^bL^qL^qL).replace(^qL^bLu005f^bLu0052^bLu0057^bLu0050^qL,p); f=open(^qLSDQR.c^qL,^qLw+^qL); f.write(p2); f.close(); print(^qL@qP[Self-Documenting Quine Relay] ~ jmoore34.github.io@qP... -> [Python] -> C -> ... -> Lisp -> Python -> ...@qPCurrent language: Python. Next language: C.@qPWrote SDQR.c to current directory.@qP[Compile] gcc SDQR.c -o SDQR-c or clang SDQR.c -o SDQR-c@qP[Run] ./SDQR-c@qP^qL.replace(^qL^bLu0040^bLu0071^bLu0050^qL,^qL^bLn^qL))^qC#))) (format t ^qC#~d^qC# (desanitize ^qC#^nL[Self-Documenting Quine Relay] ~ jmoore34.github.io^nL... -> [Lisp] -> Python -> ... -> C# -> Lisp -> ...^nLCurrent language: Lisp. Next language: Python.^nLWrote SDQR.py to current directory.^nL[Run] python3 SDQR.py^nL^nL^qC#)) ^qCP.Replace(^qCP^qC#^qCP, ^qCP^bCP^qCP^qCP).Replace(^qCP^nC#^qCP,^qCP^bCPn^qCP).Replace(^qCP^bC#^qCP,^qCP^bCP^bCP^qCP)); System.Console.Write(^qCP^nC#[Self-Documenting Quine Relay] ~ jmoore34.github.io^nC#... -> [C#] -> Lisp -> ... -> C++ -> C# -> ...^nC#Current language: C#. Next language: Lisp.^nC#Wrote SDQR.lisp to current directory.^nC#[Package] sudo apt install sbcl^nC#[Run] sbcl --script SDQR.lisp^nC#^qCP.Replace(^qCP^nC#^qCP,^qCP^bCPn^qCP) + ^qCP^bCPn^qCP); } }^qC-); outfile.close(); std::cout << desanitize(^qC-^nCP[Self-Documenting Quine Relay] ~ jmoore34.github.io^nCP... -> [C++] -> C# -> ... -> C -> C++ -> ...^nCPCurrent language: C++. Next language: C#.^nCPWrote SDQR.cs to current directory.^nCP[Package] sudo apt install mono-mcs^nCP[Compile] mcs -out:SDQR-C#.exe SDQR.cs^nCP[Run] mono SDQR-C#.exe^nCP^qC-) << std::endl; }^qP)); printf(^qP%s^bPn^qP, desanitize(^qP^nC-[Self-Documenting Quine Relay] ~ jmoore34.github.io^nC-... -> [C] -> C++ -> ... -> Python -> C -> ...^nC-Current language: C. Next language: C++.^nC-Wrote SDQR.cpp to current directory.^nC-[Compile] g++ --std=c++11 SDQR.cpp -o SDQR-c++^nC-[Run] ./SDQR-c++^nC-^qP)); }"; p2=p.replace("\u005e","\u005f").replace("\u005f\u0062\u0050","\\").replace("\u005f\u006e\u0050","\n").replace("\u005f\u0071\u0050","\"").replace("\u005f\u0052\u0057\u0050",p); f=open("SDQR.c","w+"); f.write(p2); f.close(); print("@qP[Self-Documenting Quine Relay] ~ jmoore34.github.io@qP... -> [Python] -> C -> ... -> Lisp -> Python -> ...@qPCurrent language: Python. Next language: C.@qPWrote SDQR.c to current directory.@qP[Compile] gcc SDQR.c -o SDQR-c or clang SDQR.c -o SDQR-c@qP[Run] ./SDQR-c@qP".replace("\u0040\u0071\u0050","\n"))