• tile-compare Quellcode
  • tilecompare
  • 11.01.2021
Um die Lizenzinformationen zu sehen, klicken Sie bitte den gewünschten Inhalt an.

Schriftgröße S

ActionScript
package de.hwh.bsp.hallowelt
{
import flash.display.Sprite;
import flash.events.Event;
public class Main extends Sprite
{
public function Main()
{
if (stage)
init();
else
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
trace("Hallo Welt!");
}
}
}
Hallo Welt!
AppleScript
say "Hallo Welt"
display dialog "Hallo Welt"
Hallo Welt!
Arduino
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Arduinos kommunizieren bevorzugt mit anderen elektronischen Komponenten. Ein einfaches Minimal-Beispiel ist also beispielsweise eine einzelne LED zum Blinken zu bringen. Quelle: https://www.grund-wissen.de/elektronik/arduino/erste-beispiele.html
Bash
foo="Hallo, Welt"
echo "$foo"
Bash-Skripte sind geeignet um Programme, gemäß der eigenen Bedürfnisse, miteinander zu kombinieren und sie spielen eine zentrale Rolle im Alltag der Systemadministration.
BASIC
cls
print "Hello World in BASIC!"
sleep
end
Ein Hello World!, auch bekannt als Hallo Welt!, wird traditionell verwendet, um Anfänger in eine Programmiersprache, zum Beispiel BASIC, einzuführen.
Clojure
bash-3.2$ lein repl
nREPL server started on port 59553 on host 127.0.0.1
REPL-y 0.2.1
Clojure 1.5.1
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (prn "Hello World")
"Hello World"
nil
user=> (println "Hello World")
Hello World
nil
user=> (pr-str "Hello World")
"\"Hello World\""
This is always the first tiny baby step when learning a programming language. Let’s try “Hello, World!” in Clojure.
CMake
> cmake --build .
Scanning dependencies of target prog
[ 50%] Building CXX object CMakeFiles/prog.dir/main.cpp.obj
[100%] Linking CXX executable prog.exe
[100%] Built target prog
> ./prog.exe
Hello CMake!
CMake is one of the most popular build systems for C++ out there. One of the main reasons probably is that it is cross-platform: It does not build the project itself but operates a platform-specific system.

Schriftgröße M

CoffeeScript
coffee> console.log "Hello World!"
CoffeeScript ist eine relativ junge Sprache, die nach JavaScript kompiliert wird. CoffeeScript hat eine goldene Regel: Es ist einfach JavaScript
C++
#include <iostream>
using namespace std;
int main() {
cout << "Hallo, Welt!" << std::endl;
return 0;
}
C++ (zeh plus plus ausgesprochen) is eine kompilierte Allzweck Programmiersprache. Ihre Komplexität liegt zwischen Einsteiger und Fortgeschritten, da sie sowohl High-Level als auch Low-Level Sprachelemente vereint. Sie bietet imperative, objekt-orientiert
C-Sharp (C#)
using System;
namespace HelloWorldApp {
class Geeks {
static void Main(string[] args)
Console.WriteLine("Hello World!");
Console.ReadKey();
}
}
}
In C#, a basic program consists of the following: A Namespace Declaration,
Class Declaration & Definition,
Class Members (like variables, methods etc.), Main Method, Statements or Expressions.
CSS
<style type="text/css">
h1 {
color: DeepSkyBlue;
}
</style>
<h1>Hello, world!</h1>
Bring the text "Hello, world!" to the user's screen could easily be accomplished in pure HTML, without the use of any CSS, so we'll spice it up just a bit with a different color:
Dart
void main() {
print('Hello, World!');
}
This collection is not exhaustive—it’s just a brief introduction to the language for people who like to learn by example.
Delphi
Label1.Caption := 'Hello world';
Auf die neue Form setzt man nun einen Button und ein Label (beides Registerkarte Standard). Wenn man nun doppelt auf den Button klickt, öffnet sich das Code-Fenster. Hier geben Sie folgendes ein:
Elixir
# module_name.ex
defmodule ModuleName do
def hello do
IO.puts "Hello World"
end
end
This is a quick introduction to the Elixir syntax for Erlang developers and vice-versa.

