langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,4 @@
using System;
using System.Windows.Forms;
MessageBox.Show("Goodbye, World!")

View file

@ -0,0 +1,7 @@
/* NetRexx */
options replace format comments java crossref symbols binary
import javax.swing.
msgText = 'Goodbye, World!'
JOptionPane.showMessageDialog(null, msgText)

View file

@ -0,0 +1,27 @@
/* NetRexx */
options replace format comments java crossref symbols binary
import javax.swing.
msgText = 'Goodbye, World!'
window = JFrame(msgText)
text = JTextArea()
minSize = Dimension(200, 100)
text.setText(msgText)
window.setLayout(FlowLayout())
window.add(text)
window.setMinimumSize(minSize)
window.pack
window.setVisible(isTrue)
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
return
method isTrue() public static returns boolean
return 1 == 1
method isFalse() public static returns boolean
return \isTrue

View file

@ -0,0 +1,88 @@
/* NetRexx */
options replace format comments java crossref symbols binary
class RCHelloWorld_GraphicalAWT_01 extends Dialog implements ActionListener
properties private constant
msgText = 'Goodbye, World!'
properties indirect
ok = boolean
can = boolean
okButton = Button
canButton = Button
buttonPanel = Panel
method RCHelloWorld_GraphicalAWT_01(frame = Frame, msg = String, canaction = boolean) public
super(frame, 'Default', isTrue)
setLayout(BorderLayout())
add(BorderLayout.CENTER, Label(msg))
addOKCancelPanel(canaction)
createFrame()
pack()
setVisible(isTrue)
return
method RCHelloWorld_GraphicalAWT_01(frame = Frame, msg = String) public
this(frame, msg, isFalse)
return
method addOKCancelPanel(canaction = boolean)
setButtonPanel(Panel())
getButtonPanel.setLayout(FlowLayout())
createOKButton()
if canaction then do
createCancelButton()
end
add(BorderLayout.SOUTH, getButtonPanel)
return
method createOKButton()
setOkButton(Button('OK'))
getButtonPanel.add(getOkButton)
getOkButton.addActionListener(this)
return
method createCancelButton()
setCanButton(Button('Cancel'))
getButtonPanel.add(getCanButton)
getCanButton.addActionListener(this)
return
method createFrame()
dim = getToolkit().getScreenSize
setLocation(int(dim.width / 3), int(dim.height / 3))
return
method actionPerformed(ae = ActionEvent) public
if ae.getSource == getOkButton then do
setOk(isTrue)
setCan(isFalse)
setVisible(isFalse)
end
else if ae.getSource == getCanButton then do
setCan(isTrue)
setOk(isFalse)
setVisible(isFalse)
end
return
method main(args = String[]) public constant
mainFrame = Frame()
mainFrame.setSize(200, 200)
mainFrame.setVisible(isTrue)
message = RCHelloWorld_GraphicalAWT_01(mainFrame, msgText, isTrue)
if message.isOk then
say 'OK pressed'
if message.isCan then
say 'Cancel pressed'
message.dispose
mainFrame.dispose
return
method isTrue() public static returns boolean
return 1 == 1
method isFalse() public static returns boolean
return \isTrue

View file

@ -0,0 +1,14 @@
let delete_event evt = false
let destroy () = GMain.Main.quit ()
let main () =
let window = GWindow.window in
let _ = window#set_title "Goodbye, World" in
let _ = window#event#connect#delete ~callback:delete_event in
let _ = window#connect#destroy ~callback:destroy in
let _ = window#show () in
GMain.Main.main ()
;;
let _ = main () ;;

View file

@ -0,0 +1,5 @@
let () =
let main_widget = Tk.openTk () in
let lbl = Label.create ~text:"Goodbye, World" main_widget in
Tk.pack [lbl];
Tk.mainLoop();;

View file

@ -0,0 +1,7 @@
let () =
let action () = exit 0 in
let main_widget = Tk.openTk () in
let bouton_press =
Button.create main_widget ~text:"Goodbye, World" ~command:action in
Tk.pack [bouton_press];
Tk.mainLoop();;

View file

@ -0,0 +1,15 @@
use Qt;
bundle Default {
class QtExample {
function : Main(args : String[]) ~ Nil {
app := QAppliction->New();
win := QWidget->New();
win->Resize(400, 300);
win->SetWindowTitle("Goodbye, World!");
win->Show();
app->Exec();
app->Delete();
}
}
}

View file

@ -0,0 +1,3 @@
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setMessageText:@"Goodbye, World!"];
[alert runModal];

View file

@ -0,0 +1,2 @@
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Goodbye, World!" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease];
[alert show];

View file

@ -0,0 +1 @@
MESSAGE "Goodbye, World!" VIEW-AS ALERT-BOX.

View file

@ -0,0 +1,23 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.24.dtd">
<glade-interface>
<widget class="GtkWindow" id="hworld">
<property name="visible">True</property>
<property name="title">Hello World</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="default_width">200</property>
<property name="default_height">100</property>
<signal name="delete_event" handler="on_hworld_delete_event"/>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Farewell, cruel world.</property>
</widget>
</child>
</widget>
</glade-interface>

View file

@ -0,0 +1,47 @@
// Display a Message in a GUI Window
//
// Nigel Galloway, April 18th., 2012.
//
namespace HelloWorldGUI;
interface
uses
Glade, Gtk, System;
type
Program = public static class
public
class method Main(args: array of String);
end;
MainForm = class(System.Object)
private
var
[Widget] hworld: Gtk.Window;
public
constructor(args: array of String);
method on_hworld_delete_event(aSender: Object; args: DeleteEventArgs);
end;
implementation
class method Program.Main(args: array of String);
begin
new MainForm(args);
end;
constructor MainForm(args: array of String);
begin
inherited constructor;
Application.Init();
with myG := new Glade.XML(nil, 'HelloWorldGUI.Main.glade', 'hworld', nil) do myG.Autoconnect(self);
Application.Run();
end;
method MainForm.on_hworld_delete_event(aSender: Object; args: DeleteEventArgs);
begin
Application.Quit();
end;
end.

View file

@ -0,0 +1,18 @@
namespace HelloWorldNET;
interface
type
App = class
public
class method Main;
end;
implementation
class method App.Main;
begin
System.Windows.MessageBox.Show("Farewell cruel world");
end;
end.

View file

@ -0,0 +1,5 @@
declare
[QTk] = {Module.link ['x-oz://system/wp/QTk.ozf']}
Window = {QTk.build td(label(text:"Goodbye, World!"))}
in
{Window show}

View file

@ -0,0 +1,22 @@
program HelloWorldGraphical;
uses
glib2, gdk2, gtk2;
var
window: PGtkWidget;
begin
gtk_init(@argc, @argv);
window := gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), 'Goodbye, World');
g_signal_connect (G_OBJECT (window),
'delete-event',
G_CALLBACK (@gtk_main_quit),
NULL);
gtk_widget_show_all (window);
gtk_main();
end.

View file

@ -0,0 +1,30 @@
# Translated from http://www.mono-project.com/GtkSharp:_Hello_World
constant $GTK = "gtk-sharp,Version=2.12.0.0,Culture=neutral,PublicKeyToken=35e10195dab3c99f";
constant Application = CLR::("Gtk.Application,$GTK");
constant Window = CLR::("Gtk.Window,$GTK");
constant Button = CLR::("Gtk.Button,$GTK");
Application.Init;
# Set up a button object.
my $btn = Button.new("Goodbye, World!");
$btn.add_Clicked: sub ($obj, $args) { #OK
# runs when the button is clicked.
say "Goodbye, World!";
Application.Quit;
};
my $window = Window.new("goodbyeworld");
$window.add_DeleteEvent: sub ($obj, $args) { #OK
# runs when the user deletes the window using the "close
# window" widget in the window frame.
Application.Quit;
};
# Add the button to the window and display everything
$window.Add($btn);
$window.ShowAll;
Application.Run;

View file

@ -0,0 +1,9 @@
%!PS
% render in Helvetica, 12pt:
/Helvetica findfont 12 scalefont setfont
% somewhere in the lower left-hand corner:
50 dup moveto
% render text
(Goodbye, World!) show
% wrap up page display:
showpage

View file

@ -0,0 +1,3 @@
FUNCTION PBMAIN() AS LONG
MSGBOX "Goodbye, World!"
END FUNCTION

