From 4ce630cc852199eabfe4aedc700f91db5fd34d1a Mon Sep 17 00:00:00 2001 From: Vinicius Silva Date: Mon, 1 Jan 2024 02:05:23 -0300 Subject: [PATCH] 15_enums directory created --- 15_enums/main.v | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 15_enums/main.v diff --git a/15_enums/main.v b/15_enums/main.v new file mode 100644 index 0000000..8a64320 --- /dev/null +++ b/15_enums/main.v @@ -0,0 +1,36 @@ +enum Color as u8{ + @none + red + green + blue +} + +pub fn main(){ + + mut color := Color.red + color = .green + + mut color1 := Color.@none + + println(color) + + match color { + .red { + println('the color was red') + } + + .green { + println('the color was green') + } + + .blue { + println('the color was blue') + } + + else { + println('color was not indentified') + } + } + + println(color1) +} \ No newline at end of file