choiceMaker.h is a lightweight C library to navigate and select items directly from the terminal.
Simply put choiceMaker.h in your includes folder.
Yeah it's simple like that
You can download with that :
curl -O https://raw.githubusercontent.com/wirenux/choiceMaker.h/refs/heads/main/choiceMaker.h or
wget https://raw.githubusercontent.com/wirenux/choiceMaker.h/refs/heads/main/choiceMaker.hTo use choiceMaker.h in a C file you need to adds:
#include "../includes/choiceMaker.h" // Adjust path if necessaryThen you can call choice_from_array() to launch the menu:
const char *options[] = {"Option 1", "Option 2", "Option 3"};
const char *choice = choice_from_array("Select an option:", options, 3);
printf("You selected: %s\n", choice);#include <stdio.h>
#include "choiceMaker.h"
int main(void) {
const char *options[] = {"Apple", "Banana", "Cherry"};
const char *choice = choice_from_array("Select a fruit:", options, 3);
printf("You selected: %s\n", choice);
return 0;
}- Works in terminal using arrow keys to navigate and Enter to select.
- Only supports Unix-like systems (Linux/macOS) because of
termiosandunistd.h.
- Standard C –
stdio.h,stdlib.h,string.h - POSIX / Terminal –
unistd.h,termios.h
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.