Skip to main content
deleted 3 characters in body
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

Jelly, 14 12 bytes

Œṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]i+2]
      ⁼       Equal to original?         = 10
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0

Jelly, 14 12 bytes

Œṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
      ⁼       Equal to original?         = 1
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0

Jelly, 14 12 bytes

Œṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2]
      ⁼       Equal to original?         = 0
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0
added 43 characters in body
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

JellyJelly, 14 12 bytes

Œṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
      ⁼       Equal to original?         = 1
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0

Jelly, 14 12 bytes

Œṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
      ⁼       Equal to original?         = 1
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0

Jelly, 14 12 bytes

Œṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
      ⁼       Equal to original?         = 1
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0
added 680 characters in body
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92

Jelly, 1414 12 bytes

Q⁼
Œṙ+\µÇȧṛŒṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
      ⁼       Equal to original?         = 1
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0

Jelly, 14 bytes

Q⁼
Œṙ+\µÇȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Jelly, 14 12 bytes

Œṙ+\µQ⁼ȧṛ/¬$

This is my first time golfing in Jelly. Suggestions are welcome.

Input is as an array of [direction, distance] pairs, where the direction is given as a complex number.

Explanation:

Œṙ+\µÇȧṛ/¬$   Main link. Argument: n     = [[i, 3], [1, 2], [-i, 3]]
Œṙ            Run-length decode          = [i, i, i, 1, 1, -i, -i, -i]
  +\          Cumulative sum             = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
    µ         Begin a new monadic chain
     Q        Remove duplicates          = [i, 2i, 3i, 3i+1, 3i+2, 2i+2, i+2, i]
      ⁼       Equal to original?         = 1
           $  Make a monadic link:
        ṛ/      Reduce by right argument   = i
                (Gets the last element)
          ¬     Logical NOT:               = 0
       ȧ      Logical AND the two values = 0
Post Undeleted by Esolanging Fruit
added 13 characters in body
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92
Loading
Post Deleted by Esolanging Fruit
Source Link
Esolanging Fruit
  • 15.5k
  • 4
  • 49
  • 92
Loading