Ejemplo n.º 1
0
Archivo: art.go Proyecto: taysom/va
func testTurtle(d *doodle.Doodle) {
	var n int
	var x, dx, a, da float64
	bug.Where()
	t := d.New()
	n, x, dx, a, da = 400, 0.1, 0, 37, 17
	if flag.NArg() == 5 {
		n, _ = strconv.Atoi(flag.Arg(0))
		x, _ = strconv.ParseFloat(flag.Arg(1), 64)
		dx, _ = strconv.ParseFloat(flag.Arg(2), 64)
		a, _ = strconv.ParseFloat(flag.Arg(3), 64)
		da, _ = strconv.ParseFloat(flag.Arg(4), 64)
	}
	println(n, x, dx, a, da)
	if false {
		for i := 0; i < 4; i++ {
			t.Forward(2)
			t.Right(90)
		}
		t.Doit(40, 0, .1, 90, 0)
	} else {
		t.Doit(n, x, dx, a, da)
	}
}