Ulam spiral (for primes): Difference between revisions
Content added Content deleted
(Added Quackery.) |
|||
Line 4,466: | Line 4,466: | ||
- 43 - - - 47 - - - |
- 43 - - - 47 - - - |
||
73 - - - - - 79 - - |
73 - - - - - 79 - - |
||
</pre> |
|||
=={{header|Quackery}}== |
|||
<code>isprime</code> is defined at [[Primality by trial division#Quackery]]. |
|||
<code>spiral</code> is defined at [[Spiral matrix#Quackery]]. |
|||
<syntaxhighlight lang="Quackery"> [] 900 times |
|||
[ i 1+ isprime join ] |
|||
30 spiral |
|||
witheach |
|||
[ witheach |
|||
[ dip dup peek iff |
|||
[ say "[]" ] |
|||
else [ say " " ] |
|||
] cr ] |
|||
drop</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
[] [] [] [] |
|||
[] [] [] [] |
|||
[] [] [] [] [] |
|||
[] [] [] [] [] [] |
|||
[] [] [] |
|||
[] [] [] [] |
|||
[] [] [] [] [] [] [] |
|||
[] [] [] [] [] |
|||
[] [] [] [] [] |
|||
[] [] [] [] |
|||
[] [] [] [] [] [] [] |
|||
[] [] [] |
|||
[] [] [] [] [] [] [] [] |
|||
[] [] [] [] [] [] [] [] [] |
|||
[] [] [] [] |
|||
[] [] [][] [] [] [] [] [] |
|||
[] [] [] [] |
|||
[] [] |
|||
[] [] [] [] [] [] [] [] [] |
|||
[] [] [] [] [] [] [] |
|||
[] [] |
|||
[] [] [] [] [] |
|||
[] [] [] [] |
|||
[] [] [] [] |
|||
[] [] [] [] [] |
|||
[] [] [] [] [] [] [] |
|||
[] [] [] [] |
|||
[] [] [] [] [] [] |
|||
[] [] [] |
|||
[] [] [] [] [] |
|||
</pre> |
</pre> |
||