Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
6
Task/File-input-output/Phix/file-input-output-1.phix
Normal file
6
Task/File-input-output/Phix/file-input-output-1.phix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
integer fn = open("input.txt","rb")
|
||||
string txt = get_text(fn)
|
||||
close(fn)
|
||||
fn = open("output.txt","wb")
|
||||
puts(fn,txt)
|
||||
close(fn)
|
||||
10
Task/File-input-output/Phix/file-input-output-2.phix
Normal file
10
Task/File-input-output/Phix/file-input-output-2.phix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
integer infn = open("input.txt","r"),
|
||||
outfn = open("output.txt","w")
|
||||
object line
|
||||
while 1 do
|
||||
line = gets(infn)
|
||||
if atom(line) then exit end if
|
||||
puts(outfn,line)
|
||||
end while
|
||||
close(infn)
|
||||
close(outfn)
|
||||
10
Task/File-input-output/Phix/file-input-output-3.phix
Normal file
10
Task/File-input-output/Phix/file-input-output-3.phix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
integer byte,
|
||||
infd = open("input.txt","rb"),
|
||||
outfd = open("output.txt","wb")
|
||||
while 1 do
|
||||
byte = getc(infd)
|
||||
if byte=-1 then exit end if
|
||||
puts(outfd,byte)
|
||||
end while
|
||||
close(infd)
|
||||
close(outfd)
|
||||
Loading…
Add table
Add a link
Reference in a new issue