![]() |
Object Oriented Turing Help?
I can't find any documentation, any help, or any tutorials that can answer these simple questions:
How do I retrieve certain parts of a string or integer, how do I convert types, and how can I find the remainder of division? |
1) The equivelent in python is:
print 'Hello'[1:4] >>> ell print 'Boo'[-3] >>> B 2) So what? Should I just go: var new : int := old 3) but isn't % the comment sign? EDIT: Wowzor...where'd your post go? :rolleyes: |
It was completely wrong (I thought) so I removed it.
|
Hehe, I didn't know you could remove posts, so I thought it was a glitch. =S
But after much experimentation: :
put 5 mod 3will give you 2. Whoppee. |
I have to learn Turing for a computer science course.
It wil be quite a dissapointment going from C(++). :( |
Where do you live by the way? I don't see Turing being a practical high school course language at all...
You will find it very easy though, no worries. ;) |
Quote:
|
Wow! That would explain it!! Right beside the University of Waterloo too. O_O
Could you PM me your MSN address? We could use eachother as study help for this course. :rolleyes: |
Okay. Here it is.
string to integer :
var x : string := "4"integer to string :
var x := 4retrieving parts of a string :
put "word"(1)That all took a while to figure out... -_@ |
| All times are GMT -5. The time now is 8:18 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC