diff options
author | zedarider <ymherklotz@gmail.com> | 2016-02-26 20:54:51 +0000 |
---|---|---|
committer | zedarider <ymherklotz@gmail.com> | 2016-02-26 20:54:51 +0000 |
commit | 9ac6921e341825dde06a674344dbbe2545dd6194 (patch) | |
tree | 3808133734c7721fec7352c8ba768e19fbf70fd2 | |
parent | a7ad35b0eee5cbc851d3438bf2d488ded2ca87bf (diff) | |
download | imperial_2015-9ac6921e341825dde06a674344dbbe2545dd6194.tar.gz imperial_2015-9ac6921e341825dde06a674344dbbe2545dd6194.zip |
Started recursion
-rw-r--r-- | 2048 Game/Game.cpp | 1 | ||||
-rw-r--r-- | Recursion.cpp | 41 |
2 files changed, 41 insertions, 1 deletions
diff --git a/2048 Game/Game.cpp b/2048 Game/Game.cpp index f2ddf44..e440290 100644 --- a/2048 Game/Game.cpp +++ b/2048 Game/Game.cpp @@ -75,7 +75,6 @@ int main(int argc, char* argv[]) { grid[GRIDSIZE-1][GRIDSIZE-1] = BASE; } printGrid(grid); - /* * executes this loop while the game isn't over, which means that the user can * still have turns and there are zero's left, as well as adjacent equivalent diff --git a/Recursion.cpp b/Recursion.cpp new file mode 100644 index 0000000..21742ca --- /dev/null +++ b/Recursion.cpp @@ -0,0 +1,41 @@ +#include <iostream> + +using namespace std; + +typedef int list_t; + +struct linkNode { + list_t element; + linkNode* next; +}; + +void addElement(linkNode*&, list_t&); +void addElementReverse(linkNode*&, list_t&); + +int main() { + linkNode* firstList = NULL; + linkNode* secondList = NULL; + + int n; + list_t el; + cout << "Number of elements in list: "; + cin >> n; + for(int i = 0; i < n; ++i) { + + } +} + +void addElement(linkNode* &hdList, list_t &el) { + linkNode* newNode = new linkNode; + newNode->element = el; + newNode->next = hdList; + hdList = newNode; +} + +void addElementReverse(linkNode* &hdList, list_t &el) { + if(hdList == NULL) { + + } else { + + } +} |