From e454564d9a8c80bf57dc37583e7b33b09c4ff6bd Mon Sep 17 00:00:00 2001 From: Artemis Rosman <73006620+rozukke@users.noreply.github.com> Date: Mon, 9 Sep 2024 02:24:42 +1000 Subject: [PATCH 1/4] Automatically build examples --- CMakeLists.txt | 8 +++++++- example/hello_minecraft.cpp | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 example/hello_minecraft.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bc6115c..cb4aa800 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,8 +45,14 @@ install(TARGETS ${PROJECT_NAME} PUBLIC_HEADER DESTINATION include/${PROJECT_NAME} ) +# Build examples +add_executable(pyramid example/pyramid.cpp) +target_link_libraries(pyramid ${PROJECT_NAME}) +add_executable(hello_minecraft example/hello_minecraft.cpp) +target_link_libraries(hello_minecraft ${PROJECT_NAME}) + # CPack setup SET(CPACK_GENERATOR "DEB") SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "rozukke") -INCLUDE(CPack) \ No newline at end of file +INCLUDE(CPack) diff --git a/example/hello_minecraft.cpp b/example/hello_minecraft.cpp new file mode 100644 index 00000000..4ea01138 --- /dev/null +++ b/example/hello_minecraft.cpp @@ -0,0 +1,8 @@ +#include + +using namespace mcpp; + +int main() { + MinecraftConnection mc; + mc.postToChat("Hello, Minecraft!"); +} From fbc9b825be13c75dd1ae2d3f39f715b97fadb7e7 Mon Sep 17 00:00:00 2001 From: nhatdongdang <144138246+nhatdongdang@users.noreply.github.com> Date: Mon, 9 Sep 2024 23:36:06 +1000 Subject: [PATCH 2/4] test --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40db0105..0a4d14d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,13 +50,13 @@ install(TARGETS ${PROJECT_NAME} ) # Build examples -add_executable(pyramid example/pyramid.cpp) +add_executable(pyramid EXCLUDE_FROM_ALL example/pyramid.cpp) target_link_libraries(pyramid ${PROJECT_NAME}) -add_executable(hello_minecraft example/hello_minecraft.cpp) +d_executable(hello_minecraft EXCLUDE_FROM_ALL example/hello_minecraft.cpp) target_link_libraries(hello_minecraft ${PROJECT_NAME}) # CPack setup SET(CPACK_GENERATOR "DEB") SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "rozukke") -INCLUDE(CPack) +INCLUDE(CPack) \ No newline at end of file From cf58c0efab4ac20e8e803b7185fefaa290a2f3e7 Mon Sep 17 00:00:00 2001 From: nhatdongdang <144138246+nhatdongdang@users.noreply.github.com> Date: Mon, 9 Sep 2024 23:39:12 +1000 Subject: [PATCH 3/4] Fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a4d14d8..e2d44c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ install(TARGETS ${PROJECT_NAME} # Build examples add_executable(pyramid EXCLUDE_FROM_ALL example/pyramid.cpp) target_link_libraries(pyramid ${PROJECT_NAME}) -d_executable(hello_minecraft EXCLUDE_FROM_ALL example/hello_minecraft.cpp) +add_executable(hello_minecraft EXCLUDE_FROM_ALL example/hello_minecraft.cpp) target_link_libraries(hello_minecraft ${PROJECT_NAME}) # CPack setup From c668271c117a3aea1161e229bc49091df79460e5 Mon Sep 17 00:00:00 2001 From: nhatdongdang <144138246+nhatdongdang@users.noreply.github.com> Date: Mon, 9 Sep 2024 23:39:27 +1000 Subject: [PATCH 4/4] dfs --- example/pyramid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/pyramid.cpp b/example/pyramid.cpp index ec6dff47..4c608592 100644 --- a/example/pyramid.cpp +++ b/example/pyramid.cpp @@ -33,7 +33,7 @@ int main() { // Use minimum height of the area as the lowest point on the pyramid int min_height = *std::min_element(heights.begin(), heights.end()); - // Build rings, diminishing up to pyramid height + // Build rngs, diminishing up to pyramid height mcpp::Coordinate base_pt = heights.base_pt(); base_pt.y = min_height; int side_len = pyramid_base_len;