create candidates 1000 cells allot create temp 1 cells allot : setones 0 begin dup 1 swap cells candidates + ! 1 + dup 999 > until drop ; setones 0 candidates ! 0 1 cells candidates + ! : findone begin 1 + dup cells candidates + @ 1 = until ; : markmult temp ! 2 begin dup temp @ * cells candidates + 0 swap ! 1 + dup temp @ * 999 > until drop temp @ ; : mainloop 0 begin findone markmult dup 499 > until drop ; mainloop : printloop cr 0 begin dup cells candidates + @ 1 = if dup . S" is prime" type cr then 1 + dup 999 > until drop ; printloop