I made a little cute rhythm bullet hell game where you control tabby cat named Pixel and fight AI subwoofer that went mad. You need to survive 5 remixes, each faster and denser than the previous one. But you're not alone - you have Byte, Glitch and Purrl to help. Dodge the bullets and shoot the boss to stun it. Use dash/bombs/focus and power-ups to your advantage. There's also a Practice mode if you just want to learn the patterns. Controls are arrows/WASD to move, Space/X to shoot, V to dash, C to bomb, and Shift/Z to focus. Made with love2d.

https://serpent7776.itch.io/techno-kitty

Note that the game is Claude generated.

 

This allocates required number of pages using mmap, fills it with AMD64 instructions, changes the memory protections and execute the memory as code.

This works fine on my machine, but I'm not sure if it's guaranteed to work in all cases. I assume it's safe to execute arbitrary asm code from OCaml. I'm not sure if the conversions I do are valid.

 

Example usage:

-- Register with default settings (41 timestamp bits, 10 type bits, 12 counter bits)
CALL snowflake.register('user_id');

-- Generate a user ID
SELECT snowflake.generate_user_id(now(), 1, 1);

-- Register with custom bit allocation
CALL snowflake.register('order_id', 42, 8, 13);

-- Generate an order ID with specific type and counter
SELECT snowflake.generate_order_id('2023-12-01 10:30:00 UTC', 5, 1000);