Refactored the interface of the io package
This commit is contained in:
parent
08ea91f46c
commit
a9d783c675
12 changed files with 29 additions and 35 deletions
|
@ -10,9 +10,9 @@ fizzbuzz(n int) {
|
|||
|
||||
loop {
|
||||
switch {
|
||||
x % 15 == 0 { io.out("FizzBuzz") }
|
||||
x % 5 == 0 { io.out("Buzz") }
|
||||
x % 3 == 0 { io.out("Fizz") }
|
||||
x % 15 == 0 { io.write("FizzBuzz") }
|
||||
x % 5 == 0 { io.write("Buzz") }
|
||||
x % 3 == 0 { io.write("Fizz") }
|
||||
_ { fmt.decimal(x) }
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,6 @@ fizzbuzz(n int) {
|
|||
return
|
||||
}
|
||||
|
||||
io.out(" ")
|
||||
io.write(" ")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue