|
|
@@ -1,22 +1,14 @@ |
|
|
|
#include <map> |
|
|
|
#include "Memory.h" |
|
|
|
|
|
|
|
|
|
|
|
std::map<int, int> memory_generateConstPlayfield( |
|
|
|
int n |
|
|
|
) { |
|
|
|
std::map<int, int> idGroups; |
|
|
|
int id = 0; |
|
|
|
for (int gid = 0; gid < n; ++gid) { |
|
|
|
idGroups[id++] = gid; |
|
|
|
idGroups[id++] = gid; |
|
|
|
} |
|
|
|
return idGroups; |
|
|
|
} |
|
|
|
|
|
|
|
func memory_generateConstPlayfield( |
|
|
|
n: Int |
|
|
|
_ n: Int |
|
|
|
) -> [Int: Int] { |
|
|
|
var idGroups = [Int: Int]() |
|
|
|
var id = 0 |
|
|
|
for gid in stride(from: 0, to: n, by: 1) { |
|
|
|
idGroups[id] = gid |
|
|
|
id += 1 |
|
|
|
idGroups[id] = gid |
|
|
|
id += 1 |
|
|
|
} |
|
|
|
|
|
|
|
return idGroups |
|
|
|
} |