Page 1 of 1

my brain just exploded

Posted: Sun Dec 02, 2007 2:52 am
by boabyfett
what a saterday, this is my whole fecking saterday:

A function to label ASCII code as follows

1 - for lower case
2 - for upper case
0 - all other cases

function ARRTEST(arr)

{
var temp in Int
var index in Int
var outArr in Array (of size SIZE(arr)) of Int
var oldVal in Char
var newVal in Int
for (index <-- 1 to SIZE(outArr))

{

oldVal <-- AT(index,arr)
temp <-- ASC(oldVal)
newVal <-- 0


if (temp >= 65 /\ temp <= 90) then
{ newVal <-- 2 }
if (temp >= 97 /\ temp <= 122) then
{ newVal <-- 1 }

outArr <-- PUT(index,outArr,newVal)
TRACE(newVal,oldVal,outArr)
}
return outArr
}

The code that calls the above function and gives values to inputs

var anArr in Array(of size 4) of Char
anArr <-- ['Q','2','Q','q']
show(anArr)
show(ARRTEST(anArr))

Ive another question to do before bed and its nearly 3am. i need a beer.

b

Posted: Sun Dec 02, 2007 9:45 am
by Wyvern
I don't know what the fuck you just said... but you special, man :P