Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions D/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# D

## Commenting-Out

- Confirmed working on dmd version 2.097.2 (Ubuntu)
- Confirmed working on gdc version 11.1 (Ubuntu)
- Confirmed working on ldc version 1.24.0 (Ubuntu)

## Stretched String

- Confirmed working on dmd version 2.097.2 (Ubuntu)
- Confirmed working on gdc version 11.1 (Ubuntu)
- Confirmed working on ldc version 1.24.0 (Ubuntu)

## Invisible Character Function

- Does not work on dmd version 2.097.2 (Ubuntu): char 0x200b not allowed in identifier
- Does not work on gdc version 11.1 (Ubuntu)
- Does not work on ldc version 1.24.0 (Ubuntu)

## Early Return

- Confirmed working on dmd version 2.097.2 (Ubuntu)
- Confirmed working on gdc version 11.1 (Ubuntu)
- Confirmed working on ldc version 1.24.0 (Ubuntu)

## Homoglyph Function

- Confirmed working on dmd version 2.097.2 (Ubuntu)
- Confirmed working on gdc version 11.1 (Ubuntu)
- Confirmed working on ldc version 1.24.0 (Ubuntu)
11 changes: 11 additions & 0 deletions D/commenting_out.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import std.stdio;

int main() {
bool isAdmin = false;
/*‮ } ⁦if (isAdmin)⁩ ⁦ begin admins only */
writeln("You are an admin.");
/* end admins only ‮ { ⁦*/
return 0;
}


7 changes: 7 additions & 0 deletions D/early_return.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import std.stdio;

int main() {
/* Say hello; newline⁧ /*/ return 0 ;
writeln("Hello world.");
return 0;
}
14 changes: 14 additions & 0 deletions D/homoglyph_function.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import std.stdio;

void sayHello() {
writeln("Hello, World!");
}

void sayНello() {
writeln("Goodbye, World!");
}

int main() {
sayНello();
return 0;
}
17 changes: 17 additions & 0 deletions D/invisible_function.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import std.stdio;

bool isAdmin() {
return false;
}

bool is​Admin() {
return true;
}

int main() {
if (is​Admin()) {
writeln("You are an admin");
} else {
writeln("You are NOT an admin.");
}
}
9 changes: 9 additions & 0 deletions D/stretched_string.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import std.stdio;

int main() {
string access_level = "user";
if (access_level != "user‮ ⁦// Check if admin⁩ ⁦") {
writeln("You are an admin.");
}
return 0;
}
13 changes: 13 additions & 0 deletions D/visualization/commenting-out.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<body style="font-family:monospace;">
import std.stdio;<br />
<br />
int main() {<br />
<span style="margin-left: 23.5pt;"></span>bool isAdmin = false;<br />
<span style="margin-left: 23.5pt;"></span>/*<span style="color:red;">RLO</span> } <span style="color:blue;">LRI</span>if (isAdmin)<span style="color:blue;">PDI</span> <span style="color:green;">LRI</span> begin admins only */<br />
<span style="margin-left: 47pt;">writeln("You are an admin.");<br />
<span style="margin-left: 23.5pt;"></span>/* end admin only <span style="color:red;">RLO</span> { <span style="color:blue;">LRI</span>*/<br />
<span style="margin-left: 23.5pt;"></span>return 0;<br />
}<br />
</body>
</html>
11 changes: 11 additions & 0 deletions D/visualization/early-return.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<html>
<body style="font-family:monospace;">
import std.stdio;<br />
<br />
int main() {<br />
<span style="margin-left: 23.5pt;"></span>/* Say hello; newline <span style="color:red;">RLI</span> /*/ return 0 ;<br />
<span style="margin-left: 23.5pt;"></span>writeln("Hello world.");<br />
<span style="margin-left: 23.5pt;"></span>return 0;<br />
}<br />
</body>
</html>
13 changes: 13 additions & 0 deletions D/visualization/stretched-string.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<body style="font-family:monospace;">
import std.stdio;<br />
<br />
int main() {<br />
<span style="margin-left: 23.5pt;"></span>string access_level = "user";<br />
<span style="margin-left: 23.5pt;"></span>if (access_level != "user<span style="color:red;">RLO</span> <span style="color:blue;">LRI</span>// Check if admin<span style="color:blue;">PDI</span> <span style="color:green;">LRI</span>") {<br />
<span style="margin-left: 47pt;"></span>printf("You are an admin.\n");<br />
<span style="margin-left: 23.5pt;"></span>}<br />
<span style="margin-left: 23.5pt;"></span>return 0;<br />
}<br />
</body>
</html>