Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-08-09 07:30:31

Patrick
Real Member
Registered: 2006-02-24
Posts: 1,005

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.

#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 00:39:14)


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

Offline

#2 2007-08-12 15:42:44

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

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 (:P), 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..."

Offline

Board footer

Powered by FluxBB