diff --git a/fire,py b/fire,py deleted file mode 100644 index 8d5063a..0000000 --- a/fire,py +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/python - diff --git a/fire.py b/fire.py old mode 100644 new mode 100755 index 8b1589f..c298e04 --- a/fire.py +++ b/fire.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import colorsys import random @@ -11,11 +11,11 @@ import blup.animation # http://quiteuseful.co.uk/post/96424751/beautiful-algorithms-1-fire-part-2 -dim = blup.frame.FrameDimension(18,8,16,3) +dim = blup.frame.FrameDimension(22,16,256,3) anim = blup.animation.Animation(dim) def getRandomColor(maxval): - return mmeap(lambda x: int(round(x*maxval)), colorsys.hsv_to_rgb(random.random() % 0.16666666, 1, 1)) + return list(map(lambda x: int(round(x*maxval)), colorsys.hsv_to_rgb(random.random() % 0.16666666, 1, 1))) def colorAvg(colors): r = 0 @@ -26,13 +26,13 @@ def colorAvg(colors): g += c[1] b += c[2] avg = (r,g,b) - avg = map(lambda x: int(round(x / (len(colors) * 1.0))), avg) + avg = list(map(lambda x: int(round(x / (len(colors) * 1.0))), avg)) return avg for i in range(100): randRow = [ getRandomColor(dim.depth - 1) for i in range(dim.width) ] - print randRow + print(randRow) f = blup.animation.AnimationFrame(dim, 60)