my brain just exploded

The "I'm Thinking" now thread
Post Reply
User avatar
boabyfett
Vyvyan Basterd
Posts: 4701
Joined: Tue Dec 06, 2005 10:47 pm
Location: In front of my pc forever learning java.

my brain just exploded

Post 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
Wyvern
Captain Pugwash
Posts: 5818
Joined: Mon Dec 05, 2005 9:54 pm
Location: At the helm of Thunderchild

Post by Wyvern »

I don't know what the fuck you just said... but you special, man :P
They got things like the atom bamb... so I'm gonna stay where I... AM!
Post Reply