%  Procedure draws the spinning atom for the bohr's model option
procedure bohrs_atom
    colorback (1)
    drawbox (0, 0, maxx, maxy, 2)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "

    % draw the atom
    drawoval (99, 231, 55, 42, 12)
    drawoval (99, 231, 10, 9, 4)
    color (4)
    locate (9, 13)
    put "+"
    % draw pointer
    drawline (155, 287, 130, 273, 15)
    drawline (155, 287, 195, 287, 15)
    color (12)
    locate (5, 26)
    put "Bohr imagined the electron to move about the nucleus"
    locate (6, 26)
    put "following a fixed path or orbit."
end bohrs_atom

% This procedure outputs the data for the first page of information
% corresponding to the bohr's model option.
procedure bohr_page1
    cls
    drawbox (0, 0, maxx, maxy, 2)
    colorback (1)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "
    color (3)
    locate (4, 5)
    put
	"To understand  the atom, you must understand the nature of light because"
    locate (5, 5)
    put
	"the elucidation  of the atom's  structure stems  from  studies of light."
    locate (6, 5)
    put
	"Also, it will help  you grasp Bohr's concepts and theory better once you"
    locate (7, 5)
    put "have this understanding."
    color (2)
    locate (9, 5)
    put "NATURE OF LIGHT"
    color (3)
    locate (11, 5)
    put
	"In the 1900's a German  scientist named Max Planck resolved  much of the"
    color (12)
    locate (11, 45)
    put "Max Planck"
    color (3)
    locate (12, 5)
    put
	"confusion  about the  nature of light.  At the time, it was thought that"
    locate (13, 5)
    put
	"all atoms should emit  a continuous band  of energy.  In other words, if"
    locate (14, 5)
    put
	"an atom is energized, then it  was thought that  the atom would give off"
    locate (15, 5)
    put
	"a continuous spectrum  of energy.  Planck suggested however, that energy"
    locate (16, 5)
    put
	"is  QUANTIZED.  That  is, energy  comes in  the form  of tiny pockets of"
    locate (16, 9)
    color (12)
    put "QUANTIZED"
    color (3)
    locate (17, 5)
    put
	"energy called QUANTA.  Each quanta of energy has a particular frequency,"
    locate (17, 19)
    color (12)
    put "QUANTA"
    color (3)
    locate (18, 5)
    put
	"v, the Greek letter MEW.  Each quanta  of energy travels at the speed of"
    drawline (29, 106, 32, 106, 3)
    drawarc (35, 106, 3, 3, 360, 90, 3)
    locate (19, 5)
    put "light.  Planck develops an equation: E = h v."
    locate (19, 42)
    color (12)
    put "E = h v"
    drawline (373, 92, 376, 92, 12)
    drawarc (379, 92, 3, 3, 360, 90, 12)
    color (15)
    locate (19, 55)
    put "E = energy"
    locate (20, 55)
    put "h = Planck's constant"
    locate (21, 55)
    put "v = frequency"
    drawline (429, 65, 432, 65, 15)
    drawarc (435, 65, 3, 3, 360, 90, 15)
    locate (24, 39)
    color (2)
    put "-1-"
    draw_keys_across
end bohr_page1

% This procedure outputs the data for the second page of information
% corresponding to the bohr's model option.
procedure bohr_page2
    drawbox (0, 0, maxx, maxy, 2)
    colorback (1)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "
    color (2)
    locate (4, 5)
    put "EXPLANATION"
    color (3)
    locate (6, 5)
    put
	"When you see light of a certain colour such as red, you are seeing energy"
    locate (7, 5)
    put
	"that has a certain  frequency.  Another colour  such as green will have a"
    locate (8, 5)
    put "different frequency and hence, a different energy."
    color (2)
    locate (10, 5)
    put "SIGNIFICANCE"
    color (3)
    locate (12, 5)
    put
	"When you look at white light,  you are seeing a whole continuous spectrum"
    locate (13, 5)
    put
	"of colours from violet to red.  The colours  represent a continuous range"
    locate (14, 5)
    put "of energies and hence, different frequencies of light."
    color (4)
    locate (16, 4)
    put
	"                                        RED = LOW ENERGY & FREQUENCY"
    color (5)
    locate (16, 4)
    put "      VIOLET = HIGH ENERGY & FREQUENCY,"
    color (3)
    locate (18, 5)
    put
	"However, what  occurs involving  a LINE SPECTRUM is  quite  different.  A"
    color (12)
    locate (18, 40)
    put "LINE SPECTRUM"
    color (3)
    locate (19, 5)
    put
	"line spectrum  is a spectrum  which consists of  only certain frequencies"
    locate (20, 5)
    put
	"of colours  of  visible light.  Each  element has  its own line spectrum."
    color (2)
    locate (24, 39)
    put "-2-"
    draw_keys_across
end bohr_page2

% This procedure outputs the data for the third page of information
% corresponding to the bohr's model option.
procedure bohr_page3
    drawbox (0, 0, maxx, maxy, 2)
    colorback (1)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "
    color (2)
    locate (4, 5)
    put "SIGNIFICANCE con't"
    color (3)
    locate (6, 5)
    put
	"Each colour represents  a specific frequency.  Since different elements"
    locate (7, 5)
    put
	"have different line spectrums, then it implies that only certain energy"
    locate (8, 5)
    put
	"transformations are permitted in each atom.  Therefore an atom has only"
    locate (9, 5)
    put "certain allowable energy levels."
    color (2)
    locate (24, 39)
    put "-3-"
    draw_keys_across
end bohr_page3

% This procedure outputs the data for the fourth page of information
% corresponding to the bohr's model option.
procedure bohr_page4
    colorback (1)
    drawbox (0, 0, maxx, maxy, 2)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "

    drawbox (200, 20, 620, 243, 2)
    bohrs_atom
    draw_keys
    % textual information
    color (2)
    locate (9, 39)
    put "POSTULATES OF BOHR'S THEORY"
    color (3)
    locate (11, 27)
    put "1. In every hydrogen atom, there are certain paths"
    locate (12, 27)
    put "   that an electron  can follow.  Each  path has a"
    locate (13, 27)
    put "   certain energy.  The energy  of the electron is"
    color (12)
    locate (14, 27)
    put "   QUANTIZED"
    color (3)
    locate (14, 39)
    put ".  The  farther the  electron  is away"
    locate (15, 27)
    put "   from  the nucleus,  the  greater the  potential"
    locate (16, 27)
    put "   energy."
    drawline (255, 40, 255, 111, 7)
    drawline (254, 110, 250, 103, 7)
    drawline (256, 110, 260, 103, 7)
    drawline (335, 35, 335, 117, 7)
    drawline (335, 117, 331, 110, 7)
    drawline (335, 117, 339, 110, 7)
    drawline (335, 35, 420, 35, 7)
    drawline (335, 62, 420, 62, 7)
    drawline (335, 89, 420, 89, 7)
    drawline (335, 105, 420, 105, 7)
    color (15)
    locate (20, 27)
    put "  Potential"
    locate (21, 27)
    put "   Energy"
    color (12)
    locate (23, 35)
    put "Nucleus"
    color (7)
    locate (23, 55)
    put "n = 1"
    locate (21, 55)
    put "n = 2"
    locate (19, 55)
    put "n = 3"
    locate (18, 55)
    put "n = 4"
    color (15)
    locate (20, 63)
    put "n is the"
    locate (21, 63)
    put "energy level"
    color (2)
    locate (23, 70)
    put "-4-"
end bohr_page4

% This procedure outputs the data for the fifth page of information
% corresponding to the bohr's model option.
procedure bohr_page5
    colorback (1)
    drawbox (0, 0, maxx, maxy, 2)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "

    drawbox (200, 20, 620, 243, 2)
    bohrs_atom
    draw_keys
    % textual information
    color (2)
    locate (9, 37)
    put "POSTULATES OF BOHR'S THEORY con't"
    color (3)
    locate (11, 27)
    put "2. Each energy level corresponds to an orbit, a   "
    locate (12, 27)
    put "   circular path about the nucleus.               "

    drawoval (300, 150, 27, 23, 7)
    drawoval (300, 150, 20, 17, 7)
    drawoval (300, 150, 13, 10, 7)
    drawoval (300, 150, 6, 4, 7)
    drawfill (300, 150, 7, 7)
    drawline (300, 160, 365, 160, 15)
    drawline (320, 145, 365, 145, 15)
    drawline (318, 130, 365, 130, 15)
    color (15)
    locate (14, 47)
    put "n = 1"
    locate (15, 47)
    put "n = 2"
    locate (16, 47)
    put "n = 3"

    color (3)
    locate (18, 27)
    put "   The levels looked like layers of energy."
    drawoval (370, 65, 10, 9, 7)
    drawfill (370, 65, 7, 7)
    drawarc (390, 65, 13, 18, 270, 90, 7)
    drawarc (410, 65, 13, 18, 270, 90, 7)
    drawarc (430, 65, 13, 18, 270, 90, 7)
    color (15)
    locate (20, 58)
    put "high energy"
    locate (19, 39)
    put "low energy"
    color (2)
    locate (23, 50)
    put "-5-"
