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
1
Task/Create-a-file/Axe/create-a-file.axe
Normal file
1
Task/Create-a-file/Axe/create-a-file.axe
Normal file
|
|
@ -0,0 +1 @@
|
|||
GetCalc("appvOUTPUT",0)
|
||||
2
Task/Create-a-file/ChucK/create-a-file.chuck
Normal file
2
Task/Create-a-file/ChucK/create-a-file.chuck
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
FileIO text;
|
||||
text.open("output.txt", FileIO.WRITE);
|
||||
14
Task/Create-a-file/ERRE/create-a-file.erre
Normal file
14
Task/Create-a-file/ERRE/create-a-file.erre
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
PROGRAM FILE_TEST
|
||||
|
||||
!$INCLUDE="PC.LIB"
|
||||
|
||||
BEGIN
|
||||
|
||||
OPEN("O",#1,"output.txt")
|
||||
CLOSE(1)
|
||||
|
||||
OS_MKDIR("C:\RC") ! with the appropriate access rights .......
|
||||
OPEN("O",#1,"C:\RC\output.txt")
|
||||
CLOSE(1)
|
||||
|
||||
END PROGRAM
|
||||
15
Task/Create-a-file/EchoLisp/create-a-file.echolisp
Normal file
15
Task/Create-a-file/EchoLisp/create-a-file.echolisp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
;; The file system is the browser local storage
|
||||
;; It is divided into named stores (directories)
|
||||
;; "user" is the default (home) store
|
||||
|
||||
; before : list of stores
|
||||
(local-stores) → ("system" "user" "words" "reader" "info" "root")
|
||||
|
||||
(local-put-value "output.txt" "") → "output.txt" ; into "user"
|
||||
(local-make-store "user/docs") → "user/docs"
|
||||
(local-put-value "output.txt" "" "root") → "output.txt" ; into "root"
|
||||
(local-make-store 'root/docs) → "root/docs"
|
||||
|
||||
; after : list of stores
|
||||
(local-stores 'root) → ("root" "root/docs")
|
||||
(local-stores 'user) → ("user" "user/docs")
|
||||
15
Task/Create-a-file/FreeBASIC/create-a-file.freebasic
Normal file
15
Task/Create-a-file/FreeBASIC/create-a-file.freebasic
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
' create empty file and sub-directory in current directory
|
||||
Open "output.txt" For Output As #1
|
||||
Close #1
|
||||
MkDir "docs"
|
||||
|
||||
' create empty file and sub-directory in root directory c:\
|
||||
' creating file in root requires administrative privileges in Windows 10
|
||||
Open "c:\output.txt" For Output As #1
|
||||
Close #1
|
||||
MkDir "c:\docs"
|
||||
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
6
Task/Create-a-file/FunL/create-a-file.funl
Normal file
6
Task/Create-a-file/FunL/create-a-file.funl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import io.File
|
||||
|
||||
File( 'output.txt' ).createNewFile()
|
||||
File( File.separator + 'output.txt' ).createNewFile()
|
||||
File( 'docs' ).mkdir()
|
||||
File( File.separator + 'docs' ).mkdir()
|
||||
17
Task/Create-a-file/I/create-a-file.i
Normal file
17
Task/Create-a-file/I/create-a-file.i
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
function create( ""filename ) {
|
||||
! var file = open(filename)
|
||||
file("")
|
||||
issues {
|
||||
print("Failed to create "+filename)
|
||||
return
|
||||
}
|
||||
print(filename+" created!")
|
||||
close(file)
|
||||
}
|
||||
|
||||
software {
|
||||
create("output.txt")
|
||||
create("docs/")
|
||||
create("/output.txt")
|
||||
create("/docs/")
|
||||
}
|
||||
4
Task/Create-a-file/LFE/create-a-file.lfe
Normal file
4
Task/Create-a-file/LFE/create-a-file.lfe
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(: file write_file '"output.txt" '"Some data")
|
||||
(: file make_dir '"docs")
|
||||
(: file write_file '"/output.txt" '"Some data")
|
||||
(: file make_dir '"/docs")
|
||||
17
Task/Create-a-file/Lasso/create-a-file.lasso
Normal file
17
Task/Create-a-file/Lasso/create-a-file.lasso
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// create file
|
||||
local(f) = file
|
||||
handle => { #f->close }
|
||||
#f->openWriteOnly('output.txt')
|
||||
|
||||
// make directory, just like a file
|
||||
local(d = dir('docs'))
|
||||
#d->create
|
||||
|
||||
// create file in root file system (requires permissions at user OS level)
|
||||
local(f) = file
|
||||
handle => { #f->close }
|
||||
#f->openWriteOnly('//output.txt')
|
||||
|
||||
// create directory in root file system (requires permissions at user OS level)
|
||||
local(d = dir('//docs'))
|
||||
#d->create
|
||||
3
Task/Create-a-file/Lingo/create-a-file-1.lingo
Normal file
3
Task/Create-a-file/Lingo/create-a-file-1.lingo
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
-- note: fileIO xtra is shipped with Director, i.e. an "internal"
|
||||
fp = xtra("fileIO").new()
|
||||
fp.createFile("output.txt")
|
||||
6
Task/Create-a-file/Lingo/create-a-file-2.lingo
Normal file
6
Task/Create-a-file/Lingo/create-a-file-2.lingo
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- note: fileIO xtra is shipped with Director, i.e. an "internal"
|
||||
pd = the last char of _movie.path -- "\" for win, ":" for mac
|
||||
_player.itemDelimiter = pd
|
||||
vol = _movie.path.item[1]
|
||||
fp = xtra("fileIO").new()
|
||||
fp.createFile(vol&pd&"output.txt")
|
||||
3
Task/Create-a-file/Lingo/create-a-file-3.lingo
Normal file
3
Task/Create-a-file/Lingo/create-a-file-3.lingo
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
shell_cmd("mkdir Docs") -- in cwd, both win and mac
|
||||
shell_cmd("mkdir \Docs") -- win
|
||||
shell_cmd("mkdir /Docs") -- mac
|
||||
7
Task/Create-a-file/Nim/create-a-file-1.nim
Normal file
7
Task/Create-a-file/Nim/create-a-file-1.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import os
|
||||
|
||||
open("output.txt", fmWrite).close()
|
||||
createDir("docs")
|
||||
|
||||
open(DirSep & "output.txt", fmWrite).close()
|
||||
createDir(DirSep & "docs")
|
||||
5
Task/Create-a-file/Nim/create-a-file-2.nim
Normal file
5
Task/Create-a-file/Nim/create-a-file-2.nim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import os
|
||||
const directories = ["/", "./"]
|
||||
for directory in directories:
|
||||
open(directory & "output.txt", fmWrite).close()
|
||||
createDir(directory & "docs")
|
||||
15
Task/Create-a-file/Phix/create-a-file.phix
Normal file
15
Task/Create-a-file/Phix/create-a-file.phix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
integer fn
|
||||
|
||||
-- In the current working directory
|
||||
system("mkdir docs",2)
|
||||
fn = open("output.txt","w")
|
||||
close(fn)
|
||||
|
||||
-- In the filesystem root
|
||||
system("mkdir \\docs",2)
|
||||
fn = open("\\output.txt","w")
|
||||
if fn=-1 then
|
||||
puts(1,"unable to create \\output.txt\n")
|
||||
else
|
||||
close(fn)
|
||||
end if
|
||||
4
Task/Create-a-file/Ring/create-a-file.ring
Normal file
4
Task/Create-a-file/Ring/create-a-file.ring
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
system("mkdir C:\Ring\docs")
|
||||
fopen("C:\Ring\docs\output.txt", "w+")
|
||||
system("mkdir docs")
|
||||
fopen("output.txt", "w+")
|
||||
7
Task/Create-a-file/Sidef/create-a-file.sidef
Normal file
7
Task/Create-a-file/Sidef/create-a-file.sidef
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Here
|
||||
%f'output.txt' -> create;
|
||||
%d'docs' -> create;
|
||||
|
||||
# Root dir
|
||||
Dir.root + %f'output.txt' -> create;
|
||||
Dir.root + %d'docs' -> create;
|
||||
7
Task/Create-a-file/Ursa/create-a-file.ursa
Normal file
7
Task/Create-a-file/Ursa/create-a-file.ursa
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
decl file f
|
||||
f.create "output.txt"
|
||||
f.createdir "docs"
|
||||
|
||||
# in the root directory
|
||||
f.create "/output.txt"
|
||||
f.createdir "/docs"
|
||||
Loading…
Add table
Add a link
Reference in a new issue