Compare commits

..

No commits in common. "4f987d69c0e9e943f89e1ca9361843425ce6036a" and "9a1473a45565c78fe530ef3041d125963425f9ee" have entirely different histories.

10 changed files with 132 additions and 175 deletions

1
.gitignore vendored
View file

@ -1,2 +1 @@
/a.out /a.out
/pride-c

119
basic.c
View file

@ -2,94 +2,79 @@
#include <stdio.h> #include <stdio.h>
#include "draw.h"
void rainbow_8() { void rainbow_8() {
color colors [] = { printf(
RED, RED STRIPE
L_RED, L_RED STRIPE
L_YELLOW, L_YELLOW STRIPE
GREEN, GREEN STRIPE
BLUE, BLUE STRIPE
MAGENTA MAGENTA STRIPE
}; );
draw(6, colors);
} }
void aroace_8() { void aroace_8() {
color colors [] = { printf(
YELLOW, YELLOW STRIPE
L_YELLOW, L_YELLOW STRIPE
WHITE, WHITE STRIPE
L_CYAN, L_CYAN STRIPE
BLUE BLUE STRIPE
}; );
draw(5, colors);
} }
void bisexual_8() { void bisexual_8() {
color colors [] = { printf(
RED, RED STRIPE STRIPE
RED, MAGENTA STRIPE
MAGENTA, BLUE STRIPE STRIPE
BLUE, );
BLUE
};
draw(5, colors);
} }
void gay_8() { void gay_8() {
color colors [] = { printf(
CYAN, CYAN STRIPE
L_CYAN, L_CYAN STRIPE
WHITE, WHITE STRIPE
L_BLUE, L_BLUE STRIPE
BLUE BLUE STRIPE
}; );
draw(5, colors);
} }
void lesbian_8() { void lesbian_8() {
color colors [] = { printf(
RED, RED STRIPE
L_RED, L_RED STRIPE
WHITE, WHITE STRIPE
L_MAGENTA, L_MAGENTA STRIPE
MAGENTA MAGENTA STRIPE
}; );
draw(5, colors);
} }
void nonbinary_8() { void nonbinary_8() {
color colors [] = { printf(
L_YELLOW, L_YELLOW STRIPE
WHITE, WHITE STRIPE
MAGENTA, MAGENTA STRIPE
BLACK BLACK STRIPE
}; );
draw(4, colors);
} }
void pansexual_8() { void pansexual_8() {
color colors [] = { printf(
MAGENTA, MAGENTA STRIPE STRIPE
MAGENTA, L_YELLOW STRIPE STRIPE
L_YELLOW, CYAN STRIPE STRIPE
L_YELLOW, );
CYAN,
CYAN
};
draw(6, colors);
} }
void transgender_8() { void transgender_8() {
color colors [] = { printf(
L_CYAN, L_CYAN STRIPE
L_MAGENTA, L_MAGENTA STRIPE
WHITE, WHITE STRIPE
L_MAGENTA, L_MAGENTA STRIPE
L_CYAN L_CYAN STRIPE
}; );
draw(5, colors);
} }

34
basic.h
View file

@ -1,21 +1,23 @@
#pragma once #pragma once
#define BLACK 0 #include "color.h"
#define RED 1
#define GREEN 2 #define BLACK COLOR(0)
#define YELLOW 3 #define RED COLOR(1)
#define BLUE 4 #define GREEN COLOR(2)
#define MAGENTA 5 #define YELLOW COLOR(3)
#define CYAN 6 #define BLUE COLOR(4)
#define GRAY 7 #define MAGENTA COLOR(5)
#define L_BLACK 8 #define CYAN COLOR(6)
#define L_RED 9 #define GRAY COLOR(7)
#define L_GREEN 10 #define L_BLACK COLOR(8)
#define L_YELLOW 11 #define L_RED COLOR(9)
#define L_BLUE 12 #define L_GREEN COLOR(10)
#define L_MAGENTA 13 #define L_YELLOW COLOR(11)
#define L_CYAN 14 #define L_BLUE COLOR(12)
#define WHITE 15 #define L_MAGENTA COLOR(13)
#define L_CYAN COLOR(14)
#define WHITE COLOR(15)
void rainbow_8(); void rainbow_8();
void aroace_8(); void aroace_8();

