min, max, abs

This commit is contained in:
Ginger Bill
2016-09-02 14:14:12 +01:00
parent fa09d805e2
commit 25e9b9bc87
11 changed files with 335 additions and 55 deletions
+8 -15
View File
@@ -4,24 +4,17 @@
main :: proc() {
print_int(min(1, 2)); nl()
print_int(max(1, 2)); nl()
print_int(abs(-1337)); nl()
a, b, c := 1, 2, -1337
print_int(min(a, b)); nl()
print_int(max(a, b)); nl()
print_int(abs(c) as int); nl()
match x := "1"; x {
case "1":
print_string("1!\n")
case "2":
print_string("2!\n")
if true {
break
}
case "3", "4":
print_string("3 or 4!\n")
fallthrough
default:
print_string("default!\n")
}
nl()
/*
Vec3 :: type struct { x, y, z: f32 }
Entity :: type struct {