img-responsive

Please Wait

NEW Order Assignment Online and Get upto 100% OFF !!! View all Offers

NEW Order Assignment Online and Get Upto 100% OFF !!! View all Offers

COMP1100 Assignment 2 Turtle Graphics Answer

COMP1100 Assignment 2 Turtle Graphics Answer

The students in COMP1100 assignment 2 turtle graphics have to rethink the graphics, the one about the robotic turtle. There are a number of tasks like drawing the shapes, to interpret the turtle commands, directly drawing the Sierpinski’s triangle and creating the L-systems in this assignment. For this, you need expertise of a computer science assignment help provider.

Task 1

Task 1

In this assignment, you need to draw a picture with turtle graphics. The commands need to be typed for drawing the shape and you also have to think of a way to interpret these commands.

In this task, you have to define the following two functions in src/Turtle.hs –

triangle :: Double -> [TurtleCommand]

This function should be able to return a command list. Using this command, you have to draw an equilateral triangle. The face of the turtle should be the same as it was when the turtle started.

polygon :: Int -> Double -> [TurtleCommand]

In this command, you should be able to draw a regular n-sided polygon. This polygon will have the sides that are of length s. Like the command above, your turtle’s face should be in the same position as it was when it started.

The command should be such that the program does not accept a value of n which is less than 3.

Task 2

Task 2

The commands that you wrote in the task above are data and set of instructions. The usefulness of these commands is that they will generate an output when you pass them through an interpreter.

In the COMP1100 assignment 2 answer for task 2, you need to define a function runTurtle :: [TurtleCommand] -> Picture. The command will be created as per the rules as defined in Task 1.

Place the turtle at 0,0 facing north and run the program. After successful completion of this task, your result will look like the image below –

COMP1100

To prepare the command for this task, you should know what the turtle has done. It might happen that when you prepare the command and input FORWARD, the forward direction for the turtle maybe towards the right or left.

It is better if you define a command that sets a default position for the turtle. The default command will bring the turtle back to an initial face, direction and coordinates, irrespective of its previous position.

Task 3A

In this COMP1100 assignment 2 answers of Task 3A, you need to prepare a Sierpinski’s Triangle. Sierpinski’s Triangle is a fractal that has a parent shape of an equilateral triangle and is then recursively divided into smaller equilateral triangles.

The assignment task is as below –

Task 3

You need to draw an approximation of the Sierpinski’s Triangle using commands. The university understands that you cannot reproduce it but only asks you to produce a close looking fractal.

The specifications of the task are defined as a single equilateral triangle is present at depth 1.

The other condition for the Sierpinski’s Triangle is the approximation when the depth is n and is made up of three different approximations made at n-1. The side length is reduced by 50% and all these approximations are arranged so that the original triangle is covered.

The approximate version of Sierpinski’s Triangle using the turtle commands will look something like the image below –

Sierpinski’s Triangle

Task 3B

Task 3B

In this task, you need to define a function which will give you all the commands that are necessary to draw the Sierpinski’s Triangle. Every level of the triangle making should be clear to you. To understand it better, you better draw one on a piece of paper and then think how the turtle will advance.

Get your COMP1100 assignment 2 answers

If you are struggling with the COMP1100 assignment 2 answers, then My Assignment Services have just what you need – a customised computer science assignment help. All you need to do is send our team of experts your query and details and we will provide you with a reference COMP1100 assignment 2 answers that you can study to prepare your own assessment answer. The reference solution will be 100% original and unique.

Author: Julia Miles

Julia Miles has been working with international students who are studying in Australia since last 8 years after her postgraduation. Being an international student herself, she decided to offer academic support and assistance to other students coming to Australian universities. Her hold of the concepts and theories in the domain of Information Technology give her a broad base to approach the same topics.With My Assignment Services, she utilises her knowledge by providing personalised mentoring and assignment writing help. She also holds successful completion of CCNA, a certification course offered by Cisco in information technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

Live Chat Request Call back! Send an E-Mail Order Now
Place Order