HP Forums

Full Version: LOGO/TURTLE/TORTUGA MODE on HP Prime Graphing Calculator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

TEXAS INSTRUMENTS CALCULATORS TEAM is already publishing its graphic library =0
https://tiplanet.org/forum/viewtopic.php?f=41&t=23794

I think the greatest success of the introduction of a child or young person in the world of computational thinking is the simple graphic manipulation, like the logo/turtle, since it gives "life" to the output or response of an algorithm, instead of just displaying "boring" text.
I think it would be a good complement to HPPRIME to incorporate the LOGO mode app, so children can "paint" drawings with simple instructions

The Numworks calculator has already taken the first step
NumWorks https://github.com/numworks/epsilon/pull/748

PHP Code:
from turtle import 
 
def spiral(N_iteration): 
 
N_iteration *= 25 
 
for i in range(N_iteration): 
 
# Change pen color 
 
gray=255-(i*255/N_iteration
 
pencolor(int(gray),int(gray*0.75),int(gray*0.25)) 
 
# Draw a segment of the spiral 
 
forward(i*0.1
 
left(10 

[Image: 47604134-95e7a000-d9f5-11e8-97b8-4bc499757712.png]


PHP Code:
from turtle import 
 
def koch(N_iteration): 
 
# Save pencil size and set it to 1 
 
prevSize pensize() 
 
pensize(1
 
# Define inner function for recursion 
 
def _koch(nl): 
 if 
== 1
 
forward(l
 else: 
 
_koch(n-1,l/3
 
left(60
 
_koch(n-1,l/3
 
right(120
 
_koch(n-1,l/3
 
left(60
 
_koch(n-1,l/3
 
# Call inner function 
 
_koch(N_iteration,140
 
# Restore pencil size 
 
pensize(prevSize

[Image: 82931_1540924671_5bd8a4ff5f0ab.png]

Source Forum> https://tiplanet.org/forum/viewtopic.php?f=102&t=21922

is already incorporated in xcas. (see pag 15)
https://www-fourier.ujf-grenoble.fr/~par...vie_en.pdf

Tourtle frn info by Thomas Rey Source http://casedesmaths.net/images/pour_tous/xcas.pdf

Tortue Pour ceux qui ne connaissent pas, la tortue graphique faisait partie du langage de programmation Logo créé à la fin des années 1960. Il s’agit en fait d’une « pointe de crayon » à qui on donne des ordres simples du style, avance de 10 unités, tourne de 45°à droite, change de couleur, . . .
Un module tortue est présent dans Xcas, on y accède en cliquent sur le menu Tortue. On obtient alors une fenêtre qui ressemble à la figure 6 (ci-jointe)

On peut écrire dans les lignes de saisie (à gauche de la figure) des instructions simples par exemple avance(30) ou tourne droite(60), . . . et la tortue exécute les ordres ; dans le même temps, les instructions sont recopiées dans la fenêtre de programmation (à droite).
On peut alors compléter par des boucles, des tests, comme dans le module Prog
L’ensemble des ordres possibles est accessible facilement sous la fenêtre graphique par un code à deux lettres av pour avance, re pour recule, . . . (la description s’affiche en « info-bulle » lorsqu’on survole le bouton à l’aide de la souris)

Par exemple, pour tracer un carré un programme possible est le suivant (à saisir à droite)

PHP Code:
pour k de 1 jusque 4 faire 
   avance
(30); 
   
tourne_droite(90); 
fpour

On l’exécute en cliquant dans le menu Edit sur Exec all. Le carré se trace.
Autre exemple qui donne la figure 7 (ci-jointe).
PHP Code:
efface(); // Efface l’ écran 
   
etapes :=36// nombre de cercles "intérieurs" 
   
:=20// longueur d’un côté du polygone à étapes côtés
   
h:=0.5*p/(tan(pi/etapes)); // rayon d’ un cercle intérieur 
   
pas de cote 10// pour centrer la fig 
   
saute 60;  // idem 
  
pour k de 1 jusque etapes faire // boucle 
  
crayon irem(,5); // choix de la couleur du crayon 
  
tourne gauche(360/etapes);// construction d’un côté 
  
avance(p/2);  // suite 
  
rond(h); // trace un cerclef
pour // fin de boucle 


to eng
Ans▶ https://translate.google.com/?hl=eng#fr/en
Make your own.

You do know this is "programmable" don't you?

There is more then just CAS functions. You don't seem to have discovered anything but that yet...
Ironically, Bernard Parisse's version of Xcas for the Casio FX CG-50 — Khicas — does include the turtle program.
Indeed, it's gaining in popularity here in France as a transition between Scratch and Python(-like) programming. Xcas turtle commands would be straightforward to port on the Prime, but interface would require some work and it would probably be easier to implement independantly from the CAS, because in the Xcas implementation computation and drawing are done in 2 independant steps, which is much more complicated than required on a calculator (this limits the number of turtle instructions to 512 on the Casio Prizm because of the memory available).
(10-27-2018 06:56 PM)parisse Wrote: [ -> ]Indeed, it's gaining in popularity here in France as a transition between Scratch and Python(-like) programming. Xcas turtle commands would be straightforward to port on the Prime, but interface would require some work and it would probably be easier to implement independantly from the CAS, because in the Xcas implementation computation and drawing are done in 2 independant steps, which is much more complicated than required on a calculator (this limits the number of turtle instructions to 512 on the Casio Prizm because of the memory available).

Application, anyone?
Original author here. Like Tim said, the HP Prime's programming language can easily support a user turtle implementation without needing the HP's team help to do it, as long as someone writes it. While I'm here, I'll point out that (if I recall correctly) the official MicroPython port of the Casio 90+E can't currently do graphics and neither does the not-yet-released external Python module for the TI-83 Premium CE.

For the NumWorks, I'm going for a native implementation because that calculator's Python environment is a bit cramped for a "nice" turtle. It should make a nice surprise for my nephew next time he plays with my calculator.
(10-27-2018 04:32 PM)Tim Wessman Wrote: [ -> ]Make your own.

You do know this is "programmable" don't you?

There is more then just CAS functions. You don't seem to have discovered anything but that yet...

But Tim, what about adding turtle to the Prime, while reducing ram usage and getting more free flash space?

Also, a new CAS simple deep-learning algorithm could be used to predict if the user does not want these and remove it, freeing more space Rolleyes

[Image: fekkfiq.png]
(10-28-2018 04:51 PM)compsystems Wrote: [ -> ]According to my experience in the teaching of basic computer science for secondary and tertiary students, who have practically no knowledge of computer language (Colombia is an underdeveloped country, just emerged from a conflict after 50 years of war), requires educational technology backed for with good didactic units. I think that the hp-prime Xcas is a great CAS and device, although a bit complicated, the first thing is that you should coficate yourself as close as possible to the mathematical language, in addition to the programming alternatives like logo/turtle pre-included, the applications of Third parties, discourage the beginner, who has little experience in the installation, configuration, loading and removal of applications.
I emphasized the key word
It's up to the teacher/educational system.

what is the word "coficate"? (underlined)
(10-28-2018 04:55 PM)CyberAngel Wrote: [ -> ]
(10-28-2018 04:51 PM)compsystems Wrote: [ -> ]According to my experience in the teaching of basic computer science for secondary and tertiary students, who have practically no knowledge of computer language (Colombia is an underdeveloped country, just emerged from a conflict after 50 years of war), requires educational technology backed for with good didactic units. I think that the hp-prime Xcas is a great CAS and device, although a bit complicated, the first thing is that you should coficate yourself as close as possible to the mathematical language, in addition to the programming alternatives like logo/turtle pre-included, the applications of Third parties, discourage the beginner, who has little experience in the installation, configuration, loading and removal of applications.
I emphasized the key word
It's up to the teacher/educational system.

what is the word "coficate"? (underlined)

Maybe it's from the same lexical root as "covfefe" Smile
(10-29-2018 12:12 AM)compsystems Wrote: [ -> ]X
Autre exemple
Another example. – That I understood...
Everything old is new again.

I remember using LOGO in Elementary school (~1982) on a Apple ][ plus.
It would also mean every single one of the many commands would appear EVERYWHERE and be commands everywhere, no matter if relevant or not.

This would be a few days at work for an end user to create a much better version more fit for Prime. It is a good thing we created a PROGRAMMABLE graphing calculator, huh? Big Grin
(10-30-2018 01:17 PM)Tim Wessman Wrote: [ -> ]It would also mean every single one of the many commands would appear EVERYWHERE and be commands everywhere, no matter if relevant or not.

This would be a few days at work for an end user to create a much better version more fit for Prime. It is a good thing we created a PROGRAMMABLE graphing calculator, huh? Big Grin

Turtle ! okay
but
Lambert W,....fully implemented?
Remind me when they begin to catch up to everything else...

In the meantime, I look forward to seeing your published software you are working on.
It is known that the Python app may come in the future, if that happens I would very much like TURTLE to come with it, as long as it does not represent any inconvenience design.

For being an academic module seems to me a good alternative, especially because it allows the teacher to choose according to their pedagogical strategy, but it is true that it is not necessary to stack everything in HP Prime, there are devices that can be more compatible compared than a 320x240 calculator whose objective is to be a mini tool. The current simplicity and cleanliness of hp prime is highly appreciated so far.
Reference URL's