Minimum number of cells after, before, above and below NxN squares: Difference between revisions

Added AutoHotkey
(Add CLU)
(Added AutoHotkey)
Line 203:
│ │ │ │0 0 0 0 0 0 0 0 0 0│
└───┴─────┴─────────────────┴───────────────────┘</pre>
 
=={{header|AutoHotkey}}==
<lang AutoHotkey>gridSize := 10
 
grid := []
loop % gridSize {
row := A_Index
loop % gridSize {
col := A_Index
grid[row, col] := Min(row, col, gridSize+1-row, gridSize+1-col) - 1
}
}
 
for row, obj in Grid {
for col, v in obj
result .= v " "
result .= "`n"
}
MsgBox % result</lang>
{{out}}
<pre>0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 1 1 1 1 0
0 1 2 2 2 2 2 2 1 0
0 1 2 3 3 3 3 2 1 0
0 1 2 3 4 4 3 2 1 0
0 1 2 3 4 4 3 2 1 0
0 1 2 3 3 3 3 2 1 0
0 1 2 2 2 2 2 2 1 0
0 1 1 1 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0 </pre>
 
=={{header|AWK}}==
<lang AWK>
299

edits