Code tags
by math_explorer, Oct 28, 2014, 11:00 AM
Everything Dojo deserves some more nicely formatted code samples
edit: PR'ed
And I say this with the utmost respect, of course --- thanks for the service to the community
BBCode source
CSS Tag
C Tag
C++ Tag
Haskell Tag
HTML Tag
Java Tag
JavaScript Tag
Python Tag
edit: PR'ed
And I say this with the utmost respect, of course --- thanks for the service to the community

BBCode source
CSS Tag
body #container .hello:before { content: "Hello, world!"; border: 10px solid black; }
C Tag
#include <stdio.h> int main(void) { if (2 + 2 == 4) { printf("Hello, world!\n"); } return 0; }
C++ Tag
#include <iostream> using namespace std; int main() { if (2 + 2 == 4) { cout << "Hello, world!" << endl; } return 0; }
Haskell Tag
import Control.Monad main :: IO () main = when (2 + 2 == 4) $ putStrLn "Hello, world!"
HTML Tag
<!DOCTYPE html> <html lang="en"> <body> <p>Hello, world!</p> </body> </html>
Java Tag
public class HelloWorld { public static void main(String[] args) { if (2 + 2 == 4) { System.out.println("Hello, world!"); } } }
JavaScript Tag
if (2 + 2 == 4) { console.log('Hello, world!'); }
Python Tag
if __name__ == "__main__" and 2 + 2 == 4: print "Hello, world!"
This post has been edited 1 time. Last edited by math_explorer, Oct 28, 2014, 11:56 AM