MIL-005: Wiki and finish #39

Merged
Tirsvad merged 5 commits from mil-005-wiki-and-finish into main 2026-10-13 08:45:30 +02:00
4 changed files with 113 additions and 0 deletions
Showing only changes of commit 5068e5f018 - Show all commits
+34
View File
@@ -0,0 +1,34 @@
> Denne side er genereret fra README.md og wiki/. Ændringer her bliver overskrevet, næste gang wikien udgives.
> Den engelske side er den gældende; denne oversættelse følger den.
[English](Home) | Dansk | [Bahasa Melayu](Home.ms)
# Snake-spillet (dag 24)
Det klassiske Snake-spil, bygget med Pythons `turtle`-modul. Det er opgaven fra dag 24 i Udemys *100 Days of Code: The Complete Python Pro Bootcamp*, som handler om det lokale filsystem og om at læse og skrive filer. En slange bevæger sig af sig selv hen over en sort skærm på 600 gange 600 og styres med piletasterne; den spiser mad og vokser, og tavlen øverst viser scoren og highscoren. Spillet slutter ikke: når hovedet passerer væggen eller rører sin egen hale, starter slangen og scoren forfra, og den bedste score gemmes i filen `data.txt`, så den stadig er der, næste gang du spiller.
## Styring
| Tast | Virkning |
| --- | --- |
| Op, Ned, Venstre, Højre | Drejer slangen |
Slangen vender aldrig direkte om på sig selv. Når hovedet kommer tættere end 15 pixels på den blå mad, spiser slangen den, vokser med ét led, og scoren stiger med 1.
## Highscore-filen
Highscoren gemmes som tekst i `data.txt` i den mappe, du starter spillet fra. Filen oprettes med `0` første gang. Vil du starte fra nul igen, så luk spillet og slet filen.
## Kør spillet
Der skal bruges Python 3.13 eller nyere med `tkinter`; spillet har ingen andre afhængigheder ved kørsel.
```bash
git clone https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/024-snake.git
cd 024-snake
python -m pip install -e .
python -m snake_game
```
Repositoriets README har den fulde opsætning til Windows, Linux og macOS.
+32
View File
@@ -0,0 +1,32 @@
> This page is generated from README.md and wiki/. Changes made here are overwritten the next time the wiki is published.
English | [Dansk](Home.da) | [Bahasa Melayu](Home.ms)
# Snake Game (Day 24)
The classic Snake game, built with Python's `turtle` module. It is the day-24 assignment of Udemy's *100 Days of Code: The Complete Python Pro Bootcamp*, which teaches the local file system and reading and writing files. A snake moves across a black 600 by 600 screen by itself and is steered with the arrow keys; it eats food, grows, and the scoreboard at the top shows the score and the high score. The game does not end: when the head passes the wall or touches its own tail, the snake and the score start again, and the best score is kept in the file `data.txt`, so it is still there the next time you play.
## Controls
| Key | Effect |
| --- | --- |
| Up, Down, Left, Right | Turn the snake |
The snake never turns straight back onto itself. When the head comes closer than 15 pixels to the blue food the snake eats it, grows by one segment and the score goes up by 1.
## The high score file
The high score is stored as text in `data.txt` in the folder you start the game from. It is created holding `0` the first time. To start from zero again, close the game and delete the file.
## Run
Python 3.13 or newer with `tkinter` is needed; the game has no other runtime dependencies.
```bash
git clone https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/024-snake.git
cd 024-snake
python -m pip install -e .
python -m snake_game
```
The README of the repository has the full set-up for Windows, Linux and macOS.
+34
View File
@@ -0,0 +1,34 @@
> Halaman ini dijana daripada README.md dan wiki/. Perubahan di sini akan ditimpa apabila wiki diterbitkan lagi.
> Halaman Bahasa Inggeris adalah yang rasmi; terjemahan ini mengikutinya.
[English](Home) | [Dansk](Home.da) | Bahasa Melayu
# Permainan Ular (hari 24)
Permainan Ular (Snake) klasik, dibina dengan modul `turtle` Python. Ia ialah tugasan hari ke-24 dalam *100 Days of Code: The Complete Python Pro Bootcamp* di Udemy, yang mengajar sistem fail setempat serta cara membaca dan menulis fail. Seekor ular bergerak sendiri merentasi skrin hitam 600 kali 600 dan dikawal dengan kekunci anak panah; ia makan makanan dan membesar, dan papan skor di bahagian atas memaparkan skor serta skor tertinggi. Permainan tidak tamat: apabila kepala melepasi dinding atau menyentuh ekornya sendiri, ular dan skor bermula semula, dan skor terbaik disimpan dalam fail `data.txt`, jadi ia masih ada apabila anda bermain lagi.
## Kawalan
| Kekunci | Kesan |
| --- | --- |
| Atas, Bawah, Kiri, Kanan | Memusingkan ular |
Ular tidak pernah berpusing terus ke belakang ke atas dirinya sendiri. Apabila kepala menghampiri makanan biru dalam jarak kurang daripada 15 piksel, ular memakannya, bertambah panjang satu segmen dan skor naik 1.
## Fail skor tertinggi
Skor tertinggi disimpan sebagai teks dalam `data.txt` di folder tempat anda memulakan permainan. Fail itu dicipta dengan nilai `0` kali pertama. Untuk bermula dari sifar semula, tutup permainan dan padam fail itu.
## Jalankan
Python 3.13 atau lebih baharu dengan `tkinter` diperlukan; permainan ini tiada kebergantungan lain semasa dijalankan.
```bash
git clone https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/024-snake.git
cd 024-snake
python -m pip install -e .
python -m snake_game
```
README repositori mempunyai persediaan penuh untuk Windows, Linux dan macOS.
+13
View File
@@ -0,0 +1,13 @@
**Snake Game (Day 24)**
English
- [Home](Home)
Dansk
- [Hjem](Home.da)
Bahasa Melayu
- [Utama](Home.ms)