From 3116435878936fa5dae1e4486101f5f806fe7a35 Mon Sep 17 00:00:00 2001 From: Jane Petrovna Date: Mon, 9 Nov 2020 02:52:45 -0500 Subject: [PATCH] ttttt --- pattern.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pattern.py b/pattern.py index ee88a01..dd6c7df 100644 --- a/pattern.py +++ b/pattern.py @@ -89,13 +89,14 @@ def pat(index, tick, previous_values): this.values['index'] = index if this.pattern != None: for i in range(len(this.pattern)): - name = this.pattern[i]['instruction']['name'] - targets = this.pattern[i]['instruction']['targets'] - args = [] - if 'args' in this.pattern[i]['instruction']: - args = this.pattern[i]['instruction']['args'] - if this.instructions[name] != None: - apply(targets, args, this.instructions[name]) + if i < len(this.pattern): + name = this.pattern[i]['instruction']['name'] + targets = this.pattern[i]['instruction']['targets'] + args = [] + if 'args' in this.pattern[i]['instruction']: + args = this.pattern[i]['instruction']['args'] + if this.instructions[name] != None: + apply(targets, args, this.instructions[name]) r = this.values["r"] g = this.values["g"] b = this.values["b"]