end bohr_page5

% This procedure outputs the data for the sixth page of information
% corresponding to the bohr's model option.
procedure bohr_page6
    colorback (1)
    drawbox (0, 0, maxx, maxy, 2)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "

    drawbox (200, 20, 620, 243, 2)
    bohrs_atom
    draw_keys
    % textual information
    color (2)
    locate (9, 37)
    put "POSTULATES OF BOHR'S THEORY con't"
    color (3)
    locate (11, 27)
    put "3. Bohr assumed  that an  electron could travel in"
    locate (12, 27)
    put "   one of these orbits,  ie. in one of the allowed"
    locate (13, 27)
    put "   energy levels or layers, without losing energy."
    locate (14, 27)
    put "   According to Bohr, the electron does  not  obey"
    locate (15, 27)
    put "   the laws of classical electrodynamic  theories,"
    locate (16, 27)
    put "   thus it  will  not  continuously emit radiation"
    locate (17, 27)
    put "   and spiral into the nucleus."
    locate (19, 27)
    put "4. An electron can change  energy levels if it has"
    locate (20, 27)
    put "   acquired a certain  amount of energy and jumped"
    locate (21, 27)
    put "   all at once to a higher energy level.  The jump"
    locate (22, 27)
    put "   corresponds EXACTLY to the difference in levels."
    color (2)
    locate (23, 50)
    put "-6-"
    %     atom_rotating
end bohr_page6

% This procedure outputs the data for the seventh page of information
% corresponding to the bohr's model option.
procedure bohr_page7
    cls
    drawbox (0, 0, maxx, maxy, 2)
    colorback (1)
    color (13)
    locate (2, 17)
    put "B O H R ' S   M O D E L   O F   T H E   A T O M "
    color (2)
    locate (4, 5)
    put "BOHR'S EXPLANATION OF HYDROGEN'S LINE SPECTRUM"
    drawoval (185, 198, 25, 20, 4)
    drawoval (185, 198, 64, 50, 4)
    drawoval (185, 198, 105, 80, 4)
    drawoval (185, 198, 6, 5, 12)
    drawline (182, 198, 188, 198, 4)
    drawline (185, 195, 185, 201, 4)
    color (15)
    locate (10, 23)
    put "-"
    locate (8, 34)
    put "-"
    locate (14, 29)
    put "-"
    drawoval (267, 245, 5, 4, 7)
    drawoval (179, 217, 5, 4, 7)
    drawoval (227, 161, 5, 4, 7)
    drawline (179, 223, 179, 243, 15)
    drawline (179, 243, 175, 239, 15)
    drawline (179, 243, 183, 239, 15)
    drawline (185, 223, 193, 273, 14)
    drawline (193, 273, 188, 267, 14)
    drawline (193, 273, 197, 266, 14)
    drawline (260, 242, 207, 212, 13)
    drawline (207, 212, 210, 219, 13)
    drawline (207, 212, 215, 212, 13)
    drawline (220, 165, 200, 178, 12)
    drawline (200, 178, 200, 172, 12)
    drawline (200, 178, 207, 178, 12)
    % energy lines
    drawline (275, 245, 380, 245, 10)
    drawline (380, 245, 375, 250, 10)
    drawline (380, 245, 375, 240, 10)

    drawline (227, 155, 227, 90, 10)
    drawline (227, 90, 222, 95, 10)
    drawline (227, 90, 232, 95, 10)

    drawline (170, 217, 10, 217, 2)
    drawline (170, 217, 165, 222, 2)
    drawline (170, 217, 165, 212, 2)
    color (2)
    locate (9, 3)
    put "energy absorbed"
    color (10)
    locate (7, 36)
    put "energy emitted"
    color (15)
    locate (9, 22)
    put "A"
    color (14)
    locate (9, 26)
    put "B"
    color (13)
    locate (9, 33)
    put "C"
    color (12)
    locate (14, 31)
    put "D"
    color (15)
    locate (10, 38)
    put "'A' represents a certain amount of energy"
    locate (11, 39)
    put "absorbed  by  the  electron.  Thus,  the"
    locate (12, 39)
    put "electron  'jumps'  to the  corresponding"
    locate (13, 39)
    put "energy level."
    color (14)
    locate (14, 38)
    put "'B'  represents  a  different  amount  of"
    locate (15, 39)
    put "energy absorbed thus a different 'jump'."
    locate (16, 38)
    color (13)
    put "'C' represents  energy  emitted  when the"
    locate (17, 39)
    put "electron  'drops' from  a higher  energy"
    locate (18, 39)
    put "to a lower energy level. The energy that"
    locate (19, 39)
    put "is emitted is seen  as a certain colour."
    color (12)
    locate (20, 38)
    put "'D' represents  a different energy 'drop'"
    locate (21, 39)
    put "corresponding  to a different frequency,"
    locate (22, 39)
    put "hence a different colour is seen."
    color (2)
    locate (24, 39)
    put "-7-"
    draw_keys_across
end bohr_page7

% This is the main call up procedure for the bohr's model option.  It calls
% up all procedures necessary for this option to work.
procedure bohr_main
    flag := 0
    pagenum := 1
    counter := 8
    bohr_page1
    loop
	if pagenum = 4 or pagenum = 5 or pagenum = 6 then
	    loop
		      % following  statements  draw  the small electron  on
		      % different parts of the atom  to  give  the illusion
		      % of the electron rotating around the atom on a fixed
		      % path.
		exit when hasch
		if counter = 8 then
		    counter := 1
		    drawoval (99, 273, 5, 4, 7)
		    drawfill (99, 273, 7, 7)
		    delay (150)
		    drawoval (99, 273, 5, 4, 0)
		    drawfill (99, 273, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		elsif counter = 1 then
		    counter := 2
		    drawoval (140, 259, 5, 4, 7)
		    drawfill (140, 259, 7, 7)
		    delay (150)
		    drawoval (140, 259, 5, 4, 0)
		    drawfill (140, 259, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		elsif counter = 2 then
		    counter := 3
		    drawoval (153, 228, 5, 4, 7)
		    drawfill (153, 228, 7, 7)
		    delay (150)
		    drawoval (153, 228, 5, 4, 0)
		    drawfill (153, 228, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		elsif counter = 3 then
		    counter := 4
		    drawoval (136, 200, 5, 4, 7)
		    drawfill (136, 200, 7, 7)
		    delay (150)
		    drawoval (136, 200, 5, 4, 0)
		    drawfill (136, 200, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		elsif counter = 4 then
		    counter := 5
		    drawoval (99, 189, 5, 4, 7)
		    drawfill (99, 189, 7, 7)
		    delay (150)
		    drawoval (99, 189, 5, 4, 0)
		    drawfill (99, 189, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		elsif counter = 5 then
		    counter := 6
		    drawoval (62, 200, 5, 4, 7)
		    drawfill (62, 200, 7, 7)
		    delay (150)
		    drawoval (62, 200, 5, 4, 0)
		    drawfill (62, 200, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		elsif counter = 6 then
		    counter := 7
		    drawoval (44, 228, 5, 4, 7)
		    drawfill (44, 228, 7, 7)
		    delay (150)
		    drawoval (44, 228, 5, 4, 0)
		    drawfill (44, 228, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		elsif counter = 7 then
		    counter := 8
		    drawoval (58, 259, 5, 4, 7)
		    drawfill (58, 259, 7, 7)
		    delay (150)
		    drawoval (58, 259, 5, 4, 0)
		    drawfill (58, 259, 0, 0)
		    drawoval (99, 231, 55, 42, 12)
		    exit when hasch
		end if
	    end loop
	end if
	if pagenum = 1 or pagenum = 2 or pagenum = 3 or pagenum = 7 then
	    across_keys
	else
	    pgup_pgdn
	end if
	exit when flag = 2
	if flag = 1 or flag = 3 then
	    if pagenum = 1 then
		cls
		bohr_page1
	    elsif pagenum = 2 then
		cls
		bohr_page2
	    elsif pagenum = 3 then
		cls
		bohr_page3
	    elsif pagenum = 4 then
		if flag = 3 then
		    close_page
		    openpage
		elsif reply = chr (209) then
		    cls
		end if
		bohr_page4
	    elsif pagenum = 5 then
		if flag not= 0 then
		    close_page
		    openpage
		    bohr_page5
		end if
	    elsif pagenum = 6 then
		if reply = chr (209) or ch = chr (209) and flag not= 3 then
		    close_page
		    openpage
		elsif flag = 3 then
		    cls
		end if
		drawbox (0, 0, maxx, maxy, 2)
		color (13)
		locate (2, 17)
		put "B O H R ' S   M O D E L   O F   T H E   A T O M "

		drawbox (200, 20, 620, 243, 2)
		bohrs_atom
		draw_keys
		bohr_page6
	    elsif pagenum = 7 then
		cls
		bohr_page7
	    end if
	end if
    end loop
end bohr_main
