Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/Hello-world-Newline-omission/00-META.yaml
Normal file
3
Task/Hello-world-Newline-omission/00-META.yaml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
from: http://rosettacode.org/wiki/Hello_world/Newline_omission
|
||||
note: Basic language learning
|
||||
14
Task/Hello-world-Newline-omission/00-TASK.txt
Normal file
14
Task/Hello-world-Newline-omission/00-TASK.txt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Some languages automatically insert a newline after outputting a string, unless measures are taken to prevent its output.
|
||||
|
||||
|
||||
;Task:
|
||||
Display the string <big><big><code>Goodbye, World!</code></big></big> without a trailing newline.
|
||||
|
||||
|
||||
;Related tasks:
|
||||
* [[Hello world/Graphical]]
|
||||
* [[Hello world/Line Printer]]
|
||||
* [[Hello world/Standard error]]
|
||||
* [[Hello world/Text]]
|
||||
<br><br>
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
print(‘Goodbye, World!’, end' ‘’)
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
PrintString:
|
||||
;input: A0 = source address
|
||||
;outputs to screen.
|
||||
MOVE.B (A0)+,D0
|
||||
BEQ Terminated
|
||||
JSR PrintChar
|
||||
BRA PrintString
|
||||
Terminated:
|
||||
; If this routine did in fact put a new line by default, it would do so here with the following:
|
||||
; MOVE.B #13,D0 ;13 is ascii for Carriage Return (moves cursor back to beginning of row).
|
||||
; JSR PrintChar
|
||||
; MOVE.B #10,D0 ;10 is ascii for Line Feed (moves cursor down one line).
|
||||
; JSR PrintChar
|
||||
RTS
|
||||
|
||||
myString:
|
||||
DC.B "Goodbye, World!",0
|
||||
EVEN
|
||||
|
|
@ -0,0 +1 @@
|
|||
(cw "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
BEGIN
|
||||
print ("Goodbye, World!")
|
||||
END
|
||||
|
|
@ -0,0 +1 @@
|
|||
implement main0 () = print "Goodbye, World!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
BEGIN { printf("Goodbye, World!") }
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
PROC Main()
|
||||
Print("Goodbye, World!")
|
||||
RETURN
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
with Ada.Text_IO;
|
||||
|
||||
procedure Goodbye_World is
|
||||
begin
|
||||
Ada.Text_IO.Put("Goodbye, World!");
|
||||
end Goodbye_World;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
with Ada.Text_IO;
|
||||
with Ada.Text_IO.Text_Streams;
|
||||
|
||||
procedure Goodbye_World is
|
||||
stdout: Ada.Text_IO.File_Type := Ada.Text_IO.Standard_Output;
|
||||
begin
|
||||
String'Write(Ada.Text_IO.Text_Streams.Stream(stdout), "Goodbye World");
|
||||
end Goodbye_World;
|
||||
|
|
@ -0,0 +1 @@
|
|||
io.write( "Goodbye, World!" )
|
||||
|
|
@ -0,0 +1 @@
|
|||
PRINT "GOODBYE, WORLD!";
|
||||
|
|
@ -0,0 +1 @@
|
|||
prints "Goodbye, World!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
DllCall("AllocConsole")
|
||||
FileAppend, Goodbye`, World!, CONOUT$ ; No newline outputted
|
||||
MsgBox
|
||||
|
|
@ -0,0 +1 @@
|
|||
ConsoleWrite("Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
Disp "Goodbye, World!"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
main()
|
||||
{
|
||||
putstr("Goodbye, World!");
|
||||
return(0);
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
10 REM The trailing semicolon prevents a newline
|
||||
20 PRINT "Goodbye, World!";
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
print "Goodbye,";
|
||||
print " ";
|
||||
print "World!";
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
REM BBC BASIC accepts the standard trailing semicolon:
|
||||
PRINT "Goodbye World!";
|
||||
|
||||
REM One could also output the characters individually:
|
||||
GW$ = "Goodbye World!"
|
||||
FOR i% = 1 TO LEN(GW$)
|
||||
VDU ASCMID$(GW$, i%)
|
||||
NEXT
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
PRINT "Goodbye, World!";
|
||||
PRINT "Goodbye, World!" FORMAT "%s"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
<nul set/p"=Goodbye, World!"
|
||||
<nul set/p=Goodbye, World!
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
setlocal enableDelayedExpansion
|
||||
<nul set/p"=Goodbye, World^!"
|
||||
<nul set/p=Goodbye, World^^^!
|
||||
|
|
@ -0,0 +1 @@
|
|||
"Goodbye, World!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
_`Goodbye, World!
|
||||
|
|
@ -0,0 +1 @@
|
|||
"!dlroW ,eybdooG">:#,_@
|
||||
|
|
@ -0,0 +1 @@
|
|||
print('Goodbye, World!')
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
10 print "Goodbye, w";
|
||||
20 print "orld!";
|
||||
|
|
@ -0,0 +1 @@
|
|||
put$"Goodbye, World!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
>+++++[>++++>+>+>++++>>+++<<<+<+<++[>++>+++>+++>++++>+>+[<]>>-]<-]>>
|
||||
+.>>+..<.--.++>>+.<<+.>>>-.>++.[<]++++[>++++<-]>.>>.+++.------.<-.[>]<+.[-]
|
||||
[G oo d b y e , W o r l d !]
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Goodbye, World!";
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
echo -n "Goodbye, World!"
|
||||
echo -n "-hyphens and \backslashes"
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//Using Console.WriteLine() will append a newline
|
||||
Console.WriteLine("Goodbye, World!");
|
||||
|
||||
//Using Console.Write() will not append a newline
|
||||
Console.Write("Goodbye, World!");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
(void) printf("Goodbye, World!"); /* No automatic newline */
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. GOODBYE-WORLD.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
DISPLAY 'Goodbye, World!'
|
||||
WITH NO ADVANCING
|
||||
END-DISPLAY
|
||||
.
|
||||
STOP RUN.
|
||||
|
|
@ -0,0 +1 @@
|
|||
print "Goodbye, World!"; '' the trailing semi-colon suppresses the new line
|
||||
|
|
@ -0,0 +1 @@
|
|||
?? "Goodbye, World!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
(print "Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
process.stdout.write "Goodbye, World!"
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
10 print chr$(14) : rem Switch to lower+uppercase character set
|
||||
20 print "Goodbye, World!";
|
||||
30 rem * If we end this program here, we will not see the effect because
|
||||
40 rem BASIC will print 'READY' at a new line anyway.
|
||||
50 rem * So, we just print additional message...
|
||||
60 print "(End of the world)"
|
||||
70 end
|
||||
|
|
@ -0,0 +1 @@
|
|||
(princ "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
'In a window
|
||||
|
||||
DEF Win:WINDOW
|
||||
DEF Close:CHAR
|
||||
DEF ScreenSizeX,ScreenSizeY:INT
|
||||
|
||||
GETSCREENSIZE(ScreenSizeX,ScreenSizeY)
|
||||
|
||||
WINDOW Win,0,0,ScreenSizeX,ScreenSizeY,0,0,"Goodbye program",MainHandler
|
||||
|
||||
PRINT Win,"Goodbye, World!"
|
||||
'Prints in the upper left corner of the window (position 0,0).
|
||||
PRINT"Win," I ride off into the sunset."
|
||||
|
||||
'There does not appear to be a means of starting a new line when printing in a window, other than by using the MOVE command.
|
||||
'Therefore, both sentences here will print on the same line, i.e., in the same vertical position.
|
||||
|
||||
WAITUNTIL Close=1
|
||||
|
||||
CLOSEWINDOW Win
|
||||
|
||||
END
|
||||
|
||||
SUB MainHandler
|
||||
|
||||
IF @CLASS=@IDCLOSEWINDOW THEN Close=1
|
||||
|
||||
RETURN
|
||||
|
||||
'In the console
|
||||
|
||||
OPENCONSOLE
|
||||
|
||||
'Insert a trailing comma.
|
||||
PRINT"Goodbye, World!",
|
||||
PRINT" I ride off into the sunset."
|
||||
|
||||
PRINT:PRINT"Press any key to end."
|
||||
|
||||
DO:UNTIL INKEY$<>""
|
||||
|
||||
CLOSECONSOLE
|
||||
|
||||
'Since this a Cbasic console program.
|
||||
END
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import std.stdio;
|
||||
|
||||
void main() {
|
||||
write("Goodbye, World!");
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
Print('Goodbye, World!');
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
void main() {
|
||||
stdout.write("Goodbye, World!");
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
[Goodbye, World!]P
|
||||
|
|
@ -0,0 +1 @@
|
|||
370913249815566165486152944077005857 P
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
program Project1;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
begin
|
||||
Write('Goodbye, World!');
|
||||
end.
|
||||
|
|
@ -0,0 +1 @@
|
|||
print("Goodbye, World!", terminator: "")
|
||||
|
|
@ -0,0 +1 @@
|
|||
Console::Write("Goodbye, World!")
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
//compile using the new dylan.NET v, 11.5.1.2 or later
|
||||
//use mono to run the compiler
|
||||
#refstdasm mscorlib.dll
|
||||
|
||||
import System
|
||||
|
||||
assembly gdbyeex exe
|
||||
ver 1.2.0.0
|
||||
|
||||
class public Program
|
||||
|
||||
method public static void main()
|
||||
Console::Write("Goodbye, World!")
|
||||
end method
|
||||
|
||||
end class
|
||||
|
|
@ -0,0 +1 @@
|
|||
write("Goodbye, World!")
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
.......
|
||||
PRINT("Goodbye, World!";)
|
||||
.......
|
||||
|
|
@ -0,0 +1 @@
|
|||
write "Goodbye, World!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(begin
|
||||
(write "GoodBye, World")
|
||||
(write "Next on same line"))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
public program()
|
||||
{
|
||||
//print will not append a newline
|
||||
console.write("Goodbye, World!")
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
IO.write "Goodbye, World!"
|
||||
|
|
@ -0,0 +1 @@
|
|||
(princ "Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
io:format("Goodbye, world!").
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
-- In Euphoria puts() does not insert a newline character after outputting a string
|
||||
puts(1,"Goodbye, world!")
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
// A program that will run in the interpreter (fsi.exe)
|
||||
printf "Goodbye, World!";;
|
||||
|
||||
// A compiled program
|
||||
[<EntryPoint>]
|
||||
let main args =
|
||||
printf "Goodbye, World!"
|
||||
0
|
||||
|
|
@ -0,0 +1 @@
|
|||
TYPE "Goodbye, World!"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
USE: io
|
||||
"Goodbye, World!" write
|
||||
|
|
@ -0,0 +1 @@
|
|||
print("Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
>> "Goodbye, World!"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class Main {
|
||||
Void main() {
|
||||
echo("Goodbye, World!")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
\ The Forth word ." does not insert a newline character after outputting a string
|
||||
." Goodbye, World!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
program bye
|
||||
write (*,'(a)',advance='no') 'Goodbye, World!'
|
||||
end program bye
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
WRITE (6,1) "Goodbye, World!"
|
||||
1 FORMAT (A,$)
|
||||
END
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Print "Goodbye, World!"; '' the trailing semi-colon suppresses the new line
|
||||
Sleep
|
||||
|
|
@ -0,0 +1 @@
|
|||
print["Goodbye, World!"]
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
print
|
||||
// A semicolon will suppress a line feed in a print statement.
|
||||
print "a, ";
|
||||
print "b, ";
|
||||
print "c"
|
||||
|
||||
print : print
|
||||
|
||||
// When logging, a \b (escaped b) appended to a string will suppress a line feed.
|
||||
NSLog( @"d, \b" )
|
||||
NSLog( @"e, \b" )
|
||||
NSLog( @"f" )
|
||||
|
||||
long i
|
||||
CFMutableStringRef mutStr
|
||||
mutStr = fn MutableStringWithCapacity(0)
|
||||
|
||||
// Feeds and returns can be easily omitted using a mutable string
|
||||
for i = 1 to 99
|
||||
MutableStringAppendFormat( mutStr, @"%3ld, ", i )
|
||||
if ( i mod 10 == 0 ) then MutableStringAppendString( mutStr, @"\n" )
|
||||
if ( i == 99 ) then MutableStringAppendFormat( mutStr, @"%3ld", i + 1 )
|
||||
next
|
||||
|
||||
print mutStr
|
||||
|
||||
HandleEvents
|
||||
|
|
@ -0,0 +1 @@
|
|||
show_message("Goodbye, World!")
|
||||
|
|
@ -0,0 +1 @@
|
|||
Start,Programs,Accessories,Notepad,Type:Goodbye World[pling]
|
||||
|
|
@ -0,0 +1 @@
|
|||
10 PRINT "Goodbye, World!"; '' the trailing semi-colon suppresses the new line
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
Public Sub Main()
|
||||
|
||||
Print "Goodbye, "; 'The semicolon stops the newline being added
|
||||
Print "World!"
|
||||
|
||||
End
|
||||
|
|
@ -0,0 +1 @@
|
|||
'Hello, <> 'World! print
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
[indent=4]
|
||||
/*
|
||||
Hello, with no newline, in Genie
|
||||
valac helloNoNewline.gs
|
||||
*/
|
||||
|
||||
init
|
||||
stdout.printf("%s", "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() { fmt.Print("Goodbye, World!") }
|
||||
|
|
@ -0,0 +1 @@
|
|||
print "Goodbye, world"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
?? "Goodbye, world"
|
||||
or
|
||||
QQout( "Goodbye, world" )
|
||||
|
|
@ -0,0 +1 @@
|
|||
main = putStr "Goodbye, world"
|
||||
|
|
@ -0,0 +1 @@
|
|||
"Goodbye, World!";
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#! /bin/sh
|
||||
exec huginn --no-argv -E "${0}" "${@}"
|
||||
#! huginn
|
||||
|
||||
main() {
|
||||
print( "Goodbye, World!" );
|
||||
return ( 0 );
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
10 PRINT "Goodbye, World! ";
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
'In a window
|
||||
|
||||
DEF Win:WINDOW
|
||||
DEF Close:CHAR
|
||||
DEF ScreenSizeX,ScreenSizeY:UINT
|
||||
|
||||
GETSCREENSIZE(ScreenSizeX,ScreenSizeY)
|
||||
|
||||
OPENWINDOW Win,0,0,ScreenSizeX,ScreenSizeY,NULL,NULL,"Goodbye program",&MainHandler
|
||||
|
||||
PRINT Win,"Goodbye, World!"
|
||||
'Prints in upper left corner of the window (position 0,0).
|
||||
PRINT Win," You won't have this program to kick around anymore."
|
||||
|
||||
'There does not appear to be a means of starting a new line when printing in a window, other than by using the MOVE command.
|
||||
'Therefore, both sentences here will print on the same line, i.e., in the same vertical position.
|
||||
|
||||
WAITUNTIL Close=1
|
||||
|
||||
CLOSEWINDOW Win
|
||||
|
||||
END
|
||||
|
||||
SUB MainHandler
|
||||
|
||||
IF @MESSAGE=@IDCLOSEWINDOW THEN Close=1
|
||||
|
||||
RETURN
|
||||
ENDSUB
|
||||
|
||||
'In the console
|
||||
|
||||
OPENCONSOLE
|
||||
|
||||
'by inserting a trailing comma.
|
||||
PRINT"Goodbye, World!",
|
||||
PRINT" You won't have this program to kick around anymore."
|
||||
|
||||
PRINT:PRINT
|
||||
|
||||
'A press any key to continue message is automatic in a program compiled as console only.
|
||||
'I presume the compiler adds the code.
|
||||
CLOSECONSOLE
|
||||
|
||||
'Since this an IWBASIC console program.
|
||||
END
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
procedure main()
|
||||
writes("Goodbye, World!")
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
write("Goodbye, World!")
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
'Goodbye, World!' 1!:3 <'/proc/self/fd/1'
|
||||
Goodbye, World!
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
load 'general/misc/prompt'
|
||||
prompt 'Goodbye, World!'
|
||||
Goodbye, World!
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
class Main {
|
||||
function void main () {
|
||||
do Output.printString("Goodbye, World!");und
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
print("Goodbye, World!")
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
(prin "Goodbye, World!")
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
public class HelloWorld
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.out.print("Goodbye, World!");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
process.stdout.write("Goodbye, World!");
|
||||
|
|
@ -0,0 +1 @@
|
|||
"Goodbye, World!" putchars.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
$ jq -n -j '"Goodbye, World!"'
|
||||
Goodbye, World!$
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
$ echo '"Goodbye, World!"' | jq -j
|
||||
Goodbye, World!$
|
||||
|
|
@ -0,0 +1 @@
|
|||
printf("Goodbye, World!")
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue