|
|
|
### Beispiel
|
|
|
|
```java
|
|
|
|
Walze w1 = new Walze(3);
|
|
|
|
w1.setzeNotch(13);
|
|
|
|
Walze w2 = new Walze(5);
|
|
|
|
w2.setzeNotch(1);
|
|
|
|
Walze w3 = new Walze(1);
|
|
|
|
w3.setzeNotch(20);
|
|
|
|
|
|
|
|
String codierterBuchstabe = w1.codiere('A');
|
|
|
|
if(w1.dreheWalze()) {
|
|
|
|
if(w2.dreheWalze()) {
|
|
|
|
w3.dreheWalze();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
#### Funktionen und Methoden
|
|
|
|
* Konstruktor(int walzennummer) => Setze Walze auf Nummer
|
|
|
|
* setzeNotch(char position) => Setze Startpunkt auf Char
|
|
|
|
* dreheWalze() return boolean => Wenn Notch erreicht, gib true zurück, ansonsten false
|
|
|
|
* walzenPosition() return char => Gibt die aktuelle Position zurück
|
|
|
|
* codiere(char buchstabe) return char => Gibt den verschlüsselten Buchstaben zurück
|
|
|
|
|
|
#### Originale Walzenbelegung
|
|
#### Originale Walzenbelegung
|
|
| Walze | 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 |
|
|
| Walze | 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 |
|
|
| ----- | ----- |
|
|
| ----- | ----- |
|
... | | ... | |