Rainbow code

Started by cormullion, November 21, 2008, 04:29:25 PM

Previous topic - Next topic

cormullion

I was fascinated by the discussion this week on code colouring - enough to want to try out various schemes for myself... So I've whipped up a quick newLISP-GS app for exploring them via HTML styles. Basically I've quickly merged two projects to produce this one:



http://unbalanced-parentheses.nfshost.com/downloads/rainbow-code.lsp">//http://unbalanced-parentheses.nfshost.com/downloads/rainbow-code.lsp



It's very much a hack, and prone to crashing, but you may find it fun...



I'd be interested to see it running on your machine...?!



(PS: If you're not using a UTF8 system, you may have to replace the utf8len functions with length...)

newdep

#1
Nice work cormullion... ;-)



The code does run here, partly ;-)

...first time i saw the unicode catch, Though I cant update the color

fields...everytime I type a new color it resets to the old value...



if you type this in the input field ->

9870987098709870987098709870987097890870978.....etc..

it moves to -1 in the output field, not a bug probably a format issue...



Ill have a closer look in the code... ;-)
-- (define? (Cornflakes))

cormullion

#2
Oh rats... I was hoping it would run OK on someone else's machine...



Any input in all but the first field (font-size) should be truncated to six chars and prefixed with a #.



It's supposed to look like this:



http://unbalanced-parentheses.nfshost.com/data/images/rainbow.png">



Perhaps it's a locale issue?



Sorry!

m i c h a e l

#3
Works fine here :-)



http://www.neglook.com/images/rainbow-code.png">



m i c h a e l

cormullion

#4
Phew, thanks. I'm not completely mad, then...:)