title: Using Racket BSL to design a World program that allows a user to customize a face upon a "menu" of options for eyes, mouth, and hair
body: <p>TODO: design the World program bit-face to allow
  someone to customize a face based upon a &quot;menu&quot;
  of options for eyes, mouth, and hair.</p>
  <p>You should have (at least) three options for eyes,
  three options for mouth, and three options for hair.
  Each time the user presses the &quot;e&quot; key, they should
  see the next option for eyes (cycling as necessary);
  same with &quot;m&quot; for mouth and &quot;h&quot; for hair. The
  bit-face function should supply initial values for
  each of these face features.</p>
  <p>Images are random eyes, mouth, and hair images from the internet.</p>
  <p>I can't seem to figure out how to cycle the eyes, mouth, and hair using on-key and am not sure how to use the to-draw in this specific scenario.</p>
  <p>This is what I have so far using Racket BSL:</p>
  <pre><code>(require 2htdp/image)
  (require 2htdp/universe)
  
  (define EYES-1 [image here])
  (define EYES-2 [image here])
  (define EYES-3 [image here])
  
  (define MOUTH-1 [image here])
  (define MOUTH-2 [image here])
  (define MOUTH-3 [image here])
  
  (define HAIR-1 [image here])
  (define HAIR-2 [image here])
  (define HAIR-3 [image here])
  
  (define-struct bf [eyes mouth hair])
  
  ; A BitFace (BF) is a (make-bf Image Image Image)
  ; Interpretation: customizable face based upon a
  ; menu of eyes, mouth, and hair
  
  (define BF-1
    (make-bf EYES-1 MOUTH-1 HAIR-1))
  
  (define BF-2
    (make-bf EYES-2 MOUTH-2 HAIR-2))
  
  (define BF-3
    (make-bf EYES-3 MOUTH-3 HAIR-3))
  
  (define (bf-temp bf)
    (... (bf-eyes bf) ...
         (bf-mouth bf) ...
         (bf-hair bf) ...))
  
  ; bit-face : Image Image Image -&gt; Image
  ; creates a customized face based upon a &quot;menu&quot;
  
  (define (bit-face e m h)
    (big-bang (make-bf e m h)
      [to-draw draw-bf]))
  
  ; Wishlist:
  ; - draw-bf
  ; - key-bf
  
  ; draw-bf : BF -&gt; Image
  ; visualize a bit face
  
  (define (draw-bf bf)
    (place-image
     (circle 100 &quot;outline&quot; &quot;black&quot;)
     150 150
     (empty-scene 300 300)))
  
  ; key-bf : BF KeyEvent -&gt; BF
  ; cycle the eyes, mouth, and
  ; hair when keys are pressed
  
  (define (key-bf bf)
    (... (bf-eyes bf) ...
         (bf-mouth bf) ...
         (bf-hair bf) ...))
  </code></pre>