# 2018-01-27 - Ladybug Quest
       
       I read a document with sample Logo code, and chose to try it out in
       FreeDOS.  First i tried Ladybug Logo, the Logo that i had used as a
       kid.  This brings back a few memories.
       
       In middle school i checked out an spy adventure book from the school
       library.  It involved typing in BASIC code to decrypt hidden messages
       and solve various puzzles.  I had fun typing it into an Apple II
       during lunch break.  Then i took the book home.  Dad let me type code
       into GW-BASIC on an IBM XT.  He also helped me debug it when i made
       mistakes.
       
       Later that year, i took a course designed to explore our interests.
       We would spend each week on a new subject.  During the computer
       science subject, i learned to use Logo on the Apple II.  This was the
       first time i was officially taught to use a computer at school.
       
       See below [9] for Logo books.
       
       See below [1] for a browser-based Logo.
       
       Dad downloaded Ladybug Logo [2] from Compuserve or a BBS and let me
       use that at home.  Ladybug Logo was hard-coded to use a CGA graphics
       adapter.  Since the IBM XT had a Hercules monochrome graphics
       adapter, it would not run out of the box.  Dad set it up with a
       clever TSR named SIMCGA [3], which made the necessary video BIOS and
       memory map changes to emulate CGA on a Hercules card.  This enabled
       Ladybug Logo to run on our hardware.
       
       I installed Ladybug Logo in FreeDOS 1.2 on VirtualBox.  Ladybug is a
       software engineering marvel because of its well organized
       documentation and the capabilities that it DOES offer, considering
       that it fits within the constraints of a real mode compiled BASIC
       application and a single floppy disk.  It is also interesting to note
       that the documentation uses a mixture of feminine and masculine
       pronouns, which seems progressive for 1984.
       
       The software's author was an interesting character.  He was humble
       and did not expect to get rich.  His corporate job paid the grocery
       bills and Ladybug was offered on a donations accepted basis to fund
       his hobby.  Below [7] is an article about Ladybug Logo from
       PC Magazine [4].
       
       Ladybug ran fine in FreeDOS, but it would not execute the sample Logo
       code, which used list processing primitives and variadic procedures.
       Ladybug Logo must have internal list processing in order to run Logo
       code.  However, it does not expose its internal list primitives as
       Logo commands. It also lacks variadic procedures.  Ladybug didn't
       even offer enough functionality to build my own primitives.
       
       Next i downloaded UCBLogo 5.3 for DOS, which could run the sample
       code.  Success! Let's go deeper.  On the same page the author also
       offers three textbooks free of charge, which use Logo to teach deep
       concepts in computer science.  Thinking this might be fun, i began to
       read the manual and tinker with commands.  The EDALL command spawns
       the JOVE full screen editor, which is a clone of Emacs, which is a
       depraved editor indeed.  (Of course i am a completely objective
       observer in the emacs versus vi dichotomy.)  The manual says that i
       can use any editor i wish by setting the EDITOR environment variable.
       So i set it to vi.
       
           SET EDITOR=C:\BEN\BIN\VI.EXE
       
       My DOS vi of choice was Calvin [5], which is tiny, fast, and
       functional.  It works perfectly in DOSBox but screen navigation
       produces artifacts and glitches in VirtualBox.  Reading the Calvin
       source code, my guess is that the glitches come from CGA BIOS bugs in
       VirtualBox, specifically around INT10h AH=05h SELECT ACTIVE PAGE.
       Rather than try to fix or work around this BIOS bug myself, i thought
       i would try another editor.
       
       ## 2024-03-23 follow-up
       
       I should have read the documentation, not the source code.  Calvin
       includes VI.DOC, which says:
       
           vidcompat (default 0)
              Indicates the compatibility level for video operations.
              Setting it to a higher value may cause some screen-related
              problems to go away if you have slightly non-standard hardware.
              With vidcompat=1, Calvin does not use the alternate screen
              feature of CGA adapters, and with vidcompat=2, it does not save
              and restore the screen after editing.
       
       Just as i thought!  The problem is CGA BIOS bugs.  Calvin already
       includes a workaround.  I just need to set the following environment
       variable.
       
           SET EXINIT=set vidcompat 2
       
       I verified that this does indeed resolve my problem in VirtualBox.
       
       * * *
       
       Note that UCBLogo is compiled using the Zortech C Compiler.  I
       couldn't find any place to download this compiler.  It has been
       superseded by Digital Mars, but that compiler suite no longer runs on
       DOS.
       
       On a tangent, i am pleased with how well the latest DJGPP works on
       FreeDOS 1.2.  Combined with the DOSLFN driver i get long file names
       and a Unix style shell.  FreeDOS has come a long way and promises to
       be a fun toy to play with.
       
       By the way, i have a follow-up article [6] that mentions printing
       from Ladybug LOGO on DOS.
       
       * * *
       
       > Pavel Boytchev's meticulously researched Logo Tree Project
       > [Boytchev 2014] lists just over 300 dialects of Logo, most but not
       > all of which trace their ultimate ancestry to the 1968 BBN PDP-1
       > Logo. Some of the listed dialects are Logo in name only, restricted
       > to a turtle graphics library.
       > --From: History of Logo
       >
       > Proc. ACM Program. Lang., Vol. 4, No HOPL, Article 79, Jun 2020
       
       Ladybug Logo is one of these implementations of "Logo in name only,"
       restricted to a turtle graphics library and lacking the list
       manipulation primitives necessary to write real programs.
       
       * * *
       
       See below [8] for good Logo implementations for DOS:
       
       ## 2025-12-21 follow-up
       
       I had originally linked to SIMCGA41.ZIP from a BBS archive, but it is
       exactly identical to simcga40.zip as published on simtelnet.  So i
       reverted the link to simcga40.zip.  This program is public domain.
       Version 4.2 and above are commercial software.
       
       tags: bencollver,nostalgia,reading list,retrocomputing,technical
       
       # Footnotes
       
 (HTM) [1] JS LOGO
       
 (HTM) [2] ladybug.zip
       
 (HTM) [3] simcga40.zip
       
 (HTM) [4] PC Magazine, May 14, 1984
       
 (DIR) [5] Calvin
       
 (DIR) [6] Print Quest
       
       [7] Ladybug Logo magazine article
       
 (HTM) Ladybug article page 1
       
 (HTM) Ladybug article page 2
       
 (HTM) Ladybug article page 3
       
 (HTM) Ladybug article page 4
       
       [8] Good Logo implementations for DOS
       
 (HTM) IBM Logo 1.0
       
 (HTM) IBM Logo Manual
       
 (HTM) IBM Logo VGA patch
       
 (HTM) PC Logo 4.01.04 by Harvard Associates
       
 (HTM) UCB Logo
       
 (HTM) UCB Logo 5.3 for DOS (32-bit)
       
 (HTM) UCB Logo 5.3 source code
       
       [9] Logo books
       
 (HTM) Introducing Logo: for the Apple II, TI 99/4A and Tandy Color Computer
       
 (HTM) Computer Art and Animation: A User's Guide to Atari LOGO
       
 (HTM) LogoWorks: Challenging Programs In Logo
       
 (HTM) The Great Logo Adventure
       
 (HTM) The Great Logo Adventure Files
       
 (HTM) Computer Science Logo Style: Symbolic Computing
       
 (HTM) Computer Science Logo Style: Advanced Techniques
       
 (HTM) Turtle Geometry
       
 (HTM) Logo memos from 1974
       
 (HTM) History of Logo (JS)
       
       # Tags
       
 (DIR) bencollver
 (DIR) nostalgia
 (DIR) reading list
 (DIR) retrocomputing
 (DIR) technical