2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,10 +1,13 @@
|
|||
{{selection|Short Circuit|Console Program Basics}}
|
||||
[[Category:Simple]]
|
||||
In this User Output task, the goal is to display the string "Hello world!" [sic] on a text console.
|
||||
|
||||
'''See also'''
|
||||
* [[Hello world/Graphical]]
|
||||
* [[Hello world/Line Printer]]
|
||||
* [[Hello world/Newline omission]]
|
||||
* [[Hello world/Standard error]]
|
||||
* [[Hello world/Web server]]
|
||||
;Task:
|
||||
Display the string '''Hello world!''' on a text console.
|
||||
|
||||
;Related tasks:
|
||||
* [[Hello world/Graphical]]
|
||||
* [[Hello world/Line Printer]]
|
||||
* [[Hello world/Newline omission]]
|
||||
* [[Hello world/Standard error]]
|
||||
* [[Hello world/Web server]]
|
||||
<br><br>
|
||||
|
|
|
|||
1
Task/Hello-world-Text/APL/hello-world-text.apl
Normal file
1
Task/Hello-world-Text/APL/hello-world-text.apl
Normal file
|
|
@ -0,0 +1 @@
|
|||
'Hello world!'
|
||||
|
|
@ -1 +1 @@
|
|||
((main { "Hello world!" << }))
|
||||
"Hello world!" <<
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
open monad io
|
||||
do putStrLn "Googbye, World!" ::: IO
|
||||
do putStrLn "Hello world!" ::: IO
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#symbol Program =
|
||||
#symbol program =
|
||||
[
|
||||
system'console writeLine:"Hello world!".
|
||||
].
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[[
|
||||
#define start ::= "?" < system'console.eval&writeLine( > $literal < ) >;
|
||||
]]
|
||||
#import system.
|
||||
#import system'dynamic.
|
||||
|
||||
? "Hello world!"
|
||||
#symbol program
|
||||
= Tape("Hello world!",system'console,%"writeLine[1]").
|
||||
|
|
|
|||
5
Task/Hello-world-Text/LaTeX/hello-world-text.tex
Normal file
5
Task/Hello-world-Text/LaTeX/hello-world-text.tex
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
\documentclass{scrartcl}
|
||||
|
||||
\begin{document}
|
||||
Hello World!
|
||||
\end{document}
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
.data
|
||||
hello: .asciiz "Hello world!"
|
||||
.data #section for declaring variables
|
||||
hello: .asciiz "Hello world!" #asciiz automatically adds the null terminator. If it's .ascii it doesn't have it.
|
||||
|
||||
.text
|
||||
main:
|
||||
la $a0, hello
|
||||
li $v0, 4
|
||||
syscall
|
||||
li $v0, 10
|
||||
syscall
|
||||
.text # beginning of code
|
||||
main: # a label, which can be used with jump and branching instructions.
|
||||
la $a0, hello # load the address of hello into $a0
|
||||
li $v0, 4 # set the syscall to print the string at the address $a0
|
||||
syscall # make the system call
|
||||
|
||||
li $v0, 10 # set the syscall to exit
|
||||
syscall # make the system call
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
`Hello world!\n' print
|
||||
`Hello world!\n' print flush
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
echo("Hello world!");
|
||||
echo("Hello world!"); // writes to the console
|
||||
text("Hello world!"); // creates 2D text in the object space
|
||||
linear_extrude(height=10) text("Hello world!"); // creates 3D text in the object space
|
||||
|
|
|
|||
|
|
@ -1 +1,5 @@
|
|||
(Hello world!) ==
|
||||
%!PS
|
||||
/Helvetica 20 selectfont
|
||||
70 700 moveto
|
||||
(Hello world!) show
|
||||
showpage
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
(Hello world!) =
|
||||
(Hello world!) ==
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
(Hello world!) print
|
||||
(Hello world!) =
|
||||
|
|
|
|||
1
Task/Hello-world-Text/PostScript/hello-world-text-4.ps
Normal file
1
Task/Hello-world-Text/PostScript/hello-world-text-4.ps
Normal file
|
|
@ -0,0 +1 @@
|
|||
(Hello world!) print
|
||||
8
Task/Hello-world-Text/PostScript/hello-world-text-5.ps
Normal file
8
Task/Hello-world-Text/PostScript/hello-world-text-5.ps
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
%!PS
|
||||
/Helvetica 20 selectfont
|
||||
70 700 moveto
|
||||
(Hello world!) dup dup dup
|
||||
= print == % prints three times to the console
|
||||
show % prints to document
|
||||
1 0 div % provokes error message
|
||||
showpage
|
||||
1
Task/Hello-world-Text/Processing/hello-world-text
Normal file
1
Task/Hello-world-Text/Processing/hello-world-text
Normal file
|
|
@ -0,0 +1 @@
|
|||
println("Hello world!");
|
||||
1
Task/Hello-world-Text/Python/hello-world-text-4.py
Normal file
1
Task/Hello-world-Text/Python/hello-world-text-4.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
import __hello__
|
||||
1
Task/Hello-world-Text/Python/hello-world-text-5.py
Normal file
1
Task/Hello-world-Text/Python/hello-world-text-5.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
import __phello__
|
||||
1
Task/Hello-world-Text/Python/hello-world-text-6.py
Normal file
1
Task/Hello-world-Text/Python/hello-world-text-6.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
import __phello__.spam
|
||||
1
Task/Hello-world-Text/Ruby/hello-world-text-4.rb
Normal file
1
Task/Hello-world-Text/Ruby/hello-world-text-4.rb
Normal file
|
|
@ -0,0 +1 @@
|
|||
$>.puts "Hello world!"
|
||||
1
Task/Hello-world-Text/Ruby/hello-world-text-5.rb
Normal file
1
Task/Hello-world-Text/Ruby/hello-world-text-5.rb
Normal file
|
|
@ -0,0 +1 @@
|
|||
$>.write "Hello world!\n"
|
||||
23
Task/Hello-world-Text/X86-Assembly/hello-world-text-3.x86
Normal file
23
Task/Hello-world-Text/X86-Assembly/hello-world-text-3.x86
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// No "main" used
|
||||
// compile with `gcc -nostdlib`
|
||||
#define SYS_WRITE $1
|
||||
#define STDOUT $1
|
||||
#define SYS_EXIT $60
|
||||
#define MSGLEN $14
|
||||
|
||||
.global _start
|
||||
.text
|
||||
|
||||
_start:
|
||||
movq $message, %rsi // char *
|
||||
movq SYS_WRITE, %rax
|
||||
movq STDOUT, %rdi
|
||||
movq MSGLEN, %rdx
|
||||
syscall // sys_write(message, stdout, 0x14);
|
||||
|
||||
movq SYS_EXIT, %rax
|
||||
xorq %rdi, %rdi // The exit code.
|
||||
syscall // exit(0)
|
||||
|
||||
.data
|
||||
message: .ascii "Hello, world!\n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue