Files
MegaMech 81a9c346d4 Delete courses/cup folders and rename course related files (#432)
* Move course folders

* Rename model to vertices

* Rename packed to displaylists

* Rename displaylists to course_displaylists.inc.c

* rename vertices to course_vertices

* makefile cleanup

* Rename trophy_model to ceremony_data

* move ceremony_data.inc.c to ending folder
2023-09-20 17:17:24 -06:00

21 lines
627 B
Python

import re
# Define the regex query to match the hex values
regex_query = r'0x07[0-9a-fA-F]{6}'
# Define a function to process each match
def process_match(match):
offset = int(match.group(0)[4:], 16)
return f"d_course_big_donut_packed_dl_{hex(offset)[2:].upper()}"
# Open the input file
with open("courses/big_donut/packed.inc.c", "r") as f:
# Read the file contents
file_content = f.read()
# Use re.sub() to find and replace all matches in the file content
modified_content = re.sub(regex_query, process_match, file_content)
# Print the modified content to console
print(modified_content)