anchor.diff:                            <<"take">> => cmd_get,
                             <<"quit">> => cmd_quit,
                             <<"exit">> => cmd_exit}).
  +
  +%% Initial locations of all objects in the game. Items in the
  +%% inventory are marked by special location indicated by atom 'body'.
  +-define(OBJECTS, #{ key => c }).
   
   %%%===================================================================
   %%% API
  
positive.code: describe_room(#{location := Location, rooms := Rooms}) ->
      maps:get(Location, Rooms).
  
  describe_objects(_State) ->
      undefined.
  
  make_game_state() ->
      #{ location => ?INITIAL_ROOM
       , rooms => ?ROOMS
       , edges => ?EDGES
       , commands => ?KNOWN_COMMANDS
       , status => playing
       }.
  
  %%%===================================================================
  %%% Simple text interface for testing
  
negative.code: make_empty_reply() ->
      #{ errors => [], messages => [], game_end => false}.
  
  add_reply_error(String, Reply) ->
      add_reply_error("~s", [String], Reply).
  
  add_reply_error(FormatStr, Data, Reply) ->
      Reply#{ errors := [ list_to_binary(io_lib:format(FormatStr, Data)) | maps:get(errors, Reply) ]}.
  
  add_reply_text(String, Reply) ->
      add_reply_text("~s", [String], Reply).
  
  add_reply_text(FormatStr, Data, Reply) ->
      Reply#{ messages := [ list_to_binary(io_lib:format(FormatStr, Data)) | maps:get(messages, Reply) ]}.
  
  