diff --git a/PrimeCPP/solution_2/run.cmd b/PrimeCPP/solution_2/run.cmd index aee24f625..f5191ffd1 100644 --- a/PrimeCPP/solution_2/run.cmd +++ b/PrimeCPP/solution_2/run.cmd @@ -1,9 +1,17 @@ +@echo off + IF "%1" == "" || "%1" == "1" || "%1" == "array" ( + ECHO Building and running the array approach... + ECHO( g++ -Ofast PrimeCPP_array.cpp -std=c++17 -lstdc++ -oPrimes_array.exe .\Primes_array.exe + ECHO( ) IF "%1" == "" || "%1" == "2" || "%1" == "mask" ( + ECHO Building and running the mask approach... + ECHO( g++ -Ofast PrimeCPP_mask.cpp -std=c++17 -lstdc++ -oPrimes_mask.exe .\Primes_mask.exe + ECHO( ) diff --git a/PrimeCPP/solution_2/run.sh b/PrimeCPP/solution_2/run.sh index 70f698fa5..3ecc9be9c 100755 --- a/PrimeCPP/solution_2/run.sh +++ b/PrimeCPP/solution_2/run.sh @@ -4,14 +4,16 @@ # gcc -Ofast -std=c++17 PrimeCPP.cpp -lc++ -oPrimes_gcc.exe # clang -Ofast -std=c++17 -lc++ PrimeCPP.cpp -oPrimes_clang.exe -if [[ "$#" -eq "0" -o "$1" -eq "1" -o "$1" -eq "array" ]]; then - echo "Building and running the array approach" +if [[ $# == 0 || $1 == 1 || $1 == array ]]; then + echo -e "Building and running the array approach...\n" clang++ -march=native -mtune=native -pthread -Ofast -std=c++17 PrimeCPP_array.cpp -oprimes_array.exe ./primes_array.exe + echo fi -if [[ "$#" -eq "0" -o "$1" -eq "2" -o "$1" -eq "mask" ]]; then - echo "Building and running the mask approach" +if [[ $# == 0 || $1 == 2 || $1 == mask ]]; then + echo -e "Building and running the mask approach...\n" clang++ -march=native -mtune=native -pthread -Ofast -std=c++17 PrimeCPP_mask.cpp -oprimes_mask.exe ./primes_mask.exe + echo fi