Intro to ASCII-Golfing for 05AB1E (Base Conversion [Simple])
While 05AB1E isn't intended for ASCII-Art directly, I've won 2 challenges with it. The best thing about 05AB1E is that, even with the simple base conversion there's often tricks you can use to extend and even halve your byte-count. Often in ASCII challenges there are repitition tricks you can utilize to only draw half the pattern then flip and concatenate. If it's a four way pattern you can do things like zip and bifurcate to only draw a corner of the pattern. There's plenty of data-structure manipulation techniques to use in conjunction with this simple base compression idea.
Here's a quick crash-course on a base conversion tactic:
In 05AB1E I enumerate all of the characters used in the ASCII-art, for instance:
--===___===--
Would result in:
-
=
_
I then assign them numbers starting with 1 then 0 then 2:
- is 1.
= is 0.
_ is 2.
I replace the characters in the original string with the numbers:
1122200022211
I convert to decimal using the lowest possible base (3):
879412
(How to do this using 05AB1E)
I then convert it to base 214:
Jh]
(How to do this using 05AB1E)
I then wrap it in the following code:
•Jh]•3B…102…-_=‡
Try it online!
Or try it with intermediate steps displayed.
Final explained:
•Jh]• # Push the compressed ASCII integer.
3B # Convert it to base 3.
…102 # Push the keys to the conversion.
…-_= # Push the values to the conversion.
‡ # Transliterate, replace 0, 1 and 2 with the symbols.
Now, with this specific challenge the string is so short it doesn't make sense to do. I'd probably just push half the string and Palindromize for 10 bytes "--===__"û
or golf it like Adnan did in the comments using factorial, smart man •Jh]•3B5!…-=_‡
. He's also (one of?) the creator (s?) of 05AB1E.
More complex example:
https://codegolf.stackexchange.com/a/106621/59376
Also, maybe try Dennis' kolmogorov-complexity language: Bubblegum; no idea how to use this.
1Since you mentioned it, in my experience 05AB1E is very good at ascii art challenges. – James – 2016-09-20T22:38:28.330
1I'd like to see a ASCII-art language called "ASC and II shall receive." (Seriously though, if one doesn't already exit, there's quite a bit of potential there.) – Hactar – 2016-09-20T22:42:01.803
I've designed a language called Crayon which is made specifically for creating ASCII art, but unfortunately I haven't had the time to implement it yet.
– ETHproductions – 2016-09-20T23:50:50.527@ASCII-only and I have been working on an ASCII-art language. It's still in the design phase, but we'd love your (or anyone's) input. Join us in chat if you're interested.
– DLosc – 2016-09-21T02:38:09.003Well here I was thinking my idea was unique... I asked this question because I wanted to write a CharMatrix based language. No one's mentioned one of the features I wanted though, so I might go ahead and do it anyway. All the answers and comments have been great by the way, thanks everybody – Socratic Phoenix – 2016-09-21T10:35:33.383
@SocraticPhoenix what features do you want? – ASCII-only – 2016-10-13T23:34:54.663
@MarsUltor I was specifically thinking about reflections, with reflectable characters swapping (\ -> /) ({ -> }) – Socratic Phoenix – 2016-10-14T02:19:57.350
@SocraticPhoenix Yeah, we (DLosc and I) will have that in the language we're creating, we just haven't decided on the command character yet – ASCII-only – 2016-10-14T05:49:34.247
@SocraticPhoenix I've done all the boxchars, but I'm too lazy to do the brackets, you could help group them into horizontal reflection pairs (as a JSON dictionary e.g.
– ASCII-only – 2016-10-14T12:11:39.957"[": "]", "]": "["
), also vertical reflection and 180 degree turn (you may need to put some of them in multiple of the dictionaries@ASCII-only potentially.... I'm quite busy at the moment, with school, etc. If I get a chance I'll try and do some, but I probably won't be able too – Socratic Phoenix – 2016-10-14T13:57:09.610
@Dennis https://esolangs.org/wiki/Bubblegum I want to see a short post explaining Bubblegum ;).
– Magic Octopus Urn – 2017-02-10T18:41:09.020You should check out Charcoal also, if I had the knowledge I'd write up an answer about it
– nmjcman101 – 2017-07-13T23:54:39.143