Skip to content

Commit

Permalink
Carbon
Browse files Browse the repository at this point in the history
It wasn't outputting the right amount of numbers in the sequence
  • Loading branch information
ghluka committed Jun 21, 2024
1 parent 585df27 commit ccadb6f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
25 changes: 12 additions & 13 deletions src/C/Carbon/fibonacci.carbon
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
// This was written to be compatible with Carbon's interpreter as of the 10th of March, 2023.

package ExplorerTest api;

fn Main() -> i32 {
var a: auto = 0;
var b: auto = 1;
var a: auto = 0;
var b: auto = 1;

var x: auto = 2;
while (x != 10) {
Print("{0}", a);
b = b + a;
a = b - a;
x = x + 1;
}
var x: auto = 0;
while (x < 10) {
Print("{0}", a);
b = b + a;
a = b - a;

++x;
}

return b;
}
return 0;
}

0 comments on commit ccadb6f

Please sign in to comment.