Skip to content

Commit 58d578f

Browse files
committed
add more files
1 parent 0579e43 commit 58d578f

File tree

9 files changed

+117
-0
lines changed

9 files changed

+117
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# KTANE - Python Version
2+
This is a repository aimed at attempting to solve the Centurion with one person and one person only.
3+
Honestly, I'm not sure if this is possible, but I'm sure as hell going to try.
4+
5+
Perhaps I'll discover that I can actually program. Or maybe I can't. I don't know.
6+
7+
The `standalone_modules` folder is for modules that stand on their own. They do not require any sort of edgework,
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.
10+
11+
The `modules` folder all require a Bomb object to be passed to them, meaning they require edgework.
12+
They shouldn't be excruciating to solve.
13+
14+
Anything that would be extraordinarily painful to code a solver for (like Colored Switches) or would be very
15+
impractical to design a program around (like Memory) is instead included in the `manualpages` folder,
16+
with a condensed manual page if I can find one. Some of the pages in there also have programs, I just wanted to make a condensed manual version
17+
or found a good manual page.
18+
19+
# Formatting
20+
When constructing your `Bomb` object, this is the formatting that should be followed.
21+
22+
| Field | Type | Example |
23+
|:----------------:|:---------------:|:-------------------:|
24+
| Serial Number | str | "AB5SD3" |
25+
| Lit Indicators | list | ["NSA", "FRQ"] |
26+
| Unlit Indicators | list | ["NSA", "FRQ"] |
27+
| Batteries | int | 9 |
28+
| Battery Holders | int | 23 |
29+
| Module Count | int | 15 |
30+
| Time Limit | float (minutes) | 15.5 |
31+
| Port Plates | list of lists | [[], ["RJ", "RCA"]] |
32+
33+
Note that for port plates, each list within the lists is a port plate. As such the first [] within Port Plates
34+
is actually an empty port plate.
35+
36+
# Standardized Inputs
37+
Naturally, we have to standardize the things inputted in order to compare them programmatically.
38+
## Colors
39+
Just the color name, in all caps. (i.e. WHITE)
40+
## Ports
41+
The names are standardized. Omit any unnecessary details.
42+
43+
- PARALLEL
44+
- SERIAL
45+
- RJ
46+
- RCA
47+
- DVI
48+
- PS2

bomb.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import re
2+
3+
14
# Contains all the edgework stuff about the bomb.
25

36

@@ -10,6 +13,9 @@ def __init__(self, serial_number: str, lit_indicators: list = None, unlit_indica
1013
lit_indicators = []
1114
if ports is None:
1215
ports = []
16+
ports = capitalize_list(ports)
17+
lit_indicators = capitalize_list(lit_indicators)
18+
unlit_indicators = capitalize_list
1319

1420
self.serial_number = serial_number
1521
self.lit_indicators = lit_indicators
@@ -22,3 +28,15 @@ def __init__(self, serial_number: str, lit_indicators: list = None, unlit_indica
2228

2329
self.aa_batteries = (batteries - holders) * 2
2430
self.d_batteries = batteries - self.aa_batteries
31+
32+
def last_digit_serial(self):
33+
return int(re.match('.+([0-9])[^0-9]*$', self.serial_number).group(1))
34+
35+
def get_ports_flattened(self):
36+
return [item for sublist in self.ports for item in sublist]
37+
38+
39+
def capitalize_list(old_list: list):
40+
for i in range(len(old_list)):
41+
old_list[i] = old_list[i].upper()
42+
return old_list
31.5 KB
Binary file not shown.

manualpages/ComplicatedWires.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Complicated Wires
2+
3+
### Always Cuts:
4+
- Nothing
5+
- Star only
6+
- Star + Red
7+
8+
### Last Digit Serial # Even:
9+
- Red
10+
- Blue
11+
- Red + Blue
12+
- Red + Blue + Lit
13+
14+
### Parallel Port:
15+
- Blue Lit
16+
- Blue Star Lit
17+
- Blue Red Star
18+
19+
### 2+ Batteries:
20+
- Red Lit
21+
- Red Star Lit
22+
- Lit Star
23+
24+
### Never Cuts:
25+
- Everything (Star Lit Red Blue)
26+
- Lit
27+
- Blue Star
28+
29+
30+
## Things to note:
31+
- A blank wire / wire with just a star are both always cuts. That means you should take note
32+
of any potentially blank wires.
33+
- If it's only red or only blue, it's serial number.

manualpages/Knob.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# The Knob
2+
### Things to note:
3+
- You only care about the first 6 in the sequence (unless it's alternating).
4+
5+
### Giveaways
6+
- First three are 000 - LEFT
7+
- First three are 011 - DOWN
8+
- First three are 001 - UP
9+
- First three are 101 and NOT alternating 101010 for the first 6 - RIGHT
10+
11+
### If alternating 101010, look at the bottom row
12+
- 011011 - Up
13+
- 010001 - Down
84.1 KB
Binary file not shown.
32.6 KB
Binary file not shown.

manualpages/Probing.md

Whitespace-only changes.

modules/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from modules import button
2+
3+
4+
# Here, literally what we do is just import all the modules.
5+
# This simplifies our import process in main.py. It's not pretty, but it works.

0 commit comments

Comments
 (0)