Skip to content

Commit

Permalink
refactor: use new godlike features
Browse files Browse the repository at this point in the history
  • Loading branch information
MilkeeyCat committed Aug 18, 2024
1 parent a0ceab0 commit c66e6b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 3 additions & 8 deletions programs/mafs.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
u8 main() {
u8 a;
a = 5 + 5;

u8 b;
b = 10 - 2;

u8 c;
c = a * b;
u8 a = 5 + 5;
u8 b = 10 - 2;
u8 c = a * b;

return c / 4;
}
4 changes: 1 addition & 3 deletions programs/structs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ struct Baz {
}

u8 main() {
Baz baz;
baz = Baz {
Baz baz = Baz {
bar: Bar {
foo: Foo {
value: 6,
Expand All @@ -23,7 +22,6 @@ u8 main() {
},
value: 256,
};

baz.value = 42;

return (u8)baz.value + baz.bar.value + baz.bar.foo.value;
Expand Down

0 comments on commit c66e6b5

Please sign in to comment.