libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.18k stars 1.86k forks source link

Add BytePusher example #11514

Closed maia-s closed 3 days ago

maia-s commented 4 days ago

I wrote a BytePusher VM implementation and thought it could be a good example. See here for more information about BytePusher and example programs: https://esolangs.org/wiki/BytePusher

It's written in C99. I don't know if examples are required to be C89, but I can fix that if you're interested

edit: Looks like they are, and I forgot to update the Visual Studio projects. Anyway, let me know if you want this and I'll fix it

slouken commented 4 days ago

Sure, this looks fun. I don't know if it goes in the games category though, @icculus, thoughts?

maia-s commented 4 days ago

I agree "game" doesn't exactly fit, but I'm not sure what else to put it under. A new category?

For now, I pushed an update that should work on C89 and also doesn't blast your ears off if you try an audio example with headphones e: as much. be careful :p

slouken commented 4 days ago

I agree "game" doesn't exactly fit, but I'm not sure what else to put it under. A new category?

Maybe games should be renamed demos?

icculus commented 3 days ago

Maybe games should be renamed demos?

Yes. I'm going to merge this and then make that change.

icculus commented 3 days ago

(Okay, this thing is awesome.)

madebr commented 3 days ago

With my wip work at https://github.com/libsdl-org/SDL/issues/9882#issuecomment-2492767421, I got it working on emscripten. BytePusher at https://examples.libsdl.org is currently sad.

icculus commented 3 days ago

I have a local fix for the out of memory issue, if you've got drag and drop working.

icculus commented 3 days ago

OOM fixed in 61ba8010d3c3c372226b3ce6af28b458fe7dda16.