Skip to content

Commit

Permalink
Merge pull request #133 from lambdaclass/fix-examples
Browse files Browse the repository at this point in the history
Fix test examples
  • Loading branch information
edg-l authored May 10, 2024
2 parents e0e6fb2 + 16fda9f commit dc95fdd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/arrays.con
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod Example {
fn main() -> i32 {
let mut array: [i32; 4] = [1, 9, 3, 4];
let nested_array: [[i32; 2]; 2] = [[1, 2], [9, 9]];
let mut nested_array: [[i32; 2]; 2] = [[1, 2], [9, 9]];

array[1] = 2;
nested_array[1] = [3, 4];
Expand Down
24 changes: 12 additions & 12 deletions examples/hello_world_hacky.con
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ mod HelloWorld {
let origin: *mut u8 = malloc(12);
let mut p: *mut u8 = origin;

*p = 'H';
*p = 72;
p = p + 1;
*p = 'e';
*p = 101;
p = p + 1;
*p = 'l';
*p = 108;
p = p + 1;
*p = 'l';
*p = 108;
p = p + 1;
*p = 'o';
*p = 111;
p = p + 1;
*p = ' ';
*p = 32;
p = p + 1;
*p = 'W';
*p = 87;
p = p + 1;
*p = 'o';
*p = 111;
p = p + 1;
*p = 'r';
*p = 114;
p = p + 1;
*p = 'l';
*p = 108;
p = p + 1;
*p = 'd';
*p = 100;
p = p + 1;
*p = '\0';
*p = 0;
puts(origin);

return 0;
Expand Down

0 comments on commit dc95fdd

Please sign in to comment.