Created a Gambling type Dice game in C. Its CLI based game with some colors not really interesting but it was fun creating it
stdlib
Unistd
stdio
random.h
structures.h
The random number function , although there is a builtin random function in C but it required some tweaking so i made it into a seperate function
#include<stdlib.h>
#include "random.h"
int _random(int max,int min){
//rand() % (max_number + 1 - minimum_number) + minimum_number
return rand() % (max + 1 - min) + min;
}
I also used some ANSI escape codes , REFERENCE
ESCAPE CHARACTER CODE | |
---|---|
RED | \x1b[38;5;196m |
GREEN | \x1b[38;5;46m |
BLUE | \x1b[38;5;33m |
DEFAULT | \x1b[1;39m |
clone the repo and run
make
to compile , the output shall be in output folder
To clean type:
make clean