learning F#, it seems pretty cool, favourite functional language so far.
Du kannst nicht mehr als 25 Themen auswählen
Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
123456789101112131415 |
- module Darts
-
- let withinCircle (radius: int) (x: double) (y: double) =
- sqrt ((pown x 2) + (pown y 2)) <= double(radius)
-
- let score (x: double) (y: double): int =
- if withinCircle 10 x y then
- if withinCircle 5 x y then
- if withinCircle 1 x y then
- 10
- else
- 5
- else
- 1
- else 0
|