diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-27 20:57:43 -0700 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2019-08-27 20:57:43 -0700 |
commit | c08dcad9ea25b37983c536d8f86a2f25edae6feb (patch) | |
tree | 525661adef63706afa2501cc49986a674a3804b0 | |
parent | 3d2ee280959396c474fdafbda9239734416d9fc8 (diff) |
Add welcome message at /
-rw-r--r-- | curling.rb | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -7,6 +7,42 @@ def secret ENV['HEX_SECRET'] || 'tajny_token_hehe' end +get '/' do + <<~MSG +Welcome to Hex Curler! +====================== +This game is based on Jeff Moore's Hex (http://www.1km1kt.net/rpg/hex). +Source code: gitlab.com/m-chrzan/hex-curler + +How to Play +=========== +If you're not using it already, run this line of bash to start playing: + +c=; while clear; curl -c k -b k localhost:4567/$c; read c; [ $c ]; do :; done + +You're about to start crawling through a dungeon, fighting monsters and finding +treasure. Your character has three attributes: + - Health + - Endurance + - eXperience + +After each move you'll be presented with a menu of options that could look +something like this: + >[r]un away + >[f]ight (-1 H, -1 E, 1 X) + +Select a move by typing the highlighted letter and hitting enter (e.g. type r if +you want to [r]un away like a wuss). + +Numbers in parentheses tell you how your attributes will be affected by taking +a given action. + +To restart the game, run `rm k` to remove the cookie that stores your game state. + +>[c]ontinue + MSG +end + get '/:command' do |command| engine = Hex.new cookies.to_h engine.step command |