Skip to content

Instantly share code, notes, and snippets.

@rockos
Last active June 17, 2017 00:24
Show Gist options
  • Save rockos/992ba17c9380384d3ecfb01300d163e2 to your computer and use it in GitHub Desktop.
Save rockos/992ba17c9380384d3ecfb01300d163e2 to your computer and use it in GitHub Desktop.
amida and gunron
package main
import (
"fmt"
)
/* 2 <-> 3 */
func amida23(a,b,c string) (string,string,string) {
return a,c,b
}
/* 1 <-> 2 */
func amida12(a,b,c string) (string,string,string) {
return b,a,c
}
/*
1->1,2->2,3->3 a b c
2<->3 a c b
1<->2 b a c
1->3->2->1 b c a
1->2->3->1 c a b
1<->3 c b a
*/
func main() {
var x, y, z string
x,y,z = (amida12(amida12("a", "b", "c")))
fmt.Println("1->1,2->2,3->3 \t", x, y, z)
x,y,z = amida23("a", "b", "c")
fmt.Println("2<->3 \t\t", x, y, z)
x,y,z = (amida12(amida23(amida23("a", "b", "c"))))
fmt.Println("1<->2 \t\t", x, y, z)
x,y,z = amida23(amida12(amida23(amida23("a", "b", "c"))))
fmt.Println("1->3->2->1 \t", x, y, z)
x,y,z = amida12(amida23("a", "b", "c"))
fmt.Println("1->2->3->1 \t", x, y, z)
x,y,z = amida23(amida12(amida23("a", "b", "c")))
fmt.Println("1<->3 \t\t", x, y, z)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment