Merge pull request #13 from viniciusfdasilva/dev
01-01-2024 - First Pull Request of the year 🤪🙃😝
This commit is contained in:
commit
0300678fbe
|
|
@ -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)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue