Merge pull request #438 from RobLoach/patch-1

Add Switch Statement example
This commit is contained in:
Jason Turner 2018-05-12 09:41:37 -06:00 committed by GitHub
commit b9a5607a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,6 +370,25 @@ if (expression) { }
if (statement; expression) { } if (statement; expression) { }
``` ```
## Switch Statements
``` chaiscript
var myvalue = 2
switch (myvalue) {
case (1) {
print("My Value is 1");
break;
}
case (2) {
print("My Value is 2");
break;
}
default {
print("My Value is something else.";
}
}
```
## Built in Types ## Built in Types
``` ```