Advance rotor by count
positions
Default value of parameter is 1
This commit is contained in:
parent
f4b3982986
commit
9f2106ed94
1 changed files with 2 additions and 2 deletions
|
@ -36,8 +36,8 @@ class Rotor {
|
|||
self.series = series
|
||||
}
|
||||
|
||||
func advance() {
|
||||
position = position.successor() % Rotor.alphabet.count
|
||||
func advance(count: Int = 1) {
|
||||
position = (position + count) % Rotor.alphabet.count
|
||||
}
|
||||
|
||||
func encode(c: Character) throws -> Character {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue