forked from Bananymous/banan-os
aoc2024: prepare programming environment
This commit is contained in:
9
userspace/aoc2024/full/CMakeLists.txt
Normal file
9
userspace/aoc2024/full/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_executable(aoc2024_full ${SOURCES})
|
||||
banan_include_headers(aoc2024_full ban)
|
||||
banan_link_library(aoc2024_full libc)
|
||||
|
||||
install(TARGETS aoc2024_full OPTIONAL)
|
||||
22
userspace/aoc2024/full/main.cpp
Normal file
22
userspace/aoc2024/full/main.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
for (int i = 1; i <= 25; i++)
|
||||
{
|
||||
char command[128];
|
||||
sprintf(command, "/bin/aoc2024/day%d", i);
|
||||
|
||||
struct stat st;
|
||||
if (stat(command, &st) == -1)
|
||||
continue;
|
||||
|
||||
printf("day%d\n", i);
|
||||
|
||||
system(command);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user