From d558a9add0e183219a7a9ff482807bdcd677e21a Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Mon, 11 Aug 2025 22:42:00 -0700 Subject: Initialize repo from local files --- resources/unused_code.gd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 resources/unused_code.gd (limited to 'resources/unused_code.gd') diff --git a/resources/unused_code.gd b/resources/unused_code.gd new file mode 100644 index 0000000..43570b5 --- /dev/null +++ b/resources/unused_code.gd @@ -0,0 +1,17 @@ +const airport_name_list = 'res://resources/airports.txt' +var airport_names = [] +const airport_difficulties = ["easy", "medium", "hard"] + +func load_airport_names(): + var f = File.new() + f.open(airport_name_list, File.READ) + var index = 1 + while not f.eof_reached(): # iterate through all lines until the end of file is reached + airport_names.push_back(f.get_line()) + f.close() + +func get_random_airport_name(exceptions=[]): + var name_index:int = randi() % len(airport_names) + while airport_names[name_index] in exceptions: + name_index = randi() % len(airport_names) + return airport_names[name_index] -- cgit v1.2.3