Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //For more informations: http://bit.ly/MOLECULORTI
- //Created by Wistaro
- AxesOff:GridOff
- 0->Xmin:0->Ymin
- 1->DeltaX:1->DeltaY
- ClrDraw
- Text(39,10,"A Program
- For(C,43,49
- Circle(C+13,10,C-40,{[i]
- End
- Text(~1,39,10,"
- Text(39,15,"By
- For(C,42,47,1
- Circle(C,50,C-40,{[i]
- End
- Text(~1,39,15,"
- Text(39,10,"Wistaro
- For(B,20,37,1
- Circle(B,20,B-40,{[i]
- End
- Line(33,35,42,48
- Line(44,46,34,32
- Line(55,13,41,18
- Line(53,10,35,16
- Line(24,44,24,60
- Line(24,60,30,55
- Line(30,55,36,60
- Line(36,60,36,44
- Text(10,58,"L E C U L O R
- Line(56,44,92,44
- Text(57,75,"v1.0.1
- StorePic 3
- Lbl M1
- DelVar V:RecallPic 3
- Text(35,60,"Quitter
- Text(21,60,"Saisir
- Text(28,60,"A propos
- 38->A
- Repeat K=105
- getKey->K
- A+7(K=25 and A!=38)-7(K=34 and A!=24->A
- If K:Then
- Pt-Off(56,24,2
- Pt-Off(56,38,2
- Pt-Off(56,31,2
- End
- Pt-On(56,A,2
- End
- If A=24:Goto Q
- If A=38:Goto S
- If A=31:Goto AW
- Lbl AW
- ClrDraw
- Text(0,30,"MOLECULOR
- Text(13,21,"Cree par Wistaro
- Text(27,0,"Prix programmation
- Text(34,0,"TIPlanet.org - 2015
- Text(49,0,"+d'infos:
- Text(56,0,"http://bit.ly/MOLECULOR
- Pause :ClrDraw:Goto M1
- Lbl Q
- DelVar [D]DelVar |LM:ClrDraw:ClrHome:Disp "
- Stop
- Lbl S
- ClrHome
- Output(4,1,"Rentre molecule:
- Output(5,1,"****************
- Output(8,1,"[!]: MAJUSCULES
- Output(6,1,"[!]: - pas ~
- Output(7,1,"[!]: DE pas D'
- Input "?>",Str1
- ClrHome:ClrDraw
- Goto MF
- Lbl M2
- DelVar VClrDraw:RecallPic 3
- For(A,5,0,~1
- Line(73,A,94,A,0
- End
- If length(Str9)<=23:Text(57,0,Str9
- Text(35,60,"Form brute
- Text(21,60,"Fiche infos
- Text(28,60,"Affichage
- 38->A
- Repeat K=105
- getKey->K
- If K=45:Then:ClrDraw:Goto M1:End
- A+7(K=25 and A!=38)-7(K=34 and A!=24->A
- If K:Then
- Pt-Off(56,24,2
- Pt-Off(56,38,2
- Pt-Off(56,31,2
- End
- Pt-On(56,A,2
- End
- ClrDraw
- If A=38:Goto MG
- If A=24:Then:9->V:Goto AP:End
- If A=31:Goto AP
- Lbl MG
- ClrDraw:RecallPic 4
- Pause :Goto M2
- Lbl MF
- "METHETHPROPBUTPENTHEXHEPTOCT->Str2
- DelVar |LM"ANEENEOLALONEOIQUEAMINEAMIDEOATE->Str3
- 15->dim(|LM
- {1,3,4,3,7,2,9,2,11,3,14,5,19,5,24,5,29,4->L2
- {1,4,5,3,8,4,12,3,15,4,19,3,22,4,26,3->L1
- Str1->Str9
- DelVar IinString(Str1,")-->I
- If I:Then
- inString("ZERS",sub(Str1,I-1,1->|LM(11
- sub(Str1,I+2,length(Str1)-(I+1->Str1
- End
- "--
- If I:"stereo"
- Text(45,0,"Isomerie: ",Ans,"/",sub("-ZERS",|LM(11)+1,1
- DelVar I
- inString(Str1,"-->A
- If not(A:Goto 3
- If inString(sub(Str1,A+1,3),"-":Goto 3
- DelVar B
- If inString(sub(Str1,A,length(Str1)-A),"METHYL":Then:Ans->J:1->I:End
- If not(I) and inString(sub(Str1,A,length(Str1)-A),"ETHYL":Then:Ans->J:2->I:End
- 1->D
- (sub(Str1,A+1,2)="DI")->E
- For(B,A-1,1,~1
- D+1->D
- If sub(Str1,B,1)!=",":Then:expr(sub(Str1,B,1->C
- B-1->B:End
- C->|LM(D+1
- I->|LM(D+5
- If E:Then
- C->|LM(D+3
- I->|LM(D+7
- End:End
- sub(Str1,J+(8-I),length(Str1)-(J+(7-I->Str1
- Lbl 3
- Text(31,0,"Ramif pos carb: ",|LM(3),",",|LM(4),",",|LM(5),",",|LM(6
- Text(38,0,"Ramif nbr carb: ",|LM(7),",",|LM(8),",",|LM(9),",",|LM(10
- inString(Str1," DE"->K
- If K:Then
- sub(Str1,K+4,1+length(Str1)-(K+4->Str6
- sub(Str1,1,K-1->Str1
- End
- DelVar B
- For(A,1,15,2
- If not(B) and inString(Str1,sub(Str2,L1(A),L1(A+1:A->B
- End
- round(B/2,0->|LM(1
- DelVar B
- For(A,1,18,2
- If not(B) and inString(Str1,sub(Str3,L2(A),L2(A+1:Then:A->B
- End:End
- max((B=seq(theta,theta,1,17,2))(seq(theta,theta,1,9,1->|LM(2
- If |LM(2)=9:Then
- DelVar B
- For(A,1,15,2
- If not(B) and inString(Str6,sub(Str2,L1(A),L1(A+1:Then:A->B:End
- End
- round(B/2,0->|LM(14
- Text(24,57,"[Alk: ",Ans,"]"
- End
- 1->|LM(12
- DelVar thetaIf B:inString(Str1,"-"+sub(Str3,L2(B),L2(B+1->theta
- If theta:expr(sub(Str1,theta-1,1))->|LM(12
- Text(52,0,"Place gr carac: ",|LM(12
- Lbl 1
- Horizontal 54
- If length(Str9)<=23:Then
- Str9:Else
- "Info Molecule:
- End
- Text(0,0,Ans
- Text(10,0,"Nb Carb (chn principale): ",|LM(1
- |LM(2->F
- If not(F:"Inconnu
- If F=1:"ALCANE
- If F=2:"ALCENE
- If F=3:"ALCOOL
- If F=4:"ALDEHYDE
- If F=5:"CETONE
- If F=6:"ACD CARBOXYLQ
- If F=7:"AMINE
- If F=8:"AMIDE
- If F=9:"ESTER
- Text(17,0,"Fam/Fonct: ",Ans
- If F=3:"HYDROXYLE/OH
- If F=4 or F=5:"CARBONYLE
- If F=6:"CARBOXYLE
- Text(24,0,"Gr carac: ",Ans
- StorePic 4
- Pause :Goto M2
- Lbl AP
- ClrDraw
- If |LM(1)>7 or (|LM(1)+|LM(14))>7:Goto M2
- seq(theta,theta,1,94,6->L4
- seq(theta,theta,3,60,7->L5
- DelVar [D]{9,16->dim([D]
- |LM(1->N
- "COHN='-OH''IIC-C"->Str1
- If length(Str9)<=23:Text(0,0,Str9
- Horizontal 55
- Text(57,1,"C h a r g e m e n t . . .
- Horizontal 6
- For(A,1,N
- 1->[D](5,2A+1
- If A<N:7->[D](5,2A+2
- End
- 3->A:2->B
- {|LM(3),|LM(4),|LM(5),|LM(6)->L1
- {|LM(7),|LM(8),|LM(9),|LM(10)->L2
- For(theta,1,4
- L1(theta)->A
- L2(theta)->B
- DelVar Y
- If B=1:Then
- If [D](3,2A+1):2->Y
- 1->[D](3+2Y,2A+1
- 6->[D](4+Y,2A+1
- DelVar Y:End
- If B=2:Then
- If [D](3,2A+1:2->Y
- 14->[D](3+2Y,2A+1
- 6->[D](4+Y,2A+1
- DelVar Y:End
- End
- |LM(12->P:|LM(2->F:|LM(14->E
- If F=4 or F=6 or F=9 or F=8:Then
- 10->[D](4,2N+1
- 2->[D](3,2N+1
- 6->[D](6,2N+1
- End
- If F=4:3->[D](7,2N+1
- If F=6:8->[D](7,2N+1
- If F=8:4->[D](7,2N+1
- If F=9:Then
- 2->[D](7,2N+1
- 7->[D](7,2N+2
- 2->H
- For(A,1,E
- 1->[D](7,2N+A+H
- If A!=E:7->[D](7,2N+A+1+H
- H+1->H
- End
- End
- If F=2:5->[D](5,2P+2
- If F=3 or F=5 or F=7:Then
- DelVar ADelVar B
- If P>1:Then
- If [D](4,2P+1:Then
- 6->A:7->B
- Else
- 4->A:3->B
- End:End:End
- If F=3:Then
- If P=1:Then
- 7->[D](5,2:2->[D](5,1
- Else
- 6->[D](A,2P+1:8->[D](B,2P+1
- End:End
- If F=5:Then
- If P=1:Then
- 5->[D](5,2:2->[D](5,1
- Else
- 10->[D](A,2P+1:2->[D](B,2P+1
- End:End
- If F=7:Then
- If P=1:Then
- 7->[D](5,2:4->[D](5,1
- Else
- 6->[D](A,2P+1:4->[D](B,2P+1
- End:End
- If V=9:Goto FB
- Lbl A2
- For(A,1,9
- For(B,1,16
- [D](A,B->D
- (D>=11)+1+int(D/8->C
- If D:Text(L5(A),L4(B),sub(Str1,D,C
- End:End
- StorePic 5
- Lbl A
- Text(57,0,"[[i]]Liaisons
- Text(57,37," Quitter
- Line(36,6,36,0
- Repeat K=13 or K=14
- getKey->K
- If K=11 or K=12:Goto H
- End
- Goto M2
- Lbl 1
- Lbl H
- ClrDraw
- Horizontal 54
- Horizontal 38
- Text(~1,0,0,"[[i]] Liaisons [[i]]
- Text(10,7,"{!} PAS OUBLIER LES H {!}
- Text(17,20,"dans la molecule
- Text(30,0,"Carbone (C): 4
- Text(37,0,"Oxigene (O): 2
- Text(45,0,"Hydrogene (H): 1
- Text(52,0,"Azote (N): 3
- Pause
- ClrDraw:RecallPic 5:Goto A
- Lbl FB
- DelVar CDelVar ODelVar NDelVar HDelVar T
- For(A,3,8
- For(B,1,16
- T+1->T
- Text(57,80,round(100T/96,0
- H+([D](A,B)=3->H
- If [D](A,B)=8:Then
- O+1->O
- H+1->H
- End
- If [D](A,B)=1:Then
- C+1->C
- H+4->H
- H-([D](A+1,B)=6->H
- H-([D](A-1,B)=6->H
- H-2([D](A+1,B)=10->H
- H-2([D](A-1,B)=10->H
- If B>1:Then
- H-([D](A,B-1)=7->H
- H-2([D](A,B-1)=5->H
- End
- If B<16:Then
- H-([D](A,B+1)=7->H
- H-2([D](A,B+1)=5->H
- End:End
- [D](A,B)=14
- H+5(Ans->H
- C+2([D](A,B)=14->C
- If [D](A,B)=2:Then
- O+1->O
- H+2->H
- H-([D](A,B+1)=7->H
- H-2([D](A,B+1)=5->H
- H-([D](A-1,B)=6->H
- H-2([D](A-1,B)=10->H
- H-([D](A+1,B)=6->H
- H-2([D](A+1,B)=10->H
- End
- If [D](A,B)=4:Then
- N+1->N
- H+3->H
- H-([D](A,B+1)=7->H
- H-2([D](A,B+1)=5->H
- H-([D](A+1,B)=6->H
- H-([D](A-1,B)=6->H
- H-2([D](A+1,B)=10->H
- H-2([D](A-1,B)=10->H
- End
- End:End
- Text(10,5,"Atomes dans la molecule:
- Text(22,12,"Carbone: ",C
- Text(29,12,"Hydrogene: ",H
- Text(43,12,"Azote: ",N
- Text(36,12,"Oxygene: ",O
- For(T,5,0,~1
- Line(0,T,94,T,0
- End
- Text(57,0,"Formule brute:
- Text(57,53,"C",C," H",H," O",O," N",N
- Pause :DelVar VClrDraw:Goto M2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement