File tree Expand file tree Collapse file tree
src/main/java/io/github/vbetsch/codecracker Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io .github .vbetsch .codecracker ;
22
33public class CodeCracker {
4- private final Cypher cypher = new Cypher ();
4+ private final TranslationDictionary dictionary = new TranslationDictionary ();
55
66 public char decryptLetter (char letter ) {
7- return cypher . decryptLetter (letter );
7+ return dictionary . getDecryptions (). get (letter );
88 }
99
1010 public char encryptChar (char character ) {
11- return cypher . encryptChar (character );
11+ return dictionary . getEncryptions (). get (character );
1212 }
1313
1414 public String decryptWord (String string ) {
15- return cypher .decryptWord (string );
15+ StringBuilder stringBuilder = new StringBuilder ();
16+ for (char c : string .toCharArray ()) {
17+ stringBuilder .append (decryptLetter (c ));
18+ }
19+ return stringBuilder .toString ();
1620 }
1721}
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments