Skip to content

Commit

Permalink
shrink 252, fix the length printout and only go to combos of up to 3 …
Browse files Browse the repository at this point in the history
…numbers
  • Loading branch information
sealldeveloper committed Oct 17, 2024
1 parent bf03d76 commit 4268e2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/originalMappings.csv
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
249,chr(sum(range(len(str(dict))))+len(str(credits)))
250,chr(len(str(frozenset))+sum(range(len(vars(tuple)))))
251,chr(ord(min(str(()in())))+len(str(bin)+str(credits)))
252,chr(ord(min(str(()in())))+len(str(credits)+str(hash)))
252,chr(len(vars(set))+len(vars(set))+len(str(credits)))
253,chr(sum(range(len(str(bin)))))
254,chr((not())+sum(range(len(str(bin)))))
255,chr((not())+(not())+sum(range(len(str(bin)))))
8 changes: 4 additions & 4 deletions find-num.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def find_combinations_in_range(n, codes):

# Precompute all possible sums up to n
sums = defaultdict(list)
for length in range(1, 5): # Adjust the range based on your max_length
for length in range(1, 4): # Adjust the range based on your max_length
for combo in iter_combinations(ascii_values.items(), length):
total = sum(val for _, val in combo)
if total <= n:
Expand All @@ -98,12 +98,12 @@ def find_combinations_in_range(n, codes):

if combinations:
shortest = min(combinations, key=len)
if not existing_code or len(f"chr({shortest})") < len(f"{existing_code}"):
if not existing_code or len(f"chr({shortest})") < len(f'chr({existing_code})'):
print(f"{number},chr({shortest})")
else:
print(f"(Existing) {number}: chr({existing_code}) (Length: {len(existing_code)})")
print(f"(Existing) {number}: chr({existing_code}) (Length: {len(f'chr({existing_code})')})")
elif existing_code:
print(f"(Existing) {number}: chr({existing_code}) (Length: {len(existing_code)})")
print(f"(Existing) {number}: chr({existing_code}) (Length: {len(f'chr({existing_code})')})")
else:
print(f"{number}: No combination found")

Expand Down

0 comments on commit 4268e2e

Please sign in to comment.