Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing problem sheet
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Gprime10




PostPosted: Fri May 28, 2010 1:09 pm   Post subject: 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






[/syntax]

Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
BigBear




PostPosted: Fri May 28, 2010 1:53 pm   Post subject: 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




PostPosted: Fri May 28, 2010 2:17 pm   Post subject: 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




PostPosted: Sat May 29, 2010 10:33 am   Post subject: 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 Smile.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: