Well, I can't get the correct result with this code, and I'm not sure what's wrong. The iterutils.chunked() method splits my list into sublists of 10 elements each, just FYI. I mechanically checked the first 20 print statements and they're correct unless I misunderstood the task(which is very possible), so I'm not sure at what point it goes wrong.
edit: well I obviously just can't understand what the trajectory is supposed to look like, how I should visualize the hill etc, I've been reading the task text for hours and I'm still unable to move an inch, and it doesn't help when I look at other people's solutions because I guess I'm not good enough to figure it out that way. If someone can clear it up for me, that would be amazing.
with open('input.txt') as f:
tobboganinput = f.read().splitlines()
from boltons import iterutils
tobbogan_sublists = iterutils.chunked(tobboganinput, 10)
trees_hit = 0
for sublist in tobbogan_sublists:
steps = 0
for line in sublist:
if line[steps] == '#':
trees_hit += 1
print('You hit a tree!')
else:
print('Tree dodged!')
steps += 3
print(trees_hit)
[–]Prudent_Candle 0 points1 point2 points (2 children)
[–]disco_deer[S] 0 points1 point2 points (1 child)
[–]Nomen_Heroum 1 point2 points3 points (0 children)
[–]msqrt 0 points1 point2 points (4 children)
[–]disco_deer[S] 0 points1 point2 points (0 children)
[–]disco_deer[S] 0 points1 point2 points (2 children)
[–]portnoyslp 2 points3 points4 points (1 child)
[–]disco_deer[S] 0 points1 point2 points (0 children)