Yin and yang: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (→‎Flutter: minimized)
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(4 intermediate revisions by 2 users not shown)
Line 1,995:
### </pre>
 
 
=={{header|EasyLang}}==
[https://easylang.dev/show/#cod=VY/dCsIwDEbv8xTftbIapx30cWYso1jXEVHs20t13SbkIj8nJ2TSJJCgAoXAwBAASTEp5JsGleihZGgqaA5j7scBb2Ro5e/p5UunLqDFDgpmXm3OuTp++GEmHKNxvFWggS6aVfGrDjhVz8Lv//jNlZkvBkOXXm6Dpud4hbWWJPpeqf7ScoluqS2jYxzP9AE= Run it]
 
<syntaxhighlight>
proc circ r c . .
color c
circle r
.
proc yinyang x y r . .
move x y
circ 2 * r 000
color 999
circseg 2 * r 90 -90
move x y - r
circ r 000
circ r / 3 999
move x y + r
circ r 999
circ r / 3 000
.
background 555
clear
yinyang 20 20 6
yinyang 50 60 14
</syntaxhighlight>
 
{{out}}
<pre>
</pre>
 
=={{header|Evaldraw}}==
Line 2,187 ⟶ 2,217:
const color = [Colors.black, Colors.white];
 
ContainerWidget cR(int iColor, double r, {Widget? child, bool main = false}) => ContainerDecoratedBox(
decoration: ShapeDecorationBoxDecoration(color: color[iColor], shape: const CircleBorder()BoxShape.circle),
child: SizedBox.square(dimension: r * 2, child: Center(child: child)));
constraints: BoxConstraints.tight(Size.fromRadius(r)),
clipBehavior: main ? Clip.hardEdge : Clip.none,
margin: main ? const EdgeInsets.all(5) : null,
child: Center(child: child));
 
ContainerWidget yinYang(double r, [double th = 1.0]) => cRPadding(0, r + th,
marginpadding: main ? const EdgeInsets.all(5) : null,
main: true,
child: cRClipOval(1, r,
child: StackcR(alignment: Alignment.center0, children:r [+ th,
Container(color: color[0], marginchild: EdgeInsets.onlycR(left:1, r)),
Column(children: List.generate(2, (i) => cR(1 - i, r / 2, child: cRStack(ialignment: Alignment.center, r /children: 6))))[
Container(color: color[0], margin: EdgeInsets.only(left: r)),
])));
Column(children: List.generate(2, (i) => cR(1 - i, r / 2, child: cR(i, r / 6))))
])))));
 
void main() => runApp(MaterialApp(
Line 5,582 ⟶ 5,611:
===Text===
{{trans|AWK}}
<syntaxhighlight lang="ecmascriptwren">var inCircle = Fn.new { |centerX, centerY, radius, x, y|
return (x-centerX)*(x-centerX)+(y-centerY)*(y-centerY) <= radius*radius
}
Line 5,681 ⟶ 5,710:
{{libheader|DOME}}
With a few minor changes, we can use the same code to draw these symbols in DOME.
<syntaxhighlight lang="ecmascriptwren">import "dome" for Window
import "graphics" for Canvas, Color
 
9,476

edits