Utilisateur:DavidL/TestLang
Apparence
Test de coloration syntaxique
Liste des langages
[modifier | modifier le wikicode]AppleScript, Assembly, Asymptote, Awk, Befunge, Boo, BrainFuck, C, C++, C#, Clojure, CoffeeScript, ColdFusion, Common Lisp, Coq, Cryptol, Crystal, Cython, D, Dart, Delphi, Dylan, Elm, Erlang, Ezhil, Factor, Fancy, Fortran, F#, GAP, Gherkin, GL shaders, Groovy, Haskell, IDL, Io, Java, JavaScript, Lasso, LLVM, Logtalk, Lua, Matlab, MiniD, Modelica, Modula-2, MuPad, Nemerle, Nimrod, Objective-C, Objective-J, Octave, OCaml, PHP, Perl, PovRay, PostScript, PowerShell, Prolog, Python 2.x and 3.x (incl. console sessions and tracebacks), REBOL, Red, Redcode, Ruby, Rust, S, S-Plus, R, Scala, Scheme, Scilab, Smalltalk, SNOBOL, Tcl, Vala, Verilog, VHDL, Visual Basic.NET, Visual FoxPro, XQuery, Zephir
Ada
[modifier | modifier le wikicode]with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
Put_Line ("Hello, world!");
end Hello;
#include <stdio.h>
int main(int argc, void** argv)
{
printf("Nombre d'arguments: %d\n", argc);
}
C++
[modifier | modifier le wikicode]#include <iostream>
class Exemple
{
public:
void* methodeQuiNeRetourneRien(/* Sans arguments */);
int methodeQuiRetourneUnEntier(int arg1, char* arg2, float arg3);
private:
int attr1;
void* attr2[40];
char carac='Z';
char name[]="Exemple";
}
C#
[modifier | modifier le wikicode]using System;
/// Classe d'exemple
public class Exemple
{
public static void Main(String[] args)
{
Console.WriteLine("Nombre d'arguments : "+args.length);
}
}
Java
[modifier | modifier le wikicode]package org.wikibooks.fr.example;
/**
Classe d'exemple
@author fr.wikibooks.org
*/
public class Exemple
{
private int count = 20;
public static void main(String[] args)
{
System.out.println("Nombre d'arguments : "+args.length);
}
}
Javascript
[modifier | modifier le wikicode]function exemple(a,b)
{
var n = a+b+100; /* Somme + 100 */
alert("A + B + 100 = " + n);
}
Pascal
[modifier | modifier le wikicode]program hworld;
var a:integer;
begin
a := 50; { Un commentaire }
writeln("Hello world!")
end.
Python
[modifier | modifier le wikicode]def quick_sort(arr):
less = []
pivot_list = []
more = []
if len(arr) <= 1:
return arr
else:
pass