…Vanessa-2.06.bas, row 227:

Startseite Foren LED-Basic …Vanessa-2.06.bas, row 227:

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • Autor
    Beiträge
  • #1578
    johnsvensk
    Teilnehmer
    ' only check brightness once per 15 cycles
    if z & 15 <> 0 then goto 210

    Vanessa, I think we’ve discussed this before, but I still do not understand your reasoning…
    If I have a nibble of ones (0b1111, 15), no matter which number
    [z > 0] I do a bitwise AND with, the result is <> 0. Wouldn’t this be easier to read, and closer to your intent?

    if z>15 goto 210

    Or am I missing something? 🙂

    • Dieses Thema wurde geändert vor 4 Jahre, 7 Monaten von johnsvensk.
    #1580
    Vanessa
    Moderator

    Hi John,

    z is an counter that could be very bigger then 15.
    This goto 210 should happend once per 15 cicles.
    If you use z>15 this will happen every time if z is bigger then 15.

    / Vanessa

    #1581
    johnsvensk
    Teilnehmer

    Ah, now I understand. 🙂 I wouldn’t do it that way, but that’s a bit of the charm with coding; there’s more than one way to do it! 😀
    /John

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.