# HG changeset patch # User Paul Boddie # Date 1323562295 -3600 # Node ID 42d9fec68cdd7ba8c8231590b90af61e99befa63 # Parent 18cb621de9ddac82b69a2d3815d65b3d5714f782 Replaced array usage with much simpler list operations. diff -r 18cb621de9dd -r 42d9fec68cdd ula.py --- a/ula.py Sun Dec 11 01:02:06 2011 +0100 +++ b/ula.py Sun Dec 11 01:11:35 2011 +0100 @@ -4,9 +4,6 @@ Acorn Electron ULA simulation. """ -import array -import itertools - WIDTH = 640 HEIGHT = 512 INTENSITY = 255 @@ -284,7 +281,7 @@ "Return an array representing the computer's memory." - return array.array("B", itertools.repeat(0, MAX_MEMORY)) + return [0] * MAX_MEMORY def get_screen(): @@ -293,12 +290,7 @@ x = 0 screen = [] while x < WIDTH: - y = 0 - column = [] - while y < HEIGHT: - column.append((0, 0, 0)) - y += 1 - screen.append(column) + screen.append([(0, 0, 0)] * HEIGHT) x += 1 return screen