dhellmann / google-highly-open-participation-psf

Automatically exported from code.google.com/p/google-highly-open-participation-psf
0 stars 0 forks source link

Write a simple turtle graphics module for Crunchy. #174

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Crunchy can make use of the <canvas> tag to create graphics interactively
on a page inside Firefox.  There are two modules that can be used
for this: graphics.py and math_graphics.py; the difference between
these two modules is the orientation of the positive y axis.

Using math_graphics.py as your inspiration, write a simple turtle
module for Crunchy.  The minimum functions you should include are: 
forward(), backward(), goto(), left(), right(), pen_up(), pen_down(), 
set_color() == set_colour(), circle(), init_graphics().  
In addition, you must write an html page that includes these 
functions inside a <pre> element that could be used as a sample page for 
Crunchy.

You can download Crunchy from

http://code.google.com/p/crunchy

To complete this task, in addition to being familiar with Python,
you will need to know some basic javascript.  You will also
need to know some basic trigonometry (sine and cosine).

You may find it useful to have a look at the canvas tutorial at
http://developer.mozilla.org/en/docs/Canvas_tutorial

Time to complete: you must complete this task within 5 days (120 hours) of
having claimed it.  An extension of a few days is possible if you show
that you have made some significant progress.

Bonus points: Implement other useful turtle functions than those listed above.

Bonus points: While your "turtle" only needs to draw lines on the screen,
you will get bonus points if you load a turtle image that moves on the
screen with the pen.  This image need not change orientation.

Big bonus points: Have it set up so that the image of the turtle
rotates so that it always points in the direction where it is moving.
(I do not know if this is possible with a single image using the javascript 
canvas
inside Firefox.)

Completion:

Attach your module (turtle.py) and the html sample page (turtle.html),
and possibly an image (turtle.png).

Task duration: please complete this task within 5 days (120 hours) of claiming 
it.

Original issue reported on code.google.com by the.good...@gmail.com on 7 Dec 2007 at 7:23

GoogleCodeExporter commented 9 years ago
I claim this task.

Original comment by taricorp on 7 Dec 2007 at 9:55

GoogleCodeExporter commented 9 years ago
Go ahead!   Please write to the discussion list if you encounter any problems, 
no
matter how trivial (especially at the beginning).

Original comment by andre.ro...@gmail.com on 7 Dec 2007 at 9:58

GoogleCodeExporter commented 9 years ago

Original comment by andre.ro...@gmail.com on 7 Dec 2007 at 9:58

GoogleCodeExporter commented 9 years ago

Original comment by andre.ro...@gmail.com on 7 Dec 2007 at 10:08

GoogleCodeExporter commented 9 years ago
I'd like to request an extension for this task.
It's mostly complete, but I've been experimenting with ways to draw (the easy 
part)
and erase a turtle image for a while, and I should have it ready reasonably 
soon,
assuming the scheme I have now will work (it should.. this is the least elegant
strategy I had).

Original comment by taricorp on 14 Dec 2007 at 1:49

GoogleCodeExporter commented 9 years ago
As I have seen an earlier version, I'm ok with granting an extension.  However, 
it
would be so much better if you had attached a copy of what you have (working) 
so far.
 I encourage you to do so.

Original comment by andre.ro...@gmail.com on 14 Dec 2007 at 1:59

GoogleCodeExporter commented 9 years ago
Here it is, then.  Everything appears to work (I haven't tested thoroughly, 
though).
 This is all my current code; I just commented out all references to _redraw_turtle
in the main functions.

Original comment by taricorp on 14 Dec 2007 at 9:36

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks; I'll have a look at it and possibly write some comments on the ghop 
python
discuss group.

Original comment by andre.ro...@gmail.com on 14 Dec 2007 at 9:38

GoogleCodeExporter commented 9 years ago

Original comment by georg.br...@gmail.com on 15 Dec 2007 at 10:07

GoogleCodeExporter commented 9 years ago
Extending by 1 day as good progress is being made.

Original comment by andre.ro...@gmail.com on 15 Dec 2007 at 2:32

GoogleCodeExporter commented 9 years ago
I hope to have this complete within a day or two.  I've implemented a logging
interface (so I can erase and redraw the turtle graphic), but it still needs 
tweaking
to actually work.

Original comment by taricorp on 18 Dec 2007 at 3:45

GoogleCodeExporter commented 9 years ago
Extending by two days; again, it would be appropriate to upload a copy of your
turtle.py file for inspection - for comments/suggestions

Original comment by andre.ro...@gmail.com on 18 Dec 2007 at 3:50

GoogleCodeExporter commented 9 years ago
Sure, here it is.

I'm not really happy with the logging.  In general, the 'getting caller' stuff 
feels
rather hacky, and all the instances of _log_action don't feel very elegant.  It
should work, though (with some changes).

Original comment by taricorp on 18 Dec 2007 at 3:57

Attachments:

GoogleCodeExporter commented 9 years ago
I like the look of the turtle!

It can see that some more work is needed but you are making progress.  Feel 
free to
ask questions on the discussion list if you think you could use some help.

Original comment by andre.ro...@gmail.com on 18 Dec 2007 at 4:05

GoogleCodeExporter commented 9 years ago
Setting the task to completed, as per message on ghop-python list.  It satisfies
almost all of the initial requirement (except for setting the color) and 
includes the
"bonus" features.  Well done!

Original comment by andre.ro...@gmail.com on 19 Dec 2007 at 4:14