Skip to content

Instantly share code, notes, and snippets.

View mhcoma's full-sized avatar
🔰
Noob

Coma mhcoma

🔰
Noob
View GitHub Profile
@mhcoma
mhcoma / einstein.fth
Last active October 8, 2021 15:03
Forth Einstein's Puzzle
0 constant _red 0 constant _danish 0 constant _beer 0 constant _blend 0 constant _bird
1 constant _yellow 1 constant _english 1 constant _coffee 1 constant _bluemaster 1 constant _cat
2 constant _green 2 constant _german 2 constant _milk 2 constant _dunhill 2 constant _dog
3 constant _blue 3 constant _norwegian 3 constant _tea 3 constant _pallmall 3 constant _fish
4 constant _white 4 constant _swedish 4 constant _water 4 constant _prince 4 constant _horse
: make_range
create 0 , 1 , 2 , 3 , 4 ,
;
@mhcoma
mhcoma / nexus.fth
Last active May 20, 2022 19:28
Heroes of the Storm Logo Animation
999 drop 30
constant size size 0002
* constant e size 9999 drop 4 -
s>f fconstant f e 2 * constant s pi
3.00e f/ fconstant m 00 create buff s e
* cells allot drop : main m 2.e f* { f: a |
f: r f: li f: lj x y } page begin s e * 0 +do
0 buff i cells + ! loop a -00.1e +to a f0< if
m 2e f* a f+ to a endif 0e to li begin li m 2.e
f* f< while li to lj begin lj m 2.e f* f< while m
@mhcoma
mhcoma / print_float_bits.c
Last active January 25, 2024 05:04
Print binary representation of a floating point number in C
#include <stdint.h>
#include <stdio.h>
typedef union v32_union {
float f;
uint32_t u;
} v32;
typedef union v64_union {
double f;
@mhcoma
mhcoma / alphabet_tower.py
Last active September 27, 2021 15:09
alphabet_tower.py
n = int(input("숫자를 입력하세요 : ")); [(lambda x: (print(' ' * (n - i), end = ''), [print([chr(k) for k in range(ord('A'), ord('Z') + 1)][j % 26], end = '') for j in range(i - 1, i * 3 - 2)], print()))(i) for i in range(1, n + 1)]
@mhcoma
mhcoma / pi.c
Created October 17, 2021 18:43
pi
#include <stdio.h>
#define PI putchar(i);
#define Pi i++;
#define pI i--;
#define pi char i; i -= i;
int main(void) {
pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi Pi PI pI pI pI pI pI PI Pi Pi Pi PI Pi Pi Pi PI pI pI pI PI Pi Pi Pi Pi PI Pi Pi Pi Pi PI pI pI pI pI pI pI pI PI Pi Pi Pi Pi PI pI PI pI pI PI Pi
Pi PI Pi Pi Pi PI Pi PI pI pI PI Pi Pi PI pI pI pI pI pI pI PI pI PI Pi PI Pi Pi Pi Pi Pi PI pI pI pI pI PI Pi Pi PI pI pI pI pI PI Pi Pi Pi Pi PI pI pI PI pI PI PI Pi Pi Pi Pi Pi PI pI pI pI pI pI PI pI PI Pi Pi Pi Pi Pi PI Pi Pi PI pI pI pI pI PI pI pI pI pI pI PI Pi Pi PI Pi Pi Pi Pi Pi Pi PI PI
pI pI pI pI PI pI pI pI PI Pi Pi Pi Pi Pi Pi Pi Pi PI pI pI PI pI pI pI pI pI pI PI Pi Pi Pi Pi Pi PI Pi Pi Pi PI pI pI
pI