Skip to content

Commit c06fd2d

Browse files
committed
Added another example: Prime numbers search
1 parent 3ac673c commit c06fd2d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,31 @@ while val < 10 then
137137
end
138138
```
139139

140+
### Print all primes in a sequence (till stopped)
141+
142+
```basic
143+
print(2)
144+
145+
i = 3
146+
147+
while true then
148+
p_sub = 2
149+
is_prime = true
150+
while p_sub < i then
151+
if (i % p_sub) = 0 then
152+
is_prime = false
153+
end
154+
p_sub = p_sub + 1
155+
end
156+
157+
if is_prime then
158+
print(i)
159+
end
160+
161+
i = i + 2
162+
end
163+
```
164+
140165
## TODO
141166

142167
Some features I would like to implement in this project:

0 commit comments

Comments
 (0)