valentines-day
This commit is contained in:
51
valentines-day/src/valentines_day.gleam
Normal file
51
valentines-day/src/valentines_day.gleam
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user