forked from M-Labs/artiq
examples/coredev_test: use booleans
This commit is contained in:
parent
3a6bed43e6
commit
f6bbcb6789
|
@ -17,12 +17,12 @@ class CompilerTest(AutoContext):
|
||||||
m = self.get_max()
|
m = self.get_max()
|
||||||
while x < m:
|
while x < m:
|
||||||
d = 2
|
d = 2
|
||||||
prime = 1
|
prime = True
|
||||||
while d*d <= x:
|
while d*d <= x:
|
||||||
if x % d == 0:
|
if x % d == 0:
|
||||||
prime = 0
|
prime = False
|
||||||
d = d + 1
|
d = d + 1
|
||||||
if prime == 1:
|
if prime:
|
||||||
self.output(x)
|
self.output(x)
|
||||||
x = x + 1
|
x = x + 1
|
||||||
self.led.set(0)
|
self.led.set(0)
|
||||||
|
|
Loading…
Reference in New Issue