Welcome to Byte Heist

Byte Heist is a site with coding challenges. It’s similar to sites like HackerRank, LeetCode, or Advent of Code, except the scoring system is based on the length of your code.

Normal Code Challenges Code Golf
Can be fun Can be fun
Train algorithms and data structures Train programming language internals and edge cases
Train architecture and readable code Train mathematics
Very satisfying when you finally solve a challenge Very satisfying when you finally solve a challenge

You don’t need to care about your score Optimising your score is optional. Feel free to submit fully commented solutions if you prefer to code that way. Especially restricted source.

How to have the most fun

It can be tempting to try to get to the top of the leaderboard, fail and give up. Trying to compare yourself against the top users is a recipe for frustration.

Instead, try to gradually improve your solutions over time.

I have these tips for having the most fun on the site:

  • Start by just solving the challenge. Use full length variable names, indentation, and anything you can do to make it more readable. No point in optimizing if you don’t have an efficient solution at all.
  • Think about the problem overnight, or in the next few days and weeks. Code golf mostly works by getting a random idea during your morning commute, not by staring at the problem.
  • Don’t be afraid to try “stupid” ideas. Sometimes an algorithm that feels less elegant gets you a better score. Sometimes you change a whole bit of your code for no score change but which allows saving bytes somewhere else.

OK but how do I actually get descent scores?

I will just re-iterate that it’s more about personal enjoyment and learning than scores. However, I will link to some resources which might help you:

General Resources

Python Specific

JavaScript (Deno/Node) Specific

Deno will probably be removed from the site at some point.

C Specific

C being ancient means there is a lot of tips online but very scattered. It pays to do some research.

Rust Specific

Golfing in Rust is less popular so there are less resources available, but there is also more opportunity to invent new tricks yourself.

Kotlin Specific

I do now actually know much about golfing in Kotlin so of someone is willing to fill out this section that would be helpful.

TinyAPL specific

TinyAPL is specifically designed for code golf so the official documentation is quite helpful.

Vyxal specific

Vyxal is specifically designed for code golf so the official documentation is quite helpful.

Note Vyxal 2 will probably be removed from the site eventually.