turtle demo

45 views
Skip to first unread message

John Hanna

unread,
Oct 27, 2021, 9:56:31 PM10/27/21
to tins...@googlegroups.com

Here’s a cool little demo…

 

And the CX code (just copy/paste into a python program):

 

from turtle import *

orange=(255,128,0)

colors=['red','magenta','blue','green','yellow',orange]

t=Turtle()

t.speed(0)

t.pencolor('black')

t.right(6)

t.dot(360)

for x in range(720):

  t.pencolor(colors[x%6])

  #t.width(x/100+1)

  t.forward(x/3.5)

  t.left(59)

 

Do good,

     John

 

image001.png

John Hanna

unread,
Oct 27, 2021, 10:08:07 PM10/27/21
to tins...@googlegroups.com

Using a smoother color palette…

 

Do good,

     John

--
--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinspire/002c01d7cb9f%2405946990%2410bd3cb0%24%40gmail.com.

image002.png
image003.png
Message has been deleted

John Hanna

unread,
Oct 28, 2021, 6:38:37 AM10/28/21
to tins...@googlegroups.com

I was hoping someone would notice orange:

 

The TI-developed turtle module contains some standard colors but ‘orange’ is not one of them. So I defined the variable orange and added it to the list of colors. Works fine, eh.

 

The second screenshot uses a custom color palette of my own design.

 

Do good,

     John

 

From: tins...@googlegroups.com <tins...@googlegroups.com> On Behalf Of Tom Lake
Sent: Thursday, October 28, 2021 12:21 AM
To: tinspire <tins...@googlegroups.com>
Subject: [tinspire] Re: turtle demo

 

Nice! I do have one question, though. Why isn't orange in quotes?

--

--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.

Tom Lake

unread,
Oct 28, 2021, 11:45:59 AM10/28/21
to tinspire
I just tried it on my TI-nspire CX II CAS and I get the message that Turtle isn't defined. It doesn't error out on the import statement so I'm puzzled.
I have OS ver. 5.3.2.129.

Do you know what's going on?

On Wednesday, October 27, 2021 at 9:56:31 PM UTC-4 John Hanna wrote:

John Hanna

unread,
Oct 28, 2021, 12:48:36 PM10/28/21
to tins...@googlegroups.com

You have to install the turtle module. Get it from

https://education.ti.com/en/product-resources/turtle-module/nspire-python

 

Follow the directions on page 1.1 of the file.

 

Do good,

     John

 

From: tins...@googlegroups.com <tins...@googlegroups.com> On Behalf Of Tom Lake
Sent: Thursday, October 28, 2021 11:46 AM
To: tinspire <tins...@googlegroups.com>
Subject: [tinspire] Re: turtle demo

 

I just tried it on my TI-nspire CX II CAS and I get the message that Turtle isn't defined. It doesn't error out on the import statement so I'm puzzled.

--

--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime

---
You received this message because you are subscribed to the Google Groups "tinspire" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinspire+u...@googlegroups.com.

John Hanna

unread,
Oct 28, 2021, 1:18:39 PM10/28/21
to tins...@googlegroups.com

Tom, you may have a different turtle module installed since you are not getting a ‘module not found’ error. Check your PyLib folder.

 

The ‘official’ one that I am using uses a capital T for the turtle constructor, hence t=Turtle(). There are others. I have one called ‘cx_turtle’ which I had a large part in developing, but… it’s not ‘official’ and it’s not called ‘turtle.tns’.

 

Do good,

     John

Tom Lake

unread,
Oct 28, 2021, 1:40:50 PM10/28/21
to tinspire
OK. I had copied it over to the calculator but I hadn't installed it as a module. My Python program was named turtle so it got confused.
I just installed the module and, just for fun, I tried putting orange in quotes and commenting out the orange=(255,128,0) line.
Surprise! It works fine! I guess TI has improved the turtle module since you downloaded it.
I notice it looks great in the Student Software but on the physical calculator, there are extraneous lines. I've triple-checked the program and am confident that it is a duplicate of yours
(except for orange, as noted)

Tom Lake

unread,
Oct 28, 2021, 1:47:37 PM10/28/21
to tinspire
Here's what mine looks like on the PC screen with 'orange' instead of using a tuple:

Turtle.png

from turtle import *
colors=['red','magenta','blue','green','yellow','orange']
t=Turtle()
t.speed(0)
t.pencolor('black')
t.right(6)
t.dot(360)
for x in range(720):
  t.pencolor(colors[x%6])
  #t.width(x/100+1)
  t.forward(x/3.5)
  t.left(59)

John Hanna

unread,
Oct 28, 2021, 3:24:45 PM10/28/21
to tins...@googlegroups.com

Yep. ‘orange’ is in there but not on the menu. I may have misspeled it when trying it the first time.

 

Note: not all turtle methods are on the menus to keep the menus manageable.

Examples: ‘orange’, t.towards( )

 

Do good,

     John

 

From: tins...@googlegroups.com <tins...@googlegroups.com> On Behalf Of Tom Lake
Sent: Thursday, October 28, 2021 1:48 PM
To: tinspire <tins...@googlegroups.com>
Subject: Re: [tinspire] Re: turtle demo

 

Here's what mine looks like on the PC screen with 'orange' instead of using a tuple:

 

image001.png

Tom Lake

unread,
Oct 28, 2021, 4:20:11 PM10/28/21
to tinspire
I'd think that even if it didn't fit on the menu that it would be in the Getting Started Guide, but no.
Reply all
Reply to author
Forward
0 new messages