Schriftgröße L

Elm
module HelloWorld exposing (..)
import Html exposing (text)
main =
text "Hello, World!"
And, that’s it! We can write Hello World in Elm in just a few lines of code, but what’s really going on in this code?
Erlang
% module_name.erl
-module(module_name). % you may use some other name
-compile(export_all).
hello() ->
io:format("~s~n", ["Hello world!"]).
when you want to define a named function, Erlang expects it to be inside of a module, and modules have to be compiled.
Excel
Sub helloWorld()
MsgBox ("Hello World!")
End Sub
Sub helloWorldInZelle()
Sheets("Tabelle1").Select
Cells(1, 1).Value = "Hello World!"
End Sub
Mit dem Tabellenkalkulationsprogramm Excel könnt Ihr nicht nur Diagramme und Statistiken erstellen sondern habt auch die Möglichkeit im Hintergrund komplexe Programme mit VBA (Visual Basic for Applications) zu programmieren.
F#
open System
[<EntryPoint>]
let main argv =
printfn "Hello World"
Console.ReadLine() |> ignore
0
programmers well know, it is customary to start with a “Hello World” example.
So we will be doing just that. So without further ado, what does it take to create a stand alone “Hello World” app in F#.
Go
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
Our first program will print the classic “hello world” message. Here’s the full source code.
Groovy
println 'Hello Groovy-World!'
Zwei Merkmale sind hier auf jeden Fall zu nennen und insbesondere die Kombination aus beiden macht Groovy im Moment so einzigartig:
ausdrucksstarke, prägnante Syntax und dynamische Eigenschaften
perfekte Integration mit Java.
Haskell
Prelude> putStrLn "Hello World"
Hello World
Haskell is a general purpose, purely functional programming language. This page will help you get started as quickly as possible.

Schriftgröße XL

Haxe
class Main {
static public function main():Void {
trace("Hello World");
}
}
The following program prints "Hello World" after being compiled and run:
Java
public class HelloWorld
{
public static void main (String[] args)
{
// Ausgabe Hello World!
System.out.println("Hello World!");
}
}
In Java programmiert man aufgrund der zugrunde liegenden Objektorientierung immer in Klassen. Dem Thema werden wir uns später noch ausführlicher widmen.
JavaScript
<script>
alert( 'Hello, world!' );
</script>
JavaScript programs can be inserted into any part of an HTML document with the help of the <script> tag.
JSON
<!DOCTYPE html>
<html>
<head>
<title>Test Javascript</title>
<script type="text/javascript">
let hello_world = {"Hello":"World"};
alert(hello_world.Hello);
</script>
</head>
<body>
<h2>JSON Hello World</h2>
<p>This is a test program to alert Hello world!</p>
</body>
</html>
Now that we have a basic understanding of JSON, let us work on our Hello World program.
Julia
println("hello world")
#> hello world
Set of unofficial examples of Julia the high-level, high-performance dynamic programming language for technical computing.
Kotlin
fun main(args: Array<String>) {
println("Hello World!")
}
Let's get straight to the point - type this into a file with the extension .kt:
LaTeX
Man kann auch ganz andere Geräte (Ha, der erste richtige Umlaut außer
Esszett!) referenzieren, zum Beispiel die fundamentale Gleichung Nummer
\ref{Gleichung}.
\begin{equation}\label{Gleichung}
\int^{\infty}_{-\infty} e^{-x^{2}}dx = \sqrt{\pi}
\end{equation}
Let's get straight to the point - type this into a file with the extension .kt:
Lisp
(defun f(x) (/
(+ (* x x) 3)
(- a x)))
Set of unofficial examples of Julia the high-level, high-performance dynamic programming language for technical computing.
Lua
#!/usr/local/bin/lua
-- Lua Code für die Ausführung
Now that we have a basic understanding of JSON, let us work on our Hello World program.
Markdown
Dieses \textbf{Wort} ist fett.
JavaScript programs can be inserted into any part of an HTML document with the help of the <script> tag.

Weitere Beispiele für Sprachen

MATLAB
bar(b)
xlabel('Sample #')
ylabel('Pounds')
Matlab Beispielcode
Objective-C
output = [object methodWithOutput];
output = [object methodWithInputAndOutput:input];
Objective-c Beispielcode
OCaml
# let square x = x * x;;
val square : int -> int = <fun>
# square 3;;
- : int = 9
# let rec fact x =
if x <= 1 then 1 else x * fact (x - 1);;
val fact : int -> int = <fun>
# fact 5;;
- : int = 120
# square 120;;
- : int = 14400
OCaml Beispielcode
PHP
cd ../php-x.x.x
./configure --enable-fpm --with-mysqli
make
sudo make install
PHP Beispielcode
Text
{{Beispiel|zeige=Beispiel:Beispiel.txt|
{{BeispielCode|…}}
}}
Text Beispielcode
Python
laenge_zoll = input("Bitte Länge in Zoll eingeben:")
laenge_cm = laenge_zoll * 2.54
print "Ergebnis:", laenge_cm , "Zentimeter"
Python Beispielcode
Ruby
some_list.each do |item|
# Wir sind im Innern des Blocks
# und arbeiten mit item.
end
Ruby Beispielcode
Rust
cat << EOF > ./rust-tutorial.rs
fn main() {
println!("Hello, World!");
}
EOF
Rust Beispielcode
Scala
> scala -classpath . HalloWelt
Hallo, Welt!
Scala Beispielcode
Scheme
(define a-number 42)
(define square
(lambda (x)
(* x x)))
Scheme Beispielcode
Shell
char shellcode[] =
"\xeb\x2a\x5e\x89\x76\x08\xc6\x46\x07\x00\xc7\x46\x0c\x00\x00\x00"
"\x00\xb8\x0b\x00\x00\x00\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80"
"\xb8\x01\x00\x00\x00\xbb\x00\x00\x00\x00\xcd\x80\xe8\xd1\xff\xff"
"\xff\x2f\x62\x69\x6e\x2f\x73\x68\x00\x89\xec\x5d\xc3";
Shell Beispielcode
SQL
CREATE TABLE <Tabellenname> (
<Spaltenname> <Datentyp> [ NOT NULL ] ,
.....,
<Spaltenname> <Datentyp>
) ;
SQL Beispielcode
Swift
println("Hello, world!")
Swift Beispielcode
TypeScript
const user = {
name: "Hayes",
id: 0,
};
TypeScript Beispielcode
Visual Basic .NET
' Mehrfach genutzte Prozedur
Private Sub AlleSehen()
' Ausnahmebehandlung bei Zugriffsproblem
Try
' Verbindung öffnen
con.Open()
' SQL-Befehl zum Abruf aller Daten erstellen
cmd.CommandText = "SELECT * FROM personen"
' Aufruf einer Prozedur zur Ausgabe
Ausgabe()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
' Verbindung schließen
con.Close()
End Sub
Visual Basic.NET Beispielcode
Visual Basic Script
Dim ObjShell
Dim ShellObject
Set ShellObject = CreateObject("WScript.Shell")
Set ObjShell = ShellObject.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Test")
If ObjShell = "" then
ShellObject.Popup "Wert existiert nicht und wird hinzugefügt","4",""
ShellObject.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "C:\test.vbs"
else
ShellObject.Popup "Wert existiert","3",""
end if
Visual Basic Script Beispielcode
Visual Basic Script HTML
<SCRIPT LANGUAGE="VBScript">
<!--
Function KannLiefern(Dt)
KannLiefern = (CDate(Dt) - Now()) > 2
End Function
-->
</SCRIPT>
Visual Basic Script HTML Beispielcode
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
XML Beispielcode
YAML
database_driver: pdo_pgsql
database_host: localhost
database_port: 5432
database_name: mapbender
database_path: ~
database_user: postgres
database_password: geheim
YAML Beispielcode
x