Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Map-range/ReScript/map-range-1.re
Normal file
10
Task/Map-range/ReScript/map-range-1.re
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
let map_range = ((a1, a2), (b1, b2), s) => {
|
||||
b1 +. ((s -. a1) *. (b2 -. b1) /. (a2 -. a1))
|
||||
}
|
||||
|
||||
Js.log("Mapping [0,10] to [-1,0] at intervals of 1:")
|
||||
|
||||
for i in 0 to 10 {
|
||||
Js.log("f(" ++ Js.String.make(i) ++ ") = " ++
|
||||
Js.String.make(map_range((0.0, 10.0), (-1.0, 0.0), float(i))))
|
||||
}
|
||||
15
Task/Map-range/ReScript/map-range-2.re
Normal file
15
Task/Map-range/ReScript/map-range-2.re
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>ReScript: Map_range</title>
|
||||
<meta charset="UTF-8"/>
|
||||
<style rel="stylesheet" type="text/css">
|
||||
body { color:#EEE; background-color:#888; }
|
||||
</style>
|
||||
<script>var exports = {};</script>
|
||||
<script src="./maprange.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue