m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/curling.rb
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-08-17 23:31:13 -0700
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-08-17 23:31:13 -0700
commite3afffc91d678301fcf7660db541cacc8b7a4e8d (patch)
treefd391ede8eb099d5b66672751ee01ae07f6deb98 /curling.rb
Initial commit
Diffstat (limited to 'curling.rb')
-rw-r--r--curling.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/curling.rb b/curling.rb
new file mode 100644
index 0000000..a295738
--- /dev/null
+++ b/curling.rb
@@ -0,0 +1,17 @@
+require 'sinatra'
+require 'sinatra/cookies'
+
+require './hex_engine'
+
+def secret
+ 'tajny_token_hehe'
+end
+
+get '/:command' do |command|
+ engine = Hex.new cookies.to_h
+ engine.step command
+ engine.state_h.each_pair do |key, value|
+ cookies[key] = value
+ end
+ engine.message
+end