Skip to main content
deleted 36 characters in body; added 2 characters in body; deleted 3 characters in body; edited body; added 3 characters in body
Source Link
xigoi
  • 7.3k
  • 2
  • 13
  • 23

Nibbles, 2224 23.5 22 21.5 bytes

;~"able"::"<t"$">".`,_:@"r".,_@"r"^_:_@?@"d"$"d" "h"

Attempt This Online!Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8<table><tr><th>0<th>0<th>0<th>0<th>0<th>0<th>0<th>0
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8<tr><td>1<td>1<td>1<td>1<td>1<td>1<td>1<td>1
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8<tr><td>2<td>2<td>2<td>2<td>2<td>2<td>2<td>2
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8<tr><td>3<td>3<td>3<td>3<td>3<td>3<td>3<td>3
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8<tr><td>4<td>4<td>4<td>4<td>4<td>4<td>4<td>4

Explanation

;~     Define function f(str)
"able"  and call it with sstr = "able":
:       join
:        join
"<t"      "<t"
$         str
">"      ">"
.      Map
`,      0...
_        number of rows
:       join
@        f
"r"       "r"
.        map
, ^        1..repeat
_          number of rowscolumns
:         join
_@          f
?           if
@$            row index is positive
"d"          then "d"
"h"          else "h"
           columnrow index

Nibbles, 22 bytes

;~"able"::"<t"$">".`,_:@"r".,_:_?@"d" "h"

Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8

Explanation

;~     Define function f(str)
"able"  and call it with s = "able":
:       join
:        join
"<t"      "<t"
$         str
">"      ">"
.      Map
`,      0...
_        number of rows
:       join
@        f
"r"       "r"
.        map
,         1..
_          number of rows
:         join
_          f
?           if
@            row index is positive
"d"          then "d"
"h"          else "h"
           column index

Nibbles, 24 23.5 22 21.5 bytes

;~"able"::"<t"$">".`,_:@"r"^_:@?$"d" "h"

Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr><th>0<th>0<th>0<th>0<th>0<th>0<th>0<th>0
<tr><td>1<td>1<td>1<td>1<td>1<td>1<td>1<td>1
<tr><td>2<td>2<td>2<td>2<td>2<td>2<td>2<td>2
<tr><td>3<td>3<td>3<td>3<td>3<td>3<td>3<td>3
<tr><td>4<td>4<td>4<td>4<td>4<td>4<td>4<td>4

Explanation

;~     Define function f(str)
"able"  and call it with str = "able":
:       join
:        join
"<t"      "<t"
$         str
">"      ">"
.      Map
`,      0...
_        number of rows
:       join
@        f
"r"       "r"
^        repeat
_         number of columns
:         join
@          f
?           if
$            row index is positive
"d"          then "d"
"h"          else "h"
           row index
deleted 28 characters in body; added 10 characters in body
Source Link
xigoi
  • 7.3k
  • 2
  • 13
  • 23

Nibbles, 22 bytes

;~"able"::"<t"$">".`,_:@"r".,_:_?@"d" "h"

Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8

Explanation (outdated)

;;~     Define function Savef(str)
"able"  and outputcall it with s = "able":
:       join
:        join
"<t"      "<t"
"able>"$ "able>"        str
.">"      ">"
.      Map
`,       0...
_         number of rows
:        join
:         join
@          the saved stringf
"r>""r"       "r>""r"
.         map
,          1..
_           number of rows
:          join
:           join
_            the saved stringf
?            if
@             the row index is positive
"d>""d"          then "d>""d"
"h>""h"          else "h>""h"
            the column index

Nibbles, 22 bytes

;~"able"::"<t"$">".`,_:@"r".,_:_?@"d" "h"

Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8

Explanation (outdated)

;       Save and output
"<t"     "<t"
"able>" "able>"
.       Map
`,       0...
_         number of rows
:        join
:         join
@          the saved string
"r>"       "r>"
.         map
,          1..
_           number of rows
:          join
:           join
_            the saved string
?            if
@             the row index is positive
"d>"          then "d>"
"h>"          else "h>"
            the column index

Nibbles, 22 bytes

;~"able"::"<t"$">".`,_:@"r".,_:_?@"d" "h"

Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8

Explanation

;~     Define function f(str)
"able"  and call it with s = "able":
:       join
:        join
"<t"      "<t"
$         str
">"      ">"
.      Map
`,      0...
_        number of rows
:       join
@        f
"r"       "r"
.        map
,         1..
_          number of rows
:         join
_          f
?           if
@            row index is positive
"d"          then "d"
"h"          else "h"
           column index
added 13 characters in body
Source Link
xigoi
  • 7.3k
  • 2
  • 13
  • 23

Nibbles, 23.522 bytes

;"<t" "able>";~"able"::"<t"$">".`,_::@"r>"@"r".,_::_?@"d>"@"d" "h>""h"

Attempt This Online!Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8

Explanation (outdated)

;       Save and output
"<t"     "<t"
"able>" "able>"
.       Map
`,       0...
_         number of rows
:        join
:         join
@          the saved string
"r>"       "r>"
.         map
,          1..
_           number of rows
:          join
:           join
_            the saved string
?            if
@             the row index is positive
"d>"          then "d>"
"h>"          else "h>"
            the column index

Nibbles, 23.5 bytes

;"<t" "able>".`,_::@"r>".,_::_?@"d>" "h>"

Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8

Explanation

;       Save and output
"<t"     "<t"
"able>" "able>"
.       Map
`,       0...
_         number of rows
:        join
:         join
@          the saved string
"r>"       "r>"
.         map
,          1..
_           number of rows
:          join
:           join
_            the saved string
?            if
@             the row index is positive
"d>"          then "d>"
"h>"          else "h>"
            the column index

Nibbles, 22 bytes

;~"able"::"<t"$">".`,_:@"r".,_:_?@"d" "h"

Attempt This Online!

Takes arguments in the order cols rows. Outputs something like this (for 8 5):

<table><tr> <th>1 <th>2 <th>3 <th>4 <th>5 <th>6 <th>7 <th>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8
<tr> <td>1 <td>2 <td>3 <td>4 <td>5 <td>6 <td>7 <td>8

Explanation (outdated)

;       Save and output
"<t"     "<t"
"able>" "able>"
.       Map
`,       0...
_         number of rows
:        join
:         join
@          the saved string
"r>"       "r>"
.         map
,          1..
_           number of rows
:          join
:           join
_            the saved string
?            if
@             the row index is positive
"d>"          then "d>"
"h>"          else "h>"
            the column index
added 483 characters in body
Source Link
xigoi
  • 7.3k
  • 2
  • 13
  • 23
Loading
Source Link
xigoi
  • 7.3k
  • 2
  • 13
  • 23
Loading