Skip to content

Commit 74271ee

Browse files
committed
Fix subsongs being checked in the wrong direction
# Conflicts: # version.py
1 parent 3a8f0b7 commit 74271ee

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

OcarinaSongs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@
8787
}
8888

8989

90-
# checks if one list is a sublist of the other (in either direction)
90+
# checks if the first list is a sublist of the second
9191
# python is magic.....
9292
def subsong(song1: Song, song2: Song) -> bool:
9393
# convert both lists to strings
94-
s1 = ''.join( map(chr, song1.activation))
95-
s2 = ''.join( map(chr, song2.activation))
96-
# check if either is a substring of the other
97-
return (s1 in s2) or (s2 in s1)
94+
s1 = ''.join(map(chr, song1.activation))
95+
s2 = ''.join(map(chr, song2.activation))
96+
# check if the first is a substring of the second
97+
return s1 in s2
9898

9999

100100
# give random durations and volumes to the notes
@@ -420,7 +420,7 @@ def generate_song_list(world: World, frog: bool, warp: bool, frogs2: bool) -> di
420420
is_good = True
421421

422422
for other_song in chain((song for name, song in fixed_songs.items() if name != 'ZR Frogs Ocarina Game'), random_songs):
423-
if subsong(song, other_song):
423+
if subsong(song, other_song) or subsong(other_song, song):
424424
is_good = False
425425
if is_good:
426426
random_songs.append(song)

0 commit comments

Comments
 (0)