r/programming • • Dec 01 '15

Daily programming puzzles at Advent of Code

http://adventofcode.com/
320 Upvotes

179 comments sorted by

View all comments

Show parent comment

1

u/clambert98 Dec 08 '15

Why is the answer index + 1 and not just index?

1

u/karstens_rage Dec 08 '15

When you're iterating over characters in computer speak the first one is the 0th, but when you talk about characters the first one is 1st. The instructions also make this clear "The first character in the instructions has position 1, the second character has position 2, and so on."

1

u/clambert98 Dec 08 '15

Ok great thank you very much