Last active
December 8, 2016 14:59
-
-
Save dragoon2014/6f76ca4c93108b7a1efa9f6d3a3b5f75 to your computer and use it in GitHub Desktop.
This file contains 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
// Compile Time D-man Locomotive | |
// https://qiita.com/dragoon2014/items/2217ab9578c875ecdf69 | |
import std.meta; | |
import std.range; | |
import std.algorithm; | |
const int w = 70; | |
const int p = 10; | |
const int delay = 100; | |
string m1(string str){ | |
return "pragma(msg, \"\\x1b[\", max(0, w+p-i), `C`, `"~str~"`[min($, max(0, i-w-p))..min($, i)]);"; | |
} | |
void main(){ | |
foreach (i; aliasSeqOf!(iota(w+p*2))){ | |
foreach(dmy; aliasSeqOf!(iota(delay+i))){ | |
//tacky busy loop | |
} | |
foreach(dmy; aliasSeqOf!(iota(delay-i))){ | |
//tacky busy loop | |
} | |
pragma(msg, "\x1b[2J\x1b[0;0H"); | |
mixin(m1(` _ _`)); | |
mixin(m1(` (_) (_)`)); | |
mixin(m1(`/______ \`)); | |
mixin(m1(`\\(O(O \/`)); | |
mixin(m1(` | | | |`)); | |
mixin(m1(` | |_| |`)); | |
mixin(m1(`/______/`)); | |
static if(i/6%4 == 1){ | |
mixin(m1(` (_) >`)); | |
mixin(m1(` (_)`)); | |
}else static if(i/6%4 == 3){ | |
mixin(m1(` < (_)`)); | |
mixin(m1(` (_) `)); | |
}else{ | |
mixin(m1(` < >`)); | |
mixin(m1(` (_) (_)`)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment