Skip to main content
Commonmark migration
Source Link

[J]J, 31 22 bytes

11|1+i.~&'11|1+i.~&'''

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string 11|1+i.~&', add 1, modulo 11. [J]: http://jsoftware.com/

[J], 31 22 bytes

11|1+i.~&'11|1+i.~&'''

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string 11|1+i.~&', add 1, modulo 11. [J]: http://jsoftware.com/

J, 31 22 bytes

11|1+i.~&'11|1+i.~&'''

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string 11|1+i.~&', add 1, modulo 11.

deleted 553 characters in body
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20

[J], 3131 22 bytes

'''(15|+*)@i11|1+i.]'(15|1+]+*+*)@i~&'11|1+i.]~&'''

Try it online!Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string '(15|+*)@i11|1+i.]~&', add 2 if the index is positive, add 1 in any case, modulo 15. ###Old version, 32 bytes, 0-indexed (^1+15=])@i.~&'(^1+15=])@i.~&''' Find each character in the string (^1+15=])@i.~&'
Raise the index to the power of 1+(equals 15): if the character doesn’t exist, the index will equal the length of the string, in that case square the index11.
[Try it online!][TIO-jd0djd9m] [J]: http://jsoftware.com/ [TIO-jd0djd9m]: https://tio.run/##y/r/389JT@FR22QDBQUQZQqhDA0glCmYMoLwjKCSxoZcabZ6ChpxhtqGpraxmg6ZenVq6mhcdfX/qckZ@QppCsUlKZl5Cob/gUqAKpSB8up6dQA "J – Try It Online"http://jsoftware.com/

[J], 31 bytes

'''(15|+*)@i.]'(15|1+]+*+*)@i.]

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string '(15|+*)@i.], add 2 if the index is positive, add 1 in any case, modulo 15. ###Old version, 32 bytes, 0-indexed (^1+15=])@i.~&'(^1+15=])@i.~&''' Find each character in the string (^1+15=])@i.~&'
Raise the index to the power of 1+(equals 15): if the character doesn’t exist, the index will equal the length of the string, in that case square the index.
[Try it online!][TIO-jd0djd9m] [J]: http://jsoftware.com/ [TIO-jd0djd9m]: https://tio.run/##y/r/389JT@FR22QDBQUQZQqhDA0glCmYMoLwjKCSxoZcabZ6ChpxhtqGpraxmg6ZenVq6mhcdfX/qckZ@QppCsUlKZl5Cob/gUqAKpSB8up6dQA "J – Try It Online"

[J], 31 22 bytes

11|1+i.~&'11|1+i.~&'''

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string 11|1+i.~&', add 1, modulo 11. [J]: http://jsoftware.com/

added 1 character in body
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20

[J], 31 bytes

'''(15|+*)@i.]'(15|1+]+*+*)@i.]

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string '(15|+*)@i.], add 2 if the index is positive, add 1 in any case, modulo 15. ###Old version, 32 bytes, 0-indexed (^1+15=])@i.~&'(^1+15=])@i.~&''' Find each character in the string (^1+15=])@i.~&'
Raise the index to the power of 1+(equals 15): if the character doesn’t exist, the index will equal the length of the string, in that case square the index.
[Try it online!][TIO-jd0djd9m] [J]: http://jsoftware.com/ [TIO-jd0djd9m]: https://tio.run/##y/r/389JT@FR22QDBQUQZQqhDA0glCmYMoLwjKCSxoZcabZ6ChpxhtqGpraxmg6ZenVq6mhcdfX/qckZ@QppCsUlKZl5Cob/gUqAKpSB8up6dQA "J – Try It Online"

[J], 31 bytes

'''(15|+*)@i.]'(15|1+]+*+*)@i.]

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string (15|+*)@i.], add 2 if the index is positive, add 1 in any case, modulo 15. ###Old version, 32 bytes, 0-indexed (^1+15=])@i.~&'(^1+15=])@i.~&''' Find each character in the string (^1+15=])@i.~&'
Raise the index to the power of 1+(equals 15): if the character doesn’t exist, the index will equal the length of the string, in that case square the index.
[Try it online!][TIO-jd0djd9m] [J]: http://jsoftware.com/ [TIO-jd0djd9m]: https://tio.run/##y/r/389JT@FR22QDBQUQZQqhDA0glCmYMoLwjKCSxoZcabZ6ChpxhtqGpraxmg6ZenVq6mhcdfX/qckZ@QppCsUlKZl5Cob/gUqAKpSB8up6dQA "J – Try It Online"

[J], 31 bytes

'''(15|+*)@i.]'(15|1+]+*+*)@i.]

Try it online!

1-indexed, 0 for characters that aren’t present in the code. '' stands for a single quote. Find each character in the string '(15|+*)@i.], add 2 if the index is positive, add 1 in any case, modulo 15. ###Old version, 32 bytes, 0-indexed (^1+15=])@i.~&'(^1+15=])@i.~&''' Find each character in the string (^1+15=])@i.~&'
Raise the index to the power of 1+(equals 15): if the character doesn’t exist, the index will equal the length of the string, in that case square the index.
[Try it online!][TIO-jd0djd9m] [J]: http://jsoftware.com/ [TIO-jd0djd9m]: https://tio.run/##y/r/389JT@FR22QDBQUQZQqhDA0glCmYMoLwjKCSxoZcabZ6ChpxhtqGpraxmg6ZenVq6mhcdfX/qckZ@QppCsUlKZl5Cob/gUqAKpSB8up6dQA "J – Try It Online"

added 428 characters in body
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20
Loading
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20
Loading