1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: fix warnings when doing ./v -W -progress -check-syntax build-examples

This commit is contained in:
Delyan Angelov
2020-10-26 13:14:21 +02:00
parent a7e3092165
commit 9772eb7c96
14 changed files with 203 additions and 157 deletions

View File

@ -4,21 +4,21 @@ const (
)
fn main() {
hanoi(num, 'A','B','C')
hanoi(num, 'A', 'B', 'C')
}
fn move(n int, a, b string) int {
fn move(n int, a string, b string) int {
println('Disc $n from $a to $b\...')
return 0
}
fn hanoi(n int, a, b, c string) int {
fn hanoi(n int, a string, b string, c string) int {
if n == 1 {
move(1,a,c)
move(1, a, c)
} else {
hanoi(n-1, a, c, b)
move(n,a,c)
hanoi(n-1, b, a, c)
hanoi(n - 1, a, c, b)
move(n, a, c)
hanoi(n - 1, b, a, c)
}
return 0
}