3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test simultaneous assignment.
11 var a, b, c, d, e, f, g, h, i int
14 println(a, b, c, d, e, f, g, h, i)
17 func testit(permuteok bool) bool {
18 if a+b+c+d+e+f+g+h+i != 45 {
19 print("sum does not add to 45\n")
35 func swap(x, y int) (u, v int) {
54 for z := 0; z < 100; z++ {
55 a, b, c, d, e, f, g, h, i = b, c, d, a, i, e, f, g, h
57 if !testit(z%20 != 19) {
58 print("on ", z, "th iteration\n")
75 a, b = swap(swap(a, b))