Deze website werkt beter met JavaScript.
Beginscherm
Verkennen
Help
Inloggen
kornerr
/
research-portable-memory
Volgen
1
Ster
0
Vork
0
Code
Kwesties
0
Pull-aanvragen
0
Publicaties
0
Wiki
Activiteit
Bladeren bron
d
main
Михаил Капелько
9 maanden geleden
bovenliggende
222eafc18c
commit
a46fc88c13
6 gewijzigde bestanden
met
toevoegingen van 44
en
3 verwijderingen
Zij-aan-zij weergave
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
.gitignore
+5
-1
gen-C++
+12
-0
language-C++/Memory/src/Memory.Aux.cpp
+17
-0
language-C++/Memory/src/Memory.Test.cpp
+5
-0
language-C++/Memory/src/Memory.h
+4
-1
language-C++/src/test.cpp
+ 1
- 1
.gitignore
Bestand weergeven
@@ -1 +1 @@
mem
test_
mem
ory
+ 5
- 1
gen-C++
Bestand weergeven
@@ -1 +1,5 @@
c++ -o mem language-C++/src/test.cpp
c++ -o test_memory \
-Ilanguage-C++/Memory/src \
language-C++/Memory/src/Memory.Aux.cpp \
language-C++/Memory/src/Memory.Test.cpp \
language-C++/src/test.cpp
+ 12
- 0
language-C++/Memory/src/Memory.Aux.cpp
Bestand weergeven
@@ -0,0 +1,12 @@
#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;
}
+ 17
- 0
language-C++/Memory/src/Memory.Test.cpp
Bestand weergeven
@@ -0,0 +1,17 @@
#include <string>
#include "Memory.h"
std::string test_memory_generateConstPlayfield() {
std::map<int, int> idGroups = memory_generateConstPlayfield(2);
if (
idGroups.size() == 4 &&
idGroups[0] == 0 &&
idGroups[1] == 0 &&
idGroups[2] == 1 &&
idGroups[3] == 1
) {
return "OK: memory_generateConstPlayfield";
}
return "ERR: memory_generateConstPlayfield";
}
+ 5
- 0
language-C++/Memory/src/Memory.h
Bestand weergeven
@@ -0,0 +1,5 @@
#include <map>
#include <string>
std::map<int, int> memory_generateConstPlayfield(int n);
std::string test_memory_generateConstPlayfield();
+ 4
- 1
language-C++/src/test.cpp
Bestand weergeven
@@ -1,5 +1,8 @@
#include "Memory.h"
#include <iostream>
int main() {
std::cout << "Hello, world! C++" << std::endl;
std::cout
<< test_memory_generateConstPlayfield()
<< std::endl;
}
Schrijf
Voorbeeld
Laden…
Annuleren
Opslaan