Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $(BUILD)/llms.txt: $(CHAPTERS) glossary.md $(BUILD)/questions.md tools/llms.py t
.PHONY: all fetch lint check-code exercises check clean
fetch:
mkdir -p sources/slides/2026 sources/hw/2023 sources/hw/2024 sources/hw/2025
for f in lec00 lec01 lec02 lec03 lec04; do curl -fsSL -o sources/slides/2026/$$f.pdf https://progintro.github.io/assets/pdf/$$f.pdf; done
for f in lec00 lec01 lec02 lec03 lec04 lec05 lec06; do curl -fsSL -o sources/slides/2026/$$f.pdf https://progintro.github.io/assets/pdf/$$f.pdf; done
gh release download 2025 -R $(REPO) -D sources/slides -p 'lec*.pdf' -p make.pdf --skip-existing
gh release download 2025 -R $(REPO) -D sources/hw/2025 -p 'hw*.pdf' -p stergios.pdf --skip-existing
gh release download 2024 -R $(REPO) -D sources/hw/2024 -p 'hw*.pdf' --skip-existing
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ chatbot ή agent το [`llms-full.txt`](llms-full.txt) (όλος ο οδηγός

Ο οδηγός γράφτηκε από τις διαφάνειες των διαλέξεων του 2025-26
([progintro.github.io](https://progintro.github.io/)) και ενημερώνεται με τις διαφάνειες
του 2026-27 καθώς δημοσιεύονται (ως τώρα: Διαλέξεις 0–4), τις
του 2026-27 καθώς δημοσιεύονται (ως τώρα: Διαλέξεις 0–6), τις
[σημειώσεις](https://progintro.github.io/notes/) του μαθήματος, τα
[εργαστήρια](https://progintro.github.io/lab-material/) και τα θέματα εξετάσεων και τις
εργασίες προηγούμενων ετών. Οι ασκήσεις έχουν υποδείξεις αλλά όχι λύσεις.
Expand Down
6 changes: 3 additions & 3 deletions chapters/05-operators-statements/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ layout: chapter
chapter: 5
lecture: 5
title: "Τελεστές και Εντολές"
date: 2025-10-17
date: 2026-10-16
part: B
slides: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
slides: https://progintro.github.io/assets/pdf/lec05.pdf
prev: 04-git-operators
next: 06-control-flow
topics: [operators, bitwise, precedence, types, statements, conditionals]
Expand Down Expand Up @@ -696,7 +696,7 @@ else

## Διάβασμα

- **Διαφάνειες:** [Διάλεξη 5](https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf), σελ. 1–35. Κατηγορίες τελεστών: σελ. 5· αριθμητικοί, συγκριτικοί, λογικοί: σελ. 7–9· bitwise: σελ. 10–12· συνθήκης και cast: σελ. 13–15· ανάθεση, αύξηση/μείωση, κόμμα: σελ. 16–19· πρόγραμμα βαθμολογίας: σελ. 20· προτεραιότητα: σελ. 21–24· εκφράσεις και εντολές: σελ. 25–28· `if` και `if-else`: σελ. 29–33.
- **Διαφάνειες:** [Διάλεξη 5](https://progintro.github.io/assets/pdf/lec05.pdf) (2026-27), σελ. 1–35. Κατηγορίες τελεστών: σελ. 5· αριθμητικοί, συγκριτικοί, λογικοί: σελ. 7–9· bitwise: σελ. 10–12· συνθήκης και cast: σελ. 13–15· ανάθεση, αύξηση/μείωση, κόμμα: σελ. 16–19· πρόγραμμα βαθμολογίας: σελ. 20· προτεραιότητα: σελ. 21–24· εκφράσεις και εντολές: σελ. 25–28· `if` και `if-else`: σελ. 29–33. Οι διαφάνειες του 2025-26 έχουν την ίδια αρίθμηση (αλλάζουν μόνο οι ανακοινώσεις και η ανασκόπηση, σελ. 2–3): [Διάλεξη 5 (2025)](https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf).
- **Σημειώσεις:** [Κεφάλαιο 2: Μεταβλητές, τύποι, τελεστές και παραστάσεις](https://progintro.github.io/notes/chapters/02-types-operators/), ενότητα «Εντολές αντικατάστασης, τελεστές και παραστάσεις» (K04, σελ. 34–43)· [Κεφάλαιο 3: Η ροή του ελέγχου](https://progintro.github.io/notes/chapters/03-control-flow/), ενότητες «Η ροή του ελέγχου στην C», «Εντολή `if`» (K04, σελ. 46–49). Οι διαφάνειες συνιστούν να έχετε καλύψει τις σημειώσεις του κ. Σταματόπουλου μέχρι και τη σελίδα 62.
- **Εργαστήριο:** [Εργαστήριο 3](https://progintro.github.io/lab-material/labs/lab03/): ασκήσεις `root.c` (`if...else`), `birthdate.c` (ακέραια διαίρεση και `%`), `limit.c` (αποσφαλμάτωση εκφράσεων)
- **Βιβλίο:** K&R, §2.5–2.12 (τελεστές και παραστάσεις), όπως προτείνουν οι σημειώσεις.
Expand Down
25 changes: 15 additions & 10 deletions chapters/06-control-flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ layout: chapter
chapter: 6
lecture: 6
title: "Εντολές και Ροή Ελέγχου"
date: 2025-10-20
date: 2026-10-19
part: B
slides: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
slides: https://progintro.github.io/assets/pdf/lec06.pdf
prev: 05-operators-statements
next: 07-problem-solving
topics: [statements, conditionals, loops, control-flow]
Expand Down Expand Up @@ -488,22 +488,27 @@ printf("%d\n", i);

### §6.20 Γρήγορος έλεγχος της λύσης με pipes και time

*Συμβουλή για την άσκηση `aliquot` της hw0.* Αντί να πληκτρολογείτε κάθε φορά την
*Συμβουλή για την άσκηση `goldbach` της hw0.* Αντί να πληκτρολογείτε κάθε φορά την
είσοδο, στείλτε τη στο πρόγραμμα με pipe ([Κεφάλαιο 1](../01-command-line/)):

```sh
echo -e "138\n0\nf\n" | ./aliquot
echo -e "42\ng\n67\np\n" | ./goldbach
```

Η `echo -e` ερμηνεύει κάθε `\n` ως αλλαγή γραμμής, οπότε το `./aliquot` διαβάζει τρεις
γραμμές: `138`, `0` και `f`. Με `time` μετράτε και τον χρόνο εκτέλεσης, και με
`ttyplot` (ίσως χρειαστεί να το εγκαταστήσετε) σχεδιάζετε την έξοδο στο τερματικό:
Η `echo -e` ερμηνεύει κάθε `\n` ως αλλαγή γραμμής, οπότε το `./goldbach` διαβάζει
τέσσερις γραμμές: `42` με την επιλογή `g` (έλεγχος Goldbach) και `67` με την επιλογή `p`
(έλεγχος πρώτου). Με `time` μετράτε και τον χρόνο εκτέλεσης. Αν οι είσοδοι είναι
πολλές, γράψτε τις σε ένα αρχείο και δώστε το στο πρόγραμμα με ανακατεύθυνση εισόδου:

```sh
echo -e "138\n0\nf\n" | time ./aliquot
echo -e "2856\n0\nf\n" | ./aliquot | ttyplot
echo -e "42\ng\n67\np\n" | time ./goldbach
time ./goldbach < input.txt
```

Στις διαφάνειες του 2025-26 το ίδιο παράδειγμα ήταν η άσκηση `aliquot` της hw0 εκείνης
της χρονιάς ([Α6.15](#a6-15)), όπου με το `ttyplot` σχεδιάζατε και την έξοδο στο
τερματικό: `echo -e "2856\n0\nf\n" | ./aliquot | ttyplot`.

## Κύρια σημεία

1. Κάθε εντολή της C είναι κενή, έκφρασης, σύνθετη, συνθήκης ή επανάληψης.
Expand Down Expand Up @@ -542,7 +547,7 @@ echo -e "2856\n0\nf\n" | ./aliquot | ttyplot

## Διάβασμα

- **Διαφάνειες:** [Διάλεξη 6](https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf), σελ. 1–29. Pipes και `time`: σελ. 2· κατηγορίες εντολών: σελ. 5–8· ροή ελέγχου, `if`, `if-else`: σελ. 9–13· εμφωλευμένες `if` και dangling else: σελ. 14–16· `while`: σελ. 17–21· `for`: σελ. 22–24· `do-while`: σελ. 25–26.
- **Διαφάνειες:** [Διάλεξη 6](https://progintro.github.io/assets/pdf/lec06.pdf) (2026-27), σελ. 1–29. Pipes και `time`: σελ. 2· κατηγορίες εντολών: σελ. 5–8· ροή ελέγχου, `if`, `if-else`: σελ. 9–13· εμφωλευμένες `if` και dangling else: σελ. 14–16· `while`: σελ. 17–21· `for`: σελ. 22–24· `do-while`: σελ. 25–26. Οι διαφάνειες του 2025-26 έχουν την ίδια αρίθμηση (αλλάζει μόνο το παράδειγμα της σελ. 2, που εκεί είναι η άσκηση `aliquot` της hw0 του 2025): [Διάλεξη 6 (2025)](https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf).
- **Σημειώσεις:** [Κεφάλαιο 3: Η ροή του ελέγχου](https://progintro.github.io/notes/chapters/03-control-flow/), ενότητες «Η ροή του ελέγχου στην C», «Εντολή `if`», «Εντολές βρόχου `while`», «Εντολή βρόχου `for`» (K04, σελ. 46–49 και 52–55). Οι διαφάνειες συνιστούν να έχετε καλύψει τις σημειώσεις του κ. Σταματόπουλου μέχρι και τη σελίδα 62, δηλαδή και το [Κεφάλαιο 4: Συναρτήσεις](https://progintro.github.io/notes/chapters/04-functions/) μέχρι την ενότητα «Συνάρτηση υπολογισμού παραγοντικού».
- **Εργαστήριο:** [Εργαστήριο 3](https://progintro.github.io/lab-material/labs/lab03/): εισαγωγή για τους τρεις βρόχους και τα διαγράμματα ροής τους, ασκήσεις `seq.c` (`while`, `for`, `do...while`), `root.c` (`if...else`), `birthdate.c`, `limit.c`
- **Βιβλίο:** K&R, κεφ. 3 (σελ. 85–100), όπως προτείνουν οι σημειώσεις.
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec05-bitwise-or-hex.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Η τιμή της 0xbeef | 0xcafe0000"
source:
title: "Διάλεξη 5: Τελεστές και Εντολές, διαφάνεια 12"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec05.pdf
years: [2025, 2026]
chapters: [5]
topics: [bitwise]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec05-cast-division.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Cast και διαίρεση: (double)3/4"
source:
title: "Διάλεξη 5: Τελεστές και Εντολές, διαφάνεια 14"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec05.pdf
years: [2025, 2026]
chapters: [5]
topics: [operators, types, precedence]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec05-msb.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Απομόνωση του πιο σημαντικού bit"
source:
title: "Διάλεξη 5: Τελεστές και Εντολές, διαφάνεια 11"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec05.pdf
years: [2025, 2026]
chapters: [5]
topics: [bitwise]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec05-operator-arity.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Τι τύπου τελεστές είναι;"
source:
title: "Διάλεξη 5: Τελεστές και Εντολές, διαφάνειες 7-10, 13"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec05.pdf
years: [2025, 2026]
chapters: [5]
topics: [operators, bitwise]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec05-operator-as-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Οι αριθμητικοί τελεστές ως συναρτήσεις"
source:
title: "Διάλεξη 5: Τελεστές και Εντολές, διαφάνεια 7"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec05.pdf
years: [2025, 2026]
chapters: [5]
topics: [operators, functions, types]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec05-precedence.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Προτεραιότητα και προσεταιριστικότητα"
source:
title: "Διάλεξη 5: Τελεστές και Εντολές, διαφάνεια 21"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec05.pdf
years: [2025, 2026]
chapters: [5]
topics: [precedence, operators]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec05-ternary-max.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Συνάρτηση max με τον τελεστή συνθήκης"
source:
title: "Διάλεξη 5: Τελεστές και Εντολές, διαφάνεια 13"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec05.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec05.pdf
years: [2025, 2026]
chapters: [5, 3]
topics: [operators, functions]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-dangling-else.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Το πρόβλημα του dangling else"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 15"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6]
topics: [conditionals]
difficulty: 2
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-do-while.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Τι τυπώνει η do-while"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 26"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6]
topics: [loops]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-expression-statements.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Τιμές μετά από εντολές έκφρασης"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 7"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6, 5]
topics: [statements, operators]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-for-count.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Πόσες φορές εκτελείται μια for"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 24"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6]
topics: [loops]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-for-empty.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Ο βρόχος for (;;)"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 23"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6]
topics: [loops]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-if-else-max.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Μέγιστο με if-else και εναλλακτικές"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 13"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6, 5]
topics: [conditionals]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-while-forever.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Ο βρόχος while (1)"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 20"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6]
topics: [loops]
difficulty: 1
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-while-semicolon.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Το ερωτηματικό μετά το while"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 21"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6]
topics: [loops, statements]
difficulty: 2
Expand Down
4 changes: 2 additions & 2 deletions questions/slides/slides-lec06-while-sum.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ kind: slides
title: "Άθροισμα με while"
source:
title: "Διάλεξη 6: Εντολές και Ροή Ελέγχου, διαφάνεια 19"
url: https://github.com/progintro/progintro.github.io/releases/download/2025/lec06.pdf
years: [2025]
url: https://progintro.github.io/assets/pdf/lec06.pdf
years: [2025, 2026]
chapters: [6]
topics: [loops]
difficulty: 1
Expand Down
5 changes: 4 additions & 1 deletion sources/extract/lec05.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
lecture: 5
year: 2026-27 # updated from the 2025-26 deck (35 pages) on 2026-10-20; same page numbers
slides: https://progintro.github.io/assets/pdf/lec05.pdf
pages: 35
outline:
- {pages: "1-6", section: "Κατηγορίες τελεστών"}
Expand Down Expand Up @@ -27,7 +29,8 @@ pointers:
takeaways_slide: null
issues:
- "No explicit key-takeaways slide; the red callouts on p. 9 (0 is false, any non-zero is true), p. 22 (use parentheses when unsure) and p. 31 (the if parentheses are mandatory) were treated as takeaways."
- "p. 2 (announcements: hw0 pages question, Coding Club meeting) and p. 3 (recap: pair programming, git, operators) are course logistics/recap and are not in the chapter."
- "2026-27 deck vs 2025-26 (both 35 pages): only pp. 2-4 changed. p. 2 announces the Coding Club Git & GitHub workshop (16 October) instead of the meeting; p. 3 recap drops pair programming (it moved to lecture 3) and adds a Klimt painting; p. 4 adds a caption. All page numbers are unchanged."
- "p. 2 (announcements: hw0 pages question, Coding Club) and p. 3 (recap: git, operators) are course logistics/recap and are not in the chapter."
- "p. 15: the implicit-conversion image lists 'bool, char, short int, int, unsigned int, long, unsigned, long long, float, double, long double'. The 'unsigned' after 'long' was read as 'unsigned long' in the chapter's diagram. The slide's rule 'convert to the larger operand' is a simplification of C's usual arithmetic conversions (integer promotion of char/short is not mentioned in the slides or the chapter)."
- "p. 10: the ~ examples (~0xF0 = 0x0F, ~0x05 = 0xFA) only hold for 8-bit values; the chapter says so and gives 0xFFFFFFFA for a 32-bit int (verified with gcc/clang)."
- "p. 20: the grade program is shown without #include lines; the chapter adds stdio.h and stdlib.h. The sample runs (83 for 85/75/95, 7 for 9/9/9) were produced locally, not taken from the slides."
Expand Down
Loading
Loading