Skip to content

Instantly share code, notes, and snippets.

@gmitch215
Created October 12, 2025 03:08
Show Gist options
  • Select an option

  • Save gmitch215/cf4a7376e66e835c7b8a53b85a8713d5 to your computer and use it in GitHub Desktop.

Select an option

Save gmitch215/cf4a7376e66e835c7b8a53b85a8713d5 to your computer and use it in GitHub Desktop.
a poem in c, part one
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <windows.h>
int main() {
system("cls");
for (double i = 0; i < 25; i += M_PI / 12) {
int x = i * 10;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD) { x - 1, 1 << 1 | 0 });
putchar('_');
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD) { x - 1, 1 << 2 | 1 });
putchar('~');
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD) { x - 1, sin(i) * 4 + 5});
putchar('=');
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD) { x - 1, cos(i) * 3 + 5});
putchar('*');
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD) { x - 1, (sin(i) * cos(i) * 3) + 5});
putchar('+');
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD) { x - 1, (sin(i) * sin(i) * 2) + 4});
putchar('-');
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD) { x - 1, (cos(i) * cos(i) * 5) + 1});
putchar('^');
}
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), (COORD){0, 11});
printf("%s\n", "The wind whispers softly,");
printf("%s\n", "holding onto the burden of dreams,");
printf("%s\n\n", "as the night sky embraces the silent stars.");
printf("%s\n", "To grow beyond the horizon,");
printf("%s\n", "one must first let go of the past,");
printf("%s\n", "for in the release, we find our true strength.");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment