MCPcopy Create free account
hub / github.com/ActiveState/code / add_one

Function add_one

recipes/Python/577674_Bitmap_Maker/recipe-577674.py:10–17  ·  view source on GitHub ↗
(array, colors)

Source from the content-addressed store, hash-verified

8 add_one(array, colors)
9
10def add_one(array, colors):
11 for index, digit in enumerate(array):
12 digit += 1
13 if digit == colors:
14 array[index] = 0
15 else:
16 array[index] = digit
17 break
18
19def create_image(array, width, counter=[1]):
20 image = BitMap(width, len(array) // width)

Callers 1

mainFunction · 0.85

Calls 1

enumerateFunction · 0.50

Tested by

no test coverage detected