hello could you give me a hand with exercise in haskell

0

Hello, I am stuck in the following exercise of a haskell beginner course: Having the following functions:

maximoEntreTres uno dos tres = max uno (max dos tres)
minimoEntreTres uno dos tres = min uno (min dos tres)
dispersion uno dos tres =  maximoEntreTres uno dos tres - minimoEntreTres uno dos tres

The exercise asks me to create the following functions, which I did:

    diasParejos uno dos tres = dispersion uno dos tres < 30
    diasLocos uno dos tres =  dispersion uno dos tres > 100

my problem is in the function diasNormales , that the result of the "dispersion" of its parameters is not days or days or days (so it is within a rando of 31 and 99) I have tried it in several ways but I still do not get it: I tried the following way:

diasNormales = dispersion uno dos tres > 30 && dispersion uno dos tres < 100

// But of course, this solution is not adequate because it requires the use of the functions diasParejos and diasLocos I will appreciate the help very much

Greetings

    
asked by jofret 16.09.2018 в 06:06
source

1 answer

1

You suggest it yourself:

  

diasNormales : neither diasDoses nor diasLocos

diasNormales uno dos tres =  not (diasParejos uno dos tres)
                          && not (diasLocos uno dos tres)

Alternatively:

diasNormales uno dos tres = not (diasParejos uno dos tres
                                 or diasLocos uno dos tres)
    
answered by 16.09.2018 / 14:57
source