Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
11
Task/Map-range/Sidef/map-range.sidef
Normal file
11
Task/Map-range/Sidef/map-range.sidef
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
func map_range(a, b, x) {
|
||||
var (a1, a2, b1, b2) = (a.bounds, b.bounds);
|
||||
x-a1 * b2-b1 / a2-a1 + b1;
|
||||
}
|
||||
|
||||
var a = 0..10;
|
||||
var b = -1..0;
|
||||
|
||||
for x in a {
|
||||
say "#{x} maps to #{map_range(a, b, x)}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue