-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a smiling emoji example using different shapes
- Loading branch information
1 parent
04396d7
commit 4dc8fd6
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
open Joy | ||
|
||
let make_nose () = | ||
let l = line (point 0 50)|> translate 0 (-25) in | ||
let l1 = l in | ||
let l2 = l |> rotate 90|> translate 0 (-25) in | ||
let nose = complex [l1; l2] in | ||
nose | ||
|
||
let make_arc rx ry = | ||
let r = rectangle ~c:(point 0 (ry / 2)) (2 * rx) ry in | ||
let col = r |> with_fill white |> with_stroke white in | ||
let e = ellipse ~c:(point 0 0) rx ry in | ||
complex [e; col] | ||
|
||
let () = | ||
init (); | ||
let a = circle 200 in | ||
let d = circle ~c:(point 50 50) 20 in | ||
let b = circle ~c:(point (-50) 50) 20 in | ||
let nose = make_nose () in | ||
let leb = make_arc 26 14 |> rotate 180 |> translate 50 70 in | ||
let reb = make_arc 26 14 |> rotate 180 |> translate (-50) 70 in | ||
let mouth = make_arc 80 40 |>translate 0 (-60) in | ||
show [mouth;leb;reb;a;d;b;nose]; | ||
write () | ||
|