diff options
Diffstat (limited to 'resources/unused_code.gd')
| -rw-r--r-- | resources/unused_code.gd | 17 |
1 files changed, 17 insertions, 0 deletions
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] |
