randomSeed

This commit is contained in:
Dmitry Borisenko
2020-12-02 05:05:16 +03:00
parent 49f11841be
commit 7043855e3d
2 changed files with 6 additions and 3 deletions

View File

@@ -43,7 +43,7 @@
}, },
{ {
"type": "h4", "type": "h4",
"title": "Версия файловой системы: 267" "title": "Версия файловой системы: 268"
}, },
{ {
"type": "h4", "type": "h4",

View File

@@ -23,9 +23,12 @@ void itemsListInit() {
void addItem(String name) { void addItem(String name) {
String item = readFile("items/" + name + ".txt", 1024); String item = readFile("items/" + name + ".txt", 1024);
name = deleteToMarkerLast(name, "."); name = selectToMarker(name, "-");
item.replace("id", name + "-" + String(getNewElementNumber("id.txt"))); randomSeed(micros());
unsigned int num = random(0, 1000);
item.replace("id", name + String(num)); // "-" + String(getNewElementNumber("id.txt")));
item.replace("order", String(getNewElementNumber("order.txt"))); item.replace("order", String(getNewElementNumber("order.txt")));
if (item.indexOf("pin") != -1) { //all cases (random pins from available) if (item.indexOf("pin") != -1) { //all cases (random pins from available)