0
\$\begingroup\$

Here is your task, should you choose to accept it: Output (through STDOUT, or whatever is most convenient) some n by m ASCII art that has at least one line of symmetry and is non-empty. Example:

HiiH
iooi
iooi
H!!H

This is a 4x4 example output.

(Note: I define an ASCII character to be in the ASCII range 32-126 plus newlines and spaces. No tabulators.)

Here's the catch: Your program must also reflect across these same axes AND must be a rectangle in shape. (The output and the input are not necessarily the same width/length). Here is an example in JavaScript:

console.log("HiH")//("HiH")gol.elosnoc;
console.log("JvJ")//("JvJ")gol.elosnoc;
console.log("...")//("...")gol.elosnoc;

The source code has one line of symmetry (vertical) and the output has one line of symmetry: vertical.

HiH
JvJ
...

This is a , so the highest-voted answer on THIS DATE:

3:00 PM
Saturday, September 27, 2015
Eastern Time (ET)

will be the winner.

TL;DR

Write a program with the same axes of reflections as the output, of which is at least one. The output must have side lengths greater than one and must have at least one non-whitespace character.

EDIT

If a character has a mirrored version (e.g. ( and )), then it should be used instead of itself. Example:

[>Hello!\} => {/!olleH<]

Why this question is not a duplicate

Said question wished to produce a quine which was the same, forth and back; my challenge is different in two ways. One, it does not necessarily have to be forth and back (up and down, right and left, e.g.). Two, I am not asking for a quine.

\$\endgroup\$

closed as unclear what you're asking by Downgoat, Zach Gates, Peter Taylor, Fatalize, Mhmd Sep 22 '15 at 11:29

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ A square always has the "same width". You mean rectangle. \$\endgroup\$ – mınxomaτ Sep 22 '15 at 1:43
  • 2
    \$\begingroup\$ @CᴏɴᴏʀO'Bʀɪᴇɴ I didn't downvote but it probably happened because someone thinks the pop-con tag here makes it too subjective. \$\endgroup\$ – Calvin's Hobbies Sep 22 '15 at 2:01
  • 1
    \$\begingroup\$ @CᴏɴᴏʀO'Bʀɪᴇɴ Most likely because popularity-contest is not very ... popular. But it is refreshing to see something else than codegolf. \$\endgroup\$ – mınxomaτ Sep 22 '15 at 2:02
  • 3
    \$\begingroup\$ Your Javascript example shows the reflection of ( as ), but the reflection of c is still c. Is that intended? \$\endgroup\$ – Greg Hewgill Sep 22 '15 at 2:06
  • 2
    \$\begingroup\$ /pqdb\ have mirrored versions. and some would say '` \$\endgroup\$ – Not that Charles Sep 22 '15 at 2:33
7
\$\begingroup\$

Brainfuck, 103 bytes

I made you a sandwich.

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

Output:

***
***
***
\$\endgroup\$
  • 1
    \$\begingroup\$ Doesn't it say in the question: Write a program with the same axes of reflections as the output, of which is at least one. The output must have side lengths greater than one and must have at least one non-whitespace character. \$\endgroup\$ – clap Sep 22 '15 at 4:23
  • 1
    \$\begingroup\$ Ah, yes, in the TL;DR rather than the main body of the question. Time to fix this up! \$\endgroup\$ – Hand-E-Food Sep 22 '15 at 4:31
  • \$\begingroup\$ +1 for the sandwich :D Also, good strategy to modify cells without printing. \$\endgroup\$ – clap Sep 22 '15 at 5:08
4
\$\begingroup\$

Pyth, 29 bytes

FG[\@\@)pGpG*0"0*GqGq(@/@/]GF

Demo

I'm assuming that one-liners are okay, otherwise there is an easy fix.

\$\endgroup\$
  • \$\begingroup\$ +1, but shouldn't those ps be mirrored as qs? :-P \$\endgroup\$ – Hand-E-Food Sep 22 '15 at 4:59
  • \$\begingroup\$ They could be, not that it changes anything. I'll change it anyway :D \$\endgroup\$ – clap Sep 22 '15 at 5:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.