26
2
While doing some research for a different challenge I'm formulating, I came across a Cayley graph, specifically this one. Since I'm one of the top ascii-art challenge writers, of course I had to make an ASCII art challenge for this.
Your challenge is to produce this ASCII art depiction of a Cayley graph of the free group on two generators as follows:
+
+++
+ | +
++-+-++
+ | +
+ | +
+++ | +++
+ | | | +
++-+----+----+-++
+ | | | +
+++ | +++
+ | +
+ | +
+++ | +++
+ | + | + | +
++-+-++ | ++-+-++
+ | + | + | +
+ | | | +
+++ | | | +++
+ | | | | | +
++-+----+-----------+-----------+----+-++
+ | | | | | +
+++ | | | +++
+ | | | +
+ | + | + | +
++-+-++ | ++-+-++
+ | + | + | +
+ +++ | +++ +
+++ + | + +++
+ | + | + | +
++-+-++ | ++-+-++
+ | + | + | +
+ | + | + | +
+++ | +++ | +++ | +++
+ | | | + | + | | | +
++-+----+----+-++ | ++-+----+----+-++
+ | | | + | + | | | +
+++ | +++ | +++ | +++
+ | + | + | +
+ | | | +
+++ | | | +++
+ | + | | | + | +
++-+-++ | | | ++-+-++
+ | + | | | + | +
+ | | | | | +
+++ | | | | | +++
+ | | | | | | | +
++-+----+-----------+--------------------------+--------------------------+-----------+----+-++
+ | | | | | | | +
+++ | | | | | +++
+ | | | | | +
+ | + | | | + | +
++-+-++ | | | ++-+-++
+ | + | | | + | +
+++ | | | +++
+ | | | +
+ | + | + | +
+++ | +++ | +++ | +++
+ | | | + | + | | | +
++-+----+----+-++ | ++-+----+----+-++
+ | | | + | + | | | +
+++ | +++ | +++ | +++
+ | + | + | +
+ | + | + | +
++-+-++ | ++-+-++
+ | + | + | +
+++ + | + +++
+ +++ | +++ +
+ | + | + | +
++-+-++ | ++-+-++
+ | + | + | +
+ | | | +
+++ | | | +++
+ | | | | | +
++-+----+-----------+-----------+----+-++
+ | | | | | +
+++ | | | +++
+ | | | +
+ | + | + | +
++-+-++ | ++-+-++
+ | + | + | +
+++ | +++
+ | +
+ | +
+++ | +++
+ | | | +
++-+----+----+-++
+ | | | +
+++ | +++
+ | +
+ | +
++-+-++
+ | +
+++
+
Input
No input, unless your language explicitly requires input to run.
Output
The ASCII art representation shown above.
MD5 Hashes
Since this is a pretty large output, to check your work here are some MD5 hashes of example forms of output (all are UTF-8 without BOM):
- Square space padding,
CR/LF
linefeeds, and trailing newline --954B93871DAAE7A9C05CCDF79B00BF3C
-- this is the representation used above. - Square space padding,
CR/LF
linefeeds, no trailing newline --28405EF91DA305C406BD03F9275A175C
- Square space padding,
LF
linefeeds, and trailing newline --8CA65FB455DA7EE5A4C10F25CBD49D7E
- Square space padding,
LF
linefeeds, no trailing newline --FDB1547D68023281BB60DBEC82C8D281
- No trailing spaces,
CR/LF
linefeeds, and trailing newline --77FDE8CE5D7BD1BDD47610BA23264A19
- No trailing spaces,
CR/LF
linefeeds, no trailing newline --EAD390C3EFD37F0FCACE55A84B793AB5
- No trailing spaces,
LF
linefeeds, and trailing newline --1F6CAB740F87881EB2E65BED65D08C36
- No trailing spaces,
LF
linefeeds, no trailing newline --7D41CE1E637619FEA9515D090BFA2E9C
- If there is an additional MD5 you would like for comparison, please let me know and I'll create it and update the challenge.
Rules
- Leading or trailing newlines or whitespace are all optional, so long as the characters themselves line up correctly.
- Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
- If possible, please include a link to an online testing environment so other people can try out your code!
- Standard loopholes are forbidden.
- This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.
I'm slightly surprised this isn't parametrised in any way - it looks as if it should be the sixth in a sequence. – Neil – 2017-03-14T18:30:38.150
This anarchy golf challenge is very similar.
– James – 2017-03-14T18:33:14.977@Neil I had considered doing so, but decided against it for fear that it would increase the difficulty too much for little gain. – AdmBorkBork – 2017-03-14T18:33:26.657
Looks like the runs of
-
/|
s follow the formula(2<<n)-n-2
rather than(1<<n)-1
which is what my original guess would have been. – Neil – 2017-03-14T19:25:30.533@Neil They're actually Eulerian numbers, since that provided the best aesthetic.
– AdmBorkBork – 2017-03-14T19:30:09.750Why in the "last iteration" it started to overlap ;-; <cries in recursive> – Rod – 2017-03-14T19:57:35.253
Cool highscores listing! I'm 6th in [tag:ascii-art]! I didn't know S.E. had this feature; neato. – Magic Octopus Urn – 2017-03-16T13:52:59.037