I created a command-line egg game in C, where players can discover the optimal cooking time for boiling an egg. I’ve designed a dozen endings depending on how many minutes the egg was cooked.
Motivation
I love eggs, so I decided to make my first coding project based on something I really like.
Research
I decided to complete a small project so I can see it through from beginning to end as a full cycle. I knew about scope creep and it definitely tried to derail me a few times (e.g. easter eggs, achievements chart, extra levels), however, I cut down the extra features and instead focused on finishing the game first.
I initially thought a text-based game based on boiling the egg would be quite simple to achieve. However, since I wanted to accurately present the boiled egg state depending on real-life timings, I realised the amount of heuristics that humans use during cooking when I got down to planning.
Egg, pot, water, stove. Just four things to manipulate – or is it?
What is the temperature of the pot of water when I put the eggs in – cold or boiling water? What are the states for different eggs for different minutes? Do I put the lid on the eggs when boiling? Should I use medium or high heat when boiling? What about the altitude we are cooking our eggs in?
To address all these questions, I researched from popular Chinese cooking app XiaChuFang, which had egg charts for different states. One of the english-looking charts recommended taking water to the boil, then boiling the egg for 11 minutes for a firm yolk with a teeeeeeny bit of just-firming-up-yolk in the middle – just perfect.
I conducted the experiment with five 700g eggs and actually took them out at different intervals to investigate the runniness of the yolk. It turns out 11 minutes did not, in fact, yield the yolk of my dreams. It was still a bit runny in the centre. The egg also cracked a bit – which I usually think is normal and dismiss it. But that day, it struck me – I was using fridge eggs! Which means they are very cold (unlike Chinese eggs which are sometimes not kept in the fridge).
I then decided to check out a bunch of other guides, mainly because I think having the stove on for 11 minutes is SUCH a waste of gas. And then I struck gold. So here is the definitive way I’ve found to boiling an egg!
The Perfect Boiled Egg Method
- Egg should be normal temperature. If using fridge eggs, wash it a bit under tap water to bring the temperature down. This will also prevent the eggs from cracking in the pot (Mystery of randomly cracking eggs in the pot solved)!
- Add tap water to the pot. We don’t need too much but enough so that it will just cover the eggs when they are put in (doesn’t need to be exact)! But don’t put the eggs in to cook just yet!
- Bring the water to a boil on high heat. This will raise the temperature to 100 degrees celsius and make it the perfect temperature for boiling eggs. I find that my small pot of water takes about 4 minutes to boil, but yours may be different.
- Place eggs into the boiling water gently (to prevent cracking the shell), and cover with a lid.
- Boil for 3 minutes on high heat. Then turn off the gas.
- Keep eggs in pot with lid on and wait for 5 minutes.
- FOR EASY PEELING: Take the egg out and place in a lunch box half with cold water or room-temperature water or ice bath. Close the lid on the lunch box, and shake the eggs inside for a bit. This will create small cracks in the eggs, create a separation between the internal egg and the shell due to the temperature difference and make it easy to peel! (You don’t need a lunch box, you can put it in a bowl and shake it a bit too, or simply just use the ice bath. But I find lunchboxes make it easier for shaking)
- Take out the eggs and peel! Check the yolk to see if it is your favourite. If you prefer it more runny, wait for less time next time!
Now it’s time to code the game!
Gameplay
Screenshots of game and gameplay (spoilers!)





