Sierpinski curve: Difference between revisions
m
C++ - calculate initial x and y from length
m (Refactored C++ code) |
m (C++ - calculate initial x and y from length) |
||
Line 175:
class sierpinski_curve {
public:
void write(std::ostream& out, int size,
private:
static std::string rewrite(const std::string& s);
Line 187 ⟶ 186:
};
void sierpinski_curve::write(std::ostream& out, int size,
length_ = length;
x_ =
y_ =
angle_ = 45;
out << "<svg xmlns='http://www.w3.org/2000/svg' width='"
Line 247 ⟶ 245:
}
sierpinski_curve s;
s.write(out, 545
return 0;
}</lang>
{{out}}
See: [https://slack-files.com/T0CNUL56D-
=={{header|Factor}}==
|