Skip to content
Snippets Groups Projects
Commit 293ea700 authored by Ricy40's avatar Ricy40
Browse files

Edits

parent fdb7c6f5
No related branches found
No related tags found
No related merge requests found
...@@ -32,14 +32,9 @@ public class CodeCracker { ...@@ -32,14 +32,9 @@ public class CodeCracker {
if (subtextMap.getLeft().equals(phraseMap.getLeft())) { if (subtextMap.getLeft().equals(phraseMap.getLeft())) {
System.out.println("Found!"); System.out.println("Found!");
HashBiMap<Character, Integer> numKey = phraseMap.getRight();
numKey.put('Q', 25); // Q is not in the phrase
HashBiMap<Character, Integer> subtextKey = subtextMap.getRight();
subtextKey.put('M', 25); // M isn't in the corresponding part of ciphertext
HashBiMap<Character, Character> key = HashBiMap.create(); HashBiMap<Character, Character> key = HashBiMap.create();
for (int num = 0; num < 26; num++) { for (int num = 0; num < 26; num++) {
key.put(subtextKey.inverse().get(num), numKey.inverse().get(num)); key.put(subtextMap.getRight().inverse().get(num), phraseMap.getRight().inverse().get(num));
} }
ArrayList<String> plaintext = new ArrayList<>(); ArrayList<String> plaintext = new ArrayList<>();
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment