DEV Community

Cover image for Turtle Graphics implementation for Android
Amr Hesham
Amr Hesham

Posted on

Turtle Graphics implementation for Android

Hello everyone, in this article I want to introduce my last side project which is called Turtle, the project idea is totally inspired by the Turtle Graphics Project.

What is the Turtle Graphics project?

Today you may know Turtle graphics from the turtle implementation in the standard library in Python that allows you to control one or more turtles in a two-dimensional space, but the original one first appeared in the late 1960s as a key feature of the programming language called Logo which designed in 1967 by Wally Feurzeig, Seymour Papert, and Cynthia Solomon, you can read more information about Logo and some modern derivatives from wikipedia.

After I played with the turtle module in python and loved it, I searched on google play for Android Version with the same idea so I can have instructions, variables, control flow, data structures…etc, and I didn’t find any app with those features, so I decided to implement one as a side project.

The first step is to have a programming language easy to write and understand the syntax so i created a small one with syntax like python and I called it Lilo (the name is from Lilo and Stitch animation and like logo), so we can have functions, if, loops, variables, constants and a set of instructions for drawing and control the colors but for now you can only control one turtle so here is one example to draw Rainbow Benzene in Python and Lilo.

The Python version

Image description

The Lilo version.

Image description

The result will be like this

Image description

Lilo also provide a clean error and warns messages with line and column numbers so you can easily correct your script.

If you are interesting in a created programming language like Lilo you can start with those two amazing books

1 — Crafting Interpreters by Robert Nystrom

2 — Writing An Interpreter In Go by Thorsten Ball

The next step after I created the programming language was to create a code editor for it and a preview screen, for the code editor I used the CodeView library to provide highlighter, auto complete, snippets, error and warn highlighter and for the diagnostics messages, I used TreeView library so you an expand or collapse errors, warns or both easily.

Image description

for the preview screen I have created a simple custom view that can take the Lilo executor and draw the result you can check the code from here.

Image description

After that I implemented a documentations expanding list easily by generating it using EasyAdapter library and also I implemented save, update, search, and delete your lilo scripts as a lilo packages with some extra meta data.

Image description

Turtle Android App is available now on Google Play and the source code on Github so you are welcome to suggest features, report bugs, and contribute.

Google play: Turtle Graphics App

Github: AmrDeveloper/turtle

Here is demo video for turtle app that convert many python examples to lilo check it from here.

Enjoy Programming 😋.

Top comments (15)

Collapse
 
atozlistof01 profile image
atozlistof01 • Edited

Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.

atozlistof.com/top-10-imdb-movies-...
atozlistof.com/top-10-freedom-figh...
atozlistof.com/top-10-football-pla...
atozlistof.com/top-10-engineering-...
atozlistof.com/top-10-engineering-...

Savitri Singh

Collapse
 
amrdeveloper profile image
Amr Hesham

Thank you so much for your amazing feedback, I am happy that you liked it :D, I will soon create new post about a improvement in the implementation and new features

Collapse
 
atozwebsitereview profile image
A To Z Webiste Review

 Thank you so much for sharing excellent information share with your visitor. Your posts are very so cool and unique. I’m impressed by the details that you’ve on this website article. I am coming back to your website for more soon. Manscaped
Computer Center Franchise in India
Sinkoth :-)

Collapse
 
amrdeveloper profile image
Amr Hesham

Thank you so much for your amazing feedback, I am happy that you liked it :D

Collapse
 
amrdeveloper profile image
Amr Hesham

Thank you so much for your amazing feedback, I am happy that you liked it :D

Collapse
 
sanfurniture profile image
SAN FURNITURE

**Swivel TV Unit
**A swivel television lets you place your television in the best viewing angle. This is particularly useful in offices and living spaces. It's also a smart method to place your television in an area that is in a corner.

If you are looking for a swivel TV Unit it is essential to look for one that is compatible with the dimensions of your television. Also, be aware of whether the stand comes with an open or vented back. Also, make sure to determine whether the stand can be configured to handle any cable-management route.

There are a variety of brands of swivel television stands come with a range of designs and features. They include glass, metal and wood. You can pick a design that is sleek and modern, but also more conventional. No matter which style you pick, you'll need to make sure it has ample storage space.

Collapse
 
imofullform profile image
IMO Full Form

Nice post author. Thank you. Keep it up. This article is very informative. It is very useful for me. Kindly share more articles with me. I shall be very thankful to you. KGF Full Form
RMP Full Form
Sinkoth :-)

Collapse
 
amrdeveloper profile image
Amr Hesham

Thank you so much for your amazing feedback, I am happy that you liked it :D

Collapse
 
digitalindia02 profile image
digitalindia02

Thank you for sharing. Excellent post…! It is a very great idea and unique content. Thank you so much.

Distributor
Amul Dairy Center
Amul Milk Collection
Amul Dealership
Amul Franchise Service
Amul Distributor

S.Gupta

Some comments may only be visible to logged-in visitors. Sign in to view all comments.