View file

@ -0,0 +1 @@
New-Label "Goodbye, World!" -FontSize 24 -Show

View file

@ -0,0 +1,9 @@
$form = New-Object System.Windows.Forms.Form
$label = New-Object System.Windows.Forms.Label
$label.Text = "Goodbye, World!"
$form.AutoSize = $true
$form.AutoSizeMode = [System.Windows.Forms.AutoSizeMode]::GrowAndShrink
$form.Controls.Add($label)
$Form.ShowDialog() | Out-Null

View file

@ -0,0 +1 @@
[System.Windows.Forms.MessageBox]::Show("Goodbye, World!")

View file

@ -0,0 +1 @@
MessageRequester("Hello","Goodbye, World!")

View file

@ -0,0 +1 @@
MessageBox_(#Null,"Goodbye, World!","Hello")

View file

@ -0,0 +1 @@
alert "Goodbye, World!"

View file

@ -0,0 +1 @@
MessageBox("Goodbye, World!", "RapidQ example", 0)

View file

@ -0,0 +1,5 @@
import vis::Figure;
import vis::Render;
public void GoodbyeWorld() =
render(box(text("Goodbye World")));

View file

@ -0,0 +1,2 @@
' do it with javascript
html "<script>alert('Goodbye, World!');</script>"

View file

@ -0,0 +1,21 @@
$ include "seed7_05.s7i";
include "draw.s7i";
include "keybd.s7i";
include "bitmapfont.s7i";
include "stdfont24.s7i";
include "pixmap_file.s7i";
const proc: main is func
local
var text: screen is STD_NULL;
begin
screen(400, 100);
clear(curr_win, white);
KEYBOARD := GRAPH_KEYBOARD;
screen := openPixmapFontFile(curr_win);
color(screen, black, white);
setFont(screen, stdFont24);
setPosXY(screen, 68, 60);
write(screen, "Goodbye, World");
ignore(getc(KEYBOARD));
end func;

View file

@ -0,0 +1 @@
I want window and the window title is "Goodbye, World".

View file

@ -0,0 +1,3 @@
Dialog
Text "Goodbye, World!"
EndDlog

View file

@ -0,0 +1 @@
whiptail --title 'Farewell' --msgbox 'Goodbye, World!' 7 20

View file

@ -0,0 +1 @@
dialog --title 'Farewell' --msgbox 'Goodbye, World!' 7 20

View file

@ -0,0 +1 @@
xmessage 'Goodbye, World!'

View file

@ -0,0 +1 @@
zenity --info --text='Goodbye, World!'

View file

@ -0,0 +1 @@
yad --title='Farewell' --text='Goodbye, World!'

View file

@ -0,0 +1 @@
Statline_Message("Goodbye, World!")

View file

@ -0,0 +1 @@
Dialog_Input_1(1,"`Vedit example`,`Goodbye, World!`")

View file

@ -0,0 +1,5 @@
Module GoodbyeWorld
Sub Main()
Messagebox.Show("Goodbye, World!")
End Sub
End Module

View file

@ -0,0 +1,3 @@
Sub Main()
MsgBox "Goodbye, World!"
End Sub

View file

@ -0,0 +1,26 @@
;;; hellowin.asm
;;;
;;; nasm -fwin32 hellowin.asm
;;; link -subsystem:console -out:hellowin.exe -nodefaultlib -entry:main \
;;; hellowin.obj user32.lib kernel32.lib
global _main
extern _MessageBoxA@16
extern _ExitProcess@4
MessageBox equ _MessageBoxA@16
ExitProcess equ _ExitProcess@4
section .text
_main:
push 0 ; MB_OK
push title ;
push message ;
push 0 ;
call MessageBox ; eax = MessageBox(0,message,title,MB_OK);
push eax ;
call ExitProcess ; ExitProcess(eax);
message:
db 'Goodbye, World',0
title:
db 'RosettaCode sample',0

View file

@ -0,0 +1,9 @@
;use win32ax for 32 bit
;use win64ax for 64 bit
include 'win64ax.inc'
.code
start:
invoke MessageBox,HWND_DESKTOP,"Goodbye,World!","Goodbye",MB_OK
invoke ExitProcess,0
.end start