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

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




PostPosted: Wed Apr 02, 2008 12:17 pm   Post subject: Turing Boat

Hi, Im wondering how i can create a boat in turing and if someone can post a example.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Apr 02, 2008 12:38 pm   Post subject: Re: Turing Boat

here's a boat


boat.gif
 Description:
 Filesize:  11.96 KB
 Viewed:  1056 Time(s)

boat.gif


Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
petree08




PostPosted: Wed Apr 02, 2008 1:16 pm   Post subject: RE:Turing Boat

put "boat"
asdf001




PostPosted: Wed Apr 02, 2008 8:18 pm   Post subject: Re: Turing Boat

I ment on drawline and drawbox can someone post a example of that ?
Nyrd




PostPosted: Wed Apr 02, 2008 8:37 pm   Post subject: Re: Turing Boat

Giving you an example would essentially be doing it for you.
If you know how to use Draw.Line and such, just tinker with it until you figure it out.
If you don't know how to use the Draw functions, the inbuilt Turing help is pretty good and http://compsci.ca/v3/viewtopic.php?t=8808
also helps ALOT!
asdf001




PostPosted: Wed Apr 02, 2008 8:53 pm   Post subject: Re: Turing Boat

Nyrd @ Wed Apr 02, 2008 8:37 pm wrote:
Giving you an example would essentially be doing it for you.
If you know how to use Draw.Line and such, just tinker with it until you figure it out.
If you don't know how to use the Draw functions, the inbuilt Turing help is pretty good and http://compsci.ca/v3/viewtopic.php?t=8808
also helps ALOT!


The draw line command is confusing i dont know how to make it move to make it move a certain part of the screen and sometimes the line goes big
Nyrd




PostPosted: Wed Apr 02, 2008 9:12 pm   Post subject: RE:Turing Boat

In order to draw a line from point A to point B on the screen you would need to use the Draw.Line command. In the following x1 and y1 would be equal to the coordinates of point A, and x2 and y2 would be equal to the coordinates of point B, colour is equal to the colour of the line.

code:

Draw.Line (x1,y1,x2,y2,colour)


to make the line move you just erase and redraw it a bit further down. That can be done like this
(This line moves across the screen)
code:

 for i : 1..100
   Draw.Line (x1+i,y1,x2+i,y2,colour) %draw the line
  delay(50)
  Draw.Line (x1+i,y1,x2+i,y2,white) %This will erase the line(if white is the background colour)
end for


If that doesn't help enough, give us whatever code you have and we'll help from there. Smile
Tony




PostPosted: Fri Apr 04, 2008 12:32 am   Post subject: RE:Turing Boat

http://compsci.ca/blog/if-a-programming-language-was-a-boat/
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
theone07




PostPosted: Thu Jan 22, 2009 3:39 pm   Post subject: RE:Turing Boat

hey guys i really need some help with turing on how to write number conversion programs i.e. binary to decimal etc. please help!!!!!!!
andrew.




PostPosted: Thu Jan 22, 2009 4:29 pm   Post subject: RE:Turing Boat

Hey Tony, everytime I click that link in Safari, Safari stops responding. I've never really looked at the blog in Safari before, but if all the pages are like that, you should try and fix it. It worked fine in Camino though and the article makes sense.
dc116




PostPosted: Fri Jan 23, 2009 4:46 pm   Post subject: RE:Turing Boat

Uhh, just out of curiosity, how do you draw the water waves? It would be really difficult with Draw.Arc!
saltpro15




PostPosted: Fri Jan 23, 2009 5:21 pm   Post subject: RE:Turing Boat

wouldn't be that difficult...
A.J




PostPosted: Fri Jan 23, 2009 5:34 pm   Post subject: RE:Turing Boat

I believe that you can simulates the waves by means of trigonometric functions (i.e. sine and cosine waves)

you can translate it to your needs to make it look like whaever from of water waves you want
DanielG




PostPosted: Fri Jan 23, 2009 5:36 pm   Post subject: RE:Turing Boat

it's not that hard, use sin, for i : 1 .. size of your screen, drawline (i,0, 50+10*sind(i), blue) end for

I can't use turing now to check, but it should work.
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  [ 14 Posts ]
Jump to:   


Style:  
Search: