Skip to content

Commit

Permalink
Replace exercise with simpler one
Browse files Browse the repository at this point in the history
  • Loading branch information
magaupp committed Sep 9, 2024
1 parent 68b8659 commit bb1151a
Show file tree
Hide file tree
Showing 29 changed files with 316 additions and 1,081 deletions.
8 changes: 3 additions & 5 deletions src/main/resources/templates/aeolus/c_plus_plus/default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ setup_the_build_environment () {
# Setup the build environment
# ------------------------------

# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R
# Updating ownership...
sudo chown -R artemis_user:artemis_user .

mkdir test-reports
chown artemis_user:artemis_user test-reports/ -R

# assignment
REQ_FILE=requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r requirements.txt || true
Expand All @@ -32,7 +31,6 @@ build_and_run_all_tests () {
# Task Description:
# Build and run all tests
# ------------------------------
sudo chown artemis_user:artemis_user .
python3 Tests.py || true
}

Expand Down
8 changes: 3 additions & 5 deletions src/main/resources/templates/aeolus/c_plus_plus/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ actions:
# Setup the build environment
# ------------------------------
# Updating assignment and test-reports ownership...
sudo chown artemis_user:artemis_user assignment/ -R
# Updating ownership...
sudo chown -R artemis_user:artemis_user .
mkdir test-reports
chown artemis_user:artemis_user test-reports/ -R
# assignment
REQ_FILE=requirements.txt
if [ -f "$REQ_FILE" ]; then
pip3 install --user -r requirements.txt || true
Expand All @@ -34,7 +33,6 @@ actions:
# Task Description:
# Build and run all tests
# ------------------------------
sudo chown artemis_user:artemis_user .
python3 Tests.py || true
runAlways: false
results:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
Language: Cpp
Language: Cpp
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 120
PointerAlignment: Left
DerivePointerAlignment: false
DerivePointerAlignment: false
IncludeBlocks: Preserve
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ project(ArtemisExercise)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_library(assignment INTERFACE)
target_include_directories(assignment INTERFACE include)
add_library(assignment src/sort.cpp)
target_include_directories(assignment PUBLIC include)

add_executable(assignment_main src/main.cpp)
target_link_libraries(assignment_main assignment)

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 19 additions & 0 deletions src/main/resources/templates/c_plus_plus/exercise/include/sort.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <vector>

void selection_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end);

void insertion_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end);

void quicksort(std::vector<int>::iterator begin, std::vector<int>::iterator end);

void mergesort(std::vector<int>::iterator begin, std::vector<int>::iterator end);

void mergesort_inplace(std::vector<int>::iterator begin, std::vector<int>::iterator end);

void heapsort(std::vector<int>::iterator begin, std::vector<int>::iterator end);

void heapsort_explicit(std::vector<int>::iterator begin, std::vector<int>::iterator end);

void bogosort(std::vector<int>::iterator begin, std::vector<int>::iterator end);
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "sort.hpp"

int main() {
// Test your implementation here
}
35 changes: 35 additions & 0 deletions src/main/resources/templates/c_plus_plus/exercise/src/sort.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "sort.hpp"

#include <stdexcept>

void selection_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}

void insertion_sort(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}

void quicksort(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}

void mergesort(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}

void mergesort_inplace(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}

void heapsort(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}

void heapsort_explicit(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}

void bogosort(std::vector<int>::iterator begin, std::vector<int>::iterator end) {
throw std::logic_error("not implemented");
}
28 changes: 13 additions & 15 deletions src/main/resources/templates/c_plus_plus/readme
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
[task][CMake runs correctly](TestConfigure)
1. [task][CMake runs correctly](TestConfigure)
2. [task][Your code compiles](CompileSort)
3. [task][Code is formatted with clang-format](clang-format(sort.cpp))

