Preview

Comp3652 Unit 2 Assignment

Powerful Essays
Open Document
Open Document
1090 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Comp3652 Unit 2 Assignment
COMP3652–Language Processors, Semester I, 2013—Assignment 2

1

UNIVERSITY OF THE WEST INDIES
Department of Computing
COMP3652–Language Processors
Semester I, 2013
Lecturer: Dr. Daniel Coore
Assignment 2
Due Monday, November 18, 2013

Introduction
For this assignment, you will be completing the implementation of an interpreter for fractal, a language for creating and combining simple fractal shapes. The language specification has been provided in a separate document. You will need to consult that document in order to complete this assignment. Although graphics are involved in this assignment, you will not need to implement your own graphics routines, nor to create your own classes to manage the drawing of shapes to the screen.
…show more content…
You are well advised to take a look at these classes, as well as the documentation for the classes in cs34q.jar while planning your implementation of
FractalEvaluator. You should not have to edit AbstractFractalEvaluator, and you have not been provided with the source code for Turtle or TurtleDisplay, so you may not edit the behaviour of those classes either. You may edit FractalState if you find that it is necessary to do so.
You can test your interpreter on the example files provided in the examples directory, but you should not limit your tests to only those provided there.
[25]
b. Use your interpreter to create a new fractal program. See whether you can create something that produces unexpected results. (Have fun!). Submit both your program, as well as the image it produced (take a snapshot of the whole FractalEvaluator window).
[5]
Problem 3: Bonus: Procedures [15]
As currently defined, fractal contains no support for defining functions or procedures. Add a new special form to fractal that would allow the user to define and call procedures with numerically valued arguments. The syntax of a call should look like the usual infix syntax (e.g. as used in C,
Java and Python). The syntax of a procedure definition should

