diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-02-24 17:07:12 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-02-24 17:07:12 +0100 |
| commit | e67739cbb4f333eadd3086f13e511e2da602624c (patch) | |
| tree | fea77260b405945c7343b24268b7282be63ae3aa /Info/10/2 | |
| parent | cfd1604eead4f4a3659047712c15184f5507e7a4 (diff) | |
| download | unterricht-e67739cbb4f333eadd3086f13e511e2da602624c.tar.gz unterricht-e67739cbb4f333eadd3086f13e511e2da602624c.zip | |
add my next lesson in 10B
Diffstat (limited to 'Info/10/2')
| m--------- | Info/10/2/Spielautomat/BlueJ_Projekt | 0 | ||||
| -rw-r--r-- | Info/10/2/Spielautomat/Gewinn/img/four_of_four.png | bin | 0 -> 1292 bytes | |||
| -rw-r--r-- | Info/10/2/Spielautomat/Gewinn/img/no_matching.png | bin | 0 -> 1214 bytes | |||
| -rw-r--r-- | Info/10/2/Spielautomat/Gewinn/img/two_of_three.png | bin | 0 -> 1177 bytes | |||
| -rw-r--r-- | Info/10/2/Spielautomat/Gewinn/slides.md | 153 |
5 files changed, 153 insertions, 0 deletions
diff --git a/Info/10/2/Spielautomat/BlueJ_Projekt b/Info/10/2/Spielautomat/BlueJ_Projekt -Subproject 48afb27f7f37d00d6298882fa1d857321cabe3f +Subproject 3849fdb531b84d38a2330ebdff8d4512f4385d7 diff --git a/Info/10/2/Spielautomat/Gewinn/img/four_of_four.png b/Info/10/2/Spielautomat/Gewinn/img/four_of_four.png Binary files differnew file mode 100644 index 00000000..92062e6f --- /dev/null +++ b/Info/10/2/Spielautomat/Gewinn/img/four_of_four.png diff --git a/Info/10/2/Spielautomat/Gewinn/img/no_matching.png b/Info/10/2/Spielautomat/Gewinn/img/no_matching.png Binary files differnew file mode 100644 index 00000000..ff820938 --- /dev/null +++ b/Info/10/2/Spielautomat/Gewinn/img/no_matching.png diff --git a/Info/10/2/Spielautomat/Gewinn/img/two_of_three.png b/Info/10/2/Spielautomat/Gewinn/img/two_of_three.png Binary files differnew file mode 100644 index 00000000..305ac7ae --- /dev/null +++ b/Info/10/2/Spielautomat/Gewinn/img/two_of_three.png diff --git a/Info/10/2/Spielautomat/Gewinn/slides.md b/Info/10/2/Spielautomat/Gewinn/slides.md new file mode 100644 index 00000000..b4101596 --- /dev/null +++ b/Info/10/2/Spielautomat/Gewinn/slides.md @@ -0,0 +1,153 @@ +--- +author: Florian Fischer +theme: metropolis +aspectratio: 169 +header-includes: | + \makeatletter + \beamer@ignorenonframefalse + \makeatother +--- + +## Spielautomat + +{.center} + +## Spielautomat vereinfacht - objektorientiertes Modell + +\begin{center} +\begin{tikzpicture}[ +class/.style={ +draw, +rectangle, +minimum width={width("SPIELAUTOMAT")}, +font=\small}] + +\node[class] (sa) at (0,0) {SPIELAUTOMAT}; + +\node[class] (sw) at (7, 0) {SPIELWALZE}; + +\draw (sa.east) edge[above, align=center] node {\small 1 ~~~~~ > enthält ~~~~~ \only<1>{3}\only<2->{\boldred{n}}} (sw.west); +\end{tikzpicture} +\end{center} + +\pause +\pause + +\vspace{0.2cm} +::: columns +:::: {.column width=70%} +```java +class SPIELAUTOMAT { + SPIELWALZEN[] walzen; + + SPIELAUTOMAT(int n) { + walzen = SPIELWALZE[n]; + } +} +``` +:::: +::: + +## Wdh. Felder +\large + +* Wie bildet man den Datentyp eines Feldes? +* Wie initialisiert man eine Feld? +* Wie initialisiert man ein Element des Feldes? + +\pause + +>- Datentyp eines Elements gefolgt von eckigen Klammern (`int[]`{.java}) +>- `feldname = new datentyp[laenge]`{.java} +>- `feldname[i] = ...`{.java} + +## Mögliche Indizes eines Feldes + +\begin{center} +\scalebox{1.5}{ +\begin{tabular}{|c|c|c|c|c|} +\hline +\phantom{1} & \phantom{2} & \phantom{3} & \phantom{4} & \phantom{5} \\ +\hline +\end{tabular} +} + +\only<-2>{ +\begin{tabular}{ccccc} +& & & & \\ +\end{tabular} +} +\only<3->{ +\scalebox{1.5}{ +\begin{tabular}{ccccc} +0 & 1 & 2 & 3 & 4 \\ +\end{tabular} +} +} +\end{center} + +\pause + +\only<-1>{ +\begin{itemize} +\item[] \phantom{Kleinster Index: \only<3->{\texttt{0}}} +\item[] \phantom{Größter Index: \only<4->{\texttt{length - 1}}} +\end{itemize} +} + +\only<2->{ +\begin{itemize} +\item Kleinster Index: \only<4->{\texttt{0}} +\item Größter Index: \only<5->{\texttt{length - 1}} +\end{itemize} +} + + +## \faIcon{desktop} Arbeitsauftrag – Mehr Farben - 15 min +\large + +\begin{enumerate} +\item Kopiere die neue BlueJ-Projektvorlage (\textbf{Spielautomat2}). +\item Ergänze alle \texttt{TODOs} in der Klasse \texttt{SPIELWALZE} + \begin{enumerate} + \item Deklariere und initialisiere ein neues Feld mit allen Farbergebnissen + \item Vervollständige die Methode \texttt{Drehen()}: \\ + Bestimme eine als Index geeignete Zufallszahl. \\ + Setze die neue zufällig bestimmte Farbe. + \end{enumerate} +\end{enumerate} + +## Wie erkennen wir ein gewonnenes Spiel? + +::: columns +:::: {.column width=24%} + +:::: + +:::: {.column width=33%} + +:::: + +:::: {.column width=24%} + +:::: +::: + + +## \faIcon{desktop} Arbeitsauftrag – Gewinn - 30 min +\large + +1. Vervollständige die Methode `SPIELAUTOMAT.GibGewinn()` + 1. Ergänze die geeignete Länge des Feldes `ergebnisse` + 2. Zahle die Farbergebnisse aller Spielwalzen + 3. Überprüfe ob das Spiel gewonnen wurde und gib den Gewinn zurück + +## \faIcon{desktop} Arbeitsauftrag – Spielen - 10 min +\large + +1. Vervollständige die Methode `SPIELAUTOMAT.Spielen()` +2. **Fuer Schnelle**: Verbessere den Spielautomat + Anregungen: + * Ergänze eine weitere Reihe an Walzen (Du kannst Felder von Feldern nutzen `int[][]`{.java}) + * Ergänze die Walzen um ein Symbol zusätzlich zu ihrer Farbe + * Deiner Fantasie sind keine Grenzen gesetzt |
