-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|