8-Bit Software Online Conversion

Periodic Table Program - Listing

10REM Periodic Table 20REM (c) M.Bobrowski 11'1989 30MODE4:HIMEM=&5800:LOMEM=PAGE+&2800: ON ERROR MODE6:@%=&90A:OSCLI"FX4":END 40PROCchar:PROCass:PROCinit 50REPEAT:CALL T%:PROCtitle:PROCchoice :PROCproperties:UNTIL FALSE 60: 70DEF PROCinit 80DIM S$(105),N$(105),M(105),O$(6) 90FORI%=1TO105:READ S$(I%),N$(I%),M(I %):NEXT 100O$(1)="1s ":O$(2)=O$(1)+"2s 2p ":O$ (3)=O$(2)+"3s 3p ":O$(4)=O$(3)+"3d 4s 4 p ":O$(5)=O$(4)+"4d 5s 5p ":O$(6)=O$(5) +"4f 5d 6s 6p ":*FX4,1 110T%=PAGE+&1F74:T%?5=(PAGE+&1F90)DIV2 56:T%?9=(PAGE+&1F90)MOD256:T%?23=LOMEM D IV256:S%=PAGE+&1C8B:D%=S%+&6A:U%=S%+&D4: H%=S%+&13E:G%=H%+1:V%=S%+&212:W%=V%+1:N% =19+RND(34):ENDPROC 120: 130DEFPROCchoice:PROCcursor(N%):PROCwi ndow 140REPEAT:M%=N%:PROCget:PROCcursor(M%) :PROCcursor(N%):PROCwindow:UNTIL K%=13:E NDPROC 150DEFPROCget:REPEAT:SOUND1,-15,200,2: *FX21 160K%=GET:IF K%=136 N%=N%-1:IF N%=0 N% =1 170IF K%=137 N%=N%+1:IF N%=106 N%=105 180IF K%=138 N%=N%?D% ELSE IF K%=139 N %=N%?U% 190UNTIL(K%>135 AND K%<140)ORK%=13:END PROC 200DEFPROCcursor(N%):J%=2*N%:X%=256*J% ?H%+J%?G%:Y%=256*J%?V%+J%?W%:MOVEX%,Y%:G COL4,1:PLOT0,-26,35:PLOT0,56,0:PLOT81,0, -70:PLOT0,-4,0:PLOT0,-56,0:PLOT81,0,70:E NDPROC 210DEFPROCwindow:GCOL0,1:MOVE280,692:D RAW280,895:DRAW760,895:DRAW760,692:DRAW2 80,692:VDU24,320;700;756;860;16 220Z%=@%:VDU5:L%=478-32*LENSTR$N%:MOVE L%,860:PRINT;N%:@%=&20307:MOVE520,860:PR INT;M(N%):@%=Z%:L%=2-LENS$(N%):MOVE474+L %*16,812:PROCdbl(S$(N%)):L%=13-LENN$(N%) :MOVE320+L%*14,740:PRINTN$(N%):VDU4,26:E NDPROC 230: 240DEFPROCproperties:RESTORE550:FORQ%= 1TON%:READQ$,U$:NEXT 250CLS:VDU19,0,0;0;19,1,7;0;23,1,0;0;0 ;0;:MOVE0,260:DRAW0,990:DRAW1279,990:DRA W1279,260:DRAW0,260:MOVE0,910:DRAW1279,9 10:MOVE0,490:DRAW1279,490 260PRINTTAB(19-(LENN$(N%))DIV2,2);N$(N %)'TAB(2,4)"chemical symbol";TAB(23);S$( N%)'TAB(2,6)"atomic number";TAB(23);N%'T AB(2,8)"atomic mass";TAB(23);M(N%)'TAB(2 ,10);"properties";TAB(23); 270IF N%?S%=0 OR N%?S%=4 PRINT"metal" ELSE IF N%?S%=2 PRINT"amphoteric" ELSE P RINT"non-metal" 280PRINTTAB(2,12);"state of aggregatio n ";:IF N%?S%<3 PRINT"solid" ELSEIF N% ?S%=3 PRINT"gas" ELSE PRINT"liquid" 290PRINTTAB(2,14);"oxidation states";T AB(19);U$'TAB(4,18)"electron configurati on of atoms" 300IF N%<3THEN310 ELSEIFN%>2ANDN%<11Q$ =O$(1)+Q$ ELSEIFN%>10ANDN%<19Q$=O$(2)+Q$ ELSEIFN%>18ANDN%<37Q$=O$(3)+Q$ ELSEIFN% >36ANDN%<55Q$=O$(4)+Q$ ELSEIFN%>54ANDN%< 87Q$=O$(5)+Q$ ELSEQ$=O$(6)+Q$ 310IF N%<55 PRINTTAB((39-LENQ$)DIV2,20 );Q$ ELSE PRINTTAB(2,20)LEFT$(Q$,35)TAB( 2,22)RIGHT$(Q$,LENQ$-35) 320SOUND1,-10,60,2:SOUND1,-10,76,2:SOU ND1,-10,88,2:SOUND1,-10,108,2:PRINTTAB(1 2,30)"Press Space Bar";:REPEATUNTILGET=3 2:ENDPROC 330: 340DEFPROCtitle 350GCOL0,129:GCOL0,0:VDU5,24,4;935;127 5;1019;16:MOVE76,1003:PROCdbl("Periodic Table of Chemical Elements"):VDU24,4;4;1 275;100;16:MOVE64,88:PRINT"To select an element use cursor keys":MOVE368,44:PRIN T"then press RETURN" 360GCOL0,128:GCOL0,1:VDU26,4:ENDPROC 370DEFPROCdbl(A$):LOCALA%,CH%:FORCH%=1 TOLENA$:A%=ASCMID$(A$,CH%,1):CALLd:NEXT: ENDPROC 380: 390DEFPROCass DIMMC%100:oswrch=&FFEE:o sword=&FFF1:FORI%=0TO2STEP2:P%=MC%:[OPTI %:.d STAb:LDA#10:LDX#b AND255:LDY#b DIV2 56:JSRosword:LDA#0:STAj:.d1 LDA#23:JSRos wrch:LDAj:ORA#254:JSRoswrch:LDAj:ASLA:AS LA:TAX:LDY#4:.d2 INX:LDAb,X:JSRoswrch 400JSRoswrch:DEY:BNEd2:INCj:LDAj:CMP#2 :BNEd1:LDX#4:.d3 LDAs,X:JSRoswrch:DEX:BP Ld3:RTS:.b:]:j=b+9:s=j+1:$s=CHR$11+CHR$2 55+CHR$8+CHR$10+CHR$254:NEXT:ENDPROC 410: 420DEFPROCchar:VDU23,128,26172;26214;6 0;0;23,129,14360;6168;24;0;23,130,26172; 12300;126;0;23,131,26172;26124;60;0;23,1 32,27756;3198;12;0;23,133,24702;1660;124 ;0;23,134,24636;26236;60;0;23,135,3198;1 2312;96;0;23,136,26172;26172;60;0; 430VDU23,137,26172;1598;60;0;:ENDPROC 440: 450DATA H,Hydrogen,1.008,He,Helium,4.0 03,Li,Lithium,6.941,Be,Beryllium,9.012,B ,Boron,10.81,C,Carbon,12.012,N,Nitrogen, 14.007,O,Oxygen,15.999,F,Fluorine,18.998 ,Ne,Neon,20.179,Na,Sodium,22.990,Mg,Magn esium,24.305,Al,Aluminium,26.982 460DATA Si,Silicon,28.086,P,Phosphorus ,30.974,S,Sulphur,32.06,Cl,Chlorine,35.4 53,Ar,Argon,39.948,K,Potassium,39.098,Ca ,Calcium,40.08,Sc,Scandium,44.956,Ti,Tit anium,47.9,V,Vanadium,50.941,Cr,Chromium ,51.996,Mn,Manganese,54.938 470DATA Fe,Iron,55.847,Co,Cobalt,58.93 3,Ni,Nickel,58.7,Cu,Copper,63.546,Zn,Zin c,65.38,Ga,Gallium,69.72,Ge,Germanium,72 .59,As,Arsenic,74.922,Se,Selenium,78.96, Br,Bromine,79.904,Kr,Krypton,83.8,Rb,Rub idium,85.468,Sr,Strontium,87.62 480DATA Y,Yttrium,88.906,Zr,Zirconium, 91.22,Nb,Niobium,92.906,Mo,Molybdenum,95 .94,Tc,Technetium,96.906,Ru,Ruthenium,10 1.07,Rh,Rhodium,102.906,Pd,Palladium,106 .4,Ag,Silver,107.868,Cd,Cadmium,112.4,In ,Indium,114.82,Sn,Tin,118.69 490DATA Sb,Antimony,121.75,Te,Telluriu m,127.6,I,Iodine,126.905,Xe,Xenon,131.3, Cs,Caesium,132.905,Ba,Barium,137.34,La,L anthanum,138.906,Ce,Cerium,140.12,Pr,Pra seodymium,140.908,Nd,Neodymium,144.24,Pm ,Promethium,144.913,Sm,Samarium,150.4 500DATA Eu,Europium,151.96,Gd,Gadolini um,157.25,Tb,Terbium,158.925,Dy,Dysprosi um,162.5,Ho,Holmium,164.930,Er,Erbium,16 7.26,Tm,Thulium,168.934,Yb,Ytterbium,173 .04,Lu,Lutetium,174.97,Hf,Hafnium,178.49 ,Ta,Tantalum,180.948,W,Tungsten,183.85 510DATA Re,Rhenium,186.207,Os,Osmium,1 90.2,Ir,Iridium,192.22,Pt,Platinum,195.0 9,Au,Gold,196.967,Hg,Mercury,200.59,Tl,T hallium,204.37,Pb,Lead,207.2,Bi,Bismuth, 208.98,Po,Polonium,208.982,At,Astatine,2 09.987,Rn,Radon,222.018 520DATA Fr,Francium,223.019,Ra,Radium, 226.025,Ac,Actinium,227.028,Th,Thorium,2 32.038,Pa,Protactinium,231.036,U,Uranium ,238.029,Np,Neptunium,237.048,Pu,Plutoni um,244.064,Am,Americium,243.061,Cm,Curiu m,247.07,Bk,Berkelium,247.07 530DATA Cf,Californium,251.08,Es,Einst einium,254.088,Fm,Fermium,257.095,Md,Men delevium,258.1,No,Nobelium,255.093,Lr,La wrencium,260.1,Ku,Kurchatovium,261.1,Ha, Hahnium,260 540: 550DATA "1s ","+1,(-1)","1s ",0,"2s ", "+1","2s ","+2","2s 2p ","+3","2s 2p "," -4,+4,(+2)","2s 2p ","-3,+3,+5,(+1,+2,+4 )","2s 2p ","-2,(-1)","2s 2p ","-1","2s 2p ",0,"3s ","+1","3s ","+2","3s 3p ","+ 3","3s 3p ","-4,+4,(+2)" 560DATA "3s 3p ","+3,+5,(-3)","3s 3p " ,"-2,+6,(+4)","3s 3p ","-1,+7,(+1,+3,+5, +6)","3s 3p ",0,"4s ","+1","4s ","+2","3 d 4s ","+3","3d 4s ","+4,(+2,+3)","3d 4s ","+5,(+1,+2,+3,+4)","3d 4s ","+3,+6,(+ 2)","3d 4s ","+2,+7,(+3,+4,+6)" 570DATA "3d 4s ","+2,+3","3d 4s ","+2, (+3)","3d 4s ","+2,(+1,+3)","3d 4s ","+ 2,(+1)","3d 4s ","+2","3d 4s 4p ","+3" ,"3d 4s 4p ","+4,(+2)","3d 4s 4p ","+3 ,+5,(-3)","3d 4s 4p ","-2,+6,(+4)","3d 4s 4p ","-1,(+1,+4,+5,+7)" 580DATA "3d 4s 4p ","0,(+2,+4)","5s " ,"+1","5s ","+2","4d 5s ","+3","4d 5s ", "+4","4d 5s ","+5,(+2,+3)","4d 5s ","+6, (+2,+3,+4)","4d 5s ","+4,+7,(+6)","4d 5s ","+4,(+2,+3,+6,+8)","4d 5s ","+3,(+2,+ 4,+5,+6)","4d ","+2,(+4)" 590DATA "4d 5s ","+1,(+2)","4d 5s ", "+2","4d 5s 5p ","+3","4d 5s 5p ","+4, (+2)","4d 5s 5p ","+3,+5,(-3)","4d 5s 5p ","-2,+6,(+4)","4d 5s 5p ","-1,(+1,+ 5,+7)","4d 5s 5p ","0,(+1,+2,+4,+6)","6 s ","+1","6s ","+2","5d 6s ","+3" 600DATA "4f 5d 6s ","+3,+4","4f 5d 6s ","+3,(+4)","4f 5d 6s ","+3","4f 5d 6s " ,"+3","4f 5d 6s ","+2,+3","4f 5d 6s ","+ 2,+3","4f 5d 6s ","+3","4f 5d 6s ","+3,( +4)","4f 5d 6s ","+3","4f 5d 6s ","+3", "4f 5d 6s ","+3" 610DATA "4f 5d 6s ","+3,(+2)","4f 5d 6s ","+3,(+2)","4f 5d 6s ","+3","4f 5 d 6s ","+4","4f 5d 6s ","+5,(+3,+4)","4 f 5d 6s ","+6,(+2,+3,+4,+5)","4f 5d 6s ","+4,+7,(+6)","4f 5d 6s ","+6,+8,(+3, +4)","4f 5d 6s ","+3,+4,(+6)" 620DATA "4f 5d 6s ","+2,+4,(+3,+6)"," 4f 5d 6s ","+3,(+1)","4f 5d 6s ","+2 ,(+1)","4f 5d 6s 6p ","+3,(+1)","4f 5 d 6s 6p ","+2,+4","4f 5d 6s 6p ","+3, (+5)","4f 5d 6s 6p ","(+2,+4)","4f 5d 6s 6p ","(+1,+5,+7)" 630DATA "4f 5d 6s 6p ","0,(+4)","7s ","+1","7s ","+2","6d 7s ","+3","5f 6d 7 s ","+4","5f 6d 7s ","+5,(+4)","5f 6d 7s ","+6,(+3,+4,+5)","5f 6d 7s ","+5,(+3,+ 4,+6)","5f 6d 7s ","+4,(+3,+5,+6)","5f 6 d 7s ","+3,(+4,+5,+6)" 640DATA "5f 6d 7s ","+3,(+4)","5f 6d 7 s ","+3","5f 6d 7s ","+3","5f 6d 7s "," +3","5f 6d 7s ","+3","5f 6d 7s ","+3,( +2)","5f 6d 7s ","+3,(+2)","5f 6d 7s " ,"+3","5f 6d 7s ","+4","5f 6d 7s ","+5 "