You May Also Find These Documents Helpful

  • Good Essays

    Nt1110 Unit 3 Assignment

    • 655 Words
    • 3 Pages

    Server side code will include the portion of opening a socket on a specific port as discussed earlier and in addition to it there will be some if-else construct or a switch case implementation that will interpret the incoming instructions from the client ma-chine and will call the related method associated with the in-struction…

    • 655 Words
    • 3 Pages
    Good Essays
  • Good Essays

    First, you must decide exactly what you expect to create, and how you will recognise it when it…

    • 668 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    1. What computer systems would you use to prepare illustrated technical reports using graphs, spreadsheets and draw charts?…

    • 716 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Mike's Bike Analysis

    • 2352 Words
    • 10 Pages

    Module 1: Computer Graphics With the dawn of the Internet our computer experience has changed from a textual/numerical one to a world of images, sounds, moving pictures, and combinations of all these media. Graphics they way we imagined them on a two-dimensional page have sprung out in three-dimensions that are rotated, can be customized on demand, and can be used in simulating various real experiences. As the world become more vivid in the possible representations we find on our computers, users also become more savvy in manipulating and creating theses multimedia. Bitmapped Graphics: Images on a computer screen are made up of a matrix of pixels, tiny dots of black, white and color arranged in rows. Combination of pixels on the screen outlines the shape of letters, images, and all visual representations that appear on the computer. When painting, or representing an image on the screen there are different approaches of controlling the emerging shape. When free-hand painting is employed where every move form mouse or stylus is captured, as each pixel is determined, we say we are using bitmapped graphics. In this case the information in each pixel is saved in memory and determines the outcome of the whole image. The number of memory bits devoted to each pixel is called color depth, or bit depth, and in helps the artist create more realistic looking images. Another factor is resolution, which indicates the density of the pixels, usually described in dots per inch, dpi. Not surprising that these are common words used to describe the quality of your computer monitor’s image quality. The advantage of using bitmapped graphics is the control over detail and richness of the image but there is a price to pay in the use of memory. More information devoted to each pixel, translates in a better image but also in more use of memory space in your computer. Object-Oriented Graphics: There are times when you just want to draw a shape, like a circle, a…

    • 2352 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    Mechanical Engineering

    • 6355 Words
    • 26 Pages

    The engineering drawing is one of the most important communication tools that a company can possess.…

    • 6355 Words
    • 26 Pages
    Good Essays
  • Satisfactory Essays

    Math for Pgd in Accounting

    • 60665 Words
    • 243 Pages

    Lesson 1 :COURSE OVERVIEW ....................................................................................................... 3 Lesson 2 :APPLICATION OF BASIC MATHEMATICS .................................................................... 12 Lesson 3 :APPLICATION OF BASIC MATHEMATICS .................................................................... 22 Lesson 4 :APPLICATION OF BASIC MATHEMATICS .................................................................... 29 Lesson 5 :APPLICATION OF BASIC MATHEMATICS .................................................................. 399 Lesson 6 :APPLICATION OF BASIC MATHEMATICS .................... Error! Bookmark not defined.8 Lesson 7 :APPLICATION OF BASIC MATHEMATICS .................... Error! Bookmark not defined.9 Lesson 8 :COMPOUND INTEREST ............................................................................................... 709 Lesson 9 :COMPOUND INTEREST ............................................................................................... 776 Lesson 10:MATRICES.................................................................................................................... 809 Lesson 11: MATRICES................................................................................................................... 854 Lesson 12 :RATIO AND PROPORTION .......................................................................................... 94 Lesson 13 :MATHEMATICS OF MERCHANDISING ................................................................... 1009 Lesson 14 :MATHEMATICS OF MERCHANDISING ..................................................................... 105 Lesson 15 :MATHEMATICS OF MERCHANDISING ................................................................. 11211 Lesson 16 :MATHEMATICS OF MERCHANDISING…

    • 60665 Words
    • 243 Pages
    Satisfactory Essays
  • Good Essays

    Good Course

    • 922 Words
    • 4 Pages

    This course covers the basics of scientific programming and introduces students to common computational methods with examples from medical and biological physics. The following topics will be covered: • Number representation and rounding error (2 hours) • Properties and generation of random numbers (3–4 hours) • Monte Carlo methods (6–7 hours) • Solutions to ordinary differential equations (7–8 hours) • Solutions to partial differential equations (9–10 hours) • Differential equations modelling of real systems (3–4 hours) • If time permits: cellular automata, fractals...…

    • 922 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Project guide line

    • 1695 Words
    • 7 Pages

    designed for the students of Computer Science and IT for their final year project work. It will…

    • 1695 Words
    • 7 Pages
    Powerful Essays
  • Powerful Essays

    ding dong

    • 839 Words
    • 4 Pages

    In this programming assignment you are required to understand the problem definition given below, solve the problem, program your solution in the C++ programming language, and document your solution.…

    • 839 Words
    • 4 Pages
    Powerful Essays
  • Powerful Essays

    the five keys

    • 2978 Words
    • 10 Pages

    In 1950s, a two-dimensional (2D) graphics started in computers, as the time goes by, it also takes place in some other type of devices like phones. It may combine geometric models, digital images, text to be typeset, mathematical functions and equations, and more. These components can be modified and manipulated by two-dimensional geometric transformations such as translation, rotation, scaling. In object-oriented graphics, the image is described indirectly by an object endowed with a self-rendering method—a procedure which assigns colors to the image pixels by an arbitrary algorithm. Complex models can be built by combining simpler objects, in the paradigms of object-oriented programming.…

    • 2978 Words
    • 10 Pages
    Powerful Essays
  • Powerful Essays

    Opengl Programming Guide

    • 16116 Words
    • 65 Pages

    Chapter Objectives After reading this chapter, you’ll be able to do the following: Appreciate in general terms what OpenGL does Identify different levels of rendering complexity Understand the basic structure of an OpenGL program Recognize OpenGL command syntax Identify the sequence of operations of the OpenGL rendering pipeline Understand in general terms how to animate graphics in an OpenGL program This chapter introduces OpenGL. It has the following major sections: "What Is OpenGL?" explains what OpenGL is, what it does and doesn’t do, and how it works. "A Smidgen of OpenGL Code" presents a small OpenGL program and briefly discusses it. This section also defines a few basic computer-graphics terms. "OpenGL Command Syntax" explains some of the conventions and notations used by OpenGL commands. "OpenGL as a State Machine" describes the use of state variables in OpenGL and the commands for querying, enabling, and disabling states. "OpenGL Rendering Pipeline" shows a typical sequence of operations for processing geometric and image data. "OpenGL-Related Libraries" describes sets of OpenGL-related routines, including an auxiliary library specifically written for this book to simplify programming examples. "Animation" explains in general terms how to create pictures on the screen that move.…

    • 16116 Words
    • 65 Pages
    Powerful Essays
  • Satisfactory Essays

    A compailer acceepts aprogram writen in a highlevel languages as input and produces its machine language equivalent as output .…

    • 396 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ddfgdfg

    • 285 Words
    • 2 Pages

    Java Mini Projects Source Code List of java mini projects source code: cse and it final year java mini projects from this site for free of...…

    • 285 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Computer Graphics Notes

    • 30149 Words
    • 230 Pages

    → – Line drawing algorithm, DTA algorithm, Presentian’s algorithm, frame buffers, Circle & ellipse generating algo, midpoint circle alg. , midpoint ellipse algo, Polynomial & spline curves – inside, outside text, scan, line, file of curved boundary areas, Boundary fill algo, flood fill algo, characters generation attributes of lines, curves, filling character, etc. CHAPTER 3 GRAPHICS PRIMITIVES structure, display file algorithms. The display file interpretes, display file → CHAPTER 4 ATTRIBUTES OF OUTPUT PRIMITIVES → Line attributes colour attributes, file attributes and character attributes.…

    • 30149 Words
    • 230 Pages
    Powerful Essays
  • Better Essays

    Computer Packages

    • 849 Words
    • 4 Pages

    A good number of graphics Software packages list options on menus. The choices include shapes (squares, circles, rectangles), line widths (also called brush widths), and colours. Textures can be added to parts of the picture. A portion of a drawing can be enlarged to add details and shrunk again. Figures can be repeated or overlapped, rotated or flipped. Software producers have even succeeded on packages that can help the user draw three-dimensional (3D) art with a personal computer.…

    • 849 Words
    • 4 Pages
    Better Essays

Related Topics