Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pyramid example #74

Merged
merged 3 commits into from
Aug 14, 2024
Merged

Add pyramid example #74

merged 3 commits into from
Aug 14, 2024

Conversation

rozukke
Copy link
Owner

@rozukke rozukke commented Aug 14, 2024

Demonstrates basic functionality as well as some available convenience features.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Click here for the full clang-format patch
diff --git a/example/pyramid.cpp b/example/pyramid.cpp
index 80404ca..ec6dff4 100644
--- a/example/pyramid.cpp
+++ b/example/pyramid.cpp
@@ -0,0 +1 @@
+#include <algorithm>
@@ -4 +4,0 @@
-#include <algorithm>
@@ -7 +7 @@
-mcpp::Coordinate ORIGIN {0, 0, 0};
+mcpp::Coordinate ORIGIN{0, 0, 0};
@@ -15,5 +15,2 @@ void make_ring(mcpp::Coordinate base_pt, int side_len) {
-    mc.setBlocks(
-        base_pt, 
-        base_pt + mcpp::Coordinate(side_len, 0, side_len), 
-        mcpp::Blocks::SANDSTONE
-    );
+    mc.setBlocks(base_pt, base_pt + mcpp::Coordinate(side_len, 0, side_len),
+                 mcpp::Blocks::SANDSTONE);
@@ -23,5 +20,3 @@ void make_ring(mcpp::Coordinate base_pt, int side_len) {
-    mc.setBlocks(
-        base_pt, 
-        base_pt + mcpp::Coordinate(side_len - 2, 0, side_len - 2), 
-        mcpp::Blocks::AIR
-    );
+    mc.setBlocks(base_pt,
+                 base_pt + mcpp::Coordinate(side_len - 2, 0, side_len - 2),
+                 mcpp::Blocks::AIR);
@@ -34,4 +29,3 @@ int main() {
-    mcpp::HeightMap heights = mc.getHeights(
-        ORIGIN, 
-        ORIGIN + mcpp::Coordinate(pyramid_base_len, 0, pyramid_base_len)
-    );
+    mcpp::HeightMap heights =
+        mc.getHeights(ORIGIN, ORIGIN + mcpp::Coordinate(pyramid_base_len, 0,
+                                                        pyramid_base_len));
@@ -40,4 +34 @@ int main() {
-    int min_height = *std::min_element(
-        heights.begin(), 
-        heights.end()
-    );
+    int min_height = *std::min_element(heights.begin(), heights.end());
@@ -49 +40 @@ int main() {
-    for(int i = 0; i < PYRAMID_HEIGHT; i++) {
+    for (int i = 0; i < PYRAMID_HEIGHT; i++) {
@@ -51 +42 @@ int main() {
-    } 
+    }

Have any feedback or feature suggestions? Share it here.

example/pyramid.cpp Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
example/pyramid.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot dismissed their stale review August 14, 2024 07:48

outdated suggestion

@rozukke rozukke merged commit d93363e into main Aug 14, 2024
2 checks passed
@rozukke rozukke deleted the add/first-example branch August 29, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant