Skip to content

Instantly share code, notes, and snippets.

View GabrielFreeze's full-sized avatar
🇲🇹

Gabriel_Freeze GabrielFreeze

🇲🇹
  • University of Malta
  • Għawdex
  • 15:05 (UTC +02:00)
View GitHub Profile
@GabrielFreeze
GabrielFreeze / christmas.c
Last active May 7, 2024 12:05
Prints Christmas Tree (with colour)
#include <stdio.h>
#include <stdint.h>
int main() {
uint64_t idx[766]={0x061861861861861c,0x0658618618618618,0x0199615280482483,0x025940a1d2045485,0x005205954a112192,0x001205209954a012,0x061861861861854a,
0x0618618618618618,0x06186187162806d8,0x0618618618618618,0x0242480119618618,0x005224205940a012,0x02030993ca0920c0,0x00592ca212180092,0x034a1d2086052009,
0x044a0520464891d9,0x061854a012192259,0x0618618618618618,0x02806d8618618618,0x0618618618618716,0x0658618618618618,0x0481655280481481,0x0480001655280481,
0x018905944a012147,0x005938a0d2045052,0x04ca0920820520c6,0x054a012002489099,0x0615280481481658,0x0618618618618618,0x02806d8618618618,0x07de561b2cae2556,
0x065882398a7639ec,0x0658615280482480,0x0288484181480002,0x02804830d20c564d,0x054a012112099610,0x0618618618618618,0x06d8618618618618,0x0b249a954f556280,
0x0ae5aebb28b6aae7,0x054a012152019618,0x0651280489252099,0x04ca092107052204,0x0102486081487099,0x02014840521d93ca,0x001205209961854a,0x054a01205205954a,
#include <stdio.h>
#include <inttypes.h>
int main() {
for (int i=1 ; i<=100; i++) {
uint32_t Fizz[4] = {i,0x2A447,0x2A51F,0x2A51A447};
uint8_t Buzz = ((!(i%5)) << 1) | (!(i%3));
@GabrielFreeze
GabrielFreeze / png.c
Last active August 18, 2022 00:23
Supply this program with an executable and it will display the bytecode as a png. Coloured pixels are used only for padding. GCC flags: -lm -lpng. [Linux]
#include <png.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
typedef struct {
uint8_t red;
@GabrielFreeze
GabrielFreeze / random.c
Created August 13, 2022 18:31
Give this program an 8 character word and it will generate a C program that will output that word using C's rand() function.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
int main(int argc, char** argv) {
if (argc != 2 || strlen(argv[1]) != 8)
return 0;
@GabrielFreeze
GabrielFreeze / julia.c
Created July 23, 2022 21:58
Julia Set Animation. Please resize terminal window accordingly =). Only works on linux system.
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <math.h>
#include <inttypes.h>
#include <time.h>
#include <stdlib.h>
#define ITERNUM 50
@GabrielFreeze
GabrielFreeze / mandelbrot.c
Last active July 23, 2022 13:10
Mandelbrot fractal. Compile with -lm using gcc =).
#include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <math.h>
#include <inttypes.h>
#define ITERNUM 50
#define THRESH 10
#define GRAN 0.02
#include <stdio.h>
#define N 32
#define R 12
/* _________
_#############_
_#################_
#####################
#######################
@GabrielFreeze
GabrielFreeze / print-name.c
Last active January 5, 2024 12:19
Prints my Watermark
#include <stdio.h>
int main() {
long int x6D31BEA60 = 0x6D31BEA60;
while (x6D31BEA60) putc((0x6c69484732302e20>>(((x6D31BEA60 >>= 0b011)&7)<<3)&0xFF), stdout);
}
@GabrielFreeze
GabrielFreeze / rule110.c
Last active January 5, 2024 12:14
Rule110 Obfuscation
#include <stdio.h>
long main() { unsigned long long _=0x8000000000000000
;;for (char GFreeze=0U; (sizeof(_)<<0b11ull)^GFreeze++
;){for(/*☻* ♥*/unsigned long long __=1ul; __
<<=1;)/*☺*/ fputc((71<< 5>>!!(_&__ )*6)&0x3f,
stdout);;;; fputc(10,/* */stdout); char v_v =
((_&1)<<1l) |((_&2)>>1) ;;/**/for( long w=1;w
;w<<=1U)_^= (-((0x6e>>( v_v=(((v_v <<1)&7)|!!
(_&(w<<1L)) )))&0x01ul) ^_)&w;}};; /*110x*//*
@GabrielFreeze
GabrielFreeze / obfsucation.py
Last active December 18, 2021 20:57
# This is an obfuscation of a function which either returns the summed manhattan distance of a 3x3 sliding puzzle game to it's goal state or just counts the number of misplaced tiles.
heuristic = lambda g,x=1:sum(x*(abs(i%3-((not t)*(((t-1)%(1<<3))+1)+(not not t)*(t-1))%3)+abs(i//3-([8,0,1,2,3,4,5,6,7][t])//3))+(not(x|((not t)*(((t-1)%8)+1)+(t&(not not ord("Gabriel_Freeze"[2+0+2+1])))*(t-1))-i)) for i,t in enumerate(g) if t)