YOU HAVE TEN SECONDS TO WRITE A FUNCTION THAT TAKES IN AN ARRAY OF NUMBERS AND RETURNS AN ARRAY WHERE EVERY NUMBER IS...

YOU HAVE TEN SECONDS TO WRITE A FUNCTION THAT TAKES IN AN ARRAY OF NUMBERS AND RETURNS AN ARRAY WHERE EVERY NUMBER IS MULTIPLIED BY TEN. OR ARE YOU WANT TO DIE?

Attached: birb.png (549x420, 431K)

Other urls found in this thread:

haskell.org/tutorial/arrays.html
twitter.com/SFWRedditImages

We not worried 'bout no other niggas, we them other niggas
You bust down a Rollie, I bust down a brick, then I flood it, nigga
I am not to be compared to you rappers, Eazy-Duz-It, nigga
I am more Eazy, you tryin’ your best to become me, nigga
She like them bottles with bubbles in it
Buy her Loewe and other linen

get out

Is this your second exercise for intro to programming?

1 x 10

function f() {
echo -n $1
echo "0"
}

Just use map kiddo.

map (*10) [1,2,3,4,5]

it's easy with map

but what if you don't use map at all?

I would write map then? IIRC its only like 2 lines?

map :: (a -> b) -> [a] -> [b]
map fun (car:cdr) = fun car : map fun cdr

try that except only use ES5 JavaScript

fun a(b: IntArray) = IntArray(b.size){b[it]*10}

Don't you have a loo to poo?

Where I work we do everything in Haskell and C++, I've never once used javascript in my life, even during undergrad I avoided every webdev class. So, I will remain blissfully unaware of any problems related to javascript ^_^ Thanks for your offer though.

he said write a function, not an expression
are you want to die?

>^_^
don’t do that

lambda a: [10*x for x in a]

let arrayOne == [1,2,3,4,5,6,7,8,9,10]
multiplyNumbs == [a*10,b*10,c*10,d*10,e*10,f*10,g*10,h*10,i*10,j*10]
multiplyNumbs arrayOne

I think at least, i'm new to Haskell.

int[] x10(int[] in) {
return IntStream.of(in).map(x -> x * 10).toArray();
}

func arrayMultiply(a []int) []int {
for i, val := range a {
a[i] = val * 10
}
return a
}

