8
\$\begingroup\$

The reason for this question is because I made a deadlineless bounty and I need a tips question to link in the bounty

Vyxal 3 is the third major version of the Vyxal golfing language. As it is significantly different to Vyxal 2, the tips there don't apply.

Therefore, what tips and tricks do you have for golfing in Vyxal 3? Avoid giving obvious help like "remove whitespace", "limit variable usage", "remove comments" and "don't pad your program with 20000 among us characters".

One tip per answer please.

Literate mode golfing tips are also welcome.

\$\endgroup\$
2
  • \$\begingroup\$ 🍪🍪🍪🍪🍪🍪🍪🍪 \$\endgroup\$
    – Ginger
    Commented Nov 24, 2023 at 2:19
  • 6
    \$\begingroup\$ I would suggest removing whitespace, limiting variable usage, removing comments, and not padding your program with 20000 among us characters. They're all very helpful tips. \$\endgroup\$
    – Someone
    Commented Nov 25, 2023 at 2:02

1 Answer 1

5
\$\begingroup\$

Compress Strings and Numbers

Like Vyxal 2 before it, Vyxal 3 has dictionary string compression and base-based compression. However, in Vyxal 3, dictionary strings use Jelly's sss and base-based compression uses base-252 instead of base-255.

Dictionary compression works on all strings, base string compression only works on strings of lowercase alphabet + space ([a-z ]), base number compression only works on positive numbers.

To compress a string using dictionary compression:

"Some string" #C

To compress a string using base compression:

"some lowercase string" #c

To compress a number using base compression:

69420 #c

Examples

Original Value Dictionary Compressed Base Compressed
"hello world" "Ṙ=?” "ᶠ»_Ṃ†ᵘy„
"Hello, World!" "Ḍᵗ{w<ᵏ” NA
69420 NA "ᵇᵡy“
\$\endgroup\$
1
  • \$\begingroup\$ How about compressing a list of strings? A list of numbers? \$\endgroup\$ Commented Jan 21 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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