def main():
    #positions = [x[i] for x in itertools.permutations(range(0,50), 2) for i in range(0, 2)]
    def getrow(y, offset):
        for x in range(offset + 1, 50):
            if COMPUTER.start(program[:], [x, y])[0] == 0:
                return complex(offset, x - offset)

    rows = []
    offset = 0
    for y in range(0, 50):
        for x in range(offset, 50):
            if COMPUTER.start(program[:], [x, y])[0] == 1:
                offset = x
                rows.append(getrow(y, offset))
                break
        else:
            rows.append(complex(0, 0))

    text = ''
    count = 0
    for r in rows:
        text += int(r.real) * ' ' + int(
            r.imag) * u'\u2588' + int(50 - r.real - r.imag) * ' ' + '\n'
        count += r.imag
    print text
    print "affected points: " + str(int(count))
    return count
def main():
    instr = instructions()
    instr.add('NOT A J')
    instr.add('NOT B T')
    instr.add('OR T J')
    instr.add('NOT C T')
    instr.add('OR T J')
    instr.add('AND D J')

    output = COMPUTER.start(program, instr.getinstruction())
    writetoscreen(output)
Example #3
0
def main():
    instr = instructions()
    instr.add('NOT A J')
    instr.add('NOT B T')
    instr.add('OR T J')
    instr.add('NOT C T')
    instr.add('OR T J')  #A/B/C = AIR (should jump)

    instr.add('NOT A T')
    instr.add('OR H T')
    instr.add('OR E T')
    instr.add('AND D T')  #H/E AND D IS LAND (is save to jump)

    instr.add('AND T J')  #should and can jump

    output = COMPUTER.start(program, instr.getinstruction())
    writetoscreen(output)
def main():
    return str(COMPUTER.start(program, [1])[0])
 def getpos(x, y):
     return COMPUTER.start(program[:], [x, y])[0]
 def getrow(y, offset):
     for x in range(offset + 1, 50):
         if COMPUTER.start(program[:], [x, y])[0] == 0:
             return complex(offset, x - offset)