home *** CD-ROM | disk | FTP | other *** search
- 10 rem *** election night ***
- 20 rem *** copyright 1984 ***
- 30 rem *** by john beltrami ***
- 31 rem *** translated by donna woody***
- 35 s=65520:poke783,peek(783)and254
- 37 poke53280,1:poke53281,7:printchr$(144):poke53272,23:printchr$(8)
- 40 printchr$(147):poke781,3:poke782,13:syss:print"[197][204][197][195][212][201][207][206] [206][201][199][200][212]"
- 41 poke781,7:poke782,19:syss:print"by"
- 42 poke781,9:poke782,13:syss:print"[202]ohn [194]eltrami"
- 43 poke781,15:poke782,4:syss:print"[212]ranslated for the [195]ommodore by"
- 44 poke781,17:poke782,13:syss:print"[196]onna [203]. [215]oody"
- 50 dimv(51,3),n$(51),p$(51),e(51)
- 60 gosub2180:rem *** initialize ***
- 70 gosub1330:rem *** introduction ***
- 80 gosub1140:rem *** main menu ***
- 90 rem *** results ***
- 100 printchr$(147)
- 120 poke781,2:poke782,10:syss:print"[210][197][211][213][204][212][211] [205][197][206][213]"
- 140 poke781,5:poke782,5:syss:print"1 - [211]tate [214]oting [210]esults"
- 150 poke781,6:poke782,5:syss:print" (data entry)"
- 160 poke781,8:poke782,5:syss:print"2 - [206]ational [208]icture"
- 170 poke781,9:poke782,5:syss:print" (results)"
- 180 poke781,11:poke782,5:syss:print"3 - [210]eturn to [205]ain [205]enu"
- 190 poke781,15:poke782,5:syss:print"[217]our choice?";:poke198,0:wait198,1:gety$
- 200 y=val(y$):ify<1ory>3thengoto190
- 210 ify=3thengoto250
- 220 ify=2thengosub480:goto100:rem *** national ***
- 230 gosub260:rem *** state ***
- 240 goto100
- 250 return
- 260 rem *** state menu ***
- 270 printchr$(147)
- 280 fori=1to20
- 290 h1=0:h2=13:h3=26
- 300 i$=str$(i):ifi<10theni$=" "+i$
- 310 i$=i$+"-"+n$(i)
- 320 printi$
- 330 j=i+20:i$=str$(j)
- 340 i$=i$+"-"+n$(j)
- 350 poke781,i:poke782,h2:syss:printi$
- 360 ifi>11thengoto400
- 370 j=i+40:i$=str$(j)
- 380 i$=i$+"-"+n$(j)
- 390 poke781,i:poke782,h3:syss:printi$
- 400 nexti
- 410 poke781,22:poke782,0:syss:print"[197]nter zero[144] to exit or number of a state[144]"
- 420 goto440
- 430 poke781,22:poke782,0:syss:print" [197]nter <0> to exit "
- 440 poke781,23:poke782,10:syss:input"[217]our choice";y$
- 450 y=val(y$):ify>51thengoto430
- 460 ify>0thengosub850:goto270:rem *** state ***
- 470 return
- 480 rem *** national report ***
- 490 printchr$(147)
- 510 poke781,2:poke782,10:syss:print"[206][193][212][201][207][206][193][204] [210][197][211][213][204][212][211]"
- 530 tt(1)=0:tt(2)=0:tt(3)=0
- 540 te(1)=0:te(2)=0:te(3)=0
- 550 s(1)=0:s(2)=0:s(3)=0
- 560 fori=1to51
- 570 tt(1)=tt(1)+v(i,1)
- 580 tt(2)=tt(2)+v(i,2)
- 590 tt(3)=tt(3)+v(i,3)
- 600 if(v(i,1)>v(i,2))and(v(i,1)>v(i,3))thente(1)=te(1)+e(i):s(1)=s(1)+1
- 610 if(v(i,2)>v(i,1))and(v(i,2)>v(i,3))thente(2)=te(2)+e(i):s(2)=s(2)+1
- 620 if(v(i,3)>v(i,1))and(v(i,3)>v(i,2))thente(3)=te(3)+e(i):s(3)=s(3)+1
- 630 nexti
- 640 poke781,4:poke782,3:syss:print"270 electoral votes needed to win"
- 660 poke781,6:poke782,12:syss:print"[197][204][197][195][212][207][210][193][204] [195][193][210][210][201][197][196]"
- 670 poke781,7:poke782,14:syss:print"[214][207][212][197][211] [211][212][193][212][197][211]"
- 680 flag=1:z=te(1):gosub2430:flag=0
- 690 poke781,9:poke782,1:syss:print"[196]emocratic: ";z$
- 695 flag=1:z=s(1):gosub2430:flag=0
- 700 poke781,9:poke782,29:syss:printz$
- 705 flag=1:z=te(2):gosub2430:flag=0
- 710 poke781,11:poke782,1:syss:print"[210]epublican: ";z$
- 715 flag=1:z=s(2):gosub2430:flag=0
- 720 poke781,11:poke782,29:syss:printz$
- 725 flag=1:z=te(3):gosub2430:flag=0
- 730 poke781,13:poke782,1:syss:print"[207]ther: ";z$
- 735 flag=1:z=s(3):gosub2430:flag=0
- 740 poke781,13:poke782,29:syss:printz$
- 750 poke781,15:poke782,13:syss:print"[208][207][208][213][204][193][210] [214][207][212][197]"
- 760 z=tt(1):gosub2430
- 770 poke781,17:poke782,5:syss:print"[196]emocrats ......";z$
- 780 z=tt(2):gosub2430
- 790 poke781,18:poke782,5:syss:print"[210]epublicans ....";z$
- 800 z=tt(3):gosub2430
- 810 poke781,19:poke782,5:syss:print"[207]ther ..........";z$
- 820 poke781,22:poke782,5:syss:print"[210]eady to return to menu (y/n)?";
- 830 poke198,0:wait198,1:gety$:ify$<>"y"andy$<>"[217]"then820
- 840 return
- 850 rem *** state results ***
- 860 printchr$(147)
- 870 poke781,1:poke782,10:syss:print"[211][212][193][212][197]: "n$(y)
- 880 poke781,3:poke782,10:syss:print"[197][204][197][195][212][207][210][193][204] [214][207][212][197][211]: ";e(y)
- 890 v1=4
- 900 fori=1to6
- 910 poke781,v1+i:poke782,1:syss:printyy$(i)
- 930 poke781,v1+i:poke782,6:syss:ifmid$(p$(y),i,1)="d"thenprint"[196]emocrat"
- 950 poke781,v1+i:poke782,6:syss:ifmid$(p$(y),i,1)="r"thenprint"[210]epublican"
- 970 poke781,v1+i:poke782,6:syss:ifmid$(p$(y),i,1)="o"thenprint"[207]ther"
- 990 nexti
- 1000 poke781,12:poke782,5:syss:print"[196]emocratic vote: ";v(y,1)
- 1010 poke781,14:poke782,5:syss:print"[210]epublican vote: ";v(y,2)
- 1020 poke781,16:poke782,5:syss:print"[207]ther party vote: ";v(y,3)
- 1030 poke781,18:poke782,5:syss:print"<[196]> update [196]emocratic votes"
- 1040 poke781,19:poke782,5:syss:print"<[210]> update [210]epublican votes"
- 1050 poke781,20:poke782,5:syss:print"<[207]> update other party votes"
- 1060 poke781,21:poke782,5:syss:print"<[216]> return to state menu (exit)"
- 1070 poke781,23:poke782,10:syss:print"[217]our choice?";:poke198,0:wait198,1:gety$
- 1080 ify$="x"ory$="[216]"thengoto1130
- 1090 ify$="d"ory$="[196]"thennn$="[196]emocrat":nn=1:gosub2360:goto850
- 1100 ify$="r"ory$="[210]"thennn$="[210]epublican":nn=2:gosub2360:goto850
- 1110 ify$="o"ory$="[207]"thennn$="[207]ther":nn=3:gosub2360:goto850
- 1120 goto1070
- 1130 return
- 1140 rem *** main menu ***
- 1150 printchr$(147)
- 1170 poke781,5:poke782,5:syss:print"[197][204][197][195][212][201][207][206][160][206][201][199][200][212][160][205][197][206][213]"
- 1190 poke781,10:poke782,5:syss:print"1 - [197]lection analysis"
- 1200 poke781,12:poke782,5:syss:print"2 - [212]rash-can current results and"
- 1210 poke781,13:poke782,5:syss:print" start fresh!"
- 1220 poke781,15:poke782,5:syss:print"3 - [209]uit (exit the program)"
- 1230 poke781,20:poke782,5:syss:print"[217]our choice? ";:poke198,0:wait198,1:gety$
- 1240 y=val(y$):ify<1ory>3thengoto1230
- 1245 printy$
- 1250 ify=1thengosub90:goto1320:rem *** results ***
- 1260 ify=2thengoto1300
- 1265 print
- 1270 poke781,22:poke782,5:syss:print"[193]re you sure?";:poke198,0:wait198,1:gety$
- 1280 ify$="y"ory$="[217]"thengoto2580:rem *** end ***
- 1290 goto1140
- 1300 poke781,22:poke782,5:syss:print"[193]re you sure (y/n)?";
- 1310 poke198,0:wait198,1:gety$:ify$="y"ory$="[217]"thengosub2280:rem * clear totals
- 1320 goto1140
- 1330 rem *** introduction ***
- 1340 printchr$(147)
- 1430 poke781,2:poke782,13:syss:print"[197][204][197][195][212][201][207][206]"
- 1440 poke781,2:poke782,22:syss:print"[206][201][199][200][212]"
- 1460 poke781,4:poke782,12:syss
- 1470 print" copyright 1984 "
- 1480 poke781,6:poke782,12:syss
- 1490 print"by [202]ohn [194]eltrami"
- 1500 print:print
- 1510 print"[212]his program allows you to follow the"
- 1520 print
- 1530 print"[208]residential election and chart the"
- 1540 print
- 1550 print"results as they become known. [212]he"
- 1560 print
- 1570 print"results of the last six elections have"
- 1580 print
- 1590 print"been included so that state trends can"
- 1600 print
- 1610 print"be analyzed."
- 1620 print:print
- 1630 print
- 1640 poke781,23:poke782,5:syss:print"[193]re you ready to start (y/n)?";
- 1650 poke198,0:wait198,1:gety$:ify$<>"y"andy$<>"[217]"then1640
- 1651 printchr$(147):poke781,5:poke782,1:syss
- 1652 print:print"[208]lease remember that you can only enter"
- 1653 print:print"the popular vote count. [212]he computer"
- 1654 print:print"will assign the electoral votes to the"
- 1656 print:print"candidate with the majority of the"
- 1657 print:print"popular votes cast in that state."
- 1659 print:print"270 electoral votes win!"
- 1660 poke781,23:poke782,5:syss:print"[210]eady to go (y/n)?";
- 1662 poke198,0:wait198,1:gety$:ify$<>"y"andy$<>"[217]"then1660
- 1665 return
- 1670 data"[193]labama ","drordr",9
- 1680 data"[193]laska ","rdrrrr",3
- 1690 data"[193]rizona ","rrrrrr",7
- 1700 data"[193]rkansas ","ddordr",6
- 1710 data"[195]alif. ","rddddr",47
- 1720 data"[195]olorado ","rdrrrr",8
- 1730 data"[195]onnect. ","dddrrr",8
- 1740 data"[196]elaware ","ddrrdr",3
- 1750 data"[196].[195]. [215]ash","oddddd",3
- 1760 data"[198]lorida ","rdrrdr",21
- 1770 data"[199]eorgia ","drordd",12
- 1780 data"[200]awaii ","dddrdd",4
- 1790 data"[201]daho ","rdrrrr",4
- 1800 data"[201]llinois ","ddrrrr",24
- 1810 data"[201]ndiana ","rdrrrr",12
- 1820 data"[201]owa ","rdrrrr",8
- 1830 data"[203]ansas ","rdrrrr",7
- 1840 data"[203]entucky ","rdrrdr",9
- 1850 data"[204]ouisiana","drordr",10
- 1860 data"[205]aineiana","rddrrr",4
- 1870 data"[205]aryland ","dddrdr",10
- 1880 data"[205]ass. ","dddddr",13
- 1890 data"[205]ichigan ","dddddr",20
- 1900 data"[205]innesota","dddrdd",10
- 1910 data"[205]ississi.","drordr",7
- 1920 data"[205]issouri ","ddrrdr",11
- 1930 data"[205]ontana ","rdrrrr",4
- 1940 data"[206]ebraska ","rdrrrr",5
- 1950 data"[206]evada ","ddrrrr",4
- 1960 data"[206]ew [200]amp.","rdrrrr",4
- 1970 data"[206] [202]ersey ","dddrrr",16
- 1980 data"[206] [205]exico ","ddrrrr",5
- 1990 data"[206]ew [217]ork ","dddrdr",36
- 2000 data"[206]o. [195]arol","ddrrdr",13
- 2010 data"[206]o [196]akota","rdrrrr",3
- 2020 data"[207]hio ","rdrrdr",23
- 2030 data"[207]klahoma ","rdrrrr",8
- 2040 data"[207]regon ","rdrrrr",7
- 2050 data"[208]ennsyl. ","dddrdr",25
- 2060 data"[210]hode [201]sl","dddrdd",4
- 2070 data"[211]o. [195]arol","drrrdr",8
- 2080 data"[211]o.[196]akota","rdrrrr",3
- 2090 data"[212]ennessee","rdrrdr",11
- 2100 data"[212]exas ","dddrdr",29
- 2110 data"[213]tah ","rdrrrr",5
- 2120 data"[214]ermont ","rdrrrr",3
- 2130 data"[214]irginia ","rdrrrr",12
- 2140 data"[215]ashingtn","rddrrr",10
- 2150 data"[215] [214]irgini","dddrdd",6
- 2160 data"[215]isconsin","rdrrdr",11
- 2170 data"[215]yoming ","rdrrrr",3
- 2180 rem *** initialize ***
- 2185 sp$=" "
- 2190 fori=1to51
- 2200 readn$(i),p$(i),e(i)
- 2210 nexti
- 2220 yy$(1)="1960"
- 2230 yy$(2)="1964"
- 2240 yy$(3)="1968"
- 2250 yy$(4)="1972"
- 2260 yy$(5)="1976"
- 2270 yy$(6)="1980"
- 2280 tt(1)=0:tt(2)=0:tt(3)=0
- 2290 te(1)=0:te(2)=0:te(3)=0
- 2300 fori=1to51
- 2310 forj=1to3
- 2320 v(i,j)=0
- 2330 nextj
- 2340 nexti
- 2350 return
- 2360 rem *** update votes ***
- 2370 poke781,17:poke782,0:syss
- 2375 forx=1to7:printsp$:next
- 2380 poke781,19:poke782,5:syss:print"[206]ew ";nn$;" vote count"
- 2390 poke781,23:poke782,5:syss:input"---->";u$
- 2400 u=val(u$)
- 2410 v(y,nn)=u
- 2420 return
- 2430 rem *** format numbers ***
- 2440 z$="":z1=0
- 2450 z1$=str$(z)
- 2460 zz=len(z1$)
- 2470 ifzz>3thenz1=1
- 2480 ifzz>6thenz1=z1+1
- 2490 fori=1tozz
- 2500 j=zz+1-i
- 2510 z$=mid$(z1$,j,1)+z$
- 2520 ifz1>0andi=3thenz$=","+z$
- 2530 ifz1>1andi=6thenz$=","+z$
- 2540 nexti
- 2545 ifmid$(z$,2,1)=","thenz$=right$(z$,(len(z$)-2))
- 2550 zz=len(z$)
- 2555 ifflag=1thenifzz<3thenz$=" "+z$:goto2550
- 2557 ifflag=1then2570
- 2560 ifzz<11thenz$="."+z$:goto2550
- 2570 return
- 2580 rem *** final message ***
- 2590 printchr$(147)
- 2630 poke781,11:poke782,10:syss
- 2640 print" [196]emocracy[160]"
- 2670 poke781,13:poke782,10:syss
- 2680 print" at work [160]"
- 2710 poke781,15:poke782,10:syss
- 2720 print" [199]ood-bye!"
- 2730 forx=1to3000:next
- 2740 print"[147]load"chr$(34)"hello"chr$(34)",8":print"run"
- 2750 poke631,13:poke632,13:poke198,2:end
-