home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / LADYBUG.ZIP / LADYBUG.LST < prev    next >
File List  |  1984-03-14  |  152KB  |  6,074 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.           LADYBUG GRAPHICS
  18.  
  19.           REFERENCE MANUAL
  20.  
  21.           VERSION 1.0
  22.  
  23.  
  24.  
  25.  
  26.  
  27.           14 March 1984
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.           David N. Smith
  38.  
  39.           44 Ole Musket Lane
  40.           Danbury, CT 06810
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.           (c) Copyright 1983 and 1984 by David N. Smith
  51.           All Rights Reserved.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           PREFACE
  74.  
  75.  
  76.           LadyBug is an implementation of LOGO Turtle Graphics.  It is
  77.           distributed as "User-Supported" software which means that you do
  78.           not have to pay for it.  You can copy it, give it away, or do
  79.           anything else with it except sell it.
  80.  
  81.           If you find that it is useful, you are invited to make a donation
  82.           of $35 to the author.  The donation is voluntary and in no way
  83.           should be considered as payment for software or services.
  84.  
  85.           Under no circumstances should school teachers feel any obligation
  86.           to make a donation.  One teacher said she has $100 per year for
  87.           software, shared between three teachers, and that she would send
  88.           a donation when they raised money from selling candy.  If that is
  89.           your kind of circumstance, please accept LadyBug with the
  90.           author's compliments.
  91.  
  92.           The author is:
  93.  
  94.              David N. Smith
  95.              44 Ole Musket Lane
  96.              Danbury, CT 06810
  97.  
  98.           The author can also be reached by US mail or EMAIL on CompuServe
  99.           to userid 73145,153.  Please do not phone.
  100.  
  101.  
  102.  
  103.           DISCLAIMER
  104.  
  105.           LadyBug comes with no warranties of any kind; it is available AS
  106.           IS.  The author would like to know of problems that users have
  107.           but makes no promise or guarantees that any problem will be
  108.           fixed.  Please dont feel that a donation is necessary to report a
  109.           problem or suggest an improvement; it isn't!  In fact, exactly
  110.           the opposite might be true.
  111.  
  112.           IN NO EVENT WILL THE AUTHOR BE LIABLE FOR ANY DAMAGES, INCLUDING
  113.           ANY LOST PROFITS, LOST SAVINGS, FAILURE TO EDUCATE, OR OTHER
  114.           INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR
  115.           INABILITY TO USE THIS PROGRAM, EVEN IF THE AUTHOR HAS BEEN
  116.           ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY
  117.           ANY OTHER PARTY.
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.           Preface                                                   Page ii
  137.  
  138.  
  139.           COPYING LADYBUG
  140.  
  141.           Educational institutions, clubs, and other nonprofit
  142.           organizations as well as individuals are granted permission to
  143.           freely copy LadyBug and its documentation and share them with
  144.           their members or students, or individuals with their friends, so
  145.           long as:
  146.  
  147.           1.  No price is charged for the software or documentation.
  148.               However, clubs and other nonprofit organizations may charge a
  149.               distribution fee of up to $6 to cover expenses.
  150.           2.  Neither the program nor its documentation are modified in any
  151.               way and are distributed together.
  152.  
  153.           Other organizations, and individuals, are allowed to copy LadyBug
  154.           only if done without charge and so long as the other rules above
  155.           are followed.
  156.  
  157.           Educational instutitions, clubs, and other nonprofit
  158.           organizations may make printed copies of this document for
  159.           distribution to members, or students of the institution, provided
  160.           that any price charged does not exceed the actual cost of the
  161.           duplication of the copy, and provided that the document is
  162.           reproduced in its entirety including all copyright and
  163.           restrictive notices.
  164.  
  165.           NOTICE: LadyBug is NOT in the public domain.  The author retains
  166.           ownership of the program and its copyright.
  167.  
  168.  
  169.  
  170.           USER SUPPORTED SOFTWARE
  171.  
  172.           User-supported software was conceived by Andrew Fluegelman of
  173.           Headlands Press for PC-TALK.  He used the name FreeWare(tm).  Jim
  174.           Button, distributor of PC-FILE, coined the term user-supported
  175.           software.(1)
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.           ____________________
  189.  
  190.           (1) User-supported does NOT mean that the user must support
  191.           herself.  It means that the user herself supports the idea of
  192.           freely distributed software.
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.           Preface                                                  Page iii
  203.  
  204.  
  205.           SOURCE
  206.  
  207.           LadyBug is distributed as compiled Basic; source is NOT
  208.           distributed nor is it available.
  209.  
  210.  
  211.  
  212.           HOW TO GET LADYBUG
  213.  
  214.           If you do not have LadyBug, or if your copy is not current, you
  215.           can get a new copy by sending the author a diskette and a postage
  216.           paid mailer.  You get LadyBug with documentation on disk.  In any
  217.           case, please mark LADYBUG on the OUTSIDE of the envelope.  Send
  218.           no money; it is free.
  219.  
  220.           LadyBug is available from an ever increasing list of other
  221.           sources.  In particular the Young Peoples LOGO Association
  222.           distributes LadyBug as well as hundreds of procedures written in
  223.           LOGO.  Chapter 1 gives their address.
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           TABLE OF CONTENTS
  272.  
  273.  
  274.           1. ABOUT LADYBUG AND LOGO.................................  1
  275.             1.1. LadyBug Features...................................  2
  276.             1.2. LadyBug Requirements...............................  2
  277.             1.3. Additions and Changes From Version 0.9.............  3
  278.             1.4. Why not LadyBug?...................................  3
  279.             1.5. LadyBug Procedure Library..........................  4
  280.             1.6. Thanks To ---......................................  4
  281.  
  282.           2. RUNNING LADYBUG........................................  5
  283.             2.1. Before You Run LadyBug.............................  5
  284.             2.2. Starting...........................................  5
  285.             2.3. LadyBug Function Keys..............................  5
  286.             2.4. Trying Things......................................  6
  287.             2.5. Setting Up a LadyBug Diskette......................  7
  288.             2.6. When Something Goes Wrong..........................  8
  289.  
  290.           3. THE WORKSPACE..........................................  9
  291.  
  292.           4. THE LADYBUG SCREENS....................................  10
  293.             4.1. The Graphics Screen................................  10
  294.             4.2. The Text Screen....................................  11
  295.             4.3. The Editing Screen.................................  11
  296.             4.4. Using Two Displays.................................  11
  297.  
  298.           5. THINGS WHICH MAKE UP COMMANDS..........................  12
  299.             5.1. Words..............................................  12
  300.             5.2. Numbers............................................  12
  301.             5.3. Lists..............................................  12
  302.             5.4. Strings............................................  13
  303.             5.5. About Capital Letters..............................  13
  304.             5.6. Expressions........................................  13
  305.  
  306.           6. GRAPHICS COMMANDS......................................  14
  307.             6.1. BACK length    (Abbreviated BK)....................  14
  308.             6.2. BACKGROUND color    (Abbreviated BG)...............  14
  309.             6.3. CLEARSCREEN    (Abbreviated CS)....................  15
  310.             6.4. CLIP...............................................  15
  311.             6.5. DRAW...............................................  15
  312.             6.6. FORWARD length   (Abbreviated FD)..................  15
  313.             6.7. HIDEBUG    (Abbreviated HB)........................  16
  314.             6.8. HIDETURTLE    (Abbreviated HT).....................  16
  315.             6.9. HOME...............................................  16
  316.             6.10. LEFT angle   (Abbreviated LT).....................  16
  317.             6.11. NOCLIP............................................  16
  318.             6.12. NODRAW   (Abbreviated ND).........................  17
  319.             6.13. NOWRAP............................................  17
  320.             6.14. NOWINDOW..........................................  17
  321.             6.15. PAINT paintcolor bordercolor......................  17
  322.             6.16. PALETTE palettenumber.............................  18
  323.             6.17. PENCOLOR color   (Abbreviated PC).................  18
  324.             6.18. PENDOWN   (Abbreviated PD)........................  18
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.           Table of Contents                                          Page v
  335.  
  336.  
  337.             6.19. PENUP   (Abbreviated PU)..........................  19
  338.             6.20. RIGHT angle   (Abbreviated RT)....................  19
  339.             6.21. SETHEADING angle   (Abbreviated SETH).............  19
  340.             6.22. SETBG color.......................................  19
  341.             6.23. SETPAL palette....................................  20
  342.             6.24. SETPC color.......................................  20
  343.             6.25. SETSCRUNCH n   (Also: .SETSCRUNCH)................  20
  344.             6.26. SETX xcoord.......................................  20
  345.             6.27. SETXY xcoord ycoord...............................  21
  346.             6.28. SETY ycoord.......................................  21
  347.             6.29. SHOWBUG   (Abbreviated SB)........................  21
  348.             6.30. SHOWTURTLE   (Abbreviated ST).....................  21
  349.             6.31. WINDOW............................................  22
  350.             6.32. WRAP..............................................  22
  351.  
  352.           7. SOUNDS.................................................  23
  353.             7.1. BEEP...............................................  23
  354.             7.2. PLAY string........................................  23
  355.             7.3. TONE frequency n...................................  24
  356.  
  357.           8. INPUT AND OUTPUT.......................................  25
  358.             8.1. CLEARTEXT   (Abbreviated CT).......................  25
  359.             8.2. CLEARINPUT.........................................  25
  360.             8.3. CURSOR column row..................................  25
  361.             8.4. PRINT word   (Abbreviated PR)......................  25
  362.             8.5. PRINT1 word   (Abbreviated PR1)....................  26
  363.             8.6. TYPE word..........................................  26
  364.             8.7. SETWIDTH columns...................................  26
  365.             8.8. TEXTCOLUMNS columns   (Abbreviated TCOLS)..........  26
  366.  
  367.           9. CONTROL COMMANDS.......................................  27
  368.             9.1. EDIT procname ...   (Abbreviated ED)...............  27
  369.             9.2. EDIT ALL...........................................  27
  370.             9.3. END................................................  27
  371.             9.4. ERROR message......................................  27
  372.             9.5. FOREVER list.......................................  28
  373.             9.6. GOODBYE   (Abbreviated BYE)........................  28
  374.             9.7. IF condition THEN action...........................  28
  375.             9.8. IF condition [action]..............................  28
  376.             9.9. IF condition THEN action1 ELSE action2.............  29
  377.             9.10. IF condition [action1] [action2]..................  29
  378.             9.11. IFFALSE list......................................  30
  379.             9.12. IFTRUE list.......................................  30
  380.             9.13. LOCAL variablename................................  30
  381.             9.14. MAKE "variablename value..........................  31
  382.             9.15. OUTPUT value   (Abbreviated OP)...................  32
  383.             9.16. RANDOMIZE number..................................  32
  384.             9.17. REPEAT number list................................  32
  385.             9.18. RUN list..........................................  33
  386.             9.19. STOP..............................................  33
  387.             9.20. TEST condition....................................  33
  388.             9.21. TOPLEVEL..........................................  33
  389.             9.22. WAIT time.........................................  33
  390.             9.23. WHILE condition list..............................  34
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.           Table of Contents                                         Page vi
  401.  
  402.  
  403.  
  404.           10. MANAGING THE WORKSPACE................................  35
  405.             10.1. CATALOG   (Abbreviated CAT).......................  35
  406.             10.2. CLEARWS...........................................  35
  407.             10.3. DEFINE "name list.................................  35
  408.             10.4. EDIT procname ....................................  36
  409.             10.5. EDIT ALL..........................................  36
  410.             10.6. ERASE procedurename...............................  36
  411.             10.7. ERASE ALL.........................................  36
  412.             10.8. ERASEFILE filename................................  37
  413.             10.9. ERNAME variablename...............................  37
  414.             10.10. ERNAME ALL.......................................  37
  415.             10.11. LOAD filename....................................  37
  416.             10.12. PRINTOUT name   (Abbreviated PO).................  37
  417.             10.13. READ filename....................................  37
  418.             10.14. SAVE filename....................................  38
  419.             10.15. TO procname inputs...............................  38
  420.  
  421.           11. RUNNING AND DEBUGGING PROCEDURES......................  39
  422.             11.1. Running Procedures................................  39
  423.             11.2. Pausing Procedures................................  39
  424.             11.3. Editing Active Procedures.........................  40
  425.             11.4. CONTINUE    (Abbreviated CO)......................  40
  426.             11.5. NOTRACE...........................................  40
  427.             11.6. PAUSE.............................................  40
  428.             11.7. TOPLEVEL..........................................  40
  429.             11.8. TRACE.............................................  41
  430.             11.9. ;  (comment)......................................  41
  431.  
  432.           12. NUMBERS AND COMPUTATIONS..............................  42
  433.             12.1. Values............................................  42
  434.               12.1.1. Numeric Values................................  42
  435.               12.1.2. Mathematical Values...........................  43
  436.             12.2. Graphics Words....................................  44
  437.             12.3. Other Words.......................................  45
  438.             12.4. Expressions Resulting in Numbers..................  46
  439.             12.5. Expressions Resulting in True or False............  47
  440.             12.6. Procedures........................................  48
  441.  
  442.           13. WORKSPACES WITH TOOLS.................................  49
  443.             13.1. AND  t/f  t/f.....................................  49
  444.             13.2. FOREVER list......................................  49
  445.             13.3. MAX value1 value2.................................  49
  446.             13.4. MIN value1 value2.................................  49
  447.             13.5. OR  t/f  t/f......................................  50
  448.             13.6. WAIT time.........................................  50
  449.             13.7. WHILE [condition] [commands]......................  50
  450.             13.8. XOR  t/f  t/f.....................................  50
  451.  
  452.           14. INTRODUCTION TO THE LADYBUG EDITOR....................  51
  453.             14.1. About the Editor..................................  51
  454.             14.2. Invoking the Editor...............................  51
  455.             14.3. The LadyBug Editor Keys...........................  52
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.           Table of Contents                                        Page vii
  467.  
  468.  
  469.           15. HINTS ON USING LADYBUG................................  54
  470.             15.1. Printing the Screen On an IBM or Epson Printer....  54
  471.             15.2. Printing the Screen On Other Printers.............  54
  472.             15.3. Tailoring LadyBug: The Profile....................  54
  473.             15.4. The READ Command..................................  54
  474.             15.5. Performance Hints.................................  55
  475.  
  476.           APPENDIX A. ABOUT THE LADYBUG EDITOR......................  57
  477.             A.1. The LadyBug Editor Keys............................  57
  478.  
  479.           APPENDIX B. THE PLAY COMMAND..............................  60
  480.             B.1. Music Commands.....................................  60
  481.             B.2. Examples of Play Statements........................  63
  482.  
  483.           APPENDIX C. A GUIDE TO EXAMPLE PROCEDURES.................  64
  484.             C.1. BCAKE..............................................  64
  485.             C.2. C..................................................  64
  486.             C.3. DYNA...............................................  64
  487.             C.4. DRAGON.............................................  65
  488.             C.5. DUOPOLY............................................  65
  489.             C.6. HILBERT............................................  65
  490.             C.7. INSPI..............................................  65
  491.             C.8. LUDWIG.............................................  66
  492.             C.9. MISC...............................................  66
  493.             C.10. POLY..............................................  66
  494.             C.11. POLYSPI...........................................  67
  495.             C.12. RAIL..............................................  67
  496.             C.13. SLINKY............................................  67
  497.             C.14. SNOWFLAK..........................................  68
  498.             C.15. SPIRO.............................................  68
  499.             C.16. SOUNDS............................................  68
  500.             C.17. SPINSQ............................................  69
  501.             C.18. TREES.............................................  69
  502.  
  503.           APPENDIX D. FORMAT AND CONTENTS OF SAVED WORKSPACES.......  70
  504.  
  505.           APPENDIX E. ERROR MESSAGES................................  71
  506.  
  507.           APPENDIX F. HACKERS ONLY..................................  74
  508.             F.1. .DEBUG.............................................  74
  509.             F.2. .STACK.............................................  74
  510.             F.3. .SYMTAB............................................  74
  511.             F.4. Names that return values...........................  74
  512.  
  513.           APPENDIX G. LIMITS AND CAPACITIES.........................  76
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           1. ABOUT LADYBUG AND LOGO
  536.  
  537.  
  538.           LadyBug is a graphics language based on LOGO Turtle Graphics.  It
  539.           contains most of the graphics commands, procedure making
  540.           commands, and control commands from the Apple II(2)
  541.           implementation of LOGO done by Terrapin, Inc.  This version is
  542.           described in the book LOGO FOR THE APPLE II, by Harold Abelson,
  543.           published by McGraw-Hill in 1982.  It is very similar to other
  544.           versions for the Apple II, IBM PC, Texas Instruments, and
  545.           TRS-80(3) computers.  Words from other LOGO implementations are
  546.           included for compatibility.
  547.  
  548.           This manual describes the LadyBug language but is not an
  549.           introduction to LOGO.  We highly recommend the book LOGO FOR THE
  550.           APPLE II for its very understandable presentation of LOGO and for
  551.           its many examples.
  552.  
  553.           DISCOVERING APPLE LOGO by David D. Thornburg is another very
  554.           readable, although less complete, introduction to LOGO.  It was
  555.           published by Addison-Wesley in 1983.
  556.  
  557.           For children, or adults who are going to work with children, the
  558.           book LEARNING WITH LOGO, Daniel Watt, McGraw-Hill, 1983, is
  559.           highly recommended.  It is written by a person who is both an
  560.           elementary teacher, and who has worked with the LOGO group at MIT
  561.           for many years.
  562.  
  563.           The book TURTLE GEOMETRY, Abelson and diSessa, MIT Press, 1980 is
  564.           recommended for more advanced users.  It takes the form of a
  565.           college text book on mathematics using Turtle Graphics as the
  566.           mechanism.
  567.  
  568.           A good source of ideas and programs is the Young People's LOGO
  569.           Association, 1208 Hillsdale Drive, Richardson, TX 75081.  On
  570.           CompuServe, YPLA can be reached at 70130,250 and on the Source
  571.           they are T10143.  YPLA publishes a monthly newsletter and has a
  572.           large library of public domain LOGO software for a wide variety
  573.           of machines.
  574.  
  575.           Of course, MINDSTORMS, Seymour Pappert, Basic Books, 1980 is the
  576.           ultimate source of WHY LOGO.
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.           ____________________
  586.  
  587.           (2) Apple II is a Trademark of Apple, Inc.
  588.           (3) TRS-80 is a Trademark of Tandy.
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.           About LadyBug and LOGO                                     Page 2
  599.  
  600.  
  601.           1.1. LADYBUG FEATURES
  602.  
  603.           LadyBug is a version of LOGO patterned after the Apple II
  604.           implementation developed by Terrapin, Inc.  and with features
  605.           from other LOGO systems.  In general it has most of the graphics
  606.           commands, the mathematical computations, and the control
  607.           commands, of Apple LOGO.  In addition it has:
  608.  
  609.           -   Commands and words from various other LOGO implementations.
  610.               Commands with the same names as IBM LOGO commands are mainly
  611.               compatible with IBM LOGO.
  612.           -   A library of procedures adapted from a variety of sources.
  613.           -   Painting of areas.
  614.           -   Clipping of drawings (as well as wraparound).
  615.           -   A fast full screen editor.
  616.           -   Support for using both displays if both are present.
  617.           -   Sounds -- PLAY statement like Basic.
  618.  
  619.           The major features missing are:
  620.  
  621.           -   List manipulation.
  622.           -   Variable numbers of parameters to primitives.
  623.           -   Saving screen images.
  624.  
  625.  
  626.  
  627.           1.2. LADYBUG REQUIREMENTS
  628.  
  629.           LadyBug requires a system with at least:
  630.  
  631.           -   128K of memory.
  632.           -   One single sided disk drive.
  633.           -   A graphics adaptor.
  634.           -   A graphics display of any kind.  Color is supported only on a
  635.               color display; 80 column editing is supported only on a high
  636.               resolution monitor.  A color TV set will work but colors will
  637.               not be accurate.
  638.           -   DOS 1.1, 2.0, or 2.1.  (DOS 1.0 has not been tested.)
  639.           -   An IBM PC, PCjr, or compatible machine.
  640.  
  641.           The distribution diskette is double sided and requires DOS 1.1 or
  642.           later.  Files for execution of LadyBug can be copied to a single
  643.           sided diskette.
  644.  
  645.           The IBM Monochrome display is also supported, if present, for
  646.           editing and when in text mode.  References in this document to
  647.           "the Monochrome display" refer to the IBM Monochrome display and
  648.           not to a black and white graphics monitor.
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.           About LadyBug and LOGO                                     Page 3
  665.  
  666.  
  667.           1.3. ADDITIONS AND CHANGES FROM VERSION 0.9
  668.  
  669.           The changes made in version 1.0, as compared to version 0.9,
  670.           include:
  671.  
  672.           -   returning values from procedures;
  673.           -   help key;
  674.           -   pausing procedures and then continuing;
  675.           -   SETSCRUNCH to adjust aspect ratios;
  676.           -   TEST, IFTRUE, and IFFALSE commands;
  677.           -   some list support;
  678.           -   some IBM LOGO syntax compatibility;
  679.           -   expanded limits for the size of procedures, number of lines
  680.               to edit, and sizes of constants;
  681.           -   text screen support;
  682.           -   tools workspaces; and
  683.           -   many new builtin functions.
  684.  
  685.           Many smaller changes have also been made.  In addition the manual
  686.           has been expanded with additional information, examples, and an
  687.           index.
  688.  
  689.  
  690.  
  691.           1.4. WHY NOT LADYBUG?
  692.  
  693.           LadyBug was written as an introduction to LOGO and Turtle
  694.           Graphics.(4) The author recommends that those with a serious need
  695.           for LOGO investigate the use of a commercial version of LOGO
  696.           rather than LadyBug.  There are several reasons:
  697.  
  698.           1.  LadyBug is slower.
  699.           2.  LadyBug doesn't do as much.
  700.           3.  LadyBug is not supported in the same sense the commercial
  701.               versions are supported.  If you have a bug, then you might
  702.               have a bug forever.
  703.           4.  LadyBug will not grow and progress significantly with time.
  704.           5.  LadyBug is not as well documented.
  705.  
  706.           In particular, the IBM version of LOGO is a very powerful
  707.           implementation which also runs under PC/DOS.  It stores
  708.           workspaces in a manner similar to LadyBug; conversion to it
  709.           should not be difficult.
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.           ____________________
  718.  
  719.           (4) In particular, it was done for the author's children;
  720.           thoughts of distribution only came later.
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.           About LadyBug and LOGO                                     Page 4
  731.  
  732.  
  733.           1.5. LADYBUG PROCEDURE LIBRARY
  734.  
  735.           There is not much now except those in the Tools chapter and in
  736.           the Appendix on example procedures.  I hope that LadyBug users
  737.           will contribute procedures to a library so that other users can
  738.           share their efforts.  Contirbute them either to the author or to
  739.           the Young Peoples LOGO Association.
  740.  
  741.  
  742.  
  743.           1.6. THANKS TO ---
  744.  
  745.           Thanks to the inventors of LOGO for inventing it.
  746.  
  747.           Thanks to my children for playing with LadyBug.
  748.  
  749.           Thanks to all of those who ran version 0.9 and sent problem
  750.           reports and requests for changes.  The bugs have been fixed and
  751.           as many features have been added as possible.
  752.  
  753.           Thanks to ReadiWriter, a very powerful text formatter, for making
  754.           it so easy to do a document this complex.  In particular, the
  755.           indexing was a breeze; without a program like ReadiWriter there
  756.           wouldn't have been an index.
  757.  
  758.           Thanks to all of those who have made suggestions, found bugs, and
  759.           helped out in many other ways.
  760.  
  761.           And thanks to my wife for putting up with me while I wrote
  762.           LadyBug.
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.           2. RUNNING LADYBUG
  800.  
  801.  
  802.  
  803.           2.1. BEFORE YOU RUN LADYBUG
  804.  
  805.           The LadyBug diskette should be backed up.  Never run the only one
  806.           you have if you value being able to run LadyBug tomorrow.
  807.  
  808.           LadyBug is initially distributed on double sided diskettes.  If
  809.           you have single sided drives you should get a friend to copy the
  810.           files onto diskettes formatted for single sided use.
  811.  
  812.           Although LadyBug will run with the diskette setup as distributed,
  813.           a section below describes how to set up working disks in order to
  814.           maximize the amount of working space and to make them self
  815.           booting.
  816.  
  817.  
  818.  
  819.           2.2. STARTING
  820.  
  821.           Boot DOS up.  Put the LadyBug diskette into the A: drive.(5) Type
  822.           "LADYBUG".  After a few seconds you will be in LadyBug command
  823.           mode.
  824.  
  825.  
  826.  
  827.           2.3. LADYBUG FUNCTION KEYS
  828.  
  829.           The LadyBug function keys control how LadyBug programs run or
  830.           stop them from running.  They may be used any time that LadyBug
  831.           is running.  When LadyBug is waiting for input you will have to
  832.           press the enter key before the action takes effect.  (In the
  833.           editor, the function keys have different meanings.)
  834.  
  835.           F1
  836.               Stop a running procedure and return to the command level from
  837.               which it was invoked.
  838.  
  839.           F3
  840.               Display the help menu.
  841.  
  842.           F5
  843.               Pause execution of a procedure or command and re-enter
  844.               LadyBug command mode.  Procedures and commands can be run and
  845.               then the paused command can be restarted by typing CONTINUE
  846.  
  847.           ____________________
  848.  
  849.           (5) See the DOS manual for information about how to make the
  850.           LadyBug diskette contain enough of DOS to boot up itself.  With
  851.           an AUTOEXEC.BAT file on the diskette you can have LadyBug start
  852.           up automatically when the machine is turned on.
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.           Running LadyBug                                            Page 6
  863.  
  864.  
  865.               (or CO).  F1 will stop procedures invoked from a pause level
  866.               and return to that pause level.  Procedures or commands run
  867.               from a pause level can themselves be paused, etc.
  868.  
  869.           F9
  870.               Switch on or off TRACE mode.  When it is on, each command
  871.               that is executed is displayed and LadyBug pauses for you to
  872.               press any key.
  873.  
  874.           F10
  875.               Hide or unhide the display of the LadyBug herself.  (She
  876.               looks like an arrow due to the radiation armor she wears!)
  877.               PROCEDURES RUN FASTER TWO OR THREE TIMES FASTER WHEN SHE IS
  878.               HIDDEN but are easier to understand when she is visible.
  879.  
  880.  
  881.  
  882.           2.4. TRYING THINGS
  883.  
  884.           The procedure POLY is already defined when LadyBug starts up.
  885.           (POLY is a simple and commonly used illustration of LOGO.)  To
  886.           try something, type DRAW(6) and then type one of these:
  887.  
  888.              poly 100 100
  889.              poly 100 144
  890.              poly 100 162
  891.  
  892.           Press F1 to stop the drawing; it will continue to run, retracing
  893.           its path, until you stop it.  If you press F10 while the figure
  894.           is being drawn then the LadyBug hides.  Press it again to get her
  895.           back.
  896.  
  897.           Type DRAW to clear the screen and to reset the LadyBug to her
  898.           home position.
  899.  
  900.           There are many examples which come with LadyBug; they are briefly
  901.           described in appendix C.  Try this:
  902.  
  903.              read "polyspi
  904.              clip
  905.              polyspi 5 144 5
  906.  
  907.           Press F1 to stop it.  Then try:
  908.  
  909.              draw
  910.              polyspi 1 45 1
  911.  
  912.           Or try:
  913.  
  914.  
  915.           ____________________
  916.  
  917.           (6) DRAW tells LadyBug you want to do graphics; you only have to
  918.           do it once at the start.
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.           Running LadyBug                                            Page 7
  929.  
  930.  
  931.              draw
  932.              polyspi 5 175 5
  933.  
  934.           POLY is a three statement procedure.  POLYSPI is too.  The wide
  935.           variations in each come from minor changes in how far a line is
  936.           drawn and how much of a turn is then made.  It is difficult to
  937.           believe that the three POLYSPI drawings come from the SAME
  938.           trivial program.
  939.  
  940.  
  941.  
  942.           2.5. SETTING UP A LADYBUG DISKETTE
  943.  
  944.           LadyBug will run from the diskette it is distributed on.
  945.           However, this diskette has many things, such as documentation, on
  946.           it which are not needed for running LadyBug.  The following
  947.           procedure describes how to build a diskette which holds only
  948.           those things you need.
  949.           1.  Format a diskette with the DOS FORMAT command.  Use the /S
  950.               option if you want it to automatically startup when you turn
  951.               on the machine.
  952.           2.  Put the diskette from step one into the B: drive.  Put the
  953.               LadyBug diskette into the A: drive.
  954.           3.  Issue these commands:
  955.  
  956.                  copy a
  957.                  copy a:help*.bug b:
  958.                  copy a:profile.bug b:
  959.  
  960.               These files should take about 100K leaving about 60K on a DOS
  961.               1.1 single sided diskette, 80K on a DOS 2.0 single sided
  962.               diskette, 220K on a DOS 1.1 double sided diskette, and 260K
  963.               on a DOS 2.0 double sided diskette.  Other .BUG files can be
  964.               copied as needed.
  965.           4.  If you want the diskette to automatically startup LadyBug
  966.               when the power is turned on, you need to create an
  967.               AUTOEXEC.BAT file.  The DOS manual describes how to do this.
  968.               The file should contain the following lines:
  969.  
  970.                  date
  971.                  time
  972.                  ladybug
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.           Running LadyBug                                            Page 8
  995.  
  996.  
  997.           2.6. WHEN SOMETHING GOES WRONG
  998.  
  999.           The appendix "Error Messages" lists the error messages that
  1000.           LadyBug puts out.  Two of these messages indicate a problem
  1001.           within LadyBug.  Hopefully these will never be printed but if
  1002.           they are it is very important that you communicate them to the
  1003.           author.  These are:
  1004.  
  1005.              FATAL ERROR n AT m
  1006.              INTERNAL ERROR n
  1007.  
  1008.           The "n" and "m" are numbers which vary from error to error ane
  1009.           which are very important in determining what happened.
  1010.  
  1011.           LadyBug will almost always recover from these errors and allow
  1012.           you to continue without loss of data.  However, it is recommended
  1013.           that you stop LadyBug as soon as you can afterwards and reload a
  1014.           fresh copy.  Also, do not save the workspace (except into a new
  1015.           file) without examining it to make sure the error did not cause
  1016.           damage to it.
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.           3. THE WORKSPACE
  1064.  
  1065.  
  1066.           LadyBug provides a work area in which you keep variables and
  1067.           procedures.  This work area is called a "work space".
  1068.  
  1069.           The work space initially contains only the procedure POLY.  Many
  1070.           LadyBug commands add to, modify things in, or remove things from
  1071.           the workspace.
  1072.  
  1073.              COMMAND    ACTION
  1074.              CLEARWS    Deletes everything in the workspace
  1075.              EDIT       Add or changes procedures
  1076.              ERASE      Delete a procedure or all procedures
  1077.              ERNAME     Delete a variable or all variables
  1078.              LOAD       Load things from another workspace
  1079.              SAVE       Save the workspace on disk
  1080.              TO         Define a procedure
  1081.  
  1082.           These commands are described elsewhere in this manual.
  1083.  
  1084.           As you work you add things to your current workspace.  When you
  1085.           are done you can either say BYE and leave LadyBug without saving
  1086.           the workspace or you can say SAVE and save it first.  SAVE allows
  1087.           you to name the workspace however you wish.  When you next start
  1088.           you can READ (or LOAD) that workspace and continue.
  1089.  
  1090.           You can have several workspaces for several projects or classes.
  1091.           If you have students, each can have her own workspace.
  1092.  
  1093.           The things that can go into a workspace are:
  1094.  
  1095.           Procedures
  1096.               Procedures are lists of commands that you want to run.  They
  1097.               have names, such as "poly", "fred", or "polyspi", that you
  1098.               make up.  Later on we will talk about how to create
  1099.               procedures.
  1100.  
  1101.           Variables
  1102.               Variables are named values.  They have names, such as "x",
  1103.               "fred", or "length", that you also make up.  Variables often
  1104.               are written with a semicolon like this:
  1105.  
  1106.                  :x    :fred    :length
  1107.  
  1108.               The semicolon asks LadyBug to get the current value of the
  1109.               variable and use it.  We will see these in some examples
  1110.               before we get back to discussing variables.
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.           4. THE LADYBUG SCREENS
  1130.  
  1131.  
  1132.           This chapter describes the different views of LadyBug seen on the
  1133.           screen.
  1134.  
  1135.           The TEXT SCREEN shows text.  When the text screen is current,
  1136.           LadyBug is said to be in "Text Mode".
  1137.  
  1138.           The GRAPHICS SCREEN shows graphics.  When the graphics screen is
  1139.           current, LadyBug is said to be in "Graphics Mode".
  1140.  
  1141.           The EDIT SCREEN shows procedures which can be changed.  When the
  1142.           edit screen is current, LadyBug is said to be "in the editor".
  1143.  
  1144.  
  1145.  
  1146.           4.1. THE GRAPHICS SCREEN
  1147.  
  1148.           When LadyBug starts up it is in text mode.  To get into graphics
  1149.           mode, type "DRAW".  In graphics mode, commands which draw are
  1150.           allowed.  Commands which display text do so in a small area at
  1151.           the bottom of the screen.(7) If you forget to type DRAW, LadyBug
  1152.           will automatically switch to the graphics screen when you issue
  1153.           any command which needs it.
  1154.  
  1155.           Graphics mode is re-entered each time you give the DRAW command.
  1156.  
  1157.           The graphics screen is 300 units high by 500 units wide.  The
  1158.           center is the origin.(8)
  1159.  
  1160.           The LadyBug starts at the center of the screen facing towards the
  1161.           top of the screen.  This direction has a heading of zero.  Turns
  1162.           to the right are considered positive and to the left are
  1163.           considered negative.
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.           ____________________
  1175.  
  1176.           (7) This area is two lines of up to 80 characters total.
  1177.           (8) Note that the coordinates of the LadyBug screen do not map
  1178.           exactly to the coordinates of the computers screen.  This is
  1179.           because there is nothing magic about the number of dots on the
  1180.           computers screen; different modes and different computers can
  1181.           have differing numbers of dots.  LadyBug can hide these
  1182.           differences.
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.           The LadyBug Screens                                       Page 11
  1193.  
  1194.  
  1195.           150  +----+----+----+----+----+----+----+----+----+----+
  1196.                |                                                 |
  1197.                |                                                 |
  1198.           100  +                                                 +
  1199.                |                                                 |
  1200.                |                                                 |
  1201.            50  +                                                 +
  1202.                |                                                 |
  1203.                |                                                 |
  1204.            0   +                        + (center)               +
  1205.                |                                                 |
  1206.                |                                                 |
  1207.           -50  +                                                 +
  1208.                |                                                 |
  1209.                |                                                 |
  1210.           -100 +                                                 +
  1211.                |                                                 |
  1212.                |                                                 |
  1213.           -150 +----+----+----+----+----+----+----+----+----+----+
  1214.              -250 -200 -150 -100  -50   0    50  100  150  200  250
  1215.  
  1216.                            Graphics Screen Coordinates
  1217.  
  1218.  
  1219.  
  1220.           4.2. THE TEXT SCREEN
  1221.  
  1222.           In text mode, LadyBug does not allow graphics but does allow a
  1223.           full screen of text.  Text mode is entered with the NODRAW
  1224.           command.
  1225.  
  1226.  
  1227.  
  1228.           4.3. THE EDITING SCREEN
  1229.  
  1230.           The editing screen replaces whichever screen is active when the
  1231.           EDIT or TO commands are given.  When editing ends, the previous
  1232.           screen type is restored but the screen is clear.
  1233.  
  1234.  
  1235.  
  1236.           4.4. USING TWO DISPLAYS
  1237.  
  1238.           If present, the IBM Monochrome display is used as the text screen
  1239.           and the editing screen.  The graphics display always contains the
  1240.           graphics screen.
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.           5. THINGS WHICH MAKE UP COMMANDS
  1262.  
  1263.  
  1264.           This chapter describes the kinds of things which are used in
  1265.           LadyBug commands.
  1266.  
  1267.  
  1268.  
  1269.           5.1. WORDS
  1270.  
  1271.           Words are groups of characters separated from each other by
  1272.           blanks.
  1273.  
  1274.           Examples:
  1275.  
  1276.              fred  *****  $129.50
  1277.  
  1278.           Each of "fred", "*****", and "$129.50" are words.
  1279.  
  1280.           Some special words, such as those starting with a left bracket
  1281.           ("[") or a quote mark may contain blanks; see below.
  1282.  
  1283.  
  1284.  
  1285.           5.2. NUMBERS
  1286.  
  1287.           Numbers are special kinds of words.  Numeric values come in two
  1288.           types, integer, and floating point.
  1289.  
  1290.           Integer numbers have only whole number values.  These values must
  1291.           be in the range of -32768 to 32767.  Floating point numbers have
  1292.           whole number and fractional values and an optional exponent.
  1293.  
  1294.           Examples:
  1295.  
  1296.              1    954    1.2    1.2e12
  1297.  
  1298.           Numbers are described in more detail later.
  1299.  
  1300.  
  1301.  
  1302.           5.3. LISTS
  1303.  
  1304.           Lists start with a left bracket and end with a right bracket.
  1305.           Examples of lists include:
  1306.  
  1307.              [This is a list of words]
  1308.              [ [This is a list] [of lists] ]
  1309.  
  1310.           Within a list, the number of left and right brackets are counted.
  1311.           The end of the list occurs after the right bracket which
  1312.           corresponds to the starting left bracket.  If a line ends before
  1313.           the ending bracket, it is assumed to be present.
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.           Things Which Make Up Commands                             Page 13
  1325.  
  1326.  
  1327.           5.4. STRINGS
  1328.  
  1329.           Strings are words which start with a quote mark.  Examples of
  1330.           strings are:
  1331.  
  1332.              "frank
  1333.              "(
  1334.  
  1335.           Strings may contain characters, such as a left parenthesis, which
  1336.           would otherwise be taken as something else.  Strings can also
  1337.           contain blanks:
  1338.  
  1339.           Example:
  1340.  
  1341.              "'This is a string with blanks'
  1342.  
  1343.           The second character is an apostrophe; this means that every
  1344.           character up to the next apostrophe (or the end of the line) is a
  1345.           part of the word.
  1346.  
  1347.           Strings may not contain left ([) or right (]) brackets.
  1348.  
  1349.  
  1350.  
  1351.           5.5. ABOUT CAPITAL LETTERS
  1352.  
  1353.           In this document command names are shown in capital letters.
  1354.           LadyBug will accept either capitals or lowercase for any command
  1355.           name, file identifier, procedure, variable, or other word special
  1356.           to LadyBug.
  1357.  
  1358.  
  1359.  
  1360.           5.6. EXPRESSIONS
  1361.  
  1362.           Numbers, and variables with numbers as their values, can be
  1363.           combined into expressions.  Everyplace that LadyBug is looking
  1364.           for a number you can write an expression.  Expressions will be
  1365.           described in detail later in this manual.
  1366.  
  1367.           Examples:
  1368.  
  1369.              2 + 4
  1370.              2 +
  1371.              4 * sin :angle
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.           6. GRAPHICS COMMANDS
  1394.  
  1395.  
  1396.           This section describes the LadyBug graphics commands.  These
  1397.           commands move and turn the LadyBug, paint areas, and control
  1398.           which colors are used.
  1399.  
  1400.           If issued in text mode, they cause graphics mode to be entered.
  1401.           The text on the text screen is lost.  Exceptions are WINDOW,
  1402.           NOWINDOW, WRAP, NOWRAP, CLIP, NOCLIP, and SETSCRUNCH which do not
  1403.           cause graphics mode to be entered, and NODRAW which terminates
  1404.           graphics mode and starts up text mode.
  1405.  
  1406.  
  1407.  
  1408.           6.1. BACK LENGTH    (ABBREVIATED BK)
  1409.  
  1410.                     Takes one number as input.  Moves the LadyBug
  1411.                     backwards, that is in the opposite way from which it is
  1412.                     facing, the distance given by the number.
  1413.  
  1414.                     Examples:
  1415.  
  1416.                        back 50
  1417.                        back :a + 1
  1418.                        bk 2
  1419.  
  1420.  
  1421.  
  1422.           6.2. BACKGROUND COLOR    (ABBREVIATED BG)
  1423.  
  1424.                     Takes a number from 0 through 15 as input.  Sets the
  1425.                     color according to the following table:
  1426.  
  1427.                          0   Black           8   Gray
  1428.                          1   Blue            9   Light Blue
  1429.                          2   Green          10   Light Green
  1430.                          3   Cyan           11   Light Cyan
  1431.                          4   Red            12   Light Red
  1432.                          5   Magenta        13   Light Magenta
  1433.                          6   Brown          14   Yellow
  1434.                          7   White          15   High-intensity White
  1435.  
  1436.                     The change takes place immediately for the entire
  1437.                     screen.  Until you set a background, it is black.
  1438.  
  1439.                     Examples:
  1440.  
  1441.                        background 8
  1442.                        bg 0
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.           Graphics Commands                                         Page 15
  1457.  
  1458.  
  1459.           6.3. CLEARSCREEN    (ABBREVIATED CS)
  1460.  
  1461.                     Takes no inputs.  Clears the graphics screen but does
  1462.                     not change LadyBug's position or direction.
  1463.  
  1464.                     NOTE:  In some LOGO systems CLEARSCREEN also puts the
  1465.                     LadyBug back at the home position.  For this function,
  1466.                     see the DRAW command.
  1467.  
  1468.  
  1469.  
  1470.           6.4. CLIP
  1471.  
  1472.                     Takes no inputs.  Tells Ladybug that lines drawn by the
  1473.                     LadyBug are to be trimmed at the edge of the screen.
  1474.                     If WRAP has previously been given, it is turned off.
  1475.                     (That is, CLIP also does a NOWRAP.)  See WRAP for more
  1476.                     information.
  1477.  
  1478.                     The screen acts like a window onto a large flat sheet
  1479.                     on which the LadyBug draws.  Only that part which is
  1480.                     visible through the window is seen.
  1481.  
  1482.                     Try:
  1483.  
  1484.                        clip
  1485.                        draw
  1486.                        poly 250 170
  1487.  
  1488.  
  1489.  
  1490.           6.5. DRAW
  1491.  
  1492.                     Takes no inputs.  Exits from the text mode and enters
  1493.                     graphics mode.  Clears the graphics screen and resets
  1494.                     LadyBug to her home position and direction.  (Also see
  1495.                     the HOME command.)
  1496.  
  1497.  
  1498.  
  1499.           6.6. FORWARD LENGTH   (ABBREVIATED FD)
  1500.  
  1501.                     Takes one number as input.  Moves the LadyBug forward,
  1502.                     that is in the direction it is facing, the distance
  1503.                     given by the number.
  1504.  
  1505.                     Examples:
  1506.  
  1507.                        forward 50
  1508.                        fd 10
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.           Graphics Commands                                         Page 16
  1523.  
  1524.  
  1525.           6.7. HIDEBUG    (ABBREVIATED HB)
  1526.  
  1527.                     Takes no inputs.  Makes the LadyBug disappear from the
  1528.                     screen.  May also be written as HIDETURTLE (abbreviated
  1529.                     as HT).
  1530.  
  1531.  
  1532.  
  1533.           6.8. HIDETURTLE    (ABBREVIATED HT)
  1534.  
  1535.                     Takes no inputs.  Makes the LadyBug disappear from the
  1536.                     screen.
  1537.  
  1538.  
  1539.  
  1540.           6.9. HOME
  1541.  
  1542.                     Takes no inputs.  Moves the LadyBug to the center of
  1543.                     the screen and points her straight up.  If the pen is
  1544.                     down the LadyBug will draw as she goes home.
  1545.  
  1546.  
  1547.  
  1548.           6.10. LEFT ANGLE   (ABBREVIATED LT)
  1549.  
  1550.                     Takes one input, an angle from -360 to 360.  Rotates
  1551.                     the LadyBug that many degrees counterclockwise.
  1552.  
  1553.                     Example:
  1554.  
  1555.                        left 90
  1556.  
  1557.                     Try:
  1558.  
  1559.                        repeat 36 [left 10]
  1560.  
  1561.  
  1562.  
  1563.           6.11. NOCLIP
  1564.  
  1565.                     Takes no inputs.  Tells LadyBug that an attempt to pass
  1566.                     the edge of the screen will not cause the LadyBug's
  1567.                     path to be clipped.  See WRAP and CLIP for more
  1568.                     information.
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.           Graphics Commands                                         Page 17
  1589.  
  1590.  
  1591.           6.12. NODRAW   (ABBREVIATED ND)
  1592.  
  1593.                     Takes no inputs.  Exits from graphics mode and enters
  1594.                     text mode.  Clears the screen.  Places the cursor in
  1595.                     the upper left corner.
  1596.  
  1597.                     With two screens, the graphics screen is unchanged; the
  1598.                     text screen is enabled for output commands.  See the
  1599.                     chapter "The LadyBug Screens" on page  for more
  1600.                     information about screens.
  1601.  
  1602.  
  1603.  
  1604.           6.13. NOWRAP
  1605.  
  1606.                     Takes no inputs.  Tells Ladybug that an attempt to pass
  1607.                     the edge of the screen will not cause the LadyBug to
  1608.                     wrap around to the other side.  See WRAP and CLIP for
  1609.                     more information.
  1610.  
  1611.  
  1612.  
  1613.           6.14. NOWINDOW
  1614.  
  1615.                     Same as NOCLIP in this chapter.
  1616.  
  1617.  
  1618.  
  1619.           6.15. PAINT PAINTCOLOR BORDERCOLOR
  1620.  
  1621.                     Paint the area under and around the LadyBug with the
  1622.                     painting color.  Painting is done in each direction
  1623.                     until the border color is reached (or the edge is
  1624.                     reached).
  1625.  
  1626.                     If the border color is the same as the pen color, and
  1627.                     the pen is down, the dot under the pen acts like a
  1628.                     border and no painting occurs.  To be safe, lift the
  1629.                     pen and move forward a slight amount.
  1630.  
  1631.                     Paint colors and border colors are the same as pen
  1632.                     colors; see PENCOLOR for information.
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.           Graphics Commands                                         Page 18
  1655.  
  1656.  
  1657.           6.16. PALETTE PALETTENUMBER
  1658.  
  1659.                     Takes one input, a zero or a one.  Sets the palette
  1660.                     number.  A palette is a set of colors from which the
  1661.                     allowable pen colors and painting colors are selected.
  1662.                     There are two palettes with fixed colors.  See PENCOLOR
  1663.                     for information on the colors in each palette.
  1664.  
  1665.  
  1666.  
  1667.           6.17. PENCOLOR COLOR   (ABBREVIATED PC)
  1668.  
  1669.                     Takes one input, a number from 0 to 3.  The number is
  1670.                     the color of the lines that the LadyBug will draw.  The
  1671.                     colors are:
  1672.  
  1673.                                 --- Palette ---
  1674.                        COLOR       0       1
  1675.                          1       Green   Cyan
  1676.                          2       Red     Magenta
  1677.                          3       Brown   White
  1678.  
  1679.                     A color of zero is the same color as the background.
  1680.                     (See the BACKGROUND command.)  Until you select a
  1681.                     background, Ladybug uses a black background.
  1682.  
  1683.                     Until you select a pen color, LadyBug uses color 3.
  1684.  
  1685.                     Palettes are selected with the PALETTE command; until
  1686.                     you select a palette, Ladybug uses palette one.
  1687.  
  1688.                     Example:
  1689.  
  1690.                        pencolor 2
  1691.  
  1692.  
  1693.  
  1694.           6.18. PENDOWN   (ABBREVIATED PD)
  1695.  
  1696.                     Takes no inputs.  When the pen is down, the LadyBug
  1697.                     draws when she moves.
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.           Graphics Commands                                         Page 19
  1721.  
  1722.  
  1723.           6.19. PENUP   (ABBREVIATED PU)
  1724.  
  1725.                     Takes no inputs.  When the pen is up the LadyBug does
  1726.                     not draw when she moves.
  1727.  
  1728.                     Example:
  1729.  
  1730.                        penup
  1731.                        forward 20
  1732.                        pendown
  1733.  
  1734.  
  1735.  
  1736.           6.20. RIGHT ANGLE   (ABBREVIATED RT)
  1737.  
  1738.                     Takes one input, an angle from -360 to 360.  Rotates
  1739.                     the LadyBug that many degrees clockwise.
  1740.  
  1741.                     Example:
  1742.  
  1743.                        right 47
  1744.  
  1745.                     Try:
  1746.  
  1747.                        repeat 10 [right 10 left 10]
  1748.  
  1749.  
  1750.  
  1751.           6.21. SETHEADING ANGLE   (ABBREVIATED SETH)
  1752.  
  1753.                     Takes one input, an angle from -32000 to +32000.  THe
  1754.                     angle is taken modulo 360 so that it ranges from -360
  1755.                     to +360.  The LadyBug is rotated so that it points in
  1756.                     the direction given.  An angle of zero is straight up
  1757.                     and increasing numbers are clockwise.
  1758.  
  1759.                     Examples:
  1760.  
  1761.                        setheading 45
  1762.                        seth -90
  1763.  
  1764.  
  1765.  
  1766.           6.22. SETBG COLOR
  1767.  
  1768.                     Same as BACKGROUND in this chapter.
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.           Graphics Commands                                         Page 20
  1787.  
  1788.  
  1789.           6.23. SETPAL PALETTE
  1790.  
  1791.                     Same as PALETTE in this chapter.
  1792.  
  1793.  
  1794.  
  1795.           6.24. SETPC COLOR
  1796.  
  1797.                     Same as PENCOLOR in this chapter.
  1798.  
  1799.  
  1800.  
  1801.           6.25. SETSCRUNCH N   (ALSO: .SETSCRUNCH)
  1802.  
  1803.                     Adjust the aspect ratio of screen drawings.  Initially
  1804.                     it is 1.0 but can be set to any value from 0.1 to 10.
  1805.                     The value is used to adjust the distance actually moved
  1806.                     left-to-right relative to that requested.
  1807.  
  1808.                     For example, with a value of 1.0, a FORWARD 10 moves
  1809.                     the same distance left-and-right as up-and-down.  With
  1810.                     a value of 0.8, a FORWARD 10 would move only 8 units
  1811.                     left-or-right.
  1812.  
  1813.                     Scrunch is necessary since different displays and
  1814.                     printers do not have the same number of dots per inch
  1815.                     in each direction.
  1816.  
  1817.                     You may need to experiment with SETSCRUNCH in order to
  1818.                     find the best value for your screen and printer.  (You
  1819.                     may need to run with values which distort pictures on
  1820.                     your screen in order to have printed pictures look
  1821.                     right.)  Once you have found a value you like, you
  1822.                     might want to put it into your PROFILE.BUG file.
  1823.  
  1824.  
  1825.  
  1826.           6.26. SETX XCOORD
  1827.  
  1828.                     Takes one input, an x coordinate.  Positions the
  1829.                     LadyBug at the position, drawing a line if the pen is
  1830.                     down.
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.           Graphics Commands                                         Page 21
  1853.  
  1854.  
  1855.           6.27. SETXY XCOORD YCOORD
  1856.  
  1857.                     Takes two inputs, x and y coordinates.  Positions the
  1858.                     LadyBug at the new position, drawing a line if the pen
  1859.                     is down.
  1860.  
  1861.                     Examples:
  1862.  
  1863.                        setxy 0 0
  1864.                        setxy  ( :a + 10 )  ( :b + 1 )
  1865.  
  1866.  
  1867.  
  1868.           6.28. SETY YCOORD
  1869.  
  1870.                     Takes one input, an y coordinate.  Positions the
  1871.                     LadyBug at the position, drawing a line if the pen is
  1872.                     down.
  1873.  
  1874.                     Try:
  1875.  
  1876.                        to xy
  1877.                        setx  250 - random 500
  1878.                        sety  150 - random 300
  1879.                        xy
  1880.                        end
  1881.                        xy
  1882.  
  1883.  
  1884.  
  1885.           6.29. SHOWBUG   (ABBREVIATED SB)
  1886.  
  1887.                     Takes no inputs.  Makes the LadyBug appear on the
  1888.                     screen.  May also be written SHOWTURTLE (abbreviated
  1889.                     ST).
  1890.  
  1891.  
  1892.  
  1893.           6.30. SHOWTURTLE   (ABBREVIATED ST)
  1894.  
  1895.                     Takes no inputs.  Makes the LadyBug appear on the
  1896.                     screen.
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.           Graphics Commands                                         Page 22
  1919.  
  1920.  
  1921.           6.31. WINDOW
  1922.  
  1923.                     Same as CLIP in this chapter.
  1924.  
  1925.  
  1926.  
  1927.           6.32. WRAP
  1928.  
  1929.                     Takes no inputs.  Causes the LadyBug to "wrap around"
  1930.                     when it is moved past an edge.  For example, a path
  1931.                     that goes off the top of the screen will continue at
  1932.                     the bottom of the screen.
  1933.  
  1934.                     This is the default condition.  The NOWRAP, CLIP, and
  1935.                     NOCLIP statements also affect what happens when the
  1936.                     LadyBug tries to go off of the edge.
  1937.  
  1938.                     Try:
  1939.  
  1940.                        wrap
  1941.                        draw
  1942.                        poly 200 170
  1943.  
  1944.                     If neither WRAP nor CLIP is in effect, the LadyBug
  1945.                     bumps into the edge of the screen.  Drawings will be
  1946.                     distorted.
  1947.  
  1948.                     Try:
  1949.  
  1950.                        nowrap
  1951.                        noclip
  1952.                        draw
  1953.                        penup fd 100 pendown
  1954.                        poly 150 170
  1955.  
  1956.                     Wrap is slowest, clip the next fastest, and nowrap with
  1957.                     noclip is faster still.  The performance effects are
  1958.                     not major but are measurable.
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.           7. SOUNDS
  1988.  
  1989.  
  1990.           This section describes Ladybug commands for making sounds with
  1991.           the PC speaker.
  1992.  
  1993.  
  1994.  
  1995.           7.1. BEEP
  1996.  
  1997.                     Play one short note on the speaker.
  1998.  
  1999.  
  2000.  
  2001.           7.2. PLAY STRING
  2002.  
  2003.                     Takes one input, a string.  Play a series of notes on
  2004.                     the speaker.
  2005.  
  2006.                     This sections describes only a part of the PLAY
  2007.                     command.  The appendix "The Play Command" on page 60
  2008.                     describes PLAY completely.
  2009.  
  2010.                     The PLAY statement is the word "PLAY" followed by a
  2011.                     string which contains special music commands.  These
  2012.                     commands define notes to play, or tell PLAY how to play
  2013.                     the notes.
  2014.  
  2015.                     Note: Spaces and capitalization in the PLAY statement
  2016.                     are optional.
  2017.  
  2018.  
  2019.                     A TO G WITH OPTIONAL '#', '+', OR '-'
  2020.  
  2021.                     Play the note given.  Append a # or + if the note is a
  2022.                     sharp or a - if it is a flat.
  2023.  
  2024.  
  2025.                     L N
  2026.  
  2027.                     Set the default length of all notes which follow.  For
  2028.                     example, L1 means that all notes are whole notes, L2
  2029.                     means half notes, and L4 means quarter notes.  The
  2030.                     default is L4.
  2031.  
  2032.  
  2033.                     O N
  2034.  
  2035.                     Set octave n as the current octave.  All notes given as
  2036.                     letters are in this octave.  The default octave is 4.
  2037.                     The value of n may be 0 through 7.
  2038.  
  2039.                     An octave has the notes C, D, E, F, G, H, A and B in
  2040.                     it, in that order.  The octave does NOT start with the
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.           Sounds                                                    Page 24
  2051.  
  2052.  
  2053.                     note A.
  2054.                     P N
  2055.  
  2056.                     Pause for n time units.  The meaning of the value of n
  2057.                     is the same as in the L command.  The value of n may
  2058.                     range from 1 to 64.
  2059.  
  2060.                     Examples:
  2061.  
  2062.                        play "ggga"
  2063.                        play "l4abcde"
  2064.                        play "L4 abc L8 abc"
  2065.  
  2066.                     Try:
  2067.  
  2068.                        load "ludwig
  2069.                        ludwig
  2070.  
  2071.  
  2072.  
  2073.           7.3. TONE FREQUENCY N
  2074.  
  2075.                     Takes two inputs, a frequency and a time.  Produces a
  2076.                     sound with the given frequency and for "n" clock ticks.
  2077.                     The clock ticks 18.2 times per second.
  2078.  
  2079.                     Examples:
  2080.  
  2081.                        tone 2000 20
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.           8. INPUT AND OUTPUT
  2120.  
  2121.  
  2122.           This chapter describes statements which read or write data, which
  2123.           control the text screen, or which sense what is happening with a
  2124.           keyboard or joystick.  These commands are value in both graphics
  2125.           mode and text mode unless noted otherwise.
  2126.  
  2127.  
  2128.  
  2129.           8.1. CLEARTEXT   (ABBREVIATED CT)
  2130.  
  2131.                     Takes no inputs.  Clears the text screen.  Moves the
  2132.                     cursor to the top left corner.  Exits from graphics
  2133.                     mode and enters text mode.
  2134.  
  2135.  
  2136.  
  2137.           8.2. CLEARINPUT
  2138.  
  2139.                     Takes no inputs.  Clears the input buffer of text typed
  2140.                     but not yet read.
  2141.  
  2142.  
  2143.  
  2144.           8.3. CURSOR COLUMN ROW
  2145.  
  2146.                     Takes two inputs which are a column and row position.
  2147.                     The cursor is positioned at that place on the text
  2148.                     screen.  The allowed values of the numbers depend upon
  2149.                     which screen size is in use.  The column may be 1-40
  2150.                     (or 1-80 depending upon the number of text columns) and
  2151.                     the row may be 1-25.  The cursor command is valid only
  2152.                     in text mode.
  2153.  
  2154.                     Example:
  2155.  
  2156.                        cursor 20 1
  2157.  
  2158.  
  2159.  
  2160.           8.4. PRINT WORD   (ABBREVIATED PR)
  2161.  
  2162.                     Takes one input which it prints on the current output
  2163.                     device.  Moves the cursor to the next line.
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.           Input and Output                                          Page 26
  2183.  
  2184.  
  2185.           8.5. PRINT1 WORD   (ABBREVIATED PR1)
  2186.  
  2187.                     Takes one input which it prints on the current output
  2188.                     device.  Leaves the cursor on the same line.
  2189.                     Equivalent to TYPE in this chapter.
  2190.  
  2191.  
  2192.  
  2193.           8.6. TYPE WORD
  2194.  
  2195.                     Takes one input which it prints on the current output
  2196.                     device.  Leaves the cursor on the same line.
  2197.                     Equivalent to PRINT1 in this chapter.
  2198.  
  2199.  
  2200.  
  2201.           8.7. SETWIDTH COLUMNS
  2202.  
  2203.                     Same as TEXTCOLUMNS in this chapter.
  2204.  
  2205.  
  2206.  
  2207.           8.8. TEXTCOLUMNS COLUMNS   (ABBREVIATED TCOLS)
  2208.  
  2209.                     Takes one input, either the number 40 or the number 80.
  2210.                     Sets the screen width for text mode on the graphics
  2211.                     monitor.  If the text screen is on the Monochrome
  2212.                     display it always has a width of 80.  The command is
  2213.                     value anytime but it takes effect only when in text
  2214.                     mode and when text mode is displayed on the graphics
  2215.                     device.  On the Monochrome display, text mode always
  2216.                     has 80 columns.
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.           9. CONTROL COMMANDS
  2252.  
  2253.  
  2254.           This chapter describes commands which are used to define
  2255.           variables and procedures.
  2256.  
  2257.  
  2258.  
  2259.           9.1. EDIT PROCNAME ...   (ABBREVIATED ED)
  2260.  
  2261.                     Takes a variable number of inputs.  Enters the full
  2262.                     screen editor to edit the procedures.  The chapter
  2263.                     "Introduction to the LadyBug Editor" on page 51
  2264.                     describes this command and how to use the editor.
  2265.  
  2266.                     Examples:
  2267.  
  2268.                        edit poly
  2269.                        ed poly polyspi square
  2270.  
  2271.  
  2272.  
  2273.           9.2. EDIT ALL
  2274.  
  2275.                     Edit all procedures at one time.
  2276.  
  2277.  
  2278.  
  2279.           9.3. END
  2280.  
  2281.                     In the full screen editor, END marks the end of a
  2282.                     procedure which is entered from the editor.  It may be
  2283.                     omitted from the last procedure but must be present if
  2284.                     there is more than one procedure in the editors space.
  2285.  
  2286.                     See also the TO command.
  2287.  
  2288.  
  2289.  
  2290.           9.4. ERROR MESSAGE
  2291.  
  2292.                     Takes one input, a string.  Issues an error message
  2293.                     with the string as the text and then terminates the
  2294.                     currently active procedure set.  (See the chapter
  2295.                     "Running and Debugging Procedures" on page 39.)
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.           Control Commands                                          Page 28
  2315.  
  2316.  
  2317.           9.5. FOREVER LIST
  2318.  
  2319.                     See chapter "The Workspace Named 'TOOLS'".  on page 49.
  2320.  
  2321.  
  2322.  
  2323.           9.6. GOODBYE   (ABBREVIATED BYE)
  2324.  
  2325.                     Exit to DOS from LadyBug.
  2326.  
  2327.  
  2328.  
  2329.           9.7. IF CONDITION THEN ACTION
  2330.  
  2331.                     Test the condition.  If it is "true", then perform the
  2332.                     action.  The action consists of all of the words
  2333.                     remaining on the line.
  2334.  
  2335.                     The condition is a word or expression which returns
  2336.                     "true" or "false".
  2337.  
  2338.                     The action is one or more LadyBug commands excepting an
  2339.                     IF command with an ELSE clause.
  2340.  
  2341.                     Example:
  2342.  
  2343.                        if :x > 0 then fd 100
  2344.  
  2345.                        if :ready then fd 50 rt 45 fd 100 rt 45 fd 50
  2346.  
  2347.                     Also see the TEST command.
  2348.  
  2349.  
  2350.  
  2351.           9.8. IF CONDITION [ACTION]
  2352.  
  2353.                     Test the condition.  If it is "true", then perform the
  2354.                     action (which is a list).  The action consists of the
  2355.                     words in the list.
  2356.  
  2357.                     The condition is a word or expression which returns
  2358.                     "true" or "false".
  2359.  
  2360.                     The action is one or more LadyBug commands including
  2361.                     other IF commands.
  2362.  
  2363.                     Examples:
  2364.  
  2365.                        if :x > 0 [fd 100]
  2366.  
  2367.                        if :ready [fd 50  rt 45  fd 100  rt 45  fd 50]
  2368.  
  2369.                        make "alist [fd 10  rt 90  fd 90 rt 10]
  2370.                        if :a > :b  :alist
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.           Control Commands                                          Page 29
  2381.  
  2382.  
  2383.                     Also see the TEST command.
  2384.  
  2385.  
  2386.  
  2387.           9.9. IF CONDITION THEN ACTION1 ELSE ACTION2
  2388.  
  2389.                     Test the condition.  If the result is "true", then
  2390.                     perform action1; if it is "false", then perform
  2391.                     action2.  Action1 consists of the words between the
  2392.                     THEN and the ELSE.  Action2 consists of the words
  2393.                     following the ELSE.  Neither action can be an IF/THEN
  2394.                     or an IF/THEN/ELSE command.
  2395.  
  2396.                     The condition is a word or expression which returns
  2397.                     "true" or "false".
  2398.  
  2399.                     The actions are one or more LadyBug commands.
  2400.  
  2401.                     Example:
  2402.  
  2403.                        if :x > 0 then fd 100 else fd 50
  2404.  
  2405.                        if :ready then fd 50 rt 45 else bk 20 lt 10
  2406.  
  2407.                     Also see the TEST command.
  2408.  
  2409.  
  2410.  
  2411.           9.10. IF CONDITION [ACTION1] [ACTION2]
  2412.  
  2413.                     Test the condition.  If it is "true", then perform
  2414.                     action1; if it is "false", then perform action2.  The
  2415.                     actions consist of the words in the lists.  The actions
  2416.                     can contain other IF commands.
  2417.  
  2418.                     The condition is a word or expression which returns
  2419.                     "true" or "false".
  2420.  
  2421.                     The actions are one or more LadyBug commands.
  2422.  
  2423.                     Example:
  2424.  
  2425.                        if :x > 0  [fd 100]  [fd 50]
  2426.  
  2427.                        if :ready  [fd 50 rt 45]  [bk 20 lt 10]
  2428.  
  2429.                     Also see the TEST command.
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.           Control Commands                                          Page 30
  2447.  
  2448.  
  2449.           9.11. IFFALSE LIST
  2450.  
  2451.                     Takes one input, a list.  Tests the condition set by
  2452.                     the most recently executed TEST command.  If it was
  2453.                     "false" then the list is executed.
  2454.  
  2455.                     Example:
  2456.  
  2457.                        test :a > 7
  2458.                        iffalse [fd 5 rt 5]
  2459.  
  2460.  
  2461.  
  2462.           9.12. IFTRUE LIST
  2463.  
  2464.                     Takes one input, a list.  Tests the condition set by
  2465.                     the most recently executed TEST command.  If it was
  2466.                     "true" then the list is executed.
  2467.  
  2468.                     Example:
  2469.  
  2470.                        test :a > 7
  2471.                        iftrue [fd 5]
  2472.  
  2473.  
  2474.  
  2475.           9.13. LOCAL VARIABLENAME
  2476.  
  2477.                     Defines a variable as being local to the current
  2478.                     procedure.  It is available to any procedures which are
  2479.                     called from the procedure in which it is defined unless
  2480.                     they too make the name local or have an input variable
  2481.                     with the same name.
  2482.  
  2483.                     The variable has a null (empty) value until some value
  2484.                     is assigned with the MAKE command.  See the MAKE
  2485.                     command for more information about how LadyBug searches
  2486.                     for variables.
  2487.  
  2488.                     The LOCAL command should always be used in procedures
  2489.                     which use variables for 'personal' reasons, such as
  2490.                     temporarily holding the results of some calculation.
  2491.  
  2492.                     Example:
  2493.  
  2494.                        local "saveit
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.           Control Commands                                          Page 31
  2513.  
  2514.  
  2515.                     A longer example:
  2516.                        to a
  2517.                        make "fred 1     <--- sets variable 'fred' to 1
  2518.                        print :fred      <--- prints the value '1'
  2519.                        b                <--- calls procedure 'b'
  2520.                        print :fred      <--- prints the value '2'
  2521.                        end
  2522.  
  2523.                        to b
  2524.                        make "fred 2     <--- sets same 'fred' as in 'a'
  2525.                        local "fred      <--- makes a new local 'fred'
  2526.                        make "fred 3     <--- sets the new 'fred' to 3
  2527.                        print :fred      <--- prints the value '3'
  2528.                        c                <--- call procedure 'c'
  2529.                        end              <--- returns to procedure 'a'
  2530.  
  2531.                        to c
  2532.                        print :fred      <--- prints the value '3'
  2533.                        end
  2534.  
  2535.                     If "a" is invoked, the four values printed are 1, 3, 3,
  2536.                     and 2 in that order.  After "a" is through, the
  2537.                     variable "fred" still has the value 2.
  2538.  
  2539.  
  2540.  
  2541.           9.14. MAKE "VARIABLENAME VALUE
  2542.  
  2543.                     Takes two inputs, a word which will be a variable name,
  2544.                     and a value.  The value may be an expression, a list,
  2545.                     or a string.  MAKE assigns the value to a variable with
  2546.                     the name given.  The value may be referenced by using
  2547.                     the variable name with a colon on the front.
  2548.  
  2549.                     If there already is a variable with the name given, the
  2550.                     value replaces its current value.  If there is not
  2551.                     already such a variable, one is created and given the
  2552.                     value.
  2553.  
  2554.                     Examples:
  2555.  
  2556.                        make "a 7
  2557.                        make "b 3 * :a
  2558.                        make "c ( :a / :b ) + 2
  2559.  
  2560.                     NOTE:  At any time that LadyBug is looking for a
  2561.                     variable, the variables created by the current
  2562.                     procedure are examined first.  If one with the needed
  2563.                     name is not found, LadyBug then looks at variables
  2564.                     created by the procedure which called the current one.
  2565.                     If it has such a variable, it is used.  If not, then
  2566.                     variables in the procedure that called that one are
  2567.                     examined, etc.  Finally, variables which are not a part
  2568.                     of any procedure but which are a part of the workspace
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.           Control Commands                                          Page 32
  2579.  
  2580.  
  2581.                     are examined.  If no variable is found, then MAKE makes
  2582.                     a new variable.  It is local to the current procedure
  2583.                     if one is active.
  2584.  
  2585.                     New variables created by MAKE are global.  That is,
  2586.                     they will still exist after all active procedures
  2587.                     terminate and will be saved when the workspace is
  2588.                     saved.
  2589.  
  2590.                     See the LOCAL command for information about another way
  2591.                     to create variables and for information about the scope
  2592.                     of variables in procedures which call one another.
  2593.  
  2594.  
  2595.  
  2596.           9.15. OUTPUT VALUE   (ABBREVIATED OP)
  2597.  
  2598.                     Takes one input.  Causes the current procedure to stop.
  2599.                     The value is output to the calling procedure.
  2600.  
  2601.                     Examples:
  2602.  
  2603.                        output 2
  2604.                        output ( :a + 4 ) / 3
  2605.                        op [2 3 4]
  2606.  
  2607.  
  2608.  
  2609.           9.16. RANDOMIZE NUMBER
  2610.  
  2611.                     Takes one input, an integer.  Sets the seed of the
  2612.                     random number generator to this value.  Each time the
  2613.                     same seed is used, calls to RANDOM will return the same
  2614.                     sequence of random numbers.
  2615.  
  2616.                     Examples:
  2617.  
  2618.                        randomize 2127
  2619.                        randomize :seed + 1173
  2620.  
  2621.  
  2622.  
  2623.           9.17. REPEAT NUMBER LIST
  2624.  
  2625.                     Takes two inputs, a number and a list.  RUNs the list
  2626.                     as many times as the number indicates.
  2627.  
  2628.                     Examples:
  2629.  
  2630.                        repeat 4 [forward 100 right 90]
  2631.                        repeat :n :alist
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.           Control Commands                                          Page 33
  2645.  
  2646.  
  2647.           9.18. RUN LIST
  2648.  
  2649.                     Takes one input, a list.  Executes the list as if the
  2650.                     body were typed as a command line.
  2651.  
  2652.                     Example:
  2653.  
  2654.                        run [fd 10  rt 5]
  2655.  
  2656.                     Example:
  2657.  
  2658.                        make  "b  [fd 10  rt 5]
  2659.                        run  :b
  2660.  
  2661.  
  2662.  
  2663.           9.19. STOP
  2664.  
  2665.                     Takes no inputs.  Causes the current procedure to stop
  2666.                     and return control to the procedure which called it, if
  2667.                     any, else or to the command prompt.  No value is
  2668.                     output.
  2669.  
  2670.  
  2671.  
  2672.           9.20. TEST CONDITION
  2673.  
  2674.                     Takes one input, a condition.  The condition is a word
  2675.                     or expression which returns "true" or "false".  The
  2676.                     condition is evaluated and the result is remembered; it
  2677.                     can be tested by the IFTRUE and IFFALSE commands.
  2678.  
  2679.  
  2680.  
  2681.           9.21. TOPLEVEL
  2682.  
  2683.                     Takes no inputs.  Stops all active commands, procedures
  2684.                     and PAUSEs.  Returns to the command prompt.
  2685.  
  2686.  
  2687.  
  2688.           9.22. WAIT TIME
  2689.  
  2690.                     See chapter "Workspaces With Tools".  on page 49.
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.           Control Commands                                          Page 34
  2711.  
  2712.  
  2713.           9.23. WHILE CONDITION LIST
  2714.  
  2715.                     See chapter "Workspaces With Tools" on page 49.
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.           10. MANAGING THE WORKSPACE
  2780.  
  2781.  
  2782.           This chapter describes statements which are used to control and
  2783.           manage the workspace.
  2784.  
  2785.  
  2786.  
  2787.           10.1. CATALOG   (ABBREVIATED CAT)
  2788.  
  2789.                     Takes no inputs.  Prints the names of files contained
  2790.                     on the current disk.  The current screen is cleared and
  2791.                     the catalog is displayed as if in text mode.
  2792.  
  2793.  
  2794.  
  2795.           10.2. CLEARWS
  2796.  
  2797.                     Takes no inputs.  Clears all variables and procedures
  2798.                     from the workspace.
  2799.  
  2800.  
  2801.  
  2802.           10.3. DEFINE "NAME LIST
  2803.  
  2804.                     Takes two inputs which define a procedure.  The first
  2805.                     is the name of the procedure and the second is the body
  2806.                     of the procedure.  If a procedure already exists with
  2807.                     the name given, the old one is deleted.
  2808.  
  2809.                     The body of the procedure is a list of lists.  Each
  2810.                     sublist is one line of the procedure.  The first
  2811.                     sublist contains the names of the inputs to the
  2812.                     procedure.
  2813.  
  2814.                     Example:
  2815.  
  2816.                        to tri :s
  2817.                           repeat 3 [fd :s rt 120]
  2818.                        end
  2819.  
  2820.                        can be defined as:
  2821.  
  2822.                        define "tri [[:s][repeat 3 [fd :s rt 120]]]
  2823.  
  2824.                     If there are no inputs then the first sublist is empty:
  2825.  
  2826.                     Example:
  2827.  
  2828.                        to circ
  2829.                        fd 10
  2830.                        rt 10
  2831.                        circ
  2832.                        end
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.           Managing the Workspace                                    Page 36
  2843.  
  2844.  
  2845.                     can be defined as:
  2846.  
  2847.                        define "circ [[][fd 10][rt 10][circ]]
  2848.  
  2849.  
  2850.  
  2851.           10.4. EDIT PROCNAME ...
  2852.  
  2853.                     Takes a variable number of inputs.  Enters the full
  2854.                     screen editor to edit the procedures.  The chapter
  2855.                     "Introduction to the LadyBug Editor" on page 51
  2856.                     describes this command and how to use the editor.
  2857.  
  2858.                     Examples:
  2859.  
  2860.                        edit poly
  2861.                        ed poly polyspi square
  2862.  
  2863.  
  2864.  
  2865.           10.5. EDIT ALL
  2866.  
  2867.                     Edit all procedures at one time.
  2868.  
  2869.  
  2870.  
  2871.           10.6. ERASE PROCEDURENAME
  2872.  
  2873.                     Delete the procedure named.
  2874.  
  2875.                     Example:
  2876.  
  2877.                        erase "poly
  2878.  
  2879.                     NOTE:  ERASE can be used to delete a procedure from
  2880.                     within itself without disturbing the execution of the
  2881.                     procedure.
  2882.  
  2883.  
  2884.  
  2885.           10.7. ERASE ALL
  2886.  
  2887.                     Delete all procedures.
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.           Managing the Workspace                                    Page 37
  2909.  
  2910.  
  2911.           10.8. ERASEFILE FILENAME
  2912.  
  2913.                     Erase the disk file named.
  2914.  
  2915.                     Example:
  2916.  
  2917.                        erasefile "b:brough.bug
  2918.  
  2919.  
  2920.  
  2921.           10.9. ERNAME VARIABLENAME
  2922.  
  2923.                     Delete the variable named.
  2924.  
  2925.                     Example:
  2926.  
  2927.                        ername "bart
  2928.  
  2929.  
  2930.  
  2931.           10.10. ERNAME ALL
  2932.  
  2933.                     Delete all variables.
  2934.  
  2935.  
  2936.  
  2937.           10.11. LOAD FILENAME
  2938.  
  2939.                     Same as READ in this chapter.
  2940.  
  2941.  
  2942.  
  2943.           10.12. PRINTOUT NAME   (ABBREVIATED PO)
  2944.  
  2945.                     Print the value of the variable and/or definition of
  2946.                     the procedure with the name given.
  2947.  
  2948.                     Example:
  2949.  
  2950.                        printout "elephant
  2951.  
  2952.  
  2953.  
  2954.           10.13. READ FILENAME
  2955.  
  2956.                     Load the named workspace and add its variables and
  2957.                     procedures to the workspace.  If no file extension is
  2958.                     given, .BUG is used.
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.           Managing the Workspace                                    Page 38
  2975.  
  2976.  
  2977.                     Examples:
  2978.                        read "polyspi
  2979.                        read "b:circ.lgo
  2980.  
  2981.                     See the chapter "Hints on Using LadyBug" on page 54 for
  2982.                     more information about uses of READ.
  2983.  
  2984.  
  2985.  
  2986.           10.14. SAVE FILENAME
  2987.  
  2988.                     Save the current workspace in the file named.  If no
  2989.                     file extension is given, the default of .BUG is used.
  2990.  
  2991.                     Example:
  2992.  
  2993.                        save "bobby
  2994.                        save "b:whoops.2
  2995.  
  2996.                     The appendix "Format and Contents of Saved Workspaces"
  2997.                     on page  describes the format of the workspace as it is
  2998.                     saved on disk.
  2999.  
  3000.  
  3001.  
  3002.           10.15. TO PROCNAME INPUTS...
  3003.  
  3004.                     Takes one or more inputs.  The first is the name of a
  3005.                     procedure which is to be defined.  If a procedure with
  3006.                     the same name already exists the old definition is
  3007.                     deleted.
  3008.  
  3009.                     The remaining inputs are the names of inputs to the new
  3010.                     procedure.
  3011.  
  3012.                     All lines read after the TO command become lines in the
  3013.                     new procedure.  A line containing the word END alone,
  3014.                     ends the definition of the new procedure.
  3015.  
  3016.                     Example:
  3017.  
  3018.                        to poly :dist :angle
  3019.                        fd :dist
  3020.                        rt :angle
  3021.                        poly :dist :ang
  3022.                        end
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.           11. RUNNING AND DEBUGGING PROCEDURES
  3044.  
  3045.  
  3046.           This chapter describes how to run procedures and describes some
  3047.           commands which help debug them.
  3048.  
  3049.  
  3050.  
  3051.           11.1. RUNNING PROCEDURES
  3052.  
  3053.           Procedures are groups of commands which are saved under a name
  3054.           for later execution.  Procedures are created with the LadyBug
  3055.           editor, with the TO command, or with the DEFINE command.
  3056.  
  3057.           A procedure is run by giving its name instead of the name of a
  3058.           command.
  3059.  
  3060.           Example:
  3061.  
  3062.              to moveup
  3063.              forward 20
  3064.              end
  3065.  
  3066.           This defines a procedure named MOVEUP.  The procedure can be run
  3067.           by typing its name, MOVEUP.  In effect, procedures are new
  3068.           commands and the term "command" often is used to refer to
  3069.           procedures as well as predefined, or builtin, commands.
  3070.  
  3071.           Procedures can invoke, or call, other procedures.  When several
  3072.           procedures are active at one time, the group is often called a
  3073.           "nest" of procedures or a "nested group" or procedures.
  3074.  
  3075.  
  3076.  
  3077.           11.2. PAUSING PROCEDURES
  3078.  
  3079.           Procedures, as well as commands like REPEAT which have a list of
  3080.           other commands in them, can be temporarily stopped with the pause
  3081.           key, F5, or with a PAUSE command imbedded in them.
  3082.  
  3083.           When a procedure has been paused, LadyBug accepts commands and
  3084.           will execute any command.  It indicates that some other command
  3085.           has been paused by printing the word "pause" instead of a
  3086.           question mark for a command prompt.
  3087.  
  3088.           It is possible to run other procedures while a procedure is
  3089.           paused.  The new procedure or procedure nest can itself be
  3090.           paused.  Then yet another procedure can be run, and that one
  3091.           paused, and so on subject only to the restriction of 40 active
  3092.           procedures, repeat commands, pauses, loads, and active expression
  3093.           evaluations at one time.
  3094.  
  3095.           The group or nest of procedures that is suspended by a PAUSE or
  3096.           by F5 is called a "Procedure set".  The F1 key terminates only
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.           Running and Debugging Procedures                          Page 40
  3107.  
  3108.  
  3109.           the currently active procedure set.  Thus, if you use F1 to
  3110.           terminate a procedure run while another is paused, only it will
  3111.           be terminated.  The TOPLEVEL command terminates all procedure
  3112.           sets.
  3113.  
  3114.  
  3115.  
  3116.           11.3. EDITING ACTIVE PROCEDURES
  3117.  
  3118.           It is possible to edit a procedure which is active.  Either the
  3119.           EDIT command can be in a procedure or the EDIT command can be
  3120.           given after the running procedure has been paused.
  3121.  
  3122.           However, the changes made to the procedure do not affect any
  3123.           currently active execution of that procedure.
  3124.  
  3125.  
  3126.  
  3127.           11.4. CONTINUE    (ABBREVIATED CO)
  3128.  
  3129.                     The continue command resumes execution of a paused
  3130.                     procedure set.
  3131.  
  3132.  
  3133.  
  3134.           11.5. NOTRACE
  3135.  
  3136.                     Turn off tracing.
  3137.  
  3138.  
  3139.  
  3140.           11.6. PAUSE
  3141.  
  3142.                     Pause the current nest of procedures.
  3143.  
  3144.  
  3145.  
  3146.           11.7. TOPLEVEL
  3147.  
  3148.                     Terminate all active procedures in all active procedure
  3149.                     sets, and all active commands.  Return to the top level
  3150.                     command prompt.
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.           Running and Debugging Procedures                          Page 41
  3173.  
  3174.  
  3175.           11.8. TRACE
  3176.  
  3177.                     Turn on tracing.  When trace is on, each command that
  3178.                     is executed from any source, procedure or command
  3179.                     prompt, is shown and LadyBug pauses for a key to be
  3180.                     pressed.
  3181.  
  3182.                     F9 also turns on and off tracing.
  3183.  
  3184.  
  3185.  
  3186.           11.9. ;  (COMMENT)
  3187.  
  3188.                     Any line which starts with a semicolon is a comment
  3189.                     line.  The contents of the line are ignored.
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.           12. NUMBERS AND COMPUTATIONS
  3242.  
  3243.  
  3244.           This section describes numbers and how to compute with them.
  3245.  
  3246.  
  3247.  
  3248.           12.1. VALUES
  3249.  
  3250.           Numeric values come in two types, integer, and floating point.
  3251.  
  3252.           Integer numbers have only whole number values.  These values must
  3253.           be in the range of -32768 to 32767.
  3254.  
  3255.           Floating point numbers have whole number and fractional values
  3256.           and an optional exponent.  Their value in the computer may range
  3257.           from 2.9x10**(-39) to 1.7x10**38 (where the 10**(-39) means
  3258.           "times ten to the -39 power" and 10**38 means "times ten to the
  3259.           38th power".)  When you enter the numbers into the computer, they
  3260.           must have one of the forms, for example:
  3261.  
  3262.               1.   .2   1.2   1E2   1.E2   .2E2   1.2E2   1.2E-2   1.2e2
  3263.  
  3264.           Each may also have a sign.  The "e" or "E" separates the number
  3265.           from its power of ten.
  3266.  
  3267.  
  3268.           12.1.1. NUMERIC VALUES
  3269.  
  3270.           Several words in Ladybug have values.  None of the following take
  3271.           any inputs:
  3272.  
  3273.           BACKGROUND   (Abbreviated BG)
  3274.               The background color.
  3275.  
  3276.           HEADING
  3277.               The angle that the LadyBug is currently facing.  The value
  3278.               ranges from -359 to 359.
  3279.  
  3280.           PALETTE
  3281.               The palette number.
  3282.  
  3283.           PENCOLOR  (Abbreviated PC)
  3284.               The color of the pen.
  3285.  
  3286.           SCRUNCH
  3287.               The value of the aspect ratio asjustment.  See the SETSCRUNCH
  3288.               command.
  3289.  
  3290.           XCOR
  3291.               The current x coordinate of the LadyBug.
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.           Numbers and Computations                                  Page 43
  3305.  
  3306.  
  3307.           YCOR
  3308.               The current y coordinate of the LadyBug.
  3309.  
  3310.  
  3311.           12.1.2. MATHEMATICAL VALUES
  3312.  
  3313.           These Ladybug words take one value (an expression) and return a
  3314.           number.
  3315.  
  3316.           ABS number
  3317.               Returns the absolute value of the number.
  3318.  
  3319.           ARCTAN tangent
  3320.               Returns the angle which has the tangent given.
  3321.  
  3322.           COS angle
  3323.               Returns the cosine of the angle in degrees.
  3324.  
  3325.           EXP power
  3326.               Returns the mathematical quantity 'e' raised to the power
  3327.               given.
  3328.  
  3329.           INTEGER number
  3330.               Returns the integer which is equal to or just smaller than
  3331.               the number given.  If the number is negative the result is
  3332.               smaller when it is "further away" from zero.
  3333.  
  3334.           LOG number
  3335.               Returns the logarithm of the number taken to base 10.
  3336.  
  3337.           RANDOM range
  3338.               Returns a random number in the range 0 to 'range'.  (See the
  3339.               RANDOMIZE statement for more information.)
  3340.  
  3341.           SIGN number
  3342.               Returns +1 if number is positive, 0 if number is zero, and -1
  3343.               if number if negative.
  3344.  
  3345.           SIN angle
  3346.               Returns the sine of the angle in degrees.
  3347.  
  3348.           SQRT number
  3349.               Returns the square root of the number.
  3350.  
  3351.           TAN angle
  3352.               Returns the tangent of the angle in degrees.
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.           Numbers and Computations                                  Page 44
  3371.  
  3372.  
  3373.           Examples:
  3374.              GIVEN                 PRINTS
  3375.              print abs -7          7
  3376.              print integer 7.7     7
  3377.              print integer -3.3    -4
  3378.              print log 100         10
  3379.              print random 10       2.32    (example result)
  3380.              print sign 4          1
  3381.              print sign -4         -1
  3382.              print sqrt 4          2
  3383.  
  3384.  
  3385.  
  3386.           12.2. GRAPHICS WORDS
  3387.  
  3388.           The following words return values.  Some take one input.
  3389.  
  3390.           STICK n    (or PADDLE n)
  3391.               Takes a number from 0 to 3 which corresponds to one of four
  3392.               joysticks and returns a number from 0 to 255 which represents
  3393.               it's setting.  The range of values will depend upon the
  3394.               particular joystick used.
  3395.  
  3396.           STICKBUTTON n    (or PADDLEBUTTON n)
  3397.               Takes a number from 0 to 3 which corresponds to one of four
  3398.               joysticks and returns TRUE or FALSE depending upon whether or
  3399.               not the button on the particular joystick has been pressed
  3400.               since the last time PADDLEBUTTON was used.
  3401.  
  3402.           RC?  or  KEYP
  3403.               Takes no inputs.  Outputs TRUE if a keyboard character is
  3404.               pending, that is, if the character input buffer is not empty.
  3405.               Otherwise it outputs FALSE.
  3406.  
  3407.           READCHARACTER   (Abbreviated READCHAR or RC)
  3408.               Takes no inputs.  Outputs the least recent character in the
  3409.               character buffer, or waits for a character if the buffer is
  3410.               empty.
  3411.  
  3412.           REQUEST   (Abbreviated RQ)
  3413.               Takes no inputs.  Waits for an input line to be typed and
  3414.               outputs the line.  The line is terminated by pressing the
  3415.               enter key.  Until the enter key is pressed, the backspace key
  3416.               will move back over and delete characters that have been
  3417.               typed in response to REQUEST, the back arrow key will move
  3418.               back over and allow insertions and deletions with the Ins and
  3419.               Del keys, and the ESC key will delete everyting typed so far.
  3420.  
  3421.           PENUP?  and  PENDOWN?
  3422.               Neither takes an input.  Both return either "true" or "false"
  3423.               depending upon whether the pen is up or down.
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.           Numbers and Computations                                  Page 45
  3437.  
  3438.  
  3439.           SHOWING?  and  HIDDEN?
  3440.               Neither takes an input.  Both return either "true" or "false"
  3441.               depending upon whether the LadyBug is showing or hidden.
  3442.  
  3443.  
  3444.  
  3445.           12.3. OTHER WORDS
  3446.  
  3447.           NUMBER? word
  3448.               Takes one input.  Returns "true" if the word represents a
  3449.               number and "false" if it does not.
  3450.  
  3451.           RUN list/word/string
  3452.               Takes one input, a list, string, or word.  RUNs the input and
  3453.               returns it's output.
  3454.  
  3455.               Example:
  3456.  
  3457.                  make "x [2 + 3]
  3458.                  print run :x
  3459.  
  3460.               The example prints the number "5".
  3461.  
  3462.           WORD word1 word2
  3463.               Takes two inputs and combines them into one word.
  3464.  
  3465.               Example:
  3466.  
  3467.                  make "x word "a "b
  3468.  
  3469.               The variable x is set to "ab".
  3470.  
  3471.           SENTENCE word/list word/list    (Abbreviated SE)
  3472.               Takes two inputs, words or lists.  Forms a list of the words
  3473.               or the components of the lists, and returns the new list.
  3474.  
  3475.               Examples:
  3476.  
  3477.                  make "x sentence [a b] [c d]
  3478.                  make "x sentence joe [frank bob]
  3479.  
  3480.           THING word
  3481.               Takes one input, a word which is the name of a variable.
  3482.               Returns the value of that variable.  The following are
  3483.               exactly equivalent:
  3484.  
  3485.               Example:
  3486.  
  3487.                  :elephant
  3488.                  thing "elephant
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.           Numbers and Computations                                  Page 46
  3503.  
  3504.  
  3505.           CHAR expression
  3506.               Takes one input, a number from 0 to 255.  Returns the ASCII
  3507.               character which corresponds to that number.
  3508.  
  3509.           ASC string
  3510.               Takes one input, a string or word.  Returns a number from 0
  3511.               to 255 which is the ASCII code for the first character of the
  3512.               string or word.
  3513.  
  3514.  
  3515.  
  3516.           12.4. EXPRESSIONS RESULTING IN NUMBERS
  3517.  
  3518.           Numbers can be combined into expressions.  Expressions are
  3519.           evaluated from left to right with no operator hierarchy.
  3520.           Parentheses may be used to group operations which should be
  3521.           performed first.
  3522.  
  3523.           Expressions are taken, word by word, with only blanks separating
  3524.           words.  Operators, numbers, and parentheses must be separated by
  3525.           blanks to be properly recognized.  For example, this is invalid:
  3526.  
  3527.              FORWARD 3+4
  3528.  
  3529.           but this is valid:
  3530.  
  3531.              FORWARD 3 + 4
  3532.  
  3533.           Expressions may occur anywhere that LadyBug is looking for a
  3534.           number or a truth value.  Even though an expression may have many
  3535.           words in it, it is still considered as one input.
  3536.  
  3537.           Unless noted, operations on integers result in integers and
  3538.           operations on floating point numbers result in floating point
  3539.           numbers.  When one operand of two given for an operator is
  3540.           integer, it is converted to floating point.
  3541.  
  3542.           The operators taking two values are:
  3543.  
  3544.           +     (plus)
  3545.               Returns the sum of two numbers.
  3546.  
  3547.           -     (minus)
  3548.               Returns the difference of two numbers.
  3549.  
  3550.           *     (times)
  3551.               Returns the product of two numbers.
  3552.  
  3553.           /     (divide)
  3554.               Returns the result of dividing the first number by the second
  3555.               number.  If both are integers, they are converted to floating
  3556.               point before the divide is done.
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.           Numbers and Computations                                  Page 47
  3569.  
  3570.  
  3571.           ^     (power)
  3572.               Returns the first number raised to the power given by the
  3573.               second number.  The second number must be an integer or
  3574.               LadyBug signals an error.
  3575.  
  3576.           \     (mod)
  3577.               Returns the remainder from dividing the first number by the
  3578.               second number.  If either is floating point, it is rounded to
  3579.               an integer first.
  3580.  
  3581.           Examples:
  3582.  
  3583.              forward 3 * ( 2 + 5 )
  3584.              right 5 * :x
  3585.              right ( 5 * :x )
  3586.              make "x  :x + 1
  3587.              print integer 100 * sin 4 + :angle
  3588.              print integer ( 100 * sin ( 4 + :angle ) )
  3589.  
  3590.           The last two lines print the same result.
  3591.  
  3592.  
  3593.  
  3594.           12.5. EXPRESSIONS RESULTING IN TRUE OR FALSE
  3595.  
  3596.           Expressions which result in "true" or "false" are similar to
  3597.           expressions which result in numbers and may have such expressions
  3598.           in them.  Each expression has the following form:
  3599.  
  3600.              value1 op value2
  3601.  
  3602.           where the values are numbers, variables, or expressions and "op"
  3603.           is one of the following relational operators:
  3604.  
  3605.           <
  3606.               Returns 'true' if value1 is less than value2.
  3607.  
  3608.           <=
  3609.               Returns 'true' if value1 is less than or equal to value2.
  3610.  
  3611.           >
  3612.               Returns 'true' if value1 is greater than value2.
  3613.  
  3614.           >=
  3615.               Returns 'true' if value1 is greater than or equal to value2.
  3616.  
  3617.           <>
  3618.               Returns 'true' if value1 is not equal to value2.
  3619.  
  3620.           =
  3621.               Returns 'true' if value1 is equal to value2.
  3622.  
  3623.           Conditionals can be combined with AND and OR.  See the chapter
  3624.           "Workspace With Tools" on page 49.
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.           Numbers and Computations                                  Page 48
  3635.  
  3636.  
  3637.           In addition:
  3638.  
  3639.           NOT value
  3640.               Returns "true" when the value is "false" and "false" when the
  3641.               value is "true".
  3642.  
  3643.           Examples:
  3644.  
  3645.              GIVEN                 PRINTS
  3646.              print 2 < 3           true
  3647.              print 3 > 2           false
  3648.              print 2 <= 3          true
  3649.              print 2 <> 3          true
  3650.              print not 2 < 3       false
  3651.  
  3652.  
  3653.  
  3654.           12.6. PROCEDURES
  3655.  
  3656.           Procedures can be invoked from within expressions and can return
  3657.           values.  When LadyBug finds a word in an expression it looks
  3658.           first to see if the word is a number.  If not, it looks to see if
  3659.           the word is one of the special words described in this chapter.
  3660.           If not, it looks to see if the word is the name of a procedure in
  3661.           the workspace.
  3662.  
  3663.           If the word is the name of a procedure, it is invoked.  The
  3664.           procedure must terminate with an OUTPUT command which specifies a
  3665.           value suitable for the context in which it was invoked.  (For
  3666.           example, if the procedure follows a plus sign, it would be
  3667.           expected to return a number.)
  3668.  
  3669.           Example:
  3670.  
  3671.              to inc :v
  3672.              return :v + 1
  3673.              end
  3674.  
  3675.              print 5 + v 6
  3676.  
  3677.           The procedure adds one to its input.  It is invoked in the PRINT
  3678.           command with an input of 6.  The returned value, a 7, is added to
  3679.           the 5 and a 12 is printed.
  3680.  
  3681.           LadyBug has the restriction that a procedure cannot be started
  3682.           when the inputs to another procedure are being evaluated.  The
  3683.           following, for example, is invalid:
  3684.  
  3685.           Example:
  3686.  
  3687.              print 5 + v v 6
  3688.  
  3689.           If allowed, it would increment the 6 twice.
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.           13. WORKSPACES WITH TOOLS
  3704.  
  3705.  
  3706.           This chapter describes procedures which are in the workspace
  3707.           named TOOLS.  An appendix describes other workspaces which
  3708.           contain example procedures.
  3709.  
  3710.  
  3711.  
  3712.           13.1. AND  T/F  T/F
  3713.  
  3714.                     Takes two inputs, both expressions which evaluate to
  3715.                     "true" or "false".  Returns "true" only if both inputs
  3716.                     are "true".
  3717.  
  3718.                     Example:
  3719.  
  3720.                        and :a < 2 :b > 4
  3721.  
  3722.  
  3723.  
  3724.           13.2. FOREVER LIST
  3725.  
  3726.                     Takes one input, a list.  RUNs the list over and over,
  3727.                     forever.
  3728.  
  3729.                     Example:
  3730.  
  3731.                        if  and  :a > 3  :a < 10   [fd :a]
  3732.  
  3733.  
  3734.  
  3735.           13.3. MAX VALUE1 VALUE2
  3736.  
  3737.                     Takes, two inputs, both expressions which return some
  3738.                     value.  Returns the largest of the two.
  3739.  
  3740.  
  3741.  
  3742.           13.4. MIN VALUE1 VALUE2
  3743.  
  3744.                     Takes, two inputs, both expressions which return some
  3745.                     value.  Returns the smallest of the two.
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.           Workspaces With Tools                                     Page 50
  3767.  
  3768.  
  3769.           13.5. OR  T/F  T/F
  3770.  
  3771.                     Takes two inputs, both expressions which evaluate to
  3772.                     "true" or "false".  Returns "true" if either input is
  3773.                     "true"..
  3774.  
  3775.                     Example:
  3776.  
  3777.                        if  or  :a > 3  :a < 10   [fd :a]
  3778.  
  3779.  
  3780.  
  3781.           13.6. WAIT TIME
  3782.  
  3783.                     Takes one input, a time in seconds.  LadyBug pauses for
  3784.                     this length of time.
  3785.  
  3786.  
  3787.  
  3788.           13.7. WHILE [CONDITION] [COMMANDS]
  3789.  
  3790.                     Takes two inputs, a condition and commands.  Each input
  3791.                     is given as a list.  The condition is an expression
  3792.                     which returns "true" or "false"..  The condition is
  3793.                     evaluated and, if true the list of commands is RUN.
  3794.                     The condition is again evaluated and the list RUN.
  3795.                     This is repeated so long as the condition remains true.
  3796.  
  3797.                     Example:
  3798.  
  3799.                        while [heading < 200]  [fd 10 rt 10]
  3800.  
  3801.  
  3802.  
  3803.           13.8. XOR  T/F  T/F
  3804.  
  3805.                     Takes two inputs, both expressions which evaluate to
  3806.                     "true" or "false".  Returns "false" if both inputs are
  3807.                     the same and "true" if different.
  3808.  
  3809.                     Example:
  3810.  
  3811.                        if  xor  :a > 3  :a < 10   [fd :a]
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.           14. INTRODUCTION TO THE LADYBUG EDITOR
  3836.  
  3837.  
  3838.           This chapter describes the basics of using the LadyBug full
  3839.           screen editor.  The appendix "About the LadyBug Editor" on page
  3840.           57 describes additional features of the editor.
  3841.  
  3842.  
  3843.  
  3844.           14.1. ABOUT THE EDITOR
  3845.  
  3846.           The LadyBug Editor is a full screen editor for LadyBug
  3847.           procedures.  It displays one or more procedures totalling up to
  3848.           500 lines long and with lines up to 254 characters long.  It uses
  3849.           the Monochrome display or 40 or 80 column graphics display.
  3850.  
  3851.           The screen is a window onto the file.  The window can move up,
  3852.           down, left and right.  Lines which are longer than the screen are
  3853.           partly displayed.  If you insert data, characters seem to be lost
  3854.           off of the end of the line; they are not lost but are just no
  3855.           longer displayed.  Move the cursor off of the screen to the right
  3856.           and they will reappear as the window moves.
  3857.  
  3858.           If memory becomes nearly full, the LadyBug Editor tells you and
  3859.           lets you continue editing but won't let you add more lines.
  3860.  
  3861.  
  3862.  
  3863.           14.2. INVOKING THE EDITOR
  3864.  
  3865.           Command: EDIT procname1 ...   (Abbreviated ED)
  3866.                or: EDIT ALL
  3867.  
  3868.           Takes a variable number of inputs each of which is a procedure
  3869.           name or a vaiable name which has as a value a procedure name.
  3870.           Enters the full screen editor to edit the procedures.
  3871.  
  3872.           The procedures named are displayed, each ending with an END
  3873.           command.  If ALL is given, all procedures are edited.  Lines may
  3874.           be changed, added, deleted, or moved.  When multiple procedures
  3875.           are being edited, lines may be moved between procedures.
  3876.  
  3877.           If a procedure is deleted in the editor, or its name is changed,
  3878.           it is not deleted from the workspace.  Only those procedures
  3879.           which are still in the editors space when you terminate editing
  3880.           are moved back to the workspace.  New procedures created within
  3881.           the editor are added to the workspace when you edit from the
  3882.           editor.  Use the ERASE statement to delete procedures from the
  3883.           workspace.
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.           Introduction to the LadyBug Editor                        Page 52
  3899.  
  3900.  
  3901.           14.3. THE LADYBUG EDITOR KEYS
  3902.  
  3903.           The following list defines the meaning of each key.
  3904.  
  3905.           Backspace
  3906.                Backspace over and delete the previous character.
  3907.  
  3908.           Character keys, shifted and unshifted.
  3909.                Enter the character into the current line.  If in insert
  3910.                mode, put it at the cursor position and slide the characters
  3911.                under and to the right of the cursor to the right.  If in
  3912.                replace mode, replace the character under the cursor.
  3913.  
  3914.           Cursor keys (arrows on numeric keypad)
  3915.                Move the cursor up, down, left, or right one position.  If
  3916.                the cursor would move off of the screen in a direction in
  3917.                which there is more data, then scroll the screen one
  3918.                character in that direction.
  3919.  
  3920.           Del
  3921.                Delete the character under the cursor.  Slide the characters
  3922.                at its right to the left one position.
  3923.  
  3924.           End
  3925.                Position the cursor past the end of current line.
  3926.  
  3927.           Enter key
  3928.                Put a new line in the file and position the cursor at the
  3929.                front of it.
  3930.  
  3931.           F5
  3932.                Clear the current line and position the cursor at the left
  3933.                edge.
  3934.  
  3935.           F6
  3936.                Clear the current line under and to the right of the cursor.
  3937.  
  3938.           F7
  3939.                Quit editing.  Abandon the procedure(s) being edited.  (If
  3940.                any changes have been made, the editor asks before
  3941.                abandoning them.)
  3942.  
  3943.           F9
  3944.                End editing.  Save the procedure(s) being edited.
  3945.  
  3946.           Home
  3947.                Position the cursor in the first column of both the current
  3948.                file line and the screen.
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.           Introduction to the LadyBug Editor                        Page 53
  3965.  
  3966.  
  3967.           Ins
  3968.                Toggle between insert and replace modes.  The status line
  3969.                describes which is in effect.  The cursor also changes size.
  3970.  
  3971.           Pg Dn
  3972.                Scroll down 20 lines when the screen is 80 characters wide
  3973.                and 18 lines when 40 wide.
  3974.  
  3975.           Pg Up
  3976.                Scroll up 20 lines when the screen is 80 characters wide and
  3977.                18 lines when 40 wide.
  3978.  
  3979.           Shift-F8
  3980.                Delete the line at the cursor.  The cursor moves to the next
  3981.                line in the file.
  3982.  
  3983.           Tab
  3984.                Tab right to the beginning of the next word.  (Words are
  3985.                groups of characters separated by blanks.)
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.           15. HINTS ON USING LADYBUG
  4034.  
  4035.  
  4036.           This chapter contains several helpful hints about how to use
  4037.           LadyBug effectively.
  4038.  
  4039.  
  4040.  
  4041.           15.1. PRINTING THE SCREEN ON AN IBM OR EPSON PRINTER
  4042.  
  4043.           Under DOS 2.0 (or later systems) you must give the GRAPHICS
  4044.           command in DOS before running LadyBug.  Under DOS 1.1 or 1.0
  4045.           there is no way to print the graphics screen unless you have a
  4046.           GRAPHICS command distributed with the IBM Graphics printer for
  4047.           that version, or an equivalent.  If the printer is an Epson, it
  4048.           must have the GrafTrax feature builtin or added.
  4049.  
  4050.  
  4051.  
  4052.           15.2. PRINTING THE SCREEN ON OTHER PRINTERS
  4053.  
  4054.           The manufacturers of many dot matrix printers provide software
  4055.           which will print the graphics screen.  Other routines are
  4056.           available through various PC clubs.
  4057.  
  4058.  
  4059.  
  4060.           15.3. TAILORING LADYBUG: THE PROFILE
  4061.  
  4062.           When LadyBug starts up, it READs a workspace named PROFILE.BUG.
  4063.           This workspace file can be modified to contain any LadyBug
  4064.           commands.  When it is read, the commands will be executed.
  4065.  
  4066.           For example, the PROFILE might contain:
  4067.  
  4068.              pencolor 1
  4069.              background 7
  4070.  
  4071.  
  4072.  
  4073.           15.4. THE READ COMMAND
  4074.  
  4075.           The READ command described on page 37 causes LadyBug to
  4076.           temporarily stop reading commands from the keyboard.  Commands
  4077.           are read instead from the file named.
  4078.  
  4079.           Any LadyBug command can be in the file.  However, there is no way
  4080.           to create a file from within LadyBug which contains arbitrary
  4081.           commands.  It is necessary to use a program called an "editor" to
  4082.           create the file.(9)
  4083.  
  4084.           ____________________
  4085.  
  4086.           (9) The author of LadyBug has a free editor called FRED which
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.           Hints On Using LadyBug                                    Page 55
  4097.  
  4098.  
  4099.           The READ command can itself occur within a READ command.  And
  4100.           another READ in that one, and another read in that one.  The
  4101.           limit is four active READ commands.
  4102.  
  4103.           When LadyBug starts up, it READs a file named PROFILE.BUG.  This
  4104.           file may be modified to perform any action you wish as a part of
  4105.           the startup process.
  4106.  
  4107.           READ files can be created which contain long sequences of
  4108.           commands to draw large pictures.  The commands are executed and
  4109.           discarded; they do not take space in the workspace unless they
  4110.           are MAKE, TO, or DEFINE commands.
  4111.  
  4112.  
  4113.  
  4114.           15.5. PERFORMANCE HINTS
  4115.  
  4116.           Major performance improvements:
  4117.           -   Hide the LadyBug using HB or function key F10.  Procedures
  4118.               may run as much as 3 times faster with the LadyBug hidden.
  4119.           -   Unwind procedures.  Of the following, POLYB is 30 percent
  4120.               faster than POLYA.
  4121.  
  4122.                  to polya :d :a
  4123.                  fd :d  rt :a
  4124.                  poly :d :a
  4125.                  end
  4126.  
  4127.                  to polyb :d :a
  4128.                  fd :d  rt :a
  4129.                  fd :d  rt :a
  4130.                  poly :d :a
  4131.                  end
  4132.  
  4133.           -   Repeat instead of recurse.  POLYC is 50 percent faster than
  4134.               POLYA.
  4135.  
  4136.                  to polyc :d :a
  4137.                  repeat 1000 [fd :d  rt :a]
  4138.                  poly :d :a
  4139.                  end
  4140.  
  4141.           Minor improvements:
  4142.           -   Turn on NOCLIP and NOWRAP when there is no danger of needing
  4143.               them.
  4144.           -   Put multiple statements on a line.
  4145.  
  4146.  
  4147.           ____________________
  4148.  
  4149.           will create such files; send a diskette in a self-addressed,
  4150.           post-paid diskette mailer for a free copy.  FRED is very similar
  4151.           to the LadyBug editor.  However any editor will do, including the
  4152.           EDLIN program which comes with DOS.
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.           Hints On Using LadyBug                                    Page 56
  4163.  
  4164.  
  4165.           In any case, don't worry about these performance improvements
  4166.           until you have proven that you need them.  Premature use of them
  4167.           will simply complicate the creation process.
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.           APPENDIX A. ABOUT THE LADYBUG EDITOR
  4232.  
  4233.  
  4234.           This appendix describes the LadyBug editor completely.  It
  4235.           repeats the introductory information given in the main part of
  4236.           the document.
  4237.  
  4238.           The LadyBug Editor is a full screen editor for LadyBug
  4239.           procedures.  It displays procedures or groups of procedures up to
  4240.           500 lines long and with lines up to 254 characters long.  It uses
  4241.           the IBM Monochrome display or 40 or 80 column graphics display.
  4242.  
  4243.           The screen is a window onto the file.  The window can move up,
  4244.           down, left and right.  Lines which are longer than the screen are
  4245.           partly displayed.  If you insert data, characters seem to be lost
  4246.           off of the end of the line; they are not lost but are just no
  4247.           longer displayed.  Move the cursor off of the screen to the right
  4248.           and they will reappear as the window moves.
  4249.  
  4250.           If memory nears the limit while you are editing, the LadyBug
  4251.           Editor tells you and lets you continue editing but won't let you
  4252.           add more lines.
  4253.  
  4254.  
  4255.  
  4256.           A.1. THE LADYBUG EDITOR KEYS
  4257.  
  4258.           The following list defines the meaning of each key.  The term
  4259.           "current line" means the line the cursor is currently on.
  4260.  
  4261.           Alt-d
  4262.                Delete a marked area; see Alt-l for more information.
  4263.  
  4264.           Alt-j
  4265.                Join the next line onto the current one at its end.
  4266.  
  4267.           Alt-l
  4268.                Mark the current line or extend a group of marked lines.
  4269.                The first Alt-l marks a line and displays it in reverse
  4270.                video.  The second marks all lines from the first one
  4271.                through the second.  Further Alt-l keystrokes extend the
  4272.                marked area to the current line (or shrink it from the
  4273.                nearest edge).
  4274.  
  4275.                Marked areas may be copied, deleted, or unmarked.  See
  4276.                Alt-z, Alt-d, and Alt-u.
  4277.  
  4278.           Alt-s
  4279.                Split the current line into two parts at the cursor.  At
  4280.                column one this adds a new line before the current one.
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.           About the LadyBug Editor                                  Page 58
  4295.  
  4296.  
  4297.           Alt-u
  4298.                Unmark an area; see Alt-l.
  4299.  
  4300.           Alt-z
  4301.                Copy a marked area to just after the current line.  A marked
  4302.                area cannot be copied into itself.
  4303.  
  4304.           Backspace
  4305.                Backspace over and delete the previous character.
  4306.  
  4307.           Character keys, shifted or unshifted.
  4308.                Enter the character into the current line.  If in insert
  4309.                mode, put it at the cursor position and slide the characters
  4310.                under and to the right of the cursor to the right.  If in
  4311.                replace mode, replace the character under the cursor.
  4312.  
  4313.           Ctrl-End
  4314.                Position the cursor on the last line of the file.  Keep it
  4315.                in the same column.
  4316.  
  4317.           Ctrl-Home
  4318.                Position the cursor on the top line of the file.  Keep it in
  4319.                the same column
  4320.  
  4321.           Ctrl-Left
  4322.                Move the cursor to the left 40 positions.
  4323.  
  4324.           Ctrl-Pg Dn
  4325.                Position the cursor at the bottom edge of the screen (or on
  4326.                the last line of the file if encountered first).  The column
  4327.                position is unchanged.
  4328.  
  4329.           Ctrl-Right
  4330.                Move the cursor to the right 40 positions.
  4331.  
  4332.           Cursor keys (arrows on numeric keypad)
  4333.                Move the cursor up, down, left, or right one position.  If
  4334.                the cursor would move off of the screen in a direction in
  4335.                which there is more data, then scroll the screen one
  4336.                character in that direction.
  4337.  
  4338.           Del
  4339.                Delete the character under the cursor.  Slide characters at
  4340.                its right to the left one position.
  4341.  
  4342.           End
  4343.                Position the cursor past the end of current line.
  4344.  
  4345.           Enter key
  4346.                Put a new line in the file and position the cursor at the
  4347.                front of it.  (Also see Alt-s.)
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.           About the LadyBug Editor                                  Page 59
  4361.  
  4362.  
  4363.           F5
  4364.                Clear the current line and position the cursor at the left
  4365.                edge.
  4366.  
  4367.           F6
  4368.                Clear the current line under and to the right of the cursor.
  4369.  
  4370.           F7
  4371.                Quit editing.  If any procedure has been changed, you will
  4372.                be prompted for a 'y' before the LadyBug Editor really
  4373.                quits.
  4374.  
  4375.           F9
  4376.                Stop editing.  Re-enter LadyBug mode with the changed
  4377.                procedure(s).
  4378.  
  4379.           Home
  4380.                Position the cursor in the first column of both the current
  4381.                file line and the screen.
  4382.  
  4383.           Ins
  4384.                Toggle between insert and replace modes.  The status line
  4385.                describes which is in effect.
  4386.  
  4387.           Pg Dn
  4388.                Scroll down 20 lines when the screen is 80 columns wide and
  4389.                18 lines when it is 40 wide.
  4390.  
  4391.           Pg Up
  4392.                Scroll up 20 lines when the screen is 80 columns wide and 18
  4393.                lines when it is 40 wide.
  4394.  
  4395.           Shift-F4
  4396.                Undo a change to the current line.  Once the cursor is moved
  4397.                from the line the change cannot be undone with this key.
  4398.  
  4399.           Shift-F8
  4400.                Delete the line at the cursor.  The cursor moves to the next
  4401.                line in the file.
  4402.  
  4403.           Tab
  4404.                Tab right to the beginning of the next word.  (Words are
  4405.                groups of characters separated by blanks.)
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.           APPENDIX B. THE PLAY COMMAND
  4430.  
  4431.  
  4432.           This appendix describes the PLAY command completely, repeating
  4433.           information contained in the summary in the main part of this
  4434.           document.
  4435.  
  4436.           The PLAY statement is the word "PLAY" followed by a string which
  4437.           contains special music commands.  These commands define notes to
  4438.           play, or tell PLAY how to play the notes.
  4439.  
  4440.           Note: Spaces and capitalization in the PLAY statement are
  4441.           optional.
  4442.  
  4443.  
  4444.  
  4445.           B.1. MUSIC COMMANDS
  4446.  
  4447.  
  4448.           A TO G WITH OPTIONAL '#', '+', OR '-'
  4449.  
  4450.           Play the note given.  Append a # or + if the note is a sharp or a
  4451.           - if it is a flat.
  4452.  
  4453.  
  4454.           LN
  4455.  
  4456.           Set the default length of all notes which follow.  For example,
  4457.           L1 means that all notes are whole notes, L2 means half notes, and
  4458.           L4 means quarter notes.  The default is L4.
  4459.  
  4460.           The value of n may vary from 1 to 64.  The actual note length is
  4461.           1/n.  That is, if n is 8 then the note has a length of 1/8.
  4462.           Unless changed by the T command, each quarter note lasts 1/2
  4463.           second.)
  4464.  
  4465.           The default length may be changed for any note by appending a
  4466.           different length to it.  For example, in
  4467.  
  4468.              PLAY "'L4 a b c8'
  4469.  
  4470.           the notes 'a' and 'b' will be played as quarter notes but 'c'
  4471.           will be an eighth note.
  4472.  
  4473.  
  4474.           MB
  4475.  
  4476.           Tell PLAY to play music in the background; that is, to start the
  4477.           music playing and to proceed to the next statement.  If LadyBug
  4478.           then finds another SOUND or PLAY statement, it pauses until the
  4479.           tune is complete.  Up to 32 notes (or rests) may be played in the
  4480.           background.  MB is NOT the default.
  4481.  
  4482.           Once you have given the MB command in one PLAY statement that all
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.           The PLAY Command                                          Page 61
  4493.  
  4494.  
  4495.           further PLAY statements run in the background.
  4496.           MF
  4497.  
  4498.           Play music in the foreground; that is, wait for the music to
  4499.           complete before proceeding to the next statement.  This is the
  4500.           default.
  4501.  
  4502.  
  4503.           MN
  4504.  
  4505.           Play notes the "normal" length of time.  (MN means Music Normal.)
  4506.           This is defined as 7/8th of the time specified by the note
  4507.           length.  The other 1/8 of the time is silence.
  4508.  
  4509.  
  4510.           ML
  4511.  
  4512.           Play notes the full time specified by the note length.  (ML means
  4513.           Music Legato).  There is NO pause between notes.
  4514.  
  4515.  
  4516.           MS
  4517.  
  4518.           Play notes 3/4 of the time specified by the note length.  (MS
  4519.           means Music Staccato.)  The other 1/4 of the time it rests.
  4520.  
  4521.  
  4522.           N N
  4523.  
  4524.           Play note n.  The value of n may range from 0 to 84 with 0
  4525.           meaning a rest (no sound).  Note 1 is the C of octave zero.
  4526.  
  4527.  
  4528.           O N
  4529.  
  4530.           Set octave n as the current octave.  All notes given as letters
  4531.           are in this octave.  The default octave is 4.  The value of n may
  4532.           be 0 through 7.  For example, the following two commands are
  4533.           equivalent:
  4534.  
  4535.           PLAY "O0c
  4536.           PLAY "N1
  4537.  
  4538.           An octave has the notes C, D, E, F, G, H, A and B in it, in that
  4539.           order.  The octave does NOT start with the note A.
  4540.  
  4541.           The table below shows the frequencies for each note.  The values
  4542.           in octaves three and above have been rounded to integers.  The
  4543.           minus signs mean "flat".
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.           The PLAY Command                                          Page 62
  4559.  
  4560.  
  4561.                   ---------------- Octave ----------------
  4562.           Note     0     1      2      3    4    5     6
  4563.           ------  ----------------------------------------
  4564.           c       32.7  65.4   130.8  262  523* 1046  2093
  4565.           c# d-   34.6  69.3   138.6  277  554  1109  2217
  4566.           d       36.7  73.4   146.8  294  587  1175  2349
  4567.           d# e-   38.9  77.8   155.6  311  622  1244  2489
  4568.           e       41.2  82.4   164.8  330  659  1318  2637
  4569.           f       43.7  87.3   174.6  349  698  1397  2794
  4570.           f# g-   46.2  92.5   185.0  370  740  1480  2960
  4571.           g       49.0  98.0   196.0  392  784  1568  3136
  4572.           g# a-   51.9  103.8  207.7  415  831  1661  3322
  4573.           a       55    110    220    440  880  1760  3520
  4574.           a# b-   58.3  116.5  233.1  466  932  1865  3729
  4575.           b       61.7  123.5  246.9  494  988  1975  3951
  4576.                   * - Middle C
  4577.  
  4578.                    Frequencies for Seven Octaves
  4579.  
  4580.  
  4581.           P N
  4582.  
  4583.           Pause for n time units.  The meaning of the value of n is the
  4584.           same as in the L command.  The value of n may range from 1 to 64.
  4585.  
  4586.  
  4587.           T N
  4588.  
  4589.           Set the tempo.  The tempo is the number of quarter notes per
  4590.           minute The value of n may range from 32 to 255.  The default is
  4591.           120.
  4592.  
  4593.           This means that there are 120 quarter notes per minute or that
  4594.           each quarter note begins 1/2 second after the previous quarter
  4595.           note.
  4596.  
  4597.  
  4598.           A DOT (.)
  4599.  
  4600.           A dot, placed after a note, causes the note to be played 3/2 the
  4601.           time it would otherwise be played.  A second dot multiplies the
  4602.           length again by 3/2 giving a result of 9/4 the time of the
  4603.           original note.  Dots may also appear after the P and N commands.
  4604.  
  4605.           Note: There are two kinds of dotted notes in music; those with a
  4606.           dot BELOW the note which means staccato, and those with one or
  4607.           two dots AFTER the note which means to change the note timing.
  4608.  
  4609.           PLAY's dot convention differs from that used in normal music
  4610.           notation where the first dot after a note adds 1/2 of the note
  4611.           time, and a second dot adds 1/2 of 1/2 to the note time.  Thus a
  4612.           note with double dots would have a length of 7/4 of its original
  4613.           length rather than the 9/4 that PLAY has.
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.           The PLAY Command                                          Page 63
  4625.  
  4626.  
  4627.           DEFAULTS
  4628.  
  4629.           The defaults given are what you get when LadyBug first starts up.
  4630.           However, if you change the default in one PLAY statement, it
  4631.           stays changed for further statements.
  4632.  
  4633.  
  4634.  
  4635.           B.2. EXAMPLES OF PLAY STATEMENTS
  4636.  
  4637.           This sections illustrates the use of the Play statement.  The
  4638.           workspace named SOUNDS contains all of the following examples of
  4639.           Play and additional ones.
  4640.  
  4641.           First, a space ship:
  4642.  
  4643.           Example:
  4644.  
  4645.              to ship1
  4646.                 play "'L64 T255'
  4647.                 repeat 10 [play "'n40 n42 n44 n46 n48 n50 n48 n46 n44 n42 n40']
  4648.  
  4649.           Now, a clock ticking:
  4650.  
  4651.           Example:
  4652.  
  4653.              to clock :tics
  4654.                 play "'L50 MB MS T255'
  4655.                 repeat :tics [play "'N1 P1 N2 P1']
  4656.  
  4657.           And now, a bird call:
  4658.  
  4659.           Example:
  4660.  
  4661.              to bird1
  4662.                 play "'L64 MB ML T255 O4'
  4663.                 play "'N64 N66 N68 N70 P64'
  4664.                 play "'N66 N68 N70 N72 N74 N76 N78 P64'
  4665.                 play "'N66 N68 N70 N72 P64'
  4666.                 play "'N64 N66 N68 N70 P64'
  4667.                 play "'N70 N72 N74 N76 N78 N80 P64'
  4668.                 play "'N66 N68 N70 N72 P64'
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.           APPENDIX C. A GUIDE TO EXAMPLE PROCEDURES
  4694.  
  4695.  
  4696.           This chapter describes the example workspaces which come with
  4697.           LadyBug.  Each section name below is the name of a workspace.
  4698.           Issue the command:
  4699.  
  4700.              READ "name
  4701.  
  4702.  
  4703.  
  4704.           C.1. BCAKE
  4705.  
  4706.              to bcake :age
  4707.  
  4708.           Draws a birthday cake in color and plays Happy Birthday.
  4709.           Submitted by Daniel D. Wheeler, Cincinnati, OH.  Try:
  4710.  
  4711.              bcake 5
  4712.  
  4713.  
  4714.  
  4715.           C.2. C
  4716.  
  4717.              to c :size :level
  4718.  
  4719.           Draws a "C". curve.  Adapted from a procedure in TURTLE GRAPHICS.
  4720.           Try:
  4721.  
  4722.              C 5 6
  4723.  
  4724.  
  4725.  
  4726.           C.3. DYNA
  4727.  
  4728.              to startup
  4729.              to dt :age
  4730.  
  4731.           Displays the "Dyna Turtle".  The dyna turtle is really the
  4732.           LadyBug acting like a space ship under the influence of Newton's
  4733.           Laws.  It starts off motionless at the home position.  The "r"
  4734.           and "l." keys turn the ship 30 degrees right and left.  The "k"
  4735.           key "kicks" the ship in the direction it is pointing.
  4736.  
  4737.           Adapted from LOGO FOR THE APPLE II.
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.           A Guide To Example Procedures                             Page 65
  4757.  
  4758.  
  4759.           C.4. DRAGON
  4760.  
  4761.              to dragon :size :order
  4762.  
  4763.           Draws a dragon curve.  Adapted from TURTLE GRAPHICS.  Try:
  4764.  
  4765.              dragon 5 11
  4766.  
  4767.  
  4768.  
  4769.           C.5. DUOPOLY
  4770.  
  4771.              duopoly :side1 :angle1 :side2 :angle2
  4772.  
  4773.           Adapted from TURTLE GRAPHICS.  Try:
  4774.  
  4775.              duopoly 12 10 12 -15
  4776.              duopoly 18 19 18 -20
  4777.              duopoly 45 90 45 320
  4778.              duopoly 12 10  4 -15
  4779.  
  4780.  
  4781.  
  4782.           C.6. HILBERT
  4783.  
  4784.              hilbert :size :level
  4785.  
  4786.           Adapted from TURTLE GRAPHICS, page 98.  Draws a Hilbert curve.
  4787.           Try:
  4788.  
  4789.              hilbert 10 3
  4790.              hilbert 5 5
  4791.  
  4792.  
  4793.  
  4794.           C.7. INSPI
  4795.  
  4796.              to inspi :side :angle :inc
  4797.  
  4798.           Adapted from various LOGO books.  Draws an inward spiral with an
  4799.           increasing inturning angle; it thus eventually turns out.  Slight
  4800.           differences in the angle make totally different pictures. For
  4801.           example, try:
  4802.  
  4803.              inspi 10 10 15
  4804.              inspi 10 10 16
  4805.              inspi 10 10 10
  4806.              inspi 10 10  7
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.           A Guide To Example Procedures                             Page 66
  4823.  
  4824.  
  4825.           C.8. LUDWIG
  4826.  
  4827.              to ludwig
  4828.  
  4829.           Plays a tune by Beethoven.  Adapted from a BASIC program; author
  4830.           unknown.
  4831.  
  4832.  
  4833.  
  4834.           C.9. MISC
  4835.  
  4836.              to corner.tri :size
  4837.              to cornerpoly  :size :angle :totalturn
  4838.              to nested.triangle :size
  4839.              to rays :angle :incangle :dist :incdist
  4840.              to tree :l
  4841.              to outward.tri :size
  4842.              to spiralsq
  4843.  
  4844.           CORNER.TRI draws a triangle with smaller triangles on the
  4845.           corners.
  4846.  
  4847.           CORNERPOLY does a similar thing for general polygons.
  4848.  
  4849.           NESTER.TRIANGLE draws triangles inside triangles inside
  4850.           triangles.
  4851.  
  4852.           Rays draws rays out from the current position.  The rays increase
  4853.           in length and angle with time.
  4854.  
  4855.           TREE draws a simple tree.
  4856.  
  4857.           OUTWARD.TRI is similar to CORNER.TRI.
  4858.  
  4859.           SPIRALSQ draws a square with the given size.  Rotates the turtle
  4860.           45 degrees and draws another square with a side the length of the
  4861.           diagonal of the first square.  Repeats the process with even
  4862.           increasing squares.  Adapted from LOGO FOR THE APPLE II.
  4863.  
  4864.           Most of these are adapted from TURTLE GRAPHICS.
  4865.  
  4866.  
  4867.  
  4868.           C.10. POLY
  4869.  
  4870.              to poly :side :angle
  4871.  
  4872.           The basic LOGO procedure.  It draws polygons.  Try:
  4873.  
  4874.              poly 100 90
  4875.              poly 100 120
  4876.              poly 100 144
  4877.              poly 100 162
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.           A Guide To Example Procedures                             Page 67
  4889.  
  4890.  
  4891.           C.11. POLYSPI
  4892.  
  4893.              to polyspi :side :angle :inc
  4894.  
  4895.           Very similar to POLY but the side is incremented after each time
  4896.           it is drawn.  Try:
  4897.  
  4898.              polyspi 1 45 1
  4899.              polyspi 5 119 3
  4900.              polyspi 5 120 3
  4901.              polyspi 5 144 3
  4902.  
  4903.  
  4904.  
  4905.           C.12. RAIL
  4906.  
  4907.              to rail
  4908.  
  4909.           Rail plays a familiar old song but with a complexity that seems
  4910.           impossible considering the instrument.  It is adapted from
  4911.           RAIL.BAS which was on a disk someone gave the author of LadyBug;
  4912.           there was no name on the RAIL program.  Other procedures in the
  4913.           workspace are rail1 through rail15 and are called by rail.  Try:
  4914.  
  4915.              rail
  4916.  
  4917.  
  4918.  
  4919.           C.13. SLINKY
  4920.  
  4921.              to shrinkcircle :size
  4922.              to rslinky :size
  4923.              to spinslink :size
  4924.              to growcircle :size
  4925.  
  4926.           A set of circle drawing tools adapted from LOGO FOR THE APPLE II.
  4927.           Try:
  4928.  
  4929.              shrinkcircle 100
  4930.              rslinky 50
  4931.              spinslinky 50
  4932.              growcircle 10
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.           A Guide To Example Procedures                             Page 68
  4955.  
  4956.  
  4957.           C.14. SNOWFLAK
  4958.  
  4959.              to snowflake :size :level
  4960.  
  4961.           Draws a snowflake. Try:
  4962.  
  4963.              snowflake 100 2
  4964.              snowflake 100 3
  4965.  
  4966.  
  4967.  
  4968.           C.15. SPIRO
  4969.  
  4970.              to spiro :size :angle :max
  4971.  
  4972.           Adapted from TURTLE GRAPHICS.  Try:
  4973.  
  4974.              spiro 5 45 10
  4975.              spiro 10 120 7
  4976.              spiro 10 90 9
  4977.  
  4978.  
  4979.  
  4980.           C.16. SOUNDS
  4981.  
  4982.              to ship1
  4983.              to ship2
  4984.              to ship3
  4985.              to clicks
  4986.              to clock :tics
  4987.              to bird1
  4988.              to bird2
  4989.              to bird3
  4990.              to bird4
  4991.              to birds
  4992.  
  4993.           A number of different sounds.  Ships are space ships, not ocean
  4994.           ships.  The clock ticks the number of times given.  "Birds" makes
  4995.           various bird calls.  Try:
  4996.  
  4997.              birds
  4998.              clock 20
  4999.              ship1
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.           A Guide To Example Procedures                             Page 69
  5021.  
  5022.  
  5023.           C.17. SPINSQ
  5024.  
  5025.              to spinsquares :size
  5026.  
  5027.           Draws a square and turns 20 degrees to the right.  Repeats the
  5028.           process.  Try:
  5029.  
  5030.              spinsquares 50
  5031.  
  5032.  
  5033.  
  5034.           C.18. TREES
  5035.  
  5036.              to vee
  5037.              to branch
  5038.              to bush
  5039.              to greentree
  5040.              to treemove
  5041.              to trees
  5042.  
  5043.           Adapted from LOGO FOR THE APPLE II.  Try:
  5044.  
  5045.              trees
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.  
  5054.  
  5055.  
  5056.  
  5057.  
  5058.  
  5059.  
  5060.  
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.           APPENDIX D. FORMAT AND CONTENTS OF SAVED WORKSPACES
  5090.  
  5091.  
  5092.           Workspaces are saved on disk with the SAVE command and are
  5093.           reloaded with the LOAD command.  The saved workspace reflects the
  5094.           definitions of procedures and values of variables that existed
  5095.           when the SAVE command was executed.
  5096.  
  5097.           The status of currently executing commands or procedures is not
  5098.           saved.
  5099.  
  5100.           The workspace is saved on disk such that the file contains
  5101.           commands which can be executed to rebuild the workspace or to add
  5102.           the workspace contents to another workspace.
  5103.  
  5104.           For example, you issue the commands:
  5105.  
  5106.              clearws
  5107.  
  5108.              to poly :d :a
  5109.              ; the standard, simple, POLY procuedure
  5110.              fd :d
  5111.              rt :a
  5112.              end
  5113.  
  5114.              make "abc "'Some value'
  5115.              make "n 4 * 5
  5116.  
  5117.              save "dave
  5118.  
  5119.           The file DAVE.BUG looks like this:
  5120.  
  5121.              to "poly  :d :a
  5122.              ; the standard, simple, POLY procuedure
  5123.              fd :d
  5124.              rt :a
  5125.              end
  5126.  
  5127.              make "abc "'Some value
  5128.              make "n 20
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.           APPENDIX E. ERROR MESSAGES
  5156.  
  5157.  
  5158.           (PROCEDURE) DIDN'T OUTPUT ANYTHING.
  5159.                The procedure was invoked in an expression but did not
  5160.                terminate with an OUTPUT command.
  5161.  
  5162.           (COMMAND) DOESN'T LIKE (NUMBER) AS INPUT.
  5163.  
  5164.           (COMMAND) DOES NOT LIKE (WORD) AS INPUT.
  5165.  
  5166.           (COMMAND) DOESN'T LIKE TO WORK AFTER YOU SAID DRAW.
  5167.                The command works only in text mode; issue the NODRAW
  5168.                command and try again.
  5169.  
  5170.           (COMMAND) DOESN'T LIKE TO WORK AFTER YOU SAID NODRAW.
  5171.                The command works only in graphics mode; issue the RAW
  5172.                command and try again.
  5173.  
  5174.           (COMMAND) DOESN'T LIKE (WORD/LIST/STRING) AS INPUT.
  5175.                The input does not match what the command expects.
  5176.  
  5177.           (COMMAND) HAS TOO MANY INPUTS
  5178.  
  5179.           (COMMAND) NEEDS MORE INPUTS.
  5180.  
  5181.           BACKGROUND DOESN'T LIKE COLOR NUMBER OF (NUMBER)
  5182.  
  5183.           CANNOT RAISE NUMBER TO NON-INTEGRAL VALUE
  5184.  
  5185.           CANNOT RUN A PROCEDURE WHILE STARTING UP A PROCEDURE.
  5186.  
  5187.           CURSOR POSITION IS OFF OF SCREEN:  (NUMBER)  (NUMBER)
  5188.  
  5189.           DEFINE DOESN'T LIKE (WORD/STRING) AS INPUT.
  5190.                DEFINE must have a word as its first input and alist as its
  5191.                second input.
  5192.  
  5193.           DON'T KNOW HOW TO DO ARITHMETIC ON (WORD)
  5194.  
  5195.           DON'T KNOW WHAT TO DO WITH OUTPUT VALUE: (VALUE)
  5196.                A procedure ended with an OUTPUT command but the procedure
  5197.                was not invoked as a part of an expression.
  5198.  
  5199.           ERROR CONVERTING (WORD) TO A NUMBER
  5200.                The word was in an expression, or in a place where a number
  5201.                was expected, but was not a valid number.
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.           Error Messages                                            Page 72
  5219.  
  5220.  
  5221.           FATAL ERROR (NUMBER) AT (LINE)
  5222.                Whoops!  This should never happen but it might.  Please let
  5223.                the author know.
  5224.  
  5225.           FILE NOT FOUND
  5226.                A disk file was not found.
  5227.  
  5228.           I DON'T KNOW HOW TO (COMMAND)
  5229.                LadyBug could not find the command in its internal table of
  5230.                commands and could not find a procedure with the name.
  5231.  
  5232.           I DON'T KNOW HOW TO PLAY THIS: (TUNE)
  5233.                Something is wrong with the music specification.
  5234.  
  5235.           INTERNAL ERROR (NUMBER)
  5236.                Whoops!  This should ever happen but it might.  Please let
  5237.                the author know.
  5238.  
  5239.           INVALID SYMBOL:  (NAME)
  5240.  
  5241.           LADYBUG DOESN'T LIKE TO SCRUNCH THIS MUCH:  (NUMBER)
  5242.                SETSCRUNCH can accept numbers from .1 to 10 only.
  5243.  
  5244.           MAXIMUM NUMBER OF SYMBOLS REACHED WITH (SYMBOL)
  5245.                The symbol table is full.  This might happen if you have a
  5246.                very large number of procedures and/or variables.  It might
  5247.                also happen if you have paused many times without going back
  5248.                to the top level command prompt.
  5249.  
  5250.           MISSING VALUE AFTER (WORD)
  5251.  
  5252.           PAINT DOESN'T LIKE PAINT COLOR NUMBER OF  (NUMBER)
  5253.  
  5254.           PAINT DOESN'T LIKE BOUNDARY COLOR NUMBER OF  (NUMBER)
  5255.  
  5256.           PALETTE DOESN'T LINE PALETTE NUMBER OF  (NUMBER)
  5257.  
  5258.           PENCOLOR DOESN'T LINE COLOR NUMBER OF  (NUMBER)
  5259.  
  5260.           PROCEDURE NESTING IS TOO DEEP.
  5261.                Too many procedures, repeats, pauses, or uncompleted
  5262.                expressions.
  5263.  
  5264.           PROCEDURE (WORD) WAS NOT FOUND.
  5265.  
  5266.           RAN OUT OF ROOM IN EXPRESSION.
  5267.                Too many procedures, repeats, pauses, or uncompleted
  5268.                expressions.
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.           Error Messages                                            Page 73
  5285.  
  5286.  
  5287.           RUN DOESN'T LIKE (WORD) AS INPUT.  IT EXPECTS A LIST.
  5288.  
  5289.           TEST DOESN'T LIKE (WORD) AS INPUT.
  5290.  
  5291.           TOO MANY ACTIVE FILE REFERENCES; (WORD) IGNORED.
  5292.                Commands executed as a result of a READ command have issued
  5293.                other READ command to a depth of four.
  5294.  
  5295.           TOO MANY REPEAT STATEMENTS ACTIVE.
  5296.                Too many procedures, repeats, pauses, or uncompleted
  5297.                expressions.
  5298.  
  5299.           VARIABLE (NAME) WAS NOT FOUND.
  5300.  
  5301.  
  5302.  
  5303.  
  5304.  
  5305.  
  5306.  
  5307.  
  5308.  
  5309.  
  5310.  
  5311.  
  5312.  
  5313.  
  5314.  
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.           APPENDIX F. HACKERS ONLY
  5354.  
  5355.  
  5356.           This appendix contains commands which may be of interest to
  5357.           advanced LadyBug users.  (Advanced users who care about esoteric
  5358.           commands are often called "hackers".)
  5359.  
  5360.  
  5361.  
  5362.           F.1. .DEBUG
  5363.  
  5364.                     Turn on debug mode.  In debug mode, each command is
  5365.                     printed as it is encountered; LadyBug does not pause.
  5366.                     On occassion, other output also occurs.
  5367.  
  5368.  
  5369.  
  5370.           F.2. .STACK
  5371.  
  5372.                     Display the execution stack showing what procedures,
  5373.                     repeats, and pauses are active.
  5374.  
  5375.  
  5376.  
  5377.           F.3. .SYMTAB
  5378.  
  5379.                     Display the symbol table.  The name, value, and type of
  5380.                     every symbol is shown.
  5381.  
  5382.  
  5383.  
  5384.           F.4. NAMES THAT RETURN VALUES.
  5385.  
  5386.           .LOWWATER
  5387.  
  5388.               Returns the position in the symbol table of the last symbol
  5389.               belonging to the next procedure up the nest.  Symbols at
  5390.               .lowwater + 1 were defined by the current procedure.
  5391.  
  5392.           .NVSYM
  5393.  
  5394.               The number of symbols in the symtol table.  Some of the
  5395.               entries may be empty; if so, their .vval will be "NoToken".
  5396.  
  5397.           .VSYM n
  5398.  
  5399.               The name of the n'th varible in the symbol table.  Procedures
  5400.               have the name proc:procname; POLY is named proc:poly.
  5401.  
  5402.           .VVAL n
  5403.  
  5404.               The value of the n'th variable in the symbol table.
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.           Hackers Only                                              Page 75
  5417.  
  5418.  
  5419.           .VTYPE n
  5420.  
  5421.               The type of the n'th variable in the symtol table.  The types
  5422.               can be "NoToken", "String", "Word", "List", or "Number".
  5423.               Each is currently padded with blanks to a length of 8
  5424.               characters.
  5425.  
  5426.           WARNING These commands and words are documented for use in
  5427.           debugging procedures, not for building applications.  Their
  5428.           definition may change in future releases of LadyBug.
  5429.  
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.  
  5436.  
  5437.  
  5438.  
  5439.  
  5440.  
  5441.  
  5442.  
  5443.  
  5444.  
  5445.  
  5446.  
  5447.  
  5448.  
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.           APPENDIX G. LIMITS AND CAPACITIES
  5486.  
  5487.  
  5488.           Maximum total procedures and variables in workspace
  5489.              200
  5490.  
  5491.           Maximum total procedure, repeat, pause, read/load, expression,
  5492.           and parenthesis nesting depth
  5493.              40 total, but see below
  5494.  
  5495.           Maximum number of editor lines
  5496.              500
  5497.  
  5498.           Maximum procedure size, in characters
  5499.              32760
  5500.  
  5501.           Procedures can appear to nest much deeper than the limit of 30
  5502.           due to the recognition of "tail recursion".  When the last thing
  5503.           a procedure does is call itself, LadyBug recognizes that it need
  5504.           not keep information about the old procedure call since it is
  5505.           essentially done.  Therefore such a call does not increase the
  5506.           nesting depth.
  5507.  
  5508.  
  5509.  
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.           INDEX
  5553.  
  5554.  
  5555.           =, 48
  5556.           <=, 48
  5557.           >, 48
  5558.           >=, 48
  5559.           ^, 47
  5560.           \, 47
  5561.           *, 47
  5562.           +, 47
  5563.           <, 48
  5564.           <>, 48
  5565.           -, 47
  5566.  
  5567.  
  5568.  
  5569.           --- A ---
  5570.  
  5571.           ABS keyword, 44
  5572.           AND procedure, 50
  5573.           ARCTAN keyword, 44
  5574.           Arithmetic operator
  5575.             *, 47
  5576.             +, 47
  5577.             -, 47
  5578.             /, 47
  5579.             \, 47
  5580.             ^, 47
  5581.           Aspect ratio, 21, 43
  5582.           Author, i
  5583.           AUTOEXEC.BAT file, 5
  5584.           Automatic startup, 5
  5585.  
  5586.  
  5587.  
  5588.           --- B ---
  5589.  
  5590.           BACK command, 15
  5591.           Background colors, 15, 43
  5592.           BACKGROUND command, 15
  5593.           BACKGROUND keyword, 43
  5594.           Backup, 5
  5595.           BEEP command, 24
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.           Index                                                     Page 78
  5616.  
  5617.  
  5618.           --- C ---
  5619.           CATALOG command, 36
  5620.           Changes in this version, 3
  5621.           CLEARINPUT command, 26
  5622.           CLEARSCREEN command, 16
  5623.           CLEARTEXT command, 26
  5624.           CLEARWS command, 36
  5625.           CLIP, 15
  5626.           CLIP command, 16
  5627.           CO Command, 41
  5628.           Color
  5629.             background, 15
  5630.             numbers, 15
  5631.             painting, 18
  5632.             palette, 19
  5633.             pen colors, 19, 43
  5634.           Command prompt, 40
  5635.           Comment Command, 42
  5636.           CONTINUE Command, 41
  5637.           Copying, ii
  5638.           COS keyword, 44
  5639.           Cursor
  5640.             positioning, 26
  5641.           CURSOR command, 26
  5642.  
  5643.  
  5644.  
  5645.           --- D ---
  5646.  
  5647.           DEFINE command, 36
  5648.           Defining procedures, 28
  5649.           Diskette
  5650.             setting up for execution, 7
  5651.           Distribution, secondary, ii
  5652.           DOS, 2
  5653.           DOS GRAPHICS command, 55
  5654.           DRAW, 15
  5655.           DRAW command, 6, 16
  5656.  
  5657.  
  5658.  
  5659.           --- E ---
  5660.  
  5661.           ED command, 52
  5662.           EDIT command, 28, 37, 52
  5663.           Editing active procedures, 41
  5664.           Editing files, 28, 52, 58
  5665.           Editing screen, 11
  5666.           Editor key
  5667.             Alt-d: delete area, 58
  5668.             Alt-j: join lines, 58
  5669.             Alt-l: mark lines, 58
  5670.             Alt-s: split lines, 58
  5671.             Alt-u: unmark lines, 59
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.           Index                                                     Page 79
  5682.  
  5683.  
  5684.             Alt-z: copy lines, 59
  5685.             Backspace, 53, 59
  5686.             Character keys, 53, 59
  5687.             Ctrl-End: move to end of file, 59
  5688.             Ctrl-Home: move to start of file, 59
  5689.             Ctrl-Left: left 40 columns, 59
  5690.             Ctrl-Pg Dn: to bottom edge, 59
  5691.             Ctrl-Right: right 40 columns, 59
  5692.             Cursor keys, 53, 59
  5693.             Del, 53, 59
  5694.             End, 53
  5695.             End: to end of line, 59
  5696.             Enter key, 53, 59
  5697.             F5: clear line, 53, 60
  5698.             F6: clear to EOL, 53, 60
  5699.             F7: quit editing, 53, 60
  5700.             F9: End editing, 53
  5701.             F9: stop editing, 60
  5702.             Home, 53, 60
  5703.             Ins, 54, 60
  5704.             Pg Dn, 54, 60
  5705.             Pg Up, 54, 60
  5706.             Shift-F4: undo, 60
  5707.             Shift-F8: delete line, 54, 60
  5708.             Tab, 54, 60
  5709.           EDLIN editor, 55
  5710.           END command, 28, 52
  5711.           ERASE command, 37, 37
  5712.           ERASEFILE command, 38
  5713.           ERNAME command, 38, 38
  5714.           ERROR command, 28
  5715.           EXP keyword, 44
  5716.           Expressions, 14, 47
  5717.  
  5718.  
  5719.  
  5720.           --- F ---
  5721.  
  5722.           File
  5723.             PROFILE.BUG, 21, 55, 56
  5724.           Floating point numbers, 43
  5725.           FOREVER command, 29
  5726.           FOREVER procedure, 50
  5727.           FORWARD command, 16
  5728.           FRED editor, 55
  5729.           Function key
  5730.             F10: hide LadyBug, 6
  5731.             F1: stop drawing, 5
  5732.             F3: help, 5
  5733.             F5: pause, 5
  5734.             F5: Pausing execution, 40
  5735.             F9: trace mode, 6
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.           Index                                                     Page 80
  5748.  
  5749.  
  5750.           --- G ---
  5751.           GOODBYE command, 29
  5752.           Graphics commands, 15
  5753.           Graphics mode, 10, 15, 16, 18, 26
  5754.           Graphics screens, 10
  5755.  
  5756.  
  5757.  
  5758.           --- H ---
  5759.  
  5760.           HEADING keyword, 43
  5761.           HIDDEN? keyword, 45
  5762.           HIDEBUG command, 17
  5763.           HIDETURTLE command, 17
  5764.           HOME command, 17
  5765.  
  5766.  
  5767.  
  5768.           --- I ---
  5769.  
  5770.           IF command, 29, 29, 30, 30
  5771.           IFFALSE command, 31
  5772.           IFTRUE command, 31
  5773.           Initialization, 55
  5774.           Input and output, 26
  5775.           INTEGER keyword, 44
  5776.           Integer numbers, 43
  5777.  
  5778.  
  5779.  
  5780.           --- J ---
  5781.  
  5782.           Joystick, 45
  5783.  
  5784.  
  5785.  
  5786.           --- K ---
  5787.  
  5788.           KEYP keyword, 45
  5789.  
  5790.  
  5791.  
  5792.           --- L ---
  5793.  
  5794.           LEFT command, 17
  5795.           Limits, 40, 76
  5796.           Lists, 13, 46
  5797.           LOAD command, 38
  5798.           LOCAL command, 31
  5799.           LOG keyword, 44
  5800.  
  5801.  
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.           Index                                                     Page 81
  5814.  
  5815.  
  5816.           --- M ---
  5817.           MAKE command, 32
  5818.           MAX procedure, 50
  5819.           MIN procedure, 50
  5820.           Monochrome display, 2, 12, 52, 58
  5821.  
  5822.  
  5823.  
  5824.           --- N ---
  5825.  
  5826.           Nested group of procedures, 40
  5827.           Nest of procedures, 40
  5828.           NOCLIP, 15
  5829.           NOCLIP command, 17
  5830.           NODRAW, 15, 15
  5831.           NODRAW command, 18
  5832.           NOT keyword, 48
  5833.           NOTRACE Command, 41
  5834.           NOWINDOW, 15
  5835.           NOWINDOW command, 18
  5836.           NOWRAP, 15
  5837.           NOWRAP command, 18
  5838.           NUMBER? keyword, 46
  5839.           Numbers, 13
  5840.             floating point, 43
  5841.             integers, 43
  5842.  
  5843.  
  5844.  
  5845.           --- O ---
  5846.  
  5847.           OR procedure, 51
  5848.           OUTPUT command, 33
  5849.  
  5850.  
  5851.  
  5852.           --- P ---
  5853.  
  5854.           PADDLEBUTTON keyword, 45
  5855.           PADDLE keyword, 45
  5856.           PAINT command, 18
  5857.           Painting, 18
  5858.           PALETTE command, 19
  5859.           PALETTE keyword, 43
  5860.           PAUSE Command, 41
  5861.           Pausing, 51
  5862.           Pausing procedures, 40
  5863.           PC/DOS, 2
  5864.           PC keyword, 43
  5865.           PENCOLOR command, 19
  5866.           PENCOLOR keyword, 43
  5867.           PENDOWN command, 19
  5868.           PENDOWN? keyword, 45
  5869.           PENUP command, 20
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.           Index                                                     Page 82
  5880.  
  5881.  
  5882.           PENUP? keyword, 45
  5883.           Performance hint, 6, 23
  5884.           Performance Hints, 56
  5885.           PLAY command, 24, 61
  5886.             examples, 64
  5887.           POLY procedure, 6
  5888.           POLYSPI procedure, 6
  5889.           PRINT1 command, 27
  5890.           PRINT command, 26
  5891.           Printing data, 26
  5892.           Printing the screen, 55
  5893.           PRINTOUT command, 38
  5894.           Procedures, 9, 40
  5895.             as commands, 40
  5896.             creating, 40
  5897.             defining, 28, 36, 39, 52
  5898.             maximum number of, 76
  5899.             maximum size, 76
  5900.             pausing, 40
  5901.             returning from, 34
  5902.             returning values from, 33
  5903.             running, 40
  5904.             tail recursion, 76
  5905.           Procedure set, 28
  5906.           PROFILE.BUG file, 21, 55, 56
  5907.  
  5908.  
  5909.  
  5910.           --- R ---
  5911.  
  5912.           RANDOMIZE command, 33
  5913.           RANDOM keyword, 44
  5914.           RC? keyword, 45
  5915.           RC keyword, 45
  5916.           READCHARACTER keyword, 45
  5917.           READCHAR keyword, 45
  5918.           READ command, 38, 55
  5919.           References, 1
  5920.           Relational expressions, 48, 50
  5921.           Relational operator
  5922.             <, 48
  5923.             <=, 48
  5924.             <>, 48
  5925.             =, 48
  5926.             >, 48
  5927.             >=, 48
  5928.           REPEAT command, 33
  5929.           REQUEST keyword, 45
  5930.           Requirements, 2
  5931.           RIGHT command, 20
  5932.           RQ keyword, 45
  5933.           RUN command, 34
  5934.           RUN keyword, 46
  5935.           Running LadyBug, 5
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.           Index                                                     Page 83
  5946.  
  5947.  
  5948.           --- S ---
  5949.           SAVE command, 39
  5950.           Screens, 10
  5951.             printing, 55
  5952.             width, 27
  5953.           SCRUNCH keyword, 43
  5954.           SE keyword, 46
  5955.           SENTENCE keyword, 46
  5956.           SETBG command, 20
  5957.           SETHEADING command, 20
  5958.           SETPAL command, 21
  5959.           SETPC command, 21
  5960.           SETSCRUNCH, 15
  5961.           SETSCRUNCH command, 21
  5962.           .SETSCRUNCH command, 21
  5963.           Setup for execution, 7
  5964.           SETWIDTH command, 27
  5965.           SETX command, 21
  5966.           SETXY command, 22
  5967.           SETY command, 22
  5968.           SHOWBUG command, 22
  5969.           SHOWING? keyword, 45
  5970.           SHOWTURTLE command, 22
  5971.           SIGN keyword, 44
  5972.           SIN keyword, 44
  5973.           Sounds
  5974.             playing tunes, 24
  5975.             single notes, 25
  5976.           Source code, iii
  5977.           SQRT keyword, 44
  5978.           STICKBUTTON keyword, 45
  5979.           STICK keyword, 45
  5980.           STOP command, 34
  5981.           Strings, 14
  5982.  
  5983.  
  5984.  
  5985.           --- T ---
  5986.  
  5987.           TAN keyword, 44
  5988.           TEST command, 34
  5989.           TEXTCOLUMNS command, 27
  5990.           Text mode, 11, 15, 16, 18, 26, 27
  5991.           Text screen, 11
  5992.           THING keyword, 46
  5993.           TO command, 39
  5994.           TONE command, 25
  5995.           Tools workspacea, 50
  5996.           TOPLEVEL Command, 41
  5997.           TOPLEVEL command, 34
  5998.           TRACE Command, 41
  5999.           TYPE command, 27
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.           Index                                                     Page 84
  6012.  
  6013.  
  6014.           --- U ---
  6015.           User Supported Software, i, ii
  6016.  
  6017.  
  6018.  
  6019.           --- V ---
  6020.  
  6021.           Variables, 9
  6022.             assigning, 32
  6023.             creating, 32
  6024.             maximum number of, 76
  6025.             scope, 31, 32
  6026.             scope example, 32
  6027.  
  6028.  
  6029.  
  6030.           --- W ---
  6031.  
  6032.           WAIT command, 34
  6033.           WAIT procedure, 51
  6034.           Warrantee, disclaimer of, i
  6035.           WHILE command, 35
  6036.           WHILE procedure, 51
  6037.           WINDOW, 15
  6038.           WINDOW command, 23
  6039.           WORD keyword, 46
  6040.           Words, 13
  6041.           Workspace, 9
  6042.             managing, 36
  6043.           WRAP, 15
  6044.           WRAP command, 23
  6045.  
  6046.  
  6047.  
  6048.           --- X ---
  6049.  
  6050.           XCOR keyword, 43
  6051.           XOR procedure, 51
  6052.  
  6053.  
  6054.  
  6055.           --- Y ---
  6056.  
  6057.           YCOR keyword, 44
  6058.           Young People's LOGO Association, 1
  6059.           YPLA, 1
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.