Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.
Menu
Calculatrices
Graph 35 à 100
Graph 25+Pro/25+E/25+E II
Graph 35+USB/75(+E)/85/95 SD
Graph 100(+)
Classpad 300/330(+)
fx-CG 10/20 (Prizm)
Classpad 400(+E)
Graph 90+E
fx-92+ SC
Liens
¤ Vous cherchez une fonction ?
Utilitaires >> Graph 90+E >> Graphisme >> Dessin Binaire
Dessin Binaire
Version : 1.0 Taille : 1970 octets Ajouté le : 2023-02-11 12:48 Modifié le : 2023-02-11 18:40
Auteur : Shraf
Posté par :
AcrocasioHors ligneMembrePoints: 974 Défis: 0 Message
Planète Casio - Programme Casio de graphisme - Dessin Binaire - Shraf - Calculatrices
Nombre de visites sur cette page : 536
Score au progrank : 21
Pas encore de note !
Vous devez être connecté(e) pour noter (inscription).
107 téléchargements | Soumettre un test


Description en français :

Un programme de Schraf, un génie qui a codé un utilitaire en Python qui permet de faire des graphismes plutôt joli en binaire.

Schraf dit, je cite,
"Je mets ci-dessous des codes utilisant l'idée de convertir chaque colonne (je me suis limité à 40 px) en binaire (0 = noir, 1 = blanc) ce qui donne un nombre décimal sur 12 chiffres max. Par exemple 0 donnera une colonne noire.

Partie Gimp en utilisant une image en noir & blanc de 190 x 40 px (on obtiendra donc 190 nombres puisque 190 colonnes) :

CODE Python :

def gimp2fx92():
   img = gimp.image_list()[0]
   drw = pdb.gimp_image_active_drawable(img)
   L = pdb.gimp_image_width(img)
   H = pdb.gimp_image_height(img)
   for x in range(L):
    for y in reversed(range(H)):
      v = sum(list(pdb.gimp_image_pick_color(img,drw,x,y,1,0,0))[:-1])
      c = (v != 0) if y == H - 1 else 2 * c + (v != 0)
    print c



Script sur la fx-92+ Spéciale Collège :

CODE ALGORITHMIE FX 92 :
-95 →B
S'orienter à -90
Répéter jusqu'à  B=95
Aller à x= B , y= 22
? →A
B + 1 →B
Répéter 40
   A ÷ 2 →A
   Si A = Ent(A)
    Stylo écrit
    Avancer de 0 pixels
   Fin
   Stylo relevé
   Avancer de 1 pixels
   Ent(A) →A




La difficulté pour la macro est d'estimer le temps d'attente entre la saisie de chaque nombre. J'ai remarqué que la clé USB CASIO était plus lente lorsque l'on utilise l'émulateur en étant connecté à Internet donc j'ai débranché câble et coupé Wifi de l'ordinateur. Il faut compter une dizaine de secondes pour tracer une colonne, j'ai mis 12 secondes ce qui fait 12 * 190 = 38 minutes pour avoir le dessin... Il faudrait que la macro estime le temps de traçage en fonction du nombre de traits qu'il y aura à tracer.

J'ajoute également cette version Python qui permet de vérifier le rendu final sur une NUMWORKS ou autres."


Cette version viens justement de ce programme.

Bon amusement

Compatibilité avec les autres calculatrices :

English description:

A program from Schraf a geniuse who have coded a utility in Python that allows you to make rather nice graphics in binary.

Schraf says, I quote,
"I put below codes using the idea of ​​converting each column (I limited myself to 40 px) in binary (0 = black, 1 = white) which gives a decimal number on 12 digits max. For example 0 will give a black column.

Gimp part using a black & white image of 190 x 40 px (we will therefore obtain 190 numbers since 190 columns):

Python CODE:

def gimp2fx92():
   img = gimp.image_list()[0]
   drw = pdb.gimp_image_active_drawable(img)
   L = pdb.gimp_image_width(img)
   H = pdb.gimp_image_height(img)
   for x in range(L):
    for y in reversed(range(H)):
      v = sum(list(pdb.gimp_image_pick_color(img,drw,x,y,1,0,0))[:-1])
      c = (v != 0) if y == H - 1 else 2 * c + (v != 0)
    print c



Script on the fx-92+ Special College:

FX 92 ALGORITHM CODE:
-95 →B
Orientation at -90
Repeat until B=95
Go to x= B , y= 22
? →A
B+1 →B
Repeat 40
   A ÷ 2 →A
   If A = Int(A)
    writing pen
    Advance 0 pixels
   END
   Pen up
   Move forward 1 pixel
   Int(A) →A




The difficulty for the macro is to estimate the waiting time between entering each number. I noticed that the CASIO USB key was slower when using the emulator while connected to the Internet so I unplugged the cable and cut off the computer's Wifi. It takes about ten seconds to draw a column, I took 12 seconds which makes 12 * 190 = 38 minutes to have the drawing... The macro would have to estimate the drawing time according to the number of lines that will have to be drawn.

I also add this Python version which allows to check the final rendering on a NUMWORKS or others."


This version comes from this program.

Good fun

Casio Graph 90+E/ Fx CG 50: OK

Casio Graph 35+E II / fx-9750/9860GIII: OK (with the appropriate module )

Numworks; OK for all


PS: Works on all Python platforms including the Turtle module


The "data" variable can very well be modified to be able to make your own graph;)


Commentaires :


Potter360Hors ligneRédacteurPoints: 1221 Défis: 2 Message
Posté le 11-02-2023 à 13:07 | #
le code c’est du Python, pas du C++
AcrocasioHors ligneMembrePoints: 974 Défis: 0 Message
Posté le 11-02-2023 à 13:11 | #
heu, oui, pardon, sur le topic de TI-Planet, il y avait écrit "Code Bash" pour la fx92, mais j'ai modifié. Pour le Python, c'est une seul ligne qui m'a induit en erreur

Je modifie ça, merci d'avoir signaler
Potter360Hors ligneRédacteurPoints: 1221 Défis: 2 Message
Posté le 11-02-2023 à 13:19 | #
« CODE C : »
AcrocasioHors ligneMembrePoints: 974 Défis: 0 Message
Posté le 11-02-2023 à 13:28 | #
Ouah, je suis fatigué moi
Srt_demon83Hors ligneMembrePoints: 141 Défis: 0 Message
Posté le 11-02-2023 à 14:32 | #
Ca marche sur 35+II ?
Parce que j'ai micro python
AcrocasioHors ligneMembrePoints: 974 Défis: 0 Message
Posté le 11-02-2023 à 14:41 | #
Salut Srt_demon83 o/

Je ne pense pas, mais le plus important, c'est d'avoir Python ET le module Turtle ( https://docs.python.org/fr/3/library/turtle.html ), donc si il n'est pas adapté sur ta calculatrice, ce n'est pas possible avec ce programme la.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 149 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd