FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» select intégrés
Compatibilité avec Yabasic: Turtle graphics Emptypar jjn4 Aujourd'hui à 18:33

» Aide de PANORAMIC
Compatibilité avec Yabasic: Turtle graphics Emptypar leclode Aujourd'hui à 18:23

» PANORAMIC V 1
Compatibilité avec Yabasic: Turtle graphics Emptypar Klaus Aujourd'hui à 9:53

» Je teste PANORAMIC V 1 beta 1
Compatibilité avec Yabasic: Turtle graphics Emptypar Klaus Aujourd'hui à 9:52

» bouton dans autre form que 0
Compatibilité avec Yabasic: Turtle graphics Emptypar leclode Hier à 13:59

» KGF_dll - nouvelles versions
Compatibilité avec Yabasic: Turtle graphics Emptypar Klaus Hier à 11:41

» Gestion d'un système client-serveur.
Compatibilité avec Yabasic: Turtle graphics Emptypar Klaus Hier à 10:23

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Compatibilité avec Yabasic: Turtle graphics Emptypar Froggy One Jeu 2 Mai 2024 - 11:16

» @Jack
Compatibilité avec Yabasic: Turtle graphics Emptypar Jack Mar 30 Avr 2024 - 20:40

» trop de fichiers en cours
Compatibilité avec Yabasic: Turtle graphics Emptypar papydall Lun 29 Avr 2024 - 23:39

» Une calculatrice en une ligne de programme
Compatibilité avec Yabasic: Turtle graphics Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
Compatibilité avec Yabasic: Turtle graphics Emptypar leclode Sam 27 Avr 2024 - 17:59

» Bataille navale SM
Compatibilité avec Yabasic: Turtle graphics Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Les maths du crocodile
Compatibilité avec Yabasic: Turtle graphics Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

» Naissance de Crocodile Basic
Compatibilité avec Yabasic: Turtle graphics Emptypar jean_debord Jeu 25 Avr 2024 - 8:45

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
-40%
Le deal à ne pas rater :
-40% sur le Pack Gaming Mario PDP Manette filaire + Casque filaire ...
29.99 € 49.99 €
Voir le deal

 

 Compatibilité avec Yabasic: Turtle graphics

Aller en bas 
+2
Klaus
lodchjo
6 participants
AuteurMessage
lodchjo

lodchjo


Nombre de messages : 162
Age : 53
Localisation : Anvers
Date d'inscription : 26/12/2011

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyLun 13 Fév 2012 - 15:14

Et encore plus joli, c'est ce bout de code:

En PANORAMIC

Code:

dim lenght, angle, difference, angle_difference, x, y, x2, y2, a, b, counter, pi
width 0, 650:height 0, 650
picture 1
full_space 1
2d_pen_color 0,0,100
lenght = 500
angle = 1
pi = 3.14159265
x = 50
y = 550
difference = 2
angle_difference = 0.5
y2 = y - lenght
2d_line x, y, x, y2
lenght = lenght - difference
y = y2
counter = 0
while (counter < 62)
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x2 = x + b
   y2 = y + a
   2d_line x, y, x2, y2
   angle = angle + angle_difference
   lenght = lenght - difference
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x = x2 - a
   y = y2 + b
   2d_line x2, y2, x, y
   angle = angle + angle_difference
   lenght = lenght - difference
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x2 = x - b
   y2 = y - a
   2d_line x, y, x2, y2
   angle = angle + angle_difference
   lenght = lenght - difference
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x = x2 + a
   y = y2 - b
   2d_line x2, y2, x, y
   lenght = lenght - difference
   angle = angle + angle_difference
   counter = counter + 1
end_while
end

(Et la version en Yabasic:)
Code:

clear screen
open window 600, 600
backcolor 0, 0, 0
clear window
lenght = 500
angle = 1
x = 50
y = 550
difference = 2
angle_difference = 0.5
y2 = y - lenght
line x, y, x, y2
lenght = lenght - difference
y = y2
counter = 0
color_value = 7
while (counter < 62)
   color 0, color_value, color_value
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x2 = x + b
   y2 = y + a
   line x, y, x2, y2
   angle = angle + angle_difference
   lenght = lenght - difference
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x = x2 - a
   y = y2 + b
   line x2, y2, x, y
   angle = angle + angle_difference
   lenght = lenght - difference
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x2 = x - b
   y2 = y - a
   line x, y, x2, y2
   angle = angle + angle_difference
   lenght = lenght - difference
   a = int (sin (angle * pi / 180) * lenght)
   b = int (cos (angle * pi / 180) * lenght)
   x = x2 + a
   y = y2 - b
   line x2, y2, x, y
   lenght = lenght - difference
   angle = angle + angle_difference
   counter = counter + 1
   color_value = color_value + 3
wend
inkey$
end
Revenir en haut Aller en bas
http://lode.weebly.com
Klaus

Klaus


Nombre de messages : 12293
Age : 74
Localisation : Ile de France
Date d'inscription : 29/12/2009

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyJeu 16 Fév 2012 - 18:15

Très joli ! Cela me rappelle mes études...
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyJeu 16 Fév 2012 - 21:02

merci pour la conversion, je mets une variante pour le fun ( ce n'est pas une transpo hein, juste une variante de ta version Panoramic du programme converti)

Code:
dim lenght : lenght = 500
dim angle  : angle = 1
dim difference : difference = 2
dim angle_difference : angle_difference = 0.5
dim x, y : x = 50 : y = 550
dim x2, y2, a, b
dim c1, c2, c3 : c1 = 0 : c2 = 0 : c3 = 255
dim inc : inc = 1
dim counter : counter = 0
dim pi : pi = 3.14159265

width 0, lenght + 100:height 0, lenght + 100
picture 1 : full_space 1: 2d_pen_color c1,c2,c3

y2 = y - lenght : 2d_line x, y, x, y2
lenght = lenght - difference : y = y2

while (counter < 150)

  c1 = c1+1 : c2= c2 + 5 * inc : c3 = 255 - int(rnd(255))
  if c2 > 255 then inc = -1 * inc : c2 = 255
  if c2 < 0 then  inc =-1 * inc : c2=0
  2d_pen_color c1,c2,c3
 
  a = int (sin (angle * pi / 180) * lenght) :    b = int (cos (angle * pi / 180) * lenght)
  x2 = x + b :    y2 = y + a
  2d_line x, y, x2, y2
  angle = angle + angle_difference :    lenght = lenght - difference
 
  a = int (sin (angle * pi / 180) * lenght) :    b = int (cos (angle * pi / 180) * lenght)
  x = x2 - a :    y = y2 + b
  2d_line x2, y2, x, y
  angle = angle + angle_difference :    lenght = lenght - difference

  a = int (sin (angle * pi / 180) * lenght) :    b = int (cos (angle * pi / 180) * lenght)
  x2 = x - b :    y2 = y - a
  2d_line x, y, x2, y2
  angle = angle + angle_difference :    lenght = lenght - difference

  a = int (sin (angle * pi / 180) * lenght) :    b = int (cos (angle * pi / 180) * lenght)
  x = x2 + a :    y = y2 - b
  2d_line x2, y2, x, y
  lenght = lenght - difference :    angle = angle + angle_difference

  counter = counter + 1

end_while
end
Revenir en haut Aller en bas
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyVen 17 Fév 2012 - 0:31

Une petite conversion aussi, aller, je me lance Smile

Code venant à l'origine de Creative Basic et transposé en Aurel Basic sur le forum de ce langage:

Code Aurel Basic:
Code:
' Mathematical Patterns - GWS Aug 2011
'original code written in Creative Basic
defnum i n red green blue
defnum ww wh dots xpos ypos
defnum repeat rand
defnum a b c x y z j xfocus yfocus
defnum rr gg bb
ww=800
wh=600
'open window
WIN 0 0 ww wh # "CB Fractal Patterns"
Maincolor 0 0 0

xfocus = ww * 0.47
yfocus = wh * 0.45

'create button
wControl Wbutton 4 4 100 25 SYS_TYPE 100
ControlColor 100 RGB 100 200 100 0 0 180
SetText 100 "NEXT"
FrontColor 220 220 0
Print 110 10 "COUNT:"

'GOSUB draw

WAIT

SUBID 100
Maincolor 0 0 0
ShowControl 100 <HIDE>
GOSUB draw
ENDSUB

SUB draw
NOSLEEP 1
rand=INT(RND(5))

FOR repeat = 1 TO rand
' set up some random starting positions ..
  a = RND(1.0)
  b = 0.9998
  c = 2 - 2 * a

  dots = 1000

  x = 0
  j = 0
  y = RND(1.0)*12 + 0.1

' calculate and draw the points ..
  FOR i = 0 TO dots
  Print 180 10 i
  z = x
  x = b * y + j
  j = a * x + c * (x^2)/(1 + x^2)
  y = j - z
  xpos = x*20 + xfocus
  ypos = y*20 + yfocus

  rr = RND(255)
  gg = RND(255)
  bb = RND(255)
  FrontColor rr gg bb
  RECT xpos ypos 4 4
  NEXT i

NEXT repeat
repeat=0
rand=0
dots=0
ShowControl 100 <SHOW>
NOSLEEP 0
RETURN

et maintenant, la version Panoramic faites en quelques minutes :
Code:
' Mathematical Patterns - GWS Aug 2011
' Version convertie depuis Aurel Basic en Panoramic

Label draw, bouton

dim i, n, red, green, blue
dim ww, wh : ww=800 : wh=600
dim dots, xpos, ypos
dim repeat, rand
dim a, b, c, x, y, z, j
dim xfocus, yfocus : xfocus = ww * 0.47: yfocus = wh * 0.45
dim rr, gg, bb

' Open window
Width 0, ww: height 0,wh:  caption 0,"CB Fractal Patterns"
picture 1 : full_space 1
2d_pen_color 0, 0, 0


' Create button
button 100: left 100,4:  top 100,4 : width 100,100 : height 100,25
Caption 100, "NEXT" : ON_Click 100,bouton
2d_pen_color 220, 220, 0
Print_locate 110,10 : Print "COUNT:"
End

WAIT

bouton:
  Hide 100
  GOSUB draw
return

Draw:

rand=INT(RND(5))

FOR repeat = 1 TO rand
' set up some random starting positions ..
  a = RND(1.0)
  b = 0.9998
  c = 2 - 2 * a

  dots = 1000

  x = 0
  j = 0
  y = RND(1.0)*12 + 0.1

' calculate and draw the points ..
  FOR i = 0 TO dots
  Print_locate 180,10: print i
  z = x
  x = b * y + j
  j = a * x + c * power(x,2)/(1 + power(x,2))
  y = j - z
  xpos = x*20 + xfocus
  ypos = y*20 + yfocus

  rr = RND(255)
  gg = RND(255)
  bb = RND(255)
  2D_pen_color rr,gg,bb
  2D_Rectangle xpos,ypos,xpos+4,ypos+4
  NEXT i

NEXT repeat
repeat=0
rand=0
dots=0
Show 100
RETURN
Revenir en haut Aller en bas
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyVen 17 Fév 2012 - 13:24

Lodchjo, j'ai mis cette autre converssion Aurel => Panoramic dans ton sujet. A ton avis, mieux vaut faire un seul sujet sur les conversions Aurel => Panormaic ou créer un post par conversion ? (Je te demande ça pour éviter de "spammer" un sujet si c'est hors sujet ...
(En fait, l'idée, c'est de voir si la conversion est un sujet que l'on globalise ou si l'on fait un sujet à part pour chacune d'entre elle, vu que comme ça ne m'a pas pris longtemps, je vais sans doute convertir d'autre sources Aurel en Panoramic ...)
Revenir en haut Aller en bas
bignono

bignono


Nombre de messages : 1127
Age : 66
Localisation : Val de Marne
Date d'inscription : 13/11/2011

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyVen 17 Fév 2012 - 13:54

C'est très interressant vos conversions des autres langages basic. Peut-être faudrait-il demander à Jack une rubrique spécifique dans le forum. Cela permettrait de mettre en évidence les différences entre différents langages basic, car il n'y a pas que Aurel Basic, et même peut-être mettre des programmes en C ou Delphi ou Turbo Pascal convertis en Panoramic. Ça permettrait peut-être à des novices comme moi d'aborder ces autres langages de façon moins rébarbatives. Je ne parle pas pour moi, mais j'ai tenté par 2 fois d'aborder le turbo pascal et j'ai vite laisser tomber!
Revenir en haut Aller en bas
JL35




Nombre de messages : 7095
Localisation : 77
Date d'inscription : 29/11/2007

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyVen 17 Fév 2012 - 14:02

Idem pour moi !
Revenir en haut Aller en bas
Nardo26

Nardo26


Nombre de messages : 2294
Age : 55
Localisation : Valence
Date d'inscription : 02/07/2010

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyVen 17 Fév 2012 - 15:03

Je doute que Jack fasse une rubrique "Autre basic".... Wink
Ou alors c'est qu'il en vraiment marre de nos éternelles demandes et qu'il veux nous voir partir sur d'autres langage basic...
Compatibilité avec Yabasic: Turtle graphics 30
Revenir en haut Aller en bas
http://nardo26.lescigales.org
Nardo26

Nardo26


Nombre de messages : 2294
Age : 55
Localisation : Valence
Date d'inscription : 02/07/2010

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyVen 17 Fév 2012 - 15:06

Sympa vos petits dessins...
Ca rappelle les années 70 où l'on faisait la même chose avec une planche, du fil et des clous...
C'est vrai que là ça dure moins longtemps à faire mais on ne peut pas l'accrocher sur le mur !
Laughing
Revenir en haut Aller en bas
http://nardo26.lescigales.org
JL35




Nombre de messages : 7095
Localisation : 77
Date d'inscription : 29/11/2007

Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics EmptyVen 17 Fév 2012 - 15:09

Moi je disais idem pour le fait d'avoir jeté un oeil sur turbo pascal, ou delphi, (et même C) et de n'avoir pas insisté.
Je reste au basic, et Panoramic est très bien, avec les avantages de la simplicité du basic et les graphismes en plus.
Quant aux autres basics, je mettrais ça dans les Bavardages divers, pas besoin d'une rubrique spéciale, ça pourrait aller très loin dans la digression, il y en a tellement !

Tiens c'est vrai, les dessins avec des fils... tu peux toujours essayer de les reproduire en vrai ! bon courage !
Revenir en haut Aller en bas
Contenu sponsorisé





Compatibilité avec Yabasic: Turtle graphics Empty
MessageSujet: Re: Compatibilité avec Yabasic: Turtle graphics   Compatibilité avec Yabasic: Turtle graphics Empty

Revenir en haut Aller en bas
 
Compatibilité avec Yabasic: Turtle graphics
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» compatibilité avec Windows 98
» Compatibilité avec ABasic
» Problème de compatibilité
» Perte de compatibilité
» Test Compatibilité à deux balles...

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: