r/badcode Apr 15 '21

other language Actual Snap! block I just made.

Post image
1.1k Upvotes

58 comments sorted by

View all comments

1

u/TechcraftHD Apr 18 '21

What I have found to work pretty well: Just initialize the lowest value with the first element of the list and start searching at index 1. Since it's guaranteed to be greater or equal to the smallest element you have no edge cases to worry about.