-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object oriented mode #60
Comments
almost done, one fix needed. this line must call send_report from turtleprocess.py. |
Very cool idea! Let me look at that problem. |
I think the problem is that you're not calling (Note: Classes should have a Capitalized name.) |
i know about send report, i trying to call it, but i cant. please help me! ) this is correct place to call send report: http://github.com/darvin/PythonTurtle/blob/master/src/animals.py locals()"send"i have no idea |
Why do you think that the right place to call it is in And please explain your reasoning regarding |
in go and turn self.position and self.orientation changes, so setattr will trigg at proper place (i checked) real problem is that .sendreport() in turtleprocess.py, and old go() turn() etc was in turtleprocess. but now, go, turn etc in animal.py and i have no idea how to call method of animal.py from animals.py |
(Note: Please wrap code segments with backticks (Character to left of "1") for readability.) I understand the problem now. (Nice idea with I think I have a solution. First, rename Now you could call |
i ll try |
cool! it works well! |
Getting rid of I think that letting users switch modes would be slightly confusing. (Remember, little children.) What I think would be good is a combination of both modes: The OOP mode will be on but a turtle will be created at startup, and the |
i do not think so. |
in oop mode, if there is not objects - no turtles. it is clear |
The snippet of code you gave is indeed a bit confusing; The Giving modes is problematic. Remember this should be usable by a young child who doesn't know what programming is, let alone what OOP is. Even the concept of changing modes might be hard for him. He might not even think to check the menu for it. Also, if you have two separate modes, what will you do with the drawing and existing turtles when the user switches mode? Destroy them? Not nice. |
understanding OOP, when we have global function with same name that object method is hard. |
by default, we run in "One Turtle (light mode)". If kid is smart, it checks menu. |
Can you please explain thoroughly what are the advantages of having a separation between the two modes, in contrast to having both of them at the same time? You gave one argument up to now, that it will be confusing that there is both Can you please explain the advantages of your approach? Here are the advantages of the combined approach:
|
i understand. may be we make "settings" or command-line argument for pure OOP mode? |
Ah, so by default it will be procedural+OOP, and only with the special setting it will be pure OOP? Sounds okay. Having a menu check-box to do it sounds good. (It can be called "Pure OOP Mode (Delete initial turtle)"). A command-line argument for pure OOP can also be added (in addition to the menu setting), I'm okay with that. |
we can make two options in menu: |
I'd want to change "Reset (Delete initial turtle)" to "Reset and delete initial turtle". That will be alright with me. |
ok. |
I have no time to implement anything regarding PythonTurtle. I can only guide you in implementing it. I don't see any problem with resetting the process. You terminate the existing process with |
Object Oriented mode
Make 2 modes in application:
Procedure - current
Object Oriented.
It will be swiched in menu (?)
When OO mode is swiched, turtle widget blanks.
then we can use OO approach:
It will be coolest education application ever!
The text was updated successfully, but these errors were encountered: