ebook img

Puzzled Programmers: 15 Mind-Boggling Story Puzzles to Test Your Programming Prowess : Solutions in Basic, Pascal, and C PDF

276 Pages·1987·24.58 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Puzzled Programmers: 15 Mind-Boggling Story Puzzles to Test Your Programming Prowess : Solutions in Basic, Pascal, and C

MlCfflfl. Programmers 15 MIND-BOGGLING STORY PUZZLES TO TEST YOUR J \ /l / PROGRAMMING PROWESS i ( SOLUTIONS IN BASIC, PASCAL, AND C Programmers 15 MIND-BOGGLING STORY PUZZLES TO TEST YOUR PROGRAMMING PROWESS SOLUTIONS IN BASIC, PASCAL, AND C % MCHAfy %% MPiRcrEosSofSt PUBLISHEDBY MicrosoftPress A DivisionofMicrosoftCorporation 16011 N.E. 36thWay, Box97017, Redmond, Washington98073-9717 Copyright ©1987byMichaelWiesenberg Allrightsreserved. Nopartofthecontentsofthisbookmay bereproducedortransmittedinany formorbyanymeanswithout thewrittenpermissionofthepublisher. LibraryofCongressCataloginginPublicationData Wiesenberg,Michael. Puzzledprogrammer—s. 1. Microcomputers Programming. 2. BASIC(Computerprogramlanguage) 3. PASCAL(Computerprogramlanguage) 4. C(Computerprogramlanguage) 5. Computergames. I. Title. QA76.6.W535 1987 005.26 87-7823 ISBN 1-55615-031-8 Printedandbound intheUnitedStatesofAmerica 2 345 67 89 MLML 890987 1 Distributedtothebooktrade intheUnitedStatesbyHarper&Row. Distributedtothebooktrade inCanadabyGeneral PublishingCompany, Ltd. DistributedtothebooktradeoutsidetheUnitedStatesandCanada by PenguinBooksLtd. Penguin BooksLtd., Harmondsworth, Middlesex, England Penguin BooksAustraliaLtd., Ringwood, Victoria, Australia Penguin BooksN.Z. Ltd., 182-190WairauRoad. Auckland 10, NewZealand BritishCataloginginPublicationDataavailable Thestories inthisbookarefiction. Anyresemblance betweenthecharactersandanyonealiveordeadis purelycoincidental. Apple®andApple II®areregisteredtrademarksand Macintosh™ isatrademarkofAppleComputer. Incorporated. IBM®isaregisteredtrademarkandPC/XTandPC/ATare trademarksofInternational BusinessMachinesCorporation. Microsoft®andGW-BASIC®areregisteredtrademarksof MicrosoftCorporation. Tandy®isaregisteredtrademarkofRadioShack, adivisionofTandyCorporation. For Susanna Digitized by the Internet Archive 2012 in http://archive.org/details/puzzledprogrammeOOwies CONTENTS Acknowledgments vii Introduction ix Stories A Puzzle 1 PuzzlingArrival 2 Puzzle 2 The Powers That Be 11 Puzzle 3 One Goes, Five Don't 17 Puzzle 4 Cubie Warming 22 Puzzle 5 A Pleasant Fourthsum 27 Puzzle 6 A Dance in the Sun 33 Puzzle 7 Cool Cubie Squares 39 Puzzle 8 A Product Thicker Than Water 44 Puzzle 9 The Rainbow Slips 49 Puzzle 10 Looking Suspiciously Like Each Other 56 Puzzle 11 Later Than They Think 63 Puzzle 12 How to Reduce: A Celebration 69 Puzzle 13 Betting on aJet, orJetting on a Bet 76 Puzzle 14 Memories Are Made ofThis 81 Puzzle 15 The Product Seen Through Other Eyes 88 Hints Puzzle 1 94 Puzzle 9 103 Puzzle 2 95 Puzzle 10 104 Puzzle 3 96 Puzzle 11 105 Puzzle 4 98 Puzzle 12 106 Puzzle 5 99 Puzzle 13 107 Puzzle 6 100 Puzzle 14 108 Puzzle 7 101 Puzzle 15 109 Puzzle 8 102 Solutions Puzzle 1 112 Puzzle 9 168 Puzzle 2 117 Puzzle 10 178 Puzzle 3 125 Puzzle 11 183 Puzzle 4 132 Puzzle 12 196 Puzzle 5 138 Puzzle 13 204 Puzzle 6 144 Puzzle 14 211 Puzzle 7 150 Puzzle 15 228 Puzzle 8 157 Appendix: Converting Programs to Applesoft BASIC 247 VI ACKNOWLEDGMENTS The narrative portions of some chapters in this book are based partly on installments ofmy "Computer Calisthenics" column that began in Dr. Dobb'sJournal and continues currently in A + Those episodes have . been rewritten and expanded in this book. One puzzle originally appeared in A + Its solution there was pre- . sented in only one language, but in this book it now has programmatic solutions in three languages, and the explanatory material accompanying the puzzle is more extensive than what originally appeared in the maga- zine. The remaining puzzles have notbeen published anywhere with pro- grammatic solutions, although some may be known to those familiarwith mathematical conundrums. I would like to acknowledge the considerable help of Erik Eidt, Hugh Njemanze, and Bob Stong. I would also like to thank Mike Caro, Peter Lang, Alan LeGrand, David Merit, and Tom Neudecker. VII

Description:
Are you brilliant with BASIC? Is Pascal your passion? Or C your specialty? Here are 15 clever math puzzles that will test the coding prowess of every programmer — beginning or experienced. Each puzzle is brought to you by the amusing cast of characters who work at l-Q Industries, a fictional compu
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.