Inspiration
Optimising code and making it faster is an interesting challenge and something I always enjoy doing.
What it does
Plays the game of solitaire, but this time eco friendly!
How we built it
As much as it broke me to, I removed bogo sort (despite being the fastest sorting algorithm). Calculate one break condition at a time, returnin on first fail to reduce unnecessary calculations. Remove if len(list) != 0 and replace with if list. Return early from functions when possible. Move takeTurn into separate functions # clean code. Index() has complexity of O(n) so remove instances of that where possible. Remove indentation by reversing condition on if statements. Get rid of cards.cache list, instead have a set called cache in the function. Lists have find complexity of O(n), whereas sets have find complexity of O(1).
Log in or sign up for Devpost to join the conversation.