• Home
  • Raw
  • Download

Lines Matching refs:nav

268         self.nav = turtle.TNavigator()
271 self.nav.goto(100, -100)
272 self.assertAlmostEqual(self.nav.xcor(), 100)
273 self.assertAlmostEqual(self.nav.ycor(), -100)
276 self.assertEqual(self.nav.pos(), self.nav._position)
277 self.nav.goto(100, -100)
278 self.assertEqual(self.nav.pos(), self.nav._position)
281 self.assertEqual(self.nav._orient, (1.0, 0))
282 self.nav.left(90)
283 self.assertVectorsAlmostEqual(self.nav._orient, (0.0, 1.0))
286 self.assertEqual(self.nav._orient, (1.0, 0))
287 self.nav.right(90)
288 self.assertVectorsAlmostEqual(self.nav._orient, (0, -1.0))
291 self.nav.goto(100, -100)
292 self.assertAlmostEqual(self.nav.xcor(), 100)
293 self.assertAlmostEqual(self.nav.ycor(), -100)
294 self.nav.reset()
295 self.assertAlmostEqual(self.nav.xcor(), 0)
296 self.assertAlmostEqual(self.nav.ycor(), 0)
299 self.nav.forward(150)
301 self.assertVectorsAlmostEqual(self.nav.position(), expected)
303 self.nav.reset()
304 self.nav.left(90)
305 self.nav.forward(150)
307 self.assertVectorsAlmostEqual(self.nav.position(), expected)
309 self.assertRaises(TypeError, self.nav.forward, 'skldjfldsk')
312 self.nav.back(200)
314 self.assertVectorsAlmostEqual(self.nav.position(), expected)
316 self.nav.reset()
317 self.nav.right(90)
318 self.nav.back(200)
320 self.assertVectorsAlmostEqual(self.nav.position(), expected)
323 self.nav.forward(100)
325 self.assertAlmostEqual(self.nav.distance(Vec2D(0,0)), expected)
328 self.nav.left(90)
329 self.assertAlmostEqual(self.nav.heading(), 90)
330 self.nav.radians()
331 self.assertAlmostEqual(self.nav.heading(), 1.57079633)
332 self.nav.degrees()
333 self.assertAlmostEqual(self.nav.heading(), 90)
350 self.assertEqual(self.nav.towards(x, y), expected)
351 self.assertEqual(self.nav.towards((x, y)), expected)
352 self.assertEqual(self.nav.towards(Vec2D(x, y)), expected)
356 self.nav.left(90)
357 self.assertAlmostEqual(self.nav.heading(), 90)
358 self.nav.left(45)
359 self.assertAlmostEqual(self.nav.heading(), 135)
360 self.nav.right(1.6)
361 self.assertAlmostEqual(self.nav.heading(), 133.4)
362 self.assertRaises(TypeError, self.nav.right, 'sdkfjdsf')
363 self.nav.reset()
368 self.nav.left(num)
369 self.assertEqual(self.nav.heading(), result)
370 self.nav.reset()
374 self.nav.right(num)
375 self.assertEqual(self.nav.heading(), result)
376 self.nav.reset()
382 self.nav.right(abs(num))
384 self.nav.left(num)
386 self.assertAlmostEqual(self.nav.heading(), sum_so_far % 360)
389 self.nav.setheading(102.32)
390 self.assertAlmostEqual(self.nav.heading(), 102.32)
391 self.nav.setheading(-123.23)
392 self.assertAlmostEqual(self.nav.heading(), (-123.23) % 360)
393 self.nav.setheading(-1000.34)
394 self.assertAlmostEqual(self.nav.heading(), (-1000.34) % 360)
395 self.nav.setheading(300000)
396 self.assertAlmostEqual(self.nav.heading(), 300000%360)
399 self.nav.forward(100)
400 self.nav.left(90)
401 self.nav.forward(-200)
402 self.assertVectorsAlmostEqual(self.nav.pos(), (100.0, -200.0))
405 self.nav.setx(-1023.2334)
406 self.nav.sety(193323.234)
407 self.assertVectorsAlmostEqual(self.nav.pos(), (-1023.2334, 193323.234))
410 self.nav.left(30)
411 self.nav.forward(-100000)
412 self.nav.home()
413 self.assertVectorsAlmostEqual(self.nav.pos(), (0,0))
414 self.assertAlmostEqual(self.nav.heading(), 0)
417 self.assertAlmostEqual(self.nav.distance(30, 40), 50)
419 self.assertAlmostEqual(self.nav.distance(vec), 0.22000227271553355)
423 self.assertAlmostEqual(self.nav.distance(another_turtle), 10000)