File tree Expand file tree Collapse file tree 5 files changed +65
-27
lines changed Expand file tree Collapse file tree 5 files changed +65
-27
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Perhaps I'll discover that I can actually program. Or maybe I can't. I don't kno
6
6
7
7
The ` standalone_modules ` folder is for modules that stand on their own. They do not require any sort of edgework,
8
8
it's just calculations based on given values. All of these files are desigend to run on their own - none of them need
9
- to be supplied anything. Just run them and they will solve the module for you.
9
+ to be supplied anything. Just run them and they will solve the module for you. Alternatively, the cmd_main.py file should also be able to run them.
10
10
11
11
The ` modules ` folder all require a Bomb object to be passed to them, meaning they require edgework.
12
12
They shouldn't be excruciating to solve.
Original file line number Diff line number Diff line change
1
+ from bomb import Bomb
2
+ import modules
3
+ import standalone_modules .adjacentletters
4
+
5
+ solve_methods = {
6
+ "adjacentletters" : standalone_modules .adjacentletters .solve ,
7
+ "adventuregame" : None ,
8
+ "alphabet" : None ,
9
+ "astrology" : None ,
10
+ "backgrounds" : None ,
11
+ "bigcircle" : None ,
12
+ "binaryleds" : None ,
13
+ "bitwise" : None ,
14
+ "blindalley" : None ,
15
+ "booleanvenndiagram" : None ,
16
+ "bulb" : None ,
17
+ "button" : modules .button .solve ,
18
+ "caesarcipher" : modules .caesarcipher .solve ,
19
+ "cheapcheckout" : None ,
20
+ "complicatedwires" : modules .complicatedwires .solve ,
21
+ "combinationlock" : None ,
22
+ "creation" : None ,
23
+ "cryptography" : None ,
24
+ "emojimath" : None ,
25
+ "flags" : None ,
26
+
27
+ }
28
+
29
+ params = {
30
+
31
+ }
32
+
33
+ # A version of this project's driver file, but available for use
34
+ # from the command line.
Original file line number Diff line number Diff line change 10
10
# -------------------#
11
11
12
12
current_bomb = Bomb (
13
- 'ABCDE2 ' , # serial number
14
- lit_indicators = ['NSA ' ],
15
- unlit_indicators = [],
16
- batteries = 2 ,
17
- holders = 1 ,
13
+ 'EJ4PA3 ' , # serial number
14
+ lit_indicators = ['CLR ' ],
15
+ unlit_indicators = ['IND' ],
16
+ batteries = 5 ,
17
+ holders = 3 ,
18
18
19
19
ports = [
20
- [],
21
- ['RJ' , 'RCA' ]
20
+
22
21
],
23
22
24
- module_count = 15 ,
25
- time = 20
23
+ module_count = 5 ,
24
+ time = 60
26
25
)
27
26
28
27
29
28
# -------------------#
30
29
# SOLVING MODULES #
31
30
# -------------------#
32
- modules .caesarcipher .solve (current_bomb , 'ASDFE ' )
31
+ modules .button .solve (current_bomb , 'red' , 'hold ' )
Original file line number Diff line number Diff line change 2
2
from termcolor import cprint
3
3
4
4
5
- def solve (bomb : Bomb , word : str , color : str ):
5
+ def solve (bomb : Bomb , color : str , word : str ):
6
6
cprint ('The Button' , 'yellow' , attrs = ['reverse' ])
7
7
# Preprocessing
8
8
word = word .upper ()
Original file line number Diff line number Diff line change 32
32
}
33
33
34
34
35
+ def solve ():
36
+ cprint ('Adjacent Letters' , 'yellow' , attrs = ['reverse' ])
37
+ cprint ('Input your buttons in this format:' , 'green' )
38
+ print ('''ABCD
39
+ EFGH
40
+ IJKL
41
+ ''' )
42
+
43
+ letters = [get_input_row (), get_input_row (), get_input_row ()]
44
+
45
+ print ('Your input:' )
46
+ print (letters )
47
+ print ()
48
+ print ('Buttons to press:' )
49
+
50
+ calc_letters (letters )
51
+
52
+
35
53
def calc_letters (letterlist ):
36
54
if None in letterlist :
37
55
print ('Invalid arguments. Please try again.' )
@@ -66,18 +84,5 @@ def get_input_row():
66
84
return list (row .upper ())
67
85
68
86
69
- cprint ('Adjacent Letters' , 'yellow' , attrs = ['reverse' ])
70
- cprint ('Input your buttons in this format:' , 'green' )
71
- print ('''ABCD
72
- EFGH
73
- IJKL
74
- ''' )
75
-
76
- letters = [get_input_row (), get_input_row (), get_input_row ()]
77
-
78
- print ('Your input:' )
79
- print (letters )
80
- print ()
81
- print ('Buttons to press:' )
82
-
83
- calc_letters (letters )
87
+ if __name__ == '__main__' :
88
+ solve ()
You can’t perform that action at this time.
0 commit comments