mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Finished slice and dot notation, needs a lot of testing
This commit is contained in:
@@ -1,8 +1,23 @@
|
||||
var week = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
||||
|
||||
week[::-2] = ["first", "second", "third"];
|
||||
|
||||
print week;
|
||||
|
||||
|
||||
var str = "0123456789";
|
||||
|
||||
str[3:5:-2] = "abc";
|
||||
|
||||
print str;
|
||||
|
||||
|
||||
|
||||
str = "Hello world";
|
||||
|
||||
print str; //Hello world
|
||||
print str[::2]; //Hlowrd
|
||||
print str[::-2]; //drwolH
|
||||
|
||||
|
||||
|
||||
{
|
||||
fn f() {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user