Skip to main content
added 2647 characters in body
Source Link
recursive
  • 10.4k
  • 20
  • 36

Stax, 23 bytes

ù╒←∩♂2Ωⁿ¡├∩22♀Ç○=÷â╧δÖ↑

Run and debug it

Input is two integers separated by a space.
The first is d. -1 specifies north-east. 0 for north. 1 for north-west. The second parameter is n. These two values will get implicitly parsed from input and placed on the input stack with n on top. Additionally d will be accessible from the stax's x register since it's the first implicitly parsed value.

For example, input "1 7"

            Main stack      Explanation
            ----------      -----------
;           [7]             peek from input stack
m                           map over integers [1..n] using the rest of the program
                            output each produced value implicitly
  ;         [1 7]           peek from input stack
  +         [8]             add
  .*"       [8 [42 34]]     2 character string literal with codepoints 42 and 34
  @         [42]            get the element at the specified modular index (8)
  0         [42 0]          literal zero
  "|\/"x@   [42 0 92]       get codepoint from string literal at input d (from x register)
  \         [42 [0 92]]     make pair
  :B        ['\ \ \ ']      encode in custom base; it's binary with custom codepoints
  _x*       ['\ \ \ ' 1]    (loop variable) * (input d)
  ;^        ['\ \ \ ' 1 8]  peek from input stack and increment
  %         ['\ \ \ ' 1]    modulus
  6+        ['\ \ \ ' 7]    add 6
  )         [' \ \ \ ']     left-pad to length

Run this one

Stax, 23 bytes

ù╒←∩♂2Ωⁿ¡├∩22♀Ç○=÷â╧δÖ↑

Run and debug it

Stax, 23 bytes

ù╒←∩♂2Ωⁿ¡├∩22♀Ç○=÷â╧δÖ↑

Run and debug it

Input is two integers separated by a space.
The first is d. -1 specifies north-east. 0 for north. 1 for north-west. The second parameter is n. These two values will get implicitly parsed from input and placed on the input stack with n on top. Additionally d will be accessible from the stax's x register since it's the first implicitly parsed value.

For example, input "1 7"

            Main stack      Explanation
            ----------      -----------
;           [7]             peek from input stack
m                           map over integers [1..n] using the rest of the program
                            output each produced value implicitly
  ;         [1 7]           peek from input stack
  +         [8]             add
  .*"       [8 [42 34]]     2 character string literal with codepoints 42 and 34
  @         [42]            get the element at the specified modular index (8)
  0         [42 0]          literal zero
  "|\/"x@   [42 0 92]       get codepoint from string literal at input d (from x register)
  \         [42 [0 92]]     make pair
  :B        ['\ \ \ ']      encode in custom base; it's binary with custom codepoints
  _x*       ['\ \ \ ' 1]    (loop variable) * (input d)
  ;^        ['\ \ \ ' 1 8]  peek from input stack and increment
  %         ['\ \ \ ' 1]    modulus
  6+        ['\ \ \ ' 7]    add 6
  )         [' \ \ \ ']     left-pad to length

Run this one

Post Undeleted by recursive
deleted 9 characters in body
Source Link
recursive
  • 10.4k
  • 20
  • 36

Stax, 2623 bytes

äö.7☺?↔║ôτí≈G▼═6%W╥─]╢Æé3τù╒←∩♂2Ωⁿ¡├∩22♀Ç○=÷â╧δÖ↑

Run and debug itRun and debug it

Stax, 26 bytes

äö.7☺?↔║ôτí≈G▼═6%W╥─]╢Æé3τ

Run and debug it

Stax, 23 bytes

ù╒←∩♂2Ωⁿ¡├∩22♀Ç○=÷â╧δÖ↑

Run and debug it

Post Deleted by recursive
deleted 6 characters in body
Source Link
recursive
  • 10.4k
  • 20
  • 36

Stax, 2826 bytes

Çík±A"≥↨♫ÿ8⌠εéh!ü┌}↔\ú┼J╫aÆXäö.7☺?↔║ôτí≈G▼═6%W╥─]╢Æé3τ

Run and debug itRun and debug it

Stax, 28 bytes

Çík±A"≥↨♫ÿ8⌠εéh!ü┌}↔\ú┼J╫aÆX

Run and debug it

Stax, 26 bytes

äö.7☺?↔║ôτí≈G▼═6%W╥─]╢Æé3τ

Run and debug it

Source Link
recursive
  • 10.4k
  • 20
  • 36
Loading