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
| module fastFields; | |
| static public enum Type | |
| { | |
| Bool = "bool", | |
| Ubyte = "ubyte", | |
| Byte = "byte", | |
| Ushort = "ushort", | |
| Short = "short", |
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
| enum hello_world = (() { | |
| uint iPos, oPos; | |
| ubyte[] output; | |
| output.length = 16; | |
| ubyte[32] cells; | |
| uint cellPtr = 0; | |
| cells[cellPtr] += 10 ; |
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
| static immutable func = ({ | |
| uint iPos, oPos; | |
| ubyte[] output; | |
| ubyte[4096] cells; | |
| uint cellPtr = 0; | |
| output.length = 8192; | |
| cells[cellPtr] += 13 ; | |
| while(cells[cellPtr]) { | |
| cells[cellPtr] -= 1 ; |
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
| module z3; | |
| struct _Z3_symbol; | |
| alias _Z3_symbol* Z3_symbol; | |
| struct _Z3_literals; | |
| alias _Z3_literals* Z3_literals; | |
| struct _Z3_config; | |
| alias _Z3_config* Z3_config; | |
| struct _Z3_context; | |
| alias _Z3_context* Z3_context; |
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 "cling/Interpreter/Interpreter.h" | |
| #include "SDL2/SDL.h" | |
| #include "GL/gl.h" | |
| SDL_GLContext ctx; | |
| SDL_Window* win; | |
| bool loadSDL(); | |
| bool loadGL(); |
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
| double avg(long[] values) | |
| { | |
| double result; | |
| long sum; | |
| foreach(value;values) | |
| { | |
| sum += value | |
| } | |
| result = sum; |
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> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #ifdef _WIN32 | |
| typedef __int32 int32_t; | |
| typedef unsigned __int32 uint32_t; | |
| #endif; |
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
| import std.stdio; | |
| extern(C) void srand48(long x); | |
| extern(C) double drand48(); | |
| extern(C) long lrand48(); | |
| void main() | |
| { | |
| int seed = 1; |
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
| /****************************************************************************** | |
| Atomic Compare and Swap | |
| Used to set a variable to a value in a thread-safe way | |
| Returns: the value found at the point of read | |
| so if it equals expected the cas was sucsessful | |
| ******************************************************************************/ |
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
| version (DotDotDotTemplate) | |
| { | |
| template staticMap(alias F, T...) | |
| { | |
| mixin("enum staticMap = (F!T)...;"); | |
| } | |
| } | |
| else version (Walter) | |
| { | |
| template staticMap(alias F, T...) |