Commit 7b6a6267 authored by AVANZINI Martin's avatar AVANZINI Martin
Browse files

Figure 1

parent c11ed974
......@@ -43,14 +43,13 @@ factorb = do
isPrime <- var "isPrime"
done <- var "done"
while' (x .> 1 ) $ do
while' (x .>= 1 ) $ do
-- x = uniform(1,x)
x .~ rand x
x .= x + 1
x .~ rand (x + 1)
-- if x is prime
tick
(isPrime .= 1) .<|> (isPrime .= 0)
if isPrime .== 1 then y .= y * x else skip
-- (isPrime .= 1) .<|> (isPrime .= 0)
-- if isPrime .== 1 then y .= y * x else skip
......@@ -1226,4 +1225,3 @@ tarjan = do
tick
y .= y - 1
n .= n - 1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment