Determining if enum value is in list (C#)

后端 未结 6 2309
抹茶落季
抹茶落季 2021-01-02 12:32

I am building a fun little app to determine if I should bike to work.

I would like to test to see if it is either Raining or Thunderstorm(ing).

publi         


        
6条回答
  •  孤街浪徒
    2021-01-02 13:18

    I'm not sure that it should be a flag - I think that you should have an range input for:

    • Temperature
    • How much it's raining
    • Wind strength
    • any other input you fancy (e.g. thunderstorm)

    you can then use an algorithm to determine if the conditions are sufficiently good.

    I think you should also have an input for how likely the weather is to remain the same for cycling home. The criteria may be different - you can shower and change more easliy when you get home.

    If you really want to make it interesting, collect the input data from a weather service api, and evaulate the decision each day - Yes, I should have cycled, or no, it was a mistake. Then perhaps you can have the app learn to make better decisions.

    Next step is to "socialize" your decision, and see whether other people hear you are making the same decisions.

提交回复
热议问题