Erlang Add Border
-module(add_border).
-export([add_border/1]).
add_border(Picture) ->
Width = length(hd(Picture)),
Border = lists:duplicate(Width + 2, $*),
Bordered = [[$*] ++ Row ++ [$*] || Row <- Picture],
[Border] ++ Bordered ++ [Border].
This builds a new grid with a * border around every side. It adds a full top and bottom row, then wraps each existing row from left and right.