mirror of
https://github.com/qwerfd2/Groove_Coaster_2_Server.git
synced 2026-10-13 17:48:10 +03:00
toolset
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import json
|
||||
|
||||
def json_to_hex(json_filename):
|
||||
with open(json_filename, 'r') as f:
|
||||
coordinates = json.load(f)
|
||||
|
||||
hex_data = bytearray()
|
||||
|
||||
for coord in coordinates:
|
||||
x_bytes = coord["x"].to_bytes(2, byteorder='big', signed=False)
|
||||
y_bytes = coord["y"].to_bytes(2, byteorder='big', signed=False)
|
||||
hex_data.extend(x_bytes + y_bytes)
|
||||
|
||||
return hex_data.hex().upper()
|
||||
|
||||
file_name = input("input the json file name: ")
|
||||
|
||||
hex_output = json_to_hex(file_name)
|
||||
print(hex_output)
|
||||
Reference in New Issue
Block a user