5
\$\begingroup\$

For example, I've spent several days reducing an assembly submission from an initial 456 bytes down to 330 322 bytes.

How can I determine when a code golf solution has reached its most compressed or optimized form?

\$\endgroup\$
2
  • \$\begingroup\$ I’m voting to close this question because this doesn't ask about the site, this is off-topic here. However, you can ask it in the main site. \$\endgroup\$
    – Fmbalbuena
    Jan 31 at 21:26
  • \$\begingroup\$ unofficially, there was a challenge that came up with a handicap system, that you can use to compare your handicap-adjusted score with others in the challenge. It's not fool-proof but it can give you a ball park idea of when your answer is approximately golfed ~enough~. codegolf.stackexchange.com/questions/71117/… \$\endgroup\$
    – Jack Ammo
    Feb 4 at 23:05

1 Answer 1

11
\$\begingroup\$

You can't know when a program is done, but you can know when you are done

Determining whether a general program can be shortened is equivalent to the halting problem. There is no algorithm that can be run to check.

You should instead stop golfing when further work on a particular program isn't fun for you. If you are out of ideas, it's better to go do something else than to just stare at the screen.

\$\endgroup\$
1
  • \$\begingroup\$ There are obvious cases where shortening isn't possible. But, for any non-trivial code, yeah, it's tricky to determine if an optimal solution has been reached. Thanks! \$\endgroup\$
    – vengy
    Jan 28 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .