読者です 読者をやめる 読者になる 読者になる

標高+1m

Make, Hack, Think

メモ.json

{
    "info": {
        "name": "EBISU",
        "local": "Ebisu",
        "pref": "Tokyo",
        "country": "Japan"
    },
    "people": {
        "ympbyc": {
            "x": 70,
            "y": 15,
            "greetings": {}
        },
        "ymp_byc": {
            "x": 67,
            "y": 20,
            "greetings": {
                "ympbyc": "hello"
            }
        }
    },
    "map": [
        [{
            "type": "glassland"
        }, {
            "type": "building",
            "name": "KT building",
            "enter": "-> 'welcome to KT'",
            "leave": "-> 'thank you for visiting'"
        }, {
            "type": "glassland"
        }],
        []
    ],
    "items": [{
        "name": "love potion",
        "x": 60,
        "y": 12
    }],
    "API": {
        "GET": {
            "map": "-> @map",
            "person": "(name) -> @people[name]",
            "me": "(name) -> me = @people[name]; me.greetings.empty(); me",
            "people": "-> @people",
            "items": "-> @items"
        },
        "POST": {
            "me": "(name, pos) -> set(@people[name], ['x', 'y'], [pos.x, pos.y]); @people[name] ",
            "item": "(name, pos) -> items.remove({name:name,pos:pos}); true",
            "greeting": "(from, to, message) -> @people[to].greetings[from] = message; true"
        }
    }
}