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

Username:   Password: 
 RegisterRegister   
 Capitals and lowercase letters in the get statement
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dampflames




PostPosted: Thu Sep 30, 2004 2:27 pm   Post subject: Capitals and lowercase letters in the get statement

How can you make the program ignore the lowercase/uppecase difference in words?
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Thu Sep 30, 2004 2:32 pm   Post subject: (No subject)

Create functions which convert all characters to uppercase or lowercase.

code:
function upperCase(input : string) : string
   % ...
end upperCase
Dan




PostPosted: Thu Sep 30, 2004 3:06 pm   Post subject: (No subject)

or you could use the bulit in ones Rolling Eyes

Str.Lower and Str.Upper
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
wtd




PostPosted: Thu Sep 30, 2004 3:30 pm   Post subject: (No subject)

Nifty.

Still, creating the functiopns would be a great exercise in character arithmetic. Can you manipulate ASCII characters in Turing like you can in C++ and other languages?
rizzix




PostPosted: Thu Sep 30, 2004 3:48 pm   Post subject: (No subject)

hmm such as..? char s = 'a' + 5;

well if ur talking about something like that.. heh noo. its pretty strict and type safe.
wtd




PostPosted: Thu Sep 30, 2004 4:05 pm   Post subject: (No subject)

There aren't even any functions to convert back and forth?

The most type-safe languages available have those.
Mazer




PostPosted: Thu Sep 30, 2004 4:43 pm   Post subject: (No subject)

rizzix wrote:
hmm such as..? char s = 'a' + 5;

well if ur talking about something like that.. heh noo. its pretty strict and type safe.

Something like that can be done, for the same effect.

char s := chr(ord('a') + 5)

I think...
Don't have a copy of turing here to test it.
wtd




PostPosted: Thu Sep 30, 2004 4:46 pm   Post subject: (No subject)

Coutsos wrote:
rizzix wrote:
hmm such as..? char s = 'a' + 5;

well if ur talking about something like that.. heh noo. its pretty strict and type safe.

Something like that can be done, for the same effect.

char s := chr(ord('a') + 5)


Beautiful.

code:
let s = char_of_int (int_of_char 'a' + 5)


Wink
Sponsor
Sponsor
Sponsor
sponsor
Mazer




PostPosted: Thu Sep 30, 2004 4:48 pm   Post subject: (No subject)

Heh, pretty much. I'm not sure if it can be done better...
wtd




PostPosted: Thu Sep 30, 2004 4:56 pm   Post subject: (No subject)

code:
s = ('a'[0] + 5).chr
the_short1




PostPosted: Thu Sep 30, 2004 6:36 pm   Post subject: (No subject)

i have turing..
put chr(ord('a') + 5)
produces the letter 'f' ..perfect!
rizzix




PostPosted: Thu Sep 30, 2004 7:45 pm   Post subject: (No subject)

yea wtd they do have fuctions to convert between formats.. ehm nvm.. u've already figure it out: ord
the_short1




PostPosted: Fri Oct 01, 2004 10:35 pm   Post subject: (No subject)

thx u guys tho...

i learnt something new..
believe it or not... i never really 'learned' ord..

that day of class... i kinda got someone else to do it cuz i was really tired.. and i much rathared listen to musik and not do any work.. Wink
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  [ 13 Posts ]
Jump to:   


Style:  
Search: