home *** CD-ROM | disk | FTP | other *** search
Text File | 1985-12-31 | 29.1 KB | 1,082 lines |
- script
- ;-------------------------------------------------------------------------
- ;
- ; Trivial Pursuit Game
- ;
- ; written by Keith Ledbetter
- ; for BBS Express! ST Bulletin Board System
- ;
- ; ******************
- ; ** edited by: **
- ;****************** Kolonel Kink ************************
- ;* Would appreciate it if you add my board to your list.*
- ;* Compu-erotica BBS .. EXST .. 3/12 .. 312-425-6061 *
- ;********************************************************
- ;
- ; o Some of these changes I didn't really need myself but
- ; I read some of the comments on the ICD BBS from other
- ; users and decided since I was going to rewrite it I
- ; might as well include your ideas as options.
- ;
- ; o I had to delete most of the program comments in order
- ; to fit all my changes in one file.
- ;
- ; o This script must be compiled with SC.TTP.
- ;
- ; o Change the PATHNAME variable to your folder name.
- ;
- ; o Change the HEADING variable to your BBS name.
- ;
- ; o Change the ADD_LEVEL variable to the command security
- ; level of users that you want to be able to add questions
- ; to the trivia game.
- ;
- ; o Change the SHOW_ANSWERS variable to your choice. If set
- ; to 'Y', then the user will be shown the correct answer to
- ; any question that he misses.
- ;
- ; o Change the WAIT_FOR_VALIDATION variable to your choice.
- ; If set to 'N', then new questions added by users WILL NOT
- ; be used until you edit the question files and change the
- ; validated flags to 'Y'. If WAIT_FOR_VALIDATION = 'N'
- ; then newly added questions will be used immediately.
- ;
- ; o Change the LOG_FILE variable to the full path/filename
- ; where your system's log is located. If you specify 'Y'
- ; to WAIT_FOR_VALIDATION you will get a flag in the log
- ; letting you know you need to validate a question.
- ;
- ; o Change the SYSOP_NAME variable to your handle. Even if
- ; you specify 'Y' to WAIT_FOR_VALIDATION the questions
- ; that you yourself enter will automatically be validated.
- ;
- ; o Change MAX_QUESTIONS variable to 'N' if you don't want to
- ; impose a limit to the number of questions in a game. Set
- ; to the maximum number of questions you want a player to
- ; be asked if you wish to make that restriction.
- ;
- ; o Change MAX_TIME variable to 'N' if you don't want to
- ; impose a time limit per game. Otherwise change to the
- ; number of minutes you wish each game to last.
- ;
- ; o Change SHOW_AUTHOR variable to 'Y' if you wish that the
- ; person who entered the question is displayed along with
- ; the question when it is asked. 'N' will not display the
- ; author's name.
- ;
- ; o Change the REPEATS variable to 'N' if you wish to dis-
- ; qualify a category if all the questions were used in
- ; the round. In this case if the number of eligible cat-
- ; egories gets down to one the game is ended. If 'Y' the
- ; questions will be repeated if encountered a 2nd time.
- ;
- ; o If you would like to change the subjects in Trivial Pursuit
- ; I heavily highlighted the sections you need to change.
- ; You will need to specify the category name as well as the
- ; filename for your new category.
- ;
- ;=========================================================================
- ; If you make any changes to this script and reupload it to be shared
- ; with other sysops, PLEASE update this 'program history block' area!
- ;
- ; Revision Block
- ;
- ; Date Programmer Modifications
- ; ---------------------------------------------------------------------
- ; 11-16-87 K. Ledbetter Initial release.
- ; 11-17-87 K. Ledbetter Added multiple possible answers (up to 3).
- ; 11-17-87 K. Ledbetter Added switch to show correct answers.
- ; 12-08-87 K. Kink Sysop's questions are validated regardless
- ; of validation setting.
- ; 12-09-87 K. Kink Maximum number of questions per game may
- ; be set by sysop.
- ; 12-10-87 K. Kink Maximum time per game may be set.
- ; 12-11-87 K. Kink Author's name may be shown to player.
- ; 12-12-87 K. Kink Option to disqualify repeat questions
- ; whithin a game.
- ;-------------------------------------------------------------------------
-
- define REPEATS = 'N' ;'Y' or 'N'.
- define SHOW_AUTHOR = 'Y' ;'Y' or 'N'.
- define SYSOP_NAME = 'Sysop' ;your handle.
- define PATHNAME = 'd:\trivia\' ;where your files are.
- define HEADING = 'bbs' ;your BBS name.
- define ADD_LEVEL = 1 ;level of users that can add ?'s.
- define SHOW_ANSWERS = 'Y' ;'Y' or 'N'.
- define WAIT_FOR_VALIDATION = 'N' ;'Y' or 'N'.
- define MAX_QUESTIONS = 'N' ;'N' or max.no. of questions per game.
- define MAX_TIME = 'N' ;'N' or max.time limit per game.
- define LOG_FILE = 'c:log.dat' ;full path/filename location of
- ;system's log.
-
- integer total_score ;this user's score so far
- integer pt_value ;how much next question is worth
- integer category ;category we're asking from
- integer num_right ;# correct answers
- integer num_wrong ;# wrong answers
- integer video_width = '&11'
- integer itemp ;temp work field
-
- integer t1_cat ;temp question fields
- integer t1_value
- integer t1_note
- string t1_quest1
- string t1_quest2
- string t1_answer1
- string t1_answer2
- string t1_answer3
- string t1_valid
- string t1_author
-
- integer c1_cat ;category 1 data
- integer c1_value
- integer c1_note
- string c1_quest1
- string c1_quest2
- string c1_answer1
- string c1_answer2
- string c1_answer3
- string c1_valid
- string c1_author
-
- integer c2_cat ;category 2 data
- integer c2_value
- integer c2_note
- string c2_quest1
- string c2_quest2
- string c2_answer1
- string c2_answer2
- string c2_answer3
- string c2_valid
- string c2_author
-
- integer sub_pos1 ;position in subject file 1
- integer sub_pos2 ; file 2
- integer sub_pos3 ; " " " file 3
- integer sub_pos4 ; file 4
- integer sub_pos5 ; " " " file 5
- integer sub_pos6 ; file 6
-
- string instr ;generic input field
- string quest1 ;question line 1
- string quest2 ; line 2
- string the_answer1 ;the correct answers
- string the_answer2 ;the correct answers
- string the_answer3 ;the correct answers
- string user_selection ;selection from the menu
- string question_filename ;current file we're going after
- string cat_name ;name of a category
- string authr ;person who entered question
-
- integer temp ;temp field
- integer store ;used by sort routine
- integer pointer ; ..ditto..
- integer total_games ;total rounds played
- integer count
- integer idx
- integer highest
- integer lockout ;stops EOF lockout, I hope.
- define number_of_questions ;questions asked counter.
- define time ;time comparator variable.
- define time_left ;time left in game.
- define perm_note ;note data
-
- define flag1 ;flags for category status
- define flag2
- define flag3
- define flag4
- define flag5
- define flag6
-
- define stpt1 ;starting point values
- define stpt2
- define stpt3
- define stpt4
- define stpt5
- define stpt6
-
- define flag_count ;flag accumulator
- define ind1 ;disqualified questions
- define ind2
- define ind3
- define ind4
- define ind5
- define ind6
-
- Main_processing:
-
- if time_exceeded then
- exit
- endif
-
- gosub header
-
- printe '\{\r1\b\} Play Trivia ' center
- printe
- printe '\{\r2\b\} See the Hall of Fame ' center
- printe
- printe '\{\r3\b\} Add a Trivia Question ' center
- printe
- printe '\{\r4\b\} Tips on Playing Trivia' center
- printe
- printe '\{\rX\b\} Exit ' center
- printe
- print 'Your selection: ' center
- input (user_selection, 1, noreturn)
- if user_selection = 'x' then
- exit
- ef user_selection = '2' then
- goto Display_Scores
- ef user_selection = '3' then
- goto Add_a_Question
- ef user_selection = '4' then
- goto Show_help_files
- endif
-
- Start_new_game:
- clear screen
- printe '\n\n\n\n'
- print '\i Initializing game... \o' center
-
- gosub Get_positions
- stpt1 = sub_pos1
- stpt2 = sub_pos2
- stpt3 = sub_pos3
- stpt4 = sub_pos4
- stpt5 = sub_pos5
- stpt6 = sub_pos6
- flag1 = 'OFF'
- flag2 = 'OFF'
- flag3 = 'OFF'
- flag4 = 'OFF'
- flag5 = 'OFF'
- flag6 = 'OFF'
-
- total_games = 0
- total_score = 0
- num_right = 0
- num_wrong = 0
- if max_questions = 'N' then
- number_of_questions = 1
- else
- number_of_questions = max_questions
- endif
- if max_time = 'N' then
- time = 500
- else
- time = &32 + max_time
- endif
-
- Get_a_category:
- if time_exceeded then
- exit
- endif
- if repeats = 'Y' then
- goto GC
- endif
- flag_count = 0
- if flag1 = 'STOP' then
- ind1 = '1'
- flag_count = flag_count + 1
- endif
- if flag2 = 'STOP' then
- ind2 = '2'
- flag_count = flag_count + 1
- endif
- if flag3 = 'STOP' then
- ind3 = '3'
- flag_count = flag_count + 1
- endif
- if flag4 = 'STOP' then
- ind4 = '4'
- flag_count = flag_count + 1
- endif
- if flag5 = 'STOP' then
- ind5 = '5'
- flag_count = flag_count + 1
- endif
- if flag6 = 'STOP' then
- ind6 = '6'
- flag_count = flag_count + 1
- endif
- if flag_count = 5 then
- goto flag_ex
- endif
-
- Get1:
- instr = random (6)
- gosub get_cat
- if instr = 0 then
- goto get1
- endif
- c1_cat = instr
-
- Get2:
- instr = random (6)
- gosub get_cat
- if instr = 0 then
- goto get2
- endif
- If c1_cat = instr then
- goto get2
- endif
- c2_cat = instr
-
- Keep_going:
- gosub header
- if &32 > time then
- goto max_time_ex
- endif
- instr = &32
- if max_time # 'N' then
- time_left = time - instr
- printe '\g\i You have [time_left] minutes left in this game \o\b' center
- printe
- endif
- if max_questions # 'N' then
- printe '\g\i You have [number_of_questions] questions left \o\b' center
- printe
- endif
- if number_of_questions = 0 then
- goto max_questions_ex
- endif
- printe 'Your current score: [total_score]' center
- printe
- printe 'Right/wrong: [num_right]/[num_wrong]' center
- printe
- print '\i Reading questions... \o' center
-
- t1_cat = c1_cat
- gosub Get_a_Question
- c1_value = t1_value
- c1_quest1 = t1_quest1
- c1_quest2 = t1_quest2
- c1_answer1= t1_answer1
- c1_answer2= t1_answer2
- c1_answer3= t1_answer3
- c1_valid = t1_valid
- c1_note = t1_note
- c1_author = t1_author
-
- t1_cat = c2_cat
- gosub Get_a_Question
- c2_value = t1_value
- c2_quest1 = t1_quest1
- c2_quest2 = t1_quest2
- c2_answer1= t1_answer1
- c2_answer2= t1_answer2
- c2_answer3= t1_answer3
- c2_valid = t1_valid
- c2_note = t1_note
- c2_author = t1_author
-
- backspace 26
- printe '\i Please choose a category \o'
- printe
-
- category = c1_cat
- gosub show_category
- instr = cat_name
- expand (instr, 19)
- printe '1. [instr] ([c1_value] pts)' center
-
- category = c2_cat
- gosub show_category
- instr = cat_name
- expand (instr, 19)
- printe '2. [instr] ([c2_value] pts)' center
-
- printe
- printe 'Q. Quit game ' center
- printe
- Re_choice:
- print 'Your choice? ' center
- input (user_selection, 1, noreturn)
- if max_questions # 'N' then
- number_of_questions = number_of_questions - 1
- endif
- if user_selection = '1' then
- category = c1_cat
- quest1 = c1_quest1
- quest2 = c1_quest2
- pt_value = c1_value
- the_answer1= c1_answer1
- the_answer2= c1_answer2
- the_answer3= c1_answer3
- perm_note = c1_note
- authr = c1_author
- ef user_selection = '2' then
- category = c2_cat
- quest1 = c2_quest1
- quest2 = c2_quest2
- pt_value = c2_value
- the_answer1= c2_answer1
- the_answer2= c2_answer2
- the_answer3= c2_answer3
- perm_note = c2_note
- authr = c2_author
- ef user_selection = 'Q' then
- goto Update_Score_File
- else
- goto re_choice
- endif
-
- Try_question:
- if quest1 = 'Empty' then
- printe
- printe 'Sorry, that category is empty!' center
- gosub any_key
- goto get_a_category
- endif
-
- gosub header
- gosub show_category
-
- printe
- printe 'Topic category: [cat_name]' center
- printe
- printe 'Point value: [pt_value]' center
- printe
- if show_author = 'Y' then
- printe 'Asked by: [authr]'
- printe
- endif
- printe 'The question:'
- printe '-------------'
- printe ' [quest1]'
- printe ' [quest2]'
- printe
-
- gosub write_positions
-
- print 'Your answer is: '
- input (instr, 70, noreturn)
- printe
-
- if instr = the_answer1
- goto right_answer
- ef instr = the_answer2
- goto right_answer
- ef instr = the_answer3
- goto right_answer
- else
- goto wrong_answer
- endif
-
- Right_answer:
- printe 'That answer is \rcorrect\b!' center
- num_right = num_right + 1
- total_score = total_score + pt_value
- goto carry_on
-
- Wrong_answer:
- printe 'Sorry, that answer is \rwrong\b.' center
- printe
- num_wrong = num_wrong + 1
- total_score = total_score - 1
-
- if SHOW_ANSWERS = 'Y' then
- printe '\iThe correct answer is:\o' center
- printe '[the_answer1]' center
- endif
-
- goto carry_on
-
- Carry_on:
- if total_score > 999 then
- total_score = 999
- endif
-
- increase (total_games)
- printe
- gosub Any_key
-
- goto get_a_category
-
- ;===============================================================
- ; Allow the user to add a new question to the trivia file.
- ;===============================================================
-
- Add_a_Question:
- if Command_level (add_level)
- else
- printe
- printe 'Sorry, you\"re not authorized for that!'
- printe
- gosub any_key
- goto main_processing
- endif
- gosub Header
- printe
- printe 'Add a Trivia question' center
- printe
- printe '\i Add to which category? \o' center
- printe
-
- ;************************************************************************
- ;************************************************************************
- ;****
- printe '1. Geography ' center ;************************ **
- printe '2. Entertainment ' center ;* Change these names to* **
- printe '3. History ' center ;* match your categories* **
- printe '4. Arts and Liturature' center ;************************
- printe '5. Science and Nature ' center
- printe '6. Sports and Leisure ' center
- printe
- printe 'Q. Quit ' center
-
- AQ_select:
- printe
- print 'Selection: ' center
- input (instr, 1, noreturn)
- if instr = 'Q'
- goto main_processing
- ef instr = '1'
- question_filename = 'geogrphy.que'
- category = 'Geography'
- ef instr = '2' ;************************
- question_filename = 'entrtain.que' ;* You must also change *
- category = 'Entertainment' ;* these to go with any *
- ef instr = '3' ;* category changes. *
- question_filename = 'history.que' ;************************
- category = 'History'
- ef instr = '4'
- question_filename = 'arts.que'
- category = 'Arts and Literature'
- ef instr = '5'
- question_filename = 'science.que'
- category = 'Science and Nature'
- ef instr = '6'
- question_filename = 'sports.que'
- category = 'Sports and Leisure' ;**
- else ;**
- goto AQ_select ;**
- endif ;**
- ;****
- ;************************************************************************
- ;************************************************************************
-
- gosub header
- printe
- printe 'Category: [category]' center
- printe
- printe
- printe 'Enter your trivia question below.' center
- printe
- printe 'Two 70-column lines are allowed. ' center
- printe
- print '->'
- input (c1_quest1, 70, noreturn)
- print '->'
- input (c1_quest2, 70)
- printe
- printe 'Enter up to 3 answers to this question'
- printe '(ie: "Illinois", "IL", "ILL"):'
- print '1->'
- input (c1_answer1, 70)
- print '2->'
- input (c1_answer2, 70)
- print '3->'
- input (c1_answer3, 70)
- printe
-
- AQ_reval:
- print 'Enter the point value (1-9): '
- input (c1_value, 2, noreturn)
- if c1_value = NUMERIC then
- else
- goto AQ_reval
- endif
- if c1_value < 1
- goto AQ_reval
- ef c1_value > 9
- goto AQ_reval
- endif
-
- gosub header
- printe
- printe
- printe 'Question will be added as:'
- printe
- printe '\iQuestion:\o'
- printe ' [c1_quest1]'
- printe ' [c1_quest2]'
- printe
- printe '\iAnswer(s):\o'
- printe ' [c1_answer1]'
- printe ' [c1_answer2]'
- printe ' [c1_answer3]'
- printe
- printe '\iPoint value\o is [c1_value] points'
- printe
- print 'Add this question to file (y/n)? '
- input (instr, 1, noreturn)
- if instr = 'N'
- goto Add_a_Question
- endif
- printe
- print 'Updating appropriate file...'
-
- open ('[pathname][question_filename]', append)
-
- if &1 # Sysop_name then
- goto checkit
- endif
- fprinte 'Valid : Y'
- goto passup
-
- Checkit:
- if WAIT_FOR_VALIDATION = 'y' then
- fprinte 'Valid : N'
- else
- fprinte 'Valid : Y'
- endif
-
- Passup:
- fprinte 'Points: [c1_value]'
- fprinte 'Author: &1'
- fprinte 'Quest1: [c1_quest1]'
- fprinte 'Quest2: [c1_quest2]'
- fprinte 'Answer: [c1_answer1]'
- fprinte 'Answer: [c1_answer2]'
- fprinte 'Answer: [c1_answer3]'
- fprinte
- close
-
- if &1 = sysop_name then
- printe
- gosub any_key
- goto Add_a_question
- endif
-
- if WAIT_FOR_VALIDATION = 'y' then
- printe
- printe
- printe 'Thanks! This question will be\vadded to the active game as'
- printe 'soon as the SysOp validates it.'
- printe
-
- ;=========================================================================
- ; This section posts a flag to the system's log to show an added question
- ;=========================================================================
-
- open [Log_File] append
- fprinte '************************* NEW QUESTION IN [question_filename]'
- close
- gosub any_key
- endif
-
- goto Add_a_question
-
- ;===============================================================
- ; Show the current Hall of Fame to the user
- ;===============================================================
- Display_Scores:
- gosub header
- printe '\rTrivia Hall of Fame\b' Center
- clear (table)
- count = table_load ('[Pathname]TrScore.Dat')
- printe
- printe '\b User\"s Name Date Score' Center
- printe '\g--------------------- -------- -----\b' Center
- for idx = 1 to count do
- temp = table_get (idx)
- Expand (temp, 35)
- if idx = 1 then
- printE '\r[temp]\b' center
- else
- printE 'temp' center
- endif
- endfor
- printe
- print 'Press <\rRETURN\b> To Continue..' Center
- input temp 1
- goto main_processing
-
- ;===============================================================
- ; See if this user made it into the Hall of Fame.
- ;===============================================================
-
- Update_Score_File:
- if total_games = 0 then
- goto Display_Scores
- endif
- gosub header
- printe '\rTrivia Hall of Fame\b' Center
- printe
- print 'Checking Your Score...' center
- clear (table)
- count = table_load ('[Pathname]TrScore.Dat')
- pointer = 20
- for idx = 1 to 10 do
- temp = table_get (idx)
- temp = copy (temp, 33, 3)
- table_put (pointer, temp)
- increase (pointer)
- endfor
- for idx = 20 to 29 do
- itemp = table_get (idx)
- if total_score > itemp then
- break
- endif
- endfor
- if idx < 30 then
- goto Enter_Hall
- endif
-
- printe '\n'
- printe 'Sorry, your score isn\"t in the Top 10' center
- printe
- print 'Press <\rRETURN\b> To Continue..' center
- input temp 1
- goto Display_Scores
-
- Enter_Hall:
- Bell
- printe '\n'
- printe 'You made it into the Hall of Fame!!' center
- printe
- print 'Inserting your name into the books...' Center
-
- highest = total_score
- pointer = 0
- for idx = 20 to 29 do
- itemp = table_get (idx)
- if itemp < highest then
- highest = itemp
- pointer = idx
- endif
- endfor
- table_put (pointer, total_score)
- itemp = pointer - 19
- temp = '&1'
- temp = copy (temp, 1, 21)
- Expand (temp, 22)
- table_put (itemp, '[temp]&24 [total_score]')
-
- gosub Sort_Scores
-
- open ('[Pathname]TrScore.Dat', Output)
- for idx = 50 to 59 do
- temp = table_get (idx)
- fprintE temp
- endfor
- close
- goto Display_Scores
-
- Sort_Scores:
- store = 40
- Sort:
- highest = ' '
- pointer = 0
- for idx = 20 to 29 do
- temp = table_get (idx)
- if temp > highest then
- highest = temp
- pointer = idx
- endif
- endfor
- temp = table_get (pointer)
- table_put (store, temp)
- table_put (pointer, ' ')
- itemp = pointer - 19
- temp = table_get (itemp)
- itemp = store + 10
- table_put (itemp, temp)
- increase (store)
- if store < 50 then
- goto sort
- endif
- return
-
- Get_a_question:
- lockout = 0
-
- ;************************************************************************
- ;************************************************************************
- ;****
- if t1_cat = 1 ;**
- question_filename = 'geogrphy.que' ;**
- ef t1_cat = 2 ;********************* **
- question_filename = 'entrtain.que' ;* More changes for * **
- ef t1_cat = 3 ;* a category switch.*
- question_filename = 'history.que' ;*********************
- ef t1_cat = 4
- question_filename = 'arts.que'
- ef t1_cat = 5
- question_filename = 'science.que' ;**
- else ;**
- question_filename = 'sports.que' ;**
- endif ;**
- ;****
- ;************************************************************************
- ;************************************************************************
-
- if file_exists ('[pathname][question_filename]') then
- else
- t1_value = 0
- t1_quest1 = 'Empty'
- t1_quest2 = ''
- t1_answer1= ''
- t1_answer2= ''
- t1_answer3= ''
- t1_author = ''
- RETURN
- endif
-
- open ('[pathname][question_filename]', input)
-
- if t1_cat = 1
- POINT (sub_pos1)
- ef t1_cat = 2
- POINT (sub_pos2)
- ef t1_cat = 3
- POINT (sub_pos3)
- ef t1_cat = 4
- POINT (sub_pos4)
- ef t1_cat = 5
- POINT (sub_pos5)
- else
- POINT (sub_pos6)
- endif
-
- GQ_read:
- finput t1_valid
- finput t1_value
- finput t1_author
- finput t1_quest1
- finput t1_quest2
- finput t1_answer1
- finput t1_answer2
- finput t1_answer3
- finput instr
-
- t1_valid = copy (t1_valid, 9,99)
- if t1_valid = 'N' then
- goto GQ_read
- endif
- NOTE (t1_note)
- close
-
- t1_value = copy (t1_value, 9,99)
- t1_quest1 = copy (t1_quest1,9,99)
- t1_quest2 = copy (t1_quest2,9,99)
- t1_answer1= copy (t1_answer1,9,99)
- t1_answer2= copy (t1_answer2,9,99)
- t1_answer3= copy (t1_answer3,9,99)
- t1_author = copy (t1_author,9,99)
-
- if t1_value > 10 then
- t1_value = 9
- endif
-
- return
- ; ------------------------------------------------------------
- ; we hit end-of-file on the read, so go back to start of file.
- ; ------------------------------------------------------------
- EOF:
- lockout = lockout + 1
- if lockout > 2
- t1_value = 0
- t1_quest1 = 'Empty'
- t1_quest2 = ''
- t1_answer1= ''
- t1_answer2= ''
- t1_answer3= ''
- t1_author = ''
- close
- RETURN
- endif
-
- if t1_cat = 1
- sub_pos1 = 0
- ef t1_cat = 2
- sub_pos2 = 0
- ef t1_cat = 3
- sub_pos3 = 0
- ef t1_cat = 4
- sub_pos4 = 0
- ef t1_cat = 5
- sub_pos5 = 0
- else
- sub_pos6 = 0
- endif
- POINT 0
- goto GQ_read
-
- Show_category:
- cat_name = ''
-
- ;************************************************************************
- ;************************************************************************
- ;****
- if category = 1 ;**
- cat_name = 'Geography' ;**
- ef category = 2 ;**
- cat_name = 'Entertainment' ;*************************** **
- ef category = 3 ;* Rename if you decide to *
- cat_name = 'History' ;* change categories. *
- ef category = 4 ;***************************
- cat_name = 'Arts and Literature'
- ef category = 5
- cat_name = 'Science and Nature'
- else ;**
- cat_name = 'Sports and Leisure' ;**
- endif ;**
- return ;**
- ;****
- ;************************************************************************
- ;************************************************************************
-
- Get_Positions:
- if file_exists ('[pathname]trstart.dat')
- open ('[pathname]trstart.dat', input)
- finput sub_pos1
- finput sub_pos2
- finput sub_pos3
- finput sub_pos4
- finput sub_pos5
- finput sub_pos6
- close
- else
- sub_pos1 = 0
- sub_pos2 = 0
- sub_pos3 = 0
- sub_pos4 = 0
- sub_pos5 = 0
- sub_pos6 = 0
- endif
- return
-
- Write_Positions:
- if category = 1
- sub_pos1 = perm_note
- ef category = 2
- sub_pos2 = perm_note
- ef category = 3
- sub_pos3 = perm_note
- ef category = 4
- sub_pos4 = perm_note
- ef category = 5
- sub_pos5 = perm_note
- else
- sub_pos6 = perm_note
- endif
-
- if category = 1
- goto test1
- ef category = 2
- goto test2
- ef category = 3
- goto test3
- ef category = 4
- goto test4
- ef category = 5
- goto test5
- else
- goto test6
- endif
-
- Test1:
- if flag1 = 'STOP' then
- goto cont
- else
- flag1 = 'ON'
- goto cont
- endif
- Test2:
- if flag2 = 'STOP' then
- goto cont
- else
- flag2 = 'ON'
- goto cont
- endif
- Test3:
- if flag3 = 'STOP' then
- goto cont
- else
- flag3 = 'ON'
- goto cont
- endif
- Test4:
- if flag4 = 'STOP' then
- goto cont
- else
- flag4 = 'ON'
- goto cont
- endif
- Test5:
- if flag5 = 'STOP' then
- goto cont
- else
- flag5 = 'ON'
- goto cont
- endif
- Test6:
- if flag6 = 'STOP' then
- goto cont
- else
- flag6 = 'ON'
- goto cont
- endif
-
- Cont:
- if sub_pos1 # stpt1 then
- goto n1
- endif
- if flag1 = 'ON' then
- flag1 = 'STOP'
- goto cont1
- endif
- N1:
- if sub_pos2 # stpt2 then
- goto n2
- endif
- if flag2 = 'ON' then
- flag2 = 'STOP'
- goto cont1
- endif
- N2:
- if sub_pos3 # stpt3 then
- goto n3
- endif
- if flag3 = 'ON' then
- flag3 = 'STOP'
- goto cont1
- endif
- N3:
- if sub_pos4 # stpt4 then
- goto n4
- endif
- if flag4 = 'ON' then
- flag4 = 'STOP'
- goto cont1
- endif
- N4:
- if sub_pos5 # stpt5 then
- goto n5
- endif
- if flag5 = 'ON' then
- flag5 = 'STOP'
- goto cont1
- endif
- N5:
- if sub_pos6 # stpt6 then
- goto cont1
- endif
- if flag6 = 'ON' then
- flag6 = 'STOP'
- goto cont1
- endif
-
- Cont1:
- open ('[pathname]trstart.dat', append)
- point 0
- fprinte '[sub_pos1]'
- fprinte '[sub_pos2]'
- fprinte '[sub_pos3]'
- fprinte '[sub_pos4]'
- fprinte '[sub_pos5]'
- fprinte '[sub_pos6]'
- close
- ret