Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
10
Task/Map-range/Prolog/map-range.pro
Normal file
10
Task/Map-range/Prolog/map-range.pro
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
% map_range(+S, +A1, +A2, +B1, +B2, -R)
|
||||
map_range(S, A1, A2, B1, B2, R) :-
|
||||
R is B1 + (S - A1) * (B2 - B1) / (A2 - A1).
|
||||
|
||||
% bucle principal
|
||||
run :-
|
||||
forall(between(0, 10, I),
|
||||
( map_range(I, 0, 10, -1, 0, R),
|
||||
format("~w maps to ~1f~n", [I, R])
|
||||
)).
|
||||
Loading…
Add table
Add a link
Reference in a new issue