DOC PREVIEW
Columbia COMS W4115 - COLOGO A Graph Language

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1 COLOGO COLOGO A Graph Language Advisor: Stephen A. Edwards Shen Wang ([email protected]) Lixing Dong ([email protected]) Siyuan Lu ([email protected]) Chao Song ([email protected]) Zhou Ma ([email protected])2 COLOGO Description: Our COLOGO language is an effective programming language for drawing 2D graphics. The COLOGO language is designed in spirit of low threshold, which enables easy entry by novices and yet meet the needs of high-powered users. We can use COLOGO for education as it contains basic computer concepts appropriate for beginners. We can also draw interesting pictures and design complicated logos with COLOGO so that the language could be widely used for entertainment or commercial area. Features: Euclidean: COLOGO operates in a Euclidean space using relative measures and angles, without an origin, unlike coordinate-addressed systems such as Cartisian geometry. Functional: In our COLOGO language, users can create their own functions to perform a specific task. This helps programmers to decompose the complex program to simple steps. Also, this feature allows users to reuse the code across different programs. Recursive: Recursion is supported in our COLOGO language. This allows users to simplify their code by dividing a problem to subproblems of the same type. Iridescent: COLOGO support drawing lines of different colors and line width, making your drawing experience more colorful. Objectives: The main goal of our programming language is to provide an easy way to draw 2D graphics. These graphics, and hence our language, can be used for representing mathematical formulas, teaching geometric concepts, simple arithmetical operation and simulation of robots routing. Also, COLOGO is an appropriate language for teaching basic programming language concepts. Basic data types will be supported in COLOGO, such as integers, floats, and strings. Some simple data structures like list will also be implemented in it.COLOGO 3 Sample Code: function void triangleSpiral( int intEdgeToDraw, double dblEdgeLength ) { FD dblEdgeLength; RT 2 / 3 * P i; if ( intEdgeToDraw > 0 ) { triangleSpiral( intEdgeToDraw - 1, dblEdgeLength * 0.9 ); } } function void main() { int intStarCount = 20; double dblLength; double dblAngle; for ( int intStarIndex = 0; intStarIndex < intStarCount; intStarIndex ++ ) { dblLength = rand() * 10; dblAngle = rand() * Pi; RT d blA ng le; PU; // pen up FD dblLength; PD; // pen down triangleSpiral( 10, dblLength ); } } Syntax: In the sample code, the following syntaxes are involved: Draw command (draw keywords followed by 0 or more parameters): FD dblEdgeLength; // Draw line as moving forward RT dblAngle; // Turn right by dblAngle PU; // Pen up, move without drawing PF; // Pen up/down flip4 COLOGO Variable declaration (variable class followed by variable name): double dblLength; Assignment: dblLength = rand() * 10; Variable definition (variable type followed by variable name and assignment): int intStarIndex = 0; Function definition (keyword function followed by return type, function name, parameter list and function body which is surrounded by braces): function void triangleSpiral( int intEdgeToDraw, double dblEdgeLength ) { ... } Function call (function name followed by parameter list): triangleSpiral( intEdgeToDraw - 1, dblEdgeLength * 0.9 ); Comments (start with //): // pen up Flow control (iterational and conditional flow control (for, while, if) structured similarly to C program language): for ( int intStarIndex = 0; intStarIndex < intStarCount; intStarIndex ++ ) { ... } if ( intEdgeToDraw > 0 ) { triangleSpiral( intEdgeToDraw - 1, dblEdgeLength * 0.9 );


View Full Document

Columbia COMS W4115 - COLOGO A Graph Language

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Download COLOGO A Graph Language
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view COLOGO A Graph Language and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view COLOGO A Graph Language 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?