m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/curling.rb
diff options
context:
space:
mode:
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