Sounds like your fans are clogged or you've got a lot of dust (or the temperature gauge is malfunctioning and reading as hot when it's not). Did your computer feel pretty hot to the touch when it shut down?
It probably would have happened no matter what program you were running - doing something CPU intensive like watching a movie will also accelerate the heatup/shutdown.
I didn't try touching it so I can't say.
My CPU was pretty high during the time though, so yeah.
I'll also try cleaning the inside later when I my family stops using it just to be extra safe.
I'm more interested in seeing what's wrong with my code though, assuming it doesn't work properly for anyone else.