How to resolve the algorithm Yin and yang step by step in the OCaml programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Yin and yang step by step in the OCaml programming language
Table of Contents
Problem Statement
One well-known symbol of the philosophy of duality known as yin and yang is the taijitu.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Yin and yang step by step in the OCaml programming language
Source code in the ocaml programming language
open Graphics
let draw_yinyang x y radius black white =
let hr = radius / 2 in
let sr = radius / 6 in
set_color black;
set_line_width 6;
draw_circle x y radius;
set_line_width 0;
set_color black;
fill_arc x y radius radius 270 450;
set_color white;
fill_arc x y radius radius 90 270;
fill_arc x (y + hr) hr hr 270 450;
set_color black;
fill_arc x (y - hr) hr hr 90 270;
fill_circle x (y + hr) sr;
set_color white;
fill_circle x (y - hr) sr
let () =
open_graph "";
let width = size_x()
and height = size_y() in
set_color (rgb 200 200 200);
fill_rect 0 0 width height;
let w = width / 3
and h = height / 3 in
let r = (min w h) / 3 in
draw_yinyang w (h*2) (r*2) black white;
draw_yinyang (w*2) h r blue magenta;
ignore(read_key())
You may also check:How to resolve the algorithm ABC problem step by step in the zkl programming language
You may also check:How to resolve the algorithm Power set step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm Ethiopian multiplication step by step in the PL/SQL programming language
You may also check:How to resolve the algorithm Zumkeller numbers step by step in the Raku programming language
You may also check:How to resolve the algorithm Attractive numbers step by step in the Quackery programming language