Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 2093 characters in body
Source Link
Martin Ender
  • 198.2k
  • 67
  • 455
  • 998

Glypho, 94

The source file is encoded in CP437.

␀␀!"☺☺#$☻♥♥☻♦♣♦♣%♠♠&•◘•◘'しろまるしろまる(◙♂◙♂♀♪♪♀♫☼♫☼►◄◄►↕↕)*!!¶¶!!§§+,▬↨↨▬↑↓↑↓→←→←∟∟-.↔さんかくさんかく↔/▼▼▼⌂Ç⌂Çüééüââ01ää23àååàçêçê4ëë5èïèïîî67ìÄÄì8ÅÅ9ÉÉ:;æÆÆæô<=ôöòòöûùûù>ÿÿÿÖÖ?@ÜÜAB¢££¢\₧\₧CƒƒDáíáíóóEFúññúÑaÑaGooHI¿¿J⌐¬⌐¬K1⁄21⁄21⁄21⁄41⁄4LM¡««¡N»»»░░OP▒▒QR▓││▓┤╡┤╡S╢╢T╖╕╖╕U╣╣V║╗║╗╝╜╜╝W╛╛╛┐X┐┐Y└└└┴┬┴┬├─├─Z┼┼┼╞╞[\╟╟]^╚╔╔╚╩╦╩╦_╠╠`═╬═╬╧╨╨╧╤╥╥╤a╙╙╙╘╘bc╒╒de╓╓fg╫╪╪╫┘┌┌┘█▄█▄▌hi▌▐j▐▐▀αα▀ßΓßΓπΣπΣkσσσμlμμτmnτΦΘΘΦΩδΩδo∞∞∞φpφφεεqr∩≡≡∩±±st≥≤≤≥u⌠⌠⌠⌡⌡vw÷xy÷≈°°≈∙∙z{·|}·√nn√~222

Try it online!

Explanation

Glypho is quite useful for challenges like this because it doesn't care about the actual characters being used at all. Instead it looks at each chunk of 4 characters and the command being used is determined by the pattern these four characters make:

0000 n
0001 i
0010 >
0011 \
0012 1
0100 <
0101 d
0102 [
0110 +
0111 o
0112 *
0120 -
0121 ]
0122 !
0123 e

That means we can just solve the problem and then fill in unique characters in each quartet with the printable characters and all the repeated ones with some of the "exotic" characters, which are ignored by the scoring. Glypho is sufficiently verbose that a normal handwritten solution contains enough unique characters to fit all the 94 printable ones inside. In fact, I ended up golfing it down until it had exactly 94, just so that I could use unique exotic characters for the repeated ones (hopefully, to make it harder to reduce the program).

The shorthand form of the above program is this:

11+d*d*d+d+1+1+dd1+o
d+11+d*d1+*1+-+do
11+d*d1+d**do
1+o
11+d*d*d+o
<o
ddo
11+d*d++o
111++d-<+ddo
<-+do
<1+1+o
1-+1-+o

Where each line prints one of the characters.

I've used this Retina script to convert it to Glypho using 0123. Afterwards, I've just filled in the characters in place of the digits.

In theory it might be possible to reduce this further, if someone managed to golf down the shorthand program and then managed to recombine the characters such that the right patterns show up, but I'm not sure how to prove or disprove that this is possible. If anyone manages to form a valid solution from a subset of my program, please let me know so I can delete the answer until it's fixed. Until then, I'll have to assume that this is valid.

Glypho, 94

The source file is encoded in CP437.

␀␀!"☺☺#$☻♥♥☻♦♣♦♣%♠♠&•◘•◘'しろまるしろまる(◙♂◙♂♀♪♪♀♫☼♫☼►◄◄►↕↕)*!!¶¶!!§§+,▬↨↨▬↑↓↑↓→←→←∟∟-.↔さんかくさんかく↔/▼▼▼⌂Ç⌂Çüééüââ01ää23àååàçêçê4ëë5èïèïîî67ìÄÄì8ÅÅ9ÉÉ:;æÆÆæô<=ôöòòöûùûù>ÿÿÿÖÖ?@ÜÜAB¢££¢\₧\₧CƒƒDáíáíóóEFúññúÑaÑaGooHI¿¿J⌐¬⌐¬K1⁄21⁄21⁄21⁄41⁄4LM¡««¡N»»»░░OP▒▒QR▓││▓┤╡┤╡S╢╢T╖╕╖╕U╣╣V║╗║╗╝╜╜╝W╛╛╛┐X┐┐Y└└└┴┬┴┬├─├─Z┼┼┼╞╞[\╟╟]^╚╔╔╚╩╦╩╦_╠╠`═╬═╬╧╨╨╧╤╥╥╤a╙╙╙╘╘bc╒╒de╓╓fg╫╪╪╫┘┌┌┘█▄█▄▌hi▌▐j▐▐▀αα▀ßΓßΓπΣπΣkσσσμlμμτmnτΦΘΘΦΩδΩδo∞∞∞φpφφεεqr∩≡≡∩±±st≥≤≤≥u⌠⌠⌠⌡⌡vw÷xy÷≈°°≈∙∙z{·|}·√nn√~222

Try it online!

Glypho, 94

