Yin and yang: Difference between revisions

Content added Content deleted
(→‎{{header|Visual Basic .NET}}: Added implementation)
Line 141: Line 141:
DrawArea.Ellipse(10 + 7 * (size div 16), 10 + 3 * (size div 16), 10 + 9 * (size div 16),10 + 5 * (size div 16));
DrawArea.Ellipse(10 + 7 * (size div 16), 10 + 3 * (size div 16), 10 + 9 * (size div 16),10 + 5 * (size div 16));
end;</lang>
end;</lang>

=={{header|Icon}} and {{header|Unicon}}==
<lang Icon>link graphics

procedure main()
YinYang(100)
YinYang(40,"blue","yellow","white")
WDone() # quit on Q/q
end

procedure YinYang(R,lhs,rhs,bg) # draw YinYang with radius of R pixels and ...
/lhs := "white" # left hand side
/rhs := "black" # right hand side
/bg := "grey" # background

wsize := 2*(C := R + (margin := R/5)) # marginC

W := WOpen("size="||wsize||","||wsize,"bg="||bg) | stop("Unable to open Window")
WAttrib(W,"fg="||lhs) & FillCircle(W,C,C,R,+dtor(90),dtor(180)) # main halves
WAttrib(W,"fg="||rhs) & FillCircle(W,C,C,R,-dtor(90),dtor(180))
WAttrib(W,"fg="||lhs) & FillCircle(W,C,C+R/2,R/2,-dtor(90),dtor(180)) # sub halves
WAttrib(W,"fg="||rhs) & FillCircle(W,C,C-R/2,R/2,dtor(90),dtor(180))
WAttrib(W,"fg="||lhs) & FillCircle(W,C,C-R/2,R/8) # dots
WAttrib(W,"fg="||rhs) & FillCircle(W,C,C+R/2,R/8)
end
</lang>

{{libheader|Icon Programming Library}}
[http://www.cs.arizona.edu/icon/library/src/gprocs/graphics.icn graphics.icn provides graphical procdures]


=={{header|J}}==
=={{header|J}}==