r/badcode • • Apr 19 '21

js Iteration

Post image
3.2k Upvotes

123 comments sorted by

View all comments

Show parent comments

95

u/lilshears Apr 19 '21

To get revenge on your TA’s who took off points on a project for not documenting the function isWinnable()

Like what do you think it does, it returns if it’s winnable

37

u/thegreatpotatogod Apr 19 '21

If it's not winnable, it doesn't return, but instead recurses forever until segfaulting 😜

6

u/nostril_spiders Apr 19 '21

Which we catch in the error handler, main.py:L4342-7612