Rn Programming
Total Page:16
File Type:pdf, Size:1020Kb
A MARSHALL CAVENDISH 8 COMPUTER COURSE IN WEEKLY PARTS RN PROGRAMMING - FOR FUN AND THE FUTURE ilOW TO ORDER YOUR BINDERS UK and Republic of Ireland: Send £4.95 (inc p & p) (1R£5.45) for each binder to the address below: Marshall Cavendish Services Ltd, Department 980, Newtown Road, Hove, Sussex BN3 7DN Australia: See inserts for details, or Vol 1 No 8 write to INPUT, Gordon and Gotch Ltd, PO Box 213, Alexandria, NSW 2015 PERIPHERALS New Zealand: See inserts for details, simmemor or write toINPUT,Gordon and Gotch PRINTERS: THE CHOICES 225 (NZ) Ltd, PO Box 1595, Wellington Malta: Binders are available from local newsagents. To take a hardcopy of a listing or write a letter, you need a printer—but which sort? GAMES PROGRAMMING 8 BREAKING THE SOUND BARRIER 230 There are four binders each holding 13 issues. Build up a library of exciting sound effects to add to your games routines BACK NUMBERS MACHINE CODE 9 Copies of any part of INPUT can be obtained from the following addresses at the regular cover price, with no extra charge for postage and packing: UK and Republic of Ireland: INPUT, Dept AN, Marshall Cavendish Services, GETTING TO THE HEART OF IT iM 111236 Newtown Road, Hove BN3 7DN L_ Australia, New Zealand and Malta: The CPU is the heart of the machine and controls all Back numbers are available through your local newsagent operations. Learn how to communicate with it BASIC PROGRAMMING 15 COPIES BY POST UNDERSTANDING PEEK AND POKE 240 Our Subscription Department can supply your copies direct to you regularly at £1.00 each. For example the cost of 26 issues is £26.00; for any other quantity simply Look into your computer's memory and use the values multiply the number of issues required by £1.00. These rates apply anywhere in the that are stored there world. Send your order, with payment to: Subscription Department, Marshall Cavendish Services Ltd, Newtown Road, Hove, Sussex BN3 7DN BASIC PROGRAMMING 16 Please state the title of the publication and the part from which you wish to start. HOW TO PAY: Readers in UK and Republic of Ireland: All cheques or postal orders DRAGON/TANDY: BETTER GRAPHICS 248 for binders, back numbers and copies by post should be made payable to: Marshall Cavendish Partworks Ltd. Setting up colour UDGs on these machines QUERIES: When writing in,please give the make and model of your computer,as BASIC PROGRAMMING 17 well as the Part No., page and line where the program is rejected or where it does not work. We can only answer specific queries –and please do not telephone. Send your queries to INPUT Queries, Marshall Cavendish Partworks Ltd, 58 Old MAKING PICTURES WITH MATHS 250 Compton Street, London WIV SPA. Understanding SIN and COS, and what you can do with them INPUT IS SPECIALLY DESIGNED FOR: INDEX The last part of INPUT, Part 52, will contain a complete, cross-referenced index. The SINCLAIR ZX SPECTRUM (16K, 48K,128 and + ), For easy access to your growing collection, a cumulative index to the contents COMMODORE 64 and 128, ACORN ELECTRON, BBC B of each issue is contained on the inside back cover. and B+,and the DRAGON 32 and 64. In addition, many of the programs and explanations are also PICTURE CREDITS Front cover, Dave King. Pages 225, 226, 228, Nick Farmer. Pages 230, 232, 233, suitable for the SINCLAIR ZX81, COMMODORE VIC 20, and 234, 235, Tudor Art Studios. Pages 236, 237, 238, Chris Lyon. Pages 240, 242, 244, TANDY COLOUR COMPUTER in 32K with extended BASIC. Dave King/Ian Craig/Roy Flukes. Pages 243, 245, 246, Ian Stephen. Page 248, Programs and text which are specifically for particular machines Associated Press/Graham Bingham. Pages 250, 252, 254, JD Audio Visual. Page are indicated by the following symbols: 255, Ray Duns. Equipment loaned by Lasky's, Tottenham Court Road, London WI. © Marshall Cavendish Limited 1984/5/6 SPECTRUM All worldwide rights reserved. K,128, and tiK COMMODORE 64 and 128 The contents of this publication including software, codes, listings, graphics, illustrations and text are the exclusive property and copyright of ACORN ELECTRON, Marshall Cavendish Limited and may not be copied, reproduced, El BBC B and B+ 1Z1 DRAGON 32 and 64 transmitted, hired, lent, distributed, stored or modified in any form TANDY IRS80 whatsoever without the prior approval of the Copyright holder. a nun [411 VIC 20 mr COLOUR COMPUTER Published by Marshall Cavendish Partworks Ltd, 58 Old Compton Street, London W1V SPA, England. Printed by Artisan Presss, Leicester and Howard Hunt Litho, London. ■ DO YOU NEED A PRINTER? ■ CHOOSING THE RIGHT TYPE ■ BUYING THE PAPER ■ CONNECTING THE PRINTER TO YOUR COMPUTER If you've ever wanted a 'hard' copy permanent record of any information that can of your program or a screen dump be brought to the screen. of some graphics then you'll need a For example, there are many attractive graphic designs—computer art, maybe—that printer. But how do you know you could print and file or even frame, but which sort to buy? without a printer they exist only fleetingly on the VDU screen. If you write a lengthy Buying a printer is one way to extend the program, you may well want a record of the usefulness of your computer and develop your listing to keep or to work on away from the programming skills. But it can be a very computer. If you write or buy business expensive investment, and since the choices programs, you will need to print graphs or and range of prices are just as varied as for charts to be included in reports. And for computers, only the best-informed micro user Computer Aided Design you need a record of can be sure of the need for a printer or of shapes or objects that can be referred to away buying the most suitable one. from the computer. The normal way in which a computer All home computers have a keyboard, outputs information to the user is onto a TV which is similar to that of a typewriter, so you screen or VDU. A printer is just an alternative can type and print correspondence, data—or means of displaying the same information. But even a book—as on a typewriter. Your capa- don't imagine that both devices have the same city to handle text can be extended far beyond uses—one is no substitute for the other. The mere typing and into the realms of word key role of a printer is to give a 'hard' copy or processing, where you can manipulate text in A single column of blunt needles strikes an inked ribbon to form the pattern of dots that make up each character of a dot matrix printer all sorts of ways. Given the right software, ters per second (cps) to over 400. One disad- your micro already has this ability, but a TYPES OF PRINTER vantage of some of these printers, however, is carefully composed block of text—whether it is There are four types of printer that might be that the characters do not have true just a short letter or even the contents of a suitable for the home micro user. These are the descenders—the 'tails' on letters, such as 'g' booklet—is of little use if it cannot be printed. impact dot matrix, daisywheel, thermal, and and 'q'. They make the entire character sit And almost all users would find a printer pen printers. above the line, without the tail dropping helpful as a programming aid. As well as The impact dot matrix printer is the most below. True descenders are desirable for clar- providing a back-up or copy of your work, it is popular type. As with all modern printers, the ity and attractive presentation, and this feature often far easier to spot mistakes on paper than carriage remains stationary while the print is available on the better dot matrix printers. by scrolling through the program on a VDU head advances across the width of the paper. Early designs of impact dot matrix printers screen. The merits of the VDU are many but, The print head contains a closely grouped used a seven-needle print head to produce generally, people are more familiar with vertical column of needles which are attached characters in a matrix, or pattern, of 5 x 7 printed information so they find it easier to to solenoids. When a solenoid is activated, its dots—five columns of seven rows. More recent work with than an electronic image. needle is pushed forwards against an ink designs employ nine needles to produce a 7 x 9 These attributes may well make a printer ribbon onto the paper, making an ink dot. By or 9 x 9 matrix. appear an essential aid to all computer users. firing the right combination of needles and Even with the best dot matrix printers, the But it is as well to remember that these abilities advancing the position of the print head, a characters can appear distinctly dotted, are not all built into every printer, and the character is formed. although they are clearly legible. They are most versatile printers are prohibitively ex- Commodore users have a choice of two dot quite suitable for most non-professional work, pensive. For example, not all printers can matrix printers which are dedicated to their and can be made to print pictures from the handle graphics, and only a few can print in machines—the difference is in price and per- screen.