Selaa lähdekoodia

test passed once

Nick Satinover 7 vuotta sitten
vanhempi
commit
eb34b9649a

+ 1
- 1
Crypto/src/Main/ROT13.java Näytä tiedosto

@@ -55,7 +55,7 @@ public class ROT13  {
55 55
     }
56 56
 
57 57
     public String shiftCharEncrypt(char c, int rotate){
58
-        if (c > 64){
58
+        if (c > 64 && c != 8217){
59 59
             return  ( (c > 96 && (c + rotate) > 96) || (c <= 96 && (c + rotate) > 64) ) ?
60 60
                     ( Character.toString( (char)(c + rotate) ) ) :
61 61
                     ( Character.toString( (char)(c + rotate + encryptShift) ) );

+ 0
- 44
Crypto/src/Main/Scrap/CryptFileReader.java Näytä tiedosto

@@ -1,44 +0,0 @@
1
-//package Scrap;
2
-//
3
-//import java.io.BufferedReader;
4
-//import java.io.File;
5
-//import java.io.FileReader;
6
-//import java.io.FileWriter;
7
-//import java.io.PrintWriter;
8
-//import java.io.IOException;
9
-//
10
-//public class CryptFileReader extends ROT13 {
11
-//    private File file;
12
-//    StringBuffer stringBuffer = new StringBuffer();
13
-//
14
-//    public CryptFileReader(Character cs, Character cf) {
15
-//        super(cs, cf);
16
-//    }
17
-//
18
-//    public CryptFileReader(File file) {
19
-//        this.file = file;
20
-//    }
21
-//
22
-//    public CryptFileReader() {
23
-//    }
24
-//
25
-//    public void fileCryptReader() {
26
-//        try {
27
-//            FileReader fileReader = new FileReader(file);
28
-//            BufferedReader bufferedReader = new BufferedReader(fileReader);
29
-//            String line;
30
-//            while ((line = bufferedReader.readLine()) != null) {
31
-//                stringBuffer.append(line);
32
-//                stringBuffer.append("\n");
33
-//            }
34
-//            fileReader.close();
35
-//
36
-//            File fileOut = new File("sonnet18.enc");
37
-//            // fileOut.
38
-//            this.crypt(stringBuffer.toString(), 13);
39
-//
40
-//        } catch (IOException e) {
41
-//            e.printStackTrace();
42
-//        }
43
-//    }
44
-//}

+ 0
- 3
Crypto/src/Test/fileCrypterTest.java Näytä tiedosto

@@ -12,7 +12,6 @@ public class fileCrypterTest {
12 12
 
13 13
         fileCrypter.connectToFile();
14 14
         String expected = fileCrypter.readFile();
15
-        System.out.println(fileCrypter.getFileIn());
16 15
 
17 16
         // When
18 17
         fileCrypter.encryptFile();
@@ -20,8 +19,6 @@ public class fileCrypterTest {
20 19
         fileCrypter.encryptFile();
21 20
         fileCrypter.connectToFile();
22 21
         String actual = fileCrypter.readFile();
23
-        System.out.println();
24
-        System.out.println(fileCrypter.getFileIn());
25 22
 
26 23
         // Then
27 24
         assertTrue(actual.equals(expected));

+ 1
- 1
sonnet18.txt Näytä tiedosto

@@ -11,4 +11,4 @@ Nor lose possession of that fair thou ow’st;
11 11
 Nor shall death brag thou wander’st in his shade,
12 12
 When in eternal lines to time thou grow’st:
13 13
    So long as men can breathe or eyes can see,
14
-   So long lives this, and this gives life to thee.
14
+   So long lives this, and this gives life to thee.