Dragon User


Logo 3.4

Author: Roy Coates
Publisher: Bernd Knechtel
Machine: Dragon 32

 
Published in Dragon User #045

Turtle Graphics

The latest piece of DragonDOS software to arrive from Bernd Knechtel is a utility which interfaces directly with the Dragon's own fair Basic and provides a few useful additions to the already excellent graphics commands.

Logo 3.4 provides the user with four extra graphics commands which allow turtle-type graphics to be programmed. Upon running a program an invisible 'turtle' is placed at the centre of the screen facing upwards (zero degrees) and this turtle may be manipulated very easily with the four commands mentioned above. For those who have not had the pleasure of using turtle graphics before, this involves 'guiding' a fictional turtle around the graphics screen with the option of leaving, or not leaving, a line drawn in its wake. So it is with a turtle. The first two commands in Logo 3.4 are TRIGHT and TLEFT which allow you to turn the turtle left or right through some specified angle to point in the direction you wish to draw. The position you wish to start from may be defined and re-defined using the TSTART command which sets the initial position of the turtle on the screen. And the line may be drawn (or the turtle moved) using the TMOVE command. The TMOVE command which specifies the distance the turtle is to move (in pixels) has an optional parameter which allows a line to be drawn without moving the turtle, or moving the turtle without drawing a line.

Using the example given earlier in the text, the following program would instruct the turtle to draw a square on the screen:

 10 MODE4:PCLS:SCREEN1,1 - Set up graphics mode
 20 TSTART 128,96 - Move to centre of the screen
 30 TMOVE 50 - Draw a line 50 pixels long
 40 TRIGHT 90 - Turn through 90 degrees
 50 TMOVE 50 - Draw a line 50 pixels long
 60 TRIGHT 90 - Turn through 90 degrees
 70 TMOVE 50 - Draw a line 50 pixels long
 80 TRIGHT 90 - Turn through 90 degrees
 90 TMOVE 50 - Draw a line 50 pixels long
100 END  

This is obviously a very tedious way of achieving such a simple objective and so, because Logo interfaces directly with Dragon Basic, a loop may be written which obviously allows far greater flexibitity.

For someone who uses Dragon Basic a lot to draw graphics. Logo 3.4 is a very useful addition to the programmer's armoury. A full assembler listing of Logo is supplied with the program for anyone daft enough to try and modify it and the package carries no anti-copying devices which makes it easy to incorporate into your own programs. Although Logo only adds four simple commands to Basic I can't think of anything else that could be added. Logo does give the benefits of turtle graphics without the usual pain of having to learn an entirety new environment.

Roy Coates

Other Dragon 32 Game Reviews By Roy Coates


  • Dragon/PC Convert Front Cover
    Dragon/PC Convert
  • Magbase Front Cover
    Magbase
  • Fire Force Front Cover
    Fire Force
  • Basic 42 Front Cover
    Basic 42
  • Moon Cresta Front Cover
    Moon Cresta
  • Biorhythms Front Cover
    Biorhythms
  • Superkid Front Cover
    Superkid
  • The Curse Of Camarc Front Cover
    The Curse Of Camarc