A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
3
Task/Hello-world-Line-printer/0DESCRIPTION
Normal file
3
Task/Hello-world-Line-printer/0DESCRIPTION
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Cause a line printer attached to the computer to print a line containing the message <tt>Hello World!</tt>
|
||||
|
||||
'''Note:''' A line printer is not the same as standard output. A [[wp:line printer|line printer]] was an older-style printer which prints one line at a time to a continuous ream of paper. With some systems, a line printer can be any device attached to an appropriate port (such as a parallel port).
|
||||
|
|
@ -0,0 +1 @@
|
|||
BEGIN { print("Hello World!") >"/dev/lp0" }
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Print_Line is
|
||||
Printer : File_Type;
|
||||
begin
|
||||
begin
|
||||
Open (Printer, Mode => Out_File, Name => "/dev/lp0");
|
||||
exception
|
||||
when others =>
|
||||
Put_Line ("Unable to open printer.");
|
||||
return;
|
||||
end;
|
||||
|
||||
Set_Output (Printer);
|
||||
Put_Line ("Hello World!");
|
||||
Close (Printer);
|
||||
end Print_Line;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
PR#1
|
||||
PRINT "HELLO WORLD!"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Fileappend, Hallo World!, print.txt
|
||||
Run, print "print.txt"
|
||||
|
|
@ -0,0 +1 @@
|
|||
LPRINT "Hello World!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
prn% = OPENOUT("PRN:")
|
||||
PRINT #prn%, "Hello World!"
|
||||
CLOSE #prn%
|
||||
|
|
@ -0,0 +1 @@
|
|||
ECHO Hello world!>PRN
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
int main(){
|
||||
std::ofstream lprFile;
|
||||
lprFile.open( "/dev/lp0" );
|
||||
lprFile << "Hello World\n";
|
||||
lprFile.close();
|
||||
return 0;
|
||||
}
|
||||
10
Task/Hello-world-Line-printer/C/hello-world-line-printer.c
Normal file
10
Task/Hello-world-Line-printer/C/hello-world-line-printer.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
FILE *lp;
|
||||
lp = fopen("/dev/lp0","w");
|
||||
fprintf(lp,"Hello world!\n");
|
||||
fclose(lp);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. GOODBYE-WORLD-PRINTER.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
DISPLAY 'Hello World!'
|
||||
UPON PRINTER
|
||||
END-DISPLAY.
|
||||
STOP RUN.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import std.stdio;
|
||||
|
||||
void main()
|
||||
{
|
||||
auto lp = File("/dev/lp0", "w");
|
||||
lp.writeln("Hello World!");
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
program Project1;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses Printers;
|
||||
|
||||
var
|
||||
lPrinterAsTextFile: TextFile;
|
||||
begin
|
||||
AssignPrn(lPrinterAsTextFile);
|
||||
Rewrite(lPrinterAsTextFile);
|
||||
Writeln(lPrinterAsTextFile, 'Hello World!');
|
||||
CloseFile(lPrinterAsTextFile);
|
||||
end.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
( scratchpad ) USE: io.encodings.utf8
|
||||
( scratchpad ) USE: io.launcher
|
||||
( scratchpad ) "lpr" utf8 [ "Hello World!" print ] with-process-writer
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Start,Programs,Accessories,Notepad,Type:Goodbye World[pling],
|
||||
Menu:File,Print,Button:OK
|
||||
18
Task/Hello-world-Line-printer/Go/hello-world-line-printer.go
Normal file
18
Task/Hello-world-Line-printer/Go/hello-world-line-printer.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
lp0, err := os.Create("/dev/lp0")
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
defer lp0.Close()
|
||||
|
||||
fmt.Fprintln(lp0, "Hello world!")
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
new File('/dev/lp0').write('Hello World\n')
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
import System.Cmd
|
||||
|
||||
cmd = "echo \"Hello World!\" | lpr"
|
||||
|
||||
main = system cmd
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
require'print'
|
||||
print'Hello world!'
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
public class LinePrinter {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
FileWriter lp0 = new FileWriter("/dev/lp0");
|
||||
lp0.write("Hello World!");
|
||||
lp0.close();
|
||||
} catch (IOException ioe) {
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// This example runs on Node.js
|
||||
var fs = require('fs');
|
||||
// Assuming lp is at /dev/lp0
|
||||
var lp = fs.openSync('/dev/lp0', 'w');
|
||||
fs.writeSync(lp, 'Hello, world!\n');
|
||||
fs.close(lp);
|
||||
|
|
@ -0,0 +1 @@
|
|||
10 PRINT #8, "Hello World!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fid = fopen('/dev/lp0');
|
||||
fprintf(fid,'Hello World!\n');
|
||||
fclose(fid);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
commandstring = "echo Hello World! | lpr -P Printer01"
|
||||
Run[commandstring]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
file_put_contents('/dev/lp0', 'Hello world!');
|
||||
?>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
fclose(STDOUT);
|
||||
$STDOUT = fopen('/dev/lp0', 'a');
|
||||
echo 'Hello world!';
|
||||
?>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
open O, ">", "/dev/lp0";
|
||||
print O "Hello World!\n";
|
||||
close O;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(out '(lpr "-P" "Printer01")
|
||||
(prinl "Hello world") )
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
lp = open("/dev/lp0")
|
||||
lp.write("Hello World!/n")
|
||||
lp.close()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
str='Hello World'
|
||||
'@ECHO' str ">PRN"
|
||||
|
|
@ -0,0 +1 @@
|
|||
open("| lpr", "w") { |f| f.puts "Hello World!" }
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(call-with-output-file "/dev/lp0"
|
||||
(lambda (printer)
|
||||
(write "Hello World!" printer)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
exec lp << "Hello World!"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
set f [open |lp w]
|
||||
puts $f "Hello World!"
|
||||
close $f
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
set f [open prn w]
|
||||
puts $f "Hello World!"
|
||||
close $f
|
||||
Loading…
Add table
Add a link
Reference in a new issue