From 6fa03968ba3b9e40d58888ac5bf7d5bb27ba7bbe Mon Sep 17 00:00:00 2001 From: Michael Beebower Date: Fri, 30 Aug 2019 12:24:24 -0500 Subject: [PATCH 1/5] Update mainGOL.cpp Corrected syntax errors. Made use of vectors to solve this issue so that the size doesn't have to be hard-coded into the array initialization. --- mainGOL.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/mainGOL.cpp b/mainGOL.cpp index 9fa5f20..cf1b564 100644 --- a/mainGOL.cpp +++ b/mainGOL.cpp @@ -1,27 +1,31 @@ // C++ Program to print the elements of a // Two-Dimensional array -#include +#include +#include using namespace std; -void printFunction(int ) - int main() { - L = 20 - W = 20 // an array with 3 rows and 2 columns. - int x[W][L]; + vector> x = {{0, 1}, // if you don't use vectors, then the dimensions have to be hard-coded. + {2, 3}, + {4, 5}}; + int temp_row = 0; // output each array element's value - for (int i = 0; i < W; i++) + for (auto & row : x) { - for (int j = 0; j < L; j++) + int temp_col = 0; + for (int & col : row) { - cout << "Element at x[" << i - << "][" << j << "]: "; - cout << x[i][j]< Date: Fri, 30 Aug 2019 12:25:38 -0500 Subject: [PATCH 2/5] Update mainGOL.cpp --- mainGOL.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/mainGOL.cpp b/mainGOL.cpp index cf1b564..a018894 100644 --- a/mainGOL.cpp +++ b/mainGOL.cpp @@ -28,4 +28,3 @@ int main() return 0; } -d From b6a6a3f279117c8fa3b912ae6ad4bb0a58a21092 Mon Sep 17 00:00:00 2001 From: Michael Beebower Date: Fri, 30 Aug 2019 12:30:02 -0500 Subject: [PATCH 3/5] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index f569151..60f6da5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ # Game-Of-Life Group project for CSSO + +

This C++ program iterates through a 2-dimensional array and displays the value at each element.

+ +Element at x[0][0]: 0
+Element at x[0][1]: 1
+Element at x[1][0]: 2
+Element at x[1][1]: 3
+Element at x[2][0]: 4
+Element at x[2][1]: 5
From 4b373d02d8d3d2bc94ed2c9a819d1005a59bd3d1 Mon Sep 17 00:00:00 2001 From: Michael Beebower <3438663+beebus@users.noreply.github.com> Date: Thu, 11 Nov 2021 09:39:38 -0600 Subject: [PATCH 4/5] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..06985f4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Michael Beebower + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From e780bd974cd9efacc49f98d9f05d0ce8a7b6aadd Mon Sep 17 00:00:00 2001 From: Michael Beebower <3438663+beebus@users.noreply.github.com> Date: Thu, 11 Nov 2021 09:43:47 -0600 Subject: [PATCH 5/5] Create .gitignore --- .gitignore | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..259148f --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app