

-----------------------------------

Gprime10

Fri May 28, 2010 1:09 pm


Turing problem sheet

-----------------------------------

What is it you are trying to achieve?
I have 2 problems here

First one. "Write a Turing Program that will randomly place 50 red circles of radius 10 on a black background.
Once the circles have been drawn, have the program output a white X from corner to corner across the screen using DRAWLIBNE

Second 
Write a program that will draw a striped patten of lines of random colors at an angle of 45degrees to the bottom of the screen. The program should stop once the screen is covered 



What is the problem you are having?
No idea what I'm doing teacher is kinda bad

Describe what you have tried to solve this problem
none






Please specify what version of Turing you are using
4.1.1


-----------------------------------

BigBear

Fri May 28, 2010 1:53 pm


RE:Turing problem sheet

-----------------------------------

Problem #1

You need to draw draw 50 circles in random spots
First how do you draw a circle?
Second how do you get a random number?
Third how do you drawline?

Problem #2

Once you know how to drawlines you can have a loop of drawing lines across the screen and change the colour that you are drawing.


-----------------------------------

Unnamed.t

Fri May 28, 2010 2:17 pm


Re: Turing problem sheet

-----------------------------------

The first problem is fairly easy. You should know how to use variables and the randint / Rand.Int command. And you'll have to know about loops or for loops

The Turing reference is a great place to start at learning these commands, methods and control flow statements. You should try asking for help from peers at school or other people who have already completed the course you are currently taking. I hope this helped.


-----------------------------------

supaphreek

Sat May 29, 2010 10:33 am


RE:Turing problem sheet

-----------------------------------

First one :..
You want to draw 50 random circles with a radius of 10. So there are several commands you have to look at. The first is Rand.Int (a,b)
The a is the smallest number and b is the largest. (set those values to what you want).
You also need to draw a white x using drawline.

Now if you think about what an actual window is, and maxx and maxy (which means the maximum amount, you can easily create this.)

Il give you one diagonal line, and its up to you to create the other.

Draw.Line (0,0,maxx,maxy,black)

If you look at what it does, it starts a line from the very bottom left, and to the top right. Try and create one from the top left to the bottom right :).

