iwk #1927(2007/08/06 10:40 GMT) [ OCaml ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#light open System open System.Runtime.InteropServices open System.Threading [<DllImport("kernel32.dll")>] let Beep (dwFreq:int) (dwDuration:int) :bool = failwith "" let toNum = function | 'c' -> 262 | 'd' -> 294 | 'e' -> 330 | 'f' -> 349 | 'g' -> 392 | 'a' -> 440 | 'b' -> 494 | _ -> 0 let play (s:string) = for c in s do if (toNum c) = 0 then Thread.Sleep( 500 ) else Beep (toNum c) 500 |> (fun b -> ()) done do play "cdefedcrefgagfercrcrcrcrcdefedcr"
Rating0/0=0.00-0+
[ reply ]
iwk
#1927()
[
OCaml
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]