Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In addition to performing the specified command, your program should output a brief description of for each command that it performs in the exact format described below. In the following list of commands, the output line specifies what your program should print.

  • The command
    Code Block
    
    receive <adjective>  <article>
    
    means Acker received a gift of the specified article (<adjective> <article>) of clothing. In response, the simulation outputs
    Code Block
    
    received adjective article
    
    and updates the state of the StudentEnvironment. For example,
    Code Block
    
    receive argyle socks
    
    generates
    Code Block
    
    received argyle socks
    
    and adds the argyle socks to the top of the socks pile on the shelf.
  • The command
    Code Block
    
    lose <adjective> <article>
    
    means Acker misplaced the specified article of clothing. If the item exists and Acker is not wearing it, the simulation outputs
    Code Block
    
    lost <adjective> <article>
    
    and updates the state of the StudentEnvironment accordingly. If Acker is wearing it, the simulation outputs
    Code Block
    
    Acker is wearing adjective article
    
    and leaves the StudentEnvironment unchanged. If the item does not exist, the simulation outputs
    Code Block
    
    adjective article does not exist
    
    and leaves the StudentEnvironment unchanged.
  • The command
    Code Block
    
    change <article>
    
    means Acker doffed the specified article of clothing, discarding it in the dirty laundry pile, and donned a replacement article using the protocol described above. In response, the simulation outputs
    Code Block
    
    doffed <adjective> <article>, donned <adjective> <article>
    
    describing the article doffed and the article donned.
  • The command
    Code Block
    
    {{launder}}
    
    means Acker washed and dried a load of laundry. If the dirty clothes pile is not empty, the simulation outputs
    Code Block
    
    washed <adjective> <article>, ..., <adjective> <article>
    
    listing the clothes in the order they were removed from the dirty clothes pile. If the dirty clothes pile is empty, the simulation outputs
    Code Block
    
    nothing to wash
    
  • The command
    Code Block
    
    fold
    
    means Acker retrieved a load of laundry, folded it, and put it on the closet shelf. If a load of laundry is available, the simulation outputs
    Code Block
    
    folded <adjective> <article>, ..., <adjective> <article>
    
    for the oldest unfolded load. List the clothes in the order they are placed on the shelf. Hence the top garment on the shelf should be the last one listed. If no load of laundry has been washed and dried, then the simulation outputs
    Code Block
    
    nothing to fold
    
    If the oldest load is empty (because all items in it were lost), the simulation outputs
    Code Block
    
    folded empty load
    
  • The command
    Code Block
    
    outfit
    
    asks "what is Acker wearing?" The simulation outputs
    Code Block
    
    wearing <adjective> <shirt>, <adjective> pants, <adjective> socks
    

Supporting Code and Programming Details

...