Skip to content

Commit

Permalink
Use printfn
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Jul 21, 2024
1 parent 813585b commit 49fb585
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/content/docs/references/docs/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ fn void test()
{
// The following line is either prints a value less than 0.2
// or does not print at all:
io::printf("%d\n", test_error());
io::printfn("%d", test_error());
double x = (test_error() + test_error()) ?? 100;
// This prints either a value less than 0.4 or 100:
io::printf("%d\n", x);
io::printfn("%d", x);
}
```

Expand All @@ -216,21 +216,21 @@ fn void print_input_with_explicit_checks()
int! val = line.to_int();
if (try val)
{
io::printf("You typed the number %d\n", val);
io::printfn("You typed the number %d", val);
return;
}
}
io::printf("You didn't type an integer :(\n");
io::printn("You didn't type an integer :(");
}
fn void print_input_with_chaining()
{
if (try int val = io::readline().to_int())
{
io::printf("You typed the number %d\n", val);
io::printfn("You typed the number %d", val);
return;
}
io::printf("You didn't type an integer :(\n");
io::printn("You didn't type an integer :(");
}
```

Expand Down

0 comments on commit 49fb585

Please sign in to comment.