Four sides of square: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: Add Ruby) |
(RPL: add section) |
||
Line 1,185: | Line 1,185: | ||
<br> |
<br> |
||
[http://keptarhely.eu/view.php?file=20220218v00x6hugz.jpeg Four sides of square] |
[http://keptarhely.eu/view.php?file=20220218v00x6hugz.jpeg Four sides of square] |
||
=={{header|RPL}}== |
|||
≪ → n |
|||
≪ "" 1 n '''START''' "1 " + '''NEXT''' DUP |
|||
2 n 1 - '''START''' |
|||
"" 1 n '''FOR''' j j 1 == j n == OR →STR + " " + '''NEXT NEXT''' |
|||
n ROLL 1 n '''FOR''' j j DISP '''NEXT''' |
|||
≫ ≫ ''''TASK'''' STO |
|||
4 '''TASK''' |
|||
{{out}} |
|||
<pre> |
|||
1 1 1 1 |
|||
1 0 0 1 |
|||
1 0 0 1 |
|||
1 1 1 1 |
|||
</pre> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
Line 1,204: | Line 1,222: | ||
1 1 1 1 1 1 1 1 1 |
1 1 1 1 1 1 1 1 1 |
||
</pre> |
</pre> |
||
=={{header|Sidef}}== |
=={{header|Sidef}}== |
||
<syntaxhighlight lang="ruby">var n = 5 |
<syntaxhighlight lang="ruby">var n = 5 |