From 19854fa22501c0a819a73e90f3e325ba1768f53d Mon Sep 17 00:00:00 2001 From: Sor4chi <80559385+sor4chi@users.noreply.github.com> Date: Sat, 29 Jun 2024 02:43:39 +0900 Subject: [PATCH] docs: add spaceship --- notes/sor4chi.md | 6 ++++++ notes/spaceship/intro.md | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 notes/spaceship/intro.md diff --git a/notes/sor4chi.md b/notes/sor4chi.md index 755b82e..60a76b4 100644 --- a/notes/sor4chi.md +++ b/notes/sor4chi.md @@ -34,3 +34,9 @@ ou scored some points for using the echo service! `get lambdaman`を送信。 [これが帰ってきた](./lambdaman/intro.md) + +### [2:42] `get speaceship`する + +`get spaceship`を送信。 + +[これが帰ってきた](./spaceship/intro.md) diff --git a/notes/spaceship/intro.md b/notes/spaceship/intro.md new file mode 100644 index 0000000..5ac22c6 --- /dev/null +++ b/notes/spaceship/intro.md @@ -0,0 +1,43 @@ +Welcome to the Spaceship course! + +In 2020, most of us have learned how to operate a spaceship. In this course we'll play a small chess-like game featuring the spaceship! The game operates on an infinite 2D chess board, with the spaceship initially located on `(0,0)`. The spaceship has a velocity `vx` and `vy`, which are initially both set to `0`. In each turn the player can increase/decrease each of those numbers by at most one, and then the piece moves `vx` steps to the right and `vy` steps up. + +Moves are represented with a single digit, inspired by the old numeric pad on a computer keyboard that we used to have in the old days on Earth. For example, `7` means decreasing `vx` and increasing `vy` by `1`, while `6` means increasing `vx` by `1` and keeping `vy` the same. A path can then be represented by a sequence of digits, e.g. the path `236659` visits, in this order, the following squares: `(0,0) (0,-1) (1,-3) (3,-5) (6,-7) (9,-9) (13,-10)`. + +Now the challenge is the following: given a list of squares to be visited, find a sequence of moves that visits all those squares. our solution may consist of at most `10,000,000` moves. + +The following levels are available: +* [spaceship1] Best score: 5. +* [spaceship2] Best score: 49. +* [spaceship3] Best score: 10. +* [spaceship4] Best score: 99. +* [spaceship5] Best score: 119. +* [spaceship6] Best score: 123. +* [spaceship7] Best score: 94. +* [spaceship8] Best score: 104. +* [spaceship9] Best score: 260. +* [spaceship10] Best score: 405. +* [spaceship11] Best score: 8192. +* [spaceship12] Best score: 8192. +* [spaceship13] Best score: 31744. +* [spaceship14] Best score: 210. +* [spaceship15] Best score: 43. +* [spaceship16] Best score: 1975. +* [spaceship17] Best score: 440. +* [spaceship18] Best score: 1959. +* [spaceship19] Best score: 15323. +* [spaceship20] Best score: 4186. +* [spaceship21] Best score: 4243. +* [spaceship22] Best score: 1359. +* [spaceship23] Best score: 385814. +* [spaceship24] Best score: 799788. +* [spaceship25] Best score: 894411. + +To submit a solution, send an ICFP expression that evaluates to: + +``` +solve spaceshipX moves +``` + +our score is the number of moves, so a lower score is better. +