Four sides of square: Difference between revisions

m
Line 357:
 
Implementation:
<lang J>fsosfsosq=: {{+./~(+.|.)y{.1}}</lang>
 
Some examples:
 
<lang J> fsosfsosq 0
fsosfsosq 1
1
fsosfsosq 2
1 1
1 1
fsosfsosq 3
1 1 1
1 0 1
1 1 1
fsosfsosq 4
1 1 1 1
1 0 0 1
1 0 0 1
1 1 1 1
fsosfsosq 10
1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 1
Line 390:
Gui examples are not visible here, but, for example:
<lang J> require'viewmat'
viewmat fsosfsosq 20
viewmat fsosfsosq 5</lang>
 
=={{header|Julia}}==
6,951

edits