From 52677dbb23430de6941b47f442793d514e6ea56b Mon Sep 17 00:00:00 2001 From: davidon-top Date: Wed, 15 Jan 2025 09:18:45 +0100 Subject: [PATCH] u19 --- ulohyfs/src/u19.fs | 22 ++++++++++++++++++++++ ulohyfs/ulohyfs.fsproj | 1 + 2 files changed, 23 insertions(+) create mode 100644 ulohyfs/src/u19.fs diff --git a/ulohyfs/src/u19.fs b/ulohyfs/src/u19.fs new file mode 100644 index 0000000..7a01c48 --- /dev/null +++ b/ulohyfs/src/u19.fs @@ -0,0 +1,22 @@ +module UlohyFs.u19 + +open System.IO +open UlohyFs.Attributes +open System + +let startsWithConsonant (s: string) = + let consonants = "bcdfghjklmnpqrstvwxz" + s.ToLower().[0] |> consonants.Contains + +let startsWithVowel (s: string) = + let vowels = "aeiouy" + s.ToLower().[0] |> vowels.Contains + +[] +let uloha15() = + printfn "zadaj slovo" + let input = Console.ReadLine() + if startsWithConsonant input then + printfn "%s%cay" (input.Substring(1)) input.[0] + elif startsWithVowel input then + printfn "%sway" input \ No newline at end of file diff --git a/ulohyfs/ulohyfs.fsproj b/ulohyfs/ulohyfs.fsproj index d55b47e..e84b335 100644 --- a/ulohyfs/ulohyfs.fsproj +++ b/ulohyfs/ulohyfs.fsproj @@ -12,6 +12,7 @@ +