summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlambda-calcul/haskell/demo.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/lambda-calcul/haskell/demo.sh b/lambda-calcul/haskell/demo.sh
new file mode 100755
index 0000000..b725659
--- /dev/null
+++ b/lambda-calcul/haskell/demo.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+ALICE=$(curl -s -X POST -H 'content-type: application/json' https://lambda.pankzsoft.net/api/register -d '"alice"' | jq -r)
+echo "registered alice with token $ALICE"
+sleep 2
+
+BOB=$(curl -s -X POST -H 'content-type: application/json' https://lambda.pankzsoft.net/api/register -d '"bob"' | jq -r)
+echo "registered bob with token $BOB"
+sleep 2
+
+CHARLIE=$(curl -s -X POST -H 'content-type: application/json' https://lambda.pankzsoft.net/api/register -d '"charlie"' | jq -r)
+echo "registered charlie with token $CHARLIE"
+sleep 2
+
+curl -s -X POST -H 'content-type: application/json' "https://lambda.pankzsoft.net/api/challenge?token=$ALICE" -d '"x"'
+echo "alice submitted 'x'"
+curl -s -H 'content-type: application/json' "https://lambda.pankzsoft.net/api/score?token=$ALICE"
+echo ""
+sleep 2
+
+curl -s -X POST -H 'content-type: application/json' "https://lambda.pankzsoft.net/api/challenge?token=$BOB" -d '"y"'
+echo "bob submitted 'y'"
+curl -s -H 'content-type: application/json' "https://lambda.pankzsoft.net/api/score?token=$BOB"
+echo ""
+sleep 2
+
+curl -s -X POST -H 'content-type: application/json' "https://lambda.pankzsoft.net/api/challenge?token=$CHARLIE" -d '"x"'
+echo "charlie submitted 'x'"
+curl -s -H 'content-type: application/json' "https://lambda.pankzsoft.net/api/score?token=$CHARLIE"
+echo ""
+sleep 2
+
+curl -s -H 'content-type: application/json' "https://lambda.pankzsoft.net/api/leaderboard"
+
+wait