Implementation notes. I just felt inspired to make ASCII arts of Maple and Syrup. ---------------------------------------------------------------------- 0. Concept After watching the animated version of "I don't want to get hurt so I will max out my defense" and watching it all over again, I just felt like I had to make some ASCII art. Particularly after the scene where Maple had spontaneously named her turtle "Syrup" so that "together we can be Maple Syrup", I thought that was too good to pass. So I made two quines of Maple and Syrup, where output is selected based on whether Perl or Ruby is used. ---------------------------------------------------------------------- 1. Polyglot The polyglot portion of the program used the same trick I did before with Neptune: http://uguu.org/src_neptune_pl.html Basically it comes down to how Perl and Ruby have slightly different quoting schemes beyond the usual single and double quotes. ---------------------------------------------------------------------- 2. ASCII art Output ASCII art layout is encoded using something similar to run-length encoding: A .. Z = whitespaces a .. z = code ! = newline I didn't use the full range of ASCII values this time because the code is relatively small. Reducing the range gives me extra bytes to fill in the non-whitespace parts. ---------------------------------------------------------------------- 3. Quine Both Perl and Ruby have "eval", so this part is fairly straightforward: $format1 = "..." $format2 = "..." $code = " while applying $format1 or $format2: print $format1 print $format2 print $code " eval($code) One caveat is having to consume excessive whitespaces, especially around code that would otherwise tokenize incorrectly, hence the extra layer of eval. Also, the structure of both the Perl and Ruby decoder are identical, but the syntax is subtly different so separate decoders for each language are included. If the program was any larger then writing a Perl emulation layer in Ruby might have been worthwhile. ---------------------------------------------------------------------- 4. Assembly All the coding proportions relatively straightforward to write, the bit that took most time was adjusting the whitespaces in the templates to account for the few token boundaries where it mattered. It's possible to automate this bit, but I just setup some Makefile commands to make testing easier and worked it out a few bytes at a time. ---------------------------------------------------------------------- 5. Finally... "Bofuri" has been a very good series, especially the manga adaption of it. There isn't any great end of the world disaster being averted or some existential crisis being contemplated, just a few characters enjoying a game to the fullest. It's just what I need these days.