Skip to content

Instantly share code, notes, and snippets.

View spikest3r's full-sized avatar
🎯
Focusing

spikest3r spikest3r

🎯
Focusing
View GitHub Profile
@spikest3r
spikest3r / hello.c
Last active October 6, 2025 13:06
Some stuff I made while learning WASM
#include <stdio.h>
#include <emscripten.h>
#include <string.h>
int EMSCRIPTEN_KEEPALIVE fib(int n) {
if(n == 0) return 0;
if(n == 1) return 1;
else return fib(n-1) + fib(n-2);
}
import Text.Read (readMaybe)
import Data.Char (toUpper)
lcg :: Int -> Int
lcg x = (1103515245 * x + 12345) `mod` (2^31)
rand :: Int -> Int -> Int
rand n seed = (lcg seed) `mod` n
guess :: Int -> IO()