->x,y{y.times{|i|puts"|#{(-~i%y<2??-:' ')*(x-2)}|"}}.call *[8,5]
Standard input is empty
|------| | | | | | | |------|
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!