The source file is encoded in CP437.

␀␀!"☺☺#$☻♥♥☻♦♣♦♣%♠♠&•◘•◘'しろまるしろまる(◙♂◙♂♀♪♪♀♫☼♫☼►◄◄►↕↕)*!!¶¶!!§§+,▬↨↨▬↑↓↑↓→←→←∟∟-.↔さんかくさんかく↔/▼▼▼⌂Ç⌂Çüééüââ01ää23àååàçêçê4ëë5èïèïîî67ìÄÄì8ÅÅ9ÉÉ:;æÆÆæô<=ôöòòöûùûù>ÿÿÿÖÖ?@ÜÜAB¢££¢\₧\₧CƒƒDáíáíóóEFúññúÑaÑaGooHI¿¿J⌐¬⌐¬K1⁄21⁄21⁄21⁄41⁄4LM¡««¡N»»»░░OP▒▒QR▓││▓┤╡┤╡S╢╢T╖╕╖╕U╣╣V║╗║╗╝╜╜╝W╛╛╛┐X┐┐Y└└└┴┬┴┬├─├─Z┼┼┼╞╞[\╟╟]^╚╔╔╚╩╦╩╦_╠╠`═╬═╬╧╨╨╧╤╥╥╤a╙╙╙╘╘bc╒╒de╓╓fg╫╪╪╫┘┌┌┘█▄█▄▌hi▌▐j▐▐▀αα▀ßΓßΓπΣπΣkσσσμlμμτmnτΦΘΘΦΩδΩδo∞∞∞φpφφεεqr∩≡≡∩±±st≥≤≤≥u⌠⌠⌠⌡⌡vw÷xy÷≈°°≈∙∙z{·|}·√nn√~222

Try it online!

Explanation

Glypho is quite useful for challenges like this because it doesn't care about the actual characters being used at all. Instead it looks at each chunk of 4 characters and the command being used is determined by the pattern these four characters make:

0000 n
0001 i
0010 >
0011 \
0012 1
0100 <
0101 d
0102 [
0110 +
0111 o
0112 *
0120 -
0121 ]
0122 !
0123 e

That means we can just solve the problem and then fill in unique characters in each quartet with the printable characters and all the repeated ones with some of the "exotic" characters, which are ignored by the scoring. Glypho is sufficiently verbose that a normal handwritten solution contains enough unique characters to fit all the 94 printable ones inside. In fact, I ended up golfing it down until it had exactly 94, just so that I could use unique exotic characters for the repeated ones (hopefully, to make it harder to reduce the program).

The shorthand form of the above program is this:

11+d*d*d+d+1+1+dd1+o
d+11+d*d1+*1+-+do
11+d*d1+d**do
1+o
11+d*d*d+o
<o
ddo
11+d*d++o
111++d-<+ddo
<-+do
<1+1+o
1-+1-+o

Where each line prints one of the characters.

I've used this Retina script to convert it to Glypho using 0123. Afterwards, I've just filled in the characters in place of the digits.

In theory it might be possible to reduce this further, if someone managed to golf down the shorthand program and then managed to recombine the characters such that the right patterns show up, but I'm not sure how to prove or disprove that this is possible. If anyone manages to form a valid solution from a subset of my program, please let me know so I can delete the answer until it's fixed. Until then, I'll have to assume that this is valid.

Source Link
Martin Ender
  • 198.2k
  • 67
  • 455
  • 998

Glypho, 94

The source file is encoded in CP437.

␀␀!"☺☺#$☻♥♥☻♦♣♦♣%♠♠&•◘•◘'しろまるしろまる(◙♂◙♂♀♪♪♀♫☼♫☼►◄◄►↕↕)*!!¶¶!!§§+,▬↨↨▬↑↓↑↓→←→←∟∟-.↔さんかくさんかく↔/▼▼▼⌂Ç⌂Çüééüââ01ää23àååàçêçê4ëë5èïèïîî67ìÄÄì8ÅÅ9ÉÉ:;æÆÆæô<=ôöòòöûùûù>ÿÿÿÖÖ?@ÜÜAB¢££¢\₧\₧CƒƒDáíáíóóEFúññúÑaÑaGooHI¿¿J⌐¬⌐¬K1⁄21⁄21⁄21⁄41⁄4LM¡««¡N»»»░░OP▒▒QR▓││▓┤╡┤╡S╢╢T╖╕╖╕U╣╣V║╗║╗╝╜╜╝W╛╛╛┐X┐┐Y└└└┴┬┴┬├─├─Z┼┼┼╞╞[\╟╟]^╚╔╔╚╩╦╩╦_╠╠`═╬═╬╧╨╨╧╤╥╥╤a╙╙╙╘╘bc╒╒de╓╓fg╫╪╪╫┘┌┌┘█▄█▄▌hi▌▐j▐▐▀αα▀ßΓßΓπΣπΣkσσσμlμμτmnτΦΘΘΦΩδΩδo∞∞∞φpφφεεqr∩≡≡∩±±st≥≤≤≥u⌠⌠⌠⌡⌡vw÷xy÷≈°°≈∙∙z{·|}·√nn√~222

Try it online!

AltStyle によって変換されたページ (->オリジナル) /