2024-11-26 16:30:48 +01:00
|
|
|
|
# Spaghetti Codenight
|
|
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
|
|
|
|
|
|
Welcome to Spaghetti Codenight!
|
|
|
|
|
The goal tonight is simple: solve a maze with the worst 💩 code possible!
|
|
|
|
|
|
|
|
|
|
However, there are a few restrictions and minimum requirements your code must meet.
|
|
|
|
|
While it may look bad, it still needs to be functional!
|
|
|
|
|
|
|
|
|
|
## Maze
|
|
|
|
|
|
|
|
|
|
Everything is done through `stdout` and `stdin`, but don't panic!
|
|
|
|
|
We've provided a file that handles all the hard work for you (more about this later).
|
|
|
|
|
|
|
|
|
|
### Layout
|
|
|
|
|
|
|
|
|
|
Your program will receive the maze through `stdin`.
|
2024-11-26 17:43:55 +01:00
|
|
|
|
The maze will be random each time in both layout and size!
|
2024-11-26 16:30:48 +01:00
|
|
|
|
A maze is represented using emojis. A tab character `(\t)` represents a new line in the maze, and the maze ends with a newline character `(\n)`.
|
|
|
|
|
The maze uses five emojis:
|
|
|
|
|
|
|
|
|
|
5 different emojis are used
|
|
|
|
|
- `⬛` A wall.
|
|
|
|
|
- `⬜` A tile. You can move onto these tiles.
|
|
|
|
|
- `🟥` A visited tile. These are tiles you've already walked on.
|
|
|
|
|
- `🍝` You, the player.
|
|
|
|
|
- `😮` The end of the maze.
|
|
|
|
|
|
|
|
|
|
Think of it like this:
|
|
|
|
|
You're a delicious plate of spaghetti, moving toward a hungry person.
|
|
|
|
|
As you move, you spill bolognese sauce, marking the ground red.
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>Maze example</summary>
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
⬛⬛⬛⬛⬛⬛⬛
|
|
|
|
|
⬛🍝⬜⬛⬜⬜⬛
|
|
|
|
|
⬛⬜⬛⬛⬛⬜⬛
|
2024-11-26 17:20:08 +01:00
|
|
|
|
⬛⬜⬜⬜⬛⬜⬛
|
|
|
|
|
⬛⬛⬛⬜⬜⬜⬛
|
2024-11-26 16:30:48 +01:00
|
|
|
|
⬛⬜⬜⬜⬛😮⬛
|
|
|
|
|
⬛⬛⬛⬛⬛⬛⬛
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
### Movement
|
|
|
|
|
|
|
|
|
|
You indicate your desired movement by printing a direction to `stdout`.
|
|
|
|
|
Use the following emojis to move:
|
|
|
|
|
- `⬆️` Up
|
|
|
|
|
- `➡️` Right
|
|
|
|
|
- `⬇️` Down
|
|
|
|
|
- `⬅️` Left
|
|
|
|
|
|
|
|
|
|
### End
|
|
|
|
|
|
|
|
|
|
When you reach the end, your program will be automatically terminated, and you’ll receive your score.
|
|
|
|
|
There's no need to manually check if you've completed the maze!
|
|
|
|
|
|
|
|
|
|
### Example
|
|
|
|
|
|
|
|
|
|
A very short example
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdin</summary>
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
⬛⬛⬛⬛⬛
|
|
|
|
|
⬛🍝⬜⬜⬛
|
|
|
|
|
⬛⬛⬛⬜⬛
|
|
|
|
|
⬛⬜⬜😮⬛
|
|
|
|
|
⬛⬛⬛⬛⬛
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdout</summary>
|
|
|
|
|
|
2024-11-26 18:53:06 +01:00
|
|
|
|
`➡️`
|
2024-11-26 16:30:48 +01:00
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdin</summary>
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
⬛⬛⬛⬛⬛
|
2024-11-26 18:53:06 +01:00
|
|
|
|
⬛🟥🍝⬜⬛
|
|
|
|
|
⬛⬛⬛⬜⬛
|
|
|
|
|
⬛⬜⬜😮⬛
|
2024-11-26 16:30:48 +01:00
|
|
|
|
⬛⬛⬛⬛⬛
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdout</summary>
|
|
|
|
|
|
2024-11-26 18:53:06 +01:00
|
|
|
|
`➡️`
|
2024-11-26 16:30:48 +01:00
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdin</summary>
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
⬛⬛⬛⬛⬛
|
2024-11-26 18:53:06 +01:00
|
|
|
|
⬛🟥🟥🍝⬛
|
|
|
|
|
⬛⬛⬛⬜⬛
|
|
|
|
|
⬛⬜⬜😮⬛
|
2024-11-26 16:30:48 +01:00
|
|
|
|
⬛⬛⬛⬛⬛
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdout</summary>
|
|
|
|
|
|
2024-11-26 18:53:06 +01:00
|
|
|
|
`⬇️`
|
2024-11-26 16:30:48 +01:00
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdin</summary>
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
⬛⬛⬛⬛⬛
|
2024-11-26 18:53:06 +01:00
|
|
|
|
⬛🟥🟥🟥⬛
|
|
|
|
|
⬛⬛⬛🍝⬛
|
|
|
|
|
⬛⬜⬜😮⬛
|
2024-11-26 16:30:48 +01:00
|
|
|
|
⬛⬛⬛⬛⬛
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>stdout</summary>
|
|
|
|
|
|
2024-11-26 18:53:06 +01:00
|
|
|
|
`⬇️`
|
2024-11-26 16:30:48 +01:00
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
You solved the puzzle!
|
|
|
|
|
Your program gets killed and your receive your score.
|
|
|
|
|
|
|
|
|
|
## Minimum requirements
|
|
|
|
|
|
|
|
|
|
Your submission must meet these minimum requirements:
|
|
|
|
|
|
|
|
|
|
- The code must be written in Python 🐍.
|
|
|
|
|
- It must solve the maze.
|
|
|
|
|
- It must complete the maze within **10 seconds**.
|
|
|
|
|
|
|
|
|
|
Failure to meet these requirements will result in your submission being denied.
|
|
|
|
|
|
|
|
|
|
## Restrictions
|
|
|
|
|
|
|
|
|
|
There are a few restrictions:
|
|
|
|
|
|
|
|
|
|
- All your code must be contained in a single file.
|
|
|
|
|
- The following Python packages are not allowed:
|
|
|
|
|
- `sys`
|
|
|
|
|
- `time`
|
|
|
|
|
- `os`
|
2024-11-26 17:20:08 +01:00
|
|
|
|
- `eval`
|
|
|
|
|
- `exec`
|
2024-11-26 16:30:48 +01:00
|
|
|
|
|
|
|
|
|
We perform basic checks, so please do not attempt to circumvent these restrictions. Submissions that break the rules will be rejected.
|
|
|
|
|
|
|
|
|
|
## Submitting your code
|
|
|
|
|
|
|
|
|
|
Go to `https://spaghetti.zeus.gent`.
|
|
|
|
|
Enter your name and select your code file.
|
2024-11-26 17:43:55 +01:00
|
|
|
|
If your submission is accepted, you’ll see a GIF showing the result (heads-up, it can take a while)!
|
2024-11-26 16:30:48 +01:00
|
|
|
|
|
|
|
|
|
## Start
|
|
|
|
|
|
|
|
|
|
The file [maze.py](maze.py) is a starting point for your application.
|
|
|
|
|
It contains all the required code for handling `stdin` and `stdout`, so you can focus on solving the maze.
|
|
|
|
|
|
|
|
|
|
The code file has comments (🤯) and is self-explanatory.
|
|
|
|
|
We recommend using the classes and enums defined in [maze.py](maze.py) (or suffer some strange 👻 bugs)!
|
|
|
|
|
|
|
|
|
|
**Good Luck and if you need any help, don't hesitate to ask!**
|