Acmlm's Board - I2 Archive - Programming - A PHP script problem...
User | Post |
Xkeeper
Posts: -4768/-863 |
It didn't do that last night.
Woeh. XD I guess I screwed that up.
Now I just have to add punctuation... possibly just make 256 characters and just use ORD() or something.
But what about lowercase...
EDIT: Look at this:
I added the f= to make it easier to read but it still outputs the same. It ends after "TESTING!?".
1 line: 2 lines: 3 lines: Tetris:
EDIT: WHY IS IT CHOKING ON PERIODS NOW?!?!
And on a side note how it does that. It doesn't work on the top 2 liner but on the bottom one ti does.
... Does it require a space after the ? even if there's already been one? |
Acmlm
Posts: 510/1173 |
I don't know, seems fine to me |
Xkeeper
Posts: -4769/-863 |
Well I got that fixed, but now if you have a ? anywhere after a tilde (~, starts new line) it'll stop.
|
ErkDog
Posts: 183/982 |
I was about to say the same thing Tuvai
you can use those functions
and there is even a
regex expression to do it.... |
Tuvai
Posts: 167/211 |
You do know that there are functions to make characters uppercase and lowercase, right? I'm talking about strtolower() and strtolower(). |
Acmlm
Posts: 497/1173 |
if (ord($d)>=97) $z=ord($d)-86; if (ord($d)>=65) $z=ord($d)-54; If x>97, then there's also x>65, so both lowercase and uppercase get substracted by 54 ... but a simple "else" or order change would fix it
I'm not too sure about the other problem, but you didn't define numbers for ! and ? ... and for some reason, " gives !0 instead of just 0 |
Xkeeper
Posts: -4775/-863 |
for($i=0;$i<$len;$i++){ // ASC "A" is 65 // "a" is 97 $d=$n[$i]; $z=$d; if (ord($d)>=97) $z=ord($d)-86; if (ord($d)>=65) $z=ord($d)-54; if($d=="/") $z=10; if($d=="%") $z=40; if($d==":") $z=41; if($d=="-") $z=42; if($d==" ") $z=43; if($d=="~") { $wtf=-1; $line=$line+1; $z=43; } ImageCopy($img,$gfx,($wtf+$ofs)*8,$line*9,$z*8,0,8,8); $wtf++; }
I'm trying to get it to automatically make lowercase into CAPS and also CAPS subtract 54. However, this effectively makes everything after it stop working. Is there any way to make it work, posibly?
[PS: http://sthick.cymoro.com/wtf/numgfxl.php?n=TESTHERE <--try putting ? ! - into it. It'll come up 0. ] |
|