Fibonacci sequence: Difference between revisions
Content added Content deleted
Space Ghost (talk | contribs) |
Space Ghost (talk | contribs) |
||
Line 7,041: | Line 7,041: | ||
for (let mut n = 0; n <= j; n += 1) { |
for (let mut n = 0; n <= j; n += 1) { |
||
if (n == 0 || n == 1) { |
if (n == 0 || n == 1) { |
||
let |
let output1 = String.concat(" ", Pervasives.toString(n)) |
||
ignore(File.fdWrite(File.stdout, output1)) |
ignore(File.fdWrite(File.stdout, output1)) |
||
} else { |
} else { |
||
tempf = fnow + fnext |
tempf = fnow + fnext |
||
fnow = fnext |
fnow = fnext |
||
fnext = tempf |
fnext = tempf |
||
let |
let output2 = String.concat(" ", Pervasives.toString(fnext)) |
||
ignore(File.fdWrite(File.stdout, output2)) |
ignore(File.fdWrite(File.stdout, output2)) |
||
} |
} |