Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: √ ∞ ≠ ≤ ≥ ≈ ⇒ ∈ Δ θ ∴ ∑ ∫ π -

Login

Username

Password

Not registered yet?

#1 2007-08-10 05:30:31

Patrick
Real Member
Award: Wink Alive

Offline

Code formatting

Since we now have a Coder's Corner, I think perhaps an update of the good ol'  ['code]['/code] function could be nice.

Code:

#include <stdio.h>

int main(){
               if(!MathIsFun) printf("Cry!");
               return 0;
}

Instead of the above, you would get something like:

#include <stdio.h>

int main(){
               if(!MathIsFun) printf("Cry!");
               return 0;
}

You would probably need to do something like. Since I only know PHP and C, I'm not sure about all the other languages, but I guess you could just make a huge list of all the names of functions in C, PHP, C++, JAVA, ..., and then make all functions one colour. So it could be used for all/most programming languages. Is this possible to implement?

Last edited by Patrick (2007-08-10 22:39:14)


Support MathsIsFun.com by clicking on the banners.
What music do I listen to? Clicky click
 

#2 2007-08-13 13:42:44

Ricky
Moderator

Offline

Re: Code formatting

Syntax highlighting is over rated in my opinion.  Useful, but still over rated.  I don't really see the need.  If you really want to look at it with pretty colors (tongue), copy and paste code from here into your favorite editor.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."
 

Board footer

Powered by FluxBB