Skip to content

Conversation

@lukasvozda
Copy link
Contributor

New tutorial - Null, variants and the switch statement,
Fixed typos also in the previous tutorials.
Added contact to myself to the end of the tutorial.

days := ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; // Not ok - The same problem
```
Let's make a first excersise. Try to write a function called getDay, that will take a Nat as an argument and returns a name of the corresponding day.
Let's do a first exersise. Try to write a function called getDay, that will take a Nat as an argument and returns a name of the corresponding day.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Let's do a first exersise. Try to write a function called getDay, that will take a Nat as an argument and returns a name of the corresponding day.
Let's do a first exercise. Try to write a function called getDay, that will take a Nat as an argument and returns a name of the corresponding day.


```
public query func day_of_the_week(n : Nat) : async Text {
switch(n){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all parens from here on are redundant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants