Dragon curve/D/DFL: Difference between revisions

m
Fixed syntax highlighting.
(Created page with "{{libheader|DFL}} Translation of Java <lang d>// dfl dragoncurve -gui -release -O private import dfl.all; import std.math; class DrawForm: Form { private int[] turns; ...")
 
m (Fixed syntax highlighting.)
 
(2 intermediate revisions by one other user not shown)
Line 1:
{{libheader|DFL}}
Translation of Java
<langsyntaxhighlight lang="d">// dfl dragoncurve -gui -release -O
 
private import dfl.all;
import std.math, std.range;
 
class DrawForm: Form {
Line 11:
private double startingAngle;
private double side;
private constimmutable iter = 14;
 
this() {
Line 27:
}
 
publicprivate int[] getSequence(in int iterations) {
int[] turnSequence;
forforeach (int i =_; 0; i <.. iterations; i++) {
auto copy = turnSequence.dup.reverseretro;
turnSequence ~= 1;
foreach (turn; copy) {
Line 67:
Application.run(new DrawForm);
}
catch(ObjectException oe) {
msgBox(oe.toString()msg, "Fatal Error", MsgBoxButtons.OK, MsgBoxIcon.ERROR);
result = 1;
}
return result;
}</langsyntaxhighlight>
 
Screenshot: [http://img534.imageshack.us/img534/2324/dfldragoncurve.png]
9,476

edits