15_enums directory created

This commit is contained in:
Vinicius Silva 2024-01-01 02:05:23 -03:00
parent e50b4e9299
commit 4ce630cc85
1 changed files with 36 additions and 0 deletions

36
15_enums/main.v Normal file
View File

@ -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)
}