So, I was feeling a little geeky today and have not done any serious programming for a few years now. Here is a simple problem to work on your hacking (coding) chops. You can use any language you like.
Monday Hacking Challenge (or Exercise)
9
So, I was feeling a little geeky today and have not done any serious programming for a few years now.
Here is a simple problem to work on your hacking (coding) chops. You can use any language you like.
1. Take an arbitrary list of numbers
2. Generate a list of functions from these numbers that computes x^2+2y+1 where x is unknown and y is known
So passing 2 as y results in x^2+2*2+1 = x^2+5
3. If your list of numbers has 3 numbers, you generate 3 functions. If it has 10 you generate 10.
4. Positionally apply functions to numbers and add all together for a numerical result.
Example code in Racket (a version of scheme)
Hint: Use a dynamically typed language with higher order computation ability and you'll be happier
Here is a simple problem to work on your hacking (coding) chops. You can use any language you like.
1. Take an arbitrary list of numbers
2. Generate a list of functions from these numbers that computes x^2+2y+1 where x is unknown and y is known
So passing 2 as y results in x^2+2*2+1 = x^2+5
3. If your list of numbers has 3 numbers, you generate 3 functions. If it has 10 you generate 10.
4. Positionally apply functions to numbers and add all together for a numerical result.
Example code in Racket (a version of scheme)
Hint: Use a dynamically typed language with higher order computation ability and you'll be happier
- stcupp
- sanjaypande
- michalsemen
- [1] reply
- sanjaypande
- imarketstuff
- imarketstuff
- unnatural
- facemook
Next Topics on Trending Feed
-
9