AOTLogoSharp.Drawing 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AOTLogoSharp.Drawing --version 1.1.0
                    
NuGet\Install-Package AOTLogoSharp.Drawing -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AOTLogoSharp.Drawing" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AOTLogoSharp.Drawing" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AOTLogoSharp.Drawing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AOTLogoSharp.Drawing --version 1.1.0
                    
#r "nuget: AOTLogoSharp.Drawing, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AOTLogoSharp.Drawing@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AOTLogoSharp.Drawing&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AOTLogoSharp.Drawing&version=1.1.0
                    
Install as a Cake Tool

AOTLogoSharp

Logo programming language for managed world.

中文文档

Build status NuGet Badge

Logo is a programming language that controls a turtle on the screen to draw amazing pictures, like below:

alt text

More beautiful pictures drawn by AOTLogoSharp:

  • Box Picture

    alt text

  • Beautiful Flower

    alt text

  • Square Flower

    alt text

  • Web

    alt text

Logo is widely used in computer education for kids, as it is simple and interesting. AOTLogoSharp is a .NET implementation of the Logo programming language which is based on a hand-written recursive descent parser.

Why AOTLogoSharp?

AOTLogoSharp is fully compatible with Native AOT and trimming. You can publish your application as a single native executable with minimal size and fast startup, without any JIT overhead. This makes it ideal for scenarios where deployment size and startup speed matter, such as command-line tools, educational apps, or embedded drawing pipelines.

The assembly names remain LogoSharp.dll and LogoSharp.Drawing.dll, and the namespace stays as LogoSharp / LogoSharp.Drawing, so existing code that references the original LogoSharp can migrate by simply swapping the NuGet package.

How to use AOTLogoSharp?

It is very simple and straightforward to use AOTLogoSharp in your .NET projects that is either based on .NET Framework 4.8, .NET Standard 2.0, or .NET 10. This means that you can make your AOTLogoSharp app working with .NET Core and thereby provides the cross-platform capability.

  1. Install AOTLogoSharp NuGet Package, for example:
Install-Package AOTLogoSharp -Version 1.0.0
  1. Write your first app:
using LogoSharp;

static void Main(string[] args)
{
    var logo = new Logo();
    logo.Forward += (s, e)
        => Console.WriteLine($"Forwarded {e.Steps} steps.");
    logo.Execute("FD 102");
}
  1. Run your app, you should get the message Forwarded 102 steps. on your console

Basically, a Logo program code is provided to the Execute method of the logo instance, AOTLogoSharp will execute the code and emit the events. Therefore, event handlers that subscribe to a particular event will be hit once the execution of the code emits the subscribed event.

For more information about how to use AOTLogoSharp, please refer to the LogoSharp.Drawing project.

Using AOTLogoSharp.Drawing

AOTLogoSharp.Drawing provides a Turtle class that renders Logo programs to images. It is also available as the AOTLogoSharp.Drawing NuGet package.

  1. Install AOTLogoSharp.Drawing NuGet Package, for example:
Install-Package AOTLogoSharp.Drawing -Version 1.0.0
  1. Write your first app:
using LogoSharp;
using LogoSharp.Drawing;
using SkiaSharp;

static void Main(string[] args)
{
    var turtle = new Turtle();
    var logo = new Logo();

    // Wire Logo events to the Turtle
    logo.Forward += (s, e) => turtle.MoveForward(e.Steps);
    logo.TurnRight += (s, e) => turtle.Right(e.Angle);
    logo.PenDown += (s, e) => turtle.PenStatus = PenStatus.Down;
    logo.SetPenColor += (s, e) => turtle.SetPenColor(e.R, e.G, e.B);

    logo.Execute(@"
        REPEAT 4 [
            FD 100
            RT 90
        ]
    ");

    turtle.Save("output.png");
}

The Turtle class exposes the following APIs:

  • SetCanvasSize(int width, int height) - set the canvas size
  • ShowTurtle() / HideTurtle() - toggle turtle visibility
  • Save(string fileName) - save the rendered image to a file
  • GetLineSegments() - get the list of drawn line segments for custom rendering
  • GetTurtleState() - get the current turtle position, angle, and visibility
  • DelayMilliseconds - control the delay between drawing steps

Key Features

AOTLogoSharp provides the following commands and features:

  • Basic Pen Commands
    • PENDOWN/PD
    • PENUP/PU
    • SETPENCOLOR/SETPC/PC
    • SETPENSIZE
    • PENERASE/PE
    • PENNORMAL/PN
  • Basic Drawing Commands
    • LEFT/LT
    • RIGHT/RT
    • FORWARD/FD
    • BACKWARD/BK/BACK
    • DELAY
    • DRAW/CLS/CLEARSCR/CLEARSCREEN/CS
    • SETH/SETHEADING
  • Turtle Control Commands
    • HOME
    • SHOWTURTLE/ST
    • HIDETURTLE/HT
  • Flow Control Commands
    • REPEAT and RepCount
    • IF / IFELSE
    • WHILE
  • Language Features
    • Variables (The MAKE command)
    • Expressions
      • Arithmetic: +, -, *, /, ^
      • Comparison: ==, <>, <, >, <=, >=
      • Logic: AND, OR, NOT
    • Procedures
    • Function Calls
      • SQRT
      • RANDOM
      • SIN / COS / TAN (degrees)
      • ASIN / ACOS / ATAN (degrees)
      • ABS
      • POWER
      • EXP
      • LOG (natural) / LOG10
    • Inline Comments
    • Built-in Constants
      • PI
      • E

Limitations

  • Code editing doesn't support multi-line format
  • Logo commands other than the ones listed above are not supported. More will be added in future
  • Function calls need to be surrounded by the braces, for example, {SQRT 2} or {RANDOM 100}

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.1 49 6/14/2026
1.3.0 52 6/13/2026
1.2.2 56 6/12/2026
1.2.1 48 6/11/2026
1.2.0 50 6/11/2026
1.1.0 55 6/10/2026
1.0.1 59 6/9/2026
1.0.0 50 6/9/2026