Chemical reactions by Anonymous Coder7th Sep 2004 14:56
|
---|
Summary It was meant to be a chemical reaction application I can't formulate the formula equation Periodic table exist with some recognized elements Description Please feel free completing the code perfectly Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com Rem Project: chemical reactions Rem Created: 5/9/2004 2:58:25 μμ Rem ***** Main Source File ***** global t1,t2 global introduction_message$ global element_1$ global element_2$ global element_3$ global hold$ global substance_1$ global substance_2$ global substance_3$ global result_1$ global result_2$ global result_3$ global H,Li,Na,K,Rb,Cs,Fr,Be,Mg,Ca,Sr,Ba,Ra,Sc,Y,La,Ac,Ce,Th global Ti,Zr,Hf,Ku,Pr,Pa,V,Nb,Ta,Ha,Nd,U,Cr,Mo,W,Sg,Pm,Np,Mn global Tc,Re,Bh,Sm,Pu,Fe,Ru,Os,Hs,Eu,Am,Co,Rh,Ir,Mt,Gd,Cm,Ni global Pd,Pt,Uun,Tb,Bk,Cu,Ag,Au,Uuu,Dy,Cf,Zn,Cd_,Hg,Uub,Ho,Es global B,Al,Ga,In,Tl,Er,Fm,C,Si,Ge,Sn,Pb,Tm,Md,N,P,As_,Sb,Bi global Yb,No,O,S,Se,Te,Po,Lu,Lw,F,Cl,Br,I,At,He,Ne,Ar,Kr,Xe,Rn global H$,He$,B$,C$,N$,O$,F$,Ne$,Na$,Mg$,Al$,Si$,P$,S$,Cl_$,Ar$ global K$,Ca$,Cr$,Mn$,Fe$,Ni$,Cu$,Zn$,Br$,Ag$,Sn$,I$,Pt$,Au$,Hg$ global Pb$,Ra$,U$ global shift# global maxx# global maxy# global halfx global halfy global halfx# global halfy# global hhalfx# global hhalfy# global hmaxx# global hmaxy# global H global Na global K global Ca global Cu global Al global Fe global NH4 global OH global O global Cl global I global S global SO4 global SO3 global NO3 global NO2 global CO3 global PO4 global CN global ClO3 global OH global O global Cl global I global S global SO4 global SO3 global NO3 global NO2 global CO3 global PO4 global CN global ClO3 global H2 global O2 global N2 global F2 global Cl2 global Br2 global I2 maxx#=screen width() maxy#=screen height() maxx=screen width() maxy=screen height() halfx=maxx/2 halfy=maxy/2 halfx#=maxx#/2 halfy#=maxy#/2 hhalfx#=halfx#/2 hhalfy#=halfy#/2 hmaxx#=hmaxx#*0.8 hmaxy#=hmaxy#*0.8 shift#=1.15 H$="Hydrogen" He$="Helium" B$="Boron" C$="Carbon" N$="Nitrogen" O$="Oxygen" F$="Fluorine" Ne$="Neon" Na$="Sodium" Mg$="Magnesium" Al$="Aluminium" Si$="Silicon" P$="Phosphorous" S$="Sulphur" Cl_$="Chlorine" Ar$="Argon" K$="Potassium" Ca$="Calcium" Cr$="Chromium" Mn$="Manganese" Fe$="Iron" Ni$="Nickel" Cu$="Copper" Zn$="Zinc" Br$="Bromine" Ag$="Silver" Sn$="Tin" I$="Iodine" Pt$="Platinum" Au$="Gold" Hg$="Mercury" Pb$="Lead" Ra$="Radium" U$="Uranium" element_1$="Null" element_2$="Null" `element_3$ hold$="Null" introduction_message$="yes" t1=timer() `Hydrogen H 1 `Helium He 2 `Boron B 5 `Carbon C 6 `Nitrogen N 7 `Oxygen O 8 `Fluorine F 9 `Neon Ne 10 `Sodium Na 11 `Magnesium Mg 12 `Aluminium Al 13 `Silicon Si 14 `Phosphorous P 15 `Sulphur S 16 `Chlorine Cl 17 `Argon Ar 18 `Potassium K 19 `Calcium Ca 20 `Chromium Cr 24 `Manganese Mn 25 `Iron Fe 26 `Nickel Ni 28 `Copper Cu 29 `Zinc Zn 30 `Bromine Br 35 `Silver Ag 47 `Tin Sn 50 `Iodine I 53 `Platinum Pt 78 `Gold Au 79 `Mercury Hg 80 `Lead Pb 82 `Radium Ra 88 `Uranium U 92 `H H2 `O O2 `N N2 `F F2 `Cl Cl2 `Br Br2 `I I2 `He He `Ne Ne `Ar Ar `K K `Na Na `Ca Ca `Fe Fe `K=+1 `Na=+1 `Ag=+3 `Mg=+2 `Ca=+2 `Zn=+2 `Al=+3 `Cu=+1 `Cu=+2 `Fe=+2 `Fe=+3 `Non Metals `F=-1 `Cl=-1 `Br=-1 `I=-1 `O=-2 `S=-2 `N=-3 `P=-3 `Homo-pole bonds `H=+1 `F=+1 `Cl=+1 `Br=+1 `I=+1 `O=+2 `S=+2 `N=+3 `P=+3 `C=+4 `Si=+4 `Anions-Cations `Metals `K+ , Na+ , Ag+ `Ca++ , Mg++ , Zn++ `Al+++ , Bi+++ `Non Metals `F- , Cl- , Br- , I- `O-- , S -- `N--- , P--- ````````````````````````````` `H=+1 `K=+1 `Na=+1 `Ag=+1 `Mg=+2 `Ca=+2 `Zn=+2 `Al=+3 `Cu=+1,+2 `Fe=+2,+3 `F=-1 `Cl=-1 `Br=-1 `I=-1 `O=-2 `S=-2 `N=-3 `P=-3 `Homo-pole bonds `H=+1 `F=+1 `Cl=+1 `Br=+1 `I=+1 `O=2 `S=2 `N=3 `P=3 `C=4 `Si=4 `Anions-Cations `Metals `K=+1 `Na=+1 `Ag=+1 `Ca=+2 `Mg=+2 `Zn=+2 `Al=+3 `Bi=+3 `Non Metals `F=-1 `Cl=-1 `Br=-1 `I=-1 `O=-2 `S=-2 `N=-3 `P=-3 `````````````````````````````` `H=+1 `Na=+1 `K=+1 `Ca=+2 `Cu=+2 `Al=+3 `Fe=+2 `Fe=+3 `NH4=+1 `OH=-1 `O=-2 `Cl=-1 `I=-1 `S=-2 `SO4=-2 `SO3=-2 `NO3=-1 `NO2=-1 `CO3=-2 `PO4=-3 `CN=-1 `ClO3=-1 do cls t2=timer() if (t2-t1>5000)then:introduction_message$="no" `make_button(halfx*(0.15625*1),halfy*(0.1*1),200.0,0.0,0.0,"H2") `make_button(halfx*(0.15625*1),halfy*(0.1*2),200.0,0.0,0.0,"O2") `make_button(halfx*(0.15625*1),halfy*(0.1*3),200.0,0.0,0.0,"N2") `make_button(halfx*(0.15625*1),halfy*(0.1*4),200.0,0.0,0.0,"F2") `make_button(halfx*(0.15625*1),halfy*(0.1*5),200.0,0.0,0.0,"Cl2") `make_button(halfx*(0.15625*1),halfy*(0.1*6),200.0,0.0,0.0,"Br2") `make_button(halfx*(0.15625*1),halfy*(0.1*7),200.0,0.0,0.0,"I2") `make_button(halfx*(0.15625*1),halfy*(0.1*8),200.0,0.0,0.0,"He") `make_button(halfx*(0.15625*1),halfy*(0.1*9),200.0,0.0,0.0,"Ne") `make_button(halfx*(0.15625*1),halfy*(0.1*10),200.0,0.0,0.0,"Ar") `make_button(halfx*(0.15625*2),halfy*(0.1*1),200.0,0.0,0.0,"K") `make_button(halfx*(0.15625*2),halfy*(0.1*2),200.0,0.0,0.0,"Na") `make_button(halfx*(0.15625*2),halfy*(0.1*3),200.0,0.0,0.0,"Ca") `make_button(halfx*(0.15625*2),halfy*(0.1*4),200.0,0.0,0.0,"Fe") `make_button(halfx*(0.15625*2),halfy*(0.1*5),200.0,0.0,0.0,"B") `make_button(halfx*(0.15625*2),halfy*(0.1*6),200.0,0.0,0.0,"C") `make_button(halfx*(0.15625*2),halfy*(0.1*7),200.0,0.0,0.0,"N") `make_button(halfx*(0.15625*2),halfy*(0.1*8),200.0,0.0,0.0,"O") `make_button(halfx*(0.15625*2),halfy*(0.1*9),200.0,0.0,0.0,"F") `make_button(halfx*(0.15625*2),halfy*(0.1*10),200.0,0.0,0.0,"Mg") `make_button(halfx*(0.15625*3),halfy*(0.1*1),200.0,0.0,0.0,"Al") `make_button(halfx*(0.15625*3),halfy*(0.1*2),200.0,0.0,0.0,"Si") `make_button(halfx*(0.15625*3),halfy*(0.1*3),200.0,0.0,0.0,"P") `make_button(halfx*(0.15625*3),halfy*(0.1*4),200.0,0.0,0.0,"S") `make_button(halfx*(0.15625*3),halfy*(0.1*5),200.0,0.0,0.0,"Cl") `make_button(halfx*(0.15625*3),halfy*(0.1*6),200.0,0.0,0.0,"K") `make_button(halfx*(0.15625*3),halfy*(0.1*7),200.0,0.0,0.0,"Cr") `make_button(halfx*(0.15625*3),halfy*(0.1*8),200.0,0.0,0.0,"Mn") `make_button(halfx*(0.15625*3),halfy*(0.1*9),200.0,0.0,0.0,"Ni") `make_button(halfx*(0.15625*3),halfy*(0.1*10),200.0,0.0,0.0,"Cu") `make_button(halfx*(0.15625*4),halfy*(0.1*1),200.0,0.0,0.0,"Zn") `make_button(halfx*(0.15625*4),halfy*(0.1*2),200.0,0.0,0.0,"Ag") `make_button(halfx*(0.15625*4),halfy*(0.1*3),200.0,0.0,0.0,"Sn") `make_button(halfx*(0.15625*4),halfy*(0.1*4),200.0,0.0,0.0,"I") `make_button(halfx*(0.15625*4),halfy*(0.1*5),200.0,0.0,0.0,"Pt") `make_button(halfx*(0.15625*4),halfy*(0.1*6),200.0,0.0,0.0,"Au") `make_button(halfx*(0.15625*4),halfy*(0.1*7),200.0,0.0,0.0,"Hg") `make_button(halfx*(0.15625*4),halfy*(0.1*8),200.0,0.0,0.0,"Pb") `make_button(halfx*(0.15625*4),halfy*(0.1*9),200.0,0.0,0.0,"Ra") `make_button(halfx*(0.15625*4),halfy*(0.1*10),200.0,0.0,0.0,"U") make_button(halfx*(0.15625*0.4)*shift#,halfy*(0.1*1),0.0,100.0,0.0,"H ") make_button(halfx*(0.15625*0.4)*shift#,halfy*(0.1*2),0.0,0.0,100.0,"Li") make_button(halfx*(0.15625*0.4)*shift#,halfy*(0.1*3),0.0,0.0,100.0,"Na") make_button(halfx*(0.15625*0.4)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"K ") make_button(halfx*(0.15625*0.4)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Rb") make_button(halfx*(0.15625*0.4)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Cs") make_button(halfx*(0.15625*0.4)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Fr") make_button(halfx*(0.15625*1)*shift#,halfy*(0.1*2),0.0,0.0,100.0,"Be") make_button(halfx*(0.15625*1)*shift#,halfy*(0.1*3),0.0,0.0,100.0,"Mg") make_button(halfx*(0.15625*1)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Ca") make_button(halfx*(0.15625*1)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Sr") make_button(halfx*(0.15625*1)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Ba") make_button(halfx*(0.15625*1)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Ra") make_button(halfx*(0.15625*1.6)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Sc") make_button(halfx*(0.15625*1.6)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Y ") make_button(halfx*(0.15625*1.6)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"La") make_button(halfx*(0.15625*1.6)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Ac") make_button(halfx*(0.15625*1.6)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Ce") make_button(halfx*(0.15625*1.6)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Th") make_button(halfx*(0.15625*2.2)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Ti") make_button(halfx*(0.15625*2.2)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Zr") make_button(halfx*(0.15625*2.2)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Hf") make_button(halfx*(0.15625*2.2)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Ku") make_button(halfx*(0.15625*2.2)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Pr") make_button(halfx*(0.15625*2.2)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Pa") make_button(halfx*(0.15625*2.8)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"V ") make_button(halfx*(0.15625*2.8)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Nb") make_button(halfx*(0.15625*2.8)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Ta") make_button(halfx*(0.15625*2.8)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Ha") make_button(halfx*(0.15625*2.8)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Nd") make_button(halfx*(0.15625*2.8)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"U ") make_button(halfx*(0.15625*3.4)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Cr") make_button(halfx*(0.15625*3.4)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Mo") make_button(halfx*(0.15625*3.4)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"W ") make_button(halfx*(0.15625*3.4)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Sg") make_button(halfx*(0.15625*3.4)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Pm") make_button(halfx*(0.15625*3.4)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Np") make_button(halfx*(0.15625*4.0)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Mn") make_button(halfx*(0.15625*4.0)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Tc") make_button(halfx*(0.15625*4.0)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Re") make_button(halfx*(0.15625*4.0)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Bh") make_button(halfx*(0.15625*4.0)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Sm") make_button(halfx*(0.15625*4.0)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Pu") make_button(halfx*(0.15625*4.6)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Fe") make_button(halfx*(0.15625*4.6)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Ru") make_button(halfx*(0.15625*4.6)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Os") make_button(halfx*(0.15625*4.6)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Hs") make_button(halfx*(0.15625*4.6)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Eu") make_button(halfx*(0.15625*4.6)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Am") make_button(halfx*(0.15625*5.2)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Co") make_button(halfx*(0.15625*5.2)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Rh") make_button(halfx*(0.15625*5.2)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Ir") make_button(halfx*(0.15625*5.2)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Mt") make_button(halfx*(0.15625*5.2)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Gd") make_button(halfx*(0.15625*5.2)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Cm") make_button(halfx*(0.15625*5.8)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Ni") make_button(halfx*(0.15625*5.8)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Pd") make_button(halfx*(0.15625*5.8)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Pt") make_button(halfx*(0.15625*5.8)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Uun") make_button(halfx*(0.15625*5.8)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Tb") make_button(halfx*(0.15625*5.8)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Bk") make_button(halfx*(0.15625*6.4)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Cu") make_button(halfx*(0.15625*6.4)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Ag") make_button(halfx*(0.15625*6.4)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Au") make_button(halfx*(0.15625*6.4)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Uuu") make_button(halfx*(0.15625*6.4)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Dy") make_button(halfx*(0.15625*6.4)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Cf") make_button(halfx*(0.15625*7.0)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Zn") make_button(halfx*(0.15625*7.0)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Cd") make_button(halfx*(0.15625*7.0)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Hg") make_button(halfx*(0.15625*7.0)*shift#,halfy*(0.1*7),0.0,0.0,100.0,"Uub") make_button(halfx*(0.15625*7.0)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Ho") make_button(halfx*(0.15625*7.0)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Es") make_button(halfx*(0.15625*7.6)*shift#,halfy*(0.1*2),255.0,100.0,0.0,"B ") make_button(halfx*(0.15625*7.6)*shift#,halfy*(0.1*3),0.0,0.0,100.0,"Al") make_button(halfx*(0.15625*7.6)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Ga") make_button(halfx*(0.15625*7.6)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"In") make_button(halfx*(0.15625*7.6)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Tl") make_button(halfx*(0.15625*7.6)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Er") make_button(halfx*(0.15625*7.6)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Fm") make_button(halfx*(0.15625*8.2)*shift#,halfy*(0.1*2),0.0,100.0,0.0,"C ") make_button(halfx*(0.15625*8.2)*shift#,halfy*(0.1*3),255.0,100.0,0.0,"Si") make_button(halfx*(0.15625*8.2)*shift#,halfy*(0.1*4),0.0,0.0,100.0,"Ge") make_button(halfx*(0.15625*8.2)*shift#,halfy*(0.1*5),0.0,0.0,100.0,"Sn") make_button(halfx*(0.15625*8.2)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Pb") make_button(halfx*(0.15625*8.2)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Tm") make_button(halfx*(0.15625*8.2)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Md") make_button(halfx*(0.15625*8.8)*shift#,halfy*(0.1*2),0.0,100.0,0.0,"N ") make_button(halfx*(0.15625*8.8)*shift#,halfy*(0.1*3),0.0,100.0,0.0,"P ") make_button(halfx*(0.15625*8.8)*shift#,halfy*(0.1*4),255.0,100.0,0.0,"As") make_button(halfx*(0.15625*8.8)*shift#,halfy*(0.1*5),255.0,100.0,0.0,"Sb") make_button(halfx*(0.15625*8.8)*shift#,halfy*(0.1*6),0.0,0.0,100.0,"Bi") make_button(halfx*(0.15625*8.8)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Yb") make_button(halfx*(0.15625*8.8)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"No") make_button(halfx*(0.15625*9.4)*shift#,halfy*(0.1*2),0.0,100.0,0.0,"O ") make_button(halfx*(0.15625*9.4)*shift#,halfy*(0.1*3),0.0,100.0,0.0,"S ") make_button(halfx*(0.15625*9.4)*shift#,halfy*(0.1*4),0.0,100.0,0.0,"Se") make_button(halfx*(0.15625*9.4)*shift#,halfy*(0.1*5),255.0,100.0,0.0,"Te") make_button(halfx*(0.15625*9.4)*shift#,halfy*(0.1*6),255.0,100.0,0.0,"Po") make_button(halfx*(0.15625*9.4)*shift#,halfy*(0.1*9),0.0,0.0,100.0,"Lu") make_button(halfx*(0.15625*9.4)*shift#,halfy*(0.1*10),0.0,0.0,100.0,"Lw") make_button(halfx*(0.15625*10.0)*shift#,halfy*(0.1*2),0.0,100.0,0.0,"F ") make_button(halfx*(0.15625*10.0)*shift#,halfy*(0.1*3),0.0,100.0,0.0,"Cl") make_button(halfx*(0.15625*10.0)*shift#,halfy*(0.1*4),0.0,100.0,0.0,"Br") make_button(halfx*(0.15625*10.0)*shift#,halfy*(0.1*5),0.0,100.0,0.0,"I ") make_button(halfx*(0.15625*10.0)*shift#,halfy*(0.1*6),0.0,100.0,0.0,"At") make_button(halfx*(0.15625*10.6)*shift#,halfy*(0.1*1),100.0,0.0,0.0,"He") make_button(halfx*(0.15625*10.6)*shift#,halfy*(0.1*2),100.0,0.0,0.0,"Ne") make_button(halfx*(0.15625*10.6)*shift#,halfy*(0.1*3),100.0,0.0,0.0,"Ar") make_button(halfx*(0.15625*10.6)*shift#,halfy*(0.1*4),100.0,0.0,0.0,"Kr") make_button(halfx*(0.15625*10.6)*shift#,halfy*(0.1*5),100.0,0.0,0.0,"Xe") make_button(halfx*(0.15625*10.6)*shift#,halfy*(0.1*6),100.0,0.0,0.0,"Rn") make_button(halfx*(0.15625*5)*shift#,halfy*(0.1*11.3),200.0,0.0,0.0,"Chemical Reaction") make_button(halfx*(0.15625*5)*shift#,halfy*(0.1*13),200.0,0.0,0.0,"First Element") make_button(halfx*(0.15625*5)*shift#,halfy*(0.1*14),200.0,0.0,0.0,"Second Element") make_button(halfx*(0.15625*1)*shift#,halfy*(0.1*14),200.0,0.0,0.0,"Initialize") print_xy_message(halfx*(0.15625*4.1)*shift#,halfy*(0.1*15),"Hold Element") compute_chemical_reaction() print_that() colour_reference() loop end function make_button(x,y,r#,g#,b#,txt$) button(x,y,txt$,r#,g#,b#) endfunction function print_xy_message(x,y,message$) set cursor x,y print message$ endfunction function print_xy_int(x,y,i) set cursor x,y print i endfunction function button(x,y,txt$,r#,g#,b#) ` code made by Atreides (I don't mind if you don't add me to your credits ^^) ` X ans Y are the center of the button ` txt is the text of the button ` r, g and b is the color of the button mob as boolean if mousex()>x-text width(txt$)/2-6 and mousex()<x+text width(txt$)/2+6 if mousey()>y-text height(txt$)/2-2 and mousey()<y+text height(txt$)/2+2 if mouseclick()=1 `mob=1:pushed_this$=txt$:cls 0:button_reader(txt$) mob=1 pushed_this$=txt$ cls 0 button_reader(txt$) endif endif endif if mob=0 ink rgb(r#*0.7,g#*0.7,b#*0.7),0 box x-text width(txt$)/2-6,y-text height(txt$)/2-2,x+text width(txt$)/2+6,y+text height(txt$)/2+4 ink rgb(r#,g#,b#),0 box x-text width(txt$)/2-3,y-text height(txt$)/2,x+text width(txt$)/2+3,y+text height(txt$)/2+2 if (r#+g#+b#)/3>=128 ink rgb(0,0,0),0 else ink rgb(255,255,255),0 endif text x-text width(txt$)/2,y-text height(txt$)/2,txt$ else repeat ink rgb(r#,g#,b#),0 box x-text width(txt$)/2-6,y-text height(txt$)/2-2,x+text width(txt$)/2+6,y+text height(txt$)/2+4 ink rgb(r#*0.7,g#*0.7,b#*0.7),0 box x-text width(txt$)/2-3,y-text height(txt$)/2,x+text width(txt$)/2+3,y+text height(txt$)/2+2 if (r#*0.7+g#*0.7+b#*0.7)/3>=128 ink rgb(0,0,0),0 else ink rgb(255,255,255),0 endif text x-text width(txt$)/2,y-text height(txt$)/2,txt$ sync until mouseclick()=0 if mousex()>x-text width(txt$)/2-6 and mousex()<x+text width(txt$)/2+6 and mousey()>y-text height(txt$)/2-2 and mousey()<y+text height(txt$)/2+2 if mouseclick()=1 then mob=1 else mob = 0 endif endif ink rgb(255,255,255),0 endfunction mob function button_reader(pushed_this$) if (pushed_this$="ClO3")then:element_selection("ClO3") if (pushed_this$="CN")then:element_selection("CN") if (pushed_this$="PO4")then:element_selection("PO4") if (pushed_this$="CO3")then:element_selection("CO3") if (pushed_this$="NO2")then:element_selection("NO2") if (pushed_this$="NO3")then:element_selection("NO3") if (pushed_this$="SO3")then:element_selection("SO3") if (pushed_this$="SO4")then:element_selection("SO4") if (pushed_this$="OH")then:element_selection("OH") if (pushed_this$="NH4")then:element_selection("NH4") ` if (pushed_this$="Fe")then:element_selection("Fe") ` if (pushed_this$="Cu")then:element_selection("Cu") ` if (pushed_this$="Ca")then:element_selection("Ca") ` if (pushed_this$="I2")then:element_selection("I2") if (pushed_this$="Br2")then:element_selection("Br2") if (pushed_this$="Cl2")then:element_selection("Cl2") if (pushed_this$="F2")then:element_selection("F2") if (pushed_this$="N2")then:element_selection("N2") if (pushed_this$="O2")then:element_selection("O2") if (pushed_this$="H2")then:element_selection("H2") ` if (pushed_this$="He")then:element_selection("He") ` if (pushed_this$="Ne")then:element_selection("Ne") ` if (pushed_this$="I")then:element_selection("I") ` if (pushed_this$="Pt")then:element_selection("Pt") ` if (pushed_this$="Au")then:element_selection("Au") ` if (pushed_this$="Hg")then:element_selection("Hg") ` if (pushed_this$="Pb")then:element_selection("Pb") ` if (pushed_this$="Ra")then:element_selection("Ra") ` if (pushed_this$="U")then:element_selection("U") ` if (pushed_this$="Cr")then:element_selection("Cr") ` if (pushed_this$="Mn")then:element_selection("Mn") ` if (pushed_this$="Ni")then:element_selection("Ni") ` if (pushed_this$="Zn")then:element_selection("Zn") ` if (pushed_this$="Br")then:element_selection("Br") ` if (pushed_this$="Ag")then:element_selection("Ag") ` if (pushed_this$="Sn")then:element_selection("Sn") ` if (pushed_this$="Ar")then:element_selection("Ar") ` if (pushed_this$="Cl")then:element_selection("Cl") ` if (pushed_this$="S")then:element_selection("S") ` if (pushed_this$="P")then:element_selection("P") ` if (pushed_this$="Si")then:element_selection("Si") ` if (pushed_this$="Al")then:element_selection("Al") ` if (pushed_this$="Mg")then:element_selection("Mg") ` if (pushed_this$="Na")then:element_selection("Na") ` if (pushed_this$="F")then:element_selection("F") ` if (pushed_this$="O")then:element_selection("O") ` if (pushed_this$="N")then:element_selection("N") ` if (pushed_this$="C")then:element_selection("C") ` if (pushed_this$="B")then:element_selection("B") ` if (pushed_this$="H")then:element_selection("H") ` if (pushed_this$="K")then:element_selection("K") if (pushed_this$="H ")then:element_selection("H ") if (pushed_this$="Li")then:element_selection("Li") if (pushed_this$="Na")then:element_selection("Na") if (pushed_this$="K ")then:element_selection("K ") if (pushed_this$="Rb")then:element_selection("Rb") if (pushed_this$="Cs")then:element_selection("Cs") if (pushed_this$="Fr")then:element_selection("Fr") if (pushed_this$="Be")then:element_selection("Be") if (pushed_this$="Mg")then:element_selection("Mg") if (pushed_this$="Ca")then:element_selection("Ca") if (pushed_this$="Sr")then:element_selection("Sr") if (pushed_this$="Ba")then:element_selection("Ba") if (pushed_this$="Ra")then:element_selection("Ra") if (pushed_this$="Sc")then:element_selection("Sc") if (pushed_this$="Y ")then:element_selection("Y ") if (pushed_this$="La")then:element_selection("La") if (pushed_this$="Ac")then:element_selection("Ac") if (pushed_this$="Ti")then:element_selection("Ti") if (pushed_this$="Zr")then:element_selection("Zr") if (pushed_this$="Hf")then:element_selection("Hf") if (pushed_this$="V ")then:element_selection("V ") if (pushed_this$="Nb")then:element_selection("Nb") if (pushed_this$="Ta")then:element_selection("Ta") if (pushed_this$="Cr")then:element_selection("Cr") if (pushed_this$="Mo")then:element_selection("Mo") if (pushed_this$="W ")then:element_selection("W ") if (pushed_this$="Mn")then:element_selection("Mn") if (pushed_this$="Tc")then:element_selection("Tc") if (pushed_this$="Re")then:element_selection("Re") if (pushed_this$="Fe")then:element_selection("Fe") if (pushed_this$="Ru")then:element_selection("Ru") if (pushed_this$="Os")then:element_selection("Os") if (pushed_this$="Co")then:element_selection("Co") if (pushed_this$="Rh")then:element_selection("Rh") if (pushed_this$="Ir")then:element_selection("Ir") if (pushed_this$="Ni")then:element_selection("Ni") if (pushed_this$="Pd")then:element_selection("Pd") if (pushed_this$="Pt")then:element_selection("Pt") if (pushed_this$="Cu")then:element_selection("Cu") if (pushed_this$="Ag")then:element_selection("Ag") if (pushed_this$="Au")then:element_selection("Au") if (pushed_this$="Zn")then:element_selection("Zn") if (pushed_this$="Cd")then:element_selection("Cd") if (pushed_this$="Hg")then:element_selection("Hg") if (pushed_this$="B ")then:element_selection("B ") if (pushed_this$="Al")then:element_selection("Al") if (pushed_this$="Ga")then:element_selection("Ga") if (pushed_this$="In")then:element_selection("In") if (pushed_this$="Tl")then:element_selection("Tl") if (pushed_this$="C ")then:element_selection("C ") if (pushed_this$="Si")then:element_selection("Si") if (pushed_this$="Ge")then:element_selection("Ge") if (pushed_this$="Sn")then:element_selection("Sn") if (pushed_this$="Pb")then:element_selection("Pb") if (pushed_this$="N ")then:element_selection("N ") if (pushed_this$="P ")then:element_selection("P ") if (pushed_this$="As")then:element_selection("As") if (pushed_this$="Sb")then:element_selection("Sb") if (pushed_this$="Bi")then:element_selection("Bi") if (pushed_this$="O ")then:element_selection("O ") if (pushed_this$="S ")then:element_selection("S ") if (pushed_this$="Se")then:element_selection("Se") if (pushed_this$="Te")then:element_selection("Te") if (pushed_this$="Po")then:element_selection("Po") if (pushed_this$="F ")then:element_selection("F ") if (pushed_this$="Cl")then:element_selection("Cl") if (pushed_this$="Br")then:element_selection("Br") if (pushed_this$="I ")then:element_selection("I ") if (pushed_this$="At")then:element_selection("At") if (pushed_this$="He")then:element_selection("He") if (pushed_this$="Ne")then:element_selection("Ne") if (pushed_this$="Ar")then:element_selection("Ar") if (pushed_this$="Kr")then:element_selection("Kr") if (pushed_this$="Xe")then:element_selection("Xe") if (pushed_this$="Rn")then:element_selection("Rn") if (pushed_this$="Ce")then:element_selection("Ce") if (pushed_this$="Th")then:element_selection("Th") if (pushed_this$="Pr")then:element_selection("Pr") if (pushed_this$="Pa")then:element_selection("Pa") if (pushed_this$="Nd")then:element_selection("Nd") if (pushed_this$="U ")then:element_selection("U ") if (pushed_this$="Pm")then:element_selection("Pm") if (pushed_this$="Np")then:element_selection("Np") if (pushed_this$="Sm")then:element_selection("Sm") if (pushed_this$="Pu")then:element_selection("Pu") if (pushed_this$="Eu")then:element_selection("Eu") if (pushed_this$="Am")then:element_selection("Am") if (pushed_this$="Gd")then:element_selection("Gd") if (pushed_this$="Cm")then:element_selection("Cm") if (pushed_this$="Tb")then:element_selection("Tb") if (pushed_this$="Bk")then:element_selection("Bk") if (pushed_this$="Dy")then:element_selection("Dy") if (pushed_this$="Cf")then:element_selection("Cf") if (pushed_this$="Ho")then:element_selection("Ho") if (pushed_this$="Es")then:element_selection("Es") if (pushed_this$="Er")then:element_selection("Er") if (pushed_this$="Fm")then:element_selection("Fm") if (pushed_this$="Tm")then:element_selection("Tm") if (pushed_this$="Md")then:element_selection("Md") if (pushed_this$="Yb")then:element_selection("Yb") if (pushed_this$="No")then:element_selection("No") if (pushed_this$="Lu")then:element_selection("Lu") if (pushed_this$="Lw")then:element_selection("Lw") if (pushed_this$="Ku")then:element_selection("Ku") if (pushed_this$="Ha")then:element_selection("Ha") if (pushed_this$="Sg")then:element_selection("Sg") if (pushed_this$="Bh")then:element_selection("Bh") if (pushed_this$="Hs")then:element_selection("Hs") if (pushed_this$="Mt")then:element_selection("Mt") if (pushed_this$="Uun")then:element_selection("Uun") if (pushed_this$="Uuu")then:element_selection("Uuu") if (pushed_this$="Uub")then:element_selection("Uub") if (pushed_this$="First Element")then:load_element("First Element") if (pushed_this$="Second Element")then:load_element("Second Element") if (pushed_this$="Initialize")then:initialize() if (pushed_this$="Chemical Reaction")then:compute_chemical_reaction() ` compute("Chemical Reaction") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") ` if (pushed_this$="")then:element_selection("") endfunction function line_box(x1,y1,x2,y2) line x1,y1,x2,y1 line x1,y2,x2,y2 line x1,y1,x1,y2 line x2,y1,x2,y2 endfunction function element_selection(element$) if (element$="H ") print_xy_message(0,halfy+50,H$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="O ") print_xy_message(0,halfy+50,O$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="He") print_xy_message(0,halfy+50,He$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="B ") print_xy_message(0,halfy+50,B$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="C ") print_xy_message(0,halfy+50,C$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="N ") print_xy_message(0,halfy+50,N$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="O ") print_xy_message(0,halfy+50,O$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="F ") print_xy_message(0,halfy+50,F$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Ne") print_xy_message(0,halfy+50,Ne$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Na") print_xy_message(0,halfy+50,Na$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Mg") print_xy_message(0,halfy+50,Mg$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Al") print_xy_message(0,halfy+50,Al$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Si") print_xy_message(0,halfy+50,Si$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="P ") print_xy_message(0,halfy+50,P$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="S ") print_xy_message(0,halfy+50,S$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Cl_") print_xy_message(0,halfy+50,Cl_$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Ar") print_xy_message(0,halfy+50,Ar$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="K ") print_xy_message(0,halfy+50,K$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Ca") print_xy_message(0,halfy+50,Ca$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Cr") print_xy_message(0,halfy+50,Cr$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Mn") print_xy_message(0,halfy+50,Mn$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Fe") print_xy_message(0,halfy+50,Fe$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Ni") print_xy_message(0,halfy+50,Ni$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Cu") print_xy_message(0,halfy+50,Cu$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Zn") print_xy_message(0,halfy+50,Zn$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Br") print_xy_message(0,halfy+50,Br$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Ag") print_xy_message(0,halfy+50,Ag$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Sn") print_xy_message(0,halfy+50,Sn$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="I ") print_xy_message(0,halfy+50,I$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Pt") print_xy_message(0,halfy+50,Pt$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Au") print_xy_message(0,halfy+50,Au$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Hg") print_xy_message(0,halfy+50,Hg$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Pb") print_xy_message(0,halfy+50,Pb$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="Ra") print_xy_message(0,halfy+50,Ra$) print_xy_message(100,halfy+50,element$) hold$=element$ endif if (element$="U ") print_xy_message(0,halfy+50,U$) print_xy_message(100,halfy+50,element$) hold$=element$ endif endfunction function print_that() print_xy_message(halfx*(0.15625*7)*shift#,halfy*(0.1*12.7),element_1$) print_xy_message(halfx*(0.15625*7)*shift#,halfy*(0.1*13.7),element_2$) print_xy_message(halfx*(0.15625*7)*shift#,halfy*(0.1*15.0),hold$) endfunction function load_element(element$) if (element$="First Element") element_1$=hold$ endif if (element$="Second Element") element_2$=hold$ endif endfunction function compute_chemical_reaction() if (introduction_message$="yes")then:print_xy_message(halfx*(0.15625*2)*shift#,halfy*(0.1*17),"...Waiting substances for chemical reaction...") `if (introduction_message$="no") ` if (element_1$="Null" or element_2$="Null") ` print_xy_message(halfx*(0.15625*2)*shift#,halfy*(0.1*17)," ...Cannot resolve chemical equation...") ` endif `endif ```thinking algorithm if (element_1$="H ") substance_1$="H2" endif if (element_1$="O ") substance_1$="O2" endif if (element_1$="He") substance_1$="He" endif if (element_1$="B ") endif if (element_1$="C ") endif if (element_1$="N ") substance_1$="N2" endif if (element_1$="F ") substance_1$="F2" endif if (element_1$="Ne") endif if (element_1$="Na") endif if (element_1$="Mg") endif if (element_1$="Al") endif if (element_1$="Si") endif if (element_1$="P ") endif if (element_1$="S ") endif if (element_1$="Cl_") substance_1$="Cl2" endif if (element_1$="Ar") endif if (element_1$="K ") endif if (element_1$="Ca") endif if (element_1$="Cr") endif if (element_1$="Mn") endif if (element_1$="Fe") endif if (element_1$="Ni") endif if (element_1$="Cu") endif if (element_1$="Zn") endif if (element_1$="Br") substance_1$="Br2" endif if (element_1$="Ag") endif if (element_1$="Sn") endif if (element_1$="I ") substance_1$="I2" endif if (element_1$="Pt") endif if (element_1$="Au") endif if (element_1$="Hg") endif if (element_1$="Pb") endif if (element_1$="Ra") endif if (element_1$="U ") endif ```` if (element_2$="H ") substance_2$="H2" endif if (element_2$="O ") substance_2$="O2" endif if (element_2$="He") substance_2$="He" endif if (element_2$="B ") endif if (element_2$="C ") endif if (element_2$="N ") substance_2$="N2" endif if (element_2$="O ") endif if (element_2$="F ") substance_2$="F2" endif if (element_2$="Ne") endif if (element_2$="Na") endif if (element_2$="Mg") endif if (element_2$="Al") endif if (element_2$="Si") endif if (element_2$="P ") endif if (element_2$="S ") endif if (element_2$="Cl_") substance_2$="Cl2" endif if (element_2$="Ar") endif if (element_2$="K ") endif if (element_2$="Ca") endif if (element_2$="Cr") endif if (element_2$="Mn") endif if (element_2$="Fe") endif if (element_2$="Ni") endif if (element_2$="Cu") endif if (element_2$="Zn") endif if (element_2$="Br") substance_2$="Br2" endif if (element_2$="Ag") endif if (element_2$="Sn") endif if (element_2$="I ") substance_2$="I2" endif if (element_2$="Pt") endif if (element_2$="Au") endif if (element_2$="Hg") endif if (element_2$="Pb") endif if (element_2$="Ra") endif if (element_2$="U ") endif if (introduction_message$="no")then:show_result() ````````` endfunction function colour_reference() print_xy_message(halfx*(0.15625*8)*shift#,halfy*(0.1*11),"Colour reference") print_xy_message(halfx*(0.15625*8)*shift#,halfy*(0.1*12),"Green: non-metals") print_xy_message(halfx*(0.15625*8)*shift#,halfy*(0.1*13)," Blue: metals") print_xy_message(halfx*(0.15625*8)*shift#,halfy*(0.1*14),"Orange: metalloids") print_xy_message(halfx*(0.15625*8)*shift#,halfy*(0.1*15)," Red: rare gases") endfunction function show_result() print_xy_message(halfx*(0.15625*2)*shift#,halfy*(0.1*17),element_1$) print_xy_message(halfx*(0.15625*3)*shift#,halfy*(0.1*17),"+") print_xy_message(halfx*(0.15625*4)*shift#,halfy*(0.1*17),element_2$) print_xy_message(halfx*(0.15625*5)*shift#,halfy*(0.1*17),"----->") print_xy_message(halfx*(0.15625*6)*shift#,halfy*(0.1*17),result_1$) endfunction function initialize() element_1$="Null" element_2$="Null" element_3$="Null" hold$="Null" substance_1$="Null" substance_2$="Null" substance_3$="Null" result_1$="Null" result_2$="Null" result_3$="Null" endfunction |