Pre-built version of this server is available online at https://api.pegovka.space/
Swagger docs: https://api.pegovka.space/swagger
- Change source in
src/CosmicMachine/message.txt. - Run
render-messages.sh(.NET Core should be installed). - See result in
/messagedirectory.
- Edit source in
src/CosmicMachine/CSharpGalaxy. - Run
compile-galaxy.sh(.NET Core should be installed). - See result in
/galaxydirectory.
-
Run
icfpcontest2020/galaxyimage on port12345. Image will be downloaded from Docker Hub:$ docker run --rm -p 12345:12345 icfpcontest2020/galaxy
-
Open this url in browser:
http://localhost:12345/swagger- you will see Swagger docs page for Galaxy API. -
Try to send simple
Countdownrequest ([0], which is modulated as1101000):$ curl -d "1101000" -X POST "http://localhost:12345/aliens/send"
You should see modulated response
[1,0](success, countdown is zero):11011000011101000
-
So, if everything is fine, then you can use address
http://localhost:12345asserverUrlfor your Galaxy Pad implementation.
-
Clone, build with Docker and run on port
12345:$ git clone [email protected]:icfpcontest2020/galaxy.git $ cd galaxy $ docker build -t galaxy . $ docker run --rm -p 12345:12345 galaxy
-
Other steps are the same as described earlier.
Use provided bash-scripts mod.sh and dem.sh (.NET Core should be installed).
You can modulate/demodulate strings from STDIN or from command line arguments:
$ ./mod.sh "[0, 1]"
11010110110000100
$ ./dem.sh 11010110110000100
[0, 1]
$ echo "[0, 1]" | ./mod.sh
11010110110000100
$ echo 11010110110000100 | ./dem.sh
[0, 1]You also can pipe this modulating/demodulating with sending requests to Alien server:
$ ./mod.sh "[1,0]" | curl -X POST -s -d @- "http://localhost:12345/aliens/send" | ./dem.sh
[1, [[0, 5939854065736244037], [1, 7463090120749941785]]]
$ ./mod.sh "[1,0]" | http "http://localhost:12345/aliens/send" | ./dem.sh
[1, [[0, 5939854065736244037], [1, 7463090120749941785]]]