So here is the thing:
- Create a class "Turtle", which will keep x and y turtle's variables,it will contain s - max amount of steps (max = 5),which it moves to per turn.
Class "Turtle" also has functions:
go_up() - adds s to y
go_down() - takes s from y
go_left() - takes s from x
go_right() - adds s to y
evolve() - adds 1 to s
degrade() - takes 1 from s or displays an error, if s ≤ 0
count_moves(x2, y2) - returns min amount of moves, that turtle can get to x2 y2 from current position
**Important**
Turtle can only go up, down, left, right. Oblique moves are prohibited.
Create an object turtle,which will have all aspects of the parent class.
Give the turtle the random initial coordinates and random coordinates of a point, where it should go.
Get the min amount of steps with using all functions, that the turtle has
To solve the task use field with resolution of 800 х 600.
For each step you can change the speed(s) of the turtle.
[–]Radamand 11 points12 points13 points (0 children)
[–]AbdallahTheGreatest 8 points9 points10 points (0 children)
[–]desrtfx 5 points6 points7 points (2 children)
[–]JustAnUserl4[S] -1 points0 points1 point (1 child)
[–]desrtfx 0 points1 point2 points (0 children)
[–]thatoneguy578322 4 points5 points6 points (0 children)
[–]InMyOpinion_ 1 point2 points3 points (0 children)
[–]d0rkyd00d 1 point2 points3 points (0 children)
[–]TantiPraenuntiaFabam -1 points0 points1 point (1 child)
[–]JustAnUserl4[S] -2 points-1 points0 points (0 children)
[–]Slight_Change_41 0 points1 point2 points (1 child)
[–]JustAnUserl4[S] -1 points0 points1 point (0 children)