here2share

# rgb_combo.py

Jul 17th, 2022 (edited)
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. # rgb_combo.py
  2.  
  3. def  nCombinations(x=0, restore=[]):
  4.     while 1:
  5.         for r in range(x+10):
  6.             for g in range(r+1,x+10):
  7.                 for b in range(max(g+1,x),x+10):
  8.                     yield [r,g,b]
  9.         x += 10
  10.  
  11. get_combo = nCombinations()
  12.  
  13. while 1:
  14.     print(next(get_combo))
Add Comment
Please, Sign In to add comment