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; | |
struct Color { | |
ubyte r; | |
ubyte g; | |
ubyte b; | |
ubyte a; | |
} | |
enum Colors : Color |
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; | |
int mod(int dividend, int divisor){ | |
return dividend % divisor; | |
} | |
void main() |
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; | |
//https://leetcode.com/problems/find-greatest-common-divisor-of-array/ | |
enum test1=[2,5,6,9,10]; | |
enum test2=[7,5,6,8,3]; | |
enum test3=[3,3]; | |
auto gcdarray_verbose(R)(R r){ | |
auto mi=r.minElement; | |
auto mx=r.maxElement; | |
return gcd(mi,mx); |
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; | |
//https://leetcode.com/problems/find-greatest-common-divisor-of-array/ | |
enum test1=[2,5,6,9,10]; | |
enum test2=[7,5,6,8,3]; | |
enum test3=[3,3]; | |
auto gcdarray_verbose(R)(R r){ | |
auto mi=r.minElement; | |
auto mx=r.maxElement; | |
return gcd(mi,mx); |
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; | |
//https://leetcode.com/problems/find-greatest-common-divisor-of-array/ | |
enum test1=[2,5,6,9,10]; | |
enum test2=[7,5,6,8,3]; | |
enum test3=[3,3]; | |
auto gcdarray_verbose(R)(R r){ | |
auto mi=r.minElement; | |
auto mx=r.maxElement; | |
return gcd(mi,mx); |
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
/+dub.sdl: | |
dependency "collections" version="~>0.1.0" | |
+/ | |
void main() | |
{ | |
import std.traits; | |
import std.stdio: write, writeln, writef, writefln; | |
#line 1 | |
static assert(fullyQualifiedName!fullyQualifiedName == "std.traits.fullyQuhalifiedName"); | |
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; | |
import core.thread; | |
struct Player { | |
int number; | |
void parallel_op() { | |
writefln("match %s has begun", number); | |
// Wait for a while to simulate a long-lasting operation |
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, std.format; | |
import std.algorithm; | |
struct BoolMatrix(int n) | |
{ | |
bool[n][n] elements; | |
enum err1 = n.format!"Point, %s'e denk veya fazla olamaz!"; | |
ref opCall(Point i) |
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; | |
void main() | |
{ | |
int[] a = [1, 2, 3, 4]; | |
char[] nameN = ['J', 'O', 'H', 'N'] ~ [' ', 'D', 'O', 'E']; | |
char e = 'E'; | |
char lettreE = 'E'; | |
float D = 343; | |
double O = D + 322 / 1.5; |
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; | |
void outofcontext() | |
{ | |
writeln("Hello D ", associative); | |
foreach (pointeraddress, information; associative) | |
{ | |
writeln(*cast(string*)pointeraddress); | |
} |