FlagVM/flagpole/tests/isprime.fp
2026-07-27 21:33:33 -04:00

13 lines
261 B
GLSL

$inc fvmstd.fp
proc main
:getuint @x
2 @checkFact
while &checkFact &checkFact u* 1 u- &x u< do
if &x &checkFact u% 0 == then
"Not Prime" :puts :newline return
endif
&checkFact 1 u+ @checkFact
endwhile
"Prime" :puts :newline
endproc