 According to Shirley MacLaine (qv) on her official web site, much  of the movie was written as filming progressed. The gin rummy game  was added because at the time she was learning how to play the game  from her friends in the Rat Pack. Likewise, when she started  philosophizing about love during a lunch break one day, this was  also added to the script.