valentines-day

This commit is contained in:
Alexander Heldt
2025-11-02 16:01:30 +01:00
parent 20df184279
commit 64d2de2364
10 changed files with 374 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
import gleam/otp/static_supervisor
// TODO: please define the 'Approval' custom type
pub type Approval {
Yes
No
Maybe
}
pub type Cuisine {
Korean
Turkish
}
pub type Genre {
Crime
Horror
Romance
Thriller
}
pub type Activity {
BoardGame
Chill
Movie(Genre)
Restaurant(Cuisine)
Walk(Int)
}
pub fn rate_activity(activity: Activity) -> Approval {
case activity {
BoardGame -> No
Chill -> No
Movie(genre) ->
case genre {
Romance -> Yes
_ -> No
}
Restaurant(cuisine) ->
case cuisine {
Korean -> Yes
Turkish -> Maybe
}
Walk(length) ->
case length {
length if length > 11 -> Yes
length if length > 6 -> Maybe
_ -> No
}
}
}