
-----------------------------------
dampflames
Thu Sep 30, 2004 2:27 pm

Capitals and lowercase letters in the get statement
-----------------------------------
How can you make the program ignore the lowercase/uppecase difference in words?

-----------------------------------
wtd
Thu Sep 30, 2004 2:32 pm


-----------------------------------
Create functions which convert all characters to uppercase or lowercase.

function upperCase(input : string) : string
   % ...
end upperCase

-----------------------------------
Dan
Thu Sep 30, 2004 3:06 pm


-----------------------------------
or you could use the bulit in ones :roll: 

Str.Lower and Str.Upper

-----------------------------------
wtd
Thu Sep 30, 2004 3:30 pm


-----------------------------------
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
Thu Sep 30, 2004 3:48 pm


-----------------------------------
hmm such as..? char s = 'a' + 5;  

well if ur talking about something like that.. heh noo. its pretty strict and type safe.

-----------------------------------
wtd
Thu Sep 30, 2004 4:05 pm


-----------------------------------
There aren't even any functions to convert back and forth?  

The most type-safe languages available have those.

-----------------------------------
Mazer
Thu Sep 30, 2004 4:43 pm


-----------------------------------
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
Thu Sep 30, 2004 4:46 pm


-----------------------------------
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.

let s = char_of_int (int_of_char 'a' + 5)

;)

-----------------------------------
Mazer
Thu Sep 30, 2004 4:48 pm


-----------------------------------
Heh, pretty much. I'm not sure if it can be done better...

-----------------------------------
wtd
Thu Sep 30, 2004 4:56 pm


-----------------------------------
s = ('a'[0] + 5).chr

-----------------------------------
the_short1
Thu Sep 30, 2004 6:36 pm


-----------------------------------
i have turing..
put chr(ord('a') + 5) 
produces the letter 'f' ..perfect!

-----------------------------------
rizzix
Thu Sep 30, 2004 7:45 pm


-----------------------------------
yea wtd they do have fuctions to convert between formats.. ehm nvm.. u've already figure it out: ord

-----------------------------------
the_short1
Fri Oct 01, 2004 10:35 pm


-----------------------------------
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.. ;)
