Skip to main content
Commonmark migration
Source Link

##Canvas, 14 12 bytes H;[⌐⌐∔*×∔;3*+

Canvas, 14 12 bytes

H;[⌐⌐∔*×∔;3*+

####Explanation:

Explanation:

##Canvas, 14 12 bytes H;[⌐⌐∔*×∔;3*+

####Explanation:

Canvas, 14 12 bytes

H;[⌐⌐∔*×∔;3*+

Explanation:

added 224 characters in body
Source Link
hakr14
  • 5k
  • 1
  • 11
  • 18

##Canvas, 14 14 12 bytes H;[:::2*×∔;3*+H;[⌐⌐∔*×∔;3*+

Code      |Instruction                                                          |Stack
----------+---------------------------------------------------------------------+-------------------------
          |Push input to stack (implicit)                                       |I
H         |Push "H" to stack                                                    |I,"H"
;        |Swap the top two stack items                                         |"H",I
[        |The following ToS (input) times:                                     |X
    :::|Duplicate⌐⌐  |Duplicate ToS (result from last loop ("H" if first loop)) threefour times|X,X,X,X,X
    2*  |Repeat twice|Join vertically                                                     |X,X,X,X\nX
    ×     |Prepend                                                              |X,X,XX\nX
    ∔    |Join vertically                                                      |X,X\nXX\nX
    ;    |Swap top two stack items                                             |X\nXX\nX,X
    3*  |Repeat3*|Repeat three times vertically                                        |X\nXX\nX,X\nX\nX
    +    |Join horizontally                                                    |X<space>X\nXXX\nX<space>X
        |End loop (implicit)                                                 |X
        |Print ToS (implicit)                                                |

Where I is the input, X is the pattern generated by the previous loop ("H" for the first loop), and <space> is the empty space on the first and third row of the pattern, added implicitly by .

-2 bytes thanks to dzaima!

##Canvas, 14 bytes H;[:::2*×∔;3*+

Code      |Instruction                                                          |Stack
----------+---------------------------------------------------------------------+-------------------------
          |Push input to stack (implicit)                                       |I
H         |Push "H" to stack                                                    |I,"H"
;        |Swap the top two stack items                                         |"H",I
[        |The following ToS (input) times:                                     |X
    :::|Duplicate ToS (result from last loop ("H" if first loop)) three times|X,X,X,X
    2*  |Repeat twice vertically                                              |X,X,X,X\nX
    ×     |Prepend                                                              |X,X,XX\nX
    ∔    |Join vertically                                                      |X,X\nXX\nX
    ;    |Swap top two stack items                                             |X\nXX\nX,X
    3*  |Repeat three times vertically                                        |X\nXX\nX,X\nX\nX
    +    |Join horizontally                                                    |X<space>X\nXXX\nX<space>X

Where I is the input, X is the pattern generated by the previous loop ("H" for the first loop), and <space> is the empty space on the first and third row of the pattern, added implicitly by .

##Canvas, 14 12 bytes H;[⌐⌐∔*×∔;3*+

Code    |Instruction                                                         |Stack
--------+--------------------------------------------------------------------+-------------------------
        |Push input to stack (implicit)                                      |I
H       |Push "H" to stack                                                   |I,"H"
;      |Swap the top two stack items                                        |"H",I
[      |The following ToS (input) times:                                    |X
    ⌐⌐  |Duplicate ToS (result from last loop ("H" if first loop)) four times|X,X,X,X,X
       |Join vertically                                                     |X,X,X,X\nX
    ×   |Prepend                                                             |X,X,XX\nX
    ∔   |Join vertically                                                     |X,X\nXX\nX
    ;  |Swap top two stack items                                            |X\nXX\nX,X
    3*|Repeat three times vertically                                       |X\nXX\nX,X\nX\nX
    +  |Join horizontally                                                   |X<space>X\nXXX\nX<space>X
        |End loop (implicit)                                                 |X
        |Print ToS (implicit)                                                |

Where I is the input, X is the pattern generated by the previous loop ("H" for the first loop), and <space> is the empty space on the first and third row of the pattern, added implicitly by .

-2 bytes thanks to dzaima!

hey guess what it looks decent now
Source Link
hakr14
  • 5k
  • 1
  • 11
  • 18
Code      |Instruction                                                          |Stack
----------+---------------------------------------------------------------------+-------------------------
          |Push input to stack (implicit)                                       |I
H         |Push "H" to stack                                                    |I,"H"
;        |Swap the top two stack items                                         |"H",I
[        |The following ToS (input) times:                                     |X
    :::|Duplicate ToS (result from last loop ("H" if first loop)) three times|X,X,X,X
    2*  |Repeat twice vertically                                              |X,X,X,X\nX
    ×     |Prepend                                                              |X,X,XX\nX
    ∔    |Join vertically                                                      |X,X\nXX\nX
    ;    |Swap top two stack items                                             |X\nXX\nX,X
    3*  |Repeat three times vertically                                        |X\nXX\nX,X\nX\nX
    +    |Join horizontally                                                    |X<space>X\nXXX\nX<space>X
Code      |Instruction                                                          |Stack

          |Push input to stack (implicit)                                       |I
H         |Push "H" to stack                                                    |I,"H"
;        |Swap the top two stack items                                         |"H",I
[        |The following ToS (input) times:                                     |X
    :::|Duplicate ToS (result from last loop ("H" if first loop)) three times|X,X,X,X
    2*  |Repeat twice vertically                                              |X,X,X,X\nX
    ×     |Prepend                                                              |X,X,XX\nX
    ∔    |Join vertically                                                      |X,X\nXX\nX
    ;    |Swap top two stack items                                             |X\nXX\nX,X
    3*  |Repeat three times vertically                                        |X\nXX\nX,X\nX\nX
    +    |Join horizontally                                                    |X<space>X\nXXX\nX<space>X
Code      |Instruction                                                          |Stack
----------+---------------------------------------------------------------------+-------------------------
          |Push input to stack (implicit)                                       |I
H         |Push "H" to stack                                                    |I,"H"
;        |Swap the top two stack items                                         |"H",I
[        |The following ToS (input) times:                                     |X
    :::|Duplicate ToS (result from last loop ("H" if first loop)) three times|X,X,X,X
    2*  |Repeat twice vertically                                              |X,X,X,X\nX
    ×     |Prepend                                                              |X,X,XX\nX
    ∔    |Join vertically                                                      |X,X\nXX\nX
    ;    |Swap top two stack items                                             |X\nXX\nX,X
    3*  |Repeat three times vertically                                        |X\nXX\nX,X\nX\nX
    +    |Join horizontally                                                    |X<space>X\nXXX\nX<space>X
added 6 characters in body; added 1 character in body
Source Link
hakr14
  • 5k
  • 1
  • 11
  • 18
Loading
better wording
Source Link
hakr14
  • 5k
  • 1
  • 11
  • 18
Loading
Source Link
hakr14
  • 5k
  • 1
  • 11
  • 18
Loading