# HG changeset patch # User William Morgan # Date 1376195013 25200 # Node ID 8a2925ab0d4aa70caa91d87c71845f1abbf6e9c3 # Parent a4bffcd381cdc3a826ad48036d7d32dc6544cff8 working guess request and response. diff -r a4bffcd381cd -r 8a2925ab0d4a src/requests.tp --- a/src/requests.tp Sat Aug 10 20:30:05 2013 -0700 +++ b/src/requests.tp Sat Aug 10 21:23:33 2013 -0700 @@ -62,13 +62,19 @@ } } - guessRequest <- :id :prog { + guess <- :id :prog { #{ string <- { idStr <- "\"id\":\"" . id . "\"" progStr <- "\"program\":\"" . prog . "\"" "{" . idStr . "," . progStr . "}" } + sendWithKey <- :key { + print: "Sending: " . string . "\n" + cli <- http client: "icfpc2013.cloudapp.net" + resp <- cli post: string toPath: "/guess?auth=" . key withType: "application/json" + guessResponse: resp + } } } @@ -173,13 +179,20 @@ } main <- :args { - print: ((evalId: "someId" #[1u64 2u64 3u64]) string) . "\n" - print: ((guessRequest: "someId" "someProg") string) . "\n" + //print: ((evalId: "someId" #[1u64 2u64 3u64]) string) . "\n" + //print: ((guess: "someId" "someProg") string) . "\n" if: (args length) > 1 { key <- args get: 1 + testId <- "wdThP1AgVrS2rp7q6qt9mLqp" // my first training problem + someId <- "QwhG7ZpaVsfXiLRvbJfIfxl8" // TRAINING PROGRAM IDs!!! not real ones. + + someProgram <- "(lambda (input) (shl1 input))" + //print: ((evalProgram: "(lambda (input) (shl1 input))" #[1u64 0xEFFFFFFFFFFFFFu64]) sendWithKey: key) - print: ((evalId: "QwhG7ZpaVsfXiLRvbJfIfxl8" #[1u64 0xEFFFFFFFFFFFFFu64]) sendWithKey: key) + //print: ((evalId: testId #[1u64 0xEFFFFFFFFFFFFFu64]) sendWithKey: key) + print: ((guess: testId someProgram) sendWithKey: key) + } } }