gist: 36 Download_button fork
public
Public Clone URL: git://gist.github.com/36.git
room.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-module(room).
-export([sample/0]).
-export([look/1]).
-export([look_items/1]).
 
-include_lib("defs.hrl").
 
sample() ->
  #room{descr="A maze of twisty paths, all alike.", contents=["ye flask", "a longsword"]}.
 
look(#room{descr=Descr, contents=Contents}) ->
  io:format("~s~n", [Descr]),
  io:format("You see here: ~s~n", [look_items(Contents)]).
 
look_items([]) ->
  "nothing";
look_items(Items) ->
  string:join(Items, ", ").

Owner

adamwiggins

Revisions