Constructor/Selector for Representation 2

Exercise 6.7, p. 147: Generalize exponent-of-2-in so that
          (exponent-of-in n m)
returns the highest power of n that divides evenly into m.
          (exponent-of-in 2 3888) ⇒ 4
          (exponent-of-in 3 3888) ⇒ 5
The selector is now straightforward:
     (define size-of-pile
       (lambda (game-state pile-number)
         (if (= pile-number 1)
             (exponent-of-in 2 game-state)
             (exponent-of-in 3 game-state))))