Skip to main content
Commonmark migration
Source Link

Brachylog, 20 bytes

c≡ᵍ∋Ȯ&;I∋₎;J∋₎gȮ∧I;J 

Try it online!

Outputs [I,J], where I is the row index and J the column index, both 0-indexed.

Stupidely long, but getting indexes in Brachylog is usually very verbose.

###Explanation

Explanation

c Concatenate the Input into a single string ≡ᵍ Group identical characters together ∋Ȯ Ȯ is a list of One element, which is the needle character &;I∋₎ Take the Ith row of the Input ;J∋₎ Take the Jth character of the Ith row gȮ That character, when wrapped in a list, is Ȯ ∧I;J The output is the list [I,J] 

Brachylog, 20 bytes

c≡ᵍ∋Ȯ&;I∋₎;J∋₎gȮ∧I;J 

Try it online!

Outputs [I,J], where I is the row index and J the column index, both 0-indexed.

Stupidely long, but getting indexes in Brachylog is usually very verbose.

###Explanation

c Concatenate the Input into a single string ≡ᵍ Group identical characters together ∋Ȯ Ȯ is a list of One element, which is the needle character &;I∋₎ Take the Ith row of the Input ;J∋₎ Take the Jth character of the Ith row gȮ That character, when wrapped in a list, is Ȯ ∧I;J The output is the list [I,J] 

Brachylog, 20 bytes

c≡ᵍ∋Ȯ&;I∋₎;J∋₎gȮ∧I;J 

Try it online!

Outputs [I,J], where I is the row index and J the column index, both 0-indexed.

Stupidely long, but getting indexes in Brachylog is usually very verbose.

Explanation

c Concatenate the Input into a single string ≡ᵍ Group identical characters together ∋Ȯ Ȯ is a list of One element, which is the needle character &;I∋₎ Take the Ith row of the Input ;J∋₎ Take the Jth character of the Ith row gȮ That character, when wrapped in a list, is Ȯ ∧I;J The output is the list [I,J] 
Source Link
Fatalize
  • 39.6k
  • 5
  • 73
  • 165

Brachylog, 20 bytes

c≡ᵍ∋Ȯ&;I∋₎;J∋₎gȮ∧I;J 

Try it online!

Outputs [I,J], where I is the row index and J the column index, both 0-indexed.

Stupidely long, but getting indexes in Brachylog is usually very verbose.

###Explanation

c Concatenate the Input into a single string ≡ᵍ Group identical characters together ∋Ȯ Ȯ is a list of One element, which is the needle character &;I∋₎ Take the Ith row of the Input ;J∋₎ Take the Jth character of the Ith row gȮ That character, when wrapped in a list, is Ȯ ∧I;J The output is the list [I,J]