2021-07-25 11:34:54 +00:00
|
|
|
#include "random_name.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <furi.h>
|
|
|
|
|
|
|
|
void set_random_name(char* name, uint8_t max_name_size) {
|
|
|
|
const char* prefix[] = {
|
2022-08-07 15:28:04 +00:00
|
|
|
"ancient", "hollow", "strange", "disappeared", "unknown",
|
|
|
|
"unthinkable", "unnamable", "nameless", "my", "concealed",
|
|
|
|
"forgotten", "hidden", "mysterious", "obscure", "random",
|
|
|
|
"remote", "uncharted", "undefined", "untravelled", "untold",
|
2021-07-25 11:34:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const char* suffix[] = {
|
|
|
|
"door",
|
|
|
|
"entrance",
|
|
|
|
"doorway",
|
|
|
|
"entry",
|
|
|
|
"portal",
|
|
|
|
"entree",
|
|
|
|
"opening",
|
|
|
|
"crack",
|
2022-08-07 15:28:04 +00:00
|
|
|
"access",
|
|
|
|
"corridor",
|
|
|
|
"passage",
|
|
|
|
"port",
|
2021-07-25 11:34:54 +00:00
|
|
|
};
|
2022-05-06 13:37:10 +00:00
|
|
|
uint8_t prefix_i = rand() % COUNT_OF(prefix);
|
|
|
|
uint8_t suffix_i = rand() % COUNT_OF(suffix);
|
2021-07-25 11:34:54 +00:00
|
|
|
|
2022-08-03 16:00:17 +00:00
|
|
|
snprintf(name, max_name_size, "%s_%s", prefix[prefix_i], suffix[suffix_i]);
|
2021-07-25 11:34:54 +00:00
|
|
|
// Set first symbol to upper case
|
|
|
|
name[0] = name[0] - 0x20;
|
|
|
|
}
|