He literally wrote The Gambler (1866) in 26 days in order to make enough money to pay off his gambling debts and promptly continue gambling.