• GreenCrunch@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    14
    ·
    2 天前

    the article mentions 69 being skipped as well. I assume it’s pretty simple, just check it against the list and increment until it’s valid.

    int getNextOrderNumber(int currentNumber) {
        currentNumber++; 
        while(isBanned(currentNumber)) {
            currentNumber++; 
        } 
        return currentNumber; 
    } 
    

    where bool isBanned(int orderNumber) simply checks the order number against the banned list and returns true if it’s not allowed.

    • Rentlar@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      1 天前

      Not that it’s hard to implement, but neat that it is already being practiced in tgese systems, similar to noticing floors 4, 13 or 14 being skipped in a building.