Skip to main content
Saved 0.82 bytes
Source Link
The Thonnu
  • 18.3k
  • 3
  • 16
  • 74

Thunno B, \$18 \log_{256}(96) \approx\$\$17 \log_{256}(96) \approx\$ 14.82 bytes

S"lightdark"5ApsAHS"ldiagrhkt"ZlsAH

Attempt This Online!Attempt This Online!

S"lightdark"5ApsAHS"ldiagrhkt"ZlsAH   # Implicit input. The B flag gets the ordinals of each character in the input.
S                    # Sum the ordinals
 "lightdark" "ldiagrhkt"        # String "lightdark""ldiagrhkt"
            5ApZl      # SplitUninterleaved intoto get ['light', 'dark']
               sAH   # Index into this list (1-based, modular)
                     # Implicit output

Thunno B, \$18 \log_{256}(96) \approx\$ 14.82 bytes

S"lightdark"5ApsAH

Attempt This Online!

S"lightdark"5ApsAH   # Implicit input. The B flag gets the ordinals of each character in the input.
S                    # Sum the ordinals
 "lightdark"         # String "lightdark"
            5Ap      # Split into ['light', 'dark']
               sAH   # Index into this list (1-based, modular)
                     # Implicit output

Thunno B, \$17 \log_{256}(96) \approx\$ 14 bytes

S"ldiagrhkt"ZlsAH

Attempt This Online!

S"ldiagrhkt"ZlsAH   # Implicit input. The B flag gets the ordinals of each character in the input.
S                   # Sum the ordinals
 "ldiagrhkt"        # String "ldiagrhkt"
            Zl      # Uninterleaved to get ['light', 'dark']
              sAH   # Index into this list (1-based, modular)
                    # Implicit output
Source Link
The Thonnu
  • 18.3k
  • 3
  • 16
  • 74

Thunno B, \$18 \log_{256}(96) \approx\$ 14.82 bytes

S"lightdark"5ApsAH

Attempt This Online!

S"lightdark"5ApsAH   # Implicit input. The B flag gets the ordinals of each character in the input.
S                    # Sum the ordinals
 "lightdark"         # String "lightdark"
            5Ap      # Split into ['light', 'dark']
               sAH   # Index into this list (1-based, modular)
                     # Implicit output