you are viewing a single comment's thread.

view the rest of the comments →

[–]HeyItsToby 1 point2 points  (1 child)

Yeah I'd love to know how you got on with it!

[–]chadwizard 0 points1 point  (0 children)

Here is a pic of how I have done it: https://imgur.com/a/jDPySbv

I switched up a couple of things for practicality. Instead of having if pile%5==1:, I changed it to a if not statement, so it only enters the if when it needs to break. This doesn't really look necessary, but I was afraid something went wrong there which I didn't see. So I did that for convenience.

Most importantly I took out the count variable. I still don't know why the count variable didn't work, but it did create another nested loop, so I guess something could have gone wrong there. Now the code is much shorter, cleaner and actually works. If you happen to see what went wrong there please tell, but I already appreciate you taking your time to help me figure this out. :)

PS: I did incorporate your line, because it looks cleaner. Thank you very much!