Reputation: 25
I am wondering how I can make a fact have multiple values for example:
answer(1-100, 'yes').
answer(100-700, 'no).
For 1-100 it would be yes and 100-700 it would be no. Writing thousands of facts would be too time consuming.
Upvotes: 1
Views: 158
Reputation: 74197
See the documentation for between/3
:
answer( N , yes ) :- between( 1 , 100 < N ).
answer( N , no ) :- between( 101 , 700 , N ).
Because life is too short to repeat the same thing over and over and over.
Upvotes: 1