At the next class, stand up and say you have an announcement to make. Then, tell them that the game is flawed, you found the flaw, and utilised it to get the good results. Explain how the flaw works, and (if possible) how to fix it. Say that the teacher needs to fix the flaw ASAP, so that you can all continue to play the game properly; and that you will refrain from exploiting it until that happens.
Firstly, it's the right thing to do. Second, you will achieve personal benefits by demonstrating smartness/cunning, as well as integrity and selflessness. Third, personal benefits are irrelevant compared to improving the world. Fourth, and most importantly, you will become a local legend.