ALN  0.1.1
Amazing Lucky Numbers Library

Introduction

The Amazing Lucky Numbers (ALN) Library provides a set of functions to generate and manage lucky numbers. It offers an easy-to-use API to create, draw, and retrieve lucky numbers, ensuring flexibility and customization for various lucky number generation needs.

Features

  • Generate a specified number of lucky numbers within a given range.
  • Option to allow or disallow repeated numbers.
  • Draw numbers individually or all at once.
  • Retrieve specific numbers by their index.
  • Reset the generator to draw numbers again.

Usage

Below is a simple example demonstrating how to use the ALN library.

#include "aln.h"
#include <stdio.h>
int main() {
ALN *aln = aln_new(6, 1, 46, 0);
if (!aln) {
fprintf(stderr, "Failed to create ALN instance\n");
return 1;
}
if (aln_draw_all(aln) != 0) {
fprintf(stderr, "Failed to draw all numbers\n");
aln_free(aln);
return 1;
}
for (unsigned int i = 0; i < 6; i++) {
printf("Number %u: %u\n", i + 1, aln_get_number(aln, i));
}
aln_free(aln);
return 0;
}
Amazing Lucky Numbers Library API.
ALN_API int aln_draw_all(ALN *aln)
Draws all remaining lucky numbers.
Definition: aln.c:124
ALN_API unsigned int aln_get_number(const ALN *aln, unsigned int index)
Gets a specific lucky number by index.
Definition: aln.c:138
ALN_API ALN * aln_new(unsigned int count, unsigned int min, unsigned int max, int allow_repeat)
Creates a new ALN instance.
Definition: aln.c:18
ALN_API void aln_free(ALN *aln)
Frees an ALN instance.
Definition: aln.c:61
Definition: aln.c:7

Installation

To use the ALN library, include the aln.h header file in your project and link against the ALN library.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Authors