This commit is contained in:
Михаил Капелько
2024-03-26 23:13:04 +03:00
부모 3fe88327ee
커밋 050eecea53
3개의 변경된 파일18개의 추가작업 그리고 5개의 파일을 삭제

파일 보기

@@ -1,6 +1,8 @@
#include <map>
#include <string>
// L4: Function.
std::map<int, int> memory_generateConstPlayfield(
int n
) {
@@ -15,6 +17,8 @@ std::map<int, int> memory_generateConstPlayfield(
return idGroups;
}
// L20: Test.
std::string test_memory_generateConstPlayfield() {
auto idGroups = memory_generateConstPlayfield(2);
if (
@@ -26,10 +30,11 @@ std::string test_memory_generateConstPlayfield() {
) {
return "OK: memory_generateConstPlayfield";
}
return "ERR: memory_generateConstPlayfield";
}
// L36: Run.
int main() {
printf("%s\n", test_memory_generateConstPlayfield().c_str());
}

파일 보기

@@ -1,6 +1,8 @@
// L4: Function.
function memory_generateConstPlayfield(
n
) {
@@ -12,10 +14,11 @@ function memory_generateConstPlayfield(
idGroups[id] = gid;
id += 1;
}
return idGroups;
}
// L20: Test.
function test_memory_generateConstPlayfield() {
let idGroups = memory_generateConstPlayfield(2)
if (
@@ -27,8 +30,9 @@ function test_memory_generateConstPlayfield() {
) {
return "OK: memory_generateConstPlayfield"
}
return "ERR: memory_generateConstPlayfield"
}
// L36: Run.
console.log(test_memory_generateConstPlayfield())

파일 보기

@@ -1,6 +1,8 @@
// L4: Function
func memory_generateConstPlayfield(
_ n: Int
) -> [Int: Int] {
@@ -12,10 +14,11 @@ func memory_generateConstPlayfield(
idGroups[id] = gid
id += 1
}
return idGroups
}
// L20: Test.
func test_memory_generateConstPlayfield() -> String {
let idGroups = memory_generateConstPlayfield(2)
if (
@@ -27,8 +30,9 @@ func test_memory_generateConstPlayfield() -> String {
) {
return "OK: memory_generateConstPlayfield"
}
return "ERR: memory_generateConstPlayfield"
}
// L36: Run.
print(test_memory_generateConstPlayfield())