Skip to main content
Post Undeleted by The Thonnu
Saved 7 bytes
Source Link
The Thonnu
  • 18.3k
  • 3
  • 16
  • 74

Thunno 2, 1811 bytes

ı'/=ẋ_ðx×n+£nChEẋ+JCPDḌ€ḷṡ+ðṙ

Port of emanresu A's Vyxal answer.

Requires Thunno \$\ge 2.1.10\$. ATO is on \$2.1.9\$ 😢.Attempt This Online!

Explanation

ı'/=ẋ_ðx×n+£nChEẋ+JCPDḌ€ḷṡ+ðṙ  # Implicit input
ı        JC           # Map overCharcodes theof input string:
 '/=                #  Is the current character a forward slash?
    ẋ_     PD         #  IfAre soprime, decrement xduplicate
      ðx×     Ḍ€ḷ      #  Push xDouble, spacescomplement
         n+     ṡ+    #  And addAdd to the current character
           £        #  Print with a trailing newlinecumsums
            nChE  ðṙ  #  Is the current character a backslash?Right-justify
                ẋ+  #  If so, incrementImplicit xoutput

Thunno 2, 18 bytes

ı'/=ẋ_ðx×n+£nChEẋ+

Port of emanresu A's Vyxal answer.

Requires Thunno \$\ge 2.1.10\$. ATO is on \$2.1.9\$ 😢.

Explanation

ı'/=ẋ_ðx×n+£nChEẋ+  # Implicit input
ı                   # Map over the input string:
 '/=                #  Is the current character a forward slash?
    ẋ_              #  If so, decrement x
      ðx×           #  Push x spaces
         n+         #  And add to the current character
           £        #  Print with a trailing newline
            nChE    #  Is the current character a backslash?
                ẋ+  #  If so, increment x

Thunno 2, 11 bytes

JCPDḌ€ḷṡ+ðṙ

Attempt This Online!

Explanation

JCPDḌ€ḷṡ+ðṙ  # Implicit input
JC           # Charcodes of input
  PD         # Are prime, duplicate
    Ḍ€ḷ      # Double, complement
       ṡ+    # Add to cumsums
         ðṙ  # Right-justify
             # Implicit output
Post Deleted by The Thonnu
Source Link
The Thonnu
  • 18.3k
  • 3
  • 16
  • 74

Thunno 2, 18 bytes

ı'/=ẋ_ðx×n+£nChEẋ+

Port of emanresu A's Vyxal answer.

Requires Thunno \$\ge 2.1.10\$. ATO is on \$2.1.9\$ 😢.

Explanation

ı'/=ẋ_ðx×n+£nChEẋ+  # Implicit input
ı                   # Map over the input string:
 '/=                #  Is the current character a forward slash?
    ẋ_              #  If so, decrement x
      ðx×           #  Push x spaces
         n+         #  And add to the current character
           £        #  Print with a trailing newline
            nChE    #  Is the current character a backslash?
                ẋ+  #  If so, increment x