fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3. #define NUM_TABS (24)
  4.  
  5. int main(void) {
  6. // your code goes here
  7. uint8_t indexTabIndex = 11;
  8. int8_t tabs_from_index_to_eclipse = 5;
  9. for (uint8_t currentTabIndex = 0; currentTabIndex < 24; currentTabIndex++)
  10. {
  11. const uint8_t tabs_from_start_of_eclipse = (indexTabIndex + NUM_TABS + tabs_from_index_to_eclipse + NUM_TABS - currentTabIndex) % 6;
  12. printf("Tab %u, mod6_delta_from_eclipse=%u\n", currentTabIndex, tabs_from_start_of_eclipse);
  13. }
  14.  
  15.  
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Tab 0, mod6_delta_from_eclipse=4
Tab 1, mod6_delta_from_eclipse=3
Tab 2, mod6_delta_from_eclipse=2
Tab 3, mod6_delta_from_eclipse=1
Tab 4, mod6_delta_from_eclipse=0
Tab 5, mod6_delta_from_eclipse=5
Tab 6, mod6_delta_from_eclipse=4
Tab 7, mod6_delta_from_eclipse=3
Tab 8, mod6_delta_from_eclipse=2
Tab 9, mod6_delta_from_eclipse=1
Tab 10, mod6_delta_from_eclipse=0
Tab 11, mod6_delta_from_eclipse=5
Tab 12, mod6_delta_from_eclipse=4
Tab 13, mod6_delta_from_eclipse=3
Tab 14, mod6_delta_from_eclipse=2
Tab 15, mod6_delta_from_eclipse=1
Tab 16, mod6_delta_from_eclipse=0
Tab 17, mod6_delta_from_eclipse=5
Tab 18, mod6_delta_from_eclipse=4
Tab 19, mod6_delta_from_eclipse=3
Tab 20, mod6_delta_from_eclipse=2
Tab 21, mod6_delta_from_eclipse=1
Tab 22, mod6_delta_from_eclipse=0
Tab 23, mod6_delta_from_eclipse=5