Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,8 @@
def fft(x : Array(Float64)) : Array(Complex)
return [x[0].to_c] if x.size <= 1
even = fft(Array.new(x.size / 2) { |k| x[2 * k] })
odd = fft(Array.new(x.size / 2) { |k| x[2 * k + 1] })
c = Array.new(x.size / 2) { |k| Complex.new(0, -2 * Math::PI * k / x.size).exp }
codd = Array.new(x.size / 2) { |k| c[k] * odd[k] }
return Array.new(x.size / 2) { |k| even[k] + codd[k] } + Array.new(x.size / 2) { |k| even[k] - codd[k] }
end