Exemple #1
0
# -*- coding: utf-8 -*-


from z8 import move2


p = [0, 1, 0, 0, 0]


for _ in xrange(1000):
    p = move2(p, 2)
    print(p)
Exemple #2
0
# -*- coding: utf-8 -*-


from z1 import p
from z5 import sense
from z8 import move2


motions = [1, 1]
measurements = ["red", 'green']


for measur, motion in zip(measurements, motions):
    p = move2(sense(p, measur), motion)
print(p)
Exemple #3
0
 def test_z8(self):
     import z8
     self.assertEqual(z8.move2([0, 1, 0, 0, 0], 2), [0, 0, .1, .8, .1])
     self.assertEqual(
         z8.move2([0, .5, 0, .5, 0], 2), [.4, .05, .05, .4, .1]
     )