aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-11 17:33:23 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-11 17:33:23 +0000
commit4306345ff10e9f8225b156633aa986fee3f97987 (patch)
treea40e1363f48fe4d77111fcea0bf36b4f0ab3802f /code
parent346aa5f71ca4e3d6a71187024f809eaf2fc6da1b (diff)
Dynamic array syntax [...]Type; make entities private with a prefix of `_`; fix extension checking
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin43
1 files changed, 26 insertions, 17 deletions
diff --git a/code/demo.odin b/code/demo.odin
index 0f4488f4d..401853f1d 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -1,4 +1,13 @@
-#import "fmt.odin";
+#import . "fmt.odin";
+#import "atomic.odin";
+#import "hash.odin";
+#import "math.odin";
+#import "mem.odin";
+#import "opengl.odin";
+#import "os.odin";
+#import "sync.odin";
+#import "types.odin";
+#import "utf8.odin";
main :: proc() {
@@ -8,7 +17,7 @@ main :: proc() {
BANANA,
COCONUT,
}
- fmt.println(Fruit.names);
+ println(x, Fruit.names);
}
when false {
@@ -24,16 +33,16 @@ when false {
c := m[3.0];
assert(ok && c == 564);
- fmt.print("map[");
+ print("map[");
i := 0;
for val, key in m {
if i > 0 {
- fmt.print(", ");
+ print(", ");
}
- fmt.printf("%v=%v", key, val);
+ printf("%v=%v", key, val);
i += 1;
}
- fmt.println("]");
+ println("]");
}
{
m := map[string]u32{
@@ -47,11 +56,11 @@ when false {
_, ok := m["c"];
assert(ok && c == 7654);
- fmt.println(m);
+ println(m);
}
{
- fmt.println("Hellope!");
+ println("Hellope!");
x: [dynamic]f64;
reserve(x, 16);
@@ -59,24 +68,24 @@ when false {
append(x, 2_000_000.500_000, 3, 5, 7);
for p, i in x {
- if i > 0 { fmt.print(", "); }
- fmt.print(p);
+ if i > 0 { print(", "); }
+ print(p);
}
- fmt.println();
+ println();
{
Vec3 :: [vector 3]f32;
x := Vec3{1, 2, 3};
y := Vec3{4, 5, 6};
- fmt.println(x < y);
- fmt.println(x + y);
- fmt.println(x - y);
- fmt.println(x * y);
- fmt.println(x / y);
+ println(x < y);
+ println(x + y);
+ println(x - y);
+ println(x * y);
+ println(x / y);
for i in x {
- fmt.println(i);
+ println(i);
}
}
}