# Templated doubly linked list
1. [task][Your code compiles](CompileLinkedList)
2. [task][Tests are passing](TestCatch2(linked-list-iterator-test))
3. [task][Code is formatted with clang-format](clang-format(linked-list-iterator.hpp))

# AST with polymorphism
1. [task][Your code compiles](CompileASTPolymorphic)
2. [task][Tests are passing](TestCatch2(ast-polymorphic-test))
3. [task][Code is formatted with clang-format](clang-format(ast-polymorphic.hpp))

# AST with templates
1. [task][Your code compiles](CompileASTTemplate)
2. [task][Tests are passing](TestCatch2(ast-template-test))
3. [task][Code is formatted with clang-format](clang-format(ast-template.hpp))
4. Optional: [task][Tests for simplify are passing](TestCatch2(ast-template-simplify-test))
# Sorting Algorithms
[task][All algorithms sort correctly](TestCatch2(sort-test))
1. [task][Selection Sort](sorting_algorithms/selection_sort,sorting_algorithms/all_elements_equal/selection_sort,sorting_algorithms/reverse-sorted_values/selection_sort,sorting_algorithms/single_values/selection_sort,sorting_algorithms/empty_input/selection_sort,sorting_algorithms/large_input/selection_sort)
2. [task][Insertion Sort](sorting_algorithms/insertion_sort,sorting_algorithms/all_elements_equal/insertion_sort,sorting_algorithms/reverse-sorted_values/insertion_sort,sorting_algorithms/single_values/insertion_sort,sorting_algorithms/empty_input/insertion_sort,sorting_algorithms/large_input/insertion_sort)
3. [task][Quicksort](sorting_algorithms/quicksort,sorting_algorithms/all_elements_equal/quicksort,sorting_algorithms/reverse-sorted_values/quicksort,sorting_algorithms/single_values/quicksort,sorting_algorithms/empty_input/quicksort,sorting_algorithms/large_input/quicksort)
4. [task][Mergesort](sorting_algorithms/mergesort,sorting_algorithms/all_elements_equal/mergesort,sorting_algorithms/reverse-sorted_values/mergesort,sorting_algorithms/single_values/mergesort,sorting_algorithms/empty_input/mergesort,sorting_algorithms/large_input/mergesort)
5. [task][Mergesort Inplace](sorting_algorithms/mergesort_inplace,sorting_algorithms/all_elements_equal/mergesort_inplace,sorting_algorithms/reverse-sorted_values/mergesort_inplace,sorting_algorithms/single_values/mergesort_inplace,sorting_algorithms/empty_input/mergesort_inplace,sorting_algorithms/large_input/mergesort_inplace)
6. [task][Heapsort](sorting_algorithms/heapsort,sorting_algorithms/all_elements_equal/heapsort,sorting_algorithms/reverse-sorted_values/heapsort,sorting_algorithms/single_values/heapsort,sorting_algorithms/empty_input/heapsort,sorting_algorithms/large_input/heapsort)
7. [task][Explicit Heapsort](sorting_algorithms/heapsort_explicit,sorting_algorithms/all_elements_equal/heapsort_explicit,sorting_algorithms/reverse-sorted_values/heapsort_explicit,sorting_algorithms/single_values/heapsort_explicit,sorting_algorithms/empty_input/heapsort_explicit,sorting_algorithms/large_input/heapsort_explicit)
8. [task][Bogosort](bogosort,bogosort/empty_input,bogosort/single_value)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
Language: Cpp
Language: Cpp
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 120
PointerAlignment: Left
DerivePointerAlignment: false
DerivePointerAlignment: false
IncludeBlocks: Preserve
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ project(ArtemisExercise)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_library(assignment INTERFACE)
target_include_directories(assignment INTERFACE include)
add_library(assignment src/sort.cpp)
target_include_directories(assignment PUBLIC include)

add_executable(assignment_main src/main.cpp)
target_link_libraries(assignment_main assignment)
Loading

0 comments on commit bb1151a

Please sign in to comment.