Compare commits

...

4 commits

Author SHA1 Message Date
lily
826cda95f0
Update .gitignore
Some checks failed
Create Release on Push / build_and_release_linux (push) Has been cancelled
Create Release on Push / build_and_upload_windows (push) Has been cancelled
2026-01-30 05:06:47 +11:00
lily
e756cede3a
Fix input validation for time
Some checks failed
Create Release on Push / build_and_release_linux (push) Has been cancelled
Create Release on Push / build_and_upload_windows (push) Has been cancelled
2026-01-28 19:50:55 +11:00
lily
34169274f4
Fix capitalization
Some checks failed
Create Release on Push / build_and_release_linux (push) Has been cancelled
Create Release on Push / build_and_upload_windows (push) Has been cancelled
2026-01-06 22:09:32 +11:00
lily
a01f7a6699 Add static linking for github releases 2025-12-14 09:17:13 +11:00
4 changed files with 13 additions and 6 deletions

View file

@ -19,7 +19,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y build-essential run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Build project for Linux - name: Build project for Linux
run: make all run: LDFLAGS="-static" make all
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
- name: Upload Linux artifact - name: Upload Linux artifact

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
src/agg src/agg
bin bin
obj obj
AGENTS.md

View file

@ -1,6 +1,8 @@
# Compiler and flags # Compiler and flags
CC = gcc CC = gcc
CFLAGS = -Wall -Wextra -std=c99 -pedantic -O3 -flto EXTRA_CFLAGS ?=
CFLAGS ?= -Wall -Wextra -std=c99 -pedantic -O3 -flto $(EXTRA_CFLAGS)
LDFLAGS ?=
DEBUG_FLAGS = -g -DDEBUG DEBUG_FLAGS = -g -DDEBUG
# Directories # Directories
@ -29,7 +31,7 @@ $(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR)
# Link executable # Link executable
$(TARGET): $(OBJECTS) | $(BINDIR) $(TARGET): $(OBJECTS) | $(BINDIR)
$(CC) $(OBJECTS) -o $@ $(CC) $(LDFLAGS) $(OBJECTS) -o $@
# Debug build # Debug build
debug: CFLAGS += $(DEBUG_FLAGS) debug: CFLAGS += $(DEBUG_FLAGS)

View file

@ -85,6 +85,10 @@ int main(void) {
int playtime; int playtime;
printf ("\nHow long would you like to play for? Answer in seconds.\n"); printf ("\nHow long would you like to play for? Answer in seconds.\n");
scanf ("%d", &playtime); scanf ("%d", &playtime);
if (playtime < 1) {
printf ("Error! You must select at least one second.\n");
exit(1);
}
int number_length; int number_length;
printf ("Please enter maximum possible number\n"); printf ("Please enter maximum possible number\n");
@ -152,12 +156,12 @@ int main(void) {
if (score >= 1) { if (score >= 1) {
printf ("Great job, %s!\n", username); printf ("Great job, %s!\n", username);
} else { } else {
printf ("try again!, %s.\n", username); printf ("Try again!, %s.\n", username);
} }
if (accuracytype == 1) { if (accuracytype == 1) {
printf ("you got an accuracy of %d%%!\n", (int)accuracy); printf ("You got an accuracy of %d%%!\n", (int)accuracy);
} else { } else {
printf ("you got an accuracy of %g%%!\n", accuracy); printf ("You got an accuracy of %g%%!\n", accuracy);
} }
return 0; return 0;