Demo entry 6763759

tommaso

   

Submitted by anonymous on Oct 25, 2018 at 13:25
Language: Bash. Code size: 459 Bytes.

#!/bin/bash 

#the first parameter is the length, the second one is the high

#crete horizonatal lines
for (( i=1; i<=($1-2); i++ ))
do
  horiz_line+="-" #create the horizatal lines with -
  space+=" " #create the horizontal lines with spaces
done

#print the first line
echo "+$horiz_line+"

#print the two vertical lines
for (( j=1; j<=($2-2); j++ ))
  do
    echo "|$space|"
  done

#print the last horizontal line
echo "+$horiz_line+"

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).