It’s still an experimental work in progress. At least I got the day of the week right this time!

  • lad
    link
    fedilink
    English
    arrow-up
    4
    ·
    1 day ago

    Basic allows something to be defined via itself? Or does it just initialise to random values like C?

    Z=Z-Z looks wild, but if there are no special values for integers, it will always be zero, indeed

    • over_clox@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      ·
      16 hours ago

      I do think that most dialects of Basic automatically zero out variables when they’re defined, but my code concept here makes no such assumptions, I assume the worst that all variables start off as random garbage.

      I chose Mobile Basic because it’s easy to understand, the code concept doesn’t require any super complicated language, and I can easily piddle around with stuff like this when out and about on road trips and such.

      If you like the coding idea, feel free to use it and even adapt it to other languages.

      One thing I don’t exactly like about this particular version of Basic is that it’s kinda picky on what all I can and can’t do between integer vs double data types, it doesn’t allow bit shift operations using doubles, which does make sense, but some other Basic dialects do tend to allow that by simply rounding to an integer before performing bit shifts. I guess it just depends on what your calculating priorities are, decimals or integers…