Random but interesting Python projects that sometimes seem like reinventing the wheel but are fun to implement.
This is a modification of the A Small, Simple and Fast Spelling Checker which is one of a project in the Python for fun.
The basic implementation is the same as stated in the Python for fun but the for working it uses The Levenshtein Algorithm ~ 4min and uses Trees to calculate the distance.
Motivation was to learn Data Structure without muggin up books but by implementing real life project.
Write a Python program to simulate an ecosystem containing bears and fish. The ecosystem consists of a river, which is modeled as a list. Each element should be a Bear object, a Fish object, or None. Animals have attributes gender and strength. In each time step, each animal randomly either moves to an adjacent tile or stays where it is. If a fish encounters a bear, the fish gets eaten. If two animals of the same type encounter each other, a new instance of that animal type is generated if they are the same gender. Otherwise, they fight and the one with larger strength survives.
This is a question from the book that I am currently reading Data Structures and Algorithms in Python by Michael H. Goldwasser, Michael T. Goodrich, and Roberto Tamassia.
It's a great mini-project for someone who wants to get a some insits on the OOP in Python.Plus this question has endless possiblities of features to be added as it simulates the real world.