🔥 FLAMES Game in Python (Console Based)
The FLAMES game is a fun and nostalgic relationship game many of us played during school days. This Python console version calculates the relationship status between two names using simple string logic and a list rotation technique. Below is the full Python code.
💡 What is FLAMES?
FLAMES stands for: Friends, Lovers, Affectionate, Marriage, Enemies, Siblings. The logic involves removing common letters from two names and counting the remaining letters to eliminate items from the list until one remains.
🧑💻 Python Code:
def flames(name1, name2): name1 = name1.strip().replace(' ','').lower() name2 = name2.strip().replace(' ','').lower() for char in name1: for a in name2: if char == a: name1 = name1.replace(char,'',1) name2 = name2.replace(a,'',1) break print(name1) print(name2) count = len(name1 + name2) flames = ['Friends', 'Lovers', 'Affectionate', 'Marriage', 'Enimies', 'Siblings'] while len(flames) > 1: splitIndex = (count % len(flames)) - 1 if splitIndex >= 0: splitRight = flames[splitIndex+1:] splitLeft = flames[:splitIndex] flames = splitRight + splitLeft else: flames = flames[:len(flames)-1] return flames[0] print(flames('ram kumar', 'rajesh'))
✅ Output:
After removing common characters, the function calculates the relationship using the FLAMES logic and prints the final result.
For example: ram kumar
and rajesh
→ Lovers (or result based on logic).
📌 Why You Should Try This:
- Perfect mini project for Python beginners
- Fun logic and string manipulation practice
- Helps understand loops and list handling in Python
🎮 Want more mini projects?
👉 Subscribe to our YouTube channel for cool nostalgic games & Python projects!