Skip to main content
added 251 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Jelly, 5 bytes

T%QL<

Try it online!

Look ma, no Unicode!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

The frog must traverse every index with some chosen residue modulo the stride; this checks if there's any residue which does not at any point correspond to water.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

Takes a list of 1 for lilies and 0 for water on the left, and the stride on the right. (Without having to handle strides longer than the pond itself, could just be sPẸ.)

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?

Jelly, 5 bytes

T%QL<

Try it online!

Look ma, no Unicode!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

Takes a list of 1 for lilies and 0 for water on the left, and the stride on the right.

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?

Jelly, 5 bytes

T%QL<

Try it online!

Look ma, no Unicode!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

The frog must traverse every index with some chosen residue modulo the stride; this checks if there's any residue which does not at any point correspond to water.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

Takes a list of 1 for lilies and 0 for water on the left, and the stride on the right. (Without having to handle strides longer than the pond itself, could just be sPẸ.)

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?
added 90 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Jelly, 5 bytes

T%QL<

Try it online!

Look ma, no Unicode!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

Takes a list of 1 for lilies and 0 for water on the left, and the stride on the right.

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?

Jelly, 5 bytes

T%QL<

Try it online!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?

Jelly, 5 bytes

T%QL<

Try it online!

Look ma, no Unicode!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

Takes a list of 1 for lilies and 0 for water on the left, and the stride on the right.

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?
added 521 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Jelly, 5 bytes

T%QL<

Try it online!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?

Jelly, 5 bytes

T%QL<

Try it online!

Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.

   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.

Jelly, 6 bytes

s׃R}Ẹ

Try it online!

s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55
Loading