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
15
Task/Collections/Sidef/collections-4.sidef
Normal file
15
Task/Collections/Sidef/collections-4.sidef
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# creating a struct
|
||||
struct Person {
|
||||
String name,
|
||||
Number age,
|
||||
String sex
|
||||
}
|
||||
|
||||
var a = Person("John Smith", 41, :man)
|
||||
|
||||
a.age += 1 # increment age
|
||||
a.name = "Dr. #{a.name}" # update name
|
||||
|
||||
say a.name #=> "Dr. John Smith"
|
||||
say a.age #=> 42
|
||||
say a.sex #=> "man"
|
||||
Loading…
Add table
Add a link
Reference in a new issue