This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <time.h> // Robert Nystrom | |
| #include <stdio.h> // @munificentbob | |
| #include <stdlib.h> // for Ginny | |
| #define r return // 2008-2019 | |
| #define l(a, b, c, d) for (i y=a;y\ | |
| <b; y++) for (int x = c; x < d; x++) | |
| typedef int i;const i H=40;const i W | |
| =80;i m[40][80];i g(i x){r rand()%x; | |
| }void cave(i s){i w=g(10)+5;i h=g(6) | |
| +3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <OpenGL/gl3.h> | |
| #include <SDL2/SDL.h> | |
| #define SOKOL_IMPL | |
| #define SOKOL_GLCORE33 | |
| #include <sokol_gfx.h> | |
| #define STB_IMAGE_IMPLEMENTATION | |
| #include <stb_image.h> | |
| #define CODE(...) #__VA_ARGS__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Written in 2017 by Tommy Ettinger (tommy.ettinger@gmail.com) | |
| To the extent possible under law, the author has dedicated all copyright | |
| and related and neighboring rights to this software to the public domain | |
| worldwide. This software is distributed without any warranty. | |
| See <http://creativecommons.org/publicdomain/zero/1.0/>. */ | |
| #include <stdint.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var wasmCode = new Uint8Array([0,97,115,109,1,0,0,0,1,177,128,128,128,0,9,96,0,0,96,1,127,1,127,96,0,1,127,96,1,127,0,96,2,127,127,0,96,2,127,127,1,127,96,5,127,127,127,127,127,0,96,3,127,127,127,0,96,4,127,127,127,127,0,2,157,128,128,128,0,2,3,101,110,118,7,103,101,116,99,104,97,114,0,2,3,101,110,118,7,112,117,116,99,104,97,114,0,1,3,224,128,128,128,0,95,3,2,2,2,3,2,2,3,2,3,2,3,1,4,2,1,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,8,2,0,4,133,128,128,128,0,1,112,1,72,72,5,131,128,128,128,0,1,0,2,6,129,128,128,128,0,0,7,216,134,128,128,0,95,6,109,101,109,111,114,121,2,0,6,112,117,116,107,101,121,0,2,5,108,108,107,101,121,0,3,10,107,101,121,87,97,105,116,105,110,103,0,4,6,103,101,116,107,101,121,0,5,4,116,101,108,108,0,6,3,112,111,112,0,7,3,116,111,115,0,8,4,112,117,115,104,0,9,4,100,112,111,112,0,10,5,100,112,117,115,104,0,11,4,114,112,111,112,0,12,5,114,112,117,115,104,0,13,7,114,101,97,100,77,101,109,0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define STB_IMAGE_WRITE_IMPLEMENTATION | |
| #include "stb_image_write.h" | |
| #include <ft2build.h> | |
| #include FT_FREETYPE_H | |
| #define NUM_GLYPHS 128 | |
| struct glyph_info { | |
| int x0, y0, x1, y1; // coords of glyph in the texture atlas |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| P-code for PL/0 machine | |
| [ref] https://en.wikipedia.org/wiki/P-code_machine | |
| [ref] http://blackmesatech.com/2011/12/pl0/pl0.xhtml | |
| The PL/0 virtual machine was originally specified by Nicklaus Wirth in his book | |
| Algorithms + Data Structures = Programs; it's used as the target machine for a | |
| PL/0 compiler. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "SDL.h" | |
| #include <OpenGLES/ES2/gl.h> | |
| #include <OpenGLES/ES2/glext.h> | |
| #include <iostream> | |
| #include <string> | |
| #include <memory> | |
| using namespace std; | |
| GLuint programObject; | |
| class Graphics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /******************************************************************************* | |
| * | |
| * A minimal Forth compiler in C | |
| * By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com | |
| * Release 2014-04-04 | |
| * | |
| * Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial | |
| * | |
| * PUBLIC DOMAIN | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Minimal SDL2 + OpenGL3 example. | |
| Author: https://github.com/koute | |
| This file is in the public domain; you can do whatever you want with it. | |
| In case the concept of public domain doesn't exist in your jurisdiction | |
| you can also use this code under the terms of Creative Commons CC0 license, | |
| either version 1.0 or (at your option) any later version; for details see: | |
| http://creativecommons.org/publicdomain/zero/1.0/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "udpnet.h" | |
| #if defined WIN32 | |
| typedef int socklen_t; | |
| #else | |
| #define closesocket(s) close(s) | |
| #endif | |
| static int udp_err_ = 0; |