20 lines
318 B
D
Executable file
20 lines
318 B
D
Executable file
#!/bin/env rdmd
|
|
|
|
import std.process;
|
|
import std.conv;
|
|
|
|
void main(){
|
|
string fib21(){
|
|
string r = "";
|
|
double a = 0;
|
|
double temp;
|
|
for(double b = 1; a < 10000; b = temp + b){
|
|
r ~= a.to!string ~ "\n";
|
|
temp = a;
|
|
a = b;
|
|
}
|
|
return r;
|
|
}
|
|
assert([ "./lox", "test/fib21.lox" ].execute.output == fib21());
|
|
}
|
|
|