Skip to content

Instantly share code, notes, and snippets.

@mister-person
Last active October 21, 2022 20:44
Show Gist options
  • Save mister-person/f9d06256ef090cf3e3253572d77a6108 to your computer and use it in GitHub Desktop.
Save mister-person/f9d06256ef090cf3e3253572d77a6108 to your computer and use it in GitHub Desktop.
import collections
spot_1_min, spot_1_max, spot_6_min, spot_6_max = (-39.91, -39.81013, 61.12152, 61.22091)
start_names = {
-68.4: "left ledge",
-57.6: "left plat left",
-20.0: "left plat right",
-18.8: "top plat left",
68.4: "right ledge",
57.6: "right plat right",
20.0: "right plat left",
18.8: "top plat right",
-59.42806: "left regular getup",
-58.43898: "left getup attack",
-40.0969: "left tourney winner",
-30.95691: "left tourney winner hold down",
-31.41302: "left ledge roll",
59.42806: "right regular getup",
58.43898: "right getup attack",
40.0969: "right tourney winner",
30.95691: "right tourney winner hold down",
31.41302: "right ledge roll",
-37.71193: "left tourney winner hold right",
37.71193: "right tourney winner hold left",
-57.64761: "left plat left dash attack",
-19.95239: "left plat right dash attack",
-18.84761: "top plat left dash attack",
57.64761: "right plat right dash attack",
19.95239: "right plat left dash attack",
18.84761: "top plat right dash attack",
68.44762: "right ledge dash attack",
-68.44762: "left ledge dash attack",
-60.31384: "left plat dash grab left hold down",
-17.28616: "left plat dash grab right hold down",
-21.51384: "top plat dash grab left hold down",
60.31384: "right plat dash grab right hold down",
17.28616: "right plat dash grab left hold down",
21.51384: "top plat dash grab right hold down",
-68.49: "left ledge f smash off",
-57.69: "left plat left f smash off",
-19.91: "left plat right f smash off",
-18.89: "top plat left f smash off",
68.49: "right ledge f smash off",
57.69: "right plat right f smash off",
19.91: "right plat left f smash off",
18.89: "top plat right f smash off",
}
start_names_9875 = {
50.89997: "top plat left up b right (.9875)",
-50.89997: "top plat right up b left (.9875)",
12.10000: "left plat left up b right (.9875)",
-12.10000: "right plat right up b left (.9875)",
35.02501: "left plat right up b right (.9875)",
-35.02501: "right plat left up b left (.9875)",
-18.80003: "top plat left up b right, then up b left (.9875)",
18.80003: "top plat right up b left, then up b right (.9875)",
-45.12999: "left plat dash grab left hold right shield (.9875)",
# 2.40941: "left plat dash grab right hold right shield (.9875)",
-32.47002: "left plat dash grab right hold left shield (.9875)",
5.42127: "top plat dash grab left hold right shield (.9875)",
-39.21152: "top plat dash grab left hold left shield (.9875)",
45.12999: "right plat dash grab right hold left shield (.9875)",
# -2.40941: "right plat dash grab left hold left shield (.9875)",
32.47002: "right plat dash grab left hold right shield (.9875)",
-5.42127: "top plat dash grab right hold left shield (.9875)",
39.21152: "top plat dash grab right hold right shield (.9875)",
.66900: "right plat left tilt turn hold left (.9875)",
-39.46899: "top plat left tilt turn hold left (.9875)",
-.66900: "left plat right tilt turn hold right (.9875)",
39.46899: "top plat right tilt turn hold right (.9875)",
.90948: "right plat left dash attack hold left shield (.9875)",
-37.89051: "top plat left dash attack hold left shield (.9875)",
-.90948: "left plat right dash attack hold right shield (.9875)",
37.89051: "top plat right dash attack hold right shield (.9875)",
# I forgot what this is lol
# -14.51187: "test1"
-44.22748: "top plat fall off left (.9875)",
-5.42749: "right plat fall off left (.9875)",
5.42749: "left plat fall off right (.9875)",
44.22748: "top plat fall off right (.9875)",
}
start_names_10 = {
51.16677: "top plat left up b right (1.0)",
-51.16677: "top plat right up b left (1.0)",
12.36679: "left plat left up b right (1.0)",
-12.36679: "right plat right up b left (1.0)",
35.30560: "left plat right up b right (1.0)",
-35.30560: "right plat left up b left (1.0)",
# -18.80003: "top plat left up b right, then up b left (1.0)",
# 18.80003: "top plat right up b left, then up b right (1.0)",
-44.91585: "left plat dash grab left hold right shield (1.0)",
0.66391: "left plat dash grab right hold right shield (1.0)",
-32.68416: "left plat dash grab right hold left shield (1.0)",
5.78415: "top plat dash grab left hold right shield (1.0)",
-41.49844: "top plat dash grab left hold left shield (1.0)",
44.91585: "right plat dash grab right hold left shield (1.0)",
-0.66391: "right plat dash grab left hold left shield (1.0)",
32.68416: "right plat dash grab left hold right shield (1.0)",
-5.78415: "top plat dash grab right hold left shield (1.0)",
41.49844: "top plat dash grab right hold right shield (1.0)",
.95000: "right plat left tilt turn hold left (1.0)",
-.95000: "left plat right tilt turn hold right (1.0)",
-39.75000: "top plat left tilt turn hold left (1.0)",
39.75000: "top plat right tilt turn hold right (1.0)",
.65412: "right plat left dash attack hold left shield (1.0)",
-.65412: "left plat right dash attack hold right shield (1.0)",
-38.14589: "top plat left dash attack hold left shield (1.0)",
38.14589: "top plat right dash attack hold right shield (1.0)",
5.8: "left plat right dash off right (1.0)",
-5.8: "left plat right dash off right (1.0)",
44.59999: "top plat right dash off right (1.0)",
-44.59999: "top plat left dash off left (1.0)",
}
diff_names: dict[float | tuple[float, float, float], str] = {
36.67237: "forward roll right",
33.3: "back roll right",
-36.67237: "forward roll left",
-33.3: "back roll left",
59.16669: "smash side b right",
-59.16669: "smash side b left",
44.3: "tilt side b right",
-44.3: "tilt side b left",
17.1: "1f dash right",
-17.1: "1f dash left",
# (): "",
}
diff_names_9875 = {
54.15: "up b right (.9875)",
-54.15: "up b left (.9875)",
32.83310: "sh forward right into shield (.9875)",
-32.83310: "sh forward left into shield (.9875)",
31.99372: "sh backward right into shield (.9875)",
-31.99372: "sh backward left into shield (.9875)",
5.72549: "sh backward left into buffer roll right (.9875)",
-5.72549: "sh backward right into buffer roll left (.9875)",
1.51375: "sh forward left into buffer roll right (.9875)",
-1.51375: "sh forward right into buffer roll left (.9875)",
}
diff_names_10 = {
54.42600: "up b right (1.0)",
-54.42600: "up b left (1.0)",
33.30000: "sh forward right into shield (1.0)",
-33.30000: "sh forward left into shield (1.0)",
32.45000: "sh backward right into shield (1.0)",
-32.45000: "sh backward left into shield (1.0)",
5.32236: "sh backward left into buffer roll right (1.0)",
-5.32236: "sh backward right into buffer roll left (1.0)",
1.09999: "sh forward left into buffer roll right (1.0)",
-1.09999: "sh forward right into buffer roll left (1.0)",
55.30560: "jump frame 4 up b right (1.0)",
-55.30560: "jump frame 4 up b left (1.0)",
(-44.35, 20.0, 49.0): "sh left off side plat shield (1.0)",
(44.35, -20.0, -49.0): "sh right off side plat shield (1.0)",
(44.35, -10.2, 13.25): "sh right off top plat shield (1.0)",
(-44.35, -13.25, 10.2): "sh left off top plat shield (1.0)",
(69.7, -57.6, -37.0): "up b right off side plat to ground (1.0)",
(-69.7, 37.0, 57.6): "up b left off side plat to ground (1.0)",
(55.30560, -30.0, -20.0): "up b left off side plat to other plat (1.0)",
(-55.30560, 20.0, 30.0): "up b right off side plat to other plat (1.0)",
}
diff_names.update(diff_names_10)
# diff_names.update(diff_names_9875)
start_names.update(start_names_10)
# start_names.update(start_names_9875)
PRINT_COORDS = False
starts = start_names.keys()
diffs = diff_names.keys()
names = diff_names | start_names
#starts.remove(-20)
left_edge = -68.4
right_edge = 68.4
avgdist = ((spot_6_max - spot_1_min) / 5 + (spot_6_min - spot_1_max) / 5 ) / 2
to_visit = collections.deque(map(lambda s: (s, (s,)), starts))
visited = {}
found_already = set()
def canonize(steps):
"""
if len(steps) > 5:
print("total found ", len(found_already))
exit()
"""
try:
return tuple(sorted(steps))
except TypeError:
return tuple(steps)
while True:
n, steps = to_visit.popleft()
visited[n] = steps
for diff in diffs:
if isinstance(diff, float):
next_ = n + diff
else:
if not (n >= diff[1] and n <= diff[2]):
continue
next_ = n + diff[0]
if next_ < left_edge or next_ > right_edge:
continue
if next_ in visited:
continue
if next_ % avgdist > .505 and next_ % avgdist < .602:
#if next_ > 20:
#continue
all_steps = steps + (diff,)
if canonize(all_steps) in found_already:
#print("found DUPE", steps + (diff,), next_, next_ % avgdiff)
pass
else:
all_steps = steps + (diff,)
#print("found one", round(next_ % avgdiff, 3))
print("found one:", list(map(lambda step: names[step], all_steps)))
acc = 0
if PRINT_COORDS:
for step in all_steps:
if isinstance(step, float):
acc += step
else:
acc += step[0]
print(acc, end=", ")
print()
found_already.add(canonize(steps + (diff,)))
else:
to_visit.append((next_, steps + (diff,)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment