• Aucun résultat trouvé

10 g g b A p p l e t.e v a l C o m m a n d(&#34

N/A
N/A
Protected

Academic year: 2022

Partager "10 g g b A p p l e t.e v a l C o m m a n d(&#34"

Copied!
1
0
0

Texte intégral

(1)

1 f u n c t i o n g g b O n I n i t() {}

2

3 var v a l e u r=new A r r a y(3 ,4 ,5 ,6 ,7 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,256) ; 4

5 f u n c t i o n p l u s() {

6 o=g g b A p p l e t.g e t V a l u e(" o ") ; 7 if(o<v a l e u r.length-1) {

8 o=o+1;

9 g g b A p p l e t.e v a l C o m m a n d(" o = "+o) ;

10 g g b A p p l e t.e v a l C o m m a n d(" oo = "+v a l e u r[o]) ; 11 c r e e r(v a l e u r[o]) ;

12 }

13 } 14

15 f u n c t i o n moins() {

16 o=g g b A p p l e t.g e t V a l u e(" o ") ; 17 if(o>0) {

18 o=o-1;

19 g g b A p p l e t.e v a l C o m m a n d(" o = "+o) ;

20 g g b A p p l e t.e v a l C o m m a n d(" oo = "+v a l e u r[o]) ; 21 c r e e r(v a l e u r[o]) ;

22 }

23 } 24

25 f u n c t i o n c r e e r(maxx) { 26 c=g g b A p p l e t.getXML() ; 27 c=c.r e p l a c e(" \ n "," ") ; 28 c=c.r e p l a c e(" \ r "," ") ; 29

30 /* E f f a c e p o l y g o n e */

31 var r e g=new RegExp(" < c o m m a n d na m e =\" P o l y g o n \ " . * / command > "," g ") ; 32 sub=r e g.e x e c(c) ;

33 if(sub!=n u l l) {

34 sub=sub.t o S t r i n g() ; 35 c=c.r e p l a c e(sub," ") ;

36 }

37 /* var reg = new R e g E x p (" < e l e m e n ( t ) {1 ,} ty p e =\" p o l y g o n \". element >" ," g ") ; */

38 var r e g=/ <e l e m e n t ty p e=" p o l y g o n ". * ? \ /e l e m e n t>/;

39 sub=r e g.e x e c(c) ; 40 if(sub!=n u l l) {

41 sub=sub.t o S t r i n g() ; 42 c=c.r e p l a c e(sub," ") ;

43 }

44

45 /* E f f a c e les s e g m e n t s */

46 var r e g=/ <e l e m e n t ty p e=" s e g m e n t ". * ? \ /e l e m e n t>/;

47 w h i l e((sub=r e g.e x e c(c) ) !=n u l l) { 48 sub=sub.t o S t r i n g() ;

49 c=c.r e p l a c e(sub," ") ;

50 }

51

52 /* A j o u t e les p o l y g o n e s */

53 s t r=" ";

54 for(i=0;i<maxx;i++) {

55 a=i/(maxx) ;

56 b=(i+1) /(maxx)

57 h=a*a;

58 s t r=s t r+ ’ <command n am e=" P o l y g o n "><i n p u t a0=" ( ’+ a + ’ ,0) " a1=" ( ’+ a + ’ , ’+ h + ’) " a2="←- ( ’+ b + ’ , ’+ h + ’) " a3=" ( ’+ b + ’ ,0) "/ > <o u t p u t a0=" p o l y _ {2} " / > </command> ’;

59 }

60

61 /* R e c o n s t r u i t la c h a i n e */

62 t a b=c.s p l i t(" </ c o n s t r u c t i o n > ") ;

63 c=t a b[ 0] +s t r+" </ c o n s t r u c t i o n > "+t a b[ 1] ; 64

65 g g b A p p l e t.setXML(c) 66 }

https://chingatome.fr

Références

Documents relatifs

Wojtasz- czyi( that he has used the theory of molecules to study basis properties of the Franklin system.. We remark that the theory of molecules can be used also for

[r]

[r]

Chaque programme SPIRIT est étudié dès sa conception pour vous proposer des logements fonctionnels de standing répondant aux dernières normes en vigueur en terme

’Association pour le Cyclisme Elite Dans l’Agglomération Clermontoise a réalisé la partie technique de cette manifestation avec le concours de l’ASPTT Clermont-Ferrand, du

’Association pour le Cyclisme Elite Dans l’Agglomération Clermontoise a réalisé la partie technique de cette manifestation avec le concours de l’ASPTT Clermont-Ferrand,

[r]

[r]