remove global gold

Rewrite ex36 so that the gold variable is initialized at gold=0 in
beginning of game and then carried through functions while being
changed, until it is printed at end of game.