aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-02 18:47:47 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-02 18:47:47 +0000
commita3883a178c1e4e10058089a2832004a6ce1521e2 (patch)
tree6ca5a8f0ad91bb94fb09cf10910ad98e7542ff77 /code
parentce89a1428e40aeac13a9d82211fac463f8171717 (diff)
`range` statement
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin9
1 files changed, 8 insertions, 1 deletions
diff --git a/code/demo.odin b/code/demo.odin
index b1d7dd426..05a9dfd50 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -18,5 +18,12 @@ Thing :: enum f64 {
}
main :: proc() {
- fmt.println(Thing.A, Thing.B, Thing.C, Thing.D);
+ msg := "Hello";
+ range index, value : msg {
+ fmt.println(index, value);
+ }
+ list := []int{1, 4, 7, 3, 7, 2, 1};
+ range index, value : list {
+ fmt.println(index, value);
+ }
}