Yin and yang: Difference between revisions

Add SETL
(→‎{{header|Dart}}: added Flutter)
(Add SETL)
Line 5,260:
readln(KEYBOARD);
end func;</syntaxhighlight>
 
=={{header|SETL}}==
<syntaxhighlight lang="setl>program yin_yang;
print(taijitu 4);
print(taijitu 8);
op taijitu(r);
return +/[+/[pixel(x,y,r) : x in [-2*r..2*r]] + "\n" : y in [-r..r]];
end op;
proc pixel(x,y,r);
return if circle(x,y,-r/2,r/6) then '#'
elseif circle(x,y,r/2,r/6) then '.'
elseif circle(x,y,-r/2,r/2) then '.'
elseif circle(x,y,r/2,r/2) then '#'
elseif circle(x,y,0,r) then
if x<0 then '.' else '#' end
else ' '
end;
end proc;
proc circle(x,c,y,r);
return r*r >= (x/2)**2 + (y-c)**2;
end proc;
end program;</syntaxhighlight>
{{out}}
<pre> .
.........##
.....###...##
...........####
.........########
....###########
..###...#####
..#########
#
 
.
.............##
.................####
...........###......#####
...........#####......#####
.............###......#######
......................#########
.....................##########
.................################
..........#####################
.........######################
.......######...#############
.....######.....###########
.....######...###########
....#################
..#############
#</pre>
 
=={{header|Sidef}}==
2,115

edits