Skip to content

Instantly share code, notes, and snippets.

@smvd
smvd / Winsock2Server.c
Created July 10, 2021 14:20
Simple HTTP server code
/*
- Read code from files
- Show images
- Show json
- Show video
- Show audio
- Better debugging
*/
#include <stdio.h>
@smvd
smvd / Sorting .c
Created May 31, 2021 13:08
Sorting algorithms in c
/*
The algorithims i have implemented are:
1. Bubble sort
2. Insertion sort
3. Selection sort
4. Comb sort
Youtube: www.rebrand.ly/eclip-coding
Github: gist.github.com/smvd/f95bdf6f49f18744289a2825d1f987ac
*/
@smvd
smvd / ECBF.c
Last active May 25, 2021 08:26
A brainfuck implementation
/*
> : Move the pointer forward 1 slot
< : Move the pointer back 1 slot
+ : Add 1 to the current memory slot
- : Subtract 1 from the current memory slot
. : Print the ASCII character in the current memory slot
? : Print the number stored in the current memory slot
, : Save the ASCII character taken from the keyboard in the current memory slot
[ : Test if the current slot is not 0, otherwise enter the loop
] : Test if the current slot is 0, otherwise exit the loop
@smvd
smvd / 1.LVL
Created May 11, 2021 13:39
This is just a quick demo for the game i'm working on its not meant to be a full game yet, nor look good
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000040000000000000
0000000000000000000000011111111000000000
0000000000000000000000000000001000000000
0000000000000000000000000000001000000000
0000000000000000001100000000001000000000
@smvd
smvd / FlappyBird.c
Last active October 6, 2023 23:19
flappy bird writen in c running in the terminal
/*
_ _ _ _____ _ ____ _
| \ | | ___ | |_ | ___| | __ _ _ __ _ __ _ _ | _ \ _ _ ___| | __
| \| |/ _ \| __| | |_ | |/ _` | '_ \| '_ \| | | | | | | | | | |/ __| |/ /
| |\ | (_) | |_ | _| | | (_| | |_) | |_) | |_| | | |_| | |_| | (__| <
|_| \_|\___/ \__| |_| |_|\__,_| .__/| .__/ \__, | |____/ \__,_|\___|_|\_\
|_| |_| |___/
compiler : GCC
command : gcc source.c -o FlappyBird.exe -Werror -Wall -W -s
license : www.unlicense.org (Please credit my channel tho)
/*
[1] - https://docs.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers
[2] - https://www.tutorialspoint.com/c_standard_library/stdio_h.htm
[3] - https://www.tutorialspoint.com/cprogramming/c_functions.htm
[4] - https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input
[5] - https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-mouseinput
[6] - https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput
[7] - https://www.tutorialspoint.com/cprogramming/index.htm
[8] - https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getasynckeystate
[9] - https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
/*
____ _____ _ ____ __ __ _____
| _ \| ____| / \ | _ \ | \/ | ____|
| |_) | _| / _ \ | | | | | |\/| | _|
| _ <| |___ / ___ \| |_| | | | | | |___
|_| \_\_____/_/ \_\____/ |_| |_|_____|
<--[ GENERAL ]-->
This is a simple game meant to be fun yet simple.
It uses ANSI codes to make it run without flicker compared to most small terminal games.
#define WINVER 0x0500 // It needs to be windows 2000 or up
#include <windows.h> // Import windows standard header
#include <string.h> // Import header to work with words
#include <stdio.h> // Import input/output header
int main // Main function
(
int argc, // Variable to hold the ammount of arguments
char **argv // Variable to hold the arguments
@smvd
smvd / .README.c
Last active April 30, 2021 12:18
Snek - The game
/*
License: https://unlicense.org
But please credit my YT channel ;-)
Eclips-Coding
_____ _ _ ______ _ __ _______ _ _ ______ _____ __ __ ______
/ ____| \ | | ____| |/ / |__ __| | | | ____| / ____| /\ | \/ | ____|
| (___ | \| | |__ | ' / ______ | | | |__| | |__ | | __ / \ | \ / | |__
\___ \| . ` | __| | < |______| | | | __ | __| | | |_ | / /\ \ | |\/| | __|
____) | |\ | |____| . \ | | | | | | |____ | |__| |/ ____ \| | | | |____
|_____/|_| \_|______|_|\_\ |_| |_| |_|______| \_____/_/ \_\_| |_|______|
{"command":"clear","params":"Hello World!"}