From baf3abca3ce2295b9186989a0274911886ef4b87 Mon Sep 17 00:00:00 2001 From: dev wells Date: Mon, 14 Sep 2026 12:15:25 -0400 Subject: [PATCH] ch2 3 and 4 done --- learning-odin/ch2.odin | 24 ++++++++++++++++++++++++ learning-odin/test.md | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 learning-odin/ch2.odin create mode 100644 learning-odin/test.md diff --git a/learning-odin/ch2.odin b/learning-odin/ch2.odin new file mode 100644 index 0000000..cfc74ed --- /dev/null +++ b/learning-odin/ch2.odin @@ -0,0 +1,24 @@ +package hellope + +import "core:fmt" + +// This is a useful way to explicitly type a constant +// otherwise it would be an Untyped Float (which would default convert to an f64) +DECIMAL_CONSTANT: f32 : 7.42 + +/* Comment test */ +main :: proc() { + number := 7 // an inferred int + decimal_number := f32(7.42) // a casted float + decimal_number_default := 7.50 // a default float, which is f64 + + // formatting + fmt.println(number) + fmt.println(decimal_number) + fmt.println("Hellope!") +} + +constants_test :: proc() { + // playing around with constants + CONSTANT_NUMBER :: 12 +} diff --git a/learning-odin/test.md b/learning-odin/test.md new file mode 100644 index 0000000..27c158d --- /dev/null +++ b/learning-odin/test.md @@ -0,0 +1,12 @@ +# oh + +hi how are you + +this is me writing some _markdown_ + +## a second heading + +**some bold** +[a link](https://example.com) + +nice -- knotmirror 0.0.1