-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathceaser with keyword.txt
55 lines (31 loc) · 1.01 KB
/
ceaser with keyword.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
PSUEDOCODE
PRINT welcome to the ceaser shifter, would you like to encode(1) or decode(2)? INPUT
IF INPUT ==1:
PRINT what would you like to say? INPUT = plaintext
PRINT how many spaces would you like to move the text? INPUT = shiftnumber
PRINT what would you like the keyword to be? INPUT = keyword
chr(plaintext)
chr (keyword)
move each letter shiftnumber letters
move each letter in the new string the corrisponding number of letters
IF plaintext > 26:
plaintext= plaintext -26
ord(plaintext)
PRINT plaintext
ELSE:
ord(plaintext)
PRINT plaintext
ELSE:
PRINT what would you like to decode? INPUT = cipher
cipher = chr(cipher)
PRINT how many spaces has this been shifted? INPUT = shifted
PRINT what was the keyword? INPUT = keyword
move each letter -shifted places
move each letter in the new string the corrisponding number of letters backwards
IF cipher<1:
cipher=cipher+26
ord(cipher)
PRINT cipher
ELSE
ord(cipher)
PRINT cipher