Pokemon Emerald: Implement New Game (#1813)

This commit is contained in:
Bryce Wilson
2023-11-12 13:39:34 -08:00
committed by GitHub
parent e670ca513b
commit 43041f7292
35 changed files with 16338 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from typing import List
from .data import data
def location_name_to_label(name: str) -> str:
return data.locations[name].label
def int_to_bool_array(num: int) -> List[bool]:
binary_string = format(num, '064b')
bool_array = [bit == '1' for bit in reversed(binary_string)]
return bool_array
def bool_array_to_int(bool_array: List[bool]) -> int:
binary_string = ''.join(['1' if bit else '0' for bit in reversed(bool_array)])
num = int(binary_string, 2)
return num