Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
8
Task/Variables/Pony/variables-1.pony
Normal file
8
Task/Variables/Pony/variables-1.pony
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
var counter: I32 = 10 // mutable variable 'counter' with value 10
|
||||
let temp: F64 = 36.6 // immutable variable 'temp'
|
||||
let str: String // immutable variable 'str' with no initial value
|
||||
str = "i am a string" // variables must be initialized before use
|
||||
let another_str = "i am another string" // type of variable 'another_str' infered from assigned value
|
||||
|
||||
let b = true
|
||||
let b' = false // variable names can contain ' to make a distinct variable with almost the same name
|
||||
6
Task/Variables/Pony/variables-2.pony
Normal file
6
Task/Variables/Pony/variables-2.pony
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
var x: I32 = 10
|
||||
var y: I32 = x = 20
|
||||
try
|
||||
Fact(x == 20) // x gets the new value of 20
|
||||
Fact(y == 10) // y gets the old value of x which is 10
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue