Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KajizukaTaichi committed Jul 27, 2024
1 parent 62a26a2 commit fb9ccc4
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,30 @@ In meaning, S stands for Speed, Secure, Simple and Small.

## [Example code](/example.ss)
```
// This program to solve FizzBuzz;
// This program is to solve FizzBuzz;
fn fizzbuzz(i) {
if i % 15 == 0 {
return "FizzBuzz";
};
if i % 5 == 0 {
return "Buzz";
};
if i % 3 == 0 {
return "Fizz";
};
return str(i);
};
fn add_text(source, text) {
return source + text + " "
};
var i <- 0;
var result <- "";
while i < 100 {
var i <- i + 1;
if i % 15 == 0 {
var result <- result + "FizzBuzz ";
}; if !(i % 15 == 0) {
if i % 5 == 0 {
var result <- result + "Buzz ";
}; if !(i % 5 == 0) {
if i % 3 == 0 {
var result <- result + "Fizz ";
}; if !(i % 3 == 0) {
var result <- result + f"{i} ";
};
};
};
var result <- add_text(result, fizzbuzz(i));
};
print result;
```
Expand Down

0 comments on commit fb9ccc4

Please sign in to comment.