Although physics simulator Algodoo has been used it to construct questions here, I just used it for a joke answer.

For more involved answers, how would you score code length for something like a binary calculator?

| |
  • \$\begingroup\$ Assuming you mean code length? \$\endgroup\$ – Addison Crump Dec 1 '16 at 16:38
  • \$\begingroup\$ Yes, clarified in the question now, thanks. \$\endgroup\$ – wyldstallyns Dec 1 '16 at 16:39
  • \$\begingroup\$ Does Algodoo have a save functionality? \$\endgroup\$ – Addison Crump Dec 1 '16 at 16:49
  • \$\begingroup\$ It does. It bundles a lot of default environment into the save file too. An "empty" save of a new scene is 8k but a much shorter file might still be a valid scene to import. \$\endgroup\$ – wyldstallyns Dec 1 '16 at 17:43
  • \$\begingroup\$ The save file turns out to be a 7zip containing a phun file, the extension used by the previous iteration of the software. It's a text file containing a bunch of hashes. Algodoo will boot an empty phun file. Opening and saving this results in a 2k Algodoo file, 1/4th of where we started. I suspect creating simulation files by code would make Algodoo a golf language and real competitor for certain problem sets. \$\endgroup\$ – wyldstallyns Dec 1 '16 at 23:15
  • \$\begingroup\$ Minecraft and Terraria can do logic with only physics as well. All you need is water, sand, and regular torches. \$\endgroup\$ – mbomb007 Dec 14 '16 at 22:57

The length is the size of the save file

Unless there is another mechanism that can be used to reliably and consistently import a "program", the save file is the obvious choice. Yes, that means your score will probably be much higher than other languages. No, there's nothing wrong with that - competition within languages, remember? As commented, you can golf and/or generate the save files manually, which can save some bytes.

Plus, Java won't be the most verbose language anymore.

| |
  • \$\begingroup\$ As I just commented above, the save file can actually be much smaller if hand constructed, making it comparable to other languages used here and potentially a golf winner for certain problem sets. \$\endgroup\$ – wyldstallyns Dec 1 '16 at 23:16
  • 1
    \$\begingroup\$ @wyldstallyns Then golfing the save file would be a valid way of shaving off bytes. Care to explain the downvote that is presumably yours? You may not like it, but unless there's another mechanism, the save file size is the only option. \$\endgroup\$ – Mego Dec 1 '16 at 23:17
  • 1
    \$\begingroup\$ Wasn't my downvote! In hindsight it's the only logical way to do it. \$\endgroup\$ – wyldstallyns Dec 1 '16 at 23:23
  • \$\begingroup\$ @wyldstallyns My apologies, then. Maybe someone didn't like my snarky comment about Java! :P \$\endgroup\$ – Mego Dec 1 '16 at 23:23
  • \$\begingroup\$ They need a ChillPillFactoryFactoryFactoryFactory. \$\endgroup\$ – wyldstallyns Dec 1 '16 at 23:25
  • \$\begingroup\$ @Mego tbf Java isn't as bad as AppleScript. >.> \$\endgroup\$ – Addison Crump Dec 2 '16 at 0:09
  • \$\begingroup\$ @mojimonster Yeah but people actually use Java so it's a better punching bag :P \$\endgroup\$ – Mego Dec 2 '16 at 0:10
  • \$\begingroup\$ @Mego AppleScript gave us the wondrous HyperCard. \$\endgroup\$ – wyldstallyns Dec 2 '16 at 17:08
  • 2
    \$\begingroup\$ I experimented and Algodoo imports a zero byte Phun save file just fine. Gravity is sideways and there are other oddities but physics work normally. I'm thinking about writing a pyth-style front end to generate the relatively verbose Phun data, which appears to be a set of associative arrays. Not sure yet if text output from the simulation environment is possible. \$\endgroup\$ – wyldstallyns Dec 2 '16 at 17:08

The Thyme code to generate such logic

If you copy something from Algodoo and paste it in notepad, you can see the Thyme code that generates such thing. Also, pasting it back work fine even if it's not standard copy-out text

| |
  • \$\begingroup\$ This doesn't really add anything to the existing answer, so I don't really understand the point of bringing back a question that's been dormant for 1.5 years \$\endgroup\$ – Jo King Oct 30 '18 at 3:11
  • \$\begingroup\$ @JoKing Fine. see they are same \$\endgroup\$ – l4m2 Oct 30 '18 at 4:43
  • \$\begingroup\$ This is entirely different functionality that 1.5 years later I still didn't know about. Hand-crafting Thyme code to paste into Algodoo is actually the most codegolfy approach so far. I just tried pasting a modified object and it worked perfectly. Thanks @l4m2 ! \$\endgroup\$ – wyldstallyns Nov 12 '18 at 16:15

You must log in to answer this question.

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