on a sudden wish or decision; suddenly; without thought or preparation.
I think a gambler is just simply living on the spur of the moment, and not looking forward to the future, or he wouldn't be gambling.