m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 28f3894235d396d172c1886ec938368c286f51e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Library for cUrl-based games

curling allows you to create simple games served over HTTP, intended to be
interacted with in a CLI environment with curl.

State is stored locally on the user's machine in cookies.

## Basic interaction

    curl -c c.txt -b c.txt http://endpoint.com/
    You have 100HP, 10 coins. What do you want to do?
    >fight
    >heal (-5 coins)
    curl -c c.txt -b c.txt http://endpoint.com/fight
    You won, but took some damage. You find 2 coins!
    You have 75HP, 12 coins.
    >fight
    >heal (-5 coins)
    # edits cookie file to go back to 100HP
    curl -c c.txt -b c.txt http://endpoint.com/fight
    Error: invalid state!