Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Elegant and simple. Thank you for sharing it even though it is over 30 years old.

Next time you happen to be at a store that has the rare, old fashioned-type automatic doors that swing out (not slide in/out), hurry out before your friends and stand on the pressure pad that is in the direction of the door swing out. No one will be able to exit.

This is a simple example of a state machine in the real world that I like to use to explain more complex state machines.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: