BBC BASIC 3D 10 PRINT - Crunch 2

Поделиться
HTML-код
  • Опубликовано: 23 окт 2024

Комментарии • 11

  • @byteforever7829
    @byteforever7829 Год назад

    Neat code. Are you aware BBC BASIC has an inline assembly keyword I bet you would save ram and speed it up using that.

  • @qo92
    @qo92 Год назад

    Change mode with a VDU?

  • @GeorgeFoot
    @GeorgeFoot Год назад +1

    SGNPOS ought to work instead of (POS>0) saving 3 characters. Are the brackets after RND optional as well? They usually are for single argument things.

    • @lsbyte
      @lsbyte  Год назад

      You need the brackets after RND (unless you only want a floating number between 0 and 0.999 but you might be able to tweak that). SGNPOS looks promising but it yields 0 and 1 not 0 and -1 and so there's need to be further tweakage. I'll have a think about that in the departure lounge!

    • @lsbyte
      @lsbyte  Год назад

      Yep, good move - that saves three bytes:
      B=B*(1-2*SGNPOS)

    • @GeorgeFoot
      @GeorgeFoot Год назад

      @@lsbyte now I wonder about B=BEORSGNPOS with 128* elsewhere. Or maybe B=128ANDB-SGNPOS with B=0 initially - so I think B would then swap between 0 and 128?

    • @lsbyte
      @lsbyte  Год назад

      B=128ANDB-SGNPOS and then COLOUR130-B:COLOURZ*2+B-1 saves three more bytes.

    • @GeorgeFoot
      @GeorgeFoot Год назад

      @@lsbyte I think VDU 15,31 can be combined in decimal to save a byte. Now the thing I've been meaning to think about is that you don't need to go up to 128 to change the background colour - you can just go negative instead. Leaving B as-is, you should be able to change COLOUR130-B to COLOUR-2-B without affecting the output. And, maybe that pesky leading "-" can be removed if we also invert the other COLOUR statement, e.g. COLOUR2-B:COLOURZ*2+B-5 or something like that. Or does that change the output? I'm not sure.
      And, with this negative trick, perhaps we no longer need B to toggle up and down 128 at a time - can we make it toggle just enough to switch from negative to positive? e.g. 8 ought to be enough? It might require more changes to the calculations to get that to work, there are so many things layered in there now it's hard to keep track of!

  • @Wobblybob2004
    @Wobblybob2004 Год назад

    Single digit line number?

    • @lsbyte
      @lsbyte  Год назад +2

      All stored as two bytes regardless of value!