void funct (int arr[]) { for (register int i = 0; i < sizeof(arr)/sizeof(arr[0]); i++) {arr[i]*=10;}

def want_to_die(numbers):
for i in range(len(numbers)):
numbers[i] = numbers[i] * 10
return numbers

huh

I've never even touched Haskell, either you are baiting or don't seem to understand basic logic.

Func fun = (x => x.Select(y => 10 * y).ToArray());

array*10

Attached: tfw no burriot.jpg (990x725, 94K)

(defun homework (n)
(mapcar #'(lambda (i) (* i 10)) n))

array.each do { |x| x *= 10 }

dumb guca

Attached: 0b8c337ecbb8ad4884a2eeb7cbe401b579dc5afb.jpg (470x622, 64K)

opsux = fmap ((*) 10)

shutdown -abort -lonix -autists

boy you sure are dumb

shutdown -faggot -n

pkill this_nigger

killlunixfaggots.msi

just kill me

No man gets left behind user, we will teach you how to program one way or another, you will learn how to multiply by ten!

swift answer:
func multiplyBy10(array : [Double]) -> [Double] {
var newArray = array
for index in newArray.count - 1 {
newArray[index] *= 10
}
return newArray
}


rate my code

int[] mult(int[] a) => (from b in a select 10 * b).ToArray();

>www.stackexchange.com

fuck you bird

fmap

Attached: frogposter.png (424x421, 147K)

Autists know how to program, you're just retarded.

...

fn mult_ten(arr: Vec) -> Vec {
arr.iter().map(|x| x * 10).collect()
}

You should try again, go to the learn you a haskell site and turn to chapter 4.
What you wrote wouldn't even load in Prelude, unless I'm missing something. a b c d e etc variables are not defined in the scope ever, you aren't telling it that those variables correspond to the different parts of ArrayOne anywhere in your program.

Try again.

This is retarded because you specified array, not set or list. The ToArray() and ToList() wouldn't be necessary otherwise.
int[] MultiplyArrayByTen(int[] arr) {
return arr.ToList().Select(x => x*10).ToArray();
}

def mult(arr): return [x*10 for x in arr]

POSIX compliant
#!/bin/sh
n="1 \
2 \
3 \
4 \
5 \
6 \
7 \
8 \
9"
m=""
for i in $n; do
m="$m $(($i*10))"
done

$.for(arr, function(e){console.log(e*10)})

def coolfunction(arr):
for i in arr:
arr[arr.index(i)] = i * 10
return(arr)

Attached: hackerman.jpg (500x500, 112K)

running this with [.1,1] returns [10,1] when it should return [1,10]. Please try harder

def shit(a); a.map { |n| n * 10 }; end;

this a joke?

function multiply ([int[]]$array) {
$array2 = @()
foreach ($thing in $array) { $array2 += $($thing*10)}
$array2
}

> using floats
gtfo what do i look like a computer genius?

f = lambda x: [v*10 for v in x]

def gay(numbers):
return [x*10 for x in numbers]

(define (f l)
(map (lambda (x) (* x 10)) l))

A long time since I've touched php, this is from memory and might be way off

$a[1,2,3,4,5,6,7,8,9,10];
$b[ ]
foreach ($a){
$a * 10;
array_push($a, $b);
}

Kek

this
>^_^
do not do that.

std::for_each(numbers.begin(), numbers.end(),
[](int &n) { return n * 10; } );

MATLAB:
Array*10

Or if you really want a function:
f=@(A)(A*10)

Happy bird?

{write array i want}

Attached: 1455236372499.png (534x486, 378K)

Never ask Jow Forums to do your homework. Your professor will reverse search your homework and end up on Jow Forums and you will be a joke.

function opIsGay ($benisArray){
return array_map("xten", $benisArray);
}
function xten ($n){
return $n * 10;
}

const m10 = a => a.map(n=>n * 10);

I can't believe you fags
mulTen :: (Num a) => [a] -> [a]
mulTen inarray = [ x*10 | x

>[a]
> array
no annon, you're the fags

here is the pseudo code:
void fuckYou(double[] you) {
if (you == retard) {
goSuckACock(you);
} else {
goSuckACockAnyhow(you);
}
}

user appears to be sitting in his CS exam with access to /g through his phone.

def fuck_you(x):
y = [ num*10 for num in x ]

array * 10;

[1,2,3,4,5].map(n => n*10)

def array_takein_AAA(arrya)
return [i*10 for i in arrya]

AAAA

If OP is retarded enough to not know how to do this, he should just give up already and study something else.

elixir
def multiply(array) do
Enum.map(array, fn(x) -> x * 10 end)
end

Haha unironically this.

Attached: image.jpg (783x1044, 108K)

based

Attached: 1527798341649.jpg (1000x1000, 340K)

ArrayTimesTen (TheArray) {
ArrayLength = len(TheArray)
For (i=0, i

Attached: 1489128479008.jpg (480x318, 24K)

i'm late but


BIRDMIN NO

let function arraythig(arr) {
return new Promise((resolve, reject), () = {
var thing = {arrth:(arrey) => {
let tarr = [];
for (let i=0; i { console.log(arrey) });

> [10,20,30]
>

res = @(x) x.*10;

Works for scalars, vectors and matrices. Matlab rules

(define (*by10 vec)
(for/vector ([i vec]) (* 10 i)))
This specifically will create a new vector from a given one, so that you can do, e.g.,
(define vector1 #(1 2 3))
(define vector2 (*by10 vector1))

Function tenTimes = (array) -> Arrays.stream(array).map(num->num*10).toArray(Integer[]::new);

Array programming saves the day. In J:
timesTen =: * & 10
timesTen 0 1 2 3 4 5
0 10 20 30 40 50
10 * 0 1 2 3 4 5
0 10 20 30 40 50

f =: * & 10

It's similar in Julia
res(x) = x.*10

oh, someone else thought J

While traditional arrays are not part of the base Prelude, adding them in is trivial, if you really need an Array-array vs a list of elements that are indexed...
Most ways people normally use arrays can be substituted by [a] with no issues.

Here is the link for traditional Arrays in haskell if for some reason you have need of them.
haskell.org/tutorial/arrays.html

a => a.map(v => v*10);

Easy.

>or are you want to die

since you're pajeet you obviously don't want any of the above functions

simply run a foreach loop on your array
multiply each individual value by 10
and create a new array, with the new values.
It won't be efficient, and nobody will suspect someone else writing it!
you're welcome.

Ez.
var x10 = a => (a.join('0,')+0).split(',')

Attached: bcf.gif (400x400, 66K)

func ten(x: seq[SomeNumber]): auto = x.mapIt it * 10

[1,2,3].map((x) => x * 10);

for (auto &x : myArray)
{
if (x == 0) x = 00;
if (x == 1) x = 10;
if (x == 2) x = 20;
if (x == 3) x = 30;
if (x == 4) x = 40;
if (x == 5) x = 50;
if (x == 6) x = 60;
if (x == 7) x = 70;
if (x == 8) x = 80;
if (x == 9) x = 90;
}

This C#? LINQ can be used on any enumerable, including arrays.

def foo(x):
return [y * 10 for y in x]

Python: [x*10 for x in array]

>kotlin
ugh

def bigger(inarray):
outarray = inarray;
for i in range(9):
for o in range(len(inarray)):
outarray[o] = outarray[o] + outarray[o]
return outarray

How'd I do?