From 8311e3fc11f33d402cf99834daecef8c5142b1ed Mon Sep 17 00:00:00 2001 From: Frederic Date: Thu, 9 Nov 2017 21:25:43 +0100 Subject: [PATCH] 2to3 --- fire,py | 2 -- fire.py | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 fire,py mode change 100644 => 100755 fire.py 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)