GithubHelp home page GithubHelp logo

bubdm / slogo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isindicic/slogo

0.0 0.0 0.0 55 KB

A Logo compiler and/or interpreter for Windows and/or Linux in form of command line tool and/or IDE

Home Page: http://slogo.codeplex.com/

C# 94.08% Lex 1.34% Yacc 4.54% Batchfile 0.04%

slogo's Introduction

slogo

A Logo compiler and/or interpreter for Windows and/or Linux in form of command line tool and/or IDE

How to use a command line version and which command line switches it support ?

E:\projects\SLogo.git\SLogoC\bin\Debug>SLogoC.exe --help
SLogo Compiler (Console) version X.YZ
for Windows and Linux (Mono)

Usage:
SLogoC.exe filename.lgo [options]

Where options can be:
--width=x    Where x is a number that define canvas width
--height=y   Where y is a number that define canvas height
--output=z   Where z is a a name of bitmap filename where result will be saved
             or exe file where compiled Logo program will saved
--run=c      Where c is a code that will be executed

For example:
SLogoC.exe test.lgo --output=test.bmp "--run=cs snowflake 12"
will load and compile test.lgo, and if that pass fine and without any error,
then execute ClearScreen (cs) and call function snowflake with parameter equal to 12:

E:\projects\SLogo.git\SLogoC\bin\Debug>

How to use a command line version ?

Let's we have a file named test.lgo with following content:

to square :length
  repeat 4 [ fd :length rt 90 ]
end

to rose
   clearscreen
   repeat 36 [ square 50 rt 10 ]
end

to main
  rose
end

To execute test.lgo, run main and get 200x200px result bitmap we'll use following command

E:\projects\SLogo.git\SLogoC\bin\Debug>SLogoC.exe test.lgo --output=test.bmp  --width=200 --height=200
Done in 233 miliseconds

E:\projects\SLogo.git\SLogoC\bin\Debug>

(Note that there are no code via --run switch specified. In this case a main function will be called)

A resulting image will be:

Result image

Why is this an 'Interpreter'?

An interpreter is usually something that can interpret source file, run it internally and show results inside itself. All currently known (as far as we know) Logo programs are interpreters

Why is this a 'Compiler' ?

A compiler is usually a program that is able to convert source file to something that can be runnable without that program. In most cases this is EXE file. As far as we know there are no Logo programs that are compilers (except this one)

I want to send compiled EXE file to someone who haven't SLogo installed. Is EXE file enough?

No. Together with EXE you should send a copy of TurrtleRuntime.dll file

Can I save output to some other format or I'm stuck with bitmaps ?!

You can save files in JPG, PNG or GIF. Program will automatically recognize format from file extension you specify in command line

Supported Logo Commands

PU or PenUp
PD or PenDown
REPEAT
MAKE
FD or Forward
BK or Back
RT or Right
LT or Left
CS or ClearScreen
PE or PenErase
Home
SETPC
SETSC
SetPenSize
Label
SetLabelHeight
HT or HideTurtle
ST or ShowTurtle
Stop
To
End
IF
ELSE
WHILE  

Logical operators

AND
OR
NOT

slogo's People

Contributors

isindicic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.