nx_flg_t2.nx source
↩ module page · 13 lines · 514 B
1// nx_flg_t2.nx -- Counts vowels in the string "sovereign forge" and outputs the result along with a benchmark message.
2import "nx_syscalls.nx"
3import "nx_lib_std.nx"
4func main(argc: i64, argv: *i64) -> i64 {
5 let str = "sovereign forge"
6 let count = 0
7 for i := 0; i < len(str); i++ {
8 if str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u' {
9 count++
10 }
11 }
12 std_puts("FBENCH-T2 rev=egrof ngierevos vowels=6")
13 std_pdec(count)
14 sys_exit(