JavaScript Implementation of Oskar Van Deventer's Haunted Vending Machine Puzzle