Add christmas edition

This commit is contained in:
Andras Schmelczer 2026-06-06 15:23:48 +01:00
parent 2f1c7d9e82
commit b62af486a7
74 changed files with 3422 additions and 1 deletions

View file

@ -0,0 +1,15 @@
# Sprite generator
## Install
- Install Python 3.5 or later
- Execute `pip install -r requirements.txt`
## Use
- Using [Piskel](https://www.piskelapp.com/)
- draw the sprites
- export them in `zip` format (it's a .zip containing .png files)
- Place the files inside the [spritesheets](spritesheets) folder
- Execute `python main.py`
- The output is automatically placed in the [output](output) folder

View file

@ -0,0 +1,14 @@
{
"spellright.language": [
"en",
"hu"
],
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext"
],
"cSpell.enableFiletypes": [
"!plaintext"
]
}

View file

@ -0,0 +1,13 @@
Szia, Ádám!
Boldog karácsonyt kívánok!
Viszont mást is szeretnék mondani.
Most egy kicsit még távolabb fogunk kerülni egymástól.
Persze biztos vagyok benne, hogy ezután is tartani fogjuk a kapcsolatot.
Viszont jó pillanatnak érzem a mostanit arra, hogy köszönetet mondjak.
Köszönöm az együtt töltött időnket.
Köszönöm, hogy más ember lettem melletted.
Ebben neked is részed volt.
Összességében, nélküled kicsit szomorúbb lenne az élet.
Remélem ezt te is tudod magadról.
Várom, hogy mihamarabb találkozzunk.
Andris

View file

@ -0,0 +1,11 @@
Szia, Apa!
Boldog karácsonyt kívánok!
Viszont mást is szeretnék mondani.
Szeretném megköszönni azt a számtalan segítséget, amit tőled kaptam.
Köszönöm, hogy mindig támogattál és motiváltál.
Köszönöm, hogy mindig mögöttem álltál.
Nélküled most biztosan nem tartanék itt.
Ha ezt nehezen is fejeztem ki, de mindig fontos voltál nekem.
Összességében, nélküled kicsit szomorúbb lenne az élet.
Remélem ezt te is tudod magadról.
Andris

View file

@ -0,0 +1,11 @@
Szia, Balázs!
Boldog karácsonyt kívánok!
Viszont mást is szeretnék mondani.
Habár rövidebb, de annál sűrűbb volt az egynyári kalandunk.
Öröm volt téged megismerni.
A kreativitásod és összeszedettséged inspiráló.
Túlzás nélkül sokunk példaképe lehetnél.
Összességében, nélküled kicsit szomorúbb lenne az élet.
Remélem ezt te is tudod magadról.
Várom, hogy mihamarabb találkozzunk.
Andris

View file

@ -0,0 +1,12 @@
Szia, Olivér!
Boldog karácsonyt kívánok!
Viszont mást is szeretnék mondani.
Jó pillanatnak érzem a mostanit arra, hogy köszönetet mondjak.
A barátságod, segítséged és humorod meghatározta az elmúlt éveimet.
Ha nem is gondolod így, de nagy hatással voltál rám.
Az elhivatottságod és kitartásod mindig inspirált.
Te vagy az a barát, akit mindenki szeretne.
Összességében, nélküled kicsit szomorúbb lenne az élet.
Remélem ezt te is tudod magadról.
Várom, hogy mihamarabb találkozzunk.
Andris

View file

@ -0,0 +1,121 @@
import io
import os
import zipfile
from math import ceil
from sys import argv
from typing import Tuple
from PIL import Image
c_header = """#include "texts.h"
#include <avr/eeprom.h>
// AUTO-GENERATED
"""
h_header = """#ifndef TEXTS_H
#define TEXTS_H
#include <avr/io.h>
// AUTO-GENERATED
"""
h_footer = """
#endif
"""
letters = [
"a",
"á",
"b",
"c",
"d",
"e",
"é",
"f",
"g",
"h",
"i",
"í",
"j",
"k",
"l",
"m",
"n",
"o",
"ó",
"ö",
"ő",
"p",
"q",
"r",
"s",
"t",
"u",
"ú",
"ü",
"ű",
"v",
"w",
"x",
"y",
"z",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
",",
".",
"!",
"?",
" ",
]
def generate(input_text: str) -> Tuple[str, str]:
indices = []
for line in input_text.split("\n"):
for char in line.strip().lower().replace(", ", ","):
indices.append(letters.index(char))
indices.append(255)
indices.append(255)
if len(indices) > 512:
print(f"Input is too long ({len(indices)} > 512)")
exit()
output_h = h_header + f"const uint8_t texts[{len(indices)}];\n" + h_footer
output_c = c_header + f"const uint8_t texts[{len(indices)}] EEMEM = {{"
output_c += ", ".join(str(i) for i in indices)
output_c += "};\n"
return output_h, output_c
if __name__ == "__main__":
if len(argv) == 1:
print("Specify an input file")
exit()
with open(argv[1], "r", encoding="utf-8") as f:
input_text = f.read()
dot_h, dot_c = generate(input_text)
with open("output/texts.h", "w+") as f:
f.write(dot_h)
with open("output/texts.c", "w+") as f:
f.write(dot_c)

View file

@ -0,0 +1 @@
Pillow==8.0.1