• Runtime detail that goes together with the clip in first post (see still of it attached below):

    The dump of the board lane by lane into the console, before player 0 (yellow) wins the 3rd race and wins the game, from the boards perspective (<-- comments added). It shows the neopixel buffer as sent out - 30 bytes - byte by byte (3 bytes per line defining the R G B components for the LEDs). The bytes are sent in reverse order: the last bytes - bytes for the last LED in the string - are sent first, and the first bytes - bytes for the first LED - are sent last. Last 3 bytes - as sent first - are passed thru all but last LED from one LED to the next one. First 3 bytes - as sent last - are never passed on, they stay within first LED.

    >dump()
    --- player  0  - 3 ( 2 ): <-- race position ( races won ) - *** zig ***
    0 - 0 0 0                 <-- pos 0 of even lane 0, bytes 0,1,2...
    1 - 8 4 0                 <-- races-won (2) positional indicator
    2 - 0 0 0
    3 - 174 81 0              <-- race position (3) indicator
    4 - 0 0 0                 <-- pos 4 of even lane 0, ...,12,13,14 for top lane 0
    --- player  1  - 2 ( 2 ): <-- race position ( races won ) - *** zag ***
    0 - 0 0 0                 <-- pos 4 of odd lane 1 (bytes 15,16,17...)
    1 - 0 0 0
    2 - 237 0 15              <-- race position (2) indicator
    3 - 11 0 1                <-- races-won (2) positional indicator 
    4 - 0 0 0                 <-- pos 0 of odd lane 1 (...27,28,29 for bottom lane 1)
    =undefined
    

    This is the matching players (variable) information (with some additional formatting):

    >players
    =[
      { idx: 0, racePos: 3, winCnt: 2, negPoints: 0,
        rClrs: [ 174, 81, 0 ],
        gClrs: [   8,  4, 0 ]
       },
      { idx: 1, racePos: 2, winCnt: 2, negPoints: 0,
        rClrs: [ 237, 0, 15 ],
        gClrs: [  11, 0,  1 ]
       }
     ]
    >
    

    Property negPoints not used (yet). Can be used to collect sub-par information relative to the winners in order to have more granular ranking across the races for a game or even beyond to indicate "better or worse losses / fare from or close to winning"...


    1 Attachment

    • aboutToWinGameWithWinOfThirdRace.png
About

Avatar for allObjects @allObjects started