User Control Panel
Advertisements

HELP US, HELP YOU!

Perl Code Colorizer

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Programming Challenges and AI thoughts
View unanswered posts
Author Message
MeltingWax
Member
Member


Joined: 27 Jan 2004
Posts: 132
Location: I dunno, but the padded walls are sweet...
Reputation: 30.4Reputation: 30.4Reputation: 30.4

PostPosted: Sun Mar 27, 2005 1:13 am    Post subject: Reply with quote

Make a script that will generate an html page that will mimic the colorizing done below. If you don't know any html, you can use a gui library. If you don't know either, I'm sorry Sad. Here is how it should be colored:



http://img216.exs.cx/img216/6745/coloringexample9iq.jpg

Make the script so it can be used for any spacing style. By that I mean do not make it rely on people using tab indentations and new lines for blocks of code.

You can ignore the comments and #!/usr/bin/perl if you want to, they would make everything much harder. I know there are a lot of programs out there that will do this, so please don't cheat. If this is unrealistically hard let me know Sad .
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Sun Mar 27, 2005 1:36 am    Post subject: Reply with quote

You could just use Syntax::Highlight::Perl (and look at Tk::CodeText::Perl to see how that module selects the different types of Perl elements).
_________________
Current Site (2008) http://www.cuvou.com/
Back to top
M4RTIN
Member
Member


Joined: 31 Dec 2004
Posts: 134

Reputation: 19.2Reputation: 19.2

PostPosted: Sun Mar 27, 2005 7:29 am    Post subject: Reply with quote

The opening and closing style for sub's is good. Smile

with the:

[X] sub rawr {
| | hehe
| | hehe
|_ }
Back to top
MeltingWax
Member
Member


Joined: 27 Jan 2004
Posts: 132
Location: I dunno, but the padded walls are sweet...
Reputation: 30.4Reputation: 30.4Reputation: 30.4

PostPosted: Sun Mar 27, 2005 9:58 pm    Post subject: Reply with quote

I know very well that there are numerous programs and modules that will already do this. But I'm putting this up as a challenge, to see if you can do it yourself without looking at examples Razz .

Yeah, the opening/closing is nice, but please read and understand the purpose of this topic before posting...
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Programming Challenges and AI thoughts All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group