Description
In the Alpha Centauri system, you operate a farm for centaurs located on a toroidal asteroid. The pastures are organized into square fields, separated by barriers placed at predefined locations. A centaur can move from one field to a neighboring one horizontally, vertically, or diagonally if there is no barrier blocking access. During diagonal movements, the corridor allows centaurs to move straight ahead, but it is too narrow for them to change direction (see the attached image example-directions.png
for an explanation of possible movements).
You are about to manage two centaurs. However, there’s a catch - centaurs are solitary animals, and it is of paramount importance to prevent the two centaurs from meeting in the same square field. Before accommodating them, you only have time to install three additional barriers in the area: where should you place them to house the two beasts without allowing them to meet?
The square fields are identified by a coordinate system, for example, (0, 1)
or (1, 2)
, and the locations for the barriers are identified by a pair of coordinates, for example, ((0, 1), (1, 2))
.
An example in a 5x5 dimension is provided in the attached figures:
example-empty.png
: an example of a toroidal centaur farm with barriers placed between the square fields.example-directions.png
: an example of possible directions with a given placement of barriers. In this example, from the square field located at(1, 1)
, a centaur can go to(2, 0)
,(0, 2)
, and(2, 2)
.example-solved.png
: an example of a barrier to add to isolate the two centaurs. The program expects input like:[((1, 1), (0, 2)), ((3, 1), (4, 2)), ((3, 3), (4, 3))]
. The order of square fields is not important;((1, 1), (0, 2))
and((0, 2), (1, 1))
represent the same barrier.
Once connected to the service below, you will need to place three barriers in 100 randomly generated farms. If you succeed within the 30-second limit for each farm, you will get the flag!
Files
- docker-compose.yml
-
example-empty.png
14.83 KiB – a8e68c5d6048b51d02b67459cf33690cf0197d727f83ad916567737a191cb130 -
example-directions.png
28.50 KiB – 25f666c24dacf48bdcc5bc241df31eed5152b6ac01b01631dcb1767ac2066f31 -
example-solved.png
16.29 KiB – 2bb30d19ff1e6fad4ff3b5ed7fae759132e1f67c653c07bb1bc54ded47f80ef6
Authors
Challenge Instructions
- First, download docker-compose.yml:
curl https://hackropole.fr/challenges/fcsc2024-misc-centaure-sur-tore/docker-compose.public.yml -o docker-compose.yml
- Launch the challenge by executing in the same folder:
docker compose up
- Then, in another console, access the challenge with Netcat:
nc localhost 4000
In case you encounter problems, please consult the FAQ.
Flag
Submit your solution
You can submit your writeup for this challenge. Read the FAQ to learn how to proceed.
You need to be logged in to submit a writeup.
Writeups
There are no public solutions for this challenge yet, but you can submit yours after getting the flag.