Skip to main content
added 21 characters in body
Source Link
Asturio
  • 121
  • 3

Bash and seq, 132132 108 bytes

 b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 

Use calling r, like r 8 4:

|------| | | | | |------| 

Update with manatwork suggestions, reducing to 108 byte (not EOL in the last line):

b(){ echo "|`for i in $(seq 3 $1);{ echo -n "$2";}`|";} r(){ b $1 -;for i in `seq 3 $2`;{ b $1 \ ;};b $1 -;} 

Bash and seq, 132 bytes

 b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 

Use calling r, like r 8 4:

|------| | | | | |------| 

Update with manatwork suggestions, reducing to 108 byte (not EOL in the last line):

b(){ echo "|`for i in $(seq 3 $1);{ echo -n "$2";}`|";} r(){ b $1 -;for i in `seq 3 $2`;{ b $1 \ ;};b $1 -;} 

Bash and seq, 132 108 bytes

 b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 

Use calling r, like r 8 4:

|------| | | | | |------| 

Update with manatwork suggestions, reducing to 108 byte (not EOL in the last line):

b(){ echo "|`for i in $(seq 3 $1);{ echo -n "$2";}`|";} r(){ b $1 -;for i in `seq 3 $2`;{ b $1 \ ;};b $1 -;} 
Applied suggestions from manatwork
Source Link
Asturio
  • 121
  • 3

Bash and seq, 132 bytes

b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 
 b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 

Use calling r, like r 8 4:

|------| | | | | |------| 

Update with manatwork suggestions, reducing to 108 byte (not EOL in the last line):

b(){ echo "|`for i in $(seq 3 $1);{ echo -n "$2";}`|";} r(){ b $1 -;for i in `seq 3 $2`;{ b $1 \ ;};b $1 -;} 

Bash and seq, 132 bytes

b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 

Use calling r, like r 8 4:

|------| | | | | |------| 

Bash and seq, 132 bytes

 b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 

Use calling r, like r 8 4:

|------| | | | | |------| 

Update with manatwork suggestions, reducing to 108 byte (not EOL in the last line):

b(){ echo "|`for i in $(seq 3 $1);{ echo -n "$2";}`|";} r(){ b $1 -;for i in `seq 3 $2`;{ b $1 \ ;};b $1 -;} 
Source Link
Asturio
  • 121
  • 3

Bash and seq, 132 bytes

b(){ echo -n "|";for i in $(seq 3 $1);do echo -n "$2";done;echo "|";} r(){ b $1 "-";for i in $(seq 3 $2);do b $1 " ";done;b $1 "-";} 

Use calling r, like r 8 4:

|------| | | | | |------|