Tips for golfing in SOGL

7

Do you have any tips for writing in SOGL, a golfing language created by dzaima?

Your tips should be at least somewhat specific to SOGL.

Please post one tip per answer.

Jonathan Allan

Posted 2017-04-23T21:22:14.617

Reputation: 67 804

Shouldn't this be on meta? – caird coinheringaahing – 2017-04-23T21:59:35.817

@Soyoucanreplytomeincomments, tips questions are actually on topic here (see all the others under the tag).

– Jonathan Allan – 2017-04-23T22:00:50.233

Answers

3

Use the compression creator

Here is a new, buggy but mostly working online JavaScript compression creator. There, in each line enter a part of the string on each line which closest matches one of:

  1. custom dictionary string - this will find the different characters used in the part, store them and store a number in the base of the amount of characters. This is effective for strings like niooaaoasoioaiaaaoiineeaei where there aren't a lot of different characters. It also works well for just a single character repeated. This has a limit of 98+(different characters used), and the compressor (currently) doesn't auto-split those.
  2. boxstrings - strings with only the characters /\|_- and \n. Practically the same as custom dictionary strings, but more efficient. Note that this is chooses whether to use / and \ with the same bit, so then custom strings will be used. This has a limit the same as custom dictionary strings.
  3. english - this has two word dictionaries, one of length 256 and another of ±65500. This only contains lowercase words and automatically adds spaces between words. To get something like spaceface do two parts of space and face. Each english part has a max of 4 words. If a 4-word part is followed by more english, it adds a space between. Trough the compressor will automatically split the input for you.
    Note: the dictionary contains only lowercase versions of strings (except I, I've, and a couple others), so you must correctly case if after usage (using the characters - uppercase 1st letter, - sentence-case, ū - every words 1st letter).
  4. ascii - Plain ascii - each part is 1-18 long (trough 1 and 2 are done differently) and auto-splits for you. Approx. 87% compression ratio.

Other stuff:

  • It's always useful to try different combinations and see which is smaller. At the end, it gives you the original and ending byte count and compression ratio. This might be automated sometime in the future. For example, -_-_\_/_- is shorter than -_-_\_/_- and as different parts

An example input would be

row
, 
row
, 
row your boat
,¶"

, which outputs "π¾⌡īk#S)G⁶⁷λ7&[¶⁶āΡn‘, after which I can put uppercase 1st letter and remove the starting quote and get π¾⌡īk#S)G⁶⁷λ7&[¶⁶āΡn‘⁽ for Row, row, row your boat,\n"

dzaima

Posted 2017-04-23T21:22:14.617

Reputation: 19 048

2I recognise niooaaoasoioaiaaaoiineeaei was that my magic string from The Alphabet song? – Jonathan Allan – 2017-04-23T22:10:35.310

Yep :D (message requires 15 characters) – dzaima – 2017-04-23T22:11:45.893

Can you put this on OpenProcessing ty – ASCII-only – 2017-08-24T21:10:27.070

@ASCII-only there you go. Not on OpenProcessing because it'd have taken me more time to get it there (and even more to update it) and ugly but It took me 4 hours to get it to work with processing.js so I'm happy

– dzaima – 2017-08-25T07:54:51.800

2

Remove unnecessary quotes and brackets

You can remove quotes if the string they're encasing is either at the beggining of the program, or right after another string. For example, "hello”"world” can be shortened to hello”world”. This works for all types of quotes, mixed or not.

Similarly this works with brackets. No need to write } after {, ?, nor any of []F∫‽⌠. You can also ommit a starting { if there exists and ending }

dzaima

Posted 2017-04-23T21:22:14.617

Reputation: 19 048