Skip to content

Instantly share code, notes, and snippets.

View run-dlang's full-sized avatar

Eleanor Cross run-dlang

View GitHub Profile
@run-dlang
run-dlang / main.d
Created October 29, 2023 08:38
Code shared from run.dlang.io.
import std;
void main()
{
writeln("Hello D");
}
@run-dlang
run-dlang / main.d
Created October 23, 2023 09:47
Code shared from run.dlang.io.
import std;
void main()
{
writeln("Hello D");
}
@run-dlang
run-dlang / main.d
Created October 23, 2023 09:47
Code shared from run.dlang.io.
import std;
void main()
{
writeln("Hello D");
}
@run-dlang
run-dlang / main.d
Created October 22, 2023 14:52
Code shared from run.dlang.io.
import std.typecons;
import std.stdio;
import std.format;
import std.meta;
import std.algorithm;
import std.meta;
import std.array;
import std.conv;
import std.functional;
import std.range;
@run-dlang
run-dlang / main.d
Created October 22, 2023 14:52
Code shared from run.dlang.io.
import std.typecons;
import std.stdio;
import std.format;
import std.meta;
import std.algorithm;
import std.meta;
import std.array;
import std.conv;
import std.functional;
import std.range;
@run-dlang
run-dlang / main.d
Created October 20, 2023 10:42
Code shared from run.dlang.io.
import std;
struct Vector(uint n, T) if (n > 0 && n <= 3)
{
T x;
this(T x)
{
this.x = x;
}
@run-dlang
run-dlang / main.d
Created October 18, 2023 21:40
Code shared from run.dlang.io. Run with '-unittest'
void main()
{
import std.algorithm, std.stdio, std.file, std.range;
enum cols = 14;
// Split file into 14-byte chunks per row
thisExePath.File("rb").byChunk(cols).take(20).each!(chunk =>
// Use range formatting to format the
// hexadecimal part and align the text part
writefln!"%(%02X %)%*s %s"(
chunk,
@run-dlang
run-dlang / main.d
Created October 17, 2023 06:52
Code shared from run.dlang.io.
import std;
import std.algorithm;
import std.regex;
import std.array;
import std.conv;
import std.csv;
import std.math;
import std.string;
import std.stdio;
import std.string;
@run-dlang
run-dlang / main.d
Created October 15, 2023 03:09
Code shared from run.dlang.io.
import std.stdio : writeln, toFile;
import std.datetime.stopwatch : StopWatch, AutoStart;
import asdf.serialization : deserialize, serializeToJson;
import std.file : readText;
enum TopN = 5;
struct Post
{
string _id;
@run-dlang
run-dlang / main.d
Created October 13, 2023 21:11
Code shared from run.dlang.io. Run with '-unittest'
auto targetPosition = target.headPosition;
import std.stdio;
//writefln!"Writing yaw: %s"(cameraPosition.yawTo(targetPosition));
//writefln!"Writing pitch: %s"(cameraPosition.pitchTo(targetPosition));
immutable controlAngles = getControlAngles;
immutable viewAngles = getViewAngles;
immutable currentYaw = controlAngles[1];
immutable currentPitch = controlAngles[0];