Skip to content

Commit

Permalink
Fix CMD script
Browse files Browse the repository at this point in the history
  • Loading branch information
rbergen committed Nov 8, 2024
1 parent 558b2b0 commit 99304e6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions PrimeCPP/solution_2/run.cmd
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
@echo off
@ECHO OFF

IF "%1" == "" || "%1" == "1" || "%1" == "array" (
SET "_RUN_ARRAY=0"
IF [%1] == [] SET "_RUN_ARRAY=1"
IF [%1] == [1] SET "_RUN_ARRAY=1"
IF [%1] == [array] SET "_RUN_ARRAY=1"
IF %_RUN_ARRAY% == 1 (
ECHO Building and running the array approach...
ECHO(
ECHO:
g++ -Ofast PrimeCPP_array.cpp -std=c++17 -lstdc++ -oPrimes_array.exe
.\Primes_array.exe
ECHO(
ECHO:
)
SET _RUN_ARRAY=

IF "%1" == "" || "%1" == "2" || "%1" == "mask" (
SET "_RUN_MASK=0"
IF [%1] == [] SET "_RUN_MASK=1"
IF [%1] == [2] SET "_RUN_MASK=1"
IF [%1] == [mask] SET "_RUN_MASK=1"
IF %_RUN_MASK% == 1 (
ECHO Building and running the mask approach...
ECHO(
ECHO:
g++ -Ofast PrimeCPP_mask.cpp -std=c++17 -lstdc++ -oPrimes_mask.exe
.\Primes_mask.exe
ECHO(
ECHO:
)
SET _RUN_MASK=

0 comments on commit 99304e6

Please sign in to comment.