5
color.h Normal file
View file

@ -0,0 +1,5 @@
#pragma once
#define COLOR(n) "\x1b[38;5;" #n "m"
#define STRIPE "██████████████████\n"

10
draw.c
View file

@ -1,10 +0,0 @@
#include "draw.h"
#include <stdio.h>
void draw(unsigned short int len, color colors []) {
for(int i = 0; i < len; i++) {
printf(ANSI "%dm" STRIPE, colors[i]);
}
}

10
draw.h
View file

@ -1,10 +0,0 @@
#pragma once
#define ANSI "\x1b[38;5;"
#define COLOR(n) ANSI #n "m"
#define STRIPE "██████████████████\n"
typedef unsigned short int color;
void draw(unsigned short int len, color colors[]);

120
full.c
View file

@ -2,93 +2,83 @@
#include <stdio.h> #include <stdio.h>
#include "draw.h" #include "color.h"
void rainbow_256() { void rainbow_256() {
color colors [] = { printf(
196, // red COLOR(196) STRIPE // red
208, // orange COLOR(208) STRIPE // orange
220, // yellow COLOR(220) STRIPE // yellow
28, // green COLOR(28) STRIPE // green
21, // blue COLOR(21) STRIPE // blue
90 // purple COLOR(90) STRIPE // purple
}; );
draw(6, colors);
} }
void aroace_256() { void aroace_256() {
color colors [] = { printf(
172, // orange COLOR(172) STRIPE
184, // yellow COLOR(184) STRIPE
255, // white COLOR(255) STRIPE
38, // blue COLOR(38) STRIPE
17 // navy COLOR(17) STRIPE
}; );
draw(5, colors);
} }
void bisexual_256() { void bisexual_256() {
color colors [] = { printf(
161, // magenta COLOR(161) STRIPE STRIPE
161, COLOR(91) STRIPE
91, // purple COLOR(21) STRIPE STRIPE
21, );
21 // blue
};
draw(5, colors);
} }
void gay_256() { void gay_256() {
color colors [] = { printf(
29, COLOR(29) STRIPE
49, // greens COLOR(49) STRIPE
123, COLOR(123) STRIPE
255, // white COLOR(255) STRIPE
75, COLOR(75) STRIPE
63, // blues COLOR(63) STRIPE
56 COLOR(56) STRIPE
}; );
draw(7, colors);
} }
void lesbian_256() { void lesbian_256() {
color colors [] = { printf(
202, // orange COLOR(202) STRIPE
209, // tangerine COLOR(209) STRIPE
255, // white COLOR(255) STRIPE
134, // pink COLOR(134) STRIPE
161 // magenta COLOR(161) STRIPE
}; );
draw(5, colors);
} }
void nonbinary_256() { void nonbinary_256() {
color colors [] = { printf(
226, // yellow COLOR(226) STRIPE
255, // white COLOR(255) STRIPE
134, // purple COLOR(134) STRIPE
16 // black COLOR(16) STRIPE
}; );
draw(4, colors);
} }
void pansexual_256() { void pansexual_256() {
color colors [] = { printf(
161, 161, // magenta COLOR(161) STRIPE STRIPE
220, 220, // yellow COLOR(220) STRIPE STRIPE
45, 45 // cyan COLOR(45) STRIPE STRIPE
}; );
draw(6, colors);
} }
void transgender_256() { void transgender_256() {
color colors [] = { printf(
45, // blue COLOR(45) STRIPE
213, // pink COLOR(213) STRIPE
255, // white COLOR(255) STRIPE
213, // pink COLOR(213) STRIPE
45 // blue COLOR(45) STRIPE
}; );
draw(5, colors);
} }

2
full.h
View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "draw.h" #include "color.h"
void rainbow_256(); void rainbow_256();
void aroace_256(); void aroace_256();

View file

@ -1,4 +0,0 @@
build:
gcc main.c draw.c basic.c full.c -o pride-c

2
main.c
View file

@ -1,7 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "draw.h" #include "color.h"
#include "basic.h" #include "basic.h"
#include "full.h" #include "full.h"