SECOND OPINION Your Spectrum 19 (Oct.1985) So, you used to be indecisive, but now you're not so sure, eh? Fortunately, Chris Somerville has come to your rescue with a program that'll help you reach some more definite conclusions. Has anyone seen an executive toy on the market called a Decision Maker? It's battery operated and delivers, at the press of the button, helpful advice in the form of a randomly generated Yes, No or Maybe. Without any help from it at all, I came to my own decision not to buy one. Mind you, I still reckon that a computer can be really useful in helping in the process of decision-making. That's why I've written a program that'll help you arrive at a logical decision in any situation where multiple choices are involved and where there are many factors to be taken into consideration. What's the next piece of software that you're going to buy, where are you going on holiday and should it be the Porsche or the Roller this year? It's just so hard to choose - until now! HOORAY FOR ARRAYS The first task is to set up two string arrays to hold the possible Choices and the Factors that'll affect them. And as we can't appreciate just how many they'll be in any given problem, it's fortunate that on the Speccy we can DIMension the arrays from within the program, changing their size as needs be. That means that although line 160 sets up two temporary arrays of ten elements, they can grow as large as you require. It works like this - the various Choices are lodged in duplicate, A$(1) = B$(1) and so on, and a count is kept as you enter each Choice. If the count reaches the limit of the array, then one array can be re-DIMensioned to accommodate additional information, while all the info you've already entered is safely held in the duplicate array. Eventually, the Choices finish up in a correctly DIMensioned C$() and then A$() and B$() are re-used to collect the Factors which end up in F$(). And don't worry about muddling up your Factors and your Choices as you'll be prompted throughout the program. Of course, there's one decision this program can't make for you - whether or not to type it in. You're just going to have to make your own mind up on that one. But I reckon if you're hesitating, then you're just the type of person who needs this very program. Then again, you could always save yourself the hassle and buy this month's Digi'T'ape. Oh, decisions, decisions! Don't delay the decision - type the listing in now! It's never too late to call in a second opinion! Lines 10-30 These lines ask you to wait a second while the set-up is taking place and then create a formula to make sure input is in upper case. Lines 40-100 These lines contain the data for the display heading. Lines 110-140 This section of the program reads in the data from the previous lines to create the string Q$. Lines 150-250 Subroutine which sets up the temporary arrays prior to the full size of data file being known. Lines 260-440 This routine prints the instructions for the program. Lines 450-640 This assigns the strength of each factor and then compares within each other to see which comes out on top. Notice that alphabetic characters have been used rather than numeric so the choices can exceed ten within the limits of INKEY$. Lines 650-880 This routine asks you to type in your preferences to certain factors - from this a decision can be calculated. Lines 890-1110 This is the end of the program where the answers and decisions are all printed up. DECISION TIME Pretty obviously, the computer can't really make your mind up for you. What it can do is help you to organise your thoughts by forcing you to follow a certain logical procedure. And it does this by breaking down a large complex analysis into a series of simple decisions. As you can see here, you're only ever presented with the Factors involved in a decision, in pairs. You're then asked to indicate their relative importance. Since each Factor is sequentially compared with every other Factor a numerical strength can be allocated to each. This is where the computer scores over the usual muddled, fuddled human activity that masquerades as thinking. A good example of this is those classic compos you'll have seen in YS, for instance. You know, the ones where you have to list in order of importance all the attributes of a particular product. You usually end up like a mental contortionist as you compare each attribute with the whole list. Now say the attributes were all entered as Factors in this program, well then you'd only have to compare each one with one other and make a decision as to its relative importance. The end result would be a list automatically in logical order of importance and most important of all it would still be firmly based on human judgement. Once you've covered the Factors, it's just a question of selecting the better Choice of two when only one Factor is involved. Each separate preference is recorded, scored and modified by the strength, which you've previously established, of the Factor involved. Then finally, the Choices are sorted using the Choice score number array C(). The end result is displayed in the form of the three best Choices, and the worst, with the scores given as a percentage. -- Another Fine Product transcribed by: Jim Grimwood (jimg@globalnet.co.uk), Hatfield, England --