diff --git a/Conf/lang.yaml b/Conf/lang.yaml index 0177945cc6..df9c047e05 100644 --- a/Conf/lang.yaml +++ b/Conf/lang.yaml @@ -40,8 +40,8 @@ ANT: ANTLR: APL: AppleScript: + ext: applescript Applesoft BASIC: - ext: bas Application Master: ext: Arbre: @@ -49,7 +49,6 @@ Argile: ARM Assembly: ASP: ASP.Net: - ext: asp AspectC++: ext: acpp AspectJ: @@ -68,7 +67,6 @@ B: Babel: ext: pb BASIC: - ext: bas BASIC256: Batch File: ext: bat @@ -125,13 +123,11 @@ CMake: COBOL: Cobra: CoffeeScript: - ext: coffee ColdFusion: ext: cfm Common Lisp: ext: lisp Component Pascal: - ext: pascal Coq: Crack: Curry: @@ -150,7 +146,6 @@ Dodo0: DWScript: Dylan: Dylan.NET: - ext: net Déjà Vu: ext: djv @@ -213,6 +208,7 @@ Frege: Friendly interactive shell: ext: fish Frink: + Gambas: GAP: Gdl: @@ -227,13 +223,12 @@ Gnuplot: Go: # Go!: Golfscript: - ext: golf Goo: Gosu: Groovy: GUISS: GW-BASIC: - ext: bas + Haskell: ext: hs Haxe: @@ -253,12 +248,12 @@ Inform 7: Informix 4GL: ext: 4gl Integer BASIC: - ext: bas Intercal: ext: ical Io: Ioke: Iptscrae: + J: Jabaco: Jacquard Loom: @@ -272,10 +267,9 @@ Jcon: JoCaml: Joy: JScript.NET: - ext: net JudoScript: - ext: judo Julia: + K: K3d: Kaya: @@ -283,8 +277,8 @@ KeyList Databasing: ext: Kite: KonsolScript: - ext: konso Kotlin: + L.in.oleum: ext: lin LabVIEW: @@ -294,13 +288,14 @@ LaTeX: Lhogho: Liberty BASIC: Lilypond: + ext: lily Limbo: Lisaac: Lisp: + ext: l LLP: LLVM: Locomotive Basic: - ext: bas Logo: Logtalk: LOLCODE: @@ -308,7 +303,6 @@ LOLCODE: Lolli: Lotus 123 Macro Scripting: LotusScript: - ext: lotus Lout: LSE64: LSL: @@ -316,18 +310,20 @@ Lua: Lucid: Lush: Lygon: + M4: M680x0: Make: Maple: MAPPER: Mathematica: + ext: math Mathprog: + ext: math MATLAB: ext: m Maxima: MAXScript: - ext: max MBS: ME10 macro: MEL: @@ -347,41 +343,276 @@ Modula-3: ext: mod3 MOO: Moonscript: - ext: moon MPIF90: MS SQL: + ext: sql MSSQL: + ext: sql MUF: MUMPS: MySQL: + ext: sql Mython: Mythryl: +N/t/roff: +Neat: +Neko: +Nemerle: +NetLogo: +NetRexx: +NewLISP: +Nial: +Nice: +Nickle: +Nimrod: +Niue: +NQP: +NSIS: +Oberon-2: +Objeck: +Object Pascal: +ObjectIcon: +Objective-C: + ext: m +OCaml: +Occam: +Octave: +Omega: +Onyx: +OOC: +OOCalc: +OoRexx: + ext: rexx +Opa: +OpenC++: +OpenEdge/Progress: +Openscad: + ext: scad +OPL: +Order: +OxygenBasic: + ext: oxy +Oxygene: + ext: oxy +Oz: + +PARI/GP: +Pascal: +PASM: +PDP-11 Assembly: +Pentium Assembly: Perl: ext: pl +Perl 6: + ext: pl6 PHP: PicoLisp: ext: l +Piet: +Pike: PIR: +PL/I: + ext: pli +PL/M: + ext: plm +PL/pgSQL: + ext: sql +PL/SQL: + ext: sql +PlainTeX: + ext: tex +PLUS: +PLZ/SYS: +Pop11: +PostScript: + ext: ps +POV-Ray: +PowerBASIC: +PowerShell: + ext: psh +PPC Assembly: +PPL: +Processing: + ext: +ProDOS: + ext: dos Prolog: ext: pro +Protium: +PSQL: +Pure: +Pure Data: +PureBasic: +Purity: Python: ext: py + +Q: +Qi: +Qore: +QuakeC: + ext: c +Quill: + R: - ext: r Racket: ext: rkt +RapidQ: +Rascal: +Raven: +REALbasic: +REBOL: +Refal: +Retro: +Revolution: + ext: rev REXX: +Rhope: +RLaB: +RLSL: +RPG: +RPL/2: +RTL/2: +RTSL: Ruby: ext: rb +Run BASIC: +Rust: + +S-lang: + ext: slang +Sage: +Salmon: +SAS: Sather: ext: sa Scala: Scheme: ext: ss +Scilab: +Scratch: +Script Basic: +Script3D: + ext: 3d +ScriptBasic: +Sed: +Seed7: +Self: +SETL: +SheerPower 4GL: + ext: 4gl +Shiny: +SIMPOL: +Simula: +Sisal: +Slate: Smalltalk: ext: st +SMEQL: +Snobol: + ext: sno +SNOBOL4: + ext: sno SNUSP: +Soar: +SPARC Assembly: +SPARK: +SQL: +Squirrel: + ext: net +Standard ML: + ext: ml +StreamIt: +Suneido: +Superbase BASIC: +SuperCollider: +Supernova: +SystemVerilog: + ext: v + +TAL: Tcl: +Teco: +TeLa: +Thistle: +Thyrd: +TI-83 BASIC: +TI-89 BASIC: +TIScript: +Toka: +TorqueScript: +TPP: +Transact-SQL: + ext: sql +Trith: +True BASIC: +TSE SAL: Turing: +TUSCRIPT: +Twelf: +TXR: + +UBASIC: +UC++: +Unicon: +UNIX Shell: + ext: sh +UnixPipes: +Unlambda: +Ursala: +UScript: +UserRPL: + ext: rpl + +V: +Vala: +VB6: +VBA: +VBScript: +Vedit macro language: +Verilog: + ext: v +VHDL: +Vim Script: +Visual Basic: + ext: vb +Visual Basic .NET: +Visual Objects: + ext: vobj +Visual Prolog: + ext: pro +Vorpal: +Vox: +VRML: + +Whenever: +Whitespace: + ext: ws +WML: +Wrapl: + +X10: +X86 Assembly: +Xanadu: +XBase: +XL: +XPL0: +XProc: +XQuery: +XS: +XSLT: +XSLT 1.0: +XSLT 2.0: +XTalk: +XUL: + +Yacas: +Yorick: + +Z80 Assembly: +ZED: +Zonnon: +ZPL: +ZX Spectrum Basic: diff --git a/Lang/ACL2/Arbitrary-precision-integers-(included) b/Lang/ACL2/Arbitrary-precision-integers-(included) deleted file mode 120000 index 6d88a77c49..0000000000 --- a/Lang/ACL2/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/ACL2 \ No newline at end of file diff --git a/Lang/Ada/Arbitrary-precision-integers-(included) b/Lang/Ada/Arbitrary-precision-integers-(included) deleted file mode 120000 index 2edc64c8fa..0000000000 --- a/Lang/Ada/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Ada \ No newline at end of file diff --git a/Lang/Alore/Arbitrary-precision-integers-(included) b/Lang/Alore/Arbitrary-precision-integers-(included) deleted file mode 120000 index b45566aca9..0000000000 --- a/Lang/Alore/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Alore \ No newline at end of file diff --git a/Lang/Bracmat/Arbitrary-precision-integers-(included) b/Lang/Bracmat/Arbitrary-precision-integers-(included) deleted file mode 120000 index 5edf79c35b..0000000000 --- a/Lang/Bracmat/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Bracmat \ No newline at end of file diff --git a/Lang/C++/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) b/Lang/C++/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) deleted file mode 120000 index 0588cbbce9..0000000000 --- a/Lang/C++/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++ \ No newline at end of file diff --git a/Lang/C++/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2) b/Lang/C++/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2) deleted file mode 120000 index ba452b8bd0..0000000000 --- a/Lang/C++/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++ \ No newline at end of file diff --git a/Lang/C-sharp/Arbitrary-precision-integers-(included) b/Lang/C-sharp/Arbitrary-precision-integers-(included) deleted file mode 120000 index 2eaa17c3fa..0000000000 --- a/Lang/C-sharp/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/C-sharp \ No newline at end of file diff --git a/Lang/C/Arbitrary-precision-integers-(included) b/Lang/C/Arbitrary-precision-integers-(included) deleted file mode 120000 index ba9a232ceb..0000000000 --- a/Lang/C/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/C \ No newline at end of file diff --git a/Lang/Clojure/Arbitrary-precision-integers-(included) b/Lang/Clojure/Arbitrary-precision-integers-(included) deleted file mode 120000 index ab98cf4e31..0000000000 --- a/Lang/Clojure/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Clojure \ No newline at end of file diff --git a/Lang/Common-Lisp/Arbitrary-precision-integers-(included) b/Lang/Common-Lisp/Arbitrary-precision-integers-(included) deleted file mode 120000 index ecef923ba4..0000000000 --- a/Lang/Common-Lisp/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Common-Lisp \ No newline at end of file diff --git a/Lang/D/Arbitrary-precision-integers-(included) b/Lang/D/Arbitrary-precision-integers-(included) deleted file mode 120000 index 671b355fe3..0000000000 --- a/Lang/D/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/D \ No newline at end of file diff --git a/Lang/E/Arbitrary-precision-integers-(included) b/Lang/E/Arbitrary-precision-integers-(included) deleted file mode 120000 index e7eab2c630..0000000000 --- a/Lang/E/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/E \ No newline at end of file diff --git a/Lang/Emacs-Lisp/Arbitrary-precision-integers-(included) b/Lang/Emacs-Lisp/Arbitrary-precision-integers-(included) deleted file mode 120000 index a225b1170d..0000000000 --- a/Lang/Emacs-Lisp/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Emacs-Lisp \ No newline at end of file diff --git a/Lang/Erlang/Arbitrary-precision-integers-(included) b/Lang/Erlang/Arbitrary-precision-integers-(included) deleted file mode 120000 index 5f91c4abcd..0000000000 --- a/Lang/Erlang/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Erlang \ No newline at end of file diff --git a/Lang/Go/Arbitrary-precision-integers-(included) b/Lang/Go/Arbitrary-precision-integers-(included) deleted file mode 120000 index a05728f01f..0000000000 --- a/Lang/Go/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Go \ No newline at end of file diff --git a/Lang/Haskell/Arbitrary-precision-integers-(included) b/Lang/Haskell/Arbitrary-precision-integers-(included) deleted file mode 120000 index 3b0b103363..0000000000 --- a/Lang/Haskell/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Haskell \ No newline at end of file diff --git a/Lang/Java/Arbitrary-precision-integers-(included) b/Lang/Java/Arbitrary-precision-integers-(included) deleted file mode 120000 index 2f66d23776..0000000000 --- a/Lang/Java/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Java \ No newline at end of file diff --git a/Lang/MATLAB/Arbitrary-precision-integers-(included) b/Lang/MATLAB/Arbitrary-precision-integers-(included) deleted file mode 120000 index 7730047f9d..0000000000 --- a/Lang/MATLAB/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/MATLAB \ No newline at end of file diff --git a/Lang/N-t-roff/0DESCRIPTION b/Lang/N-t-roff/0DESCRIPTION new file mode 100644 index 0000000000..f66cf163bf --- /dev/null +++ b/Lang/N-t-roff/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/NQP/0DESCRIPTION b/Lang/NQP/0DESCRIPTION new file mode 100644 index 0000000000..1bde9bd55b --- /dev/null +++ b/Lang/NQP/0DESCRIPTION @@ -0,0 +1,4 @@ +{{language}} +'''NQP''', or "Not Quite Perl", is a simplified form of [[derived from::Perl 6]]. + +An introduction is at http://en.wikibooks.org/wiki/Parrot_Virtual_Machine/Not_Quite_Perl \ No newline at end of file diff --git a/Lang/NSIS/0DESCRIPTION b/Lang/NSIS/0DESCRIPTION new file mode 100644 index 0000000000..ee72beed26 --- /dev/null +++ b/Lang/NSIS/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language|NSIS +|exec=machine +|site=http://nsis.sourceforge.net +|gc=no +|untyped=yes +|tags=NSIS, nsis +|LCT=no}} + +'''NSIS''' is a full-featured [[Windows]] installation creator based on an eponymous [[procedural programming|procedural]] language developed by [[wp:Nullsoft|Nullsoft]]. The original version of NSIS was used to install [[wp:Winamp|Winamp]] and its plugins. + +==Citations== +*[[wp:Nullsoft Scriptable Install System|NSIS on Wikipedia]] + +{{language programming paradigm|Procedural}} \ No newline at end of file diff --git a/Lang/NSIS/Arithmetic-Integer b/Lang/NSIS/Arithmetic-Integer new file mode 120000 index 0000000000..7fcaf6faea --- /dev/null +++ b/Lang/NSIS/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/NSIS \ No newline at end of file diff --git a/Lang/NSIS/Arrays b/Lang/NSIS/Arrays new file mode 120000 index 0000000000..865dd6ed41 --- /dev/null +++ b/Lang/NSIS/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/NSIS \ No newline at end of file diff --git a/Lang/NSIS/Bitwise-operations b/Lang/NSIS/Bitwise-operations new file mode 120000 index 0000000000..d3066834a8 --- /dev/null +++ b/Lang/NSIS/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/NSIS \ No newline at end of file diff --git a/Lang/NSIS/Comments b/Lang/NSIS/Comments new file mode 120000 index 0000000000..e1f326ab83 --- /dev/null +++ b/Lang/NSIS/Comments @@ -0,0 +1 @@ +../../Task/Comments/NSIS \ No newline at end of file diff --git a/Lang/NSIS/Integer-comparison b/Lang/NSIS/Integer-comparison new file mode 120000 index 0000000000..dd50404dda --- /dev/null +++ b/Lang/NSIS/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/NSIS \ No newline at end of file diff --git a/Lang/Neat/0DESCRIPTION b/Lang/Neat/0DESCRIPTION new file mode 100644 index 0000000000..a1dfc291c3 --- /dev/null +++ b/Lang/Neat/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language}} + +Neat is [[User:FeepingCreature|feep]]'s language, a D derivate with a focus on gamedev and terseness. Compiler is up on [http://www.github.com/FeepingCreature/fcc github]. Caution advised: not for newcomers. \ No newline at end of file diff --git a/Lang/Neat/Hello-world-Text b/Lang/Neat/Hello-world-Text new file mode 120000 index 0000000000..b86a7cfd2b --- /dev/null +++ b/Lang/Neat/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Neat \ No newline at end of file diff --git a/Lang/Neko/0DESCRIPTION b/Lang/Neko/0DESCRIPTION new file mode 100644 index 0000000000..6f806eb1aa --- /dev/null +++ b/Lang/Neko/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language +|site=http://nekovm.org/ +}} \ No newline at end of file diff --git a/Lang/Neko/Function-definition b/Lang/Neko/Function-definition new file mode 120000 index 0000000000..1daa01069c --- /dev/null +++ b/Lang/Neko/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Neko \ No newline at end of file diff --git a/Lang/Nemerle/0DESCRIPTION b/Lang/Nemerle/0DESCRIPTION new file mode 100644 index 0000000000..0e4e42b2d5 --- /dev/null +++ b/Lang/Nemerle/0DESCRIPTION @@ -0,0 +1,20 @@ +{{language|Nemerle +|exec=bytecode +|site=http://nemerle.org/Main_Page +|gc=yes +|express=implicit +|strength=strong +|compat=nominative +|checking=static +}} +{{language programming paradigm|object-oriented}} +{{language programming paradigm|imperative}} +{{language programming paradigm|functional}} +Nemerle is a high-level, statically-typed programming language for the [[.NET]] platform. It offers functional, object-oriented and imperative features. It has a simple [[C sharp|C#]]-like syntax and a powerful meta-programming system. + +Features that come from the functional land are variants, pattern matching, type inference and parameter polymorphism (aka generics). The meta-programming system allows great compiler extensibility, embedding domain specific languages, partial evaluation and aspect-oriented programming. + +==See Also== +* [[wp:Nemerle|Wikipedia: Nemerle]] +* [http://nemerle.org/wiki/index.php?title=Grokking_Nemerle Grokking Nemerle] +* [http://nemerle.org/wiki/index.php?title=Quick_Guide Nemerle Quick Guide] \ No newline at end of file diff --git a/Lang/Nemerle/99-Bottles-of-Beer b/Lang/Nemerle/99-Bottles-of-Beer new file mode 120000 index 0000000000..1613a967ef --- /dev/null +++ b/Lang/Nemerle/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/A+B b/Lang/Nemerle/A+B new file mode 120000 index 0000000000..0933c1e82e --- /dev/null +++ b/Lang/Nemerle/A+B @@ -0,0 +1 @@ +../../Task/A+B/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Anonymous-recursion b/Lang/Nemerle/Anonymous-recursion new file mode 120000 index 0000000000..8bc8713be3 --- /dev/null +++ b/Lang/Nemerle/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Arithmetic-Integer b/Lang/Nemerle/Arithmetic-Integer new file mode 120000 index 0000000000..580ae6e217 --- /dev/null +++ b/Lang/Nemerle/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Array-concatenation b/Lang/Nemerle/Array-concatenation new file mode 120000 index 0000000000..86554e3b06 --- /dev/null +++ b/Lang/Nemerle/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Arrays b/Lang/Nemerle/Arrays new file mode 120000 index 0000000000..e805bf3204 --- /dev/null +++ b/Lang/Nemerle/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Associative-array-Creation b/Lang/Nemerle/Associative-array-Creation new file mode 120000 index 0000000000..c51ba3bd6f --- /dev/null +++ b/Lang/Nemerle/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Averages-Arithmetic-mean b/Lang/Nemerle/Averages-Arithmetic-mean new file mode 120000 index 0000000000..081e7252a9 --- /dev/null +++ b/Lang/Nemerle/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Averages-Root-mean-square b/Lang/Nemerle/Averages-Root-mean-square new file mode 120000 index 0000000000..8f969a46ed --- /dev/null +++ b/Lang/Nemerle/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Bitwise-operations b/Lang/Nemerle/Bitwise-operations new file mode 120000 index 0000000000..635699086a --- /dev/null +++ b/Lang/Nemerle/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Case-sensitivity-of-identifiers b/Lang/Nemerle/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..851e98c56b --- /dev/null +++ b/Lang/Nemerle/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Comments b/Lang/Nemerle/Comments new file mode 120000 index 0000000000..7f400f61a2 --- /dev/null +++ b/Lang/Nemerle/Comments @@ -0,0 +1 @@ +../../Task/Comments/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Conditional-structures b/Lang/Nemerle/Conditional-structures new file mode 120000 index 0000000000..9894624e66 --- /dev/null +++ b/Lang/Nemerle/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Determine-if-a-string-is-numeric b/Lang/Nemerle/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..66a3f9da84 --- /dev/null +++ b/Lang/Nemerle/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Dot-product b/Lang/Nemerle/Dot-product new file mode 120000 index 0000000000..18de46682f --- /dev/null +++ b/Lang/Nemerle/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Empty-program b/Lang/Nemerle/Empty-program new file mode 120000 index 0000000000..12dbc0081d --- /dev/null +++ b/Lang/Nemerle/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Empty-string b/Lang/Nemerle/Empty-string new file mode 120000 index 0000000000..5647c8922c --- /dev/null +++ b/Lang/Nemerle/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Enforced-immutability b/Lang/Nemerle/Enforced-immutability new file mode 120000 index 0000000000..1203988484 --- /dev/null +++ b/Lang/Nemerle/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Ethiopian-multiplication b/Lang/Nemerle/Ethiopian-multiplication new file mode 120000 index 0000000000..2948224f9e --- /dev/null +++ b/Lang/Nemerle/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Extend-your-language b/Lang/Nemerle/Extend-your-language new file mode 120000 index 0000000000..f46b74e03f --- /dev/null +++ b/Lang/Nemerle/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Factorial b/Lang/Nemerle/Factorial new file mode 120000 index 0000000000..20612e9a01 --- /dev/null +++ b/Lang/Nemerle/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Fibonacci-sequence b/Lang/Nemerle/Fibonacci-sequence new file mode 120000 index 0000000000..ae11a194db --- /dev/null +++ b/Lang/Nemerle/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Filter b/Lang/Nemerle/Filter new file mode 120000 index 0000000000..f2b03843fc --- /dev/null +++ b/Lang/Nemerle/Filter @@ -0,0 +1 @@ +../../Task/Filter/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/First-class-functions b/Lang/Nemerle/First-class-functions new file mode 120000 index 0000000000..aed7a4108d --- /dev/null +++ b/Lang/Nemerle/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/First-class-functions-Use-numbers-analogously b/Lang/Nemerle/First-class-functions-Use-numbers-analogously new file mode 120000 index 0000000000..279155388d --- /dev/null +++ b/Lang/Nemerle/First-class-functions-Use-numbers-analogously @@ -0,0 +1 @@ +../../Task/First-class-functions-Use-numbers-analogously/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/FizzBuzz b/Lang/Nemerle/FizzBuzz new file mode 120000 index 0000000000..b8e2223082 --- /dev/null +++ b/Lang/Nemerle/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Function-composition b/Lang/Nemerle/Function-composition new file mode 120000 index 0000000000..f5e6157d1a --- /dev/null +++ b/Lang/Nemerle/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Generic-swap b/Lang/Nemerle/Generic-swap new file mode 120000 index 0000000000..e80ab3a6b4 --- /dev/null +++ b/Lang/Nemerle/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Guess-the-number b/Lang/Nemerle/Guess-the-number new file mode 120000 index 0000000000..b83c28f3e0 --- /dev/null +++ b/Lang/Nemerle/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Guess-the-number-With-feedback b/Lang/Nemerle/Guess-the-number-With-feedback new file mode 120000 index 0000000000..fdfb4a8263 --- /dev/null +++ b/Lang/Nemerle/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Hash-from-two-arrays b/Lang/Nemerle/Hash-from-two-arrays new file mode 120000 index 0000000000..e3adb10b8b --- /dev/null +++ b/Lang/Nemerle/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Hello-world-Graphical b/Lang/Nemerle/Hello-world-Graphical new file mode 120000 index 0000000000..d406ba7c03 --- /dev/null +++ b/Lang/Nemerle/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Hello-world-Newline-omission b/Lang/Nemerle/Hello-world-Newline-omission new file mode 120000 index 0000000000..0e2e5ac63b --- /dev/null +++ b/Lang/Nemerle/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Hello-world-Text b/Lang/Nemerle/Hello-world-Text new file mode 120000 index 0000000000..19f7e93479 --- /dev/null +++ b/Lang/Nemerle/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Higher-order-functions b/Lang/Nemerle/Higher-order-functions new file mode 120000 index 0000000000..a4a93b98ee --- /dev/null +++ b/Lang/Nemerle/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Increment-a-numerical-string b/Lang/Nemerle/Increment-a-numerical-string new file mode 120000 index 0000000000..505c6d02fc --- /dev/null +++ b/Lang/Nemerle/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Infinity b/Lang/Nemerle/Infinity new file mode 120000 index 0000000000..feb93fa852 --- /dev/null +++ b/Lang/Nemerle/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Integer-comparison b/Lang/Nemerle/Integer-comparison new file mode 120000 index 0000000000..7c7c727262 --- /dev/null +++ b/Lang/Nemerle/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Knuth-shuffle b/Lang/Nemerle/Knuth-shuffle new file mode 120000 index 0000000000..fac23f8df0 --- /dev/null +++ b/Lang/Nemerle/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/List-comprehensions b/Lang/Nemerle/List-comprehensions new file mode 120000 index 0000000000..a0a70b725f --- /dev/null +++ b/Lang/Nemerle/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Logical-operations b/Lang/Nemerle/Logical-operations new file mode 120000 index 0000000000..a22bf97c78 --- /dev/null +++ b/Lang/Nemerle/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loop-over-multiple-arrays-simultaneously b/Lang/Nemerle/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..b50fac6161 --- /dev/null +++ b/Lang/Nemerle/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-Break b/Lang/Nemerle/Loops-Break new file mode 120000 index 0000000000..6edf357871 --- /dev/null +++ b/Lang/Nemerle/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-Continue b/Lang/Nemerle/Loops-Continue new file mode 120000 index 0000000000..22edebee74 --- /dev/null +++ b/Lang/Nemerle/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-Do-while b/Lang/Nemerle/Loops-Do-while new file mode 120000 index 0000000000..7e3a9d5b67 --- /dev/null +++ b/Lang/Nemerle/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-Downward-for b/Lang/Nemerle/Loops-Downward-for new file mode 120000 index 0000000000..9b8bbeac5c --- /dev/null +++ b/Lang/Nemerle/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-For b/Lang/Nemerle/Loops-For new file mode 120000 index 0000000000..ac69844746 --- /dev/null +++ b/Lang/Nemerle/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-For-with-a-specified-step b/Lang/Nemerle/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..7afde2e586 --- /dev/null +++ b/Lang/Nemerle/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-Foreach b/Lang/Nemerle/Loops-Foreach new file mode 120000 index 0000000000..0e1f9a55d0 --- /dev/null +++ b/Lang/Nemerle/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-Infinite b/Lang/Nemerle/Loops-Infinite new file mode 120000 index 0000000000..100f3e4bc2 --- /dev/null +++ b/Lang/Nemerle/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-N-plus-one-half b/Lang/Nemerle/Loops-N-plus-one-half new file mode 120000 index 0000000000..832b1c8735 --- /dev/null +++ b/Lang/Nemerle/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-Nested b/Lang/Nemerle/Loops-Nested new file mode 120000 index 0000000000..5920bff18f --- /dev/null +++ b/Lang/Nemerle/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Loops-While b/Lang/Nemerle/Loops-While new file mode 120000 index 0000000000..61abbe27e0 --- /dev/null +++ b/Lang/Nemerle/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/MD5 b/Lang/Nemerle/MD5 new file mode 120000 index 0000000000..90b67824fd --- /dev/null +++ b/Lang/Nemerle/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Map-range b/Lang/Nemerle/Map-range new file mode 120000 index 0000000000..9f4b39c9bd --- /dev/null +++ b/Lang/Nemerle/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/Nemerle \ No newline at end of file diff --git a/Lang/Nemerle/Mutual-recursion b/Lang/Nemerle/Mutual-recursion new file mode 120000 index 0000000000..c6d5e11704 --- /dev/null +++ b/Lang/Nemerle/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Nemerle \ No newline at end of file diff --git a/Lang/NetLogo/0DESCRIPTION b/Lang/NetLogo/0DESCRIPTION new file mode 100644 index 0000000000..4d3d27c049 --- /dev/null +++ b/Lang/NetLogo/0DESCRIPTION @@ -0,0 +1 @@ +{{stub}}{{language}} \ No newline at end of file diff --git a/Lang/NetLogo/Detect-division-by-zero b/Lang/NetLogo/Detect-division-by-zero new file mode 120000 index 0000000000..04510924eb --- /dev/null +++ b/Lang/NetLogo/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/NetLogo \ No newline at end of file diff --git a/Lang/NetRexx/0DESCRIPTION b/Lang/NetRexx/0DESCRIPTION new file mode 100644 index 0000000000..b0458b971f --- /dev/null +++ b/Lang/NetRexx/0DESCRIPTION @@ -0,0 +1,35 @@ +{{language +|NetRexx +|exec=both +|site=http://www.netrexx.org +|gc=yes +|parampass=value +|safety=safe +|tags=netrexx, rexx, java +}} +== Introduction == + +'''NetRexx''' is a general-purpose programming language inspired by two very different programming languages, [[REXX|Rexx]] and [[Java]]TM. +It is designed for people, not computers. In this respect it follows Rexx closely, with many of the concepts and most of the syntax +taken directly from Rexx or its object-oriented version, [[ooRexx|Open Object Rexx]]. +From Java it derives static typing, binary arithmetic, the object model, and exception handling. +The resulting language not only provides the scripting capabilities and decimal arithmetic of Rexx, but also seamlessly +extends to large application development with fast binary arithmetic. + +The reference implementation of NetRexx produces classes for the [[runs on vm::Java Virtual Machine]], and in so doing demonstrates the value of that concrete +interface between language and machine: NetRexx classes and Java classes are entirely equivalent – NetRexx can use any Java class +(and vice versa) and inherits the portability and robustness of the Java environment. + +=== Language Objectives === + +The programming language NetRexx, which is derived from both Rexx and Java is intended as a dialect of Rexx that can be as efficient and portable +as languages such as Java, while preserving the low threshold to learning and the ease of use of the original Rexx language. + +==== Open Source ==== + +On the 8th of June 2011, IBM transferred ownership of the reference implementation of NetRexx to The Rexx Language Association (RexxLA) for administration under the [http://site.icu-project.org ICU - International Components for Unicode] open source license. + +==== Useful Links ==== +* [http://www.netrexx.org The NetRexx Programming Language - www.netrexx.org] +* [http://www.rexxla.org The Rexx Language Association - www.rexxla.org] +* [http://www.oorexx.org/ Open Object Rexx - www.oorexx.org] \ No newline at end of file diff --git a/Lang/NetRexx/100-doors b/Lang/NetRexx/100-doors new file mode 120000 index 0000000000..9116a9d099 --- /dev/null +++ b/Lang/NetRexx/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/99-Bottles-of-Beer b/Lang/NetRexx/99-Bottles-of-Beer new file mode 120000 index 0000000000..41b616d41e --- /dev/null +++ b/Lang/NetRexx/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/A+B b/Lang/NetRexx/A+B new file mode 120000 index 0000000000..0f54fa5f08 --- /dev/null +++ b/Lang/NetRexx/A+B @@ -0,0 +1 @@ +../../Task/A+B/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Abstract-type b/Lang/NetRexx/Abstract-type new file mode 120000 index 0000000000..8999b31464 --- /dev/null +++ b/Lang/NetRexx/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Ackermann-function b/Lang/NetRexx/Ackermann-function new file mode 120000 index 0000000000..8eaf536d9b --- /dev/null +++ b/Lang/NetRexx/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Active-Directory-Connect b/Lang/NetRexx/Active-Directory-Connect new file mode 120000 index 0000000000..120211ccb2 --- /dev/null +++ b/Lang/NetRexx/Active-Directory-Connect @@ -0,0 +1 @@ +../../Task/Active-Directory-Connect/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Active-Directory-Search-for-a-user b/Lang/NetRexx/Active-Directory-Search-for-a-user new file mode 120000 index 0000000000..797577b940 --- /dev/null +++ b/Lang/NetRexx/Active-Directory-Search-for-a-user @@ -0,0 +1 @@ +../../Task/Active-Directory-Search-for-a-user/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Arbitrary-precision-integers-included b/Lang/NetRexx/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..b066dca534 --- /dev/null +++ b/Lang/NetRexx/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Arithmetic-Integer b/Lang/NetRexx/Arithmetic-Integer new file mode 120000 index 0000000000..dee8f5abeb --- /dev/null +++ b/Lang/NetRexx/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Arithmetic-geometric-mean b/Lang/NetRexx/Arithmetic-geometric-mean new file mode 120000 index 0000000000..270e08a6aa --- /dev/null +++ b/Lang/NetRexx/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Array-concatenation b/Lang/NetRexx/Array-concatenation new file mode 120000 index 0000000000..38b29c77d6 --- /dev/null +++ b/Lang/NetRexx/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Arrays b/Lang/NetRexx/Arrays new file mode 120000 index 0000000000..b4d781d7e8 --- /dev/null +++ b/Lang/NetRexx/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Associative-array-Creation b/Lang/NetRexx/Associative-array-Creation new file mode 120000 index 0000000000..a4cff972a8 --- /dev/null +++ b/Lang/NetRexx/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Associative-array-Iteration b/Lang/NetRexx/Associative-array-Iteration new file mode 120000 index 0000000000..5998d1f332 --- /dev/null +++ b/Lang/NetRexx/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Averages-Arithmetic-mean b/Lang/NetRexx/Averages-Arithmetic-mean new file mode 120000 index 0000000000..6e2abd284a --- /dev/null +++ b/Lang/NetRexx/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Averages-Median b/Lang/NetRexx/Averages-Median new file mode 120000 index 0000000000..0774c8b52a --- /dev/null +++ b/Lang/NetRexx/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Averages-Mode b/Lang/NetRexx/Averages-Mode new file mode 120000 index 0000000000..60341c98dc --- /dev/null +++ b/Lang/NetRexx/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Averages-Pythagorean-means b/Lang/NetRexx/Averages-Pythagorean-means new file mode 120000 index 0000000000..ed42ca4530 --- /dev/null +++ b/Lang/NetRexx/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Averages-Root-mean-square b/Lang/NetRexx/Averages-Root-mean-square new file mode 120000 index 0000000000..44ad9336ec --- /dev/null +++ b/Lang/NetRexx/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Averages-Simple-moving-average b/Lang/NetRexx/Averages-Simple-moving-average new file mode 120000 index 0000000000..9253bf3527 --- /dev/null +++ b/Lang/NetRexx/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Boolean-values b/Lang/NetRexx/Boolean-values new file mode 120000 index 0000000000..88095abe6f --- /dev/null +++ b/Lang/NetRexx/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Box-the-compass b/Lang/NetRexx/Box-the-compass new file mode 120000 index 0000000000..63e3fdf1c2 --- /dev/null +++ b/Lang/NetRexx/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/CRC-32 b/Lang/NetRexx/CRC-32 new file mode 120000 index 0000000000..d6be1c31c2 --- /dev/null +++ b/Lang/NetRexx/CRC-32 @@ -0,0 +1 @@ +../../Task/CRC-32/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/CSV-to-HTML-translation b/Lang/NetRexx/CSV-to-HTML-translation new file mode 120000 index 0000000000..151405833d --- /dev/null +++ b/Lang/NetRexx/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Caesar-cipher b/Lang/NetRexx/Caesar-cipher new file mode 120000 index 0000000000..b2a51da9dd --- /dev/null +++ b/Lang/NetRexx/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Call-an-object-method b/Lang/NetRexx/Call-an-object-method new file mode 120000 index 0000000000..b17a758cfc --- /dev/null +++ b/Lang/NetRexx/Call-an-object-method @@ -0,0 +1 @@ +../../Task/Call-an-object-method/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Case-sensitivity-of-identifiers b/Lang/NetRexx/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..6e753e9c61 --- /dev/null +++ b/Lang/NetRexx/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Character-codes b/Lang/NetRexx/Character-codes new file mode 120000 index 0000000000..9548d9fc16 --- /dev/null +++ b/Lang/NetRexx/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Character-matching b/Lang/NetRexx/Character-matching new file mode 120000 index 0000000000..07bd655daf --- /dev/null +++ b/Lang/NetRexx/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Classes b/Lang/NetRexx/Classes new file mode 120000 index 0000000000..a1dd955f49 --- /dev/null +++ b/Lang/NetRexx/Classes @@ -0,0 +1 @@ +../../Task/Classes/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Collections b/Lang/NetRexx/Collections new file mode 120000 index 0000000000..a5c9e43239 --- /dev/null +++ b/Lang/NetRexx/Collections @@ -0,0 +1 @@ +../../Task/Collections/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Command-line-arguments b/Lang/NetRexx/Command-line-arguments new file mode 120000 index 0000000000..5850afac66 --- /dev/null +++ b/Lang/NetRexx/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Comments b/Lang/NetRexx/Comments new file mode 120000 index 0000000000..437bcc6788 --- /dev/null +++ b/Lang/NetRexx/Comments @@ -0,0 +1 @@ +../../Task/Comments/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Compound-data-type b/Lang/NetRexx/Compound-data-type new file mode 120000 index 0000000000..fe386a8be1 --- /dev/null +++ b/Lang/NetRexx/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Conditional-structures b/Lang/NetRexx/Conditional-structures new file mode 120000 index 0000000000..18abccde2b --- /dev/null +++ b/Lang/NetRexx/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Continued-fraction b/Lang/NetRexx/Continued-fraction new file mode 120000 index 0000000000..c9e8459460 --- /dev/null +++ b/Lang/NetRexx/Continued-fraction @@ -0,0 +1 @@ +../../Task/Continued-fraction/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Count-in-octal b/Lang/NetRexx/Count-in-octal new file mode 120000 index 0000000000..8dba985fb5 --- /dev/null +++ b/Lang/NetRexx/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Count-occurrences-of-a-substring b/Lang/NetRexx/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..4af18f2efd --- /dev/null +++ b/Lang/NetRexx/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Create-a-file b/Lang/NetRexx/Create-a-file new file mode 120000 index 0000000000..3e5250b01b --- /dev/null +++ b/Lang/NetRexx/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Create-a-two-dimensional-array-at-runtime b/Lang/NetRexx/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..3467214879 --- /dev/null +++ b/Lang/NetRexx/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Create-an-HTML-table b/Lang/NetRexx/Create-an-HTML-table new file mode 120000 index 0000000000..1949d1f72c --- /dev/null +++ b/Lang/NetRexx/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Date-format b/Lang/NetRexx/Date-format new file mode 120000 index 0000000000..0396294a44 --- /dev/null +++ b/Lang/NetRexx/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Date-manipulation b/Lang/NetRexx/Date-manipulation new file mode 120000 index 0000000000..31dc0dd920 --- /dev/null +++ b/Lang/NetRexx/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Day-of-the-week b/Lang/NetRexx/Day-of-the-week new file mode 120000 index 0000000000..a35580f840 --- /dev/null +++ b/Lang/NetRexx/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Detect-division-by-zero b/Lang/NetRexx/Detect-division-by-zero new file mode 120000 index 0000000000..f8a4bd0e2c --- /dev/null +++ b/Lang/NetRexx/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Determine-if-a-string-is-numeric b/Lang/NetRexx/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..0ab85c0564 --- /dev/null +++ b/Lang/NetRexx/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Digital-root b/Lang/NetRexx/Digital-root new file mode 120000 index 0000000000..a51308b055 --- /dev/null +++ b/Lang/NetRexx/Digital-root @@ -0,0 +1 @@ +../../Task/Digital-root/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Dot-product b/Lang/NetRexx/Dot-product new file mode 120000 index 0000000000..783fb92c59 --- /dev/null +++ b/Lang/NetRexx/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Empty-program b/Lang/NetRexx/Empty-program new file mode 120000 index 0000000000..bd67cde513 --- /dev/null +++ b/Lang/NetRexx/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Empty-string b/Lang/NetRexx/Empty-string new file mode 120000 index 0000000000..47cfba368b --- /dev/null +++ b/Lang/NetRexx/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Ethiopian-multiplication b/Lang/NetRexx/Ethiopian-multiplication new file mode 120000 index 0000000000..b644adbb3e --- /dev/null +++ b/Lang/NetRexx/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Even-or-odd b/Lang/NetRexx/Even-or-odd new file mode 120000 index 0000000000..fc0424cb1f --- /dev/null +++ b/Lang/NetRexx/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Exceptions b/Lang/NetRexx/Exceptions new file mode 120000 index 0000000000..c692562edb --- /dev/null +++ b/Lang/NetRexx/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Factorial b/Lang/NetRexx/Factorial new file mode 120000 index 0000000000..621d1d3109 --- /dev/null +++ b/Lang/NetRexx/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Fibonacci-sequence b/Lang/NetRexx/Fibonacci-sequence new file mode 120000 index 0000000000..0b17311078 --- /dev/null +++ b/Lang/NetRexx/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/File-IO b/Lang/NetRexx/File-IO new file mode 120000 index 0000000000..d6e591455f --- /dev/null +++ b/Lang/NetRexx/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Find-limit-of-recursion b/Lang/NetRexx/Find-limit-of-recursion new file mode 120000 index 0000000000..2f2c3490cf --- /dev/null +++ b/Lang/NetRexx/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Five-weekends b/Lang/NetRexx/Five-weekends new file mode 120000 index 0000000000..9ee3acc6be --- /dev/null +++ b/Lang/NetRexx/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/FizzBuzz b/Lang/NetRexx/FizzBuzz new file mode 120000 index 0000000000..5d08a6b298 --- /dev/null +++ b/Lang/NetRexx/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Flow-control-structures b/Lang/NetRexx/Flow-control-structures new file mode 120000 index 0000000000..bfca9e3d97 --- /dev/null +++ b/Lang/NetRexx/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Floyds-triangle b/Lang/NetRexx/Floyds-triangle new file mode 120000 index 0000000000..454e8a01da --- /dev/null +++ b/Lang/NetRexx/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Formatted-numeric-output b/Lang/NetRexx/Formatted-numeric-output new file mode 120000 index 0000000000..8fb55f03d5 --- /dev/null +++ b/Lang/NetRexx/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Forward-difference b/Lang/NetRexx/Forward-difference new file mode 120000 index 0000000000..b310f3c1b3 --- /dev/null +++ b/Lang/NetRexx/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Function-definition b/Lang/NetRexx/Function-definition new file mode 120000 index 0000000000..7a4fc52bde --- /dev/null +++ b/Lang/NetRexx/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Greatest-element-of-a-list b/Lang/NetRexx/Greatest-element-of-a-list new file mode 120000 index 0000000000..e2cf97d755 --- /dev/null +++ b/Lang/NetRexx/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Greatest-subsequential-sum b/Lang/NetRexx/Greatest-subsequential-sum new file mode 120000 index 0000000000..90c4c97aba --- /dev/null +++ b/Lang/NetRexx/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Guess-the-number b/Lang/NetRexx/Guess-the-number new file mode 120000 index 0000000000..57de3694a7 --- /dev/null +++ b/Lang/NetRexx/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/HTTP b/Lang/NetRexx/HTTP new file mode 120000 index 0000000000..96c56c9f47 --- /dev/null +++ b/Lang/NetRexx/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hailstone-sequence b/Lang/NetRexx/Hailstone-sequence new file mode 120000 index 0000000000..f175f67ee1 --- /dev/null +++ b/Lang/NetRexx/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Happy-numbers b/Lang/NetRexx/Happy-numbers new file mode 120000 index 0000000000..5c8cf223d8 --- /dev/null +++ b/Lang/NetRexx/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hash-from-two-arrays b/Lang/NetRexx/Hash-from-two-arrays new file mode 120000 index 0000000000..7e51d6e45b --- /dev/null +++ b/Lang/NetRexx/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hello-world-Graphical b/Lang/NetRexx/Hello-world-Graphical new file mode 120000 index 0000000000..f7da2cf770 --- /dev/null +++ b/Lang/NetRexx/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hello-world-Newline-omission b/Lang/NetRexx/Hello-world-Newline-omission new file mode 120000 index 0000000000..f89313b1b3 --- /dev/null +++ b/Lang/NetRexx/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hello-world-Standard-error b/Lang/NetRexx/Hello-world-Standard-error new file mode 120000 index 0000000000..d9e5a1355c --- /dev/null +++ b/Lang/NetRexx/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hello-world-Text b/Lang/NetRexx/Hello-world-Text new file mode 120000 index 0000000000..d66684d9e9 --- /dev/null +++ b/Lang/NetRexx/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hello-world-Web-server b/Lang/NetRexx/Hello-world-Web-server new file mode 120000 index 0000000000..39182bea9b --- /dev/null +++ b/Lang/NetRexx/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Host-introspection b/Lang/NetRexx/Host-introspection new file mode 120000 index 0000000000..7d5ca51126 --- /dev/null +++ b/Lang/NetRexx/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Hostname b/Lang/NetRexx/Hostname new file mode 120000 index 0000000000..3fc364332d --- /dev/null +++ b/Lang/NetRexx/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Increment-a-numerical-string b/Lang/NetRexx/Increment-a-numerical-string new file mode 120000 index 0000000000..b006198bd4 --- /dev/null +++ b/Lang/NetRexx/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Input-loop b/Lang/NetRexx/Input-loop new file mode 120000 index 0000000000..8831205b2c --- /dev/null +++ b/Lang/NetRexx/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Integer-comparison b/Lang/NetRexx/Integer-comparison new file mode 120000 index 0000000000..c8da571222 --- /dev/null +++ b/Lang/NetRexx/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Integer-sequence b/Lang/NetRexx/Integer-sequence new file mode 120000 index 0000000000..3e917cb5e9 --- /dev/null +++ b/Lang/NetRexx/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/JSON b/Lang/NetRexx/JSON new file mode 120000 index 0000000000..34f1ba4979 --- /dev/null +++ b/Lang/NetRexx/JSON @@ -0,0 +1 @@ +../../Task/JSON/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Jensens-Device b/Lang/NetRexx/Jensens-Device new file mode 120000 index 0000000000..cc658c7789 --- /dev/null +++ b/Lang/NetRexx/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Josephus-problem b/Lang/NetRexx/Josephus-problem new file mode 120000 index 0000000000..698ff7d800 --- /dev/null +++ b/Lang/NetRexx/Josephus-problem @@ -0,0 +1 @@ +../../Task/Josephus-problem/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Knuth-shuffle b/Lang/NetRexx/Knuth-shuffle new file mode 120000 index 0000000000..3b4edd7fea --- /dev/null +++ b/Lang/NetRexx/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Leap-year b/Lang/NetRexx/Leap-year new file mode 120000 index 0000000000..207bb75957 --- /dev/null +++ b/Lang/NetRexx/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Levenshtein-distance b/Lang/NetRexx/Levenshtein-distance new file mode 120000 index 0000000000..9b053d6da4 --- /dev/null +++ b/Lang/NetRexx/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Literals-Floating-point b/Lang/NetRexx/Literals-Floating-point new file mode 120000 index 0000000000..0fa762a039 --- /dev/null +++ b/Lang/NetRexx/Literals-Floating-point @@ -0,0 +1 @@ +../../Task/Literals-Floating-point/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Literals-Integer b/Lang/NetRexx/Literals-Integer new file mode 120000 index 0000000000..2f8db9f0cf --- /dev/null +++ b/Lang/NetRexx/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Logical-operations b/Lang/NetRexx/Logical-operations new file mode 120000 index 0000000000..e7f4bd8731 --- /dev/null +++ b/Lang/NetRexx/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loop-over-multiple-arrays-simultaneously b/Lang/NetRexx/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..88ed3da45e --- /dev/null +++ b/Lang/NetRexx/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-Break b/Lang/NetRexx/Loops-Break new file mode 120000 index 0000000000..9ab29bf74b --- /dev/null +++ b/Lang/NetRexx/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-Continue b/Lang/NetRexx/Loops-Continue new file mode 120000 index 0000000000..ddb86b6dc1 --- /dev/null +++ b/Lang/NetRexx/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-Do-while b/Lang/NetRexx/Loops-Do-while new file mode 120000 index 0000000000..e15e46588b --- /dev/null +++ b/Lang/NetRexx/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-Downward-for b/Lang/NetRexx/Loops-Downward-for new file mode 120000 index 0000000000..d95a074c43 --- /dev/null +++ b/Lang/NetRexx/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-For b/Lang/NetRexx/Loops-For new file mode 120000 index 0000000000..6cfcdcebd5 --- /dev/null +++ b/Lang/NetRexx/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-For-with-a-specified-step b/Lang/NetRexx/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..f17982b5c7 --- /dev/null +++ b/Lang/NetRexx/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-Foreach b/Lang/NetRexx/Loops-Foreach new file mode 120000 index 0000000000..5c0fe0301a --- /dev/null +++ b/Lang/NetRexx/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-Infinite b/Lang/NetRexx/Loops-Infinite new file mode 120000 index 0000000000..a7f66a1a2f --- /dev/null +++ b/Lang/NetRexx/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-N-plus-one-half b/Lang/NetRexx/Loops-N-plus-one-half new file mode 120000 index 0000000000..a0fdd67051 --- /dev/null +++ b/Lang/NetRexx/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-Nested b/Lang/NetRexx/Loops-Nested new file mode 120000 index 0000000000..03279f7e01 --- /dev/null +++ b/Lang/NetRexx/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Loops-While b/Lang/NetRexx/Loops-While new file mode 120000 index 0000000000..8ffc2c8626 --- /dev/null +++ b/Lang/NetRexx/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Luhn-test-of-credit-card-numbers b/Lang/NetRexx/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..7bdc6c9363 --- /dev/null +++ b/Lang/NetRexx/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/MD5 b/Lang/NetRexx/MD5 new file mode 120000 index 0000000000..b4058aa54a --- /dev/null +++ b/Lang/NetRexx/MD5 @@ -0,0 +1 @@ +../../Task/MD5/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Map-range b/Lang/NetRexx/Map-range new file mode 120000 index 0000000000..cd324104fa --- /dev/null +++ b/Lang/NetRexx/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Middle-three-digits b/Lang/NetRexx/Middle-three-digits new file mode 120000 index 0000000000..fa4ea7272d --- /dev/null +++ b/Lang/NetRexx/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Ordered-words b/Lang/NetRexx/Ordered-words new file mode 120000 index 0000000000..9ba8ef1ac3 --- /dev/null +++ b/Lang/NetRexx/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Pi b/Lang/NetRexx/Pi new file mode 120000 index 0000000000..88ee7e8824 --- /dev/null +++ b/Lang/NetRexx/Pi @@ -0,0 +1 @@ +../../Task/Pi/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Quine b/Lang/NetRexx/Quine new file mode 120000 index 0000000000..93ecc22817 --- /dev/null +++ b/Lang/NetRexx/Quine @@ -0,0 +1 @@ +../../Task/Quine/NetRexx \ No newline at end of file diff --git a/Lang/NetRexx/Search-a-list b/Lang/NetRexx/Search-a-list new file mode 120000 index 0000000000..0af0ab8aa4 --- /dev/null +++ b/Lang/NetRexx/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/NetRexx \ No newline at end of file diff --git a/Lang/NewLISP/0DESCRIPTION b/Lang/NewLISP/0DESCRIPTION new file mode 100644 index 0000000000..a24004c87f --- /dev/null +++ b/Lang/NewLISP/0DESCRIPTION @@ -0,0 +1,7 @@ +{{DISPLAYTITLE: Category:newLISP}} +{{language +|site=http://www.newlisp.org/ +}}{{implementation|Lisp}} +'''newLISP''' focuses on the core components of [[LISP]]: lists, symbols, and lambda expressions. To these, newLISP adds [[array|arrays]], implicit indexing on lists and arrays, and dynamic and lexical scoping. Lexical scoping is implemented using separate namespaces called contexts. + +The result is an easier-to-learn LISP that is even smaller than most Scheme implementations, but which still has about 300 built-in functions. Approximately 200k in size, newLISP is built for high portability using only the most common [[UNIX]] system [[C]]-libraries. It loads quickly and has a small memory footprint. newLISP is as fast or faster than other popular scripting languages and uses very few resources. \ No newline at end of file diff --git a/Lang/NewLISP/99-Bottles-of-Beer b/Lang/NewLISP/99-Bottles-of-Beer new file mode 120000 index 0000000000..78662ef30b --- /dev/null +++ b/Lang/NewLISP/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Abstract-type b/Lang/NewLISP/Abstract-type new file mode 120000 index 0000000000..311f11b427 --- /dev/null +++ b/Lang/NewLISP/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Address-of-a-variable b/Lang/NewLISP/Address-of-a-variable new file mode 120000 index 0000000000..8fb31505da --- /dev/null +++ b/Lang/NewLISP/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Apply-a-callback-to-an-array b/Lang/NewLISP/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..116b7ef468 --- /dev/null +++ b/Lang/NewLISP/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Arithmetic-Integer b/Lang/NewLISP/Arithmetic-Integer new file mode 120000 index 0000000000..6ab762a4df --- /dev/null +++ b/Lang/NewLISP/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Array-concatenation b/Lang/NewLISP/Array-concatenation new file mode 120000 index 0000000000..e08ba33959 --- /dev/null +++ b/Lang/NewLISP/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Arrays b/Lang/NewLISP/Arrays new file mode 120000 index 0000000000..22e64c9fcc --- /dev/null +++ b/Lang/NewLISP/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Averages-Arithmetic-mean b/Lang/NewLISP/Averages-Arithmetic-mean new file mode 120000 index 0000000000..9c27c21522 --- /dev/null +++ b/Lang/NewLISP/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Averages-Median b/Lang/NewLISP/Averages-Median new file mode 120000 index 0000000000..ef68347b7f --- /dev/null +++ b/Lang/NewLISP/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Comments b/Lang/NewLISP/Comments new file mode 120000 index 0000000000..7f72fd4bfe --- /dev/null +++ b/Lang/NewLISP/Comments @@ -0,0 +1 @@ +../../Task/Comments/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Count-in-octal b/Lang/NewLISP/Count-in-octal new file mode 120000 index 0000000000..09a219136a --- /dev/null +++ b/Lang/NewLISP/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Count-occurrences-of-a-substring b/Lang/NewLISP/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..65fbd59833 --- /dev/null +++ b/Lang/NewLISP/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Create-an-HTML-table b/Lang/NewLISP/Create-an-HTML-table new file mode 120000 index 0000000000..49148503bc --- /dev/null +++ b/Lang/NewLISP/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Date-format b/Lang/NewLISP/Date-format new file mode 120000 index 0000000000..7ad6b95166 --- /dev/null +++ b/Lang/NewLISP/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Empty-program b/Lang/NewLISP/Empty-program new file mode 120000 index 0000000000..6f3f03e681 --- /dev/null +++ b/Lang/NewLISP/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Extend-your-language b/Lang/NewLISP/Extend-your-language new file mode 120000 index 0000000000..35cf2350a2 --- /dev/null +++ b/Lang/NewLISP/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Fibonacci-sequence b/Lang/NewLISP/Fibonacci-sequence new file mode 120000 index 0000000000..45ac188e36 --- /dev/null +++ b/Lang/NewLISP/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Filter b/Lang/NewLISP/Filter new file mode 120000 index 0000000000..5a5e9f0165 --- /dev/null +++ b/Lang/NewLISP/Filter @@ -0,0 +1 @@ +../../Task/Filter/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Flatten-a-list b/Lang/NewLISP/Flatten-a-list new file mode 120000 index 0000000000..d1f5df05c0 --- /dev/null +++ b/Lang/NewLISP/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Function-composition b/Lang/NewLISP/Function-composition new file mode 120000 index 0000000000..223e1c1ef3 --- /dev/null +++ b/Lang/NewLISP/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Function-definition b/Lang/NewLISP/Function-definition new file mode 120000 index 0000000000..928ede6e70 --- /dev/null +++ b/Lang/NewLISP/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/GUI-enabling-disabling-of-controls b/Lang/NewLISP/GUI-enabling-disabling-of-controls new file mode 120000 index 0000000000..19d88a0223 --- /dev/null +++ b/Lang/NewLISP/GUI-enabling-disabling-of-controls @@ -0,0 +1 @@ +../../Task/GUI-enabling-disabling-of-controls/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Greatest-common-divisor b/Lang/NewLISP/Greatest-common-divisor new file mode 120000 index 0000000000..1e267d91c5 --- /dev/null +++ b/Lang/NewLISP/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Greatest-element-of-a-list b/Lang/NewLISP/Greatest-element-of-a-list new file mode 120000 index 0000000000..52b435e640 --- /dev/null +++ b/Lang/NewLISP/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Guess-the-number b/Lang/NewLISP/Guess-the-number new file mode 120000 index 0000000000..7fc8450a12 --- /dev/null +++ b/Lang/NewLISP/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Guess-the-number-With-feedback b/Lang/NewLISP/Guess-the-number-With-feedback new file mode 120000 index 0000000000..10309122d3 --- /dev/null +++ b/Lang/NewLISP/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Hello-world-Newline-omission b/Lang/NewLISP/Hello-world-Newline-omission new file mode 120000 index 0000000000..1c6275119f --- /dev/null +++ b/Lang/NewLISP/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Here-document b/Lang/NewLISP/Here-document new file mode 120000 index 0000000000..994587b3d6 --- /dev/null +++ b/Lang/NewLISP/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Higher-order-functions b/Lang/NewLISP/Higher-order-functions new file mode 120000 index 0000000000..7a118e8226 --- /dev/null +++ b/Lang/NewLISP/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Hostname b/Lang/NewLISP/Hostname new file mode 120000 index 0000000000..e084b4d44e --- /dev/null +++ b/Lang/NewLISP/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Logical-operations b/Lang/NewLISP/Logical-operations new file mode 120000 index 0000000000..73c5ab7ea4 --- /dev/null +++ b/Lang/NewLISP/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/NewLISP \ No newline at end of file diff --git a/Lang/NewLISP/Loops-For b/Lang/NewLISP/Loops-For new file mode 120000 index 0000000000..bcceb75e77 --- /dev/null +++ b/Lang/NewLISP/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/NewLISP \ No newline at end of file diff --git a/Lang/Nial/0DESCRIPTION b/Lang/Nial/0DESCRIPTION new file mode 100644 index 0000000000..9cd63d0ab0 --- /dev/null +++ b/Lang/Nial/0DESCRIPTION @@ -0,0 +1,8 @@ +{{language|Nial +|strength=strong +|checking=dynamic +|site=http://www.nial.com/ +|LCT=yes}}'''Nial''' (Nested interactive programming language) is an array programming language similar to [[APL]] and its successor [[J]]. + +==References== +* [[wp:Nial|Wikipedia:Nial]] \ No newline at end of file diff --git a/Lang/Nial/99-Bottles-of-Beer b/Lang/Nial/99-Bottles-of-Beer new file mode 120000 index 0000000000..59a6166a83 --- /dev/null +++ b/Lang/Nial/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Nial \ No newline at end of file diff --git a/Lang/Nial/Ackermann-function b/Lang/Nial/Ackermann-function new file mode 120000 index 0000000000..a3b7d6a44b --- /dev/null +++ b/Lang/Nial/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Nial \ No newline at end of file diff --git a/Lang/Nial/Apply-a-callback-to-an-array b/Lang/Nial/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..891304c7cb --- /dev/null +++ b/Lang/Nial/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Nial \ No newline at end of file diff --git a/Lang/Nial/Averages-Arithmetic-mean b/Lang/Nial/Averages-Arithmetic-mean new file mode 120000 index 0000000000..5dbd2ae28b --- /dev/null +++ b/Lang/Nial/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Nial \ No newline at end of file diff --git a/Lang/Nial/Factorial b/Lang/Nial/Factorial new file mode 120000 index 0000000000..b13177c21c --- /dev/null +++ b/Lang/Nial/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Nial \ No newline at end of file diff --git a/Lang/Nial/Filter b/Lang/Nial/Filter new file mode 120000 index 0000000000..78c5ed8e0a --- /dev/null +++ b/Lang/Nial/Filter @@ -0,0 +1 @@ +../../Task/Filter/Nial \ No newline at end of file diff --git a/Lang/Nial/Forward-difference b/Lang/Nial/Forward-difference new file mode 120000 index 0000000000..5718e628c1 --- /dev/null +++ b/Lang/Nial/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Nial \ No newline at end of file diff --git a/Lang/Nial/Function-definition b/Lang/Nial/Function-definition new file mode 120000 index 0000000000..516c71000b --- /dev/null +++ b/Lang/Nial/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Nial \ No newline at end of file diff --git a/Lang/Nial/Generic-swap b/Lang/Nial/Generic-swap new file mode 120000 index 0000000000..b4f59c2c61 --- /dev/null +++ b/Lang/Nial/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Nial \ No newline at end of file diff --git a/Lang/Nial/Greatest-common-divisor b/Lang/Nial/Greatest-common-divisor new file mode 120000 index 0000000000..03277440d3 --- /dev/null +++ b/Lang/Nial/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Nial \ No newline at end of file diff --git a/Lang/Nial/Greatest-element-of-a-list b/Lang/Nial/Greatest-element-of-a-list new file mode 120000 index 0000000000..3a883defe9 --- /dev/null +++ b/Lang/Nial/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Nial \ No newline at end of file diff --git a/Lang/Nial/Matrix-multiplication b/Lang/Nial/Matrix-multiplication new file mode 120000 index 0000000000..08592ec610 --- /dev/null +++ b/Lang/Nial/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/Nial \ No newline at end of file diff --git a/Lang/Nial/Matrix-transposition b/Lang/Nial/Matrix-transposition new file mode 120000 index 0000000000..1ed96d80ad --- /dev/null +++ b/Lang/Nial/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Nial \ No newline at end of file diff --git a/Lang/Nice/0DESCRIPTION b/Lang/Nice/0DESCRIPTION new file mode 100644 index 0000000000..1136329b48 --- /dev/null +++ b/Lang/Nice/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language|Nice +|site=http://nice.sourceforge.net/ +}}[[runs on vm::java virtual machine| ]] + +Nice is a new programming language. It extends the ideas behind object-orientation in order to better support modular programming and static type safety. It also incorporates features from functional programming, and puts into practice state-of-the-art results from academic research. This results in more expressivity, modularity and safety.[[#Citation|[1]]] + +Source programs are compiled to [[Java]] bytecode, and can therefore interact with libraries written in Java and other programming languages targeting the Java Virtual Machine.[[#Citation|[2]]] + +Nice supports [[wp:Multiple_dispatch|Multiple dispatch]]. + +==Citations== +#[http://nice.sourceforge.net/ The Nice Home Page] +#[[wp:Nice_(programming_language)|Wikipedia: Nice]] \ No newline at end of file diff --git a/Lang/Nickle/0DESCRIPTION b/Lang/Nickle/0DESCRIPTION new file mode 100644 index 0000000000..caf8a2316f --- /dev/null +++ b/Lang/Nickle/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language +|site=http://nickle.org/ +}} \ No newline at end of file diff --git a/Lang/Nickle/FizzBuzz b/Lang/Nickle/FizzBuzz new file mode 120000 index 0000000000..14b0656e42 --- /dev/null +++ b/Lang/Nickle/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Nickle \ No newline at end of file diff --git a/Lang/Nimrod/0DESCRIPTION b/Lang/Nimrod/0DESCRIPTION new file mode 100644 index 0000000000..4517462187 --- /dev/null +++ b/Lang/Nimrod/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language +|exec=machine +|gc=yes +|parampass=both +|express=both +|strength=strong +|LCT=yes +|checking=static +|site=http://nimrod-code.org}} +{{language programming paradigm|imperative}} +Nimrod is a general purpose, high-level, system programming, statically typed imperative compiled programming language that is developed by Andreas Rumpf. There is a lot of focus on portability and efficiency. The language compiles to C and supports many C compilers. Nimrod is actively being developed although it could use more developers, there is currently only one core developer. The language has excellent [http://nimrod-code.org/lib.html documentation], and a very good [http://nimrod-code.org/tut1.html tutorial]. + +You can ask for help on Freenode in the #nimrod channel. \ No newline at end of file diff --git a/Lang/Nimrod/99-Bottles-of-Beer b/Lang/Nimrod/99-Bottles-of-Beer new file mode 120000 index 0000000000..532af5ed6a --- /dev/null +++ b/Lang/Nimrod/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/A+B b/Lang/Nimrod/A+B new file mode 120000 index 0000000000..1dd0c233cb --- /dev/null +++ b/Lang/Nimrod/A+B @@ -0,0 +1 @@ +../../Task/A+B/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Ackermann-function b/Lang/Nimrod/Ackermann-function new file mode 120000 index 0000000000..966d9b221d --- /dev/null +++ b/Lang/Nimrod/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Apply-a-callback-to-an-array b/Lang/Nimrod/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..9f5ea5074a --- /dev/null +++ b/Lang/Nimrod/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Assertions b/Lang/Nimrod/Assertions new file mode 120000 index 0000000000..6e0978fc00 --- /dev/null +++ b/Lang/Nimrod/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Call-a-foreign-language-function b/Lang/Nimrod/Call-a-foreign-language-function new file mode 120000 index 0000000000..d11c415cc4 --- /dev/null +++ b/Lang/Nimrod/Call-a-foreign-language-function @@ -0,0 +1 @@ +../../Task/Call-a-foreign-language-function/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Case-sensitivity-of-identifiers b/Lang/Nimrod/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..c06f362dc0 --- /dev/null +++ b/Lang/Nimrod/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Compile-time-calculation b/Lang/Nimrod/Compile-time-calculation new file mode 120000 index 0000000000..3d86637c69 --- /dev/null +++ b/Lang/Nimrod/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Date-format b/Lang/Nimrod/Date-format new file mode 120000 index 0000000000..5b4bb217b9 --- /dev/null +++ b/Lang/Nimrod/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Delete-a-file b/Lang/Nimrod/Delete-a-file new file mode 120000 index 0000000000..c8e62b09b2 --- /dev/null +++ b/Lang/Nimrod/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Execute-HQ9+ b/Lang/Nimrod/Execute-HQ9+ new file mode 120000 index 0000000000..cf2e6e898a --- /dev/null +++ b/Lang/Nimrod/Execute-HQ9+ @@ -0,0 +1 @@ +../../Task/Execute-HQ9+/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Fibonacci-sequence b/Lang/Nimrod/Fibonacci-sequence new file mode 120000 index 0000000000..4d0121d690 --- /dev/null +++ b/Lang/Nimrod/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/FizzBuzz b/Lang/Nimrod/FizzBuzz new file mode 120000 index 0000000000..bf51671747 --- /dev/null +++ b/Lang/Nimrod/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Function-definition b/Lang/Nimrod/Function-definition new file mode 120000 index 0000000000..511b8eb7b3 --- /dev/null +++ b/Lang/Nimrod/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Guess-the-number b/Lang/Nimrod/Guess-the-number new file mode 120000 index 0000000000..00b179b288 --- /dev/null +++ b/Lang/Nimrod/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Hello-world-Text b/Lang/Nimrod/Hello-world-Text new file mode 120000 index 0000000000..7a1c38b68e --- /dev/null +++ b/Lang/Nimrod/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Integer-sequence b/Lang/Nimrod/Integer-sequence new file mode 120000 index 0000000000..017167a65b --- /dev/null +++ b/Lang/Nimrod/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Loops-For b/Lang/Nimrod/Loops-For new file mode 120000 index 0000000000..fdf0bc3379 --- /dev/null +++ b/Lang/Nimrod/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Loops-Foreach b/Lang/Nimrod/Loops-Foreach new file mode 120000 index 0000000000..741d3f218b --- /dev/null +++ b/Lang/Nimrod/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Nimrod \ No newline at end of file diff --git a/Lang/Nimrod/Loops-While b/Lang/Nimrod/Loops-While new file mode 120000 index 0000000000..6329b3ab8c --- /dev/null +++ b/Lang/Nimrod/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Nimrod \ No newline at end of file diff --git a/Lang/Niue/0DESCRIPTION b/Lang/Niue/0DESCRIPTION new file mode 100644 index 0000000000..e785455250 --- /dev/null +++ b/Lang/Niue/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}[http://vmathew.in/niue Niue] is an expressive, lightweight, embeddable scripting language for Java applications. It has a simple and consistent syntax based on the Reverse Polish notation. Niue is an extensible language with powerful meta-programming facilities. \ No newline at end of file diff --git a/Lang/Niue/Averages-Arithmetic-mean b/Lang/Niue/Averages-Arithmetic-mean new file mode 120000 index 0000000000..a4aa464e2a --- /dev/null +++ b/Lang/Niue/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Niue \ No newline at end of file diff --git a/Lang/Niue/Binary-search b/Lang/Niue/Binary-search new file mode 120000 index 0000000000..540307b067 --- /dev/null +++ b/Lang/Niue/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Niue \ No newline at end of file diff --git a/Lang/Niue/Factorial b/Lang/Niue/Factorial new file mode 120000 index 0000000000..96551b1165 --- /dev/null +++ b/Lang/Niue/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Niue \ No newline at end of file diff --git a/Lang/Niue/Factors-of-an-integer b/Lang/Niue/Factors-of-an-integer new file mode 120000 index 0000000000..86ed9f3133 --- /dev/null +++ b/Lang/Niue/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Niue \ No newline at end of file diff --git a/Lang/OCaml/0DESCRIPTION b/Lang/OCaml/0DESCRIPTION new file mode 100644 index 0000000000..e7787ed634 --- /dev/null +++ b/Lang/OCaml/0DESCRIPTION @@ -0,0 +1,20 @@ +{{language|OCaml +|strength=strong +|safety=safe +|compat=structural +|checking=static +|parampass=value +|gc=yes +|LCT=yes}}{{language programming paradigm|Object-oriented}}{{implementation|Caml}} +{{language programming paradigm|functional}} +{{Codepad}} +'''OCaml''' (formerly known as Objective Caml) is the main implementation of the [[Caml]] [[programming language]], created by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy and others in 1996. OCaml is an [[open source]] project managed and principally maintained by INRIA. + +OCaml extends the core [[derived from::Caml]] language with [[object-oriented programming|object-oriented]] constructs. + +OCaml's toolset includes an interactive toplevel [[interpreter]], a [[bytecode]] [[compiler]], and an optimizing native code compiler. It has a large standard library that makes it useful for many of the same applications as [[Python]] or [[Perl]], as well as robust modular and object-oriented programming constructs that make it applicable for large-scale software engineering. + +OCaml is the successor to [[Caml Light]]. The acronym CAML originally stood for Categorical Abstract Machine Language, although OCaml abandons this abstract machine. + +==Citations== +* [[wp:Ocaml|Wikipedia:OCaml]] \ No newline at end of file diff --git a/Lang/OCaml/100-doors b/Lang/OCaml/100-doors new file mode 120000 index 0000000000..d766e5a2d1 --- /dev/null +++ b/Lang/OCaml/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/OCaml \ No newline at end of file diff --git a/Lang/OCaml/24-game b/Lang/OCaml/24-game new file mode 120000 index 0000000000..04d998ef48 --- /dev/null +++ b/Lang/OCaml/24-game @@ -0,0 +1 @@ +../../Task/24-game/OCaml \ No newline at end of file diff --git a/Lang/OCaml/24-game-Solve b/Lang/OCaml/24-game-Solve new file mode 120000 index 0000000000..1a6f680f39 --- /dev/null +++ b/Lang/OCaml/24-game-Solve @@ -0,0 +1 @@ +../../Task/24-game-Solve/OCaml \ No newline at end of file diff --git a/Lang/OCaml/99-Bottles-of-Beer b/Lang/OCaml/99-Bottles-of-Beer new file mode 120000 index 0000000000..2ba0145cdb --- /dev/null +++ b/Lang/OCaml/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/OCaml \ No newline at end of file diff --git a/Lang/OCaml/A+B b/Lang/OCaml/A+B new file mode 120000 index 0000000000..f16ebc8f87 --- /dev/null +++ b/Lang/OCaml/A+B @@ -0,0 +1 @@ +../../Task/A+B/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Abstract-type b/Lang/OCaml/Abstract-type new file mode 120000 index 0000000000..8fa165befb --- /dev/null +++ b/Lang/OCaml/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Accumulator-factory b/Lang/OCaml/Accumulator-factory new file mode 120000 index 0000000000..e162c89471 --- /dev/null +++ b/Lang/OCaml/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Ackermann-function b/Lang/OCaml/Ackermann-function new file mode 120000 index 0000000000..74f73b5af2 --- /dev/null +++ b/Lang/OCaml/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Align-columns b/Lang/OCaml/Align-columns new file mode 120000 index 0000000000..364d42bc9d --- /dev/null +++ b/Lang/OCaml/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Anagrams b/Lang/OCaml/Anagrams new file mode 120000 index 0000000000..2a28271062 --- /dev/null +++ b/Lang/OCaml/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Anagrams-Deranged-anagrams b/Lang/OCaml/Anagrams-Deranged-anagrams new file mode 120000 index 0000000000..ef75a605d1 --- /dev/null +++ b/Lang/OCaml/Anagrams-Deranged-anagrams @@ -0,0 +1 @@ +../../Task/Anagrams-Deranged-anagrams/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Anonymous-recursion b/Lang/OCaml/Anonymous-recursion new file mode 120000 index 0000000000..9119de40ac --- /dev/null +++ b/Lang/OCaml/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Apply-a-callback-to-an-array b/Lang/OCaml/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..81bee2e1b1 --- /dev/null +++ b/Lang/OCaml/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Arbitrary-precision-integers-included b/Lang/OCaml/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..4c6abea4f8 --- /dev/null +++ b/Lang/OCaml/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Arithmetic-Complex b/Lang/OCaml/Arithmetic-Complex new file mode 120000 index 0000000000..02920a27a8 --- /dev/null +++ b/Lang/OCaml/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Arithmetic-Integer b/Lang/OCaml/Arithmetic-Integer new file mode 120000 index 0000000000..ae68828531 --- /dev/null +++ b/Lang/OCaml/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Arithmetic-Rational b/Lang/OCaml/Arithmetic-Rational new file mode 120000 index 0000000000..e53217f4cd --- /dev/null +++ b/Lang/OCaml/Arithmetic-Rational @@ -0,0 +1 @@ +../../Task/Arithmetic-Rational/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Arithmetic-evaluation b/Lang/OCaml/Arithmetic-evaluation new file mode 120000 index 0000000000..741933b8e8 --- /dev/null +++ b/Lang/OCaml/Arithmetic-evaluation @@ -0,0 +1 @@ +../../Task/Arithmetic-evaluation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Arithmetic-geometric-mean b/Lang/OCaml/Arithmetic-geometric-mean new file mode 120000 index 0000000000..658270d4fb --- /dev/null +++ b/Lang/OCaml/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Array-concatenation b/Lang/OCaml/Array-concatenation new file mode 120000 index 0000000000..f2dbd6aaf1 --- /dev/null +++ b/Lang/OCaml/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Arrays b/Lang/OCaml/Arrays new file mode 120000 index 0000000000..04c371efab --- /dev/null +++ b/Lang/OCaml/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Assertions b/Lang/OCaml/Assertions new file mode 120000 index 0000000000..a6d59cefdb --- /dev/null +++ b/Lang/OCaml/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Associative-array-Creation b/Lang/OCaml/Associative-array-Creation new file mode 120000 index 0000000000..4e0a356b50 --- /dev/null +++ b/Lang/OCaml/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Associative-array-Iteration b/Lang/OCaml/Associative-array-Iteration new file mode 120000 index 0000000000..d39d0d663f --- /dev/null +++ b/Lang/OCaml/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Arithmetic-mean b/Lang/OCaml/Averages-Arithmetic-mean new file mode 120000 index 0000000000..5d680f95a4 --- /dev/null +++ b/Lang/OCaml/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Mean-angle b/Lang/OCaml/Averages-Mean-angle new file mode 120000 index 0000000000..603b541f80 --- /dev/null +++ b/Lang/OCaml/Averages-Mean-angle @@ -0,0 +1 @@ +../../Task/Averages-Mean-angle/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Mean-time-of-day b/Lang/OCaml/Averages-Mean-time-of-day new file mode 120000 index 0000000000..e5ef68023f --- /dev/null +++ b/Lang/OCaml/Averages-Mean-time-of-day @@ -0,0 +1 @@ +../../Task/Averages-Mean-time-of-day/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Median b/Lang/OCaml/Averages-Median new file mode 120000 index 0000000000..96ede1c1f4 --- /dev/null +++ b/Lang/OCaml/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Mode b/Lang/OCaml/Averages-Mode new file mode 120000 index 0000000000..8f8101d398 --- /dev/null +++ b/Lang/OCaml/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Pythagorean-means b/Lang/OCaml/Averages-Pythagorean-means new file mode 120000 index 0000000000..bf9b262ce0 --- /dev/null +++ b/Lang/OCaml/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Root-mean-square b/Lang/OCaml/Averages-Root-mean-square new file mode 120000 index 0000000000..aa4c2991fa --- /dev/null +++ b/Lang/OCaml/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Averages-Simple-moving-average b/Lang/OCaml/Averages-Simple-moving-average new file mode 120000 index 0000000000..553d34e5a5 --- /dev/null +++ b/Lang/OCaml/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Balanced-brackets b/Lang/OCaml/Balanced-brackets new file mode 120000 index 0000000000..2a53a0c91e --- /dev/null +++ b/Lang/OCaml/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Balanced-ternary b/Lang/OCaml/Balanced-ternary new file mode 120000 index 0000000000..e1786b6c8f --- /dev/null +++ b/Lang/OCaml/Balanced-ternary @@ -0,0 +1 @@ +../../Task/Balanced-ternary/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Best-shuffle b/Lang/OCaml/Best-shuffle new file mode 120000 index 0000000000..b97e425dc4 --- /dev/null +++ b/Lang/OCaml/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Binary-search b/Lang/OCaml/Binary-search new file mode 120000 index 0000000000..438d1dcdd3 --- /dev/null +++ b/Lang/OCaml/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Binary-strings b/Lang/OCaml/Binary-strings new file mode 120000 index 0000000000..023c68c9c5 --- /dev/null +++ b/Lang/OCaml/Binary-strings @@ -0,0 +1 @@ +../../Task/Binary-strings/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitmap b/Lang/OCaml/Bitmap new file mode 120000 index 0000000000..b87e9e75e2 --- /dev/null +++ b/Lang/OCaml/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitmap-B-zier-curves-Cubic b/Lang/OCaml/Bitmap-B-zier-curves-Cubic new file mode 120000 index 0000000000..a012296a95 --- /dev/null +++ b/Lang/OCaml/Bitmap-B-zier-curves-Cubic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Cubic/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitmap-B-zier-curves-Quadratic b/Lang/OCaml/Bitmap-B-zier-curves-Quadratic new file mode 120000 index 0000000000..de41b3fdd4 --- /dev/null +++ b/Lang/OCaml/Bitmap-B-zier-curves-Quadratic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Quadratic/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitmap-Bresenhams-line-algorithm b/Lang/OCaml/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..3410e24676 --- /dev/null +++ b/Lang/OCaml/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitmap-Histogram b/Lang/OCaml/Bitmap-Histogram new file mode 120000 index 0000000000..036efbeaaf --- /dev/null +++ b/Lang/OCaml/Bitmap-Histogram @@ -0,0 +1 @@ +../../Task/Bitmap-Histogram/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitmap-Read-a-PPM-file b/Lang/OCaml/Bitmap-Read-a-PPM-file new file mode 120000 index 0000000000..5b09614b10 --- /dev/null +++ b/Lang/OCaml/Bitmap-Read-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Read-a-PPM-file/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitmap-Read-an-image-through-a-pipe b/Lang/OCaml/Bitmap-Read-an-image-through-a-pipe new file mode 120000 index 0000000000..ec675a0357 --- /dev/null +++ b/Lang/OCaml/Bitmap-Read-an-image-through-a-pipe @@ -0,0 +1 @@ +../../Task/Bitmap-Read-an-image-through-a-pipe/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitwise-IO b/Lang/OCaml/Bitwise-IO new file mode 120000 index 0000000000..4a41dd7c86 --- /dev/null +++ b/Lang/OCaml/Bitwise-IO @@ -0,0 +1 @@ +../../Task/Bitwise-IO/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bitwise-operations b/Lang/OCaml/Bitwise-operations new file mode 120000 index 0000000000..b2daa77568 --- /dev/null +++ b/Lang/OCaml/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Boolean-values b/Lang/OCaml/Boolean-values new file mode 120000 index 0000000000..43a84ea9ab --- /dev/null +++ b/Lang/OCaml/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Bulls-and-cows b/Lang/OCaml/Bulls-and-cows new file mode 120000 index 0000000000..42f837b796 --- /dev/null +++ b/Lang/OCaml/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/OCaml \ No newline at end of file diff --git a/Lang/OCaml/CRC-32 b/Lang/OCaml/CRC-32 new file mode 120000 index 0000000000..af3965155d --- /dev/null +++ b/Lang/OCaml/CRC-32 @@ -0,0 +1 @@ +../../Task/CRC-32/OCaml \ No newline at end of file diff --git a/Lang/OCaml/CSV-to-HTML-translation b/Lang/OCaml/CSV-to-HTML-translation new file mode 120000 index 0000000000..eba67345f9 --- /dev/null +++ b/Lang/OCaml/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Caesar-cipher b/Lang/OCaml/Caesar-cipher new file mode 120000 index 0000000000..6986f554b0 --- /dev/null +++ b/Lang/OCaml/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Call-a-foreign-language-function b/Lang/OCaml/Call-a-foreign-language-function new file mode 120000 index 0000000000..2b7e1603e8 --- /dev/null +++ b/Lang/OCaml/Call-a-foreign-language-function @@ -0,0 +1 @@ +../../Task/Call-a-foreign-language-function/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Call-a-function b/Lang/OCaml/Call-a-function new file mode 120000 index 0000000000..973c7a425c --- /dev/null +++ b/Lang/OCaml/Call-a-function @@ -0,0 +1 @@ +../../Task/Call-a-function/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Call-a-function-in-a-shared-library b/Lang/OCaml/Call-a-function-in-a-shared-library new file mode 120000 index 0000000000..82afbc1e86 --- /dev/null +++ b/Lang/OCaml/Call-a-function-in-a-shared-library @@ -0,0 +1 @@ +../../Task/Call-a-function-in-a-shared-library/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Call-an-object-method b/Lang/OCaml/Call-an-object-method new file mode 120000 index 0000000000..5fca4a7b6f --- /dev/null +++ b/Lang/OCaml/Call-an-object-method @@ -0,0 +1 @@ +../../Task/Call-an-object-method/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Case-sensitivity-of-identifiers b/Lang/OCaml/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..5afb997124 --- /dev/null +++ b/Lang/OCaml/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Catmull-Clark-subdivision-surface b/Lang/OCaml/Catmull-Clark-subdivision-surface new file mode 120000 index 0000000000..6886e5dfd9 --- /dev/null +++ b/Lang/OCaml/Catmull-Clark-subdivision-surface @@ -0,0 +1 @@ +../../Task/Catmull-Clark-subdivision-surface/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Character-codes b/Lang/OCaml/Character-codes new file mode 120000 index 0000000000..fecac356ae --- /dev/null +++ b/Lang/OCaml/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Character-matching b/Lang/OCaml/Character-matching new file mode 120000 index 0000000000..1b9d904b68 --- /dev/null +++ b/Lang/OCaml/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Check-Machin-like-formulas b/Lang/OCaml/Check-Machin-like-formulas new file mode 120000 index 0000000000..2a5f512908 --- /dev/null +++ b/Lang/OCaml/Check-Machin-like-formulas @@ -0,0 +1 @@ +../../Task/Check-Machin-like-formulas/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Check-that-file-exists b/Lang/OCaml/Check-that-file-exists new file mode 120000 index 0000000000..468da8aeba --- /dev/null +++ b/Lang/OCaml/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Cholesky-decomposition b/Lang/OCaml/Cholesky-decomposition new file mode 120000 index 0000000000..f037ff3fd5 --- /dev/null +++ b/Lang/OCaml/Cholesky-decomposition @@ -0,0 +1 @@ +../../Task/Cholesky-decomposition/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Classes b/Lang/OCaml/Classes new file mode 120000 index 0000000000..c716219a11 --- /dev/null +++ b/Lang/OCaml/Classes @@ -0,0 +1 @@ +../../Task/Classes/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Closest-pair-problem b/Lang/OCaml/Closest-pair-problem new file mode 120000 index 0000000000..20027e671a --- /dev/null +++ b/Lang/OCaml/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Collections b/Lang/OCaml/Collections new file mode 120000 index 0000000000..ecc9271270 --- /dev/null +++ b/Lang/OCaml/Collections @@ -0,0 +1 @@ +../../Task/Collections/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Color-quantization b/Lang/OCaml/Color-quantization new file mode 120000 index 0000000000..9ad3f00cea --- /dev/null +++ b/Lang/OCaml/Color-quantization @@ -0,0 +1 @@ +../../Task/Color-quantization/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Colour-bars-Display b/Lang/OCaml/Colour-bars-Display new file mode 120000 index 0000000000..961222b30f --- /dev/null +++ b/Lang/OCaml/Colour-bars-Display @@ -0,0 +1 @@ +../../Task/Colour-bars-Display/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Colour-pinstripe-Display b/Lang/OCaml/Colour-pinstripe-Display new file mode 120000 index 0000000000..fcd8acb523 --- /dev/null +++ b/Lang/OCaml/Colour-pinstripe-Display @@ -0,0 +1 @@ +../../Task/Colour-pinstripe-Display/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Combinations b/Lang/OCaml/Combinations new file mode 120000 index 0000000000..0b04d76e7c --- /dev/null +++ b/Lang/OCaml/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Combinations-with-repetitions b/Lang/OCaml/Combinations-with-repetitions new file mode 120000 index 0000000000..ad2652a1e5 --- /dev/null +++ b/Lang/OCaml/Combinations-with-repetitions @@ -0,0 +1 @@ +../../Task/Combinations-with-repetitions/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Command-line-arguments b/Lang/OCaml/Command-line-arguments new file mode 120000 index 0000000000..09d40cdd19 --- /dev/null +++ b/Lang/OCaml/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Comments b/Lang/OCaml/Comments new file mode 120000 index 0000000000..1b8334eb29 --- /dev/null +++ b/Lang/OCaml/Comments @@ -0,0 +1 @@ +../../Task/Comments/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Compile-time-calculation b/Lang/OCaml/Compile-time-calculation new file mode 120000 index 0000000000..e7663e1edf --- /dev/null +++ b/Lang/OCaml/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Compound-data-type b/Lang/OCaml/Compound-data-type new file mode 120000 index 0000000000..d57c71ac1e --- /dev/null +++ b/Lang/OCaml/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Concurrent-computing b/Lang/OCaml/Concurrent-computing new file mode 120000 index 0000000000..3abc911ed9 --- /dev/null +++ b/Lang/OCaml/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Conditional-structures b/Lang/OCaml/Conditional-structures new file mode 120000 index 0000000000..42d95002cd --- /dev/null +++ b/Lang/OCaml/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Constrained-genericity b/Lang/OCaml/Constrained-genericity new file mode 120000 index 0000000000..6cb0a97de4 --- /dev/null +++ b/Lang/OCaml/Constrained-genericity @@ -0,0 +1 @@ +../../Task/Constrained-genericity/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Constrained-random-points-on-a-circle b/Lang/OCaml/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..cbe0d1c7d8 --- /dev/null +++ b/Lang/OCaml/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Continued-fraction b/Lang/OCaml/Continued-fraction new file mode 120000 index 0000000000..f778835563 --- /dev/null +++ b/Lang/OCaml/Continued-fraction @@ -0,0 +1 @@ +../../Task/Continued-fraction/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Conways-Game-of-Life b/Lang/OCaml/Conways-Game-of-Life new file mode 120000 index 0000000000..7d6bfccde6 --- /dev/null +++ b/Lang/OCaml/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Count-in-factors b/Lang/OCaml/Count-in-factors new file mode 120000 index 0000000000..b5c52d9327 --- /dev/null +++ b/Lang/OCaml/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Count-in-octal b/Lang/OCaml/Count-in-octal new file mode 120000 index 0000000000..d6c09131cb --- /dev/null +++ b/Lang/OCaml/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Count-occurrences-of-a-substring b/Lang/OCaml/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..8721e40b38 --- /dev/null +++ b/Lang/OCaml/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Count-the-coins b/Lang/OCaml/Count-the-coins new file mode 120000 index 0000000000..c4a0e2de31 --- /dev/null +++ b/Lang/OCaml/Count-the-coins @@ -0,0 +1 @@ +../../Task/Count-the-coins/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Create-a-file b/Lang/OCaml/Create-a-file new file mode 120000 index 0000000000..885e212163 --- /dev/null +++ b/Lang/OCaml/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Create-a-two-dimensional-array-at-runtime b/Lang/OCaml/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..77fb75d7cb --- /dev/null +++ b/Lang/OCaml/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Create-an-HTML-table b/Lang/OCaml/Create-an-HTML-table new file mode 120000 index 0000000000..91dffac412 --- /dev/null +++ b/Lang/OCaml/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/OCaml \ No newline at end of file diff --git a/Lang/OCaml/DNS-query b/Lang/OCaml/DNS-query new file mode 120000 index 0000000000..904c303c5f --- /dev/null +++ b/Lang/OCaml/DNS-query @@ -0,0 +1 @@ +../../Task/DNS-query/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Date-format b/Lang/OCaml/Date-format new file mode 120000 index 0000000000..667e4e2dd5 --- /dev/null +++ b/Lang/OCaml/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Day-of-the-week b/Lang/OCaml/Day-of-the-week new file mode 120000 index 0000000000..da5cebe76e --- /dev/null +++ b/Lang/OCaml/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Deal-cards-for-FreeCell b/Lang/OCaml/Deal-cards-for-FreeCell new file mode 120000 index 0000000000..0b5de4c0e2 --- /dev/null +++ b/Lang/OCaml/Deal-cards-for-FreeCell @@ -0,0 +1 @@ +../../Task/Deal-cards-for-FreeCell/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Deepcopy b/Lang/OCaml/Deepcopy new file mode 120000 index 0000000000..2b44b390b5 --- /dev/null +++ b/Lang/OCaml/Deepcopy @@ -0,0 +1 @@ +../../Task/Deepcopy/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Define-a-primitive-data-type b/Lang/OCaml/Define-a-primitive-data-type new file mode 120000 index 0000000000..4ed25c41c2 --- /dev/null +++ b/Lang/OCaml/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Delete-a-file b/Lang/OCaml/Delete-a-file new file mode 120000 index 0000000000..e2acf5a873 --- /dev/null +++ b/Lang/OCaml/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Detect-division-by-zero b/Lang/OCaml/Detect-division-by-zero new file mode 120000 index 0000000000..f1009c4d3e --- /dev/null +++ b/Lang/OCaml/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Determine-if-a-string-is-numeric b/Lang/OCaml/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..67b38ac25b --- /dev/null +++ b/Lang/OCaml/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Determine-if-only-one-instance-is-running b/Lang/OCaml/Determine-if-only-one-instance-is-running new file mode 120000 index 0000000000..c30deb4c43 --- /dev/null +++ b/Lang/OCaml/Determine-if-only-one-instance-is-running @@ -0,0 +1 @@ +../../Task/Determine-if-only-one-instance-is-running/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Distributed-programming b/Lang/OCaml/Distributed-programming new file mode 120000 index 0000000000..4bdaa15258 --- /dev/null +++ b/Lang/OCaml/Distributed-programming @@ -0,0 +1 @@ +../../Task/Distributed-programming/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Dot-product b/Lang/OCaml/Dot-product new file mode 120000 index 0000000000..ea9d680687 --- /dev/null +++ b/Lang/OCaml/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Doubly-linked-list-Element-definition b/Lang/OCaml/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..0a6447c73d --- /dev/null +++ b/Lang/OCaml/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Doubly-linked-list-Element-insertion b/Lang/OCaml/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..03e6eb67bb --- /dev/null +++ b/Lang/OCaml/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Empty-directory b/Lang/OCaml/Empty-directory new file mode 120000 index 0000000000..124d2c1a8a --- /dev/null +++ b/Lang/OCaml/Empty-directory @@ -0,0 +1 @@ +../../Task/Empty-directory/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Empty-program b/Lang/OCaml/Empty-program new file mode 120000 index 0000000000..41d7aa7f09 --- /dev/null +++ b/Lang/OCaml/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Empty-string b/Lang/OCaml/Empty-string new file mode 120000 index 0000000000..f5921e7611 --- /dev/null +++ b/Lang/OCaml/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Enforced-immutability b/Lang/OCaml/Enforced-immutability new file mode 120000 index 0000000000..0cb10400a4 --- /dev/null +++ b/Lang/OCaml/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Enumerations b/Lang/OCaml/Enumerations new file mode 120000 index 0000000000..a805f4e566 --- /dev/null +++ b/Lang/OCaml/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Equilibrium-index b/Lang/OCaml/Equilibrium-index new file mode 120000 index 0000000000..25528f6e5d --- /dev/null +++ b/Lang/OCaml/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Ethiopian-multiplication b/Lang/OCaml/Ethiopian-multiplication new file mode 120000 index 0000000000..739cacb60d --- /dev/null +++ b/Lang/OCaml/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Evaluate-binomial-coefficients b/Lang/OCaml/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..69bfcdbcf0 --- /dev/null +++ b/Lang/OCaml/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Even-or-odd b/Lang/OCaml/Even-or-odd new file mode 120000 index 0000000000..3adabf7062 --- /dev/null +++ b/Lang/OCaml/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Evolutionary-algorithm b/Lang/OCaml/Evolutionary-algorithm new file mode 120000 index 0000000000..f96674f941 --- /dev/null +++ b/Lang/OCaml/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Exceptions b/Lang/OCaml/Exceptions new file mode 120000 index 0000000000..7cb950cf89 --- /dev/null +++ b/Lang/OCaml/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/OCaml/Exceptions-Catch-an-exception-thrown-in-a-nested-call new file mode 120000 index 0000000000..9d49f891ef --- /dev/null +++ b/Lang/OCaml/Exceptions-Catch-an-exception-thrown-in-a-nested-call @@ -0,0 +1 @@ +../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Execute-a-system-command b/Lang/OCaml/Execute-a-system-command new file mode 120000 index 0000000000..cac0c3aac4 --- /dev/null +++ b/Lang/OCaml/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Exponentiation-operator b/Lang/OCaml/Exponentiation-operator new file mode 120000 index 0000000000..abb839516e --- /dev/null +++ b/Lang/OCaml/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Extreme-floating-point-values b/Lang/OCaml/Extreme-floating-point-values new file mode 120000 index 0000000000..5a9a8a943e --- /dev/null +++ b/Lang/OCaml/Extreme-floating-point-values @@ -0,0 +1 @@ +../../Task/Extreme-floating-point-values/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Factorial b/Lang/OCaml/Factorial new file mode 120000 index 0000000000..70aa84cdf9 --- /dev/null +++ b/Lang/OCaml/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Factors-of-an-integer b/Lang/OCaml/Factors-of-an-integer new file mode 120000 index 0000000000..383a1106ad --- /dev/null +++ b/Lang/OCaml/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Fast-Fourier-transform b/Lang/OCaml/Fast-Fourier-transform new file mode 120000 index 0000000000..18bbb651a2 --- /dev/null +++ b/Lang/OCaml/Fast-Fourier-transform @@ -0,0 +1 @@ +../../Task/Fast-Fourier-transform/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Fibonacci-sequence b/Lang/OCaml/Fibonacci-sequence new file mode 120000 index 0000000000..778ffdf928 --- /dev/null +++ b/Lang/OCaml/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/OCaml \ No newline at end of file diff --git a/Lang/OCaml/File-IO b/Lang/OCaml/File-IO new file mode 120000 index 0000000000..8557844849 --- /dev/null +++ b/Lang/OCaml/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/OCaml \ No newline at end of file diff --git a/Lang/OCaml/File-modification-time b/Lang/OCaml/File-modification-time new file mode 120000 index 0000000000..2aead5e435 --- /dev/null +++ b/Lang/OCaml/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/OCaml \ No newline at end of file diff --git a/Lang/OCaml/File-size b/Lang/OCaml/File-size new file mode 120000 index 0000000000..9b092c92de --- /dev/null +++ b/Lang/OCaml/File-size @@ -0,0 +1 @@ +../../Task/File-size/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Filter b/Lang/OCaml/Filter new file mode 120000 index 0000000000..73df3512a7 --- /dev/null +++ b/Lang/OCaml/Filter @@ -0,0 +1 @@ +../../Task/Filter/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Find-common-directory-path b/Lang/OCaml/Find-common-directory-path new file mode 120000 index 0000000000..88483462d8 --- /dev/null +++ b/Lang/OCaml/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Find-limit-of-recursion b/Lang/OCaml/Find-limit-of-recursion new file mode 120000 index 0000000000..5797f2b798 --- /dev/null +++ b/Lang/OCaml/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Find-the-missing-permutation b/Lang/OCaml/Find-the-missing-permutation new file mode 120000 index 0000000000..e1e1d4ea53 --- /dev/null +++ b/Lang/OCaml/Find-the-missing-permutation @@ -0,0 +1 @@ +../../Task/Find-the-missing-permutation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/First-class-functions b/Lang/OCaml/First-class-functions new file mode 120000 index 0000000000..b99e8654cb --- /dev/null +++ b/Lang/OCaml/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/OCaml \ No newline at end of file diff --git a/Lang/OCaml/First-class-functions-Use-numbers-analogously b/Lang/OCaml/First-class-functions-Use-numbers-analogously new file mode 120000 index 0000000000..d84d6610c3 --- /dev/null +++ b/Lang/OCaml/First-class-functions-Use-numbers-analogously @@ -0,0 +1 @@ +../../Task/First-class-functions-Use-numbers-analogously/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Five-weekends b/Lang/OCaml/Five-weekends new file mode 120000 index 0000000000..d58bbdfa71 --- /dev/null +++ b/Lang/OCaml/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/OCaml \ No newline at end of file diff --git a/Lang/OCaml/FizzBuzz b/Lang/OCaml/FizzBuzz new file mode 120000 index 0000000000..e1f07266a2 --- /dev/null +++ b/Lang/OCaml/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Flatten-a-list b/Lang/OCaml/Flatten-a-list new file mode 120000 index 0000000000..8ccf068233 --- /dev/null +++ b/Lang/OCaml/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Flow-control-structures b/Lang/OCaml/Flow-control-structures new file mode 120000 index 0000000000..14fd83a915 --- /dev/null +++ b/Lang/OCaml/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Floyds-triangle b/Lang/OCaml/Floyds-triangle new file mode 120000 index 0000000000..ec509c2ab5 --- /dev/null +++ b/Lang/OCaml/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Forest-fire b/Lang/OCaml/Forest-fire new file mode 120000 index 0000000000..6331f9790e --- /dev/null +++ b/Lang/OCaml/Forest-fire @@ -0,0 +1 @@ +../../Task/Forest-fire/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Fork b/Lang/OCaml/Fork new file mode 120000 index 0000000000..55c199085b --- /dev/null +++ b/Lang/OCaml/Fork @@ -0,0 +1 @@ +../../Task/Fork/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Formatted-numeric-output b/Lang/OCaml/Formatted-numeric-output new file mode 120000 index 0000000000..f91f47125c --- /dev/null +++ b/Lang/OCaml/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Forward-difference b/Lang/OCaml/Forward-difference new file mode 120000 index 0000000000..4c28795be8 --- /dev/null +++ b/Lang/OCaml/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Four-bit-adder b/Lang/OCaml/Four-bit-adder new file mode 120000 index 0000000000..59d364fc5d --- /dev/null +++ b/Lang/OCaml/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Fractal-tree b/Lang/OCaml/Fractal-tree new file mode 120000 index 0000000000..64c4189951 --- /dev/null +++ b/Lang/OCaml/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Function-composition b/Lang/OCaml/Function-composition new file mode 120000 index 0000000000..99a3257f37 --- /dev/null +++ b/Lang/OCaml/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Function-definition b/Lang/OCaml/Function-definition new file mode 120000 index 0000000000..fa587a84a9 --- /dev/null +++ b/Lang/OCaml/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Gamma-function b/Lang/OCaml/Gamma-function new file mode 120000 index 0000000000..c92f7f3a05 --- /dev/null +++ b/Lang/OCaml/Gamma-function @@ -0,0 +1 @@ +../../Task/Gamma-function/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Generic-swap b/Lang/OCaml/Generic-swap new file mode 120000 index 0000000000..2e0f59472f --- /dev/null +++ b/Lang/OCaml/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Gray-code b/Lang/OCaml/Gray-code new file mode 120000 index 0000000000..25ae3d5231 --- /dev/null +++ b/Lang/OCaml/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Grayscale-image b/Lang/OCaml/Grayscale-image new file mode 120000 index 0000000000..886217333f --- /dev/null +++ b/Lang/OCaml/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Greatest-common-divisor b/Lang/OCaml/Greatest-common-divisor new file mode 120000 index 0000000000..87064209b7 --- /dev/null +++ b/Lang/OCaml/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Greatest-element-of-a-list b/Lang/OCaml/Greatest-element-of-a-list new file mode 120000 index 0000000000..bcdb3404e8 --- /dev/null +++ b/Lang/OCaml/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Greatest-subsequential-sum b/Lang/OCaml/Greatest-subsequential-sum new file mode 120000 index 0000000000..8822230d7e --- /dev/null +++ b/Lang/OCaml/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Greyscale-bars-Display b/Lang/OCaml/Greyscale-bars-Display new file mode 120000 index 0000000000..af2931c4f8 --- /dev/null +++ b/Lang/OCaml/Greyscale-bars-Display @@ -0,0 +1 @@ +../../Task/Greyscale-bars-Display/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Guess-the-number b/Lang/OCaml/Guess-the-number new file mode 120000 index 0000000000..b442d784e5 --- /dev/null +++ b/Lang/OCaml/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Guess-the-number-With-feedback b/Lang/OCaml/Guess-the-number-With-feedback new file mode 120000 index 0000000000..0a2b23088a --- /dev/null +++ b/Lang/OCaml/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/OCaml \ No newline at end of file diff --git a/Lang/OCaml/HTTP b/Lang/OCaml/HTTP new file mode 120000 index 0000000000..20b580bdaa --- /dev/null +++ b/Lang/OCaml/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hailstone-sequence b/Lang/OCaml/Hailstone-sequence new file mode 120000 index 0000000000..bd4f833845 --- /dev/null +++ b/Lang/OCaml/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Handle-a-signal b/Lang/OCaml/Handle-a-signal new file mode 120000 index 0000000000..8b34469500 --- /dev/null +++ b/Lang/OCaml/Handle-a-signal @@ -0,0 +1 @@ +../../Task/Handle-a-signal/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Happy-numbers b/Lang/OCaml/Happy-numbers new file mode 120000 index 0000000000..0ecee701e0 --- /dev/null +++ b/Lang/OCaml/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hash-from-two-arrays b/Lang/OCaml/Hash-from-two-arrays new file mode 120000 index 0000000000..52ff151bb6 --- /dev/null +++ b/Lang/OCaml/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hello-world-Graphical b/Lang/OCaml/Hello-world-Graphical new file mode 120000 index 0000000000..042aa92c20 --- /dev/null +++ b/Lang/OCaml/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hello-world-Line-printer b/Lang/OCaml/Hello-world-Line-printer new file mode 120000 index 0000000000..77518aad55 --- /dev/null +++ b/Lang/OCaml/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hello-world-Newline-omission b/Lang/OCaml/Hello-world-Newline-omission new file mode 120000 index 0000000000..7ce569e7d1 --- /dev/null +++ b/Lang/OCaml/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hello-world-Standard-error b/Lang/OCaml/Hello-world-Standard-error new file mode 120000 index 0000000000..d3ded3c322 --- /dev/null +++ b/Lang/OCaml/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hello-world-Text b/Lang/OCaml/Hello-world-Text new file mode 120000 index 0000000000..0320b7c4ad --- /dev/null +++ b/Lang/OCaml/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hello-world-Web-server b/Lang/OCaml/Hello-world-Web-server new file mode 120000 index 0000000000..760e0bba5f --- /dev/null +++ b/Lang/OCaml/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Higher-order-functions b/Lang/OCaml/Higher-order-functions new file mode 120000 index 0000000000..d0c34ba854 --- /dev/null +++ b/Lang/OCaml/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Horizontal-sundial-calculations b/Lang/OCaml/Horizontal-sundial-calculations new file mode 120000 index 0000000000..8e096fb5a8 --- /dev/null +++ b/Lang/OCaml/Horizontal-sundial-calculations @@ -0,0 +1 @@ +../../Task/Horizontal-sundial-calculations/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Horners-rule-for-polynomial-evaluation b/Lang/OCaml/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..49d2c94937 --- /dev/null +++ b/Lang/OCaml/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Host-introspection b/Lang/OCaml/Host-introspection new file mode 120000 index 0000000000..f77b2189c7 --- /dev/null +++ b/Lang/OCaml/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Hostname b/Lang/OCaml/Hostname new file mode 120000 index 0000000000..8b0b1e0b4b --- /dev/null +++ b/Lang/OCaml/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Huffman-coding b/Lang/OCaml/Huffman-coding new file mode 120000 index 0000000000..aeebfe5f71 --- /dev/null +++ b/Lang/OCaml/Huffman-coding @@ -0,0 +1 @@ +../../Task/Huffman-coding/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Identity-matrix b/Lang/OCaml/Identity-matrix new file mode 120000 index 0000000000..923c44fdf3 --- /dev/null +++ b/Lang/OCaml/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Image-convolution b/Lang/OCaml/Image-convolution new file mode 120000 index 0000000000..ba6856a488 --- /dev/null +++ b/Lang/OCaml/Image-convolution @@ -0,0 +1 @@ +../../Task/Image-convolution/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Image-noise b/Lang/OCaml/Image-noise new file mode 120000 index 0000000000..85341fccdd --- /dev/null +++ b/Lang/OCaml/Image-noise @@ -0,0 +1 @@ +../../Task/Image-noise/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Include-a-file b/Lang/OCaml/Include-a-file new file mode 120000 index 0000000000..41f42cc0ed --- /dev/null +++ b/Lang/OCaml/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Increment-a-numerical-string b/Lang/OCaml/Increment-a-numerical-string new file mode 120000 index 0000000000..d6501c3fcd --- /dev/null +++ b/Lang/OCaml/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Infinity b/Lang/OCaml/Infinity new file mode 120000 index 0000000000..7e17336396 --- /dev/null +++ b/Lang/OCaml/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Inheritance-Multiple b/Lang/OCaml/Inheritance-Multiple new file mode 120000 index 0000000000..5518c103e7 --- /dev/null +++ b/Lang/OCaml/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Inheritance-Single b/Lang/OCaml/Inheritance-Single new file mode 120000 index 0000000000..757495cab4 --- /dev/null +++ b/Lang/OCaml/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Input-loop b/Lang/OCaml/Input-loop new file mode 120000 index 0000000000..358ed200ea --- /dev/null +++ b/Lang/OCaml/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Integer-comparison b/Lang/OCaml/Integer-comparison new file mode 120000 index 0000000000..d4702ece3c --- /dev/null +++ b/Lang/OCaml/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Integer-sequence b/Lang/OCaml/Integer-sequence new file mode 120000 index 0000000000..2b2322da36 --- /dev/null +++ b/Lang/OCaml/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Interactive-programming b/Lang/OCaml/Interactive-programming new file mode 120000 index 0000000000..9555652691 --- /dev/null +++ b/Lang/OCaml/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Introspection b/Lang/OCaml/Introspection new file mode 120000 index 0000000000..2c22ffdd77 --- /dev/null +++ b/Lang/OCaml/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Inverted-index b/Lang/OCaml/Inverted-index new file mode 120000 index 0000000000..079eb6655b --- /dev/null +++ b/Lang/OCaml/Inverted-index @@ -0,0 +1 @@ +../../Task/Inverted-index/OCaml \ No newline at end of file diff --git a/Lang/OCaml/JSON b/Lang/OCaml/JSON new file mode 120000 index 0000000000..efd3b0523e --- /dev/null +++ b/Lang/OCaml/JSON @@ -0,0 +1 @@ +../../Task/JSON/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Jensens-Device b/Lang/OCaml/Jensens-Device new file mode 120000 index 0000000000..187db437b2 --- /dev/null +++ b/Lang/OCaml/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Joystick-position b/Lang/OCaml/Joystick-position new file mode 120000 index 0000000000..02692fbcf9 --- /dev/null +++ b/Lang/OCaml/Joystick-position @@ -0,0 +1 @@ +../../Task/Joystick-position/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Knapsack-problem-0-1 b/Lang/OCaml/Knapsack-problem-0-1 new file mode 120000 index 0000000000..568ad1268f --- /dev/null +++ b/Lang/OCaml/Knapsack-problem-0-1 @@ -0,0 +1 @@ +../../Task/Knapsack-problem-0-1/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Knapsack-problem-Continuous b/Lang/OCaml/Knapsack-problem-Continuous new file mode 120000 index 0000000000..1059ce8f78 --- /dev/null +++ b/Lang/OCaml/Knapsack-problem-Continuous @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Continuous/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Knapsack-problem-Unbounded b/Lang/OCaml/Knapsack-problem-Unbounded new file mode 120000 index 0000000000..5e40beebc6 --- /dev/null +++ b/Lang/OCaml/Knapsack-problem-Unbounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Unbounded/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Knuth-shuffle b/Lang/OCaml/Knuth-shuffle new file mode 120000 index 0000000000..dac6cc447e --- /dev/null +++ b/Lang/OCaml/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Knuths-algorithm-S b/Lang/OCaml/Knuths-algorithm-S new file mode 120000 index 0000000000..345d6d5d82 --- /dev/null +++ b/Lang/OCaml/Knuths-algorithm-S @@ -0,0 +1 @@ +../../Task/Knuths-algorithm-S/OCaml \ No newline at end of file diff --git a/Lang/OCaml/LZW-compression b/Lang/OCaml/LZW-compression new file mode 120000 index 0000000000..b3cb940c94 --- /dev/null +++ b/Lang/OCaml/LZW-compression @@ -0,0 +1 @@ +../../Task/LZW-compression/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Langtons-ant b/Lang/OCaml/Langtons-ant new file mode 120000 index 0000000000..9672048e03 --- /dev/null +++ b/Lang/OCaml/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Largest-int-from-concatenated-ints b/Lang/OCaml/Largest-int-from-concatenated-ints new file mode 120000 index 0000000000..b3a89d6b7d --- /dev/null +++ b/Lang/OCaml/Largest-int-from-concatenated-ints @@ -0,0 +1 @@ +../../Task/Largest-int-from-concatenated-ints/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Last-Friday-of-each-month b/Lang/OCaml/Last-Friday-of-each-month new file mode 120000 index 0000000000..66d354571a --- /dev/null +++ b/Lang/OCaml/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Leap-year b/Lang/OCaml/Leap-year new file mode 120000 index 0000000000..ebb122fd20 --- /dev/null +++ b/Lang/OCaml/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Least-common-multiple b/Lang/OCaml/Least-common-multiple new file mode 120000 index 0000000000..b9f153c3c9 --- /dev/null +++ b/Lang/OCaml/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Letter-frequency b/Lang/OCaml/Letter-frequency new file mode 120000 index 0000000000..6f8ee909cc --- /dev/null +++ b/Lang/OCaml/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Levenshtein-distance b/Lang/OCaml/Levenshtein-distance new file mode 120000 index 0000000000..a39469a6f0 --- /dev/null +++ b/Lang/OCaml/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/OCaml \ No newline at end of file diff --git a/Lang/OCaml/List-comprehensions b/Lang/OCaml/List-comprehensions new file mode 120000 index 0000000000..bfd2de4817 --- /dev/null +++ b/Lang/OCaml/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Literals-Floating-point b/Lang/OCaml/Literals-Floating-point new file mode 120000 index 0000000000..427cb820fe --- /dev/null +++ b/Lang/OCaml/Literals-Floating-point @@ -0,0 +1 @@ +../../Task/Literals-Floating-point/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Literals-Integer b/Lang/OCaml/Literals-Integer new file mode 120000 index 0000000000..f5d1d8651f --- /dev/null +++ b/Lang/OCaml/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Literals-String b/Lang/OCaml/Literals-String new file mode 120000 index 0000000000..713097b0c6 --- /dev/null +++ b/Lang/OCaml/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Logical-operations b/Lang/OCaml/Logical-operations new file mode 120000 index 0000000000..4a305a03d6 --- /dev/null +++ b/Lang/OCaml/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Longest-common-subsequence b/Lang/OCaml/Longest-common-subsequence new file mode 120000 index 0000000000..d62c411c11 --- /dev/null +++ b/Lang/OCaml/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Longest-string-challenge b/Lang/OCaml/Longest-string-challenge new file mode 120000 index 0000000000..aca786bef5 --- /dev/null +++ b/Lang/OCaml/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Look-and-say-sequence b/Lang/OCaml/Look-and-say-sequence new file mode 120000 index 0000000000..bf7183f647 --- /dev/null +++ b/Lang/OCaml/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loop-over-multiple-arrays-simultaneously b/Lang/OCaml/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..69168e08f3 --- /dev/null +++ b/Lang/OCaml/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-Break b/Lang/OCaml/Loops-Break new file mode 120000 index 0000000000..9a42c3afb9 --- /dev/null +++ b/Lang/OCaml/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-Continue b/Lang/OCaml/Loops-Continue new file mode 120000 index 0000000000..288d593a59 --- /dev/null +++ b/Lang/OCaml/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-Do-while b/Lang/OCaml/Loops-Do-while new file mode 120000 index 0000000000..5eca1f36e2 --- /dev/null +++ b/Lang/OCaml/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-Downward-for b/Lang/OCaml/Loops-Downward-for new file mode 120000 index 0000000000..80ce63134c --- /dev/null +++ b/Lang/OCaml/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-For b/Lang/OCaml/Loops-For new file mode 120000 index 0000000000..f3626c93e2 --- /dev/null +++ b/Lang/OCaml/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-For-with-a-specified-step b/Lang/OCaml/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..fc3301fd7f --- /dev/null +++ b/Lang/OCaml/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-Foreach b/Lang/OCaml/Loops-Foreach new file mode 120000 index 0000000000..1cbb0601c4 --- /dev/null +++ b/Lang/OCaml/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-Infinite b/Lang/OCaml/Loops-Infinite new file mode 120000 index 0000000000..9ee335eeaf --- /dev/null +++ b/Lang/OCaml/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-N-plus-one-half b/Lang/OCaml/Loops-N-plus-one-half new file mode 120000 index 0000000000..f58e47593d --- /dev/null +++ b/Lang/OCaml/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-Nested b/Lang/OCaml/Loops-Nested new file mode 120000 index 0000000000..9c83a81bdb --- /dev/null +++ b/Lang/OCaml/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Loops-While b/Lang/OCaml/Loops-While new file mode 120000 index 0000000000..88f659b4b0 --- /dev/null +++ b/Lang/OCaml/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Luhn-test-of-credit-card-numbers b/Lang/OCaml/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..f5d5968cbb --- /dev/null +++ b/Lang/OCaml/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/OCaml \ No newline at end of file diff --git a/Lang/OCaml/MD5 b/Lang/OCaml/MD5 new file mode 120000 index 0000000000..82502cef57 --- /dev/null +++ b/Lang/OCaml/MD5 @@ -0,0 +1 @@ +../../Task/MD5/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Man-or-boy-test b/Lang/OCaml/Man-or-boy-test new file mode 120000 index 0000000000..a4dd6e856d --- /dev/null +++ b/Lang/OCaml/Man-or-boy-test @@ -0,0 +1 @@ +../../Task/Man-or-boy-test/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Mandelbrot-set b/Lang/OCaml/Mandelbrot-set new file mode 120000 index 0000000000..1903d77fd6 --- /dev/null +++ b/Lang/OCaml/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Map-range b/Lang/OCaml/Map-range new file mode 120000 index 0000000000..28707cc9c0 --- /dev/null +++ b/Lang/OCaml/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Matrix-exponentiation-operator b/Lang/OCaml/Matrix-exponentiation-operator new file mode 120000 index 0000000000..840b71270d --- /dev/null +++ b/Lang/OCaml/Matrix-exponentiation-operator @@ -0,0 +1 @@ +../../Task/Matrix-exponentiation-operator/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Matrix-multiplication b/Lang/OCaml/Matrix-multiplication new file mode 120000 index 0000000000..3cd17b3786 --- /dev/null +++ b/Lang/OCaml/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Matrix-transposition b/Lang/OCaml/Matrix-transposition new file mode 120000 index 0000000000..e53b84dee1 --- /dev/null +++ b/Lang/OCaml/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Maze-generation b/Lang/OCaml/Maze-generation new file mode 120000 index 0000000000..909e66d0d3 --- /dev/null +++ b/Lang/OCaml/Maze-generation @@ -0,0 +1 @@ +../../Task/Maze-generation/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Median-filter b/Lang/OCaml/Median-filter new file mode 120000 index 0000000000..ae94caee50 --- /dev/null +++ b/Lang/OCaml/Median-filter @@ -0,0 +1 @@ +../../Task/Median-filter/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Memory-layout-of-a-data-structure b/Lang/OCaml/Memory-layout-of-a-data-structure new file mode 120000 index 0000000000..8054d55dec --- /dev/null +++ b/Lang/OCaml/Memory-layout-of-a-data-structure @@ -0,0 +1 @@ +../../Task/Memory-layout-of-a-data-structure/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Menu b/Lang/OCaml/Menu new file mode 120000 index 0000000000..73441aa683 --- /dev/null +++ b/Lang/OCaml/Menu @@ -0,0 +1 @@ +../../Task/Menu/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Middle-three-digits b/Lang/OCaml/Middle-three-digits new file mode 120000 index 0000000000..cf433616d1 --- /dev/null +++ b/Lang/OCaml/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Minesweeper-game b/Lang/OCaml/Minesweeper-game new file mode 120000 index 0000000000..131fc42107 --- /dev/null +++ b/Lang/OCaml/Minesweeper-game @@ -0,0 +1 @@ +../../Task/Minesweeper-game/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Modular-inverse b/Lang/OCaml/Modular-inverse new file mode 120000 index 0000000000..1552844ccd --- /dev/null +++ b/Lang/OCaml/Modular-inverse @@ -0,0 +1 @@ +../../Task/Modular-inverse/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Monte-Carlo-methods b/Lang/OCaml/Monte-Carlo-methods new file mode 120000 index 0000000000..ecfabb82cd --- /dev/null +++ b/Lang/OCaml/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Monty-Hall-problem b/Lang/OCaml/Monty-Hall-problem new file mode 120000 index 0000000000..d1948e930b --- /dev/null +++ b/Lang/OCaml/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Morse-code b/Lang/OCaml/Morse-code new file mode 120000 index 0000000000..004d708940 --- /dev/null +++ b/Lang/OCaml/Morse-code @@ -0,0 +1 @@ +../../Task/Morse-code/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Mouse-position b/Lang/OCaml/Mouse-position new file mode 120000 index 0000000000..c07c69df7a --- /dev/null +++ b/Lang/OCaml/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Multiple-distinct-objects b/Lang/OCaml/Multiple-distinct-objects new file mode 120000 index 0000000000..5b29c50ec8 --- /dev/null +++ b/Lang/OCaml/Multiple-distinct-objects @@ -0,0 +1 @@ +../../Task/Multiple-distinct-objects/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Multiplication-tables b/Lang/OCaml/Multiplication-tables new file mode 120000 index 0000000000..a1351fe562 --- /dev/null +++ b/Lang/OCaml/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Mutex b/Lang/OCaml/Mutex new file mode 120000 index 0000000000..c020f85a23 --- /dev/null +++ b/Lang/OCaml/Mutex @@ -0,0 +1 @@ +../../Task/Mutex/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Mutual-recursion b/Lang/OCaml/Mutual-recursion new file mode 120000 index 0000000000..1965a97b7b --- /dev/null +++ b/Lang/OCaml/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Ordered-words b/Lang/OCaml/Ordered-words new file mode 120000 index 0000000000..730b10d8e2 --- /dev/null +++ b/Lang/OCaml/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Pi b/Lang/OCaml/Pi new file mode 120000 index 0000000000..e07dc3d981 --- /dev/null +++ b/Lang/OCaml/Pi @@ -0,0 +1 @@ +../../Task/Pi/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Quine b/Lang/OCaml/Quine new file mode 120000 index 0000000000..17e82fea45 --- /dev/null +++ b/Lang/OCaml/Quine @@ -0,0 +1 @@ +../../Task/Quine/OCaml \ No newline at end of file diff --git a/Lang/OCaml/Search-a-list b/Lang/OCaml/Search-a-list new file mode 120000 index 0000000000..b7f9f4f383 --- /dev/null +++ b/Lang/OCaml/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/OCaml \ No newline at end of file diff --git a/Lang/OOC/0DESCRIPTION b/Lang/OOC/0DESCRIPTION new file mode 100644 index 0000000000..afefd57ab5 --- /dev/null +++ b/Lang/OOC/0DESCRIPTION @@ -0,0 +1,2 @@ +{{stub}}{{language +|site=http://www.ooc-lang.org}} \ No newline at end of file diff --git a/Lang/OOC/FizzBuzz b/Lang/OOC/FizzBuzz new file mode 120000 index 0000000000..07cd4d0060 --- /dev/null +++ b/Lang/OOC/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/OOC \ No newline at end of file diff --git a/Lang/OOC/Hello-world-Text b/Lang/OOC/Hello-world-Text new file mode 120000 index 0000000000..d0cad299f2 --- /dev/null +++ b/Lang/OOC/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/OOC \ No newline at end of file diff --git a/Lang/OOCalc/0DESCRIPTION b/Lang/OOCalc/0DESCRIPTION new file mode 100644 index 0000000000..ca10ffeda6 --- /dev/null +++ b/Lang/OOCalc/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language}} + +This is the macro language used in the Calc spreadsheet software, which is distributed as part of the OpenOffice.org and LibreOffice suites. \ No newline at end of file diff --git a/Lang/OPL/0DESCRIPTION b/Lang/OPL/0DESCRIPTION new file mode 100644 index 0000000000..4d3d27c049 --- /dev/null +++ b/Lang/OPL/0DESCRIPTION @@ -0,0 +1 @@ +{{stub}}{{language}} \ No newline at end of file diff --git a/Lang/OPL/Fibonacci-sequence b/Lang/OPL/Fibonacci-sequence new file mode 120000 index 0000000000..5627b6662a --- /dev/null +++ b/Lang/OPL/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/OPL \ No newline at end of file diff --git a/Lang/Oberon-2/0DESCRIPTION b/Lang/Oberon-2/0DESCRIPTION new file mode 100644 index 0000000000..d9621b2865 --- /dev/null +++ b/Lang/Oberon-2/0DESCRIPTION @@ -0,0 +1,9 @@ +{{language|Oberon-2 +|strength=strong +|safety=safe +|express=explicit +|compat=structural +|checking=static +|parampass=both +|gc=yes +|LCT=yes}}Oberon-2 is a further development of the Modula series of languages by Niklaus Wirth. Oberon was both the name for the systems programming language and the operating system. \ No newline at end of file diff --git a/Lang/Oberon-2/99-Bottles-of-Beer b/Lang/Oberon-2/99-Bottles-of-Beer new file mode 120000 index 0000000000..1554e0d4aa --- /dev/null +++ b/Lang/Oberon-2/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/A+B b/Lang/Oberon-2/A+B new file mode 120000 index 0000000000..e8d17f807e --- /dev/null +++ b/Lang/Oberon-2/A+B @@ -0,0 +1 @@ +../../Task/A+B/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Ackermann-function b/Lang/Oberon-2/Ackermann-function new file mode 120000 index 0000000000..91717fa516 --- /dev/null +++ b/Lang/Oberon-2/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Anagrams b/Lang/Oberon-2/Anagrams new file mode 120000 index 0000000000..c82810cc80 --- /dev/null +++ b/Lang/Oberon-2/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Assertions b/Lang/Oberon-2/Assertions new file mode 120000 index 0000000000..bf5e26b8e1 --- /dev/null +++ b/Lang/Oberon-2/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Averages-Arithmetic-mean b/Lang/Oberon-2/Averages-Arithmetic-mean new file mode 120000 index 0000000000..b5f75094da --- /dev/null +++ b/Lang/Oberon-2/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Averages-Median b/Lang/Oberon-2/Averages-Median new file mode 120000 index 0000000000..351254c351 --- /dev/null +++ b/Lang/Oberon-2/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Averages-Pythagorean-means b/Lang/Oberon-2/Averages-Pythagorean-means new file mode 120000 index 0000000000..c0d6d2d984 --- /dev/null +++ b/Lang/Oberon-2/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Averages-Root-mean-square b/Lang/Oberon-2/Averages-Root-mean-square new file mode 120000 index 0000000000..2729d2c2d1 --- /dev/null +++ b/Lang/Oberon-2/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Character-codes b/Lang/Oberon-2/Character-codes new file mode 120000 index 0000000000..216923d7e9 --- /dev/null +++ b/Lang/Oberon-2/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Classes b/Lang/Oberon-2/Classes new file mode 120000 index 0000000000..63432c54e0 --- /dev/null +++ b/Lang/Oberon-2/Classes @@ -0,0 +1 @@ +../../Task/Classes/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Factors-of-an-integer b/Lang/Oberon-2/Factors-of-an-integer new file mode 120000 index 0000000000..368788ede2 --- /dev/null +++ b/Lang/Oberon-2/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/FizzBuzz b/Lang/Oberon-2/FizzBuzz new file mode 120000 index 0000000000..c908abbe41 --- /dev/null +++ b/Lang/Oberon-2/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Formatted-numeric-output b/Lang/Oberon-2/Formatted-numeric-output new file mode 120000 index 0000000000..68619646ba --- /dev/null +++ b/Lang/Oberon-2/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Function-definition b/Lang/Oberon-2/Function-definition new file mode 120000 index 0000000000..730a5f43ae --- /dev/null +++ b/Lang/Oberon-2/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Hailstone-sequence b/Lang/Oberon-2/Hailstone-sequence new file mode 120000 index 0000000000..0f49c4cc8e --- /dev/null +++ b/Lang/Oberon-2/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Hello-world-Standard-error b/Lang/Oberon-2/Hello-world-Standard-error new file mode 120000 index 0000000000..9a4a3c9b73 --- /dev/null +++ b/Lang/Oberon-2/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Hello-world-Text b/Lang/Oberon-2/Hello-world-Text new file mode 120000 index 0000000000..6ed30bccab --- /dev/null +++ b/Lang/Oberon-2/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/History-variables b/Lang/Oberon-2/History-variables new file mode 120000 index 0000000000..a551ea740b --- /dev/null +++ b/Lang/Oberon-2/History-variables @@ -0,0 +1 @@ +../../Task/History-variables/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Increment-a-numerical-string b/Lang/Oberon-2/Increment-a-numerical-string new file mode 120000 index 0000000000..16e0fa7603 --- /dev/null +++ b/Lang/Oberon-2/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Integer-comparison b/Lang/Oberon-2/Integer-comparison new file mode 120000 index 0000000000..32a2e2b487 --- /dev/null +++ b/Lang/Oberon-2/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Leap-year b/Lang/Oberon-2/Leap-year new file mode 120000 index 0000000000..4e0e9485f1 --- /dev/null +++ b/Lang/Oberon-2/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Loops-Downward-for b/Lang/Oberon-2/Loops-Downward-for new file mode 120000 index 0000000000..e6ee15cc3a --- /dev/null +++ b/Lang/Oberon-2/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Oberon-2 \ No newline at end of file diff --git a/Lang/Oberon-2/Loops-While b/Lang/Oberon-2/Loops-While new file mode 120000 index 0000000000..5c240cc895 --- /dev/null +++ b/Lang/Oberon-2/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Oberon-2 \ No newline at end of file diff --git a/Lang/Objeck/0DESCRIPTION b/Lang/Objeck/0DESCRIPTION new file mode 100644 index 0000000000..109c10a8b7 --- /dev/null +++ b/Lang/Objeck/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language|Objeck +|exec=bytecode +|site=http://sourceforge.net/projects/objeck-lang +|gc=yes +|parampass=value +|safety=safe +|checking=static +|strength=strong +|LCT=yes}} +{{language programming paradigm|Object-oriented}}{{language programming paradigm|functional}} + +The '''Objeck Programming Language''' is an [[object-oriented]] computing language with [[functional programming|functional]] features. The language has ties with [[C sharp|C#]], [[Scheme]] and indirectly [[Ruby]]. In this language all data types, except for higher-order functions, are treated as objects. The language contains all of the basic features of a general-purpose (Turing complete) programming language with an emphasis placed on OOP simplicity. The programming environment consists of an optimizing compiler, virtual machine with associated [[Garbage collection|garbage collector]] and [[JIT]] compiler along with a command-line debugger. The compiler emits binary [[bytecode]] that is executed by the runtime system. The runtime system has the ability to translate the bytecode into AMD64 or IA-32 machine code on the fly. + +For more information check out the [http://objeck-lang.sourceforge.net/guide Objeck Programmer's Guide] ([https://sourceforge.net/p/objeck-lang/code/3289/tree/main/docs/guide/objeck_lang.pdf?format=raw pdf]) or this YouTube [http://www.youtube.com/watch?v=Mk2Kfb-WESU video]. The language can be [http://sourceforge.net/projects/objeck-lang/files/ obtained] from the main project homepage. Also, check out the IRC channel #objeck on freenode.net. \ No newline at end of file diff --git a/Lang/Objeck/100-doors b/Lang/Objeck/100-doors new file mode 120000 index 0000000000..4c69c6e187 --- /dev/null +++ b/Lang/Objeck/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Objeck \ No newline at end of file diff --git a/Lang/Objeck/A+B b/Lang/Objeck/A+B new file mode 120000 index 0000000000..282480b81c --- /dev/null +++ b/Lang/Objeck/A+B @@ -0,0 +1 @@ +../../Task/A+B/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Abstract-type b/Lang/Objeck/Abstract-type new file mode 120000 index 0000000000..bb9e10e956 --- /dev/null +++ b/Lang/Objeck/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Accumulator-factory b/Lang/Objeck/Accumulator-factory new file mode 120000 index 0000000000..4a742c4853 --- /dev/null +++ b/Lang/Objeck/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Apply-a-callback-to-an-array b/Lang/Objeck/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..9e15a6c6c4 --- /dev/null +++ b/Lang/Objeck/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Arithmetic-Integer b/Lang/Objeck/Arithmetic-Integer new file mode 120000 index 0000000000..f31e894534 --- /dev/null +++ b/Lang/Objeck/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Array-concatenation b/Lang/Objeck/Array-concatenation new file mode 120000 index 0000000000..fcbfdfe726 --- /dev/null +++ b/Lang/Objeck/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Arrays b/Lang/Objeck/Arrays new file mode 120000 index 0000000000..737d706f19 --- /dev/null +++ b/Lang/Objeck/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Associative-array-Creation b/Lang/Objeck/Associative-array-Creation new file mode 120000 index 0000000000..ebbf1b2ef5 --- /dev/null +++ b/Lang/Objeck/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Associative-array-Iteration b/Lang/Objeck/Associative-array-Iteration new file mode 120000 index 0000000000..3dff359ba6 --- /dev/null +++ b/Lang/Objeck/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Averages-Arithmetic-mean b/Lang/Objeck/Averages-Arithmetic-mean new file mode 120000 index 0000000000..0f079efd06 --- /dev/null +++ b/Lang/Objeck/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Averages-Median b/Lang/Objeck/Averages-Median new file mode 120000 index 0000000000..55df6ab479 --- /dev/null +++ b/Lang/Objeck/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Averages-Root-mean-square b/Lang/Objeck/Averages-Root-mean-square new file mode 120000 index 0000000000..86fec0a41d --- /dev/null +++ b/Lang/Objeck/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Balanced-brackets b/Lang/Objeck/Balanced-brackets new file mode 120000 index 0000000000..4a181934bd --- /dev/null +++ b/Lang/Objeck/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Binary-search b/Lang/Objeck/Binary-search new file mode 120000 index 0000000000..99377d1b59 --- /dev/null +++ b/Lang/Objeck/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Bitwise-operations b/Lang/Objeck/Bitwise-operations new file mode 120000 index 0000000000..cf9108c9f9 --- /dev/null +++ b/Lang/Objeck/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Box-the-compass b/Lang/Objeck/Box-the-compass new file mode 120000 index 0000000000..02f8da22fe --- /dev/null +++ b/Lang/Objeck/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Call-an-object-method b/Lang/Objeck/Call-an-object-method new file mode 120000 index 0000000000..f394a206b2 --- /dev/null +++ b/Lang/Objeck/Call-an-object-method @@ -0,0 +1 @@ +../../Task/Call-an-object-method/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Character-codes b/Lang/Objeck/Character-codes new file mode 120000 index 0000000000..ee54d0b814 --- /dev/null +++ b/Lang/Objeck/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Character-matching b/Lang/Objeck/Character-matching new file mode 120000 index 0000000000..d06b853385 --- /dev/null +++ b/Lang/Objeck/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Chat-server b/Lang/Objeck/Chat-server new file mode 120000 index 0000000000..02438f3698 --- /dev/null +++ b/Lang/Objeck/Chat-server @@ -0,0 +1 @@ +../../Task/Chat-server/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Check-that-file-exists b/Lang/Objeck/Check-that-file-exists new file mode 120000 index 0000000000..b44ce21baf --- /dev/null +++ b/Lang/Objeck/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Cholesky-decomposition b/Lang/Objeck/Cholesky-decomposition new file mode 120000 index 0000000000..54aa16102d --- /dev/null +++ b/Lang/Objeck/Cholesky-decomposition @@ -0,0 +1 @@ +../../Task/Cholesky-decomposition/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Classes b/Lang/Objeck/Classes new file mode 120000 index 0000000000..3d3f03749b --- /dev/null +++ b/Lang/Objeck/Classes @@ -0,0 +1 @@ +../../Task/Classes/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Collections b/Lang/Objeck/Collections new file mode 120000 index 0000000000..219456e485 --- /dev/null +++ b/Lang/Objeck/Collections @@ -0,0 +1 @@ +../../Task/Collections/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Command-line-arguments b/Lang/Objeck/Command-line-arguments new file mode 120000 index 0000000000..d3ff0831b9 --- /dev/null +++ b/Lang/Objeck/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Comments b/Lang/Objeck/Comments new file mode 120000 index 0000000000..1ec2de8bec --- /dev/null +++ b/Lang/Objeck/Comments @@ -0,0 +1 @@ +../../Task/Comments/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Compile-time-calculation b/Lang/Objeck/Compile-time-calculation new file mode 120000 index 0000000000..8b13d73215 --- /dev/null +++ b/Lang/Objeck/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Compound-data-type b/Lang/Objeck/Compound-data-type new file mode 120000 index 0000000000..c6c26e866b --- /dev/null +++ b/Lang/Objeck/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Concurrent-computing b/Lang/Objeck/Concurrent-computing new file mode 120000 index 0000000000..2915a69a7b --- /dev/null +++ b/Lang/Objeck/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Conditional-structures b/Lang/Objeck/Conditional-structures new file mode 120000 index 0000000000..609934ec85 --- /dev/null +++ b/Lang/Objeck/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Create-a-file b/Lang/Objeck/Create-a-file new file mode 120000 index 0000000000..915aa38e04 --- /dev/null +++ b/Lang/Objeck/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Create-a-two-dimensional-array-at-runtime b/Lang/Objeck/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..1ae6a2f42a --- /dev/null +++ b/Lang/Objeck/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Date-format b/Lang/Objeck/Date-format new file mode 120000 index 0000000000..dd06e5fb54 --- /dev/null +++ b/Lang/Objeck/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Delete-a-file b/Lang/Objeck/Delete-a-file new file mode 120000 index 0000000000..0add291ebe --- /dev/null +++ b/Lang/Objeck/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Dot-product b/Lang/Objeck/Dot-product new file mode 120000 index 0000000000..78356de68d --- /dev/null +++ b/Lang/Objeck/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Doubly-linked-list-Traversal b/Lang/Objeck/Doubly-linked-list-Traversal new file mode 120000 index 0000000000..4676ee038c --- /dev/null +++ b/Lang/Objeck/Doubly-linked-list-Traversal @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Traversal/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Echo-server b/Lang/Objeck/Echo-server new file mode 120000 index 0000000000..45b28e91cd --- /dev/null +++ b/Lang/Objeck/Echo-server @@ -0,0 +1 @@ +../../Task/Echo-server/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Empty-program b/Lang/Objeck/Empty-program new file mode 120000 index 0000000000..3ed0aa4101 --- /dev/null +++ b/Lang/Objeck/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Empty-string b/Lang/Objeck/Empty-string new file mode 120000 index 0000000000..da0015fd11 --- /dev/null +++ b/Lang/Objeck/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Enumerations b/Lang/Objeck/Enumerations new file mode 120000 index 0000000000..843b5f810e --- /dev/null +++ b/Lang/Objeck/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Ethiopian-multiplication b/Lang/Objeck/Ethiopian-multiplication new file mode 120000 index 0000000000..be875e91d5 --- /dev/null +++ b/Lang/Objeck/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Euler-method b/Lang/Objeck/Euler-method new file mode 120000 index 0000000000..af1f97cefd --- /dev/null +++ b/Lang/Objeck/Euler-method @@ -0,0 +1 @@ +../../Task/Euler-method/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Even-or-odd b/Lang/Objeck/Even-or-odd new file mode 120000 index 0000000000..5ac78886a9 --- /dev/null +++ b/Lang/Objeck/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Evolutionary-algorithm b/Lang/Objeck/Evolutionary-algorithm new file mode 120000 index 0000000000..55340e0a5c --- /dev/null +++ b/Lang/Objeck/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Factorial b/Lang/Objeck/Factorial new file mode 120000 index 0000000000..731093aa30 --- /dev/null +++ b/Lang/Objeck/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Factors-of-an-integer b/Lang/Objeck/Factors-of-an-integer new file mode 120000 index 0000000000..22b4b46423 --- /dev/null +++ b/Lang/Objeck/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Fibonacci-sequence b/Lang/Objeck/Fibonacci-sequence new file mode 120000 index 0000000000..8fdd7f4e91 --- /dev/null +++ b/Lang/Objeck/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Objeck \ No newline at end of file diff --git a/Lang/Objeck/File-IO b/Lang/Objeck/File-IO new file mode 120000 index 0000000000..1382ae77bc --- /dev/null +++ b/Lang/Objeck/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Objeck \ No newline at end of file diff --git a/Lang/Objeck/File-size b/Lang/Objeck/File-size new file mode 120000 index 0000000000..fe8c1fee60 --- /dev/null +++ b/Lang/Objeck/File-size @@ -0,0 +1 @@ +../../Task/File-size/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Filter b/Lang/Objeck/Filter new file mode 120000 index 0000000000..f99a4c1afd --- /dev/null +++ b/Lang/Objeck/Filter @@ -0,0 +1 @@ +../../Task/Filter/Objeck \ No newline at end of file diff --git a/Lang/Objeck/FizzBuzz b/Lang/Objeck/FizzBuzz new file mode 120000 index 0000000000..47f7f1a6ae --- /dev/null +++ b/Lang/Objeck/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Forward-difference b/Lang/Objeck/Forward-difference new file mode 120000 index 0000000000..0bc78ed4f6 --- /dev/null +++ b/Lang/Objeck/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Function-composition b/Lang/Objeck/Function-composition new file mode 120000 index 0000000000..b15475fe53 --- /dev/null +++ b/Lang/Objeck/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Function-definition b/Lang/Objeck/Function-definition new file mode 120000 index 0000000000..a1ccfb4a7c --- /dev/null +++ b/Lang/Objeck/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Greatest-common-divisor b/Lang/Objeck/Greatest-common-divisor new file mode 120000 index 0000000000..546917d12a --- /dev/null +++ b/Lang/Objeck/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Greatest-element-of-a-list b/Lang/Objeck/Greatest-element-of-a-list new file mode 120000 index 0000000000..be2c7d20e2 --- /dev/null +++ b/Lang/Objeck/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Guess-the-number b/Lang/Objeck/Guess-the-number new file mode 120000 index 0000000000..1061ed0d61 --- /dev/null +++ b/Lang/Objeck/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Guess-the-number-With-feedback b/Lang/Objeck/Guess-the-number-With-feedback new file mode 120000 index 0000000000..e8bc0dd50c --- /dev/null +++ b/Lang/Objeck/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/Objeck \ No newline at end of file diff --git a/Lang/Objeck/HTTP b/Lang/Objeck/HTTP new file mode 120000 index 0000000000..42e455d715 --- /dev/null +++ b/Lang/Objeck/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Objeck \ No newline at end of file diff --git a/Lang/Objeck/HTTPS b/Lang/Objeck/HTTPS new file mode 120000 index 0000000000..7d76e332ab --- /dev/null +++ b/Lang/Objeck/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Happy-numbers b/Lang/Objeck/Happy-numbers new file mode 120000 index 0000000000..d504a9ae9e --- /dev/null +++ b/Lang/Objeck/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Hash-from-two-arrays b/Lang/Objeck/Hash-from-two-arrays new file mode 120000 index 0000000000..00fa098a6a --- /dev/null +++ b/Lang/Objeck/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Haversine-formula b/Lang/Objeck/Haversine-formula new file mode 120000 index 0000000000..078c39f127 --- /dev/null +++ b/Lang/Objeck/Haversine-formula @@ -0,0 +1 @@ +../../Task/Haversine-formula/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Hello-world-Graphical b/Lang/Objeck/Hello-world-Graphical new file mode 120000 index 0000000000..f531216113 --- /dev/null +++ b/Lang/Objeck/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Hello-world-Newline-omission b/Lang/Objeck/Hello-world-Newline-omission new file mode 120000 index 0000000000..cf4f0fae30 --- /dev/null +++ b/Lang/Objeck/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Hello-world-Text b/Lang/Objeck/Hello-world-Text new file mode 120000 index 0000000000..cf62a0a525 --- /dev/null +++ b/Lang/Objeck/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Hello-world-Web-server b/Lang/Objeck/Hello-world-Web-server new file mode 120000 index 0000000000..a66152a7a2 --- /dev/null +++ b/Lang/Objeck/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Higher-order-functions b/Lang/Objeck/Higher-order-functions new file mode 120000 index 0000000000..7e5ed46182 --- /dev/null +++ b/Lang/Objeck/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Hofstadter-Conway-$10,000-sequence b/Lang/Objeck/Hofstadter-Conway-$10,000-sequence new file mode 120000 index 0000000000..b137419097 --- /dev/null +++ b/Lang/Objeck/Hofstadter-Conway-$10,000-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Conway-$10,000-sequence/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Horners-rule-for-polynomial-evaluation b/Lang/Objeck/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..54842da21d --- /dev/null +++ b/Lang/Objeck/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Hostname b/Lang/Objeck/Hostname new file mode 120000 index 0000000000..edb53077e8 --- /dev/null +++ b/Lang/Objeck/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Increment-a-numerical-string b/Lang/Objeck/Increment-a-numerical-string new file mode 120000 index 0000000000..2d34b542da --- /dev/null +++ b/Lang/Objeck/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Inheritance-Single b/Lang/Objeck/Inheritance-Single new file mode 120000 index 0000000000..7d67a37c4d --- /dev/null +++ b/Lang/Objeck/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Input-loop b/Lang/Objeck/Input-loop new file mode 120000 index 0000000000..6880ac7a6c --- /dev/null +++ b/Lang/Objeck/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Integer-comparison b/Lang/Objeck/Integer-comparison new file mode 120000 index 0000000000..59b1d50344 --- /dev/null +++ b/Lang/Objeck/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Integer-sequence b/Lang/Objeck/Integer-sequence new file mode 120000 index 0000000000..5732a68e32 --- /dev/null +++ b/Lang/Objeck/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Objeck \ No newline at end of file diff --git a/Lang/Objeck/JSON b/Lang/Objeck/JSON new file mode 120000 index 0000000000..7679c69366 --- /dev/null +++ b/Lang/Objeck/JSON @@ -0,0 +1 @@ +../../Task/JSON/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Jensens-Device b/Lang/Objeck/Jensens-Device new file mode 120000 index 0000000000..677f2cb9a5 --- /dev/null +++ b/Lang/Objeck/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Leap-year b/Lang/Objeck/Leap-year new file mode 120000 index 0000000000..7cfe43f10d --- /dev/null +++ b/Lang/Objeck/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Least-common-multiple b/Lang/Objeck/Least-common-multiple new file mode 120000 index 0000000000..040cd09300 --- /dev/null +++ b/Lang/Objeck/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Letter-frequency b/Lang/Objeck/Letter-frequency new file mode 120000 index 0000000000..e247017be1 --- /dev/null +++ b/Lang/Objeck/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Literals-Floating-point b/Lang/Objeck/Literals-Floating-point new file mode 120000 index 0000000000..b2ca774f5d --- /dev/null +++ b/Lang/Objeck/Literals-Floating-point @@ -0,0 +1 @@ +../../Task/Literals-Floating-point/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Literals-Integer b/Lang/Objeck/Literals-Integer new file mode 120000 index 0000000000..75465738a3 --- /dev/null +++ b/Lang/Objeck/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Logical-operations b/Lang/Objeck/Logical-operations new file mode 120000 index 0000000000..ae51a3ae63 --- /dev/null +++ b/Lang/Objeck/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loop-over-multiple-arrays-simultaneously b/Lang/Objeck/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..9b5c45225c --- /dev/null +++ b/Lang/Objeck/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-Break b/Lang/Objeck/Loops-Break new file mode 120000 index 0000000000..371e325517 --- /dev/null +++ b/Lang/Objeck/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-Do-while b/Lang/Objeck/Loops-Do-while new file mode 120000 index 0000000000..eaf62a585e --- /dev/null +++ b/Lang/Objeck/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-Downward-for b/Lang/Objeck/Loops-Downward-for new file mode 120000 index 0000000000..131edcf748 --- /dev/null +++ b/Lang/Objeck/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-For b/Lang/Objeck/Loops-For new file mode 120000 index 0000000000..5e19f7a0de --- /dev/null +++ b/Lang/Objeck/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-For-with-a-specified-step b/Lang/Objeck/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..14683f6b34 --- /dev/null +++ b/Lang/Objeck/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-Foreach b/Lang/Objeck/Loops-Foreach new file mode 120000 index 0000000000..4379e7e6a6 --- /dev/null +++ b/Lang/Objeck/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-Infinite b/Lang/Objeck/Loops-Infinite new file mode 120000 index 0000000000..14cacfddcd --- /dev/null +++ b/Lang/Objeck/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-N-plus-one-half b/Lang/Objeck/Loops-N-plus-one-half new file mode 120000 index 0000000000..c12a477207 --- /dev/null +++ b/Lang/Objeck/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Loops-While b/Lang/Objeck/Loops-While new file mode 120000 index 0000000000..c939cd790f --- /dev/null +++ b/Lang/Objeck/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Luhn-test-of-credit-card-numbers b/Lang/Objeck/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..88732b8a4e --- /dev/null +++ b/Lang/Objeck/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Objeck \ No newline at end of file diff --git a/Lang/Objeck/MD5 b/Lang/Objeck/MD5 new file mode 120000 index 0000000000..466f67301b --- /dev/null +++ b/Lang/Objeck/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Map-range b/Lang/Objeck/Map-range new file mode 120000 index 0000000000..6dd0bcaf5e --- /dev/null +++ b/Lang/Objeck/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Matrix-transposition b/Lang/Objeck/Matrix-transposition new file mode 120000 index 0000000000..38b36c8ec5 --- /dev/null +++ b/Lang/Objeck/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Memory-allocation b/Lang/Objeck/Memory-allocation new file mode 120000 index 0000000000..3ef117a2f4 --- /dev/null +++ b/Lang/Objeck/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Multifactorial b/Lang/Objeck/Multifactorial new file mode 120000 index 0000000000..7500474fff --- /dev/null +++ b/Lang/Objeck/Multifactorial @@ -0,0 +1 @@ +../../Task/Multifactorial/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Mutex b/Lang/Objeck/Mutex new file mode 120000 index 0000000000..d21333276c --- /dev/null +++ b/Lang/Objeck/Mutex @@ -0,0 +1 @@ +../../Task/Mutex/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Mutual-recursion b/Lang/Objeck/Mutual-recursion new file mode 120000 index 0000000000..2a0b28f29a --- /dev/null +++ b/Lang/Objeck/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Objeck \ No newline at end of file diff --git a/Lang/Objeck/Search-a-list b/Lang/Objeck/Search-a-list new file mode 120000 index 0000000000..916b24bb7c --- /dev/null +++ b/Lang/Objeck/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Objeck \ No newline at end of file diff --git a/Lang/Object-Pascal/0DESCRIPTION b/Lang/Object-Pascal/0DESCRIPTION new file mode 100644 index 0000000000..9f475f0b0a --- /dev/null +++ b/Lang/Object-Pascal/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language|Object Pascal +|strength=strong +|safety=both +|express=explicit +|compat=nominative +|checking=static +|gc=yes +|LCT=yes}}{{language programming paradigm|Object-oriented}} +Object Pascal is an [[object-oriented]] derivative of [[Pascal]] mostly known as the primary programming language of Borland [[Delphi]]. It is also known as the "Delphi programming language" when describing the dialect used by Borland Delphi. + +Borland used the name "Object Pascal" for the programming language in the first versions of Borland Delphi, but later renamed it to the "Delphi programming language". The [[Free Pascal]] compiler supports different modes/dialects and besides [[Turbo Pascal]], [[Delphi]] and MacPascal, [[Object Pascal]] can be selected. + +==Citations== +* [[wp:Object_Pascal|Wikipedia:Object Pascal]] \ No newline at end of file diff --git a/Lang/Object-Pascal/Classes b/Lang/Object-Pascal/Classes new file mode 120000 index 0000000000..5f054308ad --- /dev/null +++ b/Lang/Object-Pascal/Classes @@ -0,0 +1 @@ +../../Task/Classes/Object-Pascal \ No newline at end of file diff --git a/Lang/Object-Pascal/Ethiopian-multiplication b/Lang/Object-Pascal/Ethiopian-multiplication new file mode 120000 index 0000000000..8d66232b2a --- /dev/null +++ b/Lang/Object-Pascal/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Object-Pascal \ No newline at end of file diff --git a/Lang/Object-Pascal/File-IO b/Lang/Object-Pascal/File-IO new file mode 120000 index 0000000000..f5635ded4a --- /dev/null +++ b/Lang/Object-Pascal/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Object-Pascal \ No newline at end of file diff --git a/Lang/ObjectIcon/0DESCRIPTION b/Lang/ObjectIcon/0DESCRIPTION new file mode 100644 index 0000000000..33a663ee0c --- /dev/null +++ b/Lang/ObjectIcon/0DESCRIPTION @@ -0,0 +1,30 @@ +{{Stub}} +{{language|ObjectIcon +|site=http://code.google.com/p/objecticon/ +|exec=bytecode +|parampass=value +|strength=strong +|safety=safe +|express=implicit +|checking=dynamic +|gc=yes +|LCT=yes +}} +{{virtual machine}} +{{language programming paradigm|Procedural}} +{{language programming paradigm|Dynamic}} +{{language programming paradigm|Object-oriented}} +{{language programming paradigm|Logic_Programming}} +ObjectIcon is an object oriented variant of [[Icon]] based on an early fork of the [[Unicon]] Project developed by Robert Parlett (one of the co-authors of the Unicon book). +Some of the distinguishing characteristics are: +* a richer set of object oriented keywords +* support for unicode characters +* replacement of the I/O support with a package +* differences in keywords + +For more information refer to the wiki off the main site [http://code.google.com/p/objecticon/wiki/Introduction ObjectIcon Wiki] + +== Related == +* [[Icon]] +* [[Jcon]] +* [[Unicon]] \ No newline at end of file diff --git a/Lang/Objective-C/0DESCRIPTION b/Lang/Objective-C/0DESCRIPTION new file mode 100644 index 0000000000..afe6edc462 --- /dev/null +++ b/Lang/Objective-C/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language|Objective-C +|exec=machine +|strength=weak +|express=explicit +|checking=static +|parampass=value +|gc=allowed +|site=http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ +|LCT=yes}}{{language programming paradigm|Object-oriented}} +[[wp:Objective-C|Objective-C]] is an [[object-oriented]] superset of the [[derived from::compatible with::C]] language. It mostly copies the message passing system from [[derived from::Smalltalk]]. It was popularized by NeXT, and then again by [[Apple Inc]] with [[Mac OS X]] and [[iOS]] to implement the [[Cocoa]] frameworks. Its main reference implementation is within the [[gcc]] compiler, maintained mostly by Apple. + +As of October 2011, with the release of [http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_2.html#//apple_ref/doc/uid/00200-SW1 XCode 4.2], Apple switched from [[gcc]] to [[wp:Clang|Clang]] as its default compiler. [[wp:Clang|Clang]]/[[wp:LLVM|LLVM]] offers competitive execution times, better compile times, improved error messages, and supports a simpler alternative syntax for expressing NSArray & NSDictionary literals and indexing. In the same release Apple also introduced automatic reference counting (ARC) which eliminates the need to manually release/retain memory. With ARC the compiler reports an error any time it encounters a call to release, autorelease, retain, or dealloc. +
\ No newline at end of file diff --git a/Lang/Objective-C/99-Bottles-of-Beer b/Lang/Objective-C/99-Bottles-of-Beer new file mode 120000 index 0000000000..3c3a2fb4f4 --- /dev/null +++ b/Lang/Objective-C/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Accumulator-factory b/Lang/Objective-C/Accumulator-factory new file mode 120000 index 0000000000..389a66a730 --- /dev/null +++ b/Lang/Objective-C/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Add-a-variable-to-a-class-instance-at-runtime b/Lang/Objective-C/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..0e03a8dba6 --- /dev/null +++ b/Lang/Objective-C/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Anonymous-recursion b/Lang/Objective-C/Anonymous-recursion new file mode 120000 index 0000000000..947ff90b49 --- /dev/null +++ b/Lang/Objective-C/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Array-concatenation b/Lang/Objective-C/Array-concatenation new file mode 120000 index 0000000000..3f47bf5e64 --- /dev/null +++ b/Lang/Objective-C/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Arrays b/Lang/Objective-C/Arrays new file mode 120000 index 0000000000..bdaf9def7a --- /dev/null +++ b/Lang/Objective-C/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Assertions b/Lang/Objective-C/Assertions new file mode 120000 index 0000000000..02ee6dccfc --- /dev/null +++ b/Lang/Objective-C/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Associative-array-Creation b/Lang/Objective-C/Associative-array-Creation new file mode 120000 index 0000000000..486ebcf479 --- /dev/null +++ b/Lang/Objective-C/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Associative-array-Iteration b/Lang/Objective-C/Associative-array-Iteration new file mode 120000 index 0000000000..0cfa48678e --- /dev/null +++ b/Lang/Objective-C/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Averages-Mode b/Lang/Objective-C/Averages-Mode new file mode 120000 index 0000000000..33ee706e07 --- /dev/null +++ b/Lang/Objective-C/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Averages-Simple-moving-average b/Lang/Objective-C/Averages-Simple-moving-average new file mode 120000 index 0000000000..12e2b3c0a5 --- /dev/null +++ b/Lang/Objective-C/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Binary-search b/Lang/Objective-C/Binary-search new file mode 120000 index 0000000000..f66424dfcd --- /dev/null +++ b/Lang/Objective-C/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Break-OO-privacy b/Lang/Objective-C/Break-OO-privacy new file mode 120000 index 0000000000..329ac2c04d --- /dev/null +++ b/Lang/Objective-C/Break-OO-privacy @@ -0,0 +1 @@ +../../Task/Break-OO-privacy/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Call-an-object-method b/Lang/Objective-C/Call-an-object-method new file mode 120000 index 0000000000..ea6e12b9db --- /dev/null +++ b/Lang/Objective-C/Call-an-object-method @@ -0,0 +1 @@ +../../Task/Call-an-object-method/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Character-matching b/Lang/Objective-C/Character-matching new file mode 120000 index 0000000000..b8714f4e95 --- /dev/null +++ b/Lang/Objective-C/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Check-that-file-exists b/Lang/Objective-C/Check-that-file-exists new file mode 120000 index 0000000000..8977afdeb7 --- /dev/null +++ b/Lang/Objective-C/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Classes b/Lang/Objective-C/Classes new file mode 120000 index 0000000000..31c52e6a00 --- /dev/null +++ b/Lang/Objective-C/Classes @@ -0,0 +1 @@ +../../Task/Classes/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Collections b/Lang/Objective-C/Collections new file mode 120000 index 0000000000..fbfd1cf36e --- /dev/null +++ b/Lang/Objective-C/Collections @@ -0,0 +1 @@ +../../Task/Collections/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Command-line-arguments b/Lang/Objective-C/Command-line-arguments new file mode 120000 index 0000000000..47cdabd966 --- /dev/null +++ b/Lang/Objective-C/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Count-occurrences-of-a-substring b/Lang/Objective-C/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..61e4c5611b --- /dev/null +++ b/Lang/Objective-C/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Create-a-file b/Lang/Objective-C/Create-a-file new file mode 120000 index 0000000000..934c5d7524 --- /dev/null +++ b/Lang/Objective-C/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Create-a-two-dimensional-array-at-runtime b/Lang/Objective-C/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..14ccf8b690 --- /dev/null +++ b/Lang/Objective-C/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Date-format b/Lang/Objective-C/Date-format new file mode 120000 index 0000000000..8ae69230af --- /dev/null +++ b/Lang/Objective-C/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Day-of-the-week b/Lang/Objective-C/Day-of-the-week new file mode 120000 index 0000000000..e67180b2c3 --- /dev/null +++ b/Lang/Objective-C/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Delegates b/Lang/Objective-C/Delegates new file mode 120000 index 0000000000..b5f68bfffa --- /dev/null +++ b/Lang/Objective-C/Delegates @@ -0,0 +1 @@ +../../Task/Delegates/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Delete-a-file b/Lang/Objective-C/Delete-a-file new file mode 120000 index 0000000000..ca85b6f3d0 --- /dev/null +++ b/Lang/Objective-C/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Determine-if-a-string-is-numeric b/Lang/Objective-C/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..9be3b3b485 --- /dev/null +++ b/Lang/Objective-C/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Distributed-programming b/Lang/Objective-C/Distributed-programming new file mode 120000 index 0000000000..080bb5de2e --- /dev/null +++ b/Lang/Objective-C/Distributed-programming @@ -0,0 +1 @@ +../../Task/Distributed-programming/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Documentation b/Lang/Objective-C/Documentation new file mode 120000 index 0000000000..fec2989ced --- /dev/null +++ b/Lang/Objective-C/Documentation @@ -0,0 +1 @@ +../../Task/Documentation/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Dot-product b/Lang/Objective-C/Dot-product new file mode 120000 index 0000000000..7acf393d04 --- /dev/null +++ b/Lang/Objective-C/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Empty-program b/Lang/Objective-C/Empty-program new file mode 120000 index 0000000000..99e796bc62 --- /dev/null +++ b/Lang/Objective-C/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Ethiopian-multiplication b/Lang/Objective-C/Ethiopian-multiplication new file mode 120000 index 0000000000..4293c289cd --- /dev/null +++ b/Lang/Objective-C/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Exceptions b/Lang/Objective-C/Exceptions new file mode 120000 index 0000000000..0fce14eb1f --- /dev/null +++ b/Lang/Objective-C/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/Objective-C/Exceptions-Catch-an-exception-thrown-in-a-nested-call new file mode 120000 index 0000000000..46348480fd --- /dev/null +++ b/Lang/Objective-C/Exceptions-Catch-an-exception-thrown-in-a-nested-call @@ -0,0 +1 @@ +../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Execute-a-system-command b/Lang/Objective-C/Execute-a-system-command new file mode 120000 index 0000000000..4bea8e6b02 --- /dev/null +++ b/Lang/Objective-C/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Fibonacci-sequence b/Lang/Objective-C/Fibonacci-sequence new file mode 120000 index 0000000000..3aba0fa88c --- /dev/null +++ b/Lang/Objective-C/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/File-IO b/Lang/Objective-C/File-IO new file mode 120000 index 0000000000..9d37d889c2 --- /dev/null +++ b/Lang/Objective-C/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/File-modification-time b/Lang/Objective-C/File-modification-time new file mode 120000 index 0000000000..52c3c3d3a3 --- /dev/null +++ b/Lang/Objective-C/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/File-size b/Lang/Objective-C/File-size new file mode 120000 index 0000000000..641101c58f --- /dev/null +++ b/Lang/Objective-C/File-size @@ -0,0 +1 @@ +../../Task/File-size/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Filter b/Lang/Objective-C/Filter new file mode 120000 index 0000000000..5d300083c9 --- /dev/null +++ b/Lang/Objective-C/Filter @@ -0,0 +1 @@ +../../Task/Filter/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/FizzBuzz b/Lang/Objective-C/FizzBuzz new file mode 120000 index 0000000000..bc4262c62e --- /dev/null +++ b/Lang/Objective-C/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Flatten-a-list b/Lang/Objective-C/Flatten-a-list new file mode 120000 index 0000000000..4ce64e102f --- /dev/null +++ b/Lang/Objective-C/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Formatted-numeric-output b/Lang/Objective-C/Formatted-numeric-output new file mode 120000 index 0000000000..34b4bfbbf1 --- /dev/null +++ b/Lang/Objective-C/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Function-composition b/Lang/Objective-C/Function-composition new file mode 120000 index 0000000000..94bcbf81eb --- /dev/null +++ b/Lang/Objective-C/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Greatest-element-of-a-list b/Lang/Objective-C/Greatest-element-of-a-list new file mode 120000 index 0000000000..6676dfdc7d --- /dev/null +++ b/Lang/Objective-C/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Guess-the-number-With-feedback-player b/Lang/Objective-C/Guess-the-number-With-feedback-player new file mode 120000 index 0000000000..3ca0814c0e --- /dev/null +++ b/Lang/Objective-C/Guess-the-number-With-feedback-player @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback-player/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/HTTP b/Lang/Objective-C/HTTP new file mode 120000 index 0000000000..0b08dcff04 --- /dev/null +++ b/Lang/Objective-C/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Hash-from-two-arrays b/Lang/Objective-C/Hash-from-two-arrays new file mode 120000 index 0000000000..a2a208e187 --- /dev/null +++ b/Lang/Objective-C/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Hello-world-Graphical b/Lang/Objective-C/Hello-world-Graphical new file mode 120000 index 0000000000..93c3781205 --- /dev/null +++ b/Lang/Objective-C/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Hello-world-Standard-error b/Lang/Objective-C/Hello-world-Standard-error new file mode 120000 index 0000000000..9ad431386b --- /dev/null +++ b/Lang/Objective-C/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Hello-world-Text b/Lang/Objective-C/Hello-world-Text new file mode 120000 index 0000000000..bfd1deb576 --- /dev/null +++ b/Lang/Objective-C/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Horners-rule-for-polynomial-evaluation b/Lang/Objective-C/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..e079b40164 --- /dev/null +++ b/Lang/Objective-C/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Host-introspection b/Lang/Objective-C/Host-introspection new file mode 120000 index 0000000000..14eaf31c9d --- /dev/null +++ b/Lang/Objective-C/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Hostname b/Lang/Objective-C/Hostname new file mode 120000 index 0000000000..846632815a --- /dev/null +++ b/Lang/Objective-C/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Huffman-coding b/Lang/Objective-C/Huffman-coding new file mode 120000 index 0000000000..9e34101132 --- /dev/null +++ b/Lang/Objective-C/Huffman-coding @@ -0,0 +1 @@ +../../Task/Huffman-coding/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Increment-a-numerical-string b/Lang/Objective-C/Increment-a-numerical-string new file mode 120000 index 0000000000..07320ec1f1 --- /dev/null +++ b/Lang/Objective-C/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Inheritance-Multiple b/Lang/Objective-C/Inheritance-Multiple new file mode 120000 index 0000000000..07b847a222 --- /dev/null +++ b/Lang/Objective-C/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Inheritance-Single b/Lang/Objective-C/Inheritance-Single new file mode 120000 index 0000000000..2ec3b19cd8 --- /dev/null +++ b/Lang/Objective-C/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/JSON b/Lang/Objective-C/JSON new file mode 120000 index 0000000000..bc96aaf188 --- /dev/null +++ b/Lang/Objective-C/JSON @@ -0,0 +1 @@ +../../Task/JSON/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Knuths-algorithm-S b/Lang/Objective-C/Knuths-algorithm-S new file mode 120000 index 0000000000..f182e9bd40 --- /dev/null +++ b/Lang/Objective-C/Knuths-algorithm-S @@ -0,0 +1 @@ +../../Task/Knuths-algorithm-S/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/LZW-compression b/Lang/Objective-C/LZW-compression new file mode 120000 index 0000000000..33e8ca572a --- /dev/null +++ b/Lang/Objective-C/LZW-compression @@ -0,0 +1 @@ +../../Task/LZW-compression/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Letter-frequency b/Lang/Objective-C/Letter-frequency new file mode 120000 index 0000000000..2b30598ebe --- /dev/null +++ b/Lang/Objective-C/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Levenshtein-distance b/Lang/Objective-C/Levenshtein-distance new file mode 120000 index 0000000000..71b03cf0cd --- /dev/null +++ b/Lang/Objective-C/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Literals-String b/Lang/Objective-C/Literals-String new file mode 120000 index 0000000000..962cf5dec3 --- /dev/null +++ b/Lang/Objective-C/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Loops-Foreach b/Lang/Objective-C/Loops-Foreach new file mode 120000 index 0000000000..146069954d --- /dev/null +++ b/Lang/Objective-C/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Luhn-test-of-credit-card-numbers b/Lang/Objective-C/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..87d044e2ce --- /dev/null +++ b/Lang/Objective-C/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/MD5 b/Lang/Objective-C/MD5 new file mode 120000 index 0000000000..a41558db20 --- /dev/null +++ b/Lang/Objective-C/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Man-or-boy-test b/Lang/Objective-C/Man-or-boy-test new file mode 120000 index 0000000000..b5cde4704b --- /dev/null +++ b/Lang/Objective-C/Man-or-boy-test @@ -0,0 +1 @@ +../../Task/Man-or-boy-test/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Mutex b/Lang/Objective-C/Mutex new file mode 120000 index 0000000000..543a721133 --- /dev/null +++ b/Lang/Objective-C/Mutex @@ -0,0 +1 @@ +../../Task/Mutex/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Mutual-recursion b/Lang/Objective-C/Mutual-recursion new file mode 120000 index 0000000000..7ee796ec3c --- /dev/null +++ b/Lang/Objective-C/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Objective-C \ No newline at end of file diff --git a/Lang/Objective-C/Search-a-list b/Lang/Objective-C/Search-a-list new file mode 120000 index 0000000000..d9919fa73c --- /dev/null +++ b/Lang/Objective-C/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Objective-C \ No newline at end of file diff --git a/Lang/Occam/0DESCRIPTION b/Lang/Occam/0DESCRIPTION new file mode 100644 index 0000000000..fbc04eba82 --- /dev/null +++ b/Lang/Occam/0DESCRIPTION @@ -0,0 +1,8 @@ +{{language|Occam +}} + + +occam is a concurrent programming language that builds on the Communicating Sequential Processes ([[CSP]]) process algebra, and shares many of its features. It is named after William of Ockham of Occam's Razor fame. + +==See Also== +*[[wp:Occam_(programming_language)|Wikipedia:Occam Programming Language]] \ No newline at end of file diff --git a/Lang/Occam/Hello-world-Text b/Lang/Occam/Hello-world-Text new file mode 120000 index 0000000000..b71d5c2ef5 --- /dev/null +++ b/Lang/Occam/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Occam \ No newline at end of file diff --git a/Lang/Occam/Loops-Infinite b/Lang/Occam/Loops-Infinite new file mode 120000 index 0000000000..4aab5c728f --- /dev/null +++ b/Lang/Occam/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Occam \ No newline at end of file diff --git a/Lang/Octave/0DESCRIPTION b/Lang/Octave/0DESCRIPTION new file mode 100644 index 0000000000..e2943995b8 --- /dev/null +++ b/Lang/Octave/0DESCRIPTION @@ -0,0 +1,6 @@ +{{stub}} +{{language|Octave +|site=http://www.gnu.org/software/octave/}} +[http://www.gnu.org/software/octave/ GNU Octave] is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with [[MATLAB]]. (Text taken from the site) + +* [http://octave.sourceforge.net/ Octave-Forge]: Octave-Forge is a central location for the collaborative development of packages for [http://www.gnu.org/software/octave/ GNU Octave]. \ No newline at end of file diff --git a/Lang/Octave/100-doors b/Lang/Octave/100-doors new file mode 120000 index 0000000000..5db68d7508 --- /dev/null +++ b/Lang/Octave/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Octave \ No newline at end of file diff --git a/Lang/Octave/99-Bottles-of-Beer b/Lang/Octave/99-Bottles-of-Beer new file mode 120000 index 0000000000..88a0748935 --- /dev/null +++ b/Lang/Octave/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Octave \ No newline at end of file diff --git a/Lang/Octave/Accumulator-factory b/Lang/Octave/Accumulator-factory new file mode 120000 index 0000000000..02f99593bc --- /dev/null +++ b/Lang/Octave/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Octave \ No newline at end of file diff --git a/Lang/Octave/Ackermann-function b/Lang/Octave/Ackermann-function new file mode 120000 index 0000000000..18e41c511e --- /dev/null +++ b/Lang/Octave/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Octave \ No newline at end of file diff --git a/Lang/Octave/Add-a-variable-to-a-class-instance-at-runtime b/Lang/Octave/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..d833ee91ae --- /dev/null +++ b/Lang/Octave/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/Octave \ No newline at end of file diff --git a/Lang/Octave/Apply-a-callback-to-an-array b/Lang/Octave/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..6d7a9fe855 --- /dev/null +++ b/Lang/Octave/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Octave \ No newline at end of file diff --git a/Lang/Octave/Arithmetic-Complex b/Lang/Octave/Arithmetic-Complex new file mode 120000 index 0000000000..e3ff1f309f --- /dev/null +++ b/Lang/Octave/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Octave \ No newline at end of file diff --git a/Lang/Octave/Averages-Arithmetic-mean b/Lang/Octave/Averages-Arithmetic-mean new file mode 120000 index 0000000000..0ac72d98a5 --- /dev/null +++ b/Lang/Octave/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Octave \ No newline at end of file diff --git a/Lang/Octave/Averages-Median b/Lang/Octave/Averages-Median new file mode 120000 index 0000000000..2b5cbed0ed --- /dev/null +++ b/Lang/Octave/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Octave \ No newline at end of file diff --git a/Lang/Octave/Averages-Mode b/Lang/Octave/Averages-Mode new file mode 120000 index 0000000000..102579bc2a --- /dev/null +++ b/Lang/Octave/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/Octave \ No newline at end of file diff --git a/Lang/Octave/Averages-Pythagorean-means b/Lang/Octave/Averages-Pythagorean-means new file mode 120000 index 0000000000..edd6f6f02e --- /dev/null +++ b/Lang/Octave/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Octave \ No newline at end of file diff --git a/Lang/Octave/Binary-search b/Lang/Octave/Binary-search new file mode 120000 index 0000000000..b9e7616ce9 --- /dev/null +++ b/Lang/Octave/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Octave \ No newline at end of file diff --git a/Lang/Octave/Bitmap b/Lang/Octave/Bitmap new file mode 120000 index 0000000000..92deca4b54 --- /dev/null +++ b/Lang/Octave/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/Octave \ No newline at end of file diff --git a/Lang/Octave/Bitmap-Histogram b/Lang/Octave/Bitmap-Histogram new file mode 120000 index 0000000000..e36110b528 --- /dev/null +++ b/Lang/Octave/Bitmap-Histogram @@ -0,0 +1 @@ +../../Task/Bitmap-Histogram/Octave \ No newline at end of file diff --git a/Lang/Octave/Bitwise-operations b/Lang/Octave/Bitwise-operations new file mode 120000 index 0000000000..79216b935a --- /dev/null +++ b/Lang/Octave/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Octave \ No newline at end of file diff --git a/Lang/Octave/Combinations b/Lang/Octave/Combinations new file mode 120000 index 0000000000..d22efac2fa --- /dev/null +++ b/Lang/Octave/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Octave \ No newline at end of file diff --git a/Lang/Octave/Comments b/Lang/Octave/Comments new file mode 120000 index 0000000000..d16baf0acc --- /dev/null +++ b/Lang/Octave/Comments @@ -0,0 +1 @@ +../../Task/Comments/Octave \ No newline at end of file diff --git a/Lang/Octave/Conditional-structures b/Lang/Octave/Conditional-structures new file mode 120000 index 0000000000..cb6a43d899 --- /dev/null +++ b/Lang/Octave/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Octave \ No newline at end of file diff --git a/Lang/Octave/Count-in-factors b/Lang/Octave/Count-in-factors new file mode 120000 index 0000000000..786fe9d701 --- /dev/null +++ b/Lang/Octave/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/Octave \ No newline at end of file diff --git a/Lang/Octave/Detect-division-by-zero b/Lang/Octave/Detect-division-by-zero new file mode 120000 index 0000000000..f447025c9d --- /dev/null +++ b/Lang/Octave/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Octave \ No newline at end of file diff --git a/Lang/Octave/Determine-if-a-string-is-numeric b/Lang/Octave/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..8b2604ad85 --- /dev/null +++ b/Lang/Octave/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Octave \ No newline at end of file diff --git a/Lang/Octave/Dot-product b/Lang/Octave/Dot-product new file mode 120000 index 0000000000..e0c1e0f268 --- /dev/null +++ b/Lang/Octave/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Octave \ No newline at end of file diff --git a/Lang/Octave/Dynamic-variable-names b/Lang/Octave/Dynamic-variable-names new file mode 120000 index 0000000000..e6182e19e2 --- /dev/null +++ b/Lang/Octave/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/Octave \ No newline at end of file diff --git a/Lang/Octave/Ethiopian-multiplication b/Lang/Octave/Ethiopian-multiplication new file mode 120000 index 0000000000..0d59ec11a6 --- /dev/null +++ b/Lang/Octave/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Octave \ No newline at end of file diff --git a/Lang/Octave/Evolutionary-algorithm b/Lang/Octave/Evolutionary-algorithm new file mode 120000 index 0000000000..3655325d9b --- /dev/null +++ b/Lang/Octave/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/Octave \ No newline at end of file diff --git a/Lang/Octave/Execute-a-system-command b/Lang/Octave/Execute-a-system-command new file mode 120000 index 0000000000..49176170fb --- /dev/null +++ b/Lang/Octave/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Octave \ No newline at end of file diff --git a/Lang/Octave/Factorial b/Lang/Octave/Factorial new file mode 120000 index 0000000000..44ed400f5a --- /dev/null +++ b/Lang/Octave/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Octave \ No newline at end of file diff --git a/Lang/Octave/Factors-of-a-Mersenne-number b/Lang/Octave/Factors-of-a-Mersenne-number new file mode 120000 index 0000000000..37efa80a12 --- /dev/null +++ b/Lang/Octave/Factors-of-a-Mersenne-number @@ -0,0 +1 @@ +../../Task/Factors-of-a-Mersenne-number/Octave \ No newline at end of file diff --git a/Lang/Octave/Fibonacci-sequence b/Lang/Octave/Fibonacci-sequence new file mode 120000 index 0000000000..1ea6637644 --- /dev/null +++ b/Lang/Octave/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Octave \ No newline at end of file diff --git a/Lang/Octave/Filter b/Lang/Octave/Filter new file mode 120000 index 0000000000..6f18b020d3 --- /dev/null +++ b/Lang/Octave/Filter @@ -0,0 +1 @@ +../../Task/Filter/Octave \ No newline at end of file diff --git a/Lang/Octave/First-class-functions b/Lang/Octave/First-class-functions new file mode 120000 index 0000000000..33d9f16dcf --- /dev/null +++ b/Lang/Octave/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/Octave \ No newline at end of file diff --git a/Lang/Octave/FizzBuzz b/Lang/Octave/FizzBuzz new file mode 120000 index 0000000000..4ba8ede79e --- /dev/null +++ b/Lang/Octave/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Octave \ No newline at end of file diff --git a/Lang/Octave/Function-composition b/Lang/Octave/Function-composition new file mode 120000 index 0000000000..6a90b5f1e3 --- /dev/null +++ b/Lang/Octave/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Octave \ No newline at end of file diff --git a/Lang/Octave/Function-definition b/Lang/Octave/Function-definition new file mode 120000 index 0000000000..070690c64d --- /dev/null +++ b/Lang/Octave/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Octave \ No newline at end of file diff --git a/Lang/Octave/Gamma-function b/Lang/Octave/Gamma-function new file mode 120000 index 0000000000..2fef82561d --- /dev/null +++ b/Lang/Octave/Gamma-function @@ -0,0 +1 @@ +../../Task/Gamma-function/Octave \ No newline at end of file diff --git a/Lang/Octave/Grayscale-image b/Lang/Octave/Grayscale-image new file mode 120000 index 0000000000..5ee857e0e4 --- /dev/null +++ b/Lang/Octave/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/Octave \ No newline at end of file diff --git a/Lang/Octave/Greatest-common-divisor b/Lang/Octave/Greatest-common-divisor new file mode 120000 index 0000000000..28266f5cc1 --- /dev/null +++ b/Lang/Octave/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Octave \ No newline at end of file diff --git a/Lang/Octave/Greatest-element-of-a-list b/Lang/Octave/Greatest-element-of-a-list new file mode 120000 index 0000000000..8083f1cd78 --- /dev/null +++ b/Lang/Octave/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Octave \ No newline at end of file diff --git a/Lang/Octave/Hello-world-Standard-error b/Lang/Octave/Hello-world-Standard-error new file mode 120000 index 0000000000..79955c987b --- /dev/null +++ b/Lang/Octave/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Octave \ No newline at end of file diff --git a/Lang/Octave/Hello-world-Text b/Lang/Octave/Hello-world-Text new file mode 120000 index 0000000000..6a91674dfd --- /dev/null +++ b/Lang/Octave/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Octave \ No newline at end of file diff --git a/Lang/Octave/Higher-order-functions b/Lang/Octave/Higher-order-functions new file mode 120000 index 0000000000..39982aa5fa --- /dev/null +++ b/Lang/Octave/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Octave \ No newline at end of file diff --git a/Lang/Octave/Horizontal-sundial-calculations b/Lang/Octave/Horizontal-sundial-calculations new file mode 120000 index 0000000000..5aa4316088 --- /dev/null +++ b/Lang/Octave/Horizontal-sundial-calculations @@ -0,0 +1 @@ +../../Task/Horizontal-sundial-calculations/Octave \ No newline at end of file diff --git a/Lang/Octave/Horners-rule-for-polynomial-evaluation b/Lang/Octave/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..bc3bcdc985 --- /dev/null +++ b/Lang/Octave/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Octave \ No newline at end of file diff --git a/Lang/Octave/Hostname b/Lang/Octave/Hostname new file mode 120000 index 0000000000..8af7c3faa9 --- /dev/null +++ b/Lang/Octave/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Octave \ No newline at end of file diff --git a/Lang/Octave/Identity-matrix b/Lang/Octave/Identity-matrix new file mode 120000 index 0000000000..6416e444fb --- /dev/null +++ b/Lang/Octave/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/Octave \ No newline at end of file diff --git a/Lang/Octave/Image-convolution b/Lang/Octave/Image-convolution new file mode 120000 index 0000000000..5f13d5485a --- /dev/null +++ b/Lang/Octave/Image-convolution @@ -0,0 +1 @@ +../../Task/Image-convolution/Octave \ No newline at end of file diff --git a/Lang/Octave/Increment-a-numerical-string b/Lang/Octave/Increment-a-numerical-string new file mode 120000 index 0000000000..e03fc688a6 --- /dev/null +++ b/Lang/Octave/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Octave \ No newline at end of file diff --git a/Lang/Octave/Integer-comparison b/Lang/Octave/Integer-comparison new file mode 120000 index 0000000000..8d7228294f --- /dev/null +++ b/Lang/Octave/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Octave \ No newline at end of file diff --git a/Lang/Octave/Interactive-programming b/Lang/Octave/Interactive-programming new file mode 120000 index 0000000000..7bb3bcc8f3 --- /dev/null +++ b/Lang/Octave/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Octave \ No newline at end of file diff --git a/Lang/Octave/Literals-String b/Lang/Octave/Literals-String new file mode 120000 index 0000000000..e039bf547b --- /dev/null +++ b/Lang/Octave/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Octave \ No newline at end of file diff --git a/Lang/Octave/Logical-operations b/Lang/Octave/Logical-operations new file mode 120000 index 0000000000..08c617628f --- /dev/null +++ b/Lang/Octave/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-Break b/Lang/Octave/Loops-Break new file mode 120000 index 0000000000..d7615f9b42 --- /dev/null +++ b/Lang/Octave/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-Continue b/Lang/Octave/Loops-Continue new file mode 120000 index 0000000000..ff37ab7192 --- /dev/null +++ b/Lang/Octave/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-Do-while b/Lang/Octave/Loops-Do-while new file mode 120000 index 0000000000..db36c8e3b1 --- /dev/null +++ b/Lang/Octave/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-Downward-for b/Lang/Octave/Loops-Downward-for new file mode 120000 index 0000000000..9beaea5154 --- /dev/null +++ b/Lang/Octave/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-For b/Lang/Octave/Loops-For new file mode 120000 index 0000000000..b3cedb3ca8 --- /dev/null +++ b/Lang/Octave/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-For-with-a-specified-step b/Lang/Octave/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..1a50fae3aa --- /dev/null +++ b/Lang/Octave/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-Foreach b/Lang/Octave/Loops-Foreach new file mode 120000 index 0000000000..7867237f28 --- /dev/null +++ b/Lang/Octave/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-Infinite b/Lang/Octave/Loops-Infinite new file mode 120000 index 0000000000..a2929a7ea5 --- /dev/null +++ b/Lang/Octave/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-Nested b/Lang/Octave/Loops-Nested new file mode 120000 index 0000000000..e83dea9684 --- /dev/null +++ b/Lang/Octave/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/Octave \ No newline at end of file diff --git a/Lang/Octave/Loops-While b/Lang/Octave/Loops-While new file mode 120000 index 0000000000..5385703532 --- /dev/null +++ b/Lang/Octave/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Octave \ No newline at end of file diff --git a/Lang/Octave/Luhn-test-of-credit-card-numbers b/Lang/Octave/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..99902b67d9 --- /dev/null +++ b/Lang/Octave/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Octave \ No newline at end of file diff --git a/Lang/Octave/MD5 b/Lang/Octave/MD5 new file mode 120000 index 0000000000..e1e55d161c --- /dev/null +++ b/Lang/Octave/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Octave \ No newline at end of file diff --git a/Lang/Octave/Mandelbrot-set b/Lang/Octave/Mandelbrot-set new file mode 120000 index 0000000000..7b79a62b94 --- /dev/null +++ b/Lang/Octave/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/Octave \ No newline at end of file diff --git a/Lang/Octave/Matrix-exponentiation-operator b/Lang/Octave/Matrix-exponentiation-operator new file mode 120000 index 0000000000..f6b9bf42c6 --- /dev/null +++ b/Lang/Octave/Matrix-exponentiation-operator @@ -0,0 +1 @@ +../../Task/Matrix-exponentiation-operator/Octave \ No newline at end of file diff --git a/Lang/Octave/Matrix-multiplication b/Lang/Octave/Matrix-multiplication new file mode 120000 index 0000000000..a5446fae15 --- /dev/null +++ b/Lang/Octave/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/Octave \ No newline at end of file diff --git a/Lang/Octave/Matrix-transposition b/Lang/Octave/Matrix-transposition new file mode 120000 index 0000000000..d987db8319 --- /dev/null +++ b/Lang/Octave/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Octave \ No newline at end of file diff --git a/Lang/Octave/Monte-Carlo-methods b/Lang/Octave/Monte-Carlo-methods new file mode 120000 index 0000000000..c51feb0779 --- /dev/null +++ b/Lang/Octave/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/Octave \ No newline at end of file diff --git a/Lang/Octave/Mouse-position b/Lang/Octave/Mouse-position new file mode 120000 index 0000000000..504506b082 --- /dev/null +++ b/Lang/Octave/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/Octave \ No newline at end of file diff --git a/Lang/Octave/Mutual-recursion b/Lang/Octave/Mutual-recursion new file mode 120000 index 0000000000..ce1f219b73 --- /dev/null +++ b/Lang/Octave/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Octave \ No newline at end of file diff --git a/Lang/Omega/0DESCRIPTION b/Lang/Omega/0DESCRIPTION new file mode 100644 index 0000000000..125dbbf048 --- /dev/null +++ b/Lang/Omega/0DESCRIPTION @@ -0,0 +1,8 @@ +{{stub}} +{{language}} + +There are at least two programming languages called Omega! + +[http://www.pervasive.jku.at/About_Us/Staff/Blaschek/Omega/_Report/Introduction.html Omega] is a prototype-based programming language created by Günther Blaschek in the spirit of Smalltalk. It does not have classes in the sense of Smalltalk and C++, but prototypes as in Javascript, Self, Slate and Io. + +[http://code.google.com/p/omega/ Omega]is a cross between a purely functional programming language and a theorem prover, conceived and implemented by Tim Sheard and his students. The syntax is borrowed from Haskell and has been moderately extended. \ No newline at end of file diff --git a/Lang/Onyx/0DESCRIPTION b/Lang/Onyx/0DESCRIPTION new file mode 100644 index 0000000000..df5ce1d78f --- /dev/null +++ b/Lang/Onyx/0DESCRIPTION @@ -0,0 +1,14 @@ +{{stub}} +{{language| +|site=http://www.canonware.com/onyx/ +|gc=yes +}} + +Onyx is a powerful stack-based, multi-threaded, interpreted, general purpose programming language similar to PostScript. It can be embedded as an extension language similarly to [[ficl]] ([[Forth]]), [[guile]] ([[scheme]]), [[librep]] ([[lisp]] dialect), [[s-lang]], [[Lua]], and [[Tcl]]. + +Onyx is perhaps the most advanced stack-based general purpose programming language in existence +It has the following distinguishing features: +* Double-ended stacks are first class objects +* Perl-compatible regular expressions. +* Loadable module system. +* Object-oriented programming (OOP) support similar to that of [[Objective-C]] \ No newline at end of file diff --git a/Lang/Onyx/Hello-world-Text b/Lang/Onyx/Hello-world-Text new file mode 120000 index 0000000000..0c4abdc707 --- /dev/null +++ b/Lang/Onyx/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Onyx \ No newline at end of file diff --git a/Lang/OoRexx/0DESCRIPTION b/Lang/OoRexx/0DESCRIPTION new file mode 100644 index 0000000000..ef236b80eb --- /dev/null +++ b/Lang/OoRexx/0DESCRIPTION @@ -0,0 +1,8 @@ +{{DISPLAYTITLE: Category:ooREXX}}{{stub}}{{language}}{{implementation|REXX}} +ooRexx (aka Open Object Rexx) is an object oriented successor of 'Classic' Rexx +(another one is NetRexx). Both Open Object Rexx and NetRexx were created by IBM and are now, +open sourced, maintained by the Rexx Language Association. +ooRexx can be used to run many programs shown here in the [[REXX]] category. + +See http://rosettacode.org/wiki/Rosetta_Code:Village_Pump/Dialects#REXX.2C_ooRexx.2C_and_others +for differences. \ No newline at end of file diff --git a/Lang/Opa/0DESCRIPTION b/Lang/Opa/0DESCRIPTION new file mode 100644 index 0000000000..55eed544fb --- /dev/null +++ b/Lang/Opa/0DESCRIPTION @@ -0,0 +1,4 @@ +{{stub}}{{language|Opa +|site=http://opalang.org/ +}} +Opa is an open source, simple and unified platform for writing web applications. \ No newline at end of file diff --git a/Lang/Opa/Hello-world-Web-server b/Lang/Opa/Hello-world-Web-server new file mode 120000 index 0000000000..5a6bb2ec46 --- /dev/null +++ b/Lang/Opa/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/Opa \ No newline at end of file diff --git a/Lang/OpenC++/0DESCRIPTION b/Lang/OpenC++/0DESCRIPTION new file mode 100644 index 0000000000..2dd83177ea --- /dev/null +++ b/Lang/OpenC++/0DESCRIPTION @@ -0,0 +1,11 @@ +{{stub}} +{{language|OpenC++ +|site=http://opencxx.sourceforge.net/ +}} + +OpenC++ is a version of [[C++]] with a Metaobject Protocol. In other words, it is a tool of source-code translation for [[C++]]. Programmers can easily implement various kinds of translation so that they can define new syntax, new annotation, and new object behavior. + +==See Also== +*[http://www.csg.is.titech.ac.jp/~chiba/openc++.html Chiba's OpenC++ Page] +*[[wp:OpenC%2B%2B|Wikipedia: OpenC++]] +*[http://www.codeproject.com/KB/library/opencxx.aspx OpenC++ - A C++ Metacompiler and Introspection Library at The Code Project] \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/0DESCRIPTION b/Lang/OpenEdge-Progress/0DESCRIPTION new file mode 100644 index 0000000000..3b1b1c383b --- /dev/null +++ b/Lang/OpenEdge-Progress/0DESCRIPTION @@ -0,0 +1,3 @@ +{{language|OpenEdge/Progress}} + +OpenEdge is the Progress 4GL with classes. It is a commercial business application oriented language by [http://www.progress.com Progress]. \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/100-doors b/Lang/OpenEdge-Progress/100-doors new file mode 120000 index 0000000000..74798a5a21 --- /dev/null +++ b/Lang/OpenEdge-Progress/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/24-game b/Lang/OpenEdge-Progress/24-game new file mode 120000 index 0000000000..8cb8efb302 --- /dev/null +++ b/Lang/OpenEdge-Progress/24-game @@ -0,0 +1 @@ +../../Task/24-game/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/99-Bottles-of-Beer b/Lang/OpenEdge-Progress/99-Bottles-of-Beer new file mode 120000 index 0000000000..c1b685c2f0 --- /dev/null +++ b/Lang/OpenEdge-Progress/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/A+B b/Lang/OpenEdge-Progress/A+B new file mode 120000 index 0000000000..dcb5cb39d3 --- /dev/null +++ b/Lang/OpenEdge-Progress/A+B @@ -0,0 +1 @@ +../../Task/A+B/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Align-columns b/Lang/OpenEdge-Progress/Align-columns new file mode 120000 index 0000000000..f8bb1c0129 --- /dev/null +++ b/Lang/OpenEdge-Progress/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/CSV-to-HTML-translation b/Lang/OpenEdge-Progress/CSV-to-HTML-translation new file mode 120000 index 0000000000..a418e4a0ad --- /dev/null +++ b/Lang/OpenEdge-Progress/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Character-codes b/Lang/OpenEdge-Progress/Character-codes new file mode 120000 index 0000000000..7277cda0ee --- /dev/null +++ b/Lang/OpenEdge-Progress/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Compound-data-type b/Lang/OpenEdge-Progress/Compound-data-type new file mode 120000 index 0000000000..05f13cf00c --- /dev/null +++ b/Lang/OpenEdge-Progress/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Empty-string b/Lang/OpenEdge-Progress/Empty-string new file mode 120000 index 0000000000..eb6140e54f --- /dev/null +++ b/Lang/OpenEdge-Progress/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/File-IO b/Lang/OpenEdge-Progress/File-IO new file mode 120000 index 0000000000..cc32274cf0 --- /dev/null +++ b/Lang/OpenEdge-Progress/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/File-modification-time b/Lang/OpenEdge-Progress/File-modification-time new file mode 120000 index 0000000000..d13ea0d8d2 --- /dev/null +++ b/Lang/OpenEdge-Progress/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Find-common-directory-path b/Lang/OpenEdge-Progress/Find-common-directory-path new file mode 120000 index 0000000000..798c93e40c --- /dev/null +++ b/Lang/OpenEdge-Progress/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Formatted-numeric-output b/Lang/OpenEdge-Progress/Formatted-numeric-output new file mode 120000 index 0000000000..84a2f023f2 --- /dev/null +++ b/Lang/OpenEdge-Progress/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Globally-replace-text-in-several-files b/Lang/OpenEdge-Progress/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..8d864dca44 --- /dev/null +++ b/Lang/OpenEdge-Progress/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Hello-world-Graphical b/Lang/OpenEdge-Progress/Hello-world-Graphical new file mode 120000 index 0000000000..05570aa730 --- /dev/null +++ b/Lang/OpenEdge-Progress/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Hello-world-Line-printer b/Lang/OpenEdge-Progress/Hello-world-Line-printer new file mode 120000 index 0000000000..2226f35c33 --- /dev/null +++ b/Lang/OpenEdge-Progress/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Include-a-file b/Lang/OpenEdge-Progress/Include-a-file new file mode 120000 index 0000000000..0cd0eba838 --- /dev/null +++ b/Lang/OpenEdge-Progress/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Increment-a-numerical-string b/Lang/OpenEdge-Progress/Increment-a-numerical-string new file mode 120000 index 0000000000..8d62cac6e6 --- /dev/null +++ b/Lang/OpenEdge-Progress/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Infinity b/Lang/OpenEdge-Progress/Infinity new file mode 120000 index 0000000000..78eb321f73 --- /dev/null +++ b/Lang/OpenEdge-Progress/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Integer-sequence b/Lang/OpenEdge-Progress/Integer-sequence new file mode 120000 index 0000000000..efa496d518 --- /dev/null +++ b/Lang/OpenEdge-Progress/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/JSON b/Lang/OpenEdge-Progress/JSON new file mode 120000 index 0000000000..e27dd90969 --- /dev/null +++ b/Lang/OpenEdge-Progress/JSON @@ -0,0 +1 @@ +../../Task/JSON/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/OpenEdge-Progress/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..00b9a0bc8e --- /dev/null +++ b/Lang/OpenEdge-Progress/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Last-letter-first-letter b/Lang/OpenEdge-Progress/Last-letter-first-letter new file mode 120000 index 0000000000..bbe2f6c67f --- /dev/null +++ b/Lang/OpenEdge-Progress/Last-letter-first-letter @@ -0,0 +1 @@ +../../Task/Last-letter-first-letter/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Leap-year b/Lang/OpenEdge-Progress/Leap-year new file mode 120000 index 0000000000..b46605c388 --- /dev/null +++ b/Lang/OpenEdge-Progress/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Logical-operations b/Lang/OpenEdge-Progress/Logical-operations new file mode 120000 index 0000000000..e396438369 --- /dev/null +++ b/Lang/OpenEdge-Progress/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/MD5 b/Lang/OpenEdge-Progress/MD5 new file mode 120000 index 0000000000..86de96d33a --- /dev/null +++ b/Lang/OpenEdge-Progress/MD5 @@ -0,0 +1 @@ +../../Task/MD5/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/OpenEdge-Progress/Menu b/Lang/OpenEdge-Progress/Menu new file mode 120000 index 0000000000..cef2092e6a --- /dev/null +++ b/Lang/OpenEdge-Progress/Menu @@ -0,0 +1 @@ +../../Task/Menu/OpenEdge-Progress \ No newline at end of file diff --git a/Lang/Openscad/0DESCRIPTION b/Lang/Openscad/0DESCRIPTION new file mode 100644 index 0000000000..6a69b7b46d --- /dev/null +++ b/Lang/Openscad/0DESCRIPTION @@ -0,0 +1,5 @@ +{{stub}}{{language}} + +The openscad language is the scripting language used by the openscad geometry compiler. + +[[Category:Constructive Solid Geometry]] \ No newline at end of file diff --git a/Lang/Openscad/A+B b/Lang/Openscad/A+B new file mode 120000 index 0000000000..459cbd5c48 --- /dev/null +++ b/Lang/Openscad/A+B @@ -0,0 +1 @@ +../../Task/A+B/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Arithmetic-Integer b/Lang/Openscad/Arithmetic-Integer new file mode 120000 index 0000000000..013f63250d --- /dev/null +++ b/Lang/Openscad/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Comments b/Lang/Openscad/Comments new file mode 120000 index 0000000000..0720fc5bda --- /dev/null +++ b/Lang/Openscad/Comments @@ -0,0 +1 @@ +../../Task/Comments/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Death-Star b/Lang/Openscad/Death-Star new file mode 120000 index 0000000000..bf9791d300 --- /dev/null +++ b/Lang/Openscad/Death-Star @@ -0,0 +1 @@ +../../Task/Death-Star/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Draw-a-cuboid b/Lang/Openscad/Draw-a-cuboid new file mode 120000 index 0000000000..24dc4742bd --- /dev/null +++ b/Lang/Openscad/Draw-a-cuboid @@ -0,0 +1 @@ +../../Task/Draw-a-cuboid/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Draw-a-sphere b/Lang/Openscad/Draw-a-sphere new file mode 120000 index 0000000000..cade88016d --- /dev/null +++ b/Lang/Openscad/Draw-a-sphere @@ -0,0 +1 @@ +../../Task/Draw-a-sphere/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Hello-world-Text b/Lang/Openscad/Hello-world-Text new file mode 120000 index 0000000000..236caf16f2 --- /dev/null +++ b/Lang/Openscad/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Include-a-file b/Lang/Openscad/Include-a-file new file mode 120000 index 0000000000..25fc108927 --- /dev/null +++ b/Lang/Openscad/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/Openscad \ No newline at end of file diff --git a/Lang/Openscad/Loops-For-with-a-specified-step b/Lang/Openscad/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..bb513fc8da --- /dev/null +++ b/Lang/Openscad/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Openscad \ No newline at end of file diff --git a/Lang/Order/0DESCRIPTION b/Lang/Order/0DESCRIPTION new file mode 100644 index 0000000000..7258365d8c --- /dev/null +++ b/Lang/Order/0DESCRIPTION @@ -0,0 +1,18 @@ +{{language +|exec=interpreted +|gc=yes +|safety=unsafe +|checking=dynamic +|parampass=value +|hopl=no}} +{{language programming paradigm|Declarative}} +{{language programming paradigm|functional}} + +'''Order''' is a high-level, functional programming language implemented entirely using the [[C]] preprocessor. It provides a full programming language for [[metaprogramming]] in C (or any other environment where the C preprocessor can be used). A debugging environment and line-by-line evaluator are also included. Rather than building a library of macros to solve specific metaprogramming problems individually, Order-PP implements a continuation-based virtual machine which then interprets the high-level Order language. + +Order is based primarily on lambda calculus, and is vaguely similar in semantics to languages such as ML or [[Scheme]], offering first-class functions with partial application, lexical scope, first-class continuations, arbitrary-precision arithmetic, and built-in operators for compound types. + +Order requires some components from its sister project, Chaos (included in the download), to also be installed, although it is not primarily based on it. Order also requires a standard-conforming [[C99]] preprocessor, and has absolutely no workarounds for non-conformance - currently, only [[GCC]] is confirmed to work with all examples. + +==See Also== +* [http://chaos-pp.cvs.sourceforge.net/viewvc/chaos-pp/?view=tar Official download (Chaos, includes Order)] \ No newline at end of file diff --git a/Lang/Order/99-Bottles-of-Beer b/Lang/Order/99-Bottles-of-Beer new file mode 120000 index 0000000000..169e6ca970 --- /dev/null +++ b/Lang/Order/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Order \ No newline at end of file diff --git a/Lang/Order/Ackermann-function b/Lang/Order/Ackermann-function new file mode 120000 index 0000000000..f33ef97c7d --- /dev/null +++ b/Lang/Order/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Order \ No newline at end of file diff --git a/Lang/Order/Apply-a-callback-to-an-array b/Lang/Order/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..afedea3715 --- /dev/null +++ b/Lang/Order/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Order \ No newline at end of file diff --git a/Lang/Order/Array-concatenation b/Lang/Order/Array-concatenation new file mode 120000 index 0000000000..1640f644d1 --- /dev/null +++ b/Lang/Order/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Order \ No newline at end of file diff --git a/Lang/Order/Factorial b/Lang/Order/Factorial new file mode 120000 index 0000000000..4d46aaea2b --- /dev/null +++ b/Lang/Order/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Order \ No newline at end of file diff --git a/Lang/Order/Fibonacci-sequence b/Lang/Order/Fibonacci-sequence new file mode 120000 index 0000000000..00b8e2659c --- /dev/null +++ b/Lang/Order/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Order \ No newline at end of file diff --git a/Lang/Order/First-class-environments b/Lang/Order/First-class-environments new file mode 120000 index 0000000000..626847bb4e --- /dev/null +++ b/Lang/Order/First-class-environments @@ -0,0 +1 @@ +../../Task/First-class-environments/Order \ No newline at end of file diff --git a/Lang/Order/FizzBuzz b/Lang/Order/FizzBuzz new file mode 120000 index 0000000000..55b3e95106 --- /dev/null +++ b/Lang/Order/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Order \ No newline at end of file diff --git a/Lang/Order/Function-composition b/Lang/Order/Function-composition new file mode 120000 index 0000000000..e330b93b9c --- /dev/null +++ b/Lang/Order/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Order \ No newline at end of file diff --git a/Lang/Order/Greatest-common-divisor b/Lang/Order/Greatest-common-divisor new file mode 120000 index 0000000000..e6aefdc0dd --- /dev/null +++ b/Lang/Order/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Order \ No newline at end of file diff --git a/Lang/Order/Hailstone-sequence b/Lang/Order/Hailstone-sequence new file mode 120000 index 0000000000..c1f6e2298e --- /dev/null +++ b/Lang/Order/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Order \ No newline at end of file diff --git a/Lang/Order/Integer-sequence b/Lang/Order/Integer-sequence new file mode 120000 index 0000000000..ac55cf9937 --- /dev/null +++ b/Lang/Order/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Order \ No newline at end of file diff --git a/Lang/Order/Least-common-multiple b/Lang/Order/Least-common-multiple new file mode 120000 index 0000000000..c14fda836c --- /dev/null +++ b/Lang/Order/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Order \ No newline at end of file diff --git a/Lang/Order/Loops-For b/Lang/Order/Loops-For new file mode 120000 index 0000000000..1d345f21b5 --- /dev/null +++ b/Lang/Order/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Order \ No newline at end of file diff --git a/Lang/Order/Luhn-test-of-credit-card-numbers b/Lang/Order/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..7d49c574e1 --- /dev/null +++ b/Lang/Order/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Order \ No newline at end of file diff --git a/Lang/Order/Mutual-recursion b/Lang/Order/Mutual-recursion new file mode 120000 index 0000000000..43629b3a16 --- /dev/null +++ b/Lang/Order/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Order \ No newline at end of file diff --git a/Lang/OxygenBasic/0DESCRIPTION b/Lang/OxygenBasic/0DESCRIPTION new file mode 100644 index 0000000000..4acccc1237 --- /dev/null +++ b/Lang/OxygenBasic/0DESCRIPTION @@ -0,0 +1,73 @@ +{{language|express=both}} +OxygenBasic is a compilable language in the [[BASIC]] genre supporting [[object-oriented programming]], and containing features of [[C]]. Its earliest origins was as a macro [[Assembly]] code language in 2009, but subsequently acquired all the features of a high-level language. + +The philosophy underlying OxygenBasic is to facilitate clean coding, with low syntax noise and few coding restrictions. The core language and compiler size are kept to a minimum. + +== Examples == +'''Hello World:''' +
+print "Hello World!"
+
+ +'''Iteration:''' +
+i=0
+pr=""
+for i=1 to 10
+  pr+="Line: " i chr(13) chr(10)
+next
+print pr
+
+ +'''Function:''' +
+function cube(double n) as double
+  return d*d*d
+end function
+
+print cube(3)
+
+ +'''Class:''' +
+class MemoryBank
+  '
+  string buf
+  '
+  method store(string s)
+    buf += " " s chr(13)
+  end method
+  '
+  method find(string s) as string
+    sys a,b
+    a=instr buf,s
+    if a then
+      b=instr a,s,chr(13)
+      return mid buf,a,b-a
+    end if
+  end method
+  '
+  method clear()
+    buf=""
+  end method
+  '
+end class
+
+MemoryBank b
+b.store ("
+shoes LC1
+ships LC2
+sealing wax LC3
+cabbages LC4
+kings LC5
+")
+
+print b.find "ships"
+
+ +== Current Status == +The current implementation is available for Microsoft Windows and includes an x86 assembler. It can compile directly to memory, or to 32 bit and 64 bit binaries. Development is currently in Alpha phase. The compiler is a single DLL, and suitable for embedding in other Applications. It has been deployed as a module in thinBasic to support Assembly code and dynamic compiling. + +The latest versions can be obtained here, including an IDE and numerous examples: + +* http://www.oxygenbasic.org \ No newline at end of file diff --git a/Lang/OxygenBasic/Active-object b/Lang/OxygenBasic/Active-object new file mode 120000 index 0000000000..7230877943 --- /dev/null +++ b/Lang/OxygenBasic/Active-object @@ -0,0 +1 @@ +../../Task/Active-object/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Add-a-variable-to-a-class-instance-at-runtime b/Lang/OxygenBasic/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..5e827e6d4b --- /dev/null +++ b/Lang/OxygenBasic/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Anonymous-recursion b/Lang/OxygenBasic/Anonymous-recursion new file mode 120000 index 0000000000..51b1dc538f --- /dev/null +++ b/Lang/OxygenBasic/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Arena-storage-pool b/Lang/OxygenBasic/Arena-storage-pool new file mode 120000 index 0000000000..bfe712720f --- /dev/null +++ b/Lang/OxygenBasic/Arena-storage-pool @@ -0,0 +1 @@ +../../Task/Arena-storage-pool/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Arithmetic-Complex b/Lang/OxygenBasic/Arithmetic-Complex new file mode 120000 index 0000000000..d9023be37e --- /dev/null +++ b/Lang/OxygenBasic/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Array-concatenation b/Lang/OxygenBasic/Array-concatenation new file mode 120000 index 0000000000..884975cc1b --- /dev/null +++ b/Lang/OxygenBasic/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Arrays b/Lang/OxygenBasic/Arrays new file mode 120000 index 0000000000..124fc70088 --- /dev/null +++ b/Lang/OxygenBasic/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Associative-array-Creation b/Lang/OxygenBasic/Associative-array-Creation new file mode 120000 index 0000000000..e1b68e31d3 --- /dev/null +++ b/Lang/OxygenBasic/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Averages-Simple-moving-average b/Lang/OxygenBasic/Averages-Simple-moving-average new file mode 120000 index 0000000000..f44eb1f344 --- /dev/null +++ b/Lang/OxygenBasic/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Balanced-brackets b/Lang/OxygenBasic/Balanced-brackets new file mode 120000 index 0000000000..00b0e82b53 --- /dev/null +++ b/Lang/OxygenBasic/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Bitmap b/Lang/OxygenBasic/Bitmap new file mode 120000 index 0000000000..7b76212fcf --- /dev/null +++ b/Lang/OxygenBasic/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Call-a-function-in-a-shared-library b/Lang/OxygenBasic/Call-a-function-in-a-shared-library new file mode 120000 index 0000000000..23545959e5 --- /dev/null +++ b/Lang/OxygenBasic/Call-a-function-in-a-shared-library @@ -0,0 +1 @@ +../../Task/Call-a-function-in-a-shared-library/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Character-matching b/Lang/OxygenBasic/Character-matching new file mode 120000 index 0000000000..6112e773dc --- /dev/null +++ b/Lang/OxygenBasic/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Classes b/Lang/OxygenBasic/Classes new file mode 120000 index 0000000000..2819282951 --- /dev/null +++ b/Lang/OxygenBasic/Classes @@ -0,0 +1 @@ +../../Task/Classes/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Comments b/Lang/OxygenBasic/Comments new file mode 120000 index 0000000000..d7fe5749c2 --- /dev/null +++ b/Lang/OxygenBasic/Comments @@ -0,0 +1 @@ +../../Task/Comments/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Compile-time-calculation b/Lang/OxygenBasic/Compile-time-calculation new file mode 120000 index 0000000000..51afe8c51a --- /dev/null +++ b/Lang/OxygenBasic/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Compound-data-type b/Lang/OxygenBasic/Compound-data-type new file mode 120000 index 0000000000..f815fa67e7 --- /dev/null +++ b/Lang/OxygenBasic/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Conditional-structures b/Lang/OxygenBasic/Conditional-structures new file mode 120000 index 0000000000..99c3a3341c --- /dev/null +++ b/Lang/OxygenBasic/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Constrained-genericity b/Lang/OxygenBasic/Constrained-genericity new file mode 120000 index 0000000000..5cc0da24dc --- /dev/null +++ b/Lang/OxygenBasic/Constrained-genericity @@ -0,0 +1 @@ +../../Task/Constrained-genericity/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Date-format b/Lang/OxygenBasic/Date-format new file mode 120000 index 0000000000..d35cf1badb --- /dev/null +++ b/Lang/OxygenBasic/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Delegates b/Lang/OxygenBasic/Delegates new file mode 120000 index 0000000000..aaaa905009 --- /dev/null +++ b/Lang/OxygenBasic/Delegates @@ -0,0 +1 @@ +../../Task/Delegates/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Dining-philosophers b/Lang/OxygenBasic/Dining-philosophers new file mode 120000 index 0000000000..f7048cc134 --- /dev/null +++ b/Lang/OxygenBasic/Dining-philosophers @@ -0,0 +1 @@ +../../Task/Dining-philosophers/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Empty-program b/Lang/OxygenBasic/Empty-program new file mode 120000 index 0000000000..de65bc3927 --- /dev/null +++ b/Lang/OxygenBasic/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Evolutionary-algorithm b/Lang/OxygenBasic/Evolutionary-algorithm new file mode 120000 index 0000000000..e3b878fb00 --- /dev/null +++ b/Lang/OxygenBasic/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Floyds-triangle b/Lang/OxygenBasic/Floyds-triangle new file mode 120000 index 0000000000..3cb22acb27 --- /dev/null +++ b/Lang/OxygenBasic/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Hailstone-sequence b/Lang/OxygenBasic/Hailstone-sequence new file mode 120000 index 0000000000..d594331289 --- /dev/null +++ b/Lang/OxygenBasic/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Higher-order-functions b/Lang/OxygenBasic/Higher-order-functions new file mode 120000 index 0000000000..0ce5b88741 --- /dev/null +++ b/Lang/OxygenBasic/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/History-variables b/Lang/OxygenBasic/History-variables new file mode 120000 index 0000000000..4caeae5c1a --- /dev/null +++ b/Lang/OxygenBasic/History-variables @@ -0,0 +1 @@ +../../Task/History-variables/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Identity-matrix b/Lang/OxygenBasic/Identity-matrix new file mode 120000 index 0000000000..a6cdbd22a8 --- /dev/null +++ b/Lang/OxygenBasic/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Infinity b/Lang/OxygenBasic/Infinity new file mode 120000 index 0000000000..cbdd69e1dc --- /dev/null +++ b/Lang/OxygenBasic/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Inheritance-Multiple b/Lang/OxygenBasic/Inheritance-Multiple new file mode 120000 index 0000000000..1447494b9e --- /dev/null +++ b/Lang/OxygenBasic/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Inheritance-Single b/Lang/OxygenBasic/Inheritance-Single new file mode 120000 index 0000000000..eec550274f --- /dev/null +++ b/Lang/OxygenBasic/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Inverted-syntax b/Lang/OxygenBasic/Inverted-syntax new file mode 120000 index 0000000000..e56c54e0f3 --- /dev/null +++ b/Lang/OxygenBasic/Inverted-syntax @@ -0,0 +1 @@ +../../Task/Inverted-syntax/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Knapsack-problem-Bounded b/Lang/OxygenBasic/Knapsack-problem-Bounded new file mode 120000 index 0000000000..320fa47708 --- /dev/null +++ b/Lang/OxygenBasic/Knapsack-problem-Bounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Bounded/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Letter-frequency b/Lang/OxygenBasic/Letter-frequency new file mode 120000 index 0000000000..9ce4a7d6f0 --- /dev/null +++ b/Lang/OxygenBasic/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Matrix-multiplication b/Lang/OxygenBasic/Matrix-multiplication new file mode 120000 index 0000000000..0a50748a6c --- /dev/null +++ b/Lang/OxygenBasic/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Matrix-transposition b/Lang/OxygenBasic/Matrix-transposition new file mode 120000 index 0000000000..822fa0521d --- /dev/null +++ b/Lang/OxygenBasic/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/OxygenBasic \ No newline at end of file diff --git a/Lang/OxygenBasic/Quine b/Lang/OxygenBasic/Quine new file mode 120000 index 0000000000..a6e77ccf12 --- /dev/null +++ b/Lang/OxygenBasic/Quine @@ -0,0 +1 @@ +../../Task/Quine/OxygenBasic \ No newline at end of file diff --git a/Lang/Oxygene/0DESCRIPTION b/Lang/Oxygene/0DESCRIPTION new file mode 100644 index 0000000000..4b40439dea --- /dev/null +++ b/Lang/Oxygene/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language}} + +Oxygene is a Next Generation Object Pascal language development environment for creating managed applications for the Common Language Runtime – including Microsoft .NET and Novell's open source Mono framework – and the Java Runtime Environment – including regular Java and Android. + +With Oxygene being written in itself, the compiler runs on Windows, Mac OS X and Linux, giving developers a lot of flexibility in their working environment. It also generates 100% CLI-compliant assemblies for a wide variety of versions of the Common Language Runtime, including, of course, .NET 2.0 through 4.0 and Mono, but also the .NET Compact Framework, Silverlight and MonoTouch, as well as 100% pure JVM .jar files when building for Java or Android. + +see http://www.remobjects.com/oxygene/ \ No newline at end of file diff --git a/Lang/Oxygene/A+B b/Lang/Oxygene/A+B new file mode 120000 index 0000000000..49db82ae62 --- /dev/null +++ b/Lang/Oxygene/A+B @@ -0,0 +1 @@ +../../Task/A+B/Oxygene \ No newline at end of file diff --git a/Lang/Oxygene/Hello-world-Graphical b/Lang/Oxygene/Hello-world-Graphical new file mode 120000 index 0000000000..130acb2c8a --- /dev/null +++ b/Lang/Oxygene/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Oxygene \ No newline at end of file diff --git a/Lang/Oxygene/Hello-world-Newline-omission b/Lang/Oxygene/Hello-world-Newline-omission new file mode 120000 index 0000000000..f0dd54195a --- /dev/null +++ b/Lang/Oxygene/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Oxygene \ No newline at end of file diff --git a/Lang/Oxygene/Hello-world-Text b/Lang/Oxygene/Hello-world-Text new file mode 120000 index 0000000000..e8047f00b0 --- /dev/null +++ b/Lang/Oxygene/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Oxygene \ No newline at end of file diff --git a/Lang/Oz/0DESCRIPTION b/Lang/Oz/0DESCRIPTION new file mode 100644 index 0000000000..3e8d0187a6 --- /dev/null +++ b/Lang/Oz/0DESCRIPTION @@ -0,0 +1,24 @@ +{{language|Oz +|site=http://www.mozart-oz.org +|checking=dynamic +|gc=yes +|LCT=yes +|strength=strong +|express=implicit +|safety=safe +|compat=structural +|parampass=reference}}Oz is a multi-[[:Category:Programming Paradigms|paradigm]] language that is designed for advanced, [[concurrent programming|concurrent]], networked, soft real-time, and reactive applications. Oz provides the salient features of [[object-oriented programming]] including state, abstract data types, objects, classes, and inheritance. It provides the salient features of [[functional programming]] including compositional syntax, first-class procedures/functions, and lexical scoping. It provides the salient features of logic programming and constraint programming including logic variables, constraints, disjunction constructs, and programmable search mechanisms. It allows users to dynamically create any number of sequential [[threads]]. The threads are dataflow threads in the sense that a thread executing an operation will suspend until all operands needed have a well-defined value.[[#Citation|[1]]] +{{language programming paradigm|Logic_Programming}} +{{language programming paradigm|functional}} +{{language programming paradigm|Object-oriented}} + +The [[Mozart/Oz|Mozart]] Programming System is the primary implementation of Oz. It is released with an [[open source]] license by the Mozart Consortium. Mozart has been ported to different flavors of [[Unix]], FreeBSD, [[Linux]], [[Microsoft]] [[Windows]], and [[Mac OS X]].[[#Citation|[2]]] + +==How to execute the examples on Rosetta Code== +All examples that start with declare can be used directly in the Emacs-based IDE, without a separate compilation step. Just copy the source code to the Oz buffer and select the menu item "Oz→Feed Buffer". + +Some examples are functor definitions and must be compiled. If a makefile.oz is supplied, execute ozmake to build the project. Otherwise call the compiler directly: ozc -c filename.oz. Execute a compiled functor with ozengine filename.ozf. + +==Citation== +#[http://www.mozart-oz.org/documentation/tutorial/index.html Tutorial of Oz] +#[[wp:Oz_%28programming_language%29|Wikipedia:Oz (programming language)]] \ No newline at end of file diff --git a/Lang/Oz/100-doors b/Lang/Oz/100-doors new file mode 120000 index 0000000000..ba8515adc3 --- /dev/null +++ b/Lang/Oz/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Oz \ No newline at end of file diff --git a/Lang/Oz/99-Bottles-of-Beer b/Lang/Oz/99-Bottles-of-Beer new file mode 120000 index 0000000000..b699901fa2 --- /dev/null +++ b/Lang/Oz/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Oz \ No newline at end of file diff --git a/Lang/Oz/A+B b/Lang/Oz/A+B new file mode 120000 index 0000000000..b655ec072b --- /dev/null +++ b/Lang/Oz/A+B @@ -0,0 +1 @@ +../../Task/A+B/Oz \ No newline at end of file diff --git a/Lang/Oz/Abstract-type b/Lang/Oz/Abstract-type new file mode 120000 index 0000000000..1cc267878b --- /dev/null +++ b/Lang/Oz/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/Oz \ No newline at end of file diff --git a/Lang/Oz/Accumulator-factory b/Lang/Oz/Accumulator-factory new file mode 120000 index 0000000000..b8a0b347a2 --- /dev/null +++ b/Lang/Oz/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Oz \ No newline at end of file diff --git a/Lang/Oz/Ackermann-function b/Lang/Oz/Ackermann-function new file mode 120000 index 0000000000..9502ab7306 --- /dev/null +++ b/Lang/Oz/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Oz \ No newline at end of file diff --git a/Lang/Oz/Active-object b/Lang/Oz/Active-object new file mode 120000 index 0000000000..87607a9629 --- /dev/null +++ b/Lang/Oz/Active-object @@ -0,0 +1 @@ +../../Task/Active-object/Oz \ No newline at end of file diff --git a/Lang/Oz/Add-a-variable-to-a-class-instance-at-runtime b/Lang/Oz/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..db71fdf7b7 --- /dev/null +++ b/Lang/Oz/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/Oz \ No newline at end of file diff --git a/Lang/Oz/Align-columns b/Lang/Oz/Align-columns new file mode 120000 index 0000000000..e9a3b93187 --- /dev/null +++ b/Lang/Oz/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/Oz \ No newline at end of file diff --git a/Lang/Oz/Anagrams b/Lang/Oz/Anagrams new file mode 120000 index 0000000000..b4658ebdbc --- /dev/null +++ b/Lang/Oz/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Oz \ No newline at end of file diff --git a/Lang/Oz/Animate-a-pendulum b/Lang/Oz/Animate-a-pendulum new file mode 120000 index 0000000000..e5372ea15d --- /dev/null +++ b/Lang/Oz/Animate-a-pendulum @@ -0,0 +1 @@ +../../Task/Animate-a-pendulum/Oz \ No newline at end of file diff --git a/Lang/Oz/Animation b/Lang/Oz/Animation new file mode 120000 index 0000000000..b628c95115 --- /dev/null +++ b/Lang/Oz/Animation @@ -0,0 +1 @@ +../../Task/Animation/Oz \ No newline at end of file diff --git a/Lang/Oz/Apply-a-callback-to-an-array b/Lang/Oz/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..cade3c64c0 --- /dev/null +++ b/Lang/Oz/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Oz \ No newline at end of file diff --git a/Lang/Oz/Arbitrary-precision-integers-included b/Lang/Oz/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..364cdd4377 --- /dev/null +++ b/Lang/Oz/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Oz \ No newline at end of file diff --git a/Lang/Oz/Arithmetic-Integer b/Lang/Oz/Arithmetic-Integer new file mode 120000 index 0000000000..56008006a8 --- /dev/null +++ b/Lang/Oz/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Oz \ No newline at end of file diff --git a/Lang/Oz/Arithmetic-evaluation b/Lang/Oz/Arithmetic-evaluation new file mode 120000 index 0000000000..a93ba5b2c2 --- /dev/null +++ b/Lang/Oz/Arithmetic-evaluation @@ -0,0 +1 @@ +../../Task/Arithmetic-evaluation/Oz \ No newline at end of file diff --git a/Lang/Oz/Array-concatenation b/Lang/Oz/Array-concatenation new file mode 120000 index 0000000000..295e4f3696 --- /dev/null +++ b/Lang/Oz/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Oz \ No newline at end of file diff --git a/Lang/Oz/Arrays b/Lang/Oz/Arrays new file mode 120000 index 0000000000..5528c160fb --- /dev/null +++ b/Lang/Oz/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Oz \ No newline at end of file diff --git a/Lang/Oz/Assertions b/Lang/Oz/Assertions new file mode 120000 index 0000000000..7569b9aa6c --- /dev/null +++ b/Lang/Oz/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Oz \ No newline at end of file diff --git a/Lang/Oz/Associative-array-Creation b/Lang/Oz/Associative-array-Creation new file mode 120000 index 0000000000..0b5025e2e5 --- /dev/null +++ b/Lang/Oz/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Oz \ No newline at end of file diff --git a/Lang/Oz/Associative-array-Iteration b/Lang/Oz/Associative-array-Iteration new file mode 120000 index 0000000000..d3ecebe2d9 --- /dev/null +++ b/Lang/Oz/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Oz \ No newline at end of file diff --git a/Lang/Oz/Atomic-updates b/Lang/Oz/Atomic-updates new file mode 120000 index 0000000000..0f15dee345 --- /dev/null +++ b/Lang/Oz/Atomic-updates @@ -0,0 +1 @@ +../../Task/Atomic-updates/Oz \ No newline at end of file diff --git a/Lang/Oz/Averages-Arithmetic-mean b/Lang/Oz/Averages-Arithmetic-mean new file mode 120000 index 0000000000..641c646a52 --- /dev/null +++ b/Lang/Oz/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Oz \ No newline at end of file diff --git a/Lang/Oz/Averages-Median b/Lang/Oz/Averages-Median new file mode 120000 index 0000000000..0cdd3a60ce --- /dev/null +++ b/Lang/Oz/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Oz \ No newline at end of file diff --git a/Lang/Oz/Averages-Mode b/Lang/Oz/Averages-Mode new file mode 120000 index 0000000000..6656f97056 --- /dev/null +++ b/Lang/Oz/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/Oz \ No newline at end of file diff --git a/Lang/Oz/Averages-Pythagorean-means b/Lang/Oz/Averages-Pythagorean-means new file mode 120000 index 0000000000..fe48804015 --- /dev/null +++ b/Lang/Oz/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Oz \ No newline at end of file diff --git a/Lang/Oz/Averages-Root-mean-square b/Lang/Oz/Averages-Root-mean-square new file mode 120000 index 0000000000..99ce6ef20f --- /dev/null +++ b/Lang/Oz/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Oz \ No newline at end of file diff --git a/Lang/Oz/Averages-Simple-moving-average b/Lang/Oz/Averages-Simple-moving-average new file mode 120000 index 0000000000..058f06e4ba --- /dev/null +++ b/Lang/Oz/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/Oz \ No newline at end of file diff --git a/Lang/Oz/Binary-search b/Lang/Oz/Binary-search new file mode 120000 index 0000000000..952156bc11 --- /dev/null +++ b/Lang/Oz/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Oz \ No newline at end of file diff --git a/Lang/Oz/Bitmap b/Lang/Oz/Bitmap new file mode 120000 index 0000000000..072bae0f6a --- /dev/null +++ b/Lang/Oz/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/Oz \ No newline at end of file diff --git a/Lang/Oz/Bitmap-Read-a-PPM-file b/Lang/Oz/Bitmap-Read-a-PPM-file new file mode 120000 index 0000000000..a62de0ee95 --- /dev/null +++ b/Lang/Oz/Bitmap-Read-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Read-a-PPM-file/Oz \ No newline at end of file diff --git a/Lang/Oz/Bitmap-Write-a-PPM-file b/Lang/Oz/Bitmap-Write-a-PPM-file new file mode 120000 index 0000000000..67bc648d08 --- /dev/null +++ b/Lang/Oz/Bitmap-Write-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Write-a-PPM-file/Oz \ No newline at end of file diff --git a/Lang/Oz/Bulls-and-cows b/Lang/Oz/Bulls-and-cows new file mode 120000 index 0000000000..945b676d0b --- /dev/null +++ b/Lang/Oz/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/Oz \ No newline at end of file diff --git a/Lang/Oz/Call-a-foreign-language-function b/Lang/Oz/Call-a-foreign-language-function new file mode 120000 index 0000000000..e33115c858 --- /dev/null +++ b/Lang/Oz/Call-a-foreign-language-function @@ -0,0 +1 @@ +../../Task/Call-a-foreign-language-function/Oz \ No newline at end of file diff --git a/Lang/Oz/Character-codes b/Lang/Oz/Character-codes new file mode 120000 index 0000000000..c4d3ffc26b --- /dev/null +++ b/Lang/Oz/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Oz \ No newline at end of file diff --git a/Lang/Oz/Check-that-file-exists b/Lang/Oz/Check-that-file-exists new file mode 120000 index 0000000000..ea2f59c1a2 --- /dev/null +++ b/Lang/Oz/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Oz \ No newline at end of file diff --git a/Lang/Oz/Classes b/Lang/Oz/Classes new file mode 120000 index 0000000000..09a8d73d1b --- /dev/null +++ b/Lang/Oz/Classes @@ -0,0 +1 @@ +../../Task/Classes/Oz \ No newline at end of file diff --git a/Lang/Oz/Closest-pair-problem b/Lang/Oz/Closest-pair-problem new file mode 120000 index 0000000000..c9e595a5ab --- /dev/null +++ b/Lang/Oz/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/Oz \ No newline at end of file diff --git a/Lang/Oz/Collections b/Lang/Oz/Collections new file mode 120000 index 0000000000..b81d93f59e --- /dev/null +++ b/Lang/Oz/Collections @@ -0,0 +1 @@ +../../Task/Collections/Oz \ No newline at end of file diff --git a/Lang/Oz/Combinations b/Lang/Oz/Combinations new file mode 120000 index 0000000000..9f8f6cd396 --- /dev/null +++ b/Lang/Oz/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Oz \ No newline at end of file diff --git a/Lang/Oz/Command-line-arguments b/Lang/Oz/Command-line-arguments new file mode 120000 index 0000000000..bcddd90db4 --- /dev/null +++ b/Lang/Oz/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Oz \ No newline at end of file diff --git a/Lang/Oz/Comments b/Lang/Oz/Comments new file mode 120000 index 0000000000..af8dc20bfb --- /dev/null +++ b/Lang/Oz/Comments @@ -0,0 +1 @@ +../../Task/Comments/Oz \ No newline at end of file diff --git a/Lang/Oz/Compile-time-calculation b/Lang/Oz/Compile-time-calculation new file mode 120000 index 0000000000..9806994d88 --- /dev/null +++ b/Lang/Oz/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/Oz \ No newline at end of file diff --git a/Lang/Oz/Compound-data-type b/Lang/Oz/Compound-data-type new file mode 120000 index 0000000000..e64431f50c --- /dev/null +++ b/Lang/Oz/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Oz \ No newline at end of file diff --git a/Lang/Oz/Concurrent-computing b/Lang/Oz/Concurrent-computing new file mode 120000 index 0000000000..742e259e34 --- /dev/null +++ b/Lang/Oz/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/Oz \ No newline at end of file diff --git a/Lang/Oz/Conditional-structures b/Lang/Oz/Conditional-structures new file mode 120000 index 0000000000..9b08adb621 --- /dev/null +++ b/Lang/Oz/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Oz \ No newline at end of file diff --git a/Lang/Oz/Conways-Game-of-Life b/Lang/Oz/Conways-Game-of-Life new file mode 120000 index 0000000000..0f90f69da8 --- /dev/null +++ b/Lang/Oz/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/Oz \ No newline at end of file diff --git a/Lang/Oz/Create-a-file b/Lang/Oz/Create-a-file new file mode 120000 index 0000000000..512ac08b96 --- /dev/null +++ b/Lang/Oz/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Oz \ No newline at end of file diff --git a/Lang/Oz/Create-a-two-dimensional-array-at-runtime b/Lang/Oz/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..c3fcd020d5 --- /dev/null +++ b/Lang/Oz/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Oz \ No newline at end of file diff --git a/Lang/Oz/Create-an-HTML-table b/Lang/Oz/Create-an-HTML-table new file mode 120000 index 0000000000..7d1735fbe4 --- /dev/null +++ b/Lang/Oz/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/Oz \ No newline at end of file diff --git a/Lang/Oz/Date-format b/Lang/Oz/Date-format new file mode 120000 index 0000000000..c286886003 --- /dev/null +++ b/Lang/Oz/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Oz \ No newline at end of file diff --git a/Lang/Oz/Define-a-primitive-data-type b/Lang/Oz/Define-a-primitive-data-type new file mode 120000 index 0000000000..36a0147aa9 --- /dev/null +++ b/Lang/Oz/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Oz \ No newline at end of file diff --git a/Lang/Oz/Delegates b/Lang/Oz/Delegates new file mode 120000 index 0000000000..95647ee9da --- /dev/null +++ b/Lang/Oz/Delegates @@ -0,0 +1 @@ +../../Task/Delegates/Oz \ No newline at end of file diff --git a/Lang/Oz/Delete-a-file b/Lang/Oz/Delete-a-file new file mode 120000 index 0000000000..b917ef8482 --- /dev/null +++ b/Lang/Oz/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Oz \ No newline at end of file diff --git a/Lang/Oz/Detect-division-by-zero b/Lang/Oz/Detect-division-by-zero new file mode 120000 index 0000000000..c3fbc4b5fc --- /dev/null +++ b/Lang/Oz/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Oz \ No newline at end of file diff --git a/Lang/Oz/Determine-if-a-string-is-numeric b/Lang/Oz/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..eebb9ecd7f --- /dev/null +++ b/Lang/Oz/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Oz \ No newline at end of file diff --git a/Lang/Oz/Determine-if-only-one-instance-is-running b/Lang/Oz/Determine-if-only-one-instance-is-running new file mode 120000 index 0000000000..1def7603ec --- /dev/null +++ b/Lang/Oz/Determine-if-only-one-instance-is-running @@ -0,0 +1 @@ +../../Task/Determine-if-only-one-instance-is-running/Oz \ No newline at end of file diff --git a/Lang/Oz/Dining-philosophers b/Lang/Oz/Dining-philosophers new file mode 120000 index 0000000000..9b9618ff4f --- /dev/null +++ b/Lang/Oz/Dining-philosophers @@ -0,0 +1 @@ +../../Task/Dining-philosophers/Oz \ No newline at end of file diff --git a/Lang/Oz/Distributed-programming b/Lang/Oz/Distributed-programming new file mode 120000 index 0000000000..0efdb8906a --- /dev/null +++ b/Lang/Oz/Distributed-programming @@ -0,0 +1 @@ +../../Task/Distributed-programming/Oz \ No newline at end of file diff --git a/Lang/Oz/Dot-product b/Lang/Oz/Dot-product new file mode 120000 index 0000000000..5a6d04bcda --- /dev/null +++ b/Lang/Oz/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Oz \ No newline at end of file diff --git a/Lang/Oz/Doubly-linked-list-Element-definition b/Lang/Oz/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..a23a32636f --- /dev/null +++ b/Lang/Oz/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/Oz \ No newline at end of file diff --git a/Lang/Oz/Doubly-linked-list-Element-insertion b/Lang/Oz/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..cfc72ebec7 --- /dev/null +++ b/Lang/Oz/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/Oz \ No newline at end of file diff --git a/Lang/Oz/Doubly-linked-list-Traversal b/Lang/Oz/Doubly-linked-list-Traversal new file mode 120000 index 0000000000..b5bc4cfa7e --- /dev/null +++ b/Lang/Oz/Doubly-linked-list-Traversal @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Traversal/Oz \ No newline at end of file diff --git a/Lang/Oz/Echo-server b/Lang/Oz/Echo-server new file mode 120000 index 0000000000..b5f6605bbd --- /dev/null +++ b/Lang/Oz/Echo-server @@ -0,0 +1 @@ +../../Task/Echo-server/Oz \ No newline at end of file diff --git a/Lang/Oz/Empty-program b/Lang/Oz/Empty-program new file mode 120000 index 0000000000..82c34c6e63 --- /dev/null +++ b/Lang/Oz/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Oz \ No newline at end of file diff --git a/Lang/Oz/Enumerations b/Lang/Oz/Enumerations new file mode 120000 index 0000000000..0dea376a34 --- /dev/null +++ b/Lang/Oz/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Oz \ No newline at end of file diff --git a/Lang/Oz/Ethiopian-multiplication b/Lang/Oz/Ethiopian-multiplication new file mode 120000 index 0000000000..ba4b35968e --- /dev/null +++ b/Lang/Oz/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Oz \ No newline at end of file diff --git a/Lang/Oz/Evaluate-binomial-coefficients b/Lang/Oz/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..475aff6f8f --- /dev/null +++ b/Lang/Oz/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/Oz \ No newline at end of file diff --git a/Lang/Oz/Events b/Lang/Oz/Events new file mode 120000 index 0000000000..d9522a968b --- /dev/null +++ b/Lang/Oz/Events @@ -0,0 +1 @@ +../../Task/Events/Oz \ No newline at end of file diff --git a/Lang/Oz/Evolutionary-algorithm b/Lang/Oz/Evolutionary-algorithm new file mode 120000 index 0000000000..17c90c810d --- /dev/null +++ b/Lang/Oz/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/Oz \ No newline at end of file diff --git a/Lang/Oz/Exceptions b/Lang/Oz/Exceptions new file mode 120000 index 0000000000..fd2fe6a7f5 --- /dev/null +++ b/Lang/Oz/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Oz \ No newline at end of file diff --git a/Lang/Oz/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/Oz/Exceptions-Catch-an-exception-thrown-in-a-nested-call new file mode 120000 index 0000000000..4a539a3fe8 --- /dev/null +++ b/Lang/Oz/Exceptions-Catch-an-exception-thrown-in-a-nested-call @@ -0,0 +1 @@ +../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/Oz \ No newline at end of file diff --git a/Lang/Oz/Execute-a-system-command b/Lang/Oz/Execute-a-system-command new file mode 120000 index 0000000000..45250f1bb1 --- /dev/null +++ b/Lang/Oz/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Oz \ No newline at end of file diff --git a/Lang/Oz/Extreme-floating-point-values b/Lang/Oz/Extreme-floating-point-values new file mode 120000 index 0000000000..7bc80da732 --- /dev/null +++ b/Lang/Oz/Extreme-floating-point-values @@ -0,0 +1 @@ +../../Task/Extreme-floating-point-values/Oz \ No newline at end of file diff --git a/Lang/Oz/Factorial b/Lang/Oz/Factorial new file mode 120000 index 0000000000..8431100349 --- /dev/null +++ b/Lang/Oz/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Oz \ No newline at end of file diff --git a/Lang/Oz/Factors-of-an-integer b/Lang/Oz/Factors-of-an-integer new file mode 120000 index 0000000000..37974af6b3 --- /dev/null +++ b/Lang/Oz/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Oz \ No newline at end of file diff --git a/Lang/Oz/Fibonacci-sequence b/Lang/Oz/Fibonacci-sequence new file mode 120000 index 0000000000..5676a27f3f --- /dev/null +++ b/Lang/Oz/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Oz \ No newline at end of file diff --git a/Lang/Oz/File-IO b/Lang/Oz/File-IO new file mode 120000 index 0000000000..c6515fdd2e --- /dev/null +++ b/Lang/Oz/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Oz \ No newline at end of file diff --git a/Lang/Oz/File-modification-time b/Lang/Oz/File-modification-time new file mode 120000 index 0000000000..c52d487825 --- /dev/null +++ b/Lang/Oz/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Oz \ No newline at end of file diff --git a/Lang/Oz/File-size b/Lang/Oz/File-size new file mode 120000 index 0000000000..663a0a5b16 --- /dev/null +++ b/Lang/Oz/File-size @@ -0,0 +1 @@ +../../Task/File-size/Oz \ No newline at end of file diff --git a/Lang/Oz/Filter b/Lang/Oz/Filter new file mode 120000 index 0000000000..a4c7ea2e34 --- /dev/null +++ b/Lang/Oz/Filter @@ -0,0 +1 @@ +../../Task/Filter/Oz \ No newline at end of file diff --git a/Lang/Oz/Find-common-directory-path b/Lang/Oz/Find-common-directory-path new file mode 120000 index 0000000000..bb40231557 --- /dev/null +++ b/Lang/Oz/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/Oz \ No newline at end of file diff --git a/Lang/Oz/Find-limit-of-recursion b/Lang/Oz/Find-limit-of-recursion new file mode 120000 index 0000000000..14756d1e76 --- /dev/null +++ b/Lang/Oz/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/Oz \ No newline at end of file diff --git a/Lang/Oz/Find-the-missing-permutation b/Lang/Oz/Find-the-missing-permutation new file mode 120000 index 0000000000..52ec7e20ed --- /dev/null +++ b/Lang/Oz/Find-the-missing-permutation @@ -0,0 +1 @@ +../../Task/Find-the-missing-permutation/Oz \ No newline at end of file diff --git a/Lang/Oz/First-class-functions b/Lang/Oz/First-class-functions new file mode 120000 index 0000000000..43e58a1403 --- /dev/null +++ b/Lang/Oz/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/Oz \ No newline at end of file diff --git a/Lang/Oz/First-class-functions-Use-numbers-analogously b/Lang/Oz/First-class-functions-Use-numbers-analogously new file mode 120000 index 0000000000..329773f860 --- /dev/null +++ b/Lang/Oz/First-class-functions-Use-numbers-analogously @@ -0,0 +1 @@ +../../Task/First-class-functions-Use-numbers-analogously/Oz \ No newline at end of file diff --git a/Lang/Oz/FizzBuzz b/Lang/Oz/FizzBuzz new file mode 120000 index 0000000000..287980acd6 --- /dev/null +++ b/Lang/Oz/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Oz \ No newline at end of file diff --git a/Lang/Oz/Flatten-a-list b/Lang/Oz/Flatten-a-list new file mode 120000 index 0000000000..47c2889651 --- /dev/null +++ b/Lang/Oz/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Oz \ No newline at end of file diff --git a/Lang/Oz/Flow-control-structures b/Lang/Oz/Flow-control-structures new file mode 120000 index 0000000000..61822a48d6 --- /dev/null +++ b/Lang/Oz/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/Oz \ No newline at end of file diff --git a/Lang/Oz/Fork b/Lang/Oz/Fork new file mode 120000 index 0000000000..fcc45d31a5 --- /dev/null +++ b/Lang/Oz/Fork @@ -0,0 +1 @@ +../../Task/Fork/Oz \ No newline at end of file diff --git a/Lang/Oz/Formatted-numeric-output b/Lang/Oz/Formatted-numeric-output new file mode 120000 index 0000000000..c62c75f0aa --- /dev/null +++ b/Lang/Oz/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Oz \ No newline at end of file diff --git a/Lang/Oz/Function-composition b/Lang/Oz/Function-composition new file mode 120000 index 0000000000..f05e0ff75a --- /dev/null +++ b/Lang/Oz/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Oz \ No newline at end of file diff --git a/Lang/Oz/Function-definition b/Lang/Oz/Function-definition new file mode 120000 index 0000000000..c5bfcc6416 --- /dev/null +++ b/Lang/Oz/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Oz \ No newline at end of file diff --git a/Lang/Oz/GUI-component-interaction b/Lang/Oz/GUI-component-interaction new file mode 120000 index 0000000000..3cd1bc08e1 --- /dev/null +++ b/Lang/Oz/GUI-component-interaction @@ -0,0 +1 @@ +../../Task/GUI-component-interaction/Oz \ No newline at end of file diff --git a/Lang/Oz/Generic-swap b/Lang/Oz/Generic-swap new file mode 120000 index 0000000000..f9dd6a831c --- /dev/null +++ b/Lang/Oz/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Oz \ No newline at end of file diff --git a/Lang/Oz/Grayscale-image b/Lang/Oz/Grayscale-image new file mode 120000 index 0000000000..929f37d0e5 --- /dev/null +++ b/Lang/Oz/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/Oz \ No newline at end of file diff --git a/Lang/Oz/Greatest-common-divisor b/Lang/Oz/Greatest-common-divisor new file mode 120000 index 0000000000..53d4925bdf --- /dev/null +++ b/Lang/Oz/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Oz \ No newline at end of file diff --git a/Lang/Oz/Greatest-element-of-a-list b/Lang/Oz/Greatest-element-of-a-list new file mode 120000 index 0000000000..1ab6202dda --- /dev/null +++ b/Lang/Oz/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Oz \ No newline at end of file diff --git a/Lang/Oz/Greatest-subsequential-sum b/Lang/Oz/Greatest-subsequential-sum new file mode 120000 index 0000000000..cd3be6c4be --- /dev/null +++ b/Lang/Oz/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/Oz \ No newline at end of file diff --git a/Lang/Oz/HTTP b/Lang/Oz/HTTP new file mode 120000 index 0000000000..ec19bf063a --- /dev/null +++ b/Lang/Oz/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Oz \ No newline at end of file diff --git a/Lang/Oz/Hailstone-sequence b/Lang/Oz/Hailstone-sequence new file mode 120000 index 0000000000..04cef59211 --- /dev/null +++ b/Lang/Oz/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Oz \ No newline at end of file diff --git a/Lang/Oz/Hamming-numbers b/Lang/Oz/Hamming-numbers new file mode 120000 index 0000000000..0ecdce06d7 --- /dev/null +++ b/Lang/Oz/Hamming-numbers @@ -0,0 +1 @@ +../../Task/Hamming-numbers/Oz \ No newline at end of file diff --git a/Lang/Oz/Happy-numbers b/Lang/Oz/Happy-numbers new file mode 120000 index 0000000000..1cfc267145 --- /dev/null +++ b/Lang/Oz/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Oz \ No newline at end of file diff --git a/Lang/Oz/Hash-from-two-arrays b/Lang/Oz/Hash-from-two-arrays new file mode 120000 index 0000000000..8c119705aa --- /dev/null +++ b/Lang/Oz/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Oz \ No newline at end of file diff --git a/Lang/Oz/Hello-world-Graphical b/Lang/Oz/Hello-world-Graphical new file mode 120000 index 0000000000..2273515a2c --- /dev/null +++ b/Lang/Oz/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Oz \ No newline at end of file diff --git a/Lang/Oz/Hello-world-Standard-error b/Lang/Oz/Hello-world-Standard-error new file mode 120000 index 0000000000..510aa2aa96 --- /dev/null +++ b/Lang/Oz/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Oz \ No newline at end of file diff --git a/Lang/Oz/Hello-world-Text b/Lang/Oz/Hello-world-Text new file mode 120000 index 0000000000..034fff68fd --- /dev/null +++ b/Lang/Oz/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Oz \ No newline at end of file diff --git a/Lang/Oz/Higher-order-functions b/Lang/Oz/Higher-order-functions new file mode 120000 index 0000000000..e00c8915dc --- /dev/null +++ b/Lang/Oz/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Oz \ No newline at end of file diff --git a/Lang/Oz/Hofstadter-Conway-$10,000-sequence b/Lang/Oz/Hofstadter-Conway-$10,000-sequence new file mode 120000 index 0000000000..8da9eb55cc --- /dev/null +++ b/Lang/Oz/Hofstadter-Conway-$10,000-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Conway-$10,000-sequence/Oz \ No newline at end of file diff --git a/Lang/Oz/Horners-rule-for-polynomial-evaluation b/Lang/Oz/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..f2c08eb288 --- /dev/null +++ b/Lang/Oz/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Oz \ No newline at end of file diff --git a/Lang/Oz/Hostname b/Lang/Oz/Hostname new file mode 120000 index 0000000000..b8c2956791 --- /dev/null +++ b/Lang/Oz/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Oz \ No newline at end of file diff --git a/Lang/Oz/Increment-a-numerical-string b/Lang/Oz/Increment-a-numerical-string new file mode 120000 index 0000000000..ac1b0c031f --- /dev/null +++ b/Lang/Oz/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Oz \ No newline at end of file diff --git a/Lang/Oz/Infinity b/Lang/Oz/Infinity new file mode 120000 index 0000000000..453604948a --- /dev/null +++ b/Lang/Oz/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Oz \ No newline at end of file diff --git a/Lang/Oz/Inheritance-Multiple b/Lang/Oz/Inheritance-Multiple new file mode 120000 index 0000000000..acb4e8c010 --- /dev/null +++ b/Lang/Oz/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/Oz \ No newline at end of file diff --git a/Lang/Oz/Inheritance-Single b/Lang/Oz/Inheritance-Single new file mode 120000 index 0000000000..bd777f398b --- /dev/null +++ b/Lang/Oz/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/Oz \ No newline at end of file diff --git a/Lang/Oz/Input-loop b/Lang/Oz/Input-loop new file mode 120000 index 0000000000..ef12bd90b4 --- /dev/null +++ b/Lang/Oz/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Oz \ No newline at end of file diff --git a/Lang/Oz/Integer-comparison b/Lang/Oz/Integer-comparison new file mode 120000 index 0000000000..ff7b1312c2 --- /dev/null +++ b/Lang/Oz/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Oz \ No newline at end of file diff --git a/Lang/Oz/Interactive-programming b/Lang/Oz/Interactive-programming new file mode 120000 index 0000000000..3e2887261d --- /dev/null +++ b/Lang/Oz/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Oz \ No newline at end of file diff --git a/Lang/Oz/Introspection b/Lang/Oz/Introspection new file mode 120000 index 0000000000..e290203d7a --- /dev/null +++ b/Lang/Oz/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Oz \ No newline at end of file diff --git a/Lang/Oz/JSON b/Lang/Oz/JSON new file mode 120000 index 0000000000..654867be27 --- /dev/null +++ b/Lang/Oz/JSON @@ -0,0 +1 @@ +../../Task/JSON/Oz \ No newline at end of file diff --git a/Lang/Oz/Jensens-Device b/Lang/Oz/Jensens-Device new file mode 120000 index 0000000000..ba0f967c17 --- /dev/null +++ b/Lang/Oz/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/Oz \ No newline at end of file diff --git a/Lang/Oz/Keyboard-macros b/Lang/Oz/Keyboard-macros new file mode 120000 index 0000000000..bfc4bb95f6 --- /dev/null +++ b/Lang/Oz/Keyboard-macros @@ -0,0 +1 @@ +../../Task/Keyboard-macros/Oz \ No newline at end of file diff --git a/Lang/Oz/Knapsack-problem-0-1 b/Lang/Oz/Knapsack-problem-0-1 new file mode 120000 index 0000000000..eaa4b23d91 --- /dev/null +++ b/Lang/Oz/Knapsack-problem-0-1 @@ -0,0 +1 @@ +../../Task/Knapsack-problem-0-1/Oz \ No newline at end of file diff --git a/Lang/Oz/Knapsack-problem-Bounded b/Lang/Oz/Knapsack-problem-Bounded new file mode 120000 index 0000000000..a06a7a32d8 --- /dev/null +++ b/Lang/Oz/Knapsack-problem-Bounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Bounded/Oz \ No newline at end of file diff --git a/Lang/Oz/Knapsack-problem-Unbounded b/Lang/Oz/Knapsack-problem-Unbounded new file mode 120000 index 0000000000..67f8c2053f --- /dev/null +++ b/Lang/Oz/Knapsack-problem-Unbounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Unbounded/Oz \ No newline at end of file diff --git a/Lang/Oz/Knuth-shuffle b/Lang/Oz/Knuth-shuffle new file mode 120000 index 0000000000..7badd0a8a1 --- /dev/null +++ b/Lang/Oz/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/Oz \ No newline at end of file diff --git a/Lang/Oz/Leap-year b/Lang/Oz/Leap-year new file mode 120000 index 0000000000..d9418a4138 --- /dev/null +++ b/Lang/Oz/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Oz \ No newline at end of file diff --git a/Lang/Oz/List-comprehensions b/Lang/Oz/List-comprehensions new file mode 120000 index 0000000000..2043624286 --- /dev/null +++ b/Lang/Oz/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/Oz \ No newline at end of file diff --git a/Lang/Oz/Literals-Integer b/Lang/Oz/Literals-Integer new file mode 120000 index 0000000000..e89d8c9b5c --- /dev/null +++ b/Lang/Oz/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Oz \ No newline at end of file diff --git a/Lang/Oz/Literals-String b/Lang/Oz/Literals-String new file mode 120000 index 0000000000..84e3085c4d --- /dev/null +++ b/Lang/Oz/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Oz \ No newline at end of file diff --git a/Lang/Oz/Logical-operations b/Lang/Oz/Logical-operations new file mode 120000 index 0000000000..a677979ee9 --- /dev/null +++ b/Lang/Oz/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Oz \ No newline at end of file diff --git a/Lang/Oz/Longest-common-subsequence b/Lang/Oz/Longest-common-subsequence new file mode 120000 index 0000000000..175f089c04 --- /dev/null +++ b/Lang/Oz/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/Oz \ No newline at end of file diff --git a/Lang/Oz/Look-and-say-sequence b/Lang/Oz/Look-and-say-sequence new file mode 120000 index 0000000000..915c1b2c6a --- /dev/null +++ b/Lang/Oz/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Oz \ No newline at end of file diff --git a/Lang/Oz/Loop-over-multiple-arrays-simultaneously b/Lang/Oz/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..e59081cf9c --- /dev/null +++ b/Lang/Oz/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-Break b/Lang/Oz/Loops-Break new file mode 120000 index 0000000000..4c93bb31ce --- /dev/null +++ b/Lang/Oz/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-Continue b/Lang/Oz/Loops-Continue new file mode 120000 index 0000000000..28aa7911ad --- /dev/null +++ b/Lang/Oz/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-Do-while b/Lang/Oz/Loops-Do-while new file mode 120000 index 0000000000..97083f7d1a --- /dev/null +++ b/Lang/Oz/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-Downward-for b/Lang/Oz/Loops-Downward-for new file mode 120000 index 0000000000..5643c6bcfd --- /dev/null +++ b/Lang/Oz/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-For b/Lang/Oz/Loops-For new file mode 120000 index 0000000000..a3711a1fd0 --- /dev/null +++ b/Lang/Oz/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-For-with-a-specified-step b/Lang/Oz/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..ea1dfb4597 --- /dev/null +++ b/Lang/Oz/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-Foreach b/Lang/Oz/Loops-Foreach new file mode 120000 index 0000000000..f0db491422 --- /dev/null +++ b/Lang/Oz/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-Infinite b/Lang/Oz/Loops-Infinite new file mode 120000 index 0000000000..fc739ce90a --- /dev/null +++ b/Lang/Oz/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-N-plus-one-half b/Lang/Oz/Loops-N-plus-one-half new file mode 120000 index 0000000000..4629d0e79c --- /dev/null +++ b/Lang/Oz/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-Nested b/Lang/Oz/Loops-Nested new file mode 120000 index 0000000000..e5ebf466b4 --- /dev/null +++ b/Lang/Oz/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/Oz \ No newline at end of file diff --git a/Lang/Oz/Loops-While b/Lang/Oz/Loops-While new file mode 120000 index 0000000000..50729dc796 --- /dev/null +++ b/Lang/Oz/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Oz \ No newline at end of file diff --git a/Lang/Oz/Lucas-Lehmer-test b/Lang/Oz/Lucas-Lehmer-test new file mode 120000 index 0000000000..2d29b5c653 --- /dev/null +++ b/Lang/Oz/Lucas-Lehmer-test @@ -0,0 +1 @@ +../../Task/Lucas-Lehmer-test/Oz \ No newline at end of file diff --git a/Lang/Oz/Luhn-test-of-credit-card-numbers b/Lang/Oz/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..d2e43f276a --- /dev/null +++ b/Lang/Oz/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Oz \ No newline at end of file diff --git a/Lang/Oz/Man-or-boy-test b/Lang/Oz/Man-or-boy-test new file mode 120000 index 0000000000..07b2eca0e5 --- /dev/null +++ b/Lang/Oz/Man-or-boy-test @@ -0,0 +1 @@ +../../Task/Man-or-boy-test/Oz \ No newline at end of file diff --git a/Lang/Oz/Menu b/Lang/Oz/Menu new file mode 120000 index 0000000000..beb0689e3b --- /dev/null +++ b/Lang/Oz/Menu @@ -0,0 +1 @@ +../../Task/Menu/Oz \ No newline at end of file diff --git a/Lang/Oz/Metered-concurrency b/Lang/Oz/Metered-concurrency new file mode 120000 index 0000000000..ca4e5c63e9 --- /dev/null +++ b/Lang/Oz/Metered-concurrency @@ -0,0 +1 @@ +../../Task/Metered-concurrency/Oz \ No newline at end of file diff --git a/Lang/Oz/Mouse-position b/Lang/Oz/Mouse-position new file mode 120000 index 0000000000..51607f2c0e --- /dev/null +++ b/Lang/Oz/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/Oz \ No newline at end of file diff --git a/Lang/Oz/Multiple-distinct-objects b/Lang/Oz/Multiple-distinct-objects new file mode 120000 index 0000000000..1328d7a04b --- /dev/null +++ b/Lang/Oz/Multiple-distinct-objects @@ -0,0 +1 @@ +../../Task/Multiple-distinct-objects/Oz \ No newline at end of file diff --git a/Lang/Oz/Mutex b/Lang/Oz/Mutex new file mode 120000 index 0000000000..93e8c309e5 --- /dev/null +++ b/Lang/Oz/Mutex @@ -0,0 +1 @@ +../../Task/Mutex/Oz \ No newline at end of file diff --git a/Lang/Oz/Mutual-recursion b/Lang/Oz/Mutual-recursion new file mode 120000 index 0000000000..34038262f0 --- /dev/null +++ b/Lang/Oz/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Oz \ No newline at end of file diff --git a/Lang/Oz/Quine b/Lang/Oz/Quine new file mode 120000 index 0000000000..c9b7a4d157 --- /dev/null +++ b/Lang/Oz/Quine @@ -0,0 +1 @@ +../../Task/Quine/Oz \ No newline at end of file diff --git a/Lang/Oz/Search-a-list b/Lang/Oz/Search-a-list new file mode 120000 index 0000000000..0077d9e137 --- /dev/null +++ b/Lang/Oz/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Oz \ No newline at end of file diff --git a/Lang/PARI-GP/0DESCRIPTION b/Lang/PARI-GP/0DESCRIPTION new file mode 100644 index 0000000000..c5f2aa155e --- /dev/null +++ b/Lang/PARI-GP/0DESCRIPTION @@ -0,0 +1,68 @@ +{{language|PARI/GP +|exec=both +|site=http://pari.math.u-bordeaux.fr/ +|gc=yes +|parampass=both +|strength=weak +|checking=dynamic +|hopl=no +|LCT=yes +|tags=parigp, c +}} +{{language programming paradigm|Dynamic}} +{{language programming paradigm|Functional}} +{{language programming paradigm|Procedural}} + +PARI/GP is a widely used computer algebra system designed for fast computations in number theory (factorizations, algebraic number theory, elliptic curves...), but also contains a large number of other useful functions to compute with mathematical entities such as matrices, polynomials, power series, algebraic numbers etc., and a lot of transcendental functions. + +PARI/GP is composed of two parts: a [[C]] library called PARI and an interface, gp, to this library. GP scripts are concise, easy to write, and resemble mathematical language. (Terminology: the scripting language of gp is called GP.) + +PARI was written by Henri Cohen and others at Université Bordeaux I and is now maintained by Karim Belabas. gp was originally written by Dominique Bernardi, then maintained and enhanced by Karim Belabas and Ilya Zakharevich, and finally rewritten by Bill Alombert. + +== Using PARI/GP == +PARI/GP can be downloaded at its official website's [http://pari.math.u-bordeaux.fr/download.html download page]. + +For Windows users there are precompiled binaries in four versions: full-featured binaries (slightly old) in both a stable and a development version, a more recent stable version without plotting and line-completion, and a similarly bare-bones build of the latest bleeding-edge version. + +Mac users may find it convenient to download the version from [http://pdb.finkproject.org/pdb/package.php/pari-gp Fink]. + +Linux users can install PARI/GP with their favorite package manager (RPM, dpkg, apt, etc.) or build it from source. [http://math.crg4.com/software.html#pari Instructions] are available for compiling. + +== Coding with PARI == +The most common way to use PARI is through the gp calculator, using its own scripting language, GP. But there are other interfaces to PARI beside gp: +* [http://math.univ-lille1.fr/~ramare/ServeurPerso/GP-PARI/ PariEmacs] +* [http://go.helms-net.de/sw/paritty/pari_tty_einf_en.html Pari-tty] +* [http://www.skalatan.de/pariguide/ pariGUIde] + +If you want to write a program rather than script a calculator, many languages are supported: +* [[C]]: PARI is written in C, so it's very easy to either write your own programs or extend gp using C. +* [[C++]]: With appropriate linkage specification it is possible to use PARI directly in C++ as well. The code is intentionally written in a C++-compatible style. +* [[Python]]: [http://www.sagemath.org/ SAGE] is a Python-based system that includes PARI among others; there is a [http://code.google.com/p/pari-python/ pari-python] library as well. +* [[Perl]]: Use [http://search.cpan.org/dist/Math-Pari/ Math::Pari] or [https://github.com/FreeMonad/GPP GPP]. +* [[Common Lisp]]: Use [http://clisp.sourceforge.net/impnotes/pari.html Pari] ([[CLISP]]). + +== See also == +*[[wp:PARI/GP|Wikipedia:PARI/GP]] + +== Resources == +=== General === +*[http://www.math.utah.edu/faq/pari/pari.html PARI/GP FAQ] +*[http://www.math.u-bordeaux1.fr/~belabas/pari/ Resources for PARI/GP] +*[http://pari.math.u-bordeaux1.fr/Events/PARI2012/ Atelier PARI/GP 2012]: Conference slides + +=== Tutorials === +*[http://pari.math.u-bordeaux.fr/pub/pari/manuals/2.5.0/tutorial.pdf Official tutorial] by C. Batut, K. Belabas, D. Bernardi, H. Cohen, M. Olivier (52 pp., 2011) +* Class notes, parts [http://myweb.csuchico.edu/~blevitt/math230/230coursedocs/230notes/230notes_01.pdf 1][http://myweb.csuchico.edu/~blevitt/math230/230coursedocs/230notes/230notes_02.pdf 2][http://myweb.csuchico.edu/~blevitt/math230/230coursedocs/230notes/230notes_03.pdf 3][http://myweb.csuchico.edu/~blevitt/math230/230coursedocs/230notes/230notes_04.pdf 4][http://myweb.csuchico.edu/~blevitt/math230/230coursedocs/230notes/230notes_05.pdf 5][http://myweb.csuchico.edu/~blevitt/math230/230coursedocs/230notes/230notes_sieve.pdf sieve] by Benjamin L. Levitt (41 pp., 2009) +*[http://www.math.uiuc.edu/~r-ash/GPTutorial.pdf Tutorial] by Robert B. Ash (20 pp., 2007) +*[http://www.math.umass.edu/~siman/09.791N/tutorial.pdf Tutorial] by Siman Wong (6 pp., 2009) +*[http://www.math.uconn.edu/~kconrad/math5230f08/parihandout.pdf Introduction] by Keith Conrad (7 pp., 2008) +*[http://www.linuxjournal.com/article/1068 The Pari Package On Linux], by Klaus-Peter Nischke (3 pp., 1995) +*[http://mvngu.wordpress.com/2008/08/01/parigp-programming-for-basic-cryptography/ PARI/GP programming for basic cryptography] by Minh Van Nguyen (appx. 3 pp., 2008) +*[http://www.exploringbinary.com/exploring-binary-numbers-with-parigp-calculator/ Exploring binary numbers with PARI/GP calculator] by Rick Regan (appx. 4 pp., 2009) +*Video tutorials, parts [http://www.youtube.com/watch?v=0G-9JzlrzBM 1] [http://www.youtube.com/watch?v=d7i0rv59hns 2] [http://http://www.youtube.com/watch?v=wCyU2n-G-pk 3] [http://http://www.youtube.com/watch?v=WOCuBvK8O6Q 4] (appx. 20 minutes, 2011) + +=== Papers on PARI/GP === +* Bill Alombert, [http://www.math.u-bordeaux.fr/~allomber/darkpaper.pdf A new interpretor for PARI/GP], ''Journal de Théorie des Nombres de Bordeaux'' '''20''':3 (2008), pp. 531–541. (English) +* Paul Zimmermann, [http://www.loria.fr/~zimmerma/talks/henri.pdf The Ups and Downs of PARI/GP in the last 20 years], Explicit Methods in Number Theory, October 15th-19th 2007 + +[[Category:Mathematical programming languages]] \ No newline at end of file diff --git a/Lang/PARI-GP/100-doors b/Lang/PARI-GP/100-doors new file mode 120000 index 0000000000..d90e727f3a --- /dev/null +++ b/Lang/PARI-GP/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/24-game b/Lang/PARI-GP/24-game new file mode 120000 index 0000000000..684dd40b72 --- /dev/null +++ b/Lang/PARI-GP/24-game @@ -0,0 +1 @@ +../../Task/24-game/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/99-Bottles-of-Beer b/Lang/PARI-GP/99-Bottles-of-Beer new file mode 120000 index 0000000000..ae28b25751 --- /dev/null +++ b/Lang/PARI-GP/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/A+B b/Lang/PARI-GP/A+B new file mode 120000 index 0000000000..07696553fe --- /dev/null +++ b/Lang/PARI-GP/A+B @@ -0,0 +1 @@ +../../Task/A+B/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Ackermann-function b/Lang/PARI-GP/Ackermann-function new file mode 120000 index 0000000000..8f638c9515 --- /dev/null +++ b/Lang/PARI-GP/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Address-of-a-variable b/Lang/PARI-GP/Address-of-a-variable new file mode 120000 index 0000000000..2f69e85585 --- /dev/null +++ b/Lang/PARI-GP/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Apply-a-callback-to-an-array b/Lang/PARI-GP/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..f9746a29b1 --- /dev/null +++ b/Lang/PARI-GP/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Arbitrary-precision-integers-included b/Lang/PARI-GP/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..a6a8277b53 --- /dev/null +++ b/Lang/PARI-GP/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Arena-storage-pool b/Lang/PARI-GP/Arena-storage-pool new file mode 120000 index 0000000000..450da82638 --- /dev/null +++ b/Lang/PARI-GP/Arena-storage-pool @@ -0,0 +1 @@ +../../Task/Arena-storage-pool/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Arithmetic-Complex b/Lang/PARI-GP/Arithmetic-Complex new file mode 120000 index 0000000000..b221c30d4d --- /dev/null +++ b/Lang/PARI-GP/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Arithmetic-Integer b/Lang/PARI-GP/Arithmetic-Integer new file mode 120000 index 0000000000..e05a817eda --- /dev/null +++ b/Lang/PARI-GP/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Arithmetic-Rational b/Lang/PARI-GP/Arithmetic-Rational new file mode 120000 index 0000000000..588834f9c9 --- /dev/null +++ b/Lang/PARI-GP/Arithmetic-Rational @@ -0,0 +1 @@ +../../Task/Arithmetic-Rational/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Arithmetic-geometric-mean b/Lang/PARI-GP/Arithmetic-geometric-mean new file mode 120000 index 0000000000..701ab00eb7 --- /dev/null +++ b/Lang/PARI-GP/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Array-concatenation b/Lang/PARI-GP/Array-concatenation new file mode 120000 index 0000000000..8c1696651d --- /dev/null +++ b/Lang/PARI-GP/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Arrays b/Lang/PARI-GP/Arrays new file mode 120000 index 0000000000..59d3d3ba8b --- /dev/null +++ b/Lang/PARI-GP/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Assertions b/Lang/PARI-GP/Assertions new file mode 120000 index 0000000000..c33f18ee6f --- /dev/null +++ b/Lang/PARI-GP/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Arithmetic-mean b/Lang/PARI-GP/Averages-Arithmetic-mean new file mode 120000 index 0000000000..433e00dfa3 --- /dev/null +++ b/Lang/PARI-GP/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Mean-angle b/Lang/PARI-GP/Averages-Mean-angle new file mode 120000 index 0000000000..39e39282bf --- /dev/null +++ b/Lang/PARI-GP/Averages-Mean-angle @@ -0,0 +1 @@ +../../Task/Averages-Mean-angle/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Mean-time-of-day b/Lang/PARI-GP/Averages-Mean-time-of-day new file mode 120000 index 0000000000..5275d19a13 --- /dev/null +++ b/Lang/PARI-GP/Averages-Mean-time-of-day @@ -0,0 +1 @@ +../../Task/Averages-Mean-time-of-day/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Median b/Lang/PARI-GP/Averages-Median new file mode 120000 index 0000000000..65a83a7b36 --- /dev/null +++ b/Lang/PARI-GP/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Mode b/Lang/PARI-GP/Averages-Mode new file mode 120000 index 0000000000..02f5eae65d --- /dev/null +++ b/Lang/PARI-GP/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Pythagorean-means b/Lang/PARI-GP/Averages-Pythagorean-means new file mode 120000 index 0000000000..7b68b711c6 --- /dev/null +++ b/Lang/PARI-GP/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Root-mean-square b/Lang/PARI-GP/Averages-Root-mean-square new file mode 120000 index 0000000000..7692be9edd --- /dev/null +++ b/Lang/PARI-GP/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Averages-Simple-moving-average b/Lang/PARI-GP/Averages-Simple-moving-average new file mode 120000 index 0000000000..0bf25b1983 --- /dev/null +++ b/Lang/PARI-GP/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Balanced-brackets b/Lang/PARI-GP/Balanced-brackets new file mode 120000 index 0000000000..91362f9359 --- /dev/null +++ b/Lang/PARI-GP/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Binary-search b/Lang/PARI-GP/Binary-search new file mode 120000 index 0000000000..b6ab464c03 --- /dev/null +++ b/Lang/PARI-GP/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Bitwise-operations b/Lang/PARI-GP/Bitwise-operations new file mode 120000 index 0000000000..08ca43dbdb --- /dev/null +++ b/Lang/PARI-GP/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Box-the-compass b/Lang/PARI-GP/Box-the-compass new file mode 120000 index 0000000000..065dc766a4 --- /dev/null +++ b/Lang/PARI-GP/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Bulls-and-cows b/Lang/PARI-GP/Bulls-and-cows new file mode 120000 index 0000000000..722ffa28be --- /dev/null +++ b/Lang/PARI-GP/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Caesar-cipher b/Lang/PARI-GP/Caesar-cipher new file mode 120000 index 0000000000..87296edf39 --- /dev/null +++ b/Lang/PARI-GP/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Call-a-function b/Lang/PARI-GP/Call-a-function new file mode 120000 index 0000000000..0ce3339e93 --- /dev/null +++ b/Lang/PARI-GP/Call-a-function @@ -0,0 +1 @@ +../../Task/Call-a-function/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Call-a-function-in-a-shared-library b/Lang/PARI-GP/Call-a-function-in-a-shared-library new file mode 120000 index 0000000000..0a1a2c82cf --- /dev/null +++ b/Lang/PARI-GP/Call-a-function-in-a-shared-library @@ -0,0 +1 @@ +../../Task/Call-a-function-in-a-shared-library/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Case-sensitivity-of-identifiers b/Lang/PARI-GP/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..043c70caff --- /dev/null +++ b/Lang/PARI-GP/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Character-codes b/Lang/PARI-GP/Character-codes new file mode 120000 index 0000000000..39973aab49 --- /dev/null +++ b/Lang/PARI-GP/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Character-matching b/Lang/PARI-GP/Character-matching new file mode 120000 index 0000000000..790ecc1dc4 --- /dev/null +++ b/Lang/PARI-GP/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Check-that-file-exists b/Lang/PARI-GP/Check-that-file-exists new file mode 120000 index 0000000000..bf867892f1 --- /dev/null +++ b/Lang/PARI-GP/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Closest-pair-problem b/Lang/PARI-GP/Closest-pair-problem new file mode 120000 index 0000000000..6c26da217f --- /dev/null +++ b/Lang/PARI-GP/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Collections b/Lang/PARI-GP/Collections new file mode 120000 index 0000000000..af013ff280 --- /dev/null +++ b/Lang/PARI-GP/Collections @@ -0,0 +1 @@ +../../Task/Collections/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Combinations b/Lang/PARI-GP/Combinations new file mode 120000 index 0000000000..5eb531b78a --- /dev/null +++ b/Lang/PARI-GP/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Combinations-with-repetitions b/Lang/PARI-GP/Combinations-with-repetitions new file mode 120000 index 0000000000..5ba4643dfc --- /dev/null +++ b/Lang/PARI-GP/Combinations-with-repetitions @@ -0,0 +1 @@ +../../Task/Combinations-with-repetitions/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Compound-data-type b/Lang/PARI-GP/Compound-data-type new file mode 120000 index 0000000000..b79055bd0d --- /dev/null +++ b/Lang/PARI-GP/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Concurrent-computing b/Lang/PARI-GP/Concurrent-computing new file mode 120000 index 0000000000..cbaab756c9 --- /dev/null +++ b/Lang/PARI-GP/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Conditional-structures b/Lang/PARI-GP/Conditional-structures new file mode 120000 index 0000000000..851adc8657 --- /dev/null +++ b/Lang/PARI-GP/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Constrained-random-points-on-a-circle b/Lang/PARI-GP/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..69c711f302 --- /dev/null +++ b/Lang/PARI-GP/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Continued-fraction b/Lang/PARI-GP/Continued-fraction new file mode 120000 index 0000000000..a653c5d380 --- /dev/null +++ b/Lang/PARI-GP/Continued-fraction @@ -0,0 +1 @@ +../../Task/Continued-fraction/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Conways-Game-of-Life b/Lang/PARI-GP/Conways-Game-of-Life new file mode 120000 index 0000000000..ef7e416aaa --- /dev/null +++ b/Lang/PARI-GP/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Count-in-factors b/Lang/PARI-GP/Count-in-factors new file mode 120000 index 0000000000..12b92c7453 --- /dev/null +++ b/Lang/PARI-GP/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Count-in-octal b/Lang/PARI-GP/Count-in-octal new file mode 120000 index 0000000000..8fb1e89a8d --- /dev/null +++ b/Lang/PARI-GP/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Count-the-coins b/Lang/PARI-GP/Count-the-coins new file mode 120000 index 0000000000..4ae51c58e4 --- /dev/null +++ b/Lang/PARI-GP/Count-the-coins @@ -0,0 +1 @@ +../../Task/Count-the-coins/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Create-a-two-dimensional-array-at-runtime b/Lang/PARI-GP/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..357565642d --- /dev/null +++ b/Lang/PARI-GP/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Create-an-HTML-table b/Lang/PARI-GP/Create-an-HTML-table new file mode 120000 index 0000000000..7987377445 --- /dev/null +++ b/Lang/PARI-GP/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Deal-cards-for-FreeCell b/Lang/PARI-GP/Deal-cards-for-FreeCell new file mode 120000 index 0000000000..89894b4293 --- /dev/null +++ b/Lang/PARI-GP/Deal-cards-for-FreeCell @@ -0,0 +1 @@ +../../Task/Deal-cards-for-FreeCell/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Delete-a-file b/Lang/PARI-GP/Delete-a-file new file mode 120000 index 0000000000..23e219c71c --- /dev/null +++ b/Lang/PARI-GP/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Detect-division-by-zero b/Lang/PARI-GP/Detect-division-by-zero new file mode 120000 index 0000000000..3da728b7ff --- /dev/null +++ b/Lang/PARI-GP/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Determine-if-a-string-is-numeric b/Lang/PARI-GP/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..abcb2f7bf6 --- /dev/null +++ b/Lang/PARI-GP/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Digital-root b/Lang/PARI-GP/Digital-root new file mode 120000 index 0000000000..b5922fb898 --- /dev/null +++ b/Lang/PARI-GP/Digital-root @@ -0,0 +1 @@ +../../Task/Digital-root/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Documentation b/Lang/PARI-GP/Documentation new file mode 120000 index 0000000000..1fe8246587 --- /dev/null +++ b/Lang/PARI-GP/Documentation @@ -0,0 +1 @@ +../../Task/Documentation/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Dot-product b/Lang/PARI-GP/Dot-product new file mode 120000 index 0000000000..c1c0085fdc --- /dev/null +++ b/Lang/PARI-GP/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Dutch-national-flag-problem b/Lang/PARI-GP/Dutch-national-flag-problem new file mode 120000 index 0000000000..790a4c077f --- /dev/null +++ b/Lang/PARI-GP/Dutch-national-flag-problem @@ -0,0 +1 @@ +../../Task/Dutch-national-flag-problem/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Dynamic-variable-names b/Lang/PARI-GP/Dynamic-variable-names new file mode 120000 index 0000000000..a78858ea52 --- /dev/null +++ b/Lang/PARI-GP/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Element-wise-operations b/Lang/PARI-GP/Element-wise-operations new file mode 120000 index 0000000000..f1a5485d90 --- /dev/null +++ b/Lang/PARI-GP/Element-wise-operations @@ -0,0 +1 @@ +../../Task/Element-wise-operations/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Empty-program b/Lang/PARI-GP/Empty-program new file mode 120000 index 0000000000..e5621857fc --- /dev/null +++ b/Lang/PARI-GP/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Empty-string b/Lang/PARI-GP/Empty-string new file mode 120000 index 0000000000..9b02b43507 --- /dev/null +++ b/Lang/PARI-GP/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Equilibrium-index b/Lang/PARI-GP/Equilibrium-index new file mode 120000 index 0000000000..3a12459df6 --- /dev/null +++ b/Lang/PARI-GP/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Ethiopian-multiplication b/Lang/PARI-GP/Ethiopian-multiplication new file mode 120000 index 0000000000..908b852168 --- /dev/null +++ b/Lang/PARI-GP/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Evaluate-binomial-coefficients b/Lang/PARI-GP/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..cdffb2c4b3 --- /dev/null +++ b/Lang/PARI-GP/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Even-or-odd b/Lang/PARI-GP/Even-or-odd new file mode 120000 index 0000000000..7abec8d83d --- /dev/null +++ b/Lang/PARI-GP/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Exceptions b/Lang/PARI-GP/Exceptions new file mode 120000 index 0000000000..734c772529 --- /dev/null +++ b/Lang/PARI-GP/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Execute-HQ9+ b/Lang/PARI-GP/Execute-HQ9+ new file mode 120000 index 0000000000..366a00b8d5 --- /dev/null +++ b/Lang/PARI-GP/Execute-HQ9+ @@ -0,0 +1 @@ +../../Task/Execute-HQ9+/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Execute-a-system-command b/Lang/PARI-GP/Execute-a-system-command new file mode 120000 index 0000000000..d78edadfc7 --- /dev/null +++ b/Lang/PARI-GP/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Exponentiation-operator b/Lang/PARI-GP/Exponentiation-operator new file mode 120000 index 0000000000..409306de5b --- /dev/null +++ b/Lang/PARI-GP/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Extend-your-language b/Lang/PARI-GP/Extend-your-language new file mode 120000 index 0000000000..c18da8eb02 --- /dev/null +++ b/Lang/PARI-GP/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Factorial b/Lang/PARI-GP/Factorial new file mode 120000 index 0000000000..d8ee4ddb51 --- /dev/null +++ b/Lang/PARI-GP/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Factors-of-a-Mersenne-number b/Lang/PARI-GP/Factors-of-a-Mersenne-number new file mode 120000 index 0000000000..21644e0737 --- /dev/null +++ b/Lang/PARI-GP/Factors-of-a-Mersenne-number @@ -0,0 +1 @@ +../../Task/Factors-of-a-Mersenne-number/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Factors-of-an-integer b/Lang/PARI-GP/Factors-of-an-integer new file mode 120000 index 0000000000..d61ac3dbd5 --- /dev/null +++ b/Lang/PARI-GP/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Fast-Fourier-transform b/Lang/PARI-GP/Fast-Fourier-transform new file mode 120000 index 0000000000..996f0310a2 --- /dev/null +++ b/Lang/PARI-GP/Fast-Fourier-transform @@ -0,0 +1 @@ +../../Task/Fast-Fourier-transform/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Fibonacci-n-step-number-sequences b/Lang/PARI-GP/Fibonacci-n-step-number-sequences new file mode 120000 index 0000000000..aa958bce93 --- /dev/null +++ b/Lang/PARI-GP/Fibonacci-n-step-number-sequences @@ -0,0 +1 @@ +../../Task/Fibonacci-n-step-number-sequences/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Fibonacci-sequence b/Lang/PARI-GP/Fibonacci-sequence new file mode 120000 index 0000000000..a56ffa9e36 --- /dev/null +++ b/Lang/PARI-GP/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/File-IO b/Lang/PARI-GP/File-IO new file mode 120000 index 0000000000..002ac9a7d8 --- /dev/null +++ b/Lang/PARI-GP/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Filter b/Lang/PARI-GP/Filter new file mode 120000 index 0000000000..82006f5e69 --- /dev/null +++ b/Lang/PARI-GP/Filter @@ -0,0 +1 @@ +../../Task/Filter/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Find-common-directory-path b/Lang/PARI-GP/Find-common-directory-path new file mode 120000 index 0000000000..c47f69a11d --- /dev/null +++ b/Lang/PARI-GP/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Find-largest-left-truncatable-prime-in-a-given-base b/Lang/PARI-GP/Find-largest-left-truncatable-prime-in-a-given-base new file mode 120000 index 0000000000..b6a3e2059c --- /dev/null +++ b/Lang/PARI-GP/Find-largest-left-truncatable-prime-in-a-given-base @@ -0,0 +1 @@ +../../Task/Find-largest-left-truncatable-prime-in-a-given-base/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Find-limit-of-recursion b/Lang/PARI-GP/Find-limit-of-recursion new file mode 120000 index 0000000000..2de2b7b2da --- /dev/null +++ b/Lang/PARI-GP/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/First-class-functions b/Lang/PARI-GP/First-class-functions new file mode 120000 index 0000000000..21f94c3f30 --- /dev/null +++ b/Lang/PARI-GP/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/First-class-functions-Use-numbers-analogously b/Lang/PARI-GP/First-class-functions-Use-numbers-analogously new file mode 120000 index 0000000000..aae82d4e3e --- /dev/null +++ b/Lang/PARI-GP/First-class-functions-Use-numbers-analogously @@ -0,0 +1 @@ +../../Task/First-class-functions-Use-numbers-analogously/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Five-weekends b/Lang/PARI-GP/Five-weekends new file mode 120000 index 0000000000..7bbc8f87f0 --- /dev/null +++ b/Lang/PARI-GP/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/FizzBuzz b/Lang/PARI-GP/FizzBuzz new file mode 120000 index 0000000000..14acb6fce1 --- /dev/null +++ b/Lang/PARI-GP/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Flatten-a-list b/Lang/PARI-GP/Flatten-a-list new file mode 120000 index 0000000000..3b553e8ebc --- /dev/null +++ b/Lang/PARI-GP/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Fork b/Lang/PARI-GP/Fork new file mode 120000 index 0000000000..e34fe5e679 --- /dev/null +++ b/Lang/PARI-GP/Fork @@ -0,0 +1 @@ +../../Task/Fork/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Formal-power-series b/Lang/PARI-GP/Formal-power-series new file mode 120000 index 0000000000..ee04b47470 --- /dev/null +++ b/Lang/PARI-GP/Formal-power-series @@ -0,0 +1 @@ +../../Task/Formal-power-series/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Formatted-numeric-output b/Lang/PARI-GP/Formatted-numeric-output new file mode 120000 index 0000000000..6dbcb3bd17 --- /dev/null +++ b/Lang/PARI-GP/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Forward-difference b/Lang/PARI-GP/Forward-difference new file mode 120000 index 0000000000..c09b406839 --- /dev/null +++ b/Lang/PARI-GP/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Four-bit-adder b/Lang/PARI-GP/Four-bit-adder new file mode 120000 index 0000000000..8b04c5a302 --- /dev/null +++ b/Lang/PARI-GP/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Function-composition b/Lang/PARI-GP/Function-composition new file mode 120000 index 0000000000..acde4d90a3 --- /dev/null +++ b/Lang/PARI-GP/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Function-definition b/Lang/PARI-GP/Function-definition new file mode 120000 index 0000000000..fcf96c2334 --- /dev/null +++ b/Lang/PARI-GP/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Function-prototype b/Lang/PARI-GP/Function-prototype new file mode 120000 index 0000000000..97b5eff78a --- /dev/null +++ b/Lang/PARI-GP/Function-prototype @@ -0,0 +1 @@ +../../Task/Function-prototype/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Gamma-function b/Lang/PARI-GP/Gamma-function new file mode 120000 index 0000000000..c18276a47e --- /dev/null +++ b/Lang/PARI-GP/Gamma-function @@ -0,0 +1 @@ +../../Task/Gamma-function/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Generic-swap b/Lang/PARI-GP/Generic-swap new file mode 120000 index 0000000000..91a1fd6b96 --- /dev/null +++ b/Lang/PARI-GP/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Gray-code b/Lang/PARI-GP/Gray-code new file mode 120000 index 0000000000..859fd72137 --- /dev/null +++ b/Lang/PARI-GP/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Greatest-common-divisor b/Lang/PARI-GP/Greatest-common-divisor new file mode 120000 index 0000000000..a8e3d8caee --- /dev/null +++ b/Lang/PARI-GP/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Greatest-element-of-a-list b/Lang/PARI-GP/Greatest-element-of-a-list new file mode 120000 index 0000000000..8c60a865fc --- /dev/null +++ b/Lang/PARI-GP/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Greatest-subsequential-sum b/Lang/PARI-GP/Greatest-subsequential-sum new file mode 120000 index 0000000000..ca0ea6a0e6 --- /dev/null +++ b/Lang/PARI-GP/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Guess-the-number b/Lang/PARI-GP/Guess-the-number new file mode 120000 index 0000000000..cc37e4f6c0 --- /dev/null +++ b/Lang/PARI-GP/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Guess-the-number-With-feedback b/Lang/PARI-GP/Guess-the-number-With-feedback new file mode 120000 index 0000000000..a71625904d --- /dev/null +++ b/Lang/PARI-GP/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Guess-the-number-With-feedback-player b/Lang/PARI-GP/Guess-the-number-With-feedback-player new file mode 120000 index 0000000000..5bbd01c89e --- /dev/null +++ b/Lang/PARI-GP/Guess-the-number-With-feedback-player @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback-player/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Hailstone-sequence b/Lang/PARI-GP/Hailstone-sequence new file mode 120000 index 0000000000..a794de44ad --- /dev/null +++ b/Lang/PARI-GP/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Hamming-numbers b/Lang/PARI-GP/Hamming-numbers new file mode 120000 index 0000000000..6189df7fa5 --- /dev/null +++ b/Lang/PARI-GP/Hamming-numbers @@ -0,0 +1 @@ +../../Task/Hamming-numbers/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Happy-numbers b/Lang/PARI-GP/Happy-numbers new file mode 120000 index 0000000000..f88256ef4c --- /dev/null +++ b/Lang/PARI-GP/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Haversine-formula b/Lang/PARI-GP/Haversine-formula new file mode 120000 index 0000000000..eff5aede70 --- /dev/null +++ b/Lang/PARI-GP/Haversine-formula @@ -0,0 +1 @@ +../../Task/Haversine-formula/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Hello-world-Newline-omission b/Lang/PARI-GP/Hello-world-Newline-omission new file mode 120000 index 0000000000..4e17a0b1cb --- /dev/null +++ b/Lang/PARI-GP/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Hello-world-Standard-error b/Lang/PARI-GP/Hello-world-Standard-error new file mode 120000 index 0000000000..bcdaf1f16b --- /dev/null +++ b/Lang/PARI-GP/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Hello-world-Text b/Lang/PARI-GP/Hello-world-Text new file mode 120000 index 0000000000..249994e5b8 --- /dev/null +++ b/Lang/PARI-GP/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Higher-order-functions b/Lang/PARI-GP/Higher-order-functions new file mode 120000 index 0000000000..6d075f57d9 --- /dev/null +++ b/Lang/PARI-GP/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/History-variables b/Lang/PARI-GP/History-variables new file mode 120000 index 0000000000..6f1d5e1317 --- /dev/null +++ b/Lang/PARI-GP/History-variables @@ -0,0 +1 @@ +../../Task/History-variables/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Hofstadter-Conway-$10,000-sequence b/Lang/PARI-GP/Hofstadter-Conway-$10,000-sequence new file mode 120000 index 0000000000..97a703ec0c --- /dev/null +++ b/Lang/PARI-GP/Hofstadter-Conway-$10,000-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Conway-$10,000-sequence/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Hofstadter-Q-sequence b/Lang/PARI-GP/Hofstadter-Q-sequence new file mode 120000 index 0000000000..4590c8398d --- /dev/null +++ b/Lang/PARI-GP/Hofstadter-Q-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Q-sequence/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Horners-rule-for-polynomial-evaluation b/Lang/PARI-GP/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..61e1ec2e76 --- /dev/null +++ b/Lang/PARI-GP/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Identity-matrix b/Lang/PARI-GP/Identity-matrix new file mode 120000 index 0000000000..9499598b17 --- /dev/null +++ b/Lang/PARI-GP/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Increment-a-numerical-string b/Lang/PARI-GP/Increment-a-numerical-string new file mode 120000 index 0000000000..c2b6ba468a --- /dev/null +++ b/Lang/PARI-GP/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Infinity b/Lang/PARI-GP/Infinity new file mode 120000 index 0000000000..322c1a8956 --- /dev/null +++ b/Lang/PARI-GP/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Integer-comparison b/Lang/PARI-GP/Integer-comparison new file mode 120000 index 0000000000..656f513334 --- /dev/null +++ b/Lang/PARI-GP/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Integer-sequence b/Lang/PARI-GP/Integer-sequence new file mode 120000 index 0000000000..78ed137c86 --- /dev/null +++ b/Lang/PARI-GP/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Interactive-programming b/Lang/PARI-GP/Interactive-programming new file mode 120000 index 0000000000..abfde41bf5 --- /dev/null +++ b/Lang/PARI-GP/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Introspection b/Lang/PARI-GP/Introspection new file mode 120000 index 0000000000..b794671970 --- /dev/null +++ b/Lang/PARI-GP/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Inverted-syntax b/Lang/PARI-GP/Inverted-syntax new file mode 120000 index 0000000000..8453520f7f --- /dev/null +++ b/Lang/PARI-GP/Inverted-syntax @@ -0,0 +1 @@ +../../Task/Inverted-syntax/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Josephus-problem b/Lang/PARI-GP/Josephus-problem new file mode 120000 index 0000000000..b09b073f12 --- /dev/null +++ b/Lang/PARI-GP/Josephus-problem @@ -0,0 +1 @@ +../../Task/Josephus-problem/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Kaprekar-numbers b/Lang/PARI-GP/Kaprekar-numbers new file mode 120000 index 0000000000..8483baec88 --- /dev/null +++ b/Lang/PARI-GP/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Knuth-shuffle b/Lang/PARI-GP/Knuth-shuffle new file mode 120000 index 0000000000..90eedb37d5 --- /dev/null +++ b/Lang/PARI-GP/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Knuths-algorithm-S b/Lang/PARI-GP/Knuths-algorithm-S new file mode 120000 index 0000000000..9c0028c2f8 --- /dev/null +++ b/Lang/PARI-GP/Knuths-algorithm-S @@ -0,0 +1 @@ +../../Task/Knuths-algorithm-S/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Langtons-ant b/Lang/PARI-GP/Langtons-ant new file mode 120000 index 0000000000..d0f2993d6e --- /dev/null +++ b/Lang/PARI-GP/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Leap-year b/Lang/PARI-GP/Leap-year new file mode 120000 index 0000000000..9d9e96ab55 --- /dev/null +++ b/Lang/PARI-GP/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Least-common-multiple b/Lang/PARI-GP/Least-common-multiple new file mode 120000 index 0000000000..2443dd426b --- /dev/null +++ b/Lang/PARI-GP/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Letter-frequency b/Lang/PARI-GP/Letter-frequency new file mode 120000 index 0000000000..f217fef013 --- /dev/null +++ b/Lang/PARI-GP/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Linear-congruential-generator b/Lang/PARI-GP/Linear-congruential-generator new file mode 120000 index 0000000000..7f80e17122 --- /dev/null +++ b/Lang/PARI-GP/Linear-congruential-generator @@ -0,0 +1 @@ +../../Task/Linear-congruential-generator/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/List-comprehensions b/Lang/PARI-GP/List-comprehensions new file mode 120000 index 0000000000..d63eeaa1d0 --- /dev/null +++ b/Lang/PARI-GP/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Logical-operations b/Lang/PARI-GP/Logical-operations new file mode 120000 index 0000000000..c2fff46159 --- /dev/null +++ b/Lang/PARI-GP/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Long-multiplication b/Lang/PARI-GP/Long-multiplication new file mode 120000 index 0000000000..4092cb003c --- /dev/null +++ b/Lang/PARI-GP/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Look-and-say-sequence b/Lang/PARI-GP/Look-and-say-sequence new file mode 120000 index 0000000000..d0fcbfb69d --- /dev/null +++ b/Lang/PARI-GP/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loop-over-multiple-arrays-simultaneously b/Lang/PARI-GP/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..8b2f73c71b --- /dev/null +++ b/Lang/PARI-GP/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-Break b/Lang/PARI-GP/Loops-Break new file mode 120000 index 0000000000..b88c99232a --- /dev/null +++ b/Lang/PARI-GP/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-Continue b/Lang/PARI-GP/Loops-Continue new file mode 120000 index 0000000000..e421ee5c75 --- /dev/null +++ b/Lang/PARI-GP/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-Do-while b/Lang/PARI-GP/Loops-Do-while new file mode 120000 index 0000000000..a2c9b8af83 --- /dev/null +++ b/Lang/PARI-GP/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-Downward-for b/Lang/PARI-GP/Loops-Downward-for new file mode 120000 index 0000000000..aece3126fb --- /dev/null +++ b/Lang/PARI-GP/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-For b/Lang/PARI-GP/Loops-For new file mode 120000 index 0000000000..7192b69143 --- /dev/null +++ b/Lang/PARI-GP/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-For-with-a-specified-step b/Lang/PARI-GP/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..0f834101b1 --- /dev/null +++ b/Lang/PARI-GP/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-Foreach b/Lang/PARI-GP/Loops-Foreach new file mode 120000 index 0000000000..746ffd250c --- /dev/null +++ b/Lang/PARI-GP/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-Infinite b/Lang/PARI-GP/Loops-Infinite new file mode 120000 index 0000000000..3d10bd069b --- /dev/null +++ b/Lang/PARI-GP/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-N-plus-one-half b/Lang/PARI-GP/Loops-N-plus-one-half new file mode 120000 index 0000000000..4f957a57b7 --- /dev/null +++ b/Lang/PARI-GP/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-Nested b/Lang/PARI-GP/Loops-Nested new file mode 120000 index 0000000000..6ebbc62e20 --- /dev/null +++ b/Lang/PARI-GP/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Loops-While b/Lang/PARI-GP/Loops-While new file mode 120000 index 0000000000..4dc36dc88e --- /dev/null +++ b/Lang/PARI-GP/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Lucas-Lehmer-test b/Lang/PARI-GP/Lucas-Lehmer-test new file mode 120000 index 0000000000..16d33a7507 --- /dev/null +++ b/Lang/PARI-GP/Lucas-Lehmer-test @@ -0,0 +1 @@ +../../Task/Lucas-Lehmer-test/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Map-range b/Lang/PARI-GP/Map-range new file mode 120000 index 0000000000..65be0d1f0f --- /dev/null +++ b/Lang/PARI-GP/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Matrix-arithmetic b/Lang/PARI-GP/Matrix-arithmetic new file mode 120000 index 0000000000..77356505ce --- /dev/null +++ b/Lang/PARI-GP/Matrix-arithmetic @@ -0,0 +1 @@ +../../Task/Matrix-arithmetic/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Matrix-exponentiation-operator b/Lang/PARI-GP/Matrix-exponentiation-operator new file mode 120000 index 0000000000..1dbaacd302 --- /dev/null +++ b/Lang/PARI-GP/Matrix-exponentiation-operator @@ -0,0 +1 @@ +../../Task/Matrix-exponentiation-operator/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Matrix-multiplication b/Lang/PARI-GP/Matrix-multiplication new file mode 120000 index 0000000000..c212d0f38f --- /dev/null +++ b/Lang/PARI-GP/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Matrix-transposition b/Lang/PARI-GP/Matrix-transposition new file mode 120000 index 0000000000..7db6ab999f --- /dev/null +++ b/Lang/PARI-GP/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Memory-allocation b/Lang/PARI-GP/Memory-allocation new file mode 120000 index 0000000000..41c461708b --- /dev/null +++ b/Lang/PARI-GP/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Menu b/Lang/PARI-GP/Menu new file mode 120000 index 0000000000..0c2cfc6b8d --- /dev/null +++ b/Lang/PARI-GP/Menu @@ -0,0 +1 @@ +../../Task/Menu/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Metaprogramming b/Lang/PARI-GP/Metaprogramming new file mode 120000 index 0000000000..4e4fbaab42 --- /dev/null +++ b/Lang/PARI-GP/Metaprogramming @@ -0,0 +1 @@ +../../Task/Metaprogramming/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Miller-Rabin-primality-test b/Lang/PARI-GP/Miller-Rabin-primality-test new file mode 120000 index 0000000000..6c17b6de21 --- /dev/null +++ b/Lang/PARI-GP/Miller-Rabin-primality-test @@ -0,0 +1 @@ +../../Task/Miller-Rabin-primality-test/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Modular-exponentiation b/Lang/PARI-GP/Modular-exponentiation new file mode 120000 index 0000000000..d6a3f93130 --- /dev/null +++ b/Lang/PARI-GP/Modular-exponentiation @@ -0,0 +1 @@ +../../Task/Modular-exponentiation/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Monte-Carlo-methods b/Lang/PARI-GP/Monte-Carlo-methods new file mode 120000 index 0000000000..ddf77d3de9 --- /dev/null +++ b/Lang/PARI-GP/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Monty-Hall-problem b/Lang/PARI-GP/Monty-Hall-problem new file mode 120000 index 0000000000..d44516224f --- /dev/null +++ b/Lang/PARI-GP/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Morse-code b/Lang/PARI-GP/Morse-code new file mode 120000 index 0000000000..b8bb97edad --- /dev/null +++ b/Lang/PARI-GP/Morse-code @@ -0,0 +1 @@ +../../Task/Morse-code/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Multifactorial b/Lang/PARI-GP/Multifactorial new file mode 120000 index 0000000000..765a9992f8 --- /dev/null +++ b/Lang/PARI-GP/Multifactorial @@ -0,0 +1 @@ +../../Task/Multifactorial/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Multiple-regression b/Lang/PARI-GP/Multiple-regression new file mode 120000 index 0000000000..4393d66f81 --- /dev/null +++ b/Lang/PARI-GP/Multiple-regression @@ -0,0 +1 @@ +../../Task/Multiple-regression/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Multiplication-tables b/Lang/PARI-GP/Multiplication-tables new file mode 120000 index 0000000000..710da5556e --- /dev/null +++ b/Lang/PARI-GP/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Multiplicative-order b/Lang/PARI-GP/Multiplicative-order new file mode 120000 index 0000000000..218b791d58 --- /dev/null +++ b/Lang/PARI-GP/Multiplicative-order @@ -0,0 +1 @@ +../../Task/Multiplicative-order/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Mutual-recursion b/Lang/PARI-GP/Mutual-recursion new file mode 120000 index 0000000000..de24b24684 --- /dev/null +++ b/Lang/PARI-GP/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Pi b/Lang/PARI-GP/Pi new file mode 120000 index 0000000000..140465da96 --- /dev/null +++ b/Lang/PARI-GP/Pi @@ -0,0 +1 @@ +../../Task/Pi/PARI-GP \ No newline at end of file diff --git a/Lang/PARI-GP/Search-a-list b/Lang/PARI-GP/Search-a-list new file mode 120000 index 0000000000..68288ca582 --- /dev/null +++ b/Lang/PARI-GP/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/PARI-GP \ No newline at end of file diff --git a/Lang/PASM/0DESCRIPTION b/Lang/PASM/0DESCRIPTION new file mode 100644 index 0000000000..72761c4b33 --- /dev/null +++ b/Lang/PASM/0DESCRIPTION @@ -0,0 +1,2 @@ +{{stub}}{{language|PASM|site=http://www.parrot.org/dev/examples/pasm}} +PASM is the low level assembly language used by the [[runs on vm::Parrot]] virtual machine. \ No newline at end of file diff --git a/Lang/PASM/Comments b/Lang/PASM/Comments new file mode 120000 index 0000000000..617c958cee --- /dev/null +++ b/Lang/PASM/Comments @@ -0,0 +1 @@ +../../Task/Comments/PASM \ No newline at end of file diff --git a/Lang/PASM/Hello-world-Newline-omission b/Lang/PASM/Hello-world-Newline-omission new file mode 120000 index 0000000000..91d9318e3b --- /dev/null +++ b/Lang/PASM/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/PASM \ No newline at end of file diff --git a/Lang/PASM/Hello-world-Text b/Lang/PASM/Hello-world-Text new file mode 120000 index 0000000000..d984a62315 --- /dev/null +++ b/Lang/PASM/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/PASM \ No newline at end of file diff --git a/Lang/PDP-11-Assembly/0DESCRIPTION b/Lang/PDP-11-Assembly/0DESCRIPTION new file mode 100644 index 0000000000..95309450b0 --- /dev/null +++ b/Lang/PDP-11-Assembly/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{assembler language}}{{stub}} \ No newline at end of file diff --git a/Lang/PDP-11-Assembly/Hello-world-Text b/Lang/PDP-11-Assembly/Hello-world-Text new file mode 120000 index 0000000000..50d37db5f5 --- /dev/null +++ b/Lang/PDP-11-Assembly/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/PDP-11-Assembly \ No newline at end of file diff --git a/Lang/PHP/Arbitrary-precision-integers-(included) b/Lang/PHP/Arbitrary-precision-integers-(included) deleted file mode 120000 index 349602ec2b..0000000000 --- a/Lang/PHP/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/PHP \ No newline at end of file diff --git a/Lang/PL-I/0DESCRIPTION b/Lang/PL-I/0DESCRIPTION new file mode 100644 index 0000000000..56ce676f29 --- /dev/null +++ b/Lang/PL-I/0DESCRIPTION @@ -0,0 +1,52 @@ +{{stub}}{{language|PL/I}} + +PL/I is a general purpose programming language suitable for commercial, scientific, non-scientific, and system programming. + +It provides the following data types: + +* Floating-point, +* Decimal integer, +* Binary integer, +* Fixed-point decimal (with fractional part), +* Fixed-point binary (that is, with fractional part), +* Character strings of two kinds: +# fixed-length, and +# varying-length. +* Bit strings of two kinds: +# fixed-length, and +# varying length. + +The float, integer,and fixed-point types can be real or complex. + +Multiple precisions are available for binary fixed-point: +* 8 bits, +* 16 bits, +* 32 bits, and +* 64 bits. + +Multiple precisions are available for floating point: +* 32 bits, +* 64 bits, and +* 80 bits. + +The language provides for static and dynamic arrays. Of the latter, there are automatic and controlled. + +Controlled can be applied to any data type, including scalar, structure, as well as arrays. With controlled, a push-down and pop-up stack is automatically used. + +PL/I has four kinds of I/O: +# For simple I/O commands, list-directed input and output requires only the names of the variables. Default format is used, based on the variable's declaration. +# For simple I/O commands, data-directed input and output requires only the names of the variables. For this form, both the names of the variables and their values are transmitted. +# When precise layouts of input and output data is required, edit-directed I/O is used. A format is specified by the user. The format is flexible, and permits the number of digits, and the number of places after the decimal point to be specified dynamically. The format may also be specified in picture form. +# for files held on storage media, record-oriented transmission is often used, either for sequential or random access. + +PL/I has built-in checking for such programmer conditions including +* subscript-range checking, +* floating-point overflow, +* fixed-point overflow, +* division by zero, +* sub-string range checking, and +* string-size checking. + +Any of those may be enabled or disabled by the user. + +When any of those conditions occurs, the user may trap them and recover from them and continue execution. \ No newline at end of file diff --git a/Lang/PL-I/100-doors b/Lang/PL-I/100-doors new file mode 120000 index 0000000000..64eb4ccbc9 --- /dev/null +++ b/Lang/PL-I/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/PL-I \ No newline at end of file diff --git a/Lang/PL-I/24-game b/Lang/PL-I/24-game new file mode 120000 index 0000000000..165aabe894 --- /dev/null +++ b/Lang/PL-I/24-game @@ -0,0 +1 @@ +../../Task/24-game/PL-I \ No newline at end of file diff --git a/Lang/PL-I/A+B b/Lang/PL-I/A+B new file mode 120000 index 0000000000..a75b409675 --- /dev/null +++ b/Lang/PL-I/A+B @@ -0,0 +1 @@ +../../Task/A+B/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Ackermann-function b/Lang/PL-I/Ackermann-function new file mode 120000 index 0000000000..ba9a9e269d --- /dev/null +++ b/Lang/PL-I/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Address-of-a-variable b/Lang/PL-I/Address-of-a-variable new file mode 120000 index 0000000000..909b5754ba --- /dev/null +++ b/Lang/PL-I/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Align-columns b/Lang/PL-I/Align-columns new file mode 120000 index 0000000000..03caf5a4be --- /dev/null +++ b/Lang/PL-I/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Anagrams b/Lang/PL-I/Anagrams new file mode 120000 index 0000000000..c6402039ac --- /dev/null +++ b/Lang/PL-I/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Arithmetic-Complex b/Lang/PL-I/Arithmetic-Complex new file mode 120000 index 0000000000..e5bcaf7523 --- /dev/null +++ b/Lang/PL-I/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Arithmetic-Integer b/Lang/PL-I/Arithmetic-Integer new file mode 120000 index 0000000000..03632bbc09 --- /dev/null +++ b/Lang/PL-I/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Arithmetic-geometric-mean b/Lang/PL-I/Arithmetic-geometric-mean new file mode 120000 index 0000000000..b3070e66b4 --- /dev/null +++ b/Lang/PL-I/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Array-concatenation b/Lang/PL-I/Array-concatenation new file mode 120000 index 0000000000..a7c5453b1c --- /dev/null +++ b/Lang/PL-I/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Arrays b/Lang/PL-I/Arrays new file mode 120000 index 0000000000..07cbd7b350 --- /dev/null +++ b/Lang/PL-I/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Assertions b/Lang/PL-I/Assertions new file mode 120000 index 0000000000..05daa875d9 --- /dev/null +++ b/Lang/PL-I/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Averages-Arithmetic-mean b/Lang/PL-I/Averages-Arithmetic-mean new file mode 120000 index 0000000000..9ddbba2512 --- /dev/null +++ b/Lang/PL-I/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Averages-Mean-angle b/Lang/PL-I/Averages-Mean-angle new file mode 120000 index 0000000000..90b71193a7 --- /dev/null +++ b/Lang/PL-I/Averages-Mean-angle @@ -0,0 +1 @@ +../../Task/Averages-Mean-angle/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Averages-Median b/Lang/PL-I/Averages-Median new file mode 120000 index 0000000000..d263f81e99 --- /dev/null +++ b/Lang/PL-I/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Averages-Pythagorean-means b/Lang/PL-I/Averages-Pythagorean-means new file mode 120000 index 0000000000..812578c8ff --- /dev/null +++ b/Lang/PL-I/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Averages-Root-mean-square b/Lang/PL-I/Averages-Root-mean-square new file mode 120000 index 0000000000..ed255b5990 --- /dev/null +++ b/Lang/PL-I/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Averages-Simple-moving-average b/Lang/PL-I/Averages-Simple-moving-average new file mode 120000 index 0000000000..af0508e10f --- /dev/null +++ b/Lang/PL-I/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Best-shuffle b/Lang/PL-I/Best-shuffle new file mode 120000 index 0000000000..a44c735407 --- /dev/null +++ b/Lang/PL-I/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Binary-search b/Lang/PL-I/Binary-search new file mode 120000 index 0000000000..87d5451f20 --- /dev/null +++ b/Lang/PL-I/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Binary-strings b/Lang/PL-I/Binary-strings new file mode 120000 index 0000000000..7593fe24aa --- /dev/null +++ b/Lang/PL-I/Binary-strings @@ -0,0 +1 @@ +../../Task/Binary-strings/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitmap b/Lang/PL-I/Bitmap new file mode 120000 index 0000000000..6eb2b6670b --- /dev/null +++ b/Lang/PL-I/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitmap-Bresenhams-line-algorithm b/Lang/PL-I/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..8ccf20a3d6 --- /dev/null +++ b/Lang/PL-I/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitmap-Flood-fill b/Lang/PL-I/Bitmap-Flood-fill new file mode 120000 index 0000000000..5ab6ac183c --- /dev/null +++ b/Lang/PL-I/Bitmap-Flood-fill @@ -0,0 +1 @@ +../../Task/Bitmap-Flood-fill/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitmap-Midpoint-circle-algorithm b/Lang/PL-I/Bitmap-Midpoint-circle-algorithm new file mode 120000 index 0000000000..8d9eb68a90 --- /dev/null +++ b/Lang/PL-I/Bitmap-Midpoint-circle-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Midpoint-circle-algorithm/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitmap-Read-a-PPM-file b/Lang/PL-I/Bitmap-Read-a-PPM-file new file mode 120000 index 0000000000..93310c74b9 --- /dev/null +++ b/Lang/PL-I/Bitmap-Read-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Read-a-PPM-file/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitmap-Write-a-PPM-file b/Lang/PL-I/Bitmap-Write-a-PPM-file new file mode 120000 index 0000000000..d94fa71711 --- /dev/null +++ b/Lang/PL-I/Bitmap-Write-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Write-a-PPM-file/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitwise-IO b/Lang/PL-I/Bitwise-IO new file mode 120000 index 0000000000..d4e188efce --- /dev/null +++ b/Lang/PL-I/Bitwise-IO @@ -0,0 +1 @@ +../../Task/Bitwise-IO/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Bitwise-operations b/Lang/PL-I/Bitwise-operations new file mode 120000 index 0000000000..1facad6c2a --- /dev/null +++ b/Lang/PL-I/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Boolean-values b/Lang/PL-I/Boolean-values new file mode 120000 index 0000000000..f6f882cead --- /dev/null +++ b/Lang/PL-I/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Caesar-cipher b/Lang/PL-I/Caesar-cipher new file mode 120000 index 0000000000..6f7b901eb1 --- /dev/null +++ b/Lang/PL-I/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Calendar b/Lang/PL-I/Calendar new file mode 120000 index 0000000000..3f6ff0dbf3 --- /dev/null +++ b/Lang/PL-I/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Call-a-foreign-language-function b/Lang/PL-I/Call-a-foreign-language-function new file mode 120000 index 0000000000..1f3c6f32ad --- /dev/null +++ b/Lang/PL-I/Call-a-foreign-language-function @@ -0,0 +1 @@ +../../Task/Call-a-foreign-language-function/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Character-codes b/Lang/PL-I/Character-codes new file mode 120000 index 0000000000..23f8ff800c --- /dev/null +++ b/Lang/PL-I/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Character-matching b/Lang/PL-I/Character-matching new file mode 120000 index 0000000000..5d164a3541 --- /dev/null +++ b/Lang/PL-I/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Closest-pair-problem b/Lang/PL-I/Closest-pair-problem new file mode 120000 index 0000000000..1103b7e791 --- /dev/null +++ b/Lang/PL-I/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Collections b/Lang/PL-I/Collections new file mode 120000 index 0000000000..6773fd1429 --- /dev/null +++ b/Lang/PL-I/Collections @@ -0,0 +1 @@ +../../Task/Collections/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Command-line-arguments b/Lang/PL-I/Command-line-arguments new file mode 120000 index 0000000000..1ba6eef245 --- /dev/null +++ b/Lang/PL-I/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Comments b/Lang/PL-I/Comments new file mode 120000 index 0000000000..4d96140d76 --- /dev/null +++ b/Lang/PL-I/Comments @@ -0,0 +1 @@ +../../Task/Comments/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Compile-time-calculation b/Lang/PL-I/Compile-time-calculation new file mode 120000 index 0000000000..972315998e --- /dev/null +++ b/Lang/PL-I/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Compound-data-type b/Lang/PL-I/Compound-data-type new file mode 120000 index 0000000000..51f306028f --- /dev/null +++ b/Lang/PL-I/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Conditional-structures b/Lang/PL-I/Conditional-structures new file mode 120000 index 0000000000..f8b171e18f --- /dev/null +++ b/Lang/PL-I/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Constrained-random-points-on-a-circle b/Lang/PL-I/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..1fb902edc1 --- /dev/null +++ b/Lang/PL-I/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Continued-fraction b/Lang/PL-I/Continued-fraction new file mode 120000 index 0000000000..8089bdd790 --- /dev/null +++ b/Lang/PL-I/Continued-fraction @@ -0,0 +1 @@ +../../Task/Continued-fraction/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Count-in-factors b/Lang/PL-I/Count-in-factors new file mode 120000 index 0000000000..9db506fb78 --- /dev/null +++ b/Lang/PL-I/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Count-in-octal b/Lang/PL-I/Count-in-octal new file mode 120000 index 0000000000..f2189a18ff --- /dev/null +++ b/Lang/PL-I/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Count-occurrences-of-a-substring b/Lang/PL-I/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..11b4e2a9d1 --- /dev/null +++ b/Lang/PL-I/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Create-a-file b/Lang/PL-I/Create-a-file new file mode 120000 index 0000000000..bff0770d0f --- /dev/null +++ b/Lang/PL-I/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Create-a-two-dimensional-array-at-runtime b/Lang/PL-I/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..2f83a3a393 --- /dev/null +++ b/Lang/PL-I/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Create-an-HTML-table b/Lang/PL-I/Create-an-HTML-table new file mode 120000 index 0000000000..33d7181114 --- /dev/null +++ b/Lang/PL-I/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Date-format b/Lang/PL-I/Date-format new file mode 120000 index 0000000000..f6206b18ea --- /dev/null +++ b/Lang/PL-I/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Date-manipulation b/Lang/PL-I/Date-manipulation new file mode 120000 index 0000000000..6a09dcfba1 --- /dev/null +++ b/Lang/PL-I/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Day-of-the-week b/Lang/PL-I/Day-of-the-week new file mode 120000 index 0000000000..c1675962a9 --- /dev/null +++ b/Lang/PL-I/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Detect-division-by-zero b/Lang/PL-I/Detect-division-by-zero new file mode 120000 index 0000000000..81ffe6352f --- /dev/null +++ b/Lang/PL-I/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Determine-if-a-string-is-numeric b/Lang/PL-I/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..6be8d84e8e --- /dev/null +++ b/Lang/PL-I/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Digital-root b/Lang/PL-I/Digital-root new file mode 120000 index 0000000000..31be1c0095 --- /dev/null +++ b/Lang/PL-I/Digital-root @@ -0,0 +1 @@ +../../Task/Digital-root/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Dot-product b/Lang/PL-I/Dot-product new file mode 120000 index 0000000000..1844294083 --- /dev/null +++ b/Lang/PL-I/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Doubly-linked-list-Definition b/Lang/PL-I/Doubly-linked-list-Definition new file mode 120000 index 0000000000..d1c6d65726 --- /dev/null +++ b/Lang/PL-I/Doubly-linked-list-Definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Definition/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Doubly-linked-list-Element-definition b/Lang/PL-I/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..e1fca8ecbb --- /dev/null +++ b/Lang/PL-I/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Doubly-linked-list-Element-insertion b/Lang/PL-I/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..2674a1fa47 --- /dev/null +++ b/Lang/PL-I/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Doubly-linked-list-Traversal b/Lang/PL-I/Doubly-linked-list-Traversal new file mode 120000 index 0000000000..47e7a1b37c --- /dev/null +++ b/Lang/PL-I/Doubly-linked-list-Traversal @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Traversal/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Element-wise-operations b/Lang/PL-I/Element-wise-operations new file mode 120000 index 0000000000..1770f316c1 --- /dev/null +++ b/Lang/PL-I/Element-wise-operations @@ -0,0 +1 @@ +../../Task/Element-wise-operations/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Empty-program b/Lang/PL-I/Empty-program new file mode 120000 index 0000000000..e7db9d2a14 --- /dev/null +++ b/Lang/PL-I/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Empty-string b/Lang/PL-I/Empty-string new file mode 120000 index 0000000000..1d1ef0be3a --- /dev/null +++ b/Lang/PL-I/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Enumerations b/Lang/PL-I/Enumerations new file mode 120000 index 0000000000..bc273df834 --- /dev/null +++ b/Lang/PL-I/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Ethiopian-multiplication b/Lang/PL-I/Ethiopian-multiplication new file mode 120000 index 0000000000..4639bcb13a --- /dev/null +++ b/Lang/PL-I/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Euler-method b/Lang/PL-I/Euler-method new file mode 120000 index 0000000000..37581206fa --- /dev/null +++ b/Lang/PL-I/Euler-method @@ -0,0 +1 @@ +../../Task/Euler-method/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Evaluate-binomial-coefficients b/Lang/PL-I/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..fa0aaa2e6c --- /dev/null +++ b/Lang/PL-I/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Even-or-odd b/Lang/PL-I/Even-or-odd new file mode 120000 index 0000000000..ed38e4ff46 --- /dev/null +++ b/Lang/PL-I/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Exceptions b/Lang/PL-I/Exceptions new file mode 120000 index 0000000000..41ace666de --- /dev/null +++ b/Lang/PL-I/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/PL-I/Exceptions-Catch-an-exception-thrown-in-a-nested-call new file mode 120000 index 0000000000..6c10b18604 --- /dev/null +++ b/Lang/PL-I/Exceptions-Catch-an-exception-thrown-in-a-nested-call @@ -0,0 +1 @@ +../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Exponentiation-operator b/Lang/PL-I/Exponentiation-operator new file mode 120000 index 0000000000..0706e92f4f --- /dev/null +++ b/Lang/PL-I/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Factorial b/Lang/PL-I/Factorial new file mode 120000 index 0000000000..f21c644027 --- /dev/null +++ b/Lang/PL-I/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Factors-of-an-integer b/Lang/PL-I/Factors-of-an-integer new file mode 120000 index 0000000000..fce873b4f4 --- /dev/null +++ b/Lang/PL-I/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Fast-Fourier-transform b/Lang/PL-I/Fast-Fourier-transform new file mode 120000 index 0000000000..254156f9f9 --- /dev/null +++ b/Lang/PL-I/Fast-Fourier-transform @@ -0,0 +1 @@ +../../Task/Fast-Fourier-transform/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Fibonacci-n-step-number-sequences b/Lang/PL-I/Fibonacci-n-step-number-sequences new file mode 120000 index 0000000000..430af7e2b4 --- /dev/null +++ b/Lang/PL-I/Fibonacci-n-step-number-sequences @@ -0,0 +1 @@ +../../Task/Fibonacci-n-step-number-sequences/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Fibonacci-sequence b/Lang/PL-I/Fibonacci-sequence new file mode 120000 index 0000000000..134c09f6b9 --- /dev/null +++ b/Lang/PL-I/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/PL-I \ No newline at end of file diff --git a/Lang/PL-I/File-IO b/Lang/PL-I/File-IO new file mode 120000 index 0000000000..b7f65e9299 --- /dev/null +++ b/Lang/PL-I/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/PL-I \ No newline at end of file diff --git a/Lang/PL-I/File-size b/Lang/PL-I/File-size new file mode 120000 index 0000000000..72c3dfeea3 --- /dev/null +++ b/Lang/PL-I/File-size @@ -0,0 +1 @@ +../../Task/File-size/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Find-limit-of-recursion b/Lang/PL-I/Find-limit-of-recursion new file mode 120000 index 0000000000..3fb2a6d568 --- /dev/null +++ b/Lang/PL-I/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Five-weekends b/Lang/PL-I/Five-weekends new file mode 120000 index 0000000000..8e3631a72d --- /dev/null +++ b/Lang/PL-I/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/PL-I \ No newline at end of file diff --git a/Lang/PL-I/FizzBuzz b/Lang/PL-I/FizzBuzz new file mode 120000 index 0000000000..c2ea1c3f57 --- /dev/null +++ b/Lang/PL-I/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Flatten-a-list b/Lang/PL-I/Flatten-a-list new file mode 120000 index 0000000000..38487aac0a --- /dev/null +++ b/Lang/PL-I/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Flow-control-structures b/Lang/PL-I/Flow-control-structures new file mode 120000 index 0000000000..e536a4b6c5 --- /dev/null +++ b/Lang/PL-I/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Floyds-triangle b/Lang/PL-I/Floyds-triangle new file mode 120000 index 0000000000..97d1d7088a --- /dev/null +++ b/Lang/PL-I/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Fork b/Lang/PL-I/Fork new file mode 120000 index 0000000000..8eed126e75 --- /dev/null +++ b/Lang/PL-I/Fork @@ -0,0 +1 @@ +../../Task/Fork/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Formatted-numeric-output b/Lang/PL-I/Formatted-numeric-output new file mode 120000 index 0000000000..a1a65e63c0 --- /dev/null +++ b/Lang/PL-I/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Forward-difference b/Lang/PL-I/Forward-difference new file mode 120000 index 0000000000..15e7829d13 --- /dev/null +++ b/Lang/PL-I/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Four-bit-adder b/Lang/PL-I/Four-bit-adder new file mode 120000 index 0000000000..44547fe3b0 --- /dev/null +++ b/Lang/PL-I/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Function-definition b/Lang/PL-I/Function-definition new file mode 120000 index 0000000000..32af8a8b1b --- /dev/null +++ b/Lang/PL-I/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Gamma-function b/Lang/PL-I/Gamma-function new file mode 120000 index 0000000000..5aeef5070f --- /dev/null +++ b/Lang/PL-I/Gamma-function @@ -0,0 +1 @@ +../../Task/Gamma-function/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Generic-swap b/Lang/PL-I/Generic-swap new file mode 120000 index 0000000000..25fb0015c7 --- /dev/null +++ b/Lang/PL-I/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Grayscale-image b/Lang/PL-I/Grayscale-image new file mode 120000 index 0000000000..740104558a --- /dev/null +++ b/Lang/PL-I/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Greatest-common-divisor b/Lang/PL-I/Greatest-common-divisor new file mode 120000 index 0000000000..8af259ce80 --- /dev/null +++ b/Lang/PL-I/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Greatest-element-of-a-list b/Lang/PL-I/Greatest-element-of-a-list new file mode 120000 index 0000000000..4c1403e153 --- /dev/null +++ b/Lang/PL-I/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hailstone-sequence b/Lang/PL-I/Hailstone-sequence new file mode 120000 index 0000000000..53440c4370 --- /dev/null +++ b/Lang/PL-I/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Handle-a-signal b/Lang/PL-I/Handle-a-signal new file mode 120000 index 0000000000..4567fd42e2 --- /dev/null +++ b/Lang/PL-I/Handle-a-signal @@ -0,0 +1 @@ +../../Task/Handle-a-signal/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Happy-numbers b/Lang/PL-I/Happy-numbers new file mode 120000 index 0000000000..9babae7438 --- /dev/null +++ b/Lang/PL-I/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hello-world-Line-printer b/Lang/PL-I/Hello-world-Line-printer new file mode 120000 index 0000000000..aac2fb3562 --- /dev/null +++ b/Lang/PL-I/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hello-world-Newline-omission b/Lang/PL-I/Hello-world-Newline-omission new file mode 120000 index 0000000000..598fccbf79 --- /dev/null +++ b/Lang/PL-I/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hello-world-Standard-error b/Lang/PL-I/Hello-world-Standard-error new file mode 120000 index 0000000000..73a48c5485 --- /dev/null +++ b/Lang/PL-I/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hello-world-Text b/Lang/PL-I/Hello-world-Text new file mode 120000 index 0000000000..0b7372aa1d --- /dev/null +++ b/Lang/PL-I/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Higher-order-functions b/Lang/PL-I/Higher-order-functions new file mode 120000 index 0000000000..6660c2b257 --- /dev/null +++ b/Lang/PL-I/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/PL-I \ No newline at end of file diff --git a/Lang/PL-I/History-variables b/Lang/PL-I/History-variables new file mode 120000 index 0000000000..54d3e0c35a --- /dev/null +++ b/Lang/PL-I/History-variables @@ -0,0 +1 @@ +../../Task/History-variables/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hofstadter-Conway-$10,000-sequence b/Lang/PL-I/Hofstadter-Conway-$10,000-sequence new file mode 120000 index 0000000000..943036f015 --- /dev/null +++ b/Lang/PL-I/Hofstadter-Conway-$10,000-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Conway-$10,000-sequence/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hofstadter-Figure-Figure-sequences b/Lang/PL-I/Hofstadter-Figure-Figure-sequences new file mode 120000 index 0000000000..752e5ec3a1 --- /dev/null +++ b/Lang/PL-I/Hofstadter-Figure-Figure-sequences @@ -0,0 +1 @@ +../../Task/Hofstadter-Figure-Figure-sequences/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Hofstadter-Q-sequence b/Lang/PL-I/Hofstadter-Q-sequence new file mode 120000 index 0000000000..1bd4a6d4f5 --- /dev/null +++ b/Lang/PL-I/Hofstadter-Q-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Q-sequence/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Horners-rule-for-polynomial-evaluation b/Lang/PL-I/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..cd28d8edc7 --- /dev/null +++ b/Lang/PL-I/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Host-introspection b/Lang/PL-I/Host-introspection new file mode 120000 index 0000000000..0c31cbdfcf --- /dev/null +++ b/Lang/PL-I/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Identity-matrix b/Lang/PL-I/Identity-matrix new file mode 120000 index 0000000000..f3215fd2ba --- /dev/null +++ b/Lang/PL-I/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Include-a-file b/Lang/PL-I/Include-a-file new file mode 120000 index 0000000000..f977418ced --- /dev/null +++ b/Lang/PL-I/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Increment-a-numerical-string b/Lang/PL-I/Increment-a-numerical-string new file mode 120000 index 0000000000..5eb90ef16d --- /dev/null +++ b/Lang/PL-I/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Infinity b/Lang/PL-I/Infinity new file mode 120000 index 0000000000..6d1730b15b --- /dev/null +++ b/Lang/PL-I/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Input-loop b/Lang/PL-I/Input-loop new file mode 120000 index 0000000000..ac281810c3 --- /dev/null +++ b/Lang/PL-I/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Integer-comparison b/Lang/PL-I/Integer-comparison new file mode 120000 index 0000000000..c8e306a2a7 --- /dev/null +++ b/Lang/PL-I/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Integer-sequence b/Lang/PL-I/Integer-sequence new file mode 120000 index 0000000000..05f3825724 --- /dev/null +++ b/Lang/PL-I/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Introspection b/Lang/PL-I/Introspection new file mode 120000 index 0000000000..23565f4dff --- /dev/null +++ b/Lang/PL-I/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Kaprekar-numbers b/Lang/PL-I/Kaprekar-numbers new file mode 120000 index 0000000000..ebc365d8d6 --- /dev/null +++ b/Lang/PL-I/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Knuth-shuffle b/Lang/PL-I/Knuth-shuffle new file mode 120000 index 0000000000..a5fa688feb --- /dev/null +++ b/Lang/PL-I/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Last-Friday-of-each-month b/Lang/PL-I/Last-Friday-of-each-month new file mode 120000 index 0000000000..93798a1280 --- /dev/null +++ b/Lang/PL-I/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Leap-year b/Lang/PL-I/Leap-year new file mode 120000 index 0000000000..a205431352 --- /dev/null +++ b/Lang/PL-I/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Letter-frequency b/Lang/PL-I/Letter-frequency new file mode 120000 index 0000000000..bccb3c8931 --- /dev/null +++ b/Lang/PL-I/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Linear-congruential-generator b/Lang/PL-I/Linear-congruential-generator new file mode 120000 index 0000000000..3d8eee30f2 --- /dev/null +++ b/Lang/PL-I/Linear-congruential-generator @@ -0,0 +1 @@ +../../Task/Linear-congruential-generator/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Literals-Floating-point b/Lang/PL-I/Literals-Floating-point new file mode 120000 index 0000000000..bccd63b708 --- /dev/null +++ b/Lang/PL-I/Literals-Floating-point @@ -0,0 +1 @@ +../../Task/Literals-Floating-point/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Literals-Integer b/Lang/PL-I/Literals-Integer new file mode 120000 index 0000000000..0720e7dd52 --- /dev/null +++ b/Lang/PL-I/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Literals-String b/Lang/PL-I/Literals-String new file mode 120000 index 0000000000..4d2a68e579 --- /dev/null +++ b/Lang/PL-I/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Logical-operations b/Lang/PL-I/Logical-operations new file mode 120000 index 0000000000..c8e089b8c6 --- /dev/null +++ b/Lang/PL-I/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Long-multiplication b/Lang/PL-I/Long-multiplication new file mode 120000 index 0000000000..5246cde0f0 --- /dev/null +++ b/Lang/PL-I/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Longest-string-challenge b/Lang/PL-I/Longest-string-challenge new file mode 120000 index 0000000000..89e5ae15a0 --- /dev/null +++ b/Lang/PL-I/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loop-over-multiple-arrays-simultaneously b/Lang/PL-I/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..f8a4a88af6 --- /dev/null +++ b/Lang/PL-I/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-Break b/Lang/PL-I/Loops-Break new file mode 120000 index 0000000000..aaca20c5ae --- /dev/null +++ b/Lang/PL-I/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-Continue b/Lang/PL-I/Loops-Continue new file mode 120000 index 0000000000..c7b3c80836 --- /dev/null +++ b/Lang/PL-I/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-Do-while b/Lang/PL-I/Loops-Do-while new file mode 120000 index 0000000000..fe89cdc3c7 --- /dev/null +++ b/Lang/PL-I/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-Downward-for b/Lang/PL-I/Loops-Downward-for new file mode 120000 index 0000000000..71071b6eab --- /dev/null +++ b/Lang/PL-I/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-For b/Lang/PL-I/Loops-For new file mode 120000 index 0000000000..b721fb37c9 --- /dev/null +++ b/Lang/PL-I/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-For-with-a-specified-step b/Lang/PL-I/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..67e14b183e --- /dev/null +++ b/Lang/PL-I/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-Foreach b/Lang/PL-I/Loops-Foreach new file mode 120000 index 0000000000..7675baf0da --- /dev/null +++ b/Lang/PL-I/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-Infinite b/Lang/PL-I/Loops-Infinite new file mode 120000 index 0000000000..0ea75afd4b --- /dev/null +++ b/Lang/PL-I/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-N-plus-one-half b/Lang/PL-I/Loops-N-plus-one-half new file mode 120000 index 0000000000..589096fe2c --- /dev/null +++ b/Lang/PL-I/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-Nested b/Lang/PL-I/Loops-Nested new file mode 120000 index 0000000000..4b1d4b4f7c --- /dev/null +++ b/Lang/PL-I/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Loops-While b/Lang/PL-I/Loops-While new file mode 120000 index 0000000000..79cc0c17c7 --- /dev/null +++ b/Lang/PL-I/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Luhn-test-of-credit-card-numbers b/Lang/PL-I/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..708359ab7d --- /dev/null +++ b/Lang/PL-I/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Map-range b/Lang/PL-I/Map-range new file mode 120000 index 0000000000..ab65dc6af2 --- /dev/null +++ b/Lang/PL-I/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Matrix-multiplication b/Lang/PL-I/Matrix-multiplication new file mode 120000 index 0000000000..c8e44c1635 --- /dev/null +++ b/Lang/PL-I/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Matrix-transposition b/Lang/PL-I/Matrix-transposition new file mode 120000 index 0000000000..47e3a317c1 --- /dev/null +++ b/Lang/PL-I/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Memory-allocation b/Lang/PL-I/Memory-allocation new file mode 120000 index 0000000000..365b9c5bbf --- /dev/null +++ b/Lang/PL-I/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Memory-layout-of-a-data-structure b/Lang/PL-I/Memory-layout-of-a-data-structure new file mode 120000 index 0000000000..da88dcea9b --- /dev/null +++ b/Lang/PL-I/Memory-layout-of-a-data-structure @@ -0,0 +1 @@ +../../Task/Memory-layout-of-a-data-structure/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Menu b/Lang/PL-I/Menu new file mode 120000 index 0000000000..c515d97b1e --- /dev/null +++ b/Lang/PL-I/Menu @@ -0,0 +1 @@ +../../Task/Menu/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Morse-code b/Lang/PL-I/Morse-code new file mode 120000 index 0000000000..c684348d1a --- /dev/null +++ b/Lang/PL-I/Morse-code @@ -0,0 +1 @@ +../../Task/Morse-code/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Multiplication-tables b/Lang/PL-I/Multiplication-tables new file mode 120000 index 0000000000..105fefafec --- /dev/null +++ b/Lang/PL-I/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Mutual-recursion b/Lang/PL-I/Mutual-recursion new file mode 120000 index 0000000000..a63f1dfd3a --- /dev/null +++ b/Lang/PL-I/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Ordered-words b/Lang/PL-I/Ordered-words new file mode 120000 index 0000000000..3c13e87942 --- /dev/null +++ b/Lang/PL-I/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Pi b/Lang/PL-I/Pi new file mode 120000 index 0000000000..50dbc9e36d --- /dev/null +++ b/Lang/PL-I/Pi @@ -0,0 +1 @@ +../../Task/Pi/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Quine b/Lang/PL-I/Quine new file mode 120000 index 0000000000..ee9c0b6a24 --- /dev/null +++ b/Lang/PL-I/Quine @@ -0,0 +1 @@ +../../Task/Quine/PL-I \ No newline at end of file diff --git a/Lang/PL-I/Search-a-list b/Lang/PL-I/Search-a-list new file mode 120000 index 0000000000..6d2f7cfa2a --- /dev/null +++ b/Lang/PL-I/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/PL-I \ No newline at end of file diff --git a/Lang/PL-M/0DESCRIPTION b/Lang/PL-M/0DESCRIPTION new file mode 100644 index 0000000000..f66cf163bf --- /dev/null +++ b/Lang/PL-M/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/PL-SQL/0DESCRIPTION b/Lang/PL-SQL/0DESCRIPTION new file mode 100644 index 0000000000..81d408ebd7 --- /dev/null +++ b/Lang/PL-SQL/0DESCRIPTION @@ -0,0 +1,3 @@ +{{language|PL/SQL}}{{implementation|SQL}}'''PL/SQL''' (Procedural Language/Structured Query Language) is Oracle Corporation's proprietary server-based procedural extension to the [[SQL]] database language. (Some other SQL database management systems offer languages similar to PL/SQL.) Its syntax strongly resembles that of [[Ada]]. +==Citations== +* [http://en.wikipedia.org/wiki/PL/SQL Wikipedia:PL/SQL] \ No newline at end of file diff --git a/Lang/PL-SQL/Apply-a-callback-to-an-array b/Lang/PL-SQL/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..8609c78776 --- /dev/null +++ b/Lang/PL-SQL/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Associative-array-Creation b/Lang/PL-SQL/Associative-array-Creation new file mode 120000 index 0000000000..52f508b0a1 --- /dev/null +++ b/Lang/PL-SQL/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Call-an-object-method b/Lang/PL-SQL/Call-an-object-method new file mode 120000 index 0000000000..d0f9d3c79b --- /dev/null +++ b/Lang/PL-SQL/Call-an-object-method @@ -0,0 +1 @@ +../../Task/Call-an-object-method/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Comments b/Lang/PL-SQL/Comments new file mode 120000 index 0000000000..d05359aac5 --- /dev/null +++ b/Lang/PL-SQL/Comments @@ -0,0 +1 @@ +../../Task/Comments/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Detect-division-by-zero b/Lang/PL-SQL/Detect-division-by-zero new file mode 120000 index 0000000000..d16f90c149 --- /dev/null +++ b/Lang/PL-SQL/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Determine-if-a-string-is-numeric b/Lang/PL-SQL/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..8b9a4c9fa5 --- /dev/null +++ b/Lang/PL-SQL/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Empty-program b/Lang/PL-SQL/Empty-program new file mode 120000 index 0000000000..f9515d0445 --- /dev/null +++ b/Lang/PL-SQL/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Ethiopian-multiplication b/Lang/PL-SQL/Ethiopian-multiplication new file mode 120000 index 0000000000..0bb70cc4b2 --- /dev/null +++ b/Lang/PL-SQL/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Fibonacci-sequence b/Lang/PL-SQL/Fibonacci-sequence new file mode 120000 index 0000000000..4855a8ae8b --- /dev/null +++ b/Lang/PL-SQL/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/FizzBuzz b/Lang/PL-SQL/FizzBuzz new file mode 120000 index 0000000000..c9c66efe08 --- /dev/null +++ b/Lang/PL-SQL/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Function-definition b/Lang/PL-SQL/Function-definition new file mode 120000 index 0000000000..b2761730f6 --- /dev/null +++ b/Lang/PL-SQL/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Hostname b/Lang/PL-SQL/Hostname new file mode 120000 index 0000000000..be798be66e --- /dev/null +++ b/Lang/PL-SQL/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Jump-anywhere b/Lang/PL-SQL/Jump-anywhere new file mode 120000 index 0000000000..deabe9de72 --- /dev/null +++ b/Lang/PL-SQL/Jump-anywhere @@ -0,0 +1 @@ +../../Task/Jump-anywhere/PL-SQL \ No newline at end of file diff --git a/Lang/PL-SQL/Luhn-test-of-credit-card-numbers b/Lang/PL-SQL/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..edf426d13c --- /dev/null +++ b/Lang/PL-SQL/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/PL-SQL \ No newline at end of file diff --git a/Lang/PL-pgSQL/0DESCRIPTION b/Lang/PL-pgSQL/0DESCRIPTION new file mode 100644 index 0000000000..f4ab223f78 --- /dev/null +++ b/Lang/PL-pgSQL/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language|PL/pgSQL +|site=http://www.postgresql.org/docs/current/static/plpgsql.html}} +PL/pgSQL (Procedural Language/PostgreSQL Structured Query Language) is a full featured procedural language supported by the PostgreSQL ORDBMS. It closely resembles Oracle's [[PL/SQL]] language. \ No newline at end of file diff --git a/Lang/PLUS/0DESCRIPTION b/Lang/PLUS/0DESCRIPTION new file mode 100644 index 0000000000..f66cf163bf --- /dev/null +++ b/Lang/PLUS/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/PLZ-SYS/0DESCRIPTION b/Lang/PLZ-SYS/0DESCRIPTION new file mode 100644 index 0000000000..f66cf163bf --- /dev/null +++ b/Lang/PLZ-SYS/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/POV-Ray/0DESCRIPTION b/Lang/POV-Ray/0DESCRIPTION new file mode 100644 index 0000000000..6dee331070 --- /dev/null +++ b/Lang/POV-Ray/0DESCRIPTION @@ -0,0 +1,12 @@ +{{language +|exec=interpreted +|site=http://www.povray.org +| +}}{{stub}} +'''POV-Ray''' is a raytracer where images are specified in a description language. This description language also has programming constructs, making it a full-fledged programming language. + +==Citation== +*[[wp:POV-Ray|Wikipedia: POV-Ray]] + +[[Category:Constructive Solid Geometry]] +[[Category:Raytracing]] \ No newline at end of file diff --git a/Lang/POV-Ray/Death-Star b/Lang/POV-Ray/Death-Star new file mode 120000 index 0000000000..d291519c14 --- /dev/null +++ b/Lang/POV-Ray/Death-Star @@ -0,0 +1 @@ +../../Task/Death-Star/POV-Ray \ No newline at end of file diff --git a/Lang/POV-Ray/Draw-a-cuboid b/Lang/POV-Ray/Draw-a-cuboid new file mode 120000 index 0000000000..4a95db6bc9 --- /dev/null +++ b/Lang/POV-Ray/Draw-a-cuboid @@ -0,0 +1 @@ +../../Task/Draw-a-cuboid/POV-Ray \ No newline at end of file diff --git a/Lang/POV-Ray/Draw-a-sphere b/Lang/POV-Ray/Draw-a-sphere new file mode 120000 index 0000000000..e87b82de8c --- /dev/null +++ b/Lang/POV-Ray/Draw-a-sphere @@ -0,0 +1 @@ +../../Task/Draw-a-sphere/POV-Ray \ No newline at end of file diff --git a/Lang/POV-Ray/Fractal-tree b/Lang/POV-Ray/Fractal-tree new file mode 120000 index 0000000000..57ac260e28 --- /dev/null +++ b/Lang/POV-Ray/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/POV-Ray \ No newline at end of file diff --git a/Lang/PPC-Assembly/0DESCRIPTION b/Lang/PPC-Assembly/0DESCRIPTION new file mode 100644 index 0000000000..95309450b0 --- /dev/null +++ b/Lang/PPC-Assembly/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{assembler language}}{{stub}} \ No newline at end of file diff --git a/Lang/PPL/0DESCRIPTION b/Lang/PPL/0DESCRIPTION new file mode 100644 index 0000000000..2390a89a3b --- /dev/null +++ b/Lang/PPL/0DESCRIPTION @@ -0,0 +1,106 @@ +{{language +|untyped=yes +|site=http://www.ppl-lang.com}} +{{language programming paradigm|object-oriented}} +ArianeSoft PPL is a fast and easy-to-learn programming language that is fully [[object-oriented]]. PPL runs on [[Windows]] (XP and up) and Windows Mobile phones. Programs written for one system are 100% compatible with each supported platforms. PPL comes with a complete development environment on Windows. + +PPL has been in active development for more than six years now. It has been used by thousands of people all over the world. PPL has proven to be very stable, many projects have been developed with it. + + +'''PPL 2 (Pocket Programming Language version 2)''' is an object-oriented programming language designed from the ground-up for Windows and Windows Mobile phones. It features: + +The PPL language syntax is a mixture of [[C]], [[Pascal]] and [[Basic]]. There are no variable types in PPL. Everything is fully transparent, from string to char to integer or double. Multi-dimensional arrays and multi-level matrices are supported while structures can be defined with specific fields sizes. Pointers can be used the same way the C language handles them. String manipulation is done transparently and allocated dynamically just like in Pascal or Basic. Linked-lists are an integral part of the variable system in PPL. You can easily create linked-list variables with arrays of different size or different structures in each element. Windows [[API]] functions are easy to access. Simply define the function, the number of input and output parameters and the interpreter will do all the necessary work including WideChar conversions. + +*Object Oriented framework +*Temporary object creation and method calling (ex: PDialog("Hello World!").Message) +*Syntax borrows the best from commonly used languages like C, [[C Sharp|C#]], Pascal and BASIC, so it's easy for all levels of developer to understand +*Implements advanced constructs like Arrays, Linked Lists and Matrices +*100% compatible with PPL v1.x procedural's syntax +*Regular expressions + + +#class test + Private(a$, b$); + + nproc Create + Dim(b$, 10); + end; + + property read a a$; + property write a a$; + + property read b b$; + property write b b$; + +#endclass + +proc main + o$ = new test; + o.a = 10; + o.a += 15; + ShowMessage(o.a++); + (o$).a = 20; + (o$).a += 25; + o.b[0] = 50; + ShowMessage(o.b[0]); + Dim(l$, 10); + l$[0] = o$; + l$[0].b[1] = 60; + ShowMessage(l$[0].b[1]); +end; + +'''PPL Assembler:''' + +PPL comes with a fully integrated assembler that uses an easy syntax. Results are super-fast and instant. Assembling is dynamic, therefore you don't need to compile your code in advance, you can do it on the fly. You write the code once and the assembler generate the binary code for each target platforms supported by PPL. + + +'''The PPL 2 IDE (Integrated Development Environment):''' + +*Design your application visually using our new visual coding technology +*Inter-platform development - design the application on Windows and run it, without any modifications, on Windows Mobile +*Use our high-level source code editor, with code completion, syntax highlighting and code templates to greatly simplify your programming. Spend less time finding what is required to accomplish a task and get the results faster. +*Visual debugger. +*Code profiler to help you make your code the fastest possible. +*Memory leak analyzer. +*Create native stand-alone executable files for Windows and Windows Mobile. + + +'''Advanced Help System:''' + +Providing help for the components you design has never been easier. PPL 2 comes fully loaded with an incredibly easy-to-use help editor and help viewer. Never worry about the layout of your help documents anymore, PPL takes care of it for you. The help engine, allows for fast searching and a uniform layout for all the help topics. The help engine also supports classes, properties, methods and events. It will create links to inherited classes, create topics for properties, methods and events. Get the professional help files without the work load. + + +'''The Tag Search System:''' + +Have you ever waste valuable minutes trying to remember what was the name of that function that does what you were looking for but were not able to find it? This is a situation from the past now, PPL 2, offers a powerful tag search engine, that accept English-like search text and finds all functions, properties, methods, events, etc... that are related to that text. For example, if you are looking for a way to display some text in a dialog box on the screen, simply type: "display some text", you will get a list of all functions that relates to displaying text. That easy! + + +'''The PPL Control Library:''' + +*All standard [[Microsoft]] controls are bundled in easy to use object oriented libraries +*Easily create your own controls using PCL (PPL Control Library) which provides an excellent framework to develop your applications. +*Package your components, help files and project templates in an easy to distribute format. +*Download and purchase components or component packages from our PPL Store. +*Easily install new components at the click of a button. + + +'''The Database library:''' + +*[[SQLite]] v2 and v3 support (read here http://blog.gobansaor.com/2009/03/14/sqlite-as-the-mp3-of-data why we chose SQLite) +*Visual data grid and data controls +*Orion database engine +*Secure SSL encryption package + + +'''Advanced Game Engine to build 2D games for Windows and Windows Mobile:''' + +*WYSIWYG game level editing - design your game levels visually +*Object-Oriented framework +*2D graphics support +**Drawing primitives (lines, boxes, circles) +**Image loading and manipulation (.BMP, .JPG, .PNG) +**Extensive support for sprites +*Isometric viewpoint support +*Particle engine +*Physics engine +*Sound engine \ No newline at end of file diff --git a/Lang/PSQL/0DESCRIPTION b/Lang/PSQL/0DESCRIPTION new file mode 100644 index 0000000000..39fdfb0a4a --- /dev/null +++ b/Lang/PSQL/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language}} +PSQL is the procedural language of the Firebird database. It is used to create stored procedures, and triggers, or, within an EXECUTE BLOCK, within regular SQL. +See [http://www.firebirdsql.org Firebird homepage] \ No newline at end of file diff --git a/Lang/PSQL/Empty-program b/Lang/PSQL/Empty-program new file mode 120000 index 0000000000..40bbcf7d2e --- /dev/null +++ b/Lang/PSQL/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/PSQL \ No newline at end of file diff --git a/Lang/Pascal/0DESCRIPTION b/Lang/Pascal/0DESCRIPTION new file mode 100644 index 0000000000..9278c799c3 --- /dev/null +++ b/Lang/Pascal/0DESCRIPTION @@ -0,0 +1,24 @@ +{{language|Pascal +|strength=strong +|safety=safe +|express=explicit +|checking=static +|parampass=both +|gc=no +|LCT=yes +|bnf=http://en.wikipedia.org/wiki/ISO_7185}} +{{language programming paradigm|Imperative}} +'''Pascal''' is an [[imperative programming|imperative]] computer programming language, developed in 1970 by [[wp:Niklaus Wirth|Niklaus Wirth]] as a language particularly suitable for [[wp:structured programming|structured programming]]. A derivative known as [[:Category:Object Pascal|Object Pascal]] was designed for [[object-oriented]] programming. Pascal can be used very easily in conjunction with fundamental [[wp:discrete mathematics|discrete mathematics]] as sets are built into the language. + +There are actually several varieties of Pascal. The most important ones are: +* Standard Pascal ([[ISO]] 7185) is the original Pascal standard. However, there are many features missing from that language version, which has led to a wide variety of nonstandard extensions. On the other hand, there are features of Standard Pascal which are seldom implemented by Pascal compilers. A compiler which implements all features of Standard Pascal is [[GNU Pascal]]. +* Extended Pascal (ISO 10206) is a later Pascal standard which adds a lot to the original Pascal standard. However, compilers implementing Extended Pascal are even more rare than those implementing Standard Pascal. GNU Pascal implements most of Extended Pascal as well. +* [[Turbo Pascal]] was a very successful Pascal implementation for [[DOS]] and 16 bit [[Windows]] (the latest version was sold under the name "Borland Pascal 7.0") and became the de-facto standard for Pascal on DOS. Even today many Pascal compilers provide compatibility to Turbo Pascal. +* [[Object Pascal]] is the Pascal dialect used in [[Delphi]], Borland's successor product to Turbo/Borland Pascal. It extends Pascal with a new object model (in addition to the object model introduced in Turbo Pascal 5.5). This language is also implemented by [[Free Pascal]] and [[Lazarus]]. + +==Grammar== +The [[wp:ISO 7185|ISO 7185]] standard for Pascal uses [[wp:Extended Backus–Naur Form|Extended Backus–Naur Form]]. +Also [[wp:Van Wijngaarden grammar|Van Wijngaarden's grammar]] can be used to define +[[Pascal]]'s grammar[http://www-users.cs.york.ac.uk/~fisher/software/yoyovwg/exs/pascal.vwg]. +==See also== +* [[wp:Pascal (programming language)|Pascal on Wikipedia]] \ No newline at end of file diff --git a/Lang/Pascal/100-doors b/Lang/Pascal/100-doors new file mode 120000 index 0000000000..7e806c2945 --- /dev/null +++ b/Lang/Pascal/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Pascal \ No newline at end of file diff --git a/Lang/Pascal/99-Bottles-of-Beer b/Lang/Pascal/99-Bottles-of-Beer new file mode 120000 index 0000000000..a4fece1da2 --- /dev/null +++ b/Lang/Pascal/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Pascal \ No newline at end of file diff --git a/Lang/Pascal/A+B b/Lang/Pascal/A+B new file mode 120000 index 0000000000..d02d85c56f --- /dev/null +++ b/Lang/Pascal/A+B @@ -0,0 +1 @@ +../../Task/A+B/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Ackermann-function b/Lang/Pascal/Ackermann-function new file mode 120000 index 0000000000..3de8174567 --- /dev/null +++ b/Lang/Pascal/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Anagrams b/Lang/Pascal/Anagrams new file mode 120000 index 0000000000..d378abaac4 --- /dev/null +++ b/Lang/Pascal/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Arbitrary-precision-integers-included b/Lang/Pascal/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..4f8c5d12bb --- /dev/null +++ b/Lang/Pascal/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Arena-storage-pool b/Lang/Pascal/Arena-storage-pool new file mode 120000 index 0000000000..81da97f176 --- /dev/null +++ b/Lang/Pascal/Arena-storage-pool @@ -0,0 +1 @@ +../../Task/Arena-storage-pool/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Arithmetic-Complex b/Lang/Pascal/Arithmetic-Complex new file mode 120000 index 0000000000..14de8713e4 --- /dev/null +++ b/Lang/Pascal/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Arithmetic-Integer b/Lang/Pascal/Arithmetic-Integer new file mode 120000 index 0000000000..0076201c7a --- /dev/null +++ b/Lang/Pascal/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Arithmetic-geometric-mean b/Lang/Pascal/Arithmetic-geometric-mean new file mode 120000 index 0000000000..0d94f6893a --- /dev/null +++ b/Lang/Pascal/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Arrays b/Lang/Pascal/Arrays new file mode 120000 index 0000000000..b9d4bb0b4a --- /dev/null +++ b/Lang/Pascal/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Averages-Arithmetic-mean b/Lang/Pascal/Averages-Arithmetic-mean new file mode 120000 index 0000000000..0d91680d90 --- /dev/null +++ b/Lang/Pascal/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Averages-Median b/Lang/Pascal/Averages-Median new file mode 120000 index 0000000000..e4ab4f476c --- /dev/null +++ b/Lang/Pascal/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Best-shuffle b/Lang/Pascal/Best-shuffle new file mode 120000 index 0000000000..6b7a607f1a --- /dev/null +++ b/Lang/Pascal/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Binary-search b/Lang/Pascal/Binary-search new file mode 120000 index 0000000000..86d6e0f3d3 --- /dev/null +++ b/Lang/Pascal/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Binary-strings b/Lang/Pascal/Binary-strings new file mode 120000 index 0000000000..49e3da1d18 --- /dev/null +++ b/Lang/Pascal/Binary-strings @@ -0,0 +1 @@ +../../Task/Binary-strings/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Bitmap b/Lang/Pascal/Bitmap new file mode 120000 index 0000000000..a266de8f90 --- /dev/null +++ b/Lang/Pascal/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Bitwise-operations b/Lang/Pascal/Bitwise-operations new file mode 120000 index 0000000000..e6db56ef53 --- /dev/null +++ b/Lang/Pascal/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Boolean-values b/Lang/Pascal/Boolean-values new file mode 120000 index 0000000000..75404c5079 --- /dev/null +++ b/Lang/Pascal/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Box-the-compass b/Lang/Pascal/Box-the-compass new file mode 120000 index 0000000000..cf8c6c41df --- /dev/null +++ b/Lang/Pascal/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Caesar-cipher b/Lang/Pascal/Caesar-cipher new file mode 120000 index 0000000000..1d59475a1b --- /dev/null +++ b/Lang/Pascal/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Character-codes b/Lang/Pascal/Character-codes new file mode 120000 index 0000000000..fe2289f3e5 --- /dev/null +++ b/Lang/Pascal/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Cholesky-decomposition b/Lang/Pascal/Cholesky-decomposition new file mode 120000 index 0000000000..ec43087616 --- /dev/null +++ b/Lang/Pascal/Cholesky-decomposition @@ -0,0 +1 @@ +../../Task/Cholesky-decomposition/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Collections b/Lang/Pascal/Collections new file mode 120000 index 0000000000..9516e93bd2 --- /dev/null +++ b/Lang/Pascal/Collections @@ -0,0 +1 @@ +../../Task/Collections/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Combinations b/Lang/Pascal/Combinations new file mode 120000 index 0000000000..58e490303f --- /dev/null +++ b/Lang/Pascal/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Comments b/Lang/Pascal/Comments new file mode 120000 index 0000000000..54042e615d --- /dev/null +++ b/Lang/Pascal/Comments @@ -0,0 +1 @@ +../../Task/Comments/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Compile-time-calculation b/Lang/Pascal/Compile-time-calculation new file mode 120000 index 0000000000..29404c2804 --- /dev/null +++ b/Lang/Pascal/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Compound-data-type b/Lang/Pascal/Compound-data-type new file mode 120000 index 0000000000..4867b898f5 --- /dev/null +++ b/Lang/Pascal/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Conditional-structures b/Lang/Pascal/Conditional-structures new file mode 120000 index 0000000000..c681bf9289 --- /dev/null +++ b/Lang/Pascal/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Count-in-factors b/Lang/Pascal/Count-in-factors new file mode 120000 index 0000000000..0de18a118f --- /dev/null +++ b/Lang/Pascal/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Create-a-file b/Lang/Pascal/Create-a-file new file mode 120000 index 0000000000..027f3e967f --- /dev/null +++ b/Lang/Pascal/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Create-a-two-dimensional-array-at-runtime b/Lang/Pascal/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..fcc277d837 --- /dev/null +++ b/Lang/Pascal/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Date-format b/Lang/Pascal/Date-format new file mode 120000 index 0000000000..013508514a --- /dev/null +++ b/Lang/Pascal/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Define-a-primitive-data-type b/Lang/Pascal/Define-a-primitive-data-type new file mode 120000 index 0000000000..83b25ce916 --- /dev/null +++ b/Lang/Pascal/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Determine-if-a-string-is-numeric b/Lang/Pascal/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..8cdc447158 --- /dev/null +++ b/Lang/Pascal/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Doubly-linked-list-Element-definition b/Lang/Pascal/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..0a3fa4f20e --- /dev/null +++ b/Lang/Pascal/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Doubly-linked-list-Element-insertion b/Lang/Pascal/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..56a477b291 --- /dev/null +++ b/Lang/Pascal/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Draw-a-cuboid b/Lang/Pascal/Draw-a-cuboid new file mode 120000 index 0000000000..ddfc047072 --- /dev/null +++ b/Lang/Pascal/Draw-a-cuboid @@ -0,0 +1 @@ +../../Task/Draw-a-cuboid/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Empty-program b/Lang/Pascal/Empty-program new file mode 120000 index 0000000000..454e7023ba --- /dev/null +++ b/Lang/Pascal/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Equilibrium-index b/Lang/Pascal/Equilibrium-index new file mode 120000 index 0000000000..766c26bacb --- /dev/null +++ b/Lang/Pascal/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Ethiopian-multiplication b/Lang/Pascal/Ethiopian-multiplication new file mode 120000 index 0000000000..53e5b905d2 --- /dev/null +++ b/Lang/Pascal/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Even-or-odd b/Lang/Pascal/Even-or-odd new file mode 120000 index 0000000000..76457e9338 --- /dev/null +++ b/Lang/Pascal/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Execute-a-system-command b/Lang/Pascal/Execute-a-system-command new file mode 120000 index 0000000000..5111e138a7 --- /dev/null +++ b/Lang/Pascal/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Exponentiation-operator b/Lang/Pascal/Exponentiation-operator new file mode 120000 index 0000000000..65ae467183 --- /dev/null +++ b/Lang/Pascal/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Factorial b/Lang/Pascal/Factorial new file mode 120000 index 0000000000..fddbe8aa15 --- /dev/null +++ b/Lang/Pascal/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Factors-of-a-Mersenne-number b/Lang/Pascal/Factors-of-a-Mersenne-number new file mode 120000 index 0000000000..46b7e077bc --- /dev/null +++ b/Lang/Pascal/Factors-of-a-Mersenne-number @@ -0,0 +1 @@ +../../Task/Factors-of-a-Mersenne-number/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Factors-of-an-integer b/Lang/Pascal/Factors-of-an-integer new file mode 120000 index 0000000000..5b8264b5c6 --- /dev/null +++ b/Lang/Pascal/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Fibonacci-n-step-number-sequences b/Lang/Pascal/Fibonacci-n-step-number-sequences new file mode 120000 index 0000000000..9045b26c3d --- /dev/null +++ b/Lang/Pascal/Fibonacci-n-step-number-sequences @@ -0,0 +1 @@ +../../Task/Fibonacci-n-step-number-sequences/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Fibonacci-sequence b/Lang/Pascal/Fibonacci-sequence new file mode 120000 index 0000000000..8edbd1f8e5 --- /dev/null +++ b/Lang/Pascal/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Filter b/Lang/Pascal/Filter new file mode 120000 index 0000000000..378e5080e9 --- /dev/null +++ b/Lang/Pascal/Filter @@ -0,0 +1 @@ +../../Task/Filter/Pascal \ No newline at end of file diff --git a/Lang/Pascal/FizzBuzz b/Lang/Pascal/FizzBuzz new file mode 120000 index 0000000000..786dae3647 --- /dev/null +++ b/Lang/Pascal/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Flow-control-structures b/Lang/Pascal/Flow-control-structures new file mode 120000 index 0000000000..af5c31a65c --- /dev/null +++ b/Lang/Pascal/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Floyds-triangle b/Lang/Pascal/Floyds-triangle new file mode 120000 index 0000000000..a32b7a5191 --- /dev/null +++ b/Lang/Pascal/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Forward-difference b/Lang/Pascal/Forward-difference new file mode 120000 index 0000000000..d566351a73 --- /dev/null +++ b/Lang/Pascal/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Function-definition b/Lang/Pascal/Function-definition new file mode 120000 index 0000000000..b31c578ca0 --- /dev/null +++ b/Lang/Pascal/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Generic-swap b/Lang/Pascal/Generic-swap new file mode 120000 index 0000000000..2a478aa518 --- /dev/null +++ b/Lang/Pascal/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Globally-replace-text-in-several-files b/Lang/Pascal/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..ef5345616e --- /dev/null +++ b/Lang/Pascal/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Greatest-common-divisor b/Lang/Pascal/Greatest-common-divisor new file mode 120000 index 0000000000..b28f43e35b --- /dev/null +++ b/Lang/Pascal/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Greatest-subsequential-sum b/Lang/Pascal/Greatest-subsequential-sum new file mode 120000 index 0000000000..cd48542136 --- /dev/null +++ b/Lang/Pascal/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Guess-the-number b/Lang/Pascal/Guess-the-number new file mode 120000 index 0000000000..2dc9ae8de4 --- /dev/null +++ b/Lang/Pascal/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Guess-the-number-With-feedback-player b/Lang/Pascal/Guess-the-number-With-feedback-player new file mode 120000 index 0000000000..40a3bd4aa4 --- /dev/null +++ b/Lang/Pascal/Guess-the-number-With-feedback-player @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback-player/Pascal \ No newline at end of file diff --git a/Lang/Pascal/HTTP b/Lang/Pascal/HTTP new file mode 120000 index 0000000000..08488386b1 --- /dev/null +++ b/Lang/Pascal/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Happy-numbers b/Lang/Pascal/Happy-numbers new file mode 120000 index 0000000000..599c15e497 --- /dev/null +++ b/Lang/Pascal/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hash-from-two-arrays b/Lang/Pascal/Hash-from-two-arrays new file mode 120000 index 0000000000..4f95c82865 --- /dev/null +++ b/Lang/Pascal/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Haversine-formula b/Lang/Pascal/Haversine-formula new file mode 120000 index 0000000000..56fc581f8e --- /dev/null +++ b/Lang/Pascal/Haversine-formula @@ -0,0 +1 @@ +../../Task/Haversine-formula/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hello-world-Graphical b/Lang/Pascal/Hello-world-Graphical new file mode 120000 index 0000000000..b34c464c4d --- /dev/null +++ b/Lang/Pascal/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hello-world-Line-printer b/Lang/Pascal/Hello-world-Line-printer new file mode 120000 index 0000000000..372e4b96ae --- /dev/null +++ b/Lang/Pascal/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hello-world-Newline-omission b/Lang/Pascal/Hello-world-Newline-omission new file mode 120000 index 0000000000..bc550b360a --- /dev/null +++ b/Lang/Pascal/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hello-world-Standard-error b/Lang/Pascal/Hello-world-Standard-error new file mode 120000 index 0000000000..7f69568f45 --- /dev/null +++ b/Lang/Pascal/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hello-world-Text b/Lang/Pascal/Hello-world-Text new file mode 120000 index 0000000000..cd6eb2a301 --- /dev/null +++ b/Lang/Pascal/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Higher-order-functions b/Lang/Pascal/Higher-order-functions new file mode 120000 index 0000000000..6dbf8628dc --- /dev/null +++ b/Lang/Pascal/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hofstadter-Q-sequence b/Lang/Pascal/Hofstadter-Q-sequence new file mode 120000 index 0000000000..b6c3623ed0 --- /dev/null +++ b/Lang/Pascal/Hofstadter-Q-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Q-sequence/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Horizontal-sundial-calculations b/Lang/Pascal/Horizontal-sundial-calculations new file mode 120000 index 0000000000..e73917719c --- /dev/null +++ b/Lang/Pascal/Horizontal-sundial-calculations @@ -0,0 +1 @@ +../../Task/Horizontal-sundial-calculations/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Horners-rule-for-polynomial-evaluation b/Lang/Pascal/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..8f8e6a70f1 --- /dev/null +++ b/Lang/Pascal/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Host-introspection b/Lang/Pascal/Host-introspection new file mode 120000 index 0000000000..85bcbb17dd --- /dev/null +++ b/Lang/Pascal/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Hostname b/Lang/Pascal/Hostname new file mode 120000 index 0000000000..0fb5bb4cb6 --- /dev/null +++ b/Lang/Pascal/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Identity-matrix b/Lang/Pascal/Identity-matrix new file mode 120000 index 0000000000..d35805e4dc --- /dev/null +++ b/Lang/Pascal/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Image-noise b/Lang/Pascal/Image-noise new file mode 120000 index 0000000000..63a111f45c --- /dev/null +++ b/Lang/Pascal/Image-noise @@ -0,0 +1 @@ +../../Task/Image-noise/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Input-loop b/Lang/Pascal/Input-loop new file mode 120000 index 0000000000..6b4d828192 --- /dev/null +++ b/Lang/Pascal/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Integer-comparison b/Lang/Pascal/Integer-comparison new file mode 120000 index 0000000000..4813fdd74d --- /dev/null +++ b/Lang/Pascal/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Integer-sequence b/Lang/Pascal/Integer-sequence new file mode 120000 index 0000000000..9e2c0c9030 --- /dev/null +++ b/Lang/Pascal/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Pascal/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..6592354ec0 --- /dev/null +++ b/Lang/Pascal/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Knapsack-problem-Unbounded b/Lang/Pascal/Knapsack-problem-Unbounded new file mode 120000 index 0000000000..b95adeb38a --- /dev/null +++ b/Lang/Pascal/Knapsack-problem-Unbounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Unbounded/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Knuth-shuffle b/Lang/Pascal/Knuth-shuffle new file mode 120000 index 0000000000..bd2f6bf25a --- /dev/null +++ b/Lang/Pascal/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Least-common-multiple b/Lang/Pascal/Least-common-multiple new file mode 120000 index 0000000000..36cd99fb9f --- /dev/null +++ b/Lang/Pascal/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Letter-frequency b/Lang/Pascal/Letter-frequency new file mode 120000 index 0000000000..bdb54ab7fd --- /dev/null +++ b/Lang/Pascal/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Levenshtein-distance b/Lang/Pascal/Levenshtein-distance new file mode 120000 index 0000000000..aa9f13dc0f --- /dev/null +++ b/Lang/Pascal/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Linear-congruential-generator b/Lang/Pascal/Linear-congruential-generator new file mode 120000 index 0000000000..160ce1c58d --- /dev/null +++ b/Lang/Pascal/Linear-congruential-generator @@ -0,0 +1 @@ +../../Task/Linear-congruential-generator/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Logical-operations b/Lang/Pascal/Logical-operations new file mode 120000 index 0000000000..00f4a940d2 --- /dev/null +++ b/Lang/Pascal/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Longest-common-subsequence b/Lang/Pascal/Longest-common-subsequence new file mode 120000 index 0000000000..90bbfdc0ff --- /dev/null +++ b/Lang/Pascal/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Longest-string-challenge b/Lang/Pascal/Longest-string-challenge new file mode 120000 index 0000000000..c35b31ed68 --- /dev/null +++ b/Lang/Pascal/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Look-and-say-sequence b/Lang/Pascal/Look-and-say-sequence new file mode 120000 index 0000000000..8cffde677d --- /dev/null +++ b/Lang/Pascal/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Loops-Do-while b/Lang/Pascal/Loops-Do-while new file mode 120000 index 0000000000..149daef36e --- /dev/null +++ b/Lang/Pascal/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Loops-Downward-for b/Lang/Pascal/Loops-Downward-for new file mode 120000 index 0000000000..11ca4a4f88 --- /dev/null +++ b/Lang/Pascal/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Loops-For b/Lang/Pascal/Loops-For new file mode 120000 index 0000000000..26cf6efd99 --- /dev/null +++ b/Lang/Pascal/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Loops-Infinite b/Lang/Pascal/Loops-Infinite new file mode 120000 index 0000000000..8a82e31d6e --- /dev/null +++ b/Lang/Pascal/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Loops-N-plus-one-half b/Lang/Pascal/Loops-N-plus-one-half new file mode 120000 index 0000000000..05a55c8068 --- /dev/null +++ b/Lang/Pascal/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Loops-While b/Lang/Pascal/Loops-While new file mode 120000 index 0000000000..c12e017f5a --- /dev/null +++ b/Lang/Pascal/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Lucas-Lehmer-test b/Lang/Pascal/Lucas-Lehmer-test new file mode 120000 index 0000000000..17b8e15174 --- /dev/null +++ b/Lang/Pascal/Lucas-Lehmer-test @@ -0,0 +1 @@ +../../Task/Lucas-Lehmer-test/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Luhn-test-of-credit-card-numbers b/Lang/Pascal/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..db2515dc1b --- /dev/null +++ b/Lang/Pascal/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Map-range b/Lang/Pascal/Map-range new file mode 120000 index 0000000000..71c05c40ec --- /dev/null +++ b/Lang/Pascal/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Matrix-transposition b/Lang/Pascal/Matrix-transposition new file mode 120000 index 0000000000..d83a9a78bf --- /dev/null +++ b/Lang/Pascal/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Memory-allocation b/Lang/Pascal/Memory-allocation new file mode 120000 index 0000000000..b9769b7d9c --- /dev/null +++ b/Lang/Pascal/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Memory-layout-of-a-data-structure b/Lang/Pascal/Memory-layout-of-a-data-structure new file mode 120000 index 0000000000..91ce3d87af --- /dev/null +++ b/Lang/Pascal/Memory-layout-of-a-data-structure @@ -0,0 +1 @@ +../../Task/Memory-layout-of-a-data-structure/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Modular-exponentiation b/Lang/Pascal/Modular-exponentiation new file mode 120000 index 0000000000..4efc27d8d9 --- /dev/null +++ b/Lang/Pascal/Modular-exponentiation @@ -0,0 +1 @@ +../../Task/Modular-exponentiation/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Monte-Carlo-methods b/Lang/Pascal/Monte-Carlo-methods new file mode 120000 index 0000000000..78e2d48d53 --- /dev/null +++ b/Lang/Pascal/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Mutual-recursion b/Lang/Pascal/Mutual-recursion new file mode 120000 index 0000000000..3e67d307a8 --- /dev/null +++ b/Lang/Pascal/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Pi b/Lang/Pascal/Pi new file mode 120000 index 0000000000..d0a39691fd --- /dev/null +++ b/Lang/Pascal/Pi @@ -0,0 +1 @@ +../../Task/Pi/Pascal \ No newline at end of file diff --git a/Lang/Pascal/Quine b/Lang/Pascal/Quine new file mode 120000 index 0000000000..a2c8e2629a --- /dev/null +++ b/Lang/Pascal/Quine @@ -0,0 +1 @@ +../../Task/Quine/Pascal \ No newline at end of file diff --git a/Lang/Pentium-Assembly/0DESCRIPTION b/Lang/Pentium-Assembly/0DESCRIPTION new file mode 100644 index 0000000000..95309450b0 --- /dev/null +++ b/Lang/Pentium-Assembly/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{assembler language}}{{stub}} \ No newline at end of file diff --git a/Lang/Perl-6/0DESCRIPTION b/Lang/Perl-6/0DESCRIPTION new file mode 100644 index 0000000000..d0a480c788 --- /dev/null +++ b/Lang/Perl-6/0DESCRIPTION @@ -0,0 +1,27 @@ +{{language|Perl 6 +|site=http://perl6.org/ +|checking=both +|gc=yes +|strength=gradual +|safety=both +|compat=Nominative, Duck +|parampass=both +|tags=perl6}} +{{language programming paradigm|Dynamic}} +{{language programming paradigm|imperative}} +{{language programming paradigm|procedural}} +{{language programming paradigm|reflective}} +{{language programming paradigm|functional}} +{{language programming paradigm|object-oriented}} +{{language programming paradigm|generic}} +Perl 6 is the up-and-coming little sister to Perl 5. Though it resembles previous versions of [[Perl]] to no small degree, Perl 6 is substantially a new language; by design, it isn't backwards-compatible with Perl 5. In development since 2000, Perl 6 still lacks a complete implementation of its specification, the [http://perlcabal.org/syn/ Synopses]. However, more than one implementation is getting close to that goal. + +Damian Conway described the basic philosophy of Perl 6 as follows: + +
The Perl 6 design process is about keeping what works in Perl 5, fixing what doesn't, and adding what's missing. That means there will be a few fundamental changes to the language, a large number of extensions to existing features, and a handful of completely new ideas. These modifications, enhancements, and innovations will work together to make the future Perl even more insanely great -- without, we hope, making it even more greatly insane.
+ +Major new features include multiple dispatch, declarative classes, grammars, formal parameters to subroutines, type constraints on variables, lazy evaluation, junctions, meta-operators, and the ability to change Perl's syntax at will with hygienic macros and user-defined operators. + +There are several different implementations of Perl 6. They vary widely in design goals, degree of completeness, and current development activity. At present, the implementations closest to matching the specification are [[Pugs]], written in [[Haskell]] and primarily of historical interest, [[Rakudo]], built on the [http://www.parrot.org Parrot] virtual machine, and [[Niecza]], built on the .NET/[http://mono-project.com/ Mono] platform. + +
\ No newline at end of file diff --git a/Lang/Perl-6/100-doors b/Lang/Perl-6/100-doors new file mode 120000 index 0000000000..844dbccae6 --- /dev/null +++ b/Lang/Perl-6/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/24-game b/Lang/Perl-6/24-game new file mode 120000 index 0000000000..e05cb6042a --- /dev/null +++ b/Lang/Perl-6/24-game @@ -0,0 +1 @@ +../../Task/24-game/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/24-game-Solve b/Lang/Perl-6/24-game-Solve new file mode 120000 index 0000000000..3952806fb7 --- /dev/null +++ b/Lang/Perl-6/24-game-Solve @@ -0,0 +1 @@ +../../Task/24-game-Solve/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/99-Bottles-of-Beer b/Lang/Perl-6/99-Bottles-of-Beer new file mode 120000 index 0000000000..395217a157 --- /dev/null +++ b/Lang/Perl-6/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/A+B b/Lang/Perl-6/A+B new file mode 120000 index 0000000000..0f37c19ddd --- /dev/null +++ b/Lang/Perl-6/A+B @@ -0,0 +1 @@ +../../Task/A+B/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Abstract-type b/Lang/Perl-6/Abstract-type new file mode 120000 index 0000000000..0239fb6959 --- /dev/null +++ b/Lang/Perl-6/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Accumulator-factory b/Lang/Perl-6/Accumulator-factory new file mode 120000 index 0000000000..c88a1f485a --- /dev/null +++ b/Lang/Perl-6/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Ackermann-function b/Lang/Perl-6/Ackermann-function new file mode 120000 index 0000000000..c104d305b8 --- /dev/null +++ b/Lang/Perl-6/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Add-a-variable-to-a-class-instance-at-runtime b/Lang/Perl-6/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..ab4a4c29bb --- /dev/null +++ b/Lang/Perl-6/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Address-of-a-variable b/Lang/Perl-6/Address-of-a-variable new file mode 120000 index 0000000000..dd8318b201 --- /dev/null +++ b/Lang/Perl-6/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Align-columns b/Lang/Perl-6/Align-columns new file mode 120000 index 0000000000..b854a8debb --- /dev/null +++ b/Lang/Perl-6/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Anagrams b/Lang/Perl-6/Anagrams new file mode 120000 index 0000000000..9ee128987e --- /dev/null +++ b/Lang/Perl-6/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Anagrams-Deranged-anagrams b/Lang/Perl-6/Anagrams-Deranged-anagrams new file mode 120000 index 0000000000..5e5f10ab90 --- /dev/null +++ b/Lang/Perl-6/Anagrams-Deranged-anagrams @@ -0,0 +1 @@ +../../Task/Anagrams-Deranged-anagrams/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Anonymous-recursion b/Lang/Perl-6/Anonymous-recursion new file mode 120000 index 0000000000..c646882fd9 --- /dev/null +++ b/Lang/Perl-6/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Apply-a-callback-to-an-array b/Lang/Perl-6/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..3f31a32624 --- /dev/null +++ b/Lang/Perl-6/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Arbitrary-precision-integers-included b/Lang/Perl-6/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..26535d1bb0 --- /dev/null +++ b/Lang/Perl-6/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Arithmetic-Complex b/Lang/Perl-6/Arithmetic-Complex new file mode 120000 index 0000000000..fa7e604e64 --- /dev/null +++ b/Lang/Perl-6/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Arithmetic-Integer b/Lang/Perl-6/Arithmetic-Integer new file mode 120000 index 0000000000..5ae962c6ad --- /dev/null +++ b/Lang/Perl-6/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Arithmetic-Rational b/Lang/Perl-6/Arithmetic-Rational new file mode 120000 index 0000000000..8c0cfea140 --- /dev/null +++ b/Lang/Perl-6/Arithmetic-Rational @@ -0,0 +1 @@ +../../Task/Arithmetic-Rational/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Arithmetic-evaluation b/Lang/Perl-6/Arithmetic-evaluation new file mode 120000 index 0000000000..facaa00b56 --- /dev/null +++ b/Lang/Perl-6/Arithmetic-evaluation @@ -0,0 +1 @@ +../../Task/Arithmetic-evaluation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Arithmetic-geometric-mean b/Lang/Perl-6/Arithmetic-geometric-mean new file mode 120000 index 0000000000..d723932308 --- /dev/null +++ b/Lang/Perl-6/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Array-concatenation b/Lang/Perl-6/Array-concatenation new file mode 120000 index 0000000000..25d24ea984 --- /dev/null +++ b/Lang/Perl-6/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Arrays b/Lang/Perl-6/Arrays new file mode 120000 index 0000000000..321f440db3 --- /dev/null +++ b/Lang/Perl-6/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Assertions b/Lang/Perl-6/Assertions new file mode 120000 index 0000000000..46a81a5ccf --- /dev/null +++ b/Lang/Perl-6/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Associative-array-Creation b/Lang/Perl-6/Associative-array-Creation new file mode 120000 index 0000000000..bf3aada1de --- /dev/null +++ b/Lang/Perl-6/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Associative-array-Iteration b/Lang/Perl-6/Associative-array-Iteration new file mode 120000 index 0000000000..af0f6bbabe --- /dev/null +++ b/Lang/Perl-6/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Average-loop-length b/Lang/Perl-6/Average-loop-length new file mode 120000 index 0000000000..c1659ccea3 --- /dev/null +++ b/Lang/Perl-6/Average-loop-length @@ -0,0 +1 @@ +../../Task/Average-loop-length/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Arithmetic-mean b/Lang/Perl-6/Averages-Arithmetic-mean new file mode 120000 index 0000000000..02bc4117a6 --- /dev/null +++ b/Lang/Perl-6/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Mean-angle b/Lang/Perl-6/Averages-Mean-angle new file mode 120000 index 0000000000..3d1b4c095b --- /dev/null +++ b/Lang/Perl-6/Averages-Mean-angle @@ -0,0 +1 @@ +../../Task/Averages-Mean-angle/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Mean-time-of-day b/Lang/Perl-6/Averages-Mean-time-of-day new file mode 120000 index 0000000000..274b6134fa --- /dev/null +++ b/Lang/Perl-6/Averages-Mean-time-of-day @@ -0,0 +1 @@ +../../Task/Averages-Mean-time-of-day/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Median b/Lang/Perl-6/Averages-Median new file mode 120000 index 0000000000..e73f672c3b --- /dev/null +++ b/Lang/Perl-6/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Mode b/Lang/Perl-6/Averages-Mode new file mode 120000 index 0000000000..cebe20d6f7 --- /dev/null +++ b/Lang/Perl-6/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Pythagorean-means b/Lang/Perl-6/Averages-Pythagorean-means new file mode 120000 index 0000000000..5fa4ecd2f6 --- /dev/null +++ b/Lang/Perl-6/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Root-mean-square b/Lang/Perl-6/Averages-Root-mean-square new file mode 120000 index 0000000000..0f252753ac --- /dev/null +++ b/Lang/Perl-6/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Averages-Simple-moving-average b/Lang/Perl-6/Averages-Simple-moving-average new file mode 120000 index 0000000000..851799d7dc --- /dev/null +++ b/Lang/Perl-6/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Balanced-brackets b/Lang/Perl-6/Balanced-brackets new file mode 120000 index 0000000000..96c3b3b5b8 --- /dev/null +++ b/Lang/Perl-6/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Balanced-ternary b/Lang/Perl-6/Balanced-ternary new file mode 120000 index 0000000000..eb93764f8a --- /dev/null +++ b/Lang/Perl-6/Balanced-ternary @@ -0,0 +1 @@ +../../Task/Balanced-ternary/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Best-shuffle b/Lang/Perl-6/Best-shuffle new file mode 120000 index 0000000000..0fb33b9357 --- /dev/null +++ b/Lang/Perl-6/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Binary-search b/Lang/Perl-6/Binary-search new file mode 120000 index 0000000000..5f6261b758 --- /dev/null +++ b/Lang/Perl-6/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Binary-strings b/Lang/Perl-6/Binary-strings new file mode 120000 index 0000000000..a734ac5003 --- /dev/null +++ b/Lang/Perl-6/Binary-strings @@ -0,0 +1 @@ +../../Task/Binary-strings/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bitcoin-address-validation b/Lang/Perl-6/Bitcoin-address-validation new file mode 120000 index 0000000000..1e6df1555d --- /dev/null +++ b/Lang/Perl-6/Bitcoin-address-validation @@ -0,0 +1 @@ +../../Task/Bitcoin-address-validation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bitmap b/Lang/Perl-6/Bitmap new file mode 120000 index 0000000000..6323afe1fb --- /dev/null +++ b/Lang/Perl-6/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bitmap-Bresenhams-line-algorithm b/Lang/Perl-6/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..a486afe8a8 --- /dev/null +++ b/Lang/Perl-6/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bitmap-Write-a-PPM-file b/Lang/Perl-6/Bitmap-Write-a-PPM-file new file mode 120000 index 0000000000..71825bb6fa --- /dev/null +++ b/Lang/Perl-6/Bitmap-Write-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Write-a-PPM-file/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bitwise-IO b/Lang/Perl-6/Bitwise-IO new file mode 120000 index 0000000000..b99d34c0f3 --- /dev/null +++ b/Lang/Perl-6/Bitwise-IO @@ -0,0 +1 @@ +../../Task/Bitwise-IO/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bitwise-operations b/Lang/Perl-6/Bitwise-operations new file mode 120000 index 0000000000..893302150d --- /dev/null +++ b/Lang/Perl-6/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Boolean-values b/Lang/Perl-6/Boolean-values new file mode 120000 index 0000000000..d4407c842d --- /dev/null +++ b/Lang/Perl-6/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Box-the-compass b/Lang/Perl-6/Box-the-compass new file mode 120000 index 0000000000..f252e53203 --- /dev/null +++ b/Lang/Perl-6/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Break-OO-privacy b/Lang/Perl-6/Break-OO-privacy new file mode 120000 index 0000000000..af62383538 --- /dev/null +++ b/Lang/Perl-6/Break-OO-privacy @@ -0,0 +1 @@ +../../Task/Break-OO-privacy/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bulls-and-cows b/Lang/Perl-6/Bulls-and-cows new file mode 120000 index 0000000000..ba0714d22d --- /dev/null +++ b/Lang/Perl-6/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Bulls-and-cows-Player b/Lang/Perl-6/Bulls-and-cows-Player new file mode 120000 index 0000000000..011773a2fe --- /dev/null +++ b/Lang/Perl-6/Bulls-and-cows-Player @@ -0,0 +1 @@ +../../Task/Bulls-and-cows-Player/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/CRC-32 b/Lang/Perl-6/CRC-32 new file mode 120000 index 0000000000..44d005b233 --- /dev/null +++ b/Lang/Perl-6/CRC-32 @@ -0,0 +1 @@ +../../Task/CRC-32/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/CSV-to-HTML-translation b/Lang/Perl-6/CSV-to-HTML-translation new file mode 120000 index 0000000000..b09ab2e552 --- /dev/null +++ b/Lang/Perl-6/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Caesar-cipher b/Lang/Perl-6/Caesar-cipher new file mode 120000 index 0000000000..69d2b08774 --- /dev/null +++ b/Lang/Perl-6/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Calendar b/Lang/Perl-6/Calendar new file mode 120000 index 0000000000..5b38f30b7f --- /dev/null +++ b/Lang/Perl-6/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Calendar-for-real-programmers b/Lang/Perl-6/Calendar-for-real-programmers new file mode 120000 index 0000000000..c088e3414a --- /dev/null +++ b/Lang/Perl-6/Calendar-for-real-programmers @@ -0,0 +1 @@ +../../Task/Calendar-for-real-programmers/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Call-a-foreign-language-function b/Lang/Perl-6/Call-a-foreign-language-function new file mode 120000 index 0000000000..b6972f58b0 --- /dev/null +++ b/Lang/Perl-6/Call-a-foreign-language-function @@ -0,0 +1 @@ +../../Task/Call-a-foreign-language-function/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Call-a-function b/Lang/Perl-6/Call-a-function new file mode 120000 index 0000000000..40cf1e0684 --- /dev/null +++ b/Lang/Perl-6/Call-a-function @@ -0,0 +1 @@ +../../Task/Call-a-function/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Call-a-function-in-a-shared-library b/Lang/Perl-6/Call-a-function-in-a-shared-library new file mode 120000 index 0000000000..44796ad5f8 --- /dev/null +++ b/Lang/Perl-6/Call-a-function-in-a-shared-library @@ -0,0 +1 @@ +../../Task/Call-a-function-in-a-shared-library/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Call-an-object-method b/Lang/Perl-6/Call-an-object-method new file mode 120000 index 0000000000..a26b3a8c8a --- /dev/null +++ b/Lang/Perl-6/Call-an-object-method @@ -0,0 +1 @@ +../../Task/Call-an-object-method/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Carmichael-3-strong-pseudoprimes b/Lang/Perl-6/Carmichael-3-strong-pseudoprimes new file mode 120000 index 0000000000..e1839f1971 --- /dev/null +++ b/Lang/Perl-6/Carmichael-3-strong-pseudoprimes @@ -0,0 +1 @@ +../../Task/Carmichael-3-strong-pseudoprimes/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Case-sensitivity-of-identifiers b/Lang/Perl-6/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..d063ff47de --- /dev/null +++ b/Lang/Perl-6/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Character-codes b/Lang/Perl-6/Character-codes new file mode 120000 index 0000000000..bc82e1b349 --- /dev/null +++ b/Lang/Perl-6/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Character-matching b/Lang/Perl-6/Character-matching new file mode 120000 index 0000000000..60d1c21291 --- /dev/null +++ b/Lang/Perl-6/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Check-Machin-like-formulas b/Lang/Perl-6/Check-Machin-like-formulas new file mode 120000 index 0000000000..0f6407647b --- /dev/null +++ b/Lang/Perl-6/Check-Machin-like-formulas @@ -0,0 +1 @@ +../../Task/Check-Machin-like-formulas/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Check-that-file-exists b/Lang/Perl-6/Check-that-file-exists new file mode 120000 index 0000000000..0fa90efe4f --- /dev/null +++ b/Lang/Perl-6/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Cholesky-decomposition b/Lang/Perl-6/Cholesky-decomposition new file mode 120000 index 0000000000..f371fe0df5 --- /dev/null +++ b/Lang/Perl-6/Cholesky-decomposition @@ -0,0 +1 @@ +../../Task/Cholesky-decomposition/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Classes b/Lang/Perl-6/Classes new file mode 120000 index 0000000000..0355710424 --- /dev/null +++ b/Lang/Perl-6/Classes @@ -0,0 +1 @@ +../../Task/Classes/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Closest-pair-problem b/Lang/Perl-6/Closest-pair-problem new file mode 120000 index 0000000000..fad4d098b3 --- /dev/null +++ b/Lang/Perl-6/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Collections b/Lang/Perl-6/Collections new file mode 120000 index 0000000000..528c442dc3 --- /dev/null +++ b/Lang/Perl-6/Collections @@ -0,0 +1 @@ +../../Task/Collections/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Combinations b/Lang/Perl-6/Combinations new file mode 120000 index 0000000000..f43efab8cb --- /dev/null +++ b/Lang/Perl-6/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Combinations-with-repetitions b/Lang/Perl-6/Combinations-with-repetitions new file mode 120000 index 0000000000..7a8cadf04c --- /dev/null +++ b/Lang/Perl-6/Combinations-with-repetitions @@ -0,0 +1 @@ +../../Task/Combinations-with-repetitions/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Command-line-arguments b/Lang/Perl-6/Command-line-arguments new file mode 120000 index 0000000000..6373af456a --- /dev/null +++ b/Lang/Perl-6/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Comments b/Lang/Perl-6/Comments new file mode 120000 index 0000000000..dca2e61738 --- /dev/null +++ b/Lang/Perl-6/Comments @@ -0,0 +1 @@ +../../Task/Comments/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Compile-time-calculation b/Lang/Perl-6/Compile-time-calculation new file mode 120000 index 0000000000..be3aec0b46 --- /dev/null +++ b/Lang/Perl-6/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Compound-data-type b/Lang/Perl-6/Compound-data-type new file mode 120000 index 0000000000..43e9a33a4c --- /dev/null +++ b/Lang/Perl-6/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Concurrent-computing b/Lang/Perl-6/Concurrent-computing new file mode 120000 index 0000000000..5ecffef851 --- /dev/null +++ b/Lang/Perl-6/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Conditional-structures b/Lang/Perl-6/Conditional-structures new file mode 120000 index 0000000000..058e9021df --- /dev/null +++ b/Lang/Perl-6/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Constrained-genericity b/Lang/Perl-6/Constrained-genericity new file mode 120000 index 0000000000..6f379de7b4 --- /dev/null +++ b/Lang/Perl-6/Constrained-genericity @@ -0,0 +1 @@ +../../Task/Constrained-genericity/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Constrained-random-points-on-a-circle b/Lang/Perl-6/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..b7f10c5bb0 --- /dev/null +++ b/Lang/Perl-6/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Continued-fraction b/Lang/Perl-6/Continued-fraction new file mode 120000 index 0000000000..76f5ae50ba --- /dev/null +++ b/Lang/Perl-6/Continued-fraction @@ -0,0 +1 @@ +../../Task/Continued-fraction/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Continued-fraction-Arithmetic-Construct-from-rational-number b/Lang/Perl-6/Continued-fraction-Arithmetic-Construct-from-rational-number new file mode 120000 index 0000000000..d52665698a --- /dev/null +++ b/Lang/Perl-6/Continued-fraction-Arithmetic-Construct-from-rational-number @@ -0,0 +1 @@ +../../Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Conways-Game-of-Life b/Lang/Perl-6/Conways-Game-of-Life new file mode 120000 index 0000000000..d71e03bd80 --- /dev/null +++ b/Lang/Perl-6/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Count-in-factors b/Lang/Perl-6/Count-in-factors new file mode 120000 index 0000000000..c6d9558fcc --- /dev/null +++ b/Lang/Perl-6/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Count-in-octal b/Lang/Perl-6/Count-in-octal new file mode 120000 index 0000000000..2461a94e39 --- /dev/null +++ b/Lang/Perl-6/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Count-occurrences-of-a-substring b/Lang/Perl-6/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..59e70cf023 --- /dev/null +++ b/Lang/Perl-6/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Count-the-coins b/Lang/Perl-6/Count-the-coins new file mode 120000 index 0000000000..e016fd7d1b --- /dev/null +++ b/Lang/Perl-6/Count-the-coins @@ -0,0 +1 @@ +../../Task/Count-the-coins/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Create-a-file b/Lang/Perl-6/Create-a-file new file mode 120000 index 0000000000..7a49271c1c --- /dev/null +++ b/Lang/Perl-6/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Create-a-two-dimensional-array-at-runtime b/Lang/Perl-6/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..264d0ccb93 --- /dev/null +++ b/Lang/Perl-6/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Create-an-HTML-table b/Lang/Perl-6/Create-an-HTML-table new file mode 120000 index 0000000000..0a65d0e0e0 --- /dev/null +++ b/Lang/Perl-6/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Date-format b/Lang/Perl-6/Date-format new file mode 120000 index 0000000000..0606935190 --- /dev/null +++ b/Lang/Perl-6/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Day-of-the-week b/Lang/Perl-6/Day-of-the-week new file mode 120000 index 0000000000..2058879190 --- /dev/null +++ b/Lang/Perl-6/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Deal-cards-for-FreeCell b/Lang/Perl-6/Deal-cards-for-FreeCell new file mode 120000 index 0000000000..84b763baf4 --- /dev/null +++ b/Lang/Perl-6/Deal-cards-for-FreeCell @@ -0,0 +1 @@ +../../Task/Deal-cards-for-FreeCell/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Death-Star b/Lang/Perl-6/Death-Star new file mode 120000 index 0000000000..d107800946 --- /dev/null +++ b/Lang/Perl-6/Death-Star @@ -0,0 +1 @@ +../../Task/Death-Star/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Deconvolution-1D b/Lang/Perl-6/Deconvolution-1D new file mode 120000 index 0000000000..df59acb337 --- /dev/null +++ b/Lang/Perl-6/Deconvolution-1D @@ -0,0 +1 @@ +../../Task/Deconvolution-1D/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Deconvolution-2D+ b/Lang/Perl-6/Deconvolution-2D+ new file mode 120000 index 0000000000..41c830a1d0 --- /dev/null +++ b/Lang/Perl-6/Deconvolution-2D+ @@ -0,0 +1 @@ +../../Task/Deconvolution-2D+/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Define-a-primitive-data-type b/Lang/Perl-6/Define-a-primitive-data-type new file mode 120000 index 0000000000..6222affbb4 --- /dev/null +++ b/Lang/Perl-6/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Delegates b/Lang/Perl-6/Delegates new file mode 120000 index 0000000000..8f8422c40d --- /dev/null +++ b/Lang/Perl-6/Delegates @@ -0,0 +1 @@ +../../Task/Delegates/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Delete-a-file b/Lang/Perl-6/Delete-a-file new file mode 120000 index 0000000000..be42529257 --- /dev/null +++ b/Lang/Perl-6/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Detect-division-by-zero b/Lang/Perl-6/Detect-division-by-zero new file mode 120000 index 0000000000..764fc80955 --- /dev/null +++ b/Lang/Perl-6/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Determine-if-a-string-is-numeric b/Lang/Perl-6/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..85fcd599e8 --- /dev/null +++ b/Lang/Perl-6/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Digital-root b/Lang/Perl-6/Digital-root new file mode 120000 index 0000000000..4c792b95eb --- /dev/null +++ b/Lang/Perl-6/Digital-root @@ -0,0 +1 @@ +../../Task/Digital-root/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Dinesmans-multiple-dwelling-problem b/Lang/Perl-6/Dinesmans-multiple-dwelling-problem new file mode 120000 index 0000000000..b725987040 --- /dev/null +++ b/Lang/Perl-6/Dinesmans-multiple-dwelling-problem @@ -0,0 +1 @@ +../../Task/Dinesmans-multiple-dwelling-problem/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Discordian-date b/Lang/Perl-6/Discordian-date new file mode 120000 index 0000000000..d017d4edb4 --- /dev/null +++ b/Lang/Perl-6/Discordian-date @@ -0,0 +1 @@ +../../Task/Discordian-date/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Documentation b/Lang/Perl-6/Documentation new file mode 120000 index 0000000000..d1df4afee0 --- /dev/null +++ b/Lang/Perl-6/Documentation @@ -0,0 +1 @@ +../../Task/Documentation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Dot-product b/Lang/Perl-6/Dot-product new file mode 120000 index 0000000000..c7782e8e3b --- /dev/null +++ b/Lang/Perl-6/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Doubly-linked-list-Definition b/Lang/Perl-6/Doubly-linked-list-Definition new file mode 120000 index 0000000000..49eca31742 --- /dev/null +++ b/Lang/Perl-6/Doubly-linked-list-Definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Definition/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Doubly-linked-list-Element-definition b/Lang/Perl-6/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..ac0834fdb0 --- /dev/null +++ b/Lang/Perl-6/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Doubly-linked-list-Element-insertion b/Lang/Perl-6/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..264cc26d4c --- /dev/null +++ b/Lang/Perl-6/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Doubly-linked-list-Traversal b/Lang/Perl-6/Doubly-linked-list-Traversal new file mode 120000 index 0000000000..1067c61676 --- /dev/null +++ b/Lang/Perl-6/Doubly-linked-list-Traversal @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Traversal/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Draw-a-cuboid b/Lang/Perl-6/Draw-a-cuboid new file mode 120000 index 0000000000..c5ecba3e07 --- /dev/null +++ b/Lang/Perl-6/Draw-a-cuboid @@ -0,0 +1 @@ +../../Task/Draw-a-cuboid/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Draw-a-sphere b/Lang/Perl-6/Draw-a-sphere new file mode 120000 index 0000000000..bb4316cf40 --- /dev/null +++ b/Lang/Perl-6/Draw-a-sphere @@ -0,0 +1 @@ +../../Task/Draw-a-sphere/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Dutch-national-flag-problem b/Lang/Perl-6/Dutch-national-flag-problem new file mode 120000 index 0000000000..75e3d51536 --- /dev/null +++ b/Lang/Perl-6/Dutch-national-flag-problem @@ -0,0 +1 @@ +../../Task/Dutch-national-flag-problem/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Dynamic-variable-names b/Lang/Perl-6/Dynamic-variable-names new file mode 120000 index 0000000000..86f75bcf76 --- /dev/null +++ b/Lang/Perl-6/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Echo-server b/Lang/Perl-6/Echo-server new file mode 120000 index 0000000000..dde07bf373 --- /dev/null +++ b/Lang/Perl-6/Echo-server @@ -0,0 +1 @@ +../../Task/Echo-server/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Element-wise-operations b/Lang/Perl-6/Element-wise-operations new file mode 120000 index 0000000000..e3223544b8 --- /dev/null +++ b/Lang/Perl-6/Element-wise-operations @@ -0,0 +1 @@ +../../Task/Element-wise-operations/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Empty-directory b/Lang/Perl-6/Empty-directory new file mode 120000 index 0000000000..88b0e6af68 --- /dev/null +++ b/Lang/Perl-6/Empty-directory @@ -0,0 +1 @@ +../../Task/Empty-directory/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Empty-program b/Lang/Perl-6/Empty-program new file mode 120000 index 0000000000..03ab06d80e --- /dev/null +++ b/Lang/Perl-6/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Empty-string b/Lang/Perl-6/Empty-string new file mode 120000 index 0000000000..ed5ec48362 --- /dev/null +++ b/Lang/Perl-6/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Enforced-immutability b/Lang/Perl-6/Enforced-immutability new file mode 120000 index 0000000000..d9855618dd --- /dev/null +++ b/Lang/Perl-6/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Entropy b/Lang/Perl-6/Entropy new file mode 120000 index 0000000000..8be2a21ba0 --- /dev/null +++ b/Lang/Perl-6/Entropy @@ -0,0 +1 @@ +../../Task/Entropy/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Enumerations b/Lang/Perl-6/Enumerations new file mode 120000 index 0000000000..1a163023a0 --- /dev/null +++ b/Lang/Perl-6/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Equilibrium-index b/Lang/Perl-6/Equilibrium-index new file mode 120000 index 0000000000..80b08824e1 --- /dev/null +++ b/Lang/Perl-6/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Ethiopian-multiplication b/Lang/Perl-6/Ethiopian-multiplication new file mode 120000 index 0000000000..45197c6171 --- /dev/null +++ b/Lang/Perl-6/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Euler-method b/Lang/Perl-6/Euler-method new file mode 120000 index 0000000000..e65dd8c45a --- /dev/null +++ b/Lang/Perl-6/Euler-method @@ -0,0 +1 @@ +../../Task/Euler-method/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Evaluate-binomial-coefficients b/Lang/Perl-6/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..be47330c1a --- /dev/null +++ b/Lang/Perl-6/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Even-or-odd b/Lang/Perl-6/Even-or-odd new file mode 120000 index 0000000000..63dd8cffb8 --- /dev/null +++ b/Lang/Perl-6/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Evolutionary-algorithm b/Lang/Perl-6/Evolutionary-algorithm new file mode 120000 index 0000000000..4526e5c75b --- /dev/null +++ b/Lang/Perl-6/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Exceptions b/Lang/Perl-6/Exceptions new file mode 120000 index 0000000000..2cdaff02cd --- /dev/null +++ b/Lang/Perl-6/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/Perl-6/Exceptions-Catch-an-exception-thrown-in-a-nested-call new file mode 120000 index 0000000000..b9c0226e2a --- /dev/null +++ b/Lang/Perl-6/Exceptions-Catch-an-exception-thrown-in-a-nested-call @@ -0,0 +1 @@ +../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Executable-library b/Lang/Perl-6/Executable-library new file mode 120000 index 0000000000..5cc5094bd2 --- /dev/null +++ b/Lang/Perl-6/Executable-library @@ -0,0 +1 @@ +../../Task/Executable-library/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Execute-HQ9+ b/Lang/Perl-6/Execute-HQ9+ new file mode 120000 index 0000000000..43e8fff44d --- /dev/null +++ b/Lang/Perl-6/Execute-HQ9+ @@ -0,0 +1 @@ +../../Task/Execute-HQ9+/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Execute-a-system-command b/Lang/Perl-6/Execute-a-system-command new file mode 120000 index 0000000000..b956b2fecb --- /dev/null +++ b/Lang/Perl-6/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Exponentiation-operator b/Lang/Perl-6/Exponentiation-operator new file mode 120000 index 0000000000..73ac68ec44 --- /dev/null +++ b/Lang/Perl-6/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Extend-your-language b/Lang/Perl-6/Extend-your-language new file mode 120000 index 0000000000..3648234d86 --- /dev/null +++ b/Lang/Perl-6/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Extreme-floating-point-values b/Lang/Perl-6/Extreme-floating-point-values new file mode 120000 index 0000000000..232a2d6cb8 --- /dev/null +++ b/Lang/Perl-6/Extreme-floating-point-values @@ -0,0 +1 @@ +../../Task/Extreme-floating-point-values/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Factorial b/Lang/Perl-6/Factorial new file mode 120000 index 0000000000..4d0fd9b253 --- /dev/null +++ b/Lang/Perl-6/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Factors-of-a-Mersenne-number b/Lang/Perl-6/Factors-of-a-Mersenne-number new file mode 120000 index 0000000000..a84881b576 --- /dev/null +++ b/Lang/Perl-6/Factors-of-a-Mersenne-number @@ -0,0 +1 @@ +../../Task/Factors-of-a-Mersenne-number/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Factors-of-an-integer b/Lang/Perl-6/Factors-of-an-integer new file mode 120000 index 0000000000..4bfe8f05e3 --- /dev/null +++ b/Lang/Perl-6/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Fast-Fourier-transform b/Lang/Perl-6/Fast-Fourier-transform new file mode 120000 index 0000000000..3b502c48fb --- /dev/null +++ b/Lang/Perl-6/Fast-Fourier-transform @@ -0,0 +1 @@ +../../Task/Fast-Fourier-transform/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Fibonacci-n-step-number-sequences b/Lang/Perl-6/Fibonacci-n-step-number-sequences new file mode 120000 index 0000000000..d07ec6333c --- /dev/null +++ b/Lang/Perl-6/Fibonacci-n-step-number-sequences @@ -0,0 +1 @@ +../../Task/Fibonacci-n-step-number-sequences/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Fibonacci-sequence b/Lang/Perl-6/Fibonacci-sequence new file mode 120000 index 0000000000..c86ca8d5f7 --- /dev/null +++ b/Lang/Perl-6/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/File-IO b/Lang/Perl-6/File-IO new file mode 120000 index 0000000000..31a7e6cf7b --- /dev/null +++ b/Lang/Perl-6/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/File-modification-time b/Lang/Perl-6/File-modification-time new file mode 120000 index 0000000000..d4e0222b71 --- /dev/null +++ b/Lang/Perl-6/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/File-size b/Lang/Perl-6/File-size new file mode 120000 index 0000000000..1a2b53bf9c --- /dev/null +++ b/Lang/Perl-6/File-size @@ -0,0 +1 @@ +../../Task/File-size/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Filter b/Lang/Perl-6/Filter new file mode 120000 index 0000000000..0f7852ef4c --- /dev/null +++ b/Lang/Perl-6/Filter @@ -0,0 +1 @@ +../../Task/Filter/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Find-common-directory-path b/Lang/Perl-6/Find-common-directory-path new file mode 120000 index 0000000000..9f91f4c169 --- /dev/null +++ b/Lang/Perl-6/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Find-largest-left-truncatable-prime-in-a-given-base b/Lang/Perl-6/Find-largest-left-truncatable-prime-in-a-given-base new file mode 120000 index 0000000000..0adcf36bb5 --- /dev/null +++ b/Lang/Perl-6/Find-largest-left-truncatable-prime-in-a-given-base @@ -0,0 +1 @@ +../../Task/Find-largest-left-truncatable-prime-in-a-given-base/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Find-limit-of-recursion b/Lang/Perl-6/Find-limit-of-recursion new file mode 120000 index 0000000000..7e6f8450fd --- /dev/null +++ b/Lang/Perl-6/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Find-the-missing-permutation b/Lang/Perl-6/Find-the-missing-permutation new file mode 120000 index 0000000000..816d830a01 --- /dev/null +++ b/Lang/Perl-6/Find-the-missing-permutation @@ -0,0 +1 @@ +../../Task/Find-the-missing-permutation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/First-class-functions b/Lang/Perl-6/First-class-functions new file mode 120000 index 0000000000..b6665aaed0 --- /dev/null +++ b/Lang/Perl-6/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/First-class-functions-Use-numbers-analogously b/Lang/Perl-6/First-class-functions-Use-numbers-analogously new file mode 120000 index 0000000000..6ec35463c3 --- /dev/null +++ b/Lang/Perl-6/First-class-functions-Use-numbers-analogously @@ -0,0 +1 @@ +../../Task/First-class-functions-Use-numbers-analogously/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Five-weekends b/Lang/Perl-6/Five-weekends new file mode 120000 index 0000000000..109e1ff9d3 --- /dev/null +++ b/Lang/Perl-6/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/FizzBuzz b/Lang/Perl-6/FizzBuzz new file mode 120000 index 0000000000..0767c9c9e0 --- /dev/null +++ b/Lang/Perl-6/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Flatten-a-list b/Lang/Perl-6/Flatten-a-list new file mode 120000 index 0000000000..7d42d1129c --- /dev/null +++ b/Lang/Perl-6/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Flow-control-structures b/Lang/Perl-6/Flow-control-structures new file mode 120000 index 0000000000..849df5ba1c --- /dev/null +++ b/Lang/Perl-6/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Floyds-triangle b/Lang/Perl-6/Floyds-triangle new file mode 120000 index 0000000000..a7086e87dc --- /dev/null +++ b/Lang/Perl-6/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Forest-fire b/Lang/Perl-6/Forest-fire new file mode 120000 index 0000000000..b172d59e30 --- /dev/null +++ b/Lang/Perl-6/Forest-fire @@ -0,0 +1 @@ +../../Task/Forest-fire/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Fork b/Lang/Perl-6/Fork new file mode 120000 index 0000000000..35b4cc0e5d --- /dev/null +++ b/Lang/Perl-6/Fork @@ -0,0 +1 @@ +../../Task/Fork/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Formal-power-series b/Lang/Perl-6/Formal-power-series new file mode 120000 index 0000000000..0bccc9d058 --- /dev/null +++ b/Lang/Perl-6/Formal-power-series @@ -0,0 +1 @@ +../../Task/Formal-power-series/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Formatted-numeric-output b/Lang/Perl-6/Formatted-numeric-output new file mode 120000 index 0000000000..d9e9d1fbdd --- /dev/null +++ b/Lang/Perl-6/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Forward-difference b/Lang/Perl-6/Forward-difference new file mode 120000 index 0000000000..a010d8af42 --- /dev/null +++ b/Lang/Perl-6/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Four-bit-adder b/Lang/Perl-6/Four-bit-adder new file mode 120000 index 0000000000..9cd109d17f --- /dev/null +++ b/Lang/Perl-6/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Fractal-tree b/Lang/Perl-6/Fractal-tree new file mode 120000 index 0000000000..bc690def40 --- /dev/null +++ b/Lang/Perl-6/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Function-composition b/Lang/Perl-6/Function-composition new file mode 120000 index 0000000000..82b43e0acc --- /dev/null +++ b/Lang/Perl-6/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Function-definition b/Lang/Perl-6/Function-definition new file mode 120000 index 0000000000..5e95c698e6 --- /dev/null +++ b/Lang/Perl-6/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Function-prototype b/Lang/Perl-6/Function-prototype new file mode 120000 index 0000000000..6c6431edda --- /dev/null +++ b/Lang/Perl-6/Function-prototype @@ -0,0 +1 @@ +../../Task/Function-prototype/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Gamma-function b/Lang/Perl-6/Gamma-function new file mode 120000 index 0000000000..4befe73cb5 --- /dev/null +++ b/Lang/Perl-6/Gamma-function @@ -0,0 +1 @@ +../../Task/Gamma-function/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Generator-Exponential b/Lang/Perl-6/Generator-Exponential new file mode 120000 index 0000000000..ddf35ba4e0 --- /dev/null +++ b/Lang/Perl-6/Generator-Exponential @@ -0,0 +1 @@ +../../Task/Generator-Exponential/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Generic-swap b/Lang/Perl-6/Generic-swap new file mode 120000 index 0000000000..70ca84739f --- /dev/null +++ b/Lang/Perl-6/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Globally-replace-text-in-several-files b/Lang/Perl-6/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..ca61a7387c --- /dev/null +++ b/Lang/Perl-6/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Gray-code b/Lang/Perl-6/Gray-code new file mode 120000 index 0000000000..26e641767c --- /dev/null +++ b/Lang/Perl-6/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Grayscale-image b/Lang/Perl-6/Grayscale-image new file mode 120000 index 0000000000..c5043f4cef --- /dev/null +++ b/Lang/Perl-6/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Greatest-common-divisor b/Lang/Perl-6/Greatest-common-divisor new file mode 120000 index 0000000000..e16dbb77e8 --- /dev/null +++ b/Lang/Perl-6/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Greatest-element-of-a-list b/Lang/Perl-6/Greatest-element-of-a-list new file mode 120000 index 0000000000..6c41d8ef34 --- /dev/null +++ b/Lang/Perl-6/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Greatest-subsequential-sum b/Lang/Perl-6/Greatest-subsequential-sum new file mode 120000 index 0000000000..e3564459f1 --- /dev/null +++ b/Lang/Perl-6/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Greyscale-bars-Display b/Lang/Perl-6/Greyscale-bars-Display new file mode 120000 index 0000000000..e6db88762b --- /dev/null +++ b/Lang/Perl-6/Greyscale-bars-Display @@ -0,0 +1 @@ +../../Task/Greyscale-bars-Display/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Guess-the-number b/Lang/Perl-6/Guess-the-number new file mode 120000 index 0000000000..527c23c4a4 --- /dev/null +++ b/Lang/Perl-6/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Guess-the-number-With-feedback b/Lang/Perl-6/Guess-the-number-With-feedback new file mode 120000 index 0000000000..443f9f94f7 --- /dev/null +++ b/Lang/Perl-6/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Guess-the-number-With-feedback-player b/Lang/Perl-6/Guess-the-number-With-feedback-player new file mode 120000 index 0000000000..6db52b3c91 --- /dev/null +++ b/Lang/Perl-6/Guess-the-number-With-feedback-player @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback-player/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/HTTP b/Lang/Perl-6/HTTP new file mode 120000 index 0000000000..16be8515d4 --- /dev/null +++ b/Lang/Perl-6/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hailstone-sequence b/Lang/Perl-6/Hailstone-sequence new file mode 120000 index 0000000000..62fe44680a --- /dev/null +++ b/Lang/Perl-6/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hamming-numbers b/Lang/Perl-6/Hamming-numbers new file mode 120000 index 0000000000..4cf4d56f42 --- /dev/null +++ b/Lang/Perl-6/Hamming-numbers @@ -0,0 +1 @@ +../../Task/Hamming-numbers/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Happy-numbers b/Lang/Perl-6/Happy-numbers new file mode 120000 index 0000000000..8d51765a47 --- /dev/null +++ b/Lang/Perl-6/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Harshad-or-Niven-series b/Lang/Perl-6/Harshad-or-Niven-series new file mode 120000 index 0000000000..374c24cfe2 --- /dev/null +++ b/Lang/Perl-6/Harshad-or-Niven-series @@ -0,0 +1 @@ +../../Task/Harshad-or-Niven-series/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hash-from-two-arrays b/Lang/Perl-6/Hash-from-two-arrays new file mode 120000 index 0000000000..02a1fb9724 --- /dev/null +++ b/Lang/Perl-6/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Haversine-formula b/Lang/Perl-6/Haversine-formula new file mode 120000 index 0000000000..ec50bd416b --- /dev/null +++ b/Lang/Perl-6/Haversine-formula @@ -0,0 +1 @@ +../../Task/Haversine-formula/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hello-world-Graphical b/Lang/Perl-6/Hello-world-Graphical new file mode 120000 index 0000000000..ee142dbf48 --- /dev/null +++ b/Lang/Perl-6/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hello-world-Line-printer b/Lang/Perl-6/Hello-world-Line-printer new file mode 120000 index 0000000000..c92b767366 --- /dev/null +++ b/Lang/Perl-6/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hello-world-Newline-omission b/Lang/Perl-6/Hello-world-Newline-omission new file mode 120000 index 0000000000..aefc072b02 --- /dev/null +++ b/Lang/Perl-6/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hello-world-Standard-error b/Lang/Perl-6/Hello-world-Standard-error new file mode 120000 index 0000000000..3952561426 --- /dev/null +++ b/Lang/Perl-6/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hello-world-Text b/Lang/Perl-6/Hello-world-Text new file mode 120000 index 0000000000..afde41de23 --- /dev/null +++ b/Lang/Perl-6/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hello-world-Web-server b/Lang/Perl-6/Hello-world-Web-server new file mode 120000 index 0000000000..2e6975d4d1 --- /dev/null +++ b/Lang/Perl-6/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Here-document b/Lang/Perl-6/Here-document new file mode 120000 index 0000000000..c7732fd786 --- /dev/null +++ b/Lang/Perl-6/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Higher-order-functions b/Lang/Perl-6/Higher-order-functions new file mode 120000 index 0000000000..98c535ee69 --- /dev/null +++ b/Lang/Perl-6/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hofstadter-Conway-$10,000-sequence b/Lang/Perl-6/Hofstadter-Conway-$10,000-sequence new file mode 120000 index 0000000000..01dbdb643e --- /dev/null +++ b/Lang/Perl-6/Hofstadter-Conway-$10,000-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Conway-$10,000-sequence/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hofstadter-Figure-Figure-sequences b/Lang/Perl-6/Hofstadter-Figure-Figure-sequences new file mode 120000 index 0000000000..9f90c09479 --- /dev/null +++ b/Lang/Perl-6/Hofstadter-Figure-Figure-sequences @@ -0,0 +1 @@ +../../Task/Hofstadter-Figure-Figure-sequences/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hofstadter-Q-sequence b/Lang/Perl-6/Hofstadter-Q-sequence new file mode 120000 index 0000000000..3b9f15c30a --- /dev/null +++ b/Lang/Perl-6/Hofstadter-Q-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Q-sequence/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Holidays-related-to-Easter b/Lang/Perl-6/Holidays-related-to-Easter new file mode 120000 index 0000000000..b0169e9273 --- /dev/null +++ b/Lang/Perl-6/Holidays-related-to-Easter @@ -0,0 +1 @@ +../../Task/Holidays-related-to-Easter/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Horizontal-sundial-calculations b/Lang/Perl-6/Horizontal-sundial-calculations new file mode 120000 index 0000000000..c784aca8db --- /dev/null +++ b/Lang/Perl-6/Horizontal-sundial-calculations @@ -0,0 +1 @@ +../../Task/Horizontal-sundial-calculations/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Horners-rule-for-polynomial-evaluation b/Lang/Perl-6/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..75c4cc0877 --- /dev/null +++ b/Lang/Perl-6/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Host-introspection b/Lang/Perl-6/Host-introspection new file mode 120000 index 0000000000..28a24bb0b9 --- /dev/null +++ b/Lang/Perl-6/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Hostname b/Lang/Perl-6/Hostname new file mode 120000 index 0000000000..d0d6d4ee4c --- /dev/null +++ b/Lang/Perl-6/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Huffman-coding b/Lang/Perl-6/Huffman-coding new file mode 120000 index 0000000000..fa365f553d --- /dev/null +++ b/Lang/Perl-6/Huffman-coding @@ -0,0 +1 @@ +../../Task/Huffman-coding/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Identity-matrix b/Lang/Perl-6/Identity-matrix new file mode 120000 index 0000000000..f8a216ba73 --- /dev/null +++ b/Lang/Perl-6/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Include-a-file b/Lang/Perl-6/Include-a-file new file mode 120000 index 0000000000..92f46ae4c8 --- /dev/null +++ b/Lang/Perl-6/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Increment-a-numerical-string b/Lang/Perl-6/Increment-a-numerical-string new file mode 120000 index 0000000000..3c30030d23 --- /dev/null +++ b/Lang/Perl-6/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Inheritance-Multiple b/Lang/Perl-6/Inheritance-Multiple new file mode 120000 index 0000000000..3534e8114a --- /dev/null +++ b/Lang/Perl-6/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Inheritance-Single b/Lang/Perl-6/Inheritance-Single new file mode 120000 index 0000000000..1a5bcf0ea2 --- /dev/null +++ b/Lang/Perl-6/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Input-loop b/Lang/Perl-6/Input-loop new file mode 120000 index 0000000000..d4b014b021 --- /dev/null +++ b/Lang/Perl-6/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Integer-comparison b/Lang/Perl-6/Integer-comparison new file mode 120000 index 0000000000..2015e8d90e --- /dev/null +++ b/Lang/Perl-6/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Integer-sequence b/Lang/Perl-6/Integer-sequence new file mode 120000 index 0000000000..7b6f8f1be9 --- /dev/null +++ b/Lang/Perl-6/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Interactive-programming b/Lang/Perl-6/Interactive-programming new file mode 120000 index 0000000000..dd9cd8ad6e --- /dev/null +++ b/Lang/Perl-6/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Introspection b/Lang/Perl-6/Introspection new file mode 120000 index 0000000000..a5547bd018 --- /dev/null +++ b/Lang/Perl-6/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Inverted-index b/Lang/Perl-6/Inverted-index new file mode 120000 index 0000000000..fe5a813822 --- /dev/null +++ b/Lang/Perl-6/Inverted-index @@ -0,0 +1 @@ +../../Task/Inverted-index/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Inverted-syntax b/Lang/Perl-6/Inverted-syntax new file mode 120000 index 0000000000..086822d238 --- /dev/null +++ b/Lang/Perl-6/Inverted-syntax @@ -0,0 +1 @@ +../../Task/Inverted-syntax/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/JSON b/Lang/Perl-6/JSON new file mode 120000 index 0000000000..bc4206ecb2 --- /dev/null +++ b/Lang/Perl-6/JSON @@ -0,0 +1 @@ +../../Task/JSON/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Jensens-Device b/Lang/Perl-6/Jensens-Device new file mode 120000 index 0000000000..532af7bb81 --- /dev/null +++ b/Lang/Perl-6/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Josephus-problem b/Lang/Perl-6/Josephus-problem new file mode 120000 index 0000000000..1bf1299523 --- /dev/null +++ b/Lang/Perl-6/Josephus-problem @@ -0,0 +1 @@ +../../Task/Josephus-problem/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Kaprekar-numbers b/Lang/Perl-6/Kaprekar-numbers new file mode 120000 index 0000000000..10089dffc8 --- /dev/null +++ b/Lang/Perl-6/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Perl-6/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..cc26cc9e05 --- /dev/null +++ b/Lang/Perl-6/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Knapsack-problem-0-1 b/Lang/Perl-6/Knapsack-problem-0-1 new file mode 120000 index 0000000000..800e596e80 --- /dev/null +++ b/Lang/Perl-6/Knapsack-problem-0-1 @@ -0,0 +1 @@ +../../Task/Knapsack-problem-0-1/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Knapsack-problem-Bounded b/Lang/Perl-6/Knapsack-problem-Bounded new file mode 120000 index 0000000000..9579d212ec --- /dev/null +++ b/Lang/Perl-6/Knapsack-problem-Bounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Bounded/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Knapsack-problem-Continuous b/Lang/Perl-6/Knapsack-problem-Continuous new file mode 120000 index 0000000000..2eb41e778a --- /dev/null +++ b/Lang/Perl-6/Knapsack-problem-Continuous @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Continuous/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Knapsack-problem-Unbounded b/Lang/Perl-6/Knapsack-problem-Unbounded new file mode 120000 index 0000000000..d872cfa187 --- /dev/null +++ b/Lang/Perl-6/Knapsack-problem-Unbounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Unbounded/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Knights-tour b/Lang/Perl-6/Knights-tour new file mode 120000 index 0000000000..f98539c1bf --- /dev/null +++ b/Lang/Perl-6/Knights-tour @@ -0,0 +1 @@ +../../Task/Knights-tour/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Knuth-shuffle b/Lang/Perl-6/Knuth-shuffle new file mode 120000 index 0000000000..05ca525bd6 --- /dev/null +++ b/Lang/Perl-6/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Knuths-algorithm-S b/Lang/Perl-6/Knuths-algorithm-S new file mode 120000 index 0000000000..0d81a0a41a --- /dev/null +++ b/Lang/Perl-6/Knuths-algorithm-S @@ -0,0 +1 @@ +../../Task/Knuths-algorithm-S/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/LZW-compression b/Lang/Perl-6/LZW-compression new file mode 120000 index 0000000000..5d1753e4a6 --- /dev/null +++ b/Lang/Perl-6/LZW-compression @@ -0,0 +1 @@ +../../Task/LZW-compression/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Langtons-ant b/Lang/Perl-6/Langtons-ant new file mode 120000 index 0000000000..06b4e82280 --- /dev/null +++ b/Lang/Perl-6/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Largest-int-from-concatenated-ints b/Lang/Perl-6/Largest-int-from-concatenated-ints new file mode 120000 index 0000000000..b50efa6687 --- /dev/null +++ b/Lang/Perl-6/Largest-int-from-concatenated-ints @@ -0,0 +1 @@ +../../Task/Largest-int-from-concatenated-ints/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Last-Friday-of-each-month b/Lang/Perl-6/Last-Friday-of-each-month new file mode 120000 index 0000000000..325a862ddd --- /dev/null +++ b/Lang/Perl-6/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Last-letter-first-letter b/Lang/Perl-6/Last-letter-first-letter new file mode 120000 index 0000000000..2e3b78e6c5 --- /dev/null +++ b/Lang/Perl-6/Last-letter-first-letter @@ -0,0 +1 @@ +../../Task/Last-letter-first-letter/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Leap-year b/Lang/Perl-6/Leap-year new file mode 120000 index 0000000000..e0d385b389 --- /dev/null +++ b/Lang/Perl-6/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Least-common-multiple b/Lang/Perl-6/Least-common-multiple new file mode 120000 index 0000000000..1f3df53b8b --- /dev/null +++ b/Lang/Perl-6/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Letter-frequency b/Lang/Perl-6/Letter-frequency new file mode 120000 index 0000000000..578b80ebca --- /dev/null +++ b/Lang/Perl-6/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Levenshtein-distance b/Lang/Perl-6/Levenshtein-distance new file mode 120000 index 0000000000..2c2a899ff8 --- /dev/null +++ b/Lang/Perl-6/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Linear-congruential-generator b/Lang/Perl-6/Linear-congruential-generator new file mode 120000 index 0000000000..80355a7d59 --- /dev/null +++ b/Lang/Perl-6/Linear-congruential-generator @@ -0,0 +1 @@ +../../Task/Linear-congruential-generator/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/List-comprehensions b/Lang/Perl-6/List-comprehensions new file mode 120000 index 0000000000..85d63457bf --- /dev/null +++ b/Lang/Perl-6/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Literals-Floating-point b/Lang/Perl-6/Literals-Floating-point new file mode 120000 index 0000000000..d62b1459e1 --- /dev/null +++ b/Lang/Perl-6/Literals-Floating-point @@ -0,0 +1 @@ +../../Task/Literals-Floating-point/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Literals-Integer b/Lang/Perl-6/Literals-Integer new file mode 120000 index 0000000000..9557403ea8 --- /dev/null +++ b/Lang/Perl-6/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Literals-String b/Lang/Perl-6/Literals-String new file mode 120000 index 0000000000..96cdaadc35 --- /dev/null +++ b/Lang/Perl-6/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Logical-operations b/Lang/Perl-6/Logical-operations new file mode 120000 index 0000000000..bb920b338e --- /dev/null +++ b/Lang/Perl-6/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Long-multiplication b/Lang/Perl-6/Long-multiplication new file mode 120000 index 0000000000..0a62904880 --- /dev/null +++ b/Lang/Perl-6/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Longest-common-subsequence b/Lang/Perl-6/Longest-common-subsequence new file mode 120000 index 0000000000..24e38f1f68 --- /dev/null +++ b/Lang/Perl-6/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Longest-string-challenge b/Lang/Perl-6/Longest-string-challenge new file mode 120000 index 0000000000..414e1f4a74 --- /dev/null +++ b/Lang/Perl-6/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Look-and-say-sequence b/Lang/Perl-6/Look-and-say-sequence new file mode 120000 index 0000000000..ab864b8025 --- /dev/null +++ b/Lang/Perl-6/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loop-over-multiple-arrays-simultaneously b/Lang/Perl-6/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..d52d8125b6 --- /dev/null +++ b/Lang/Perl-6/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-Break b/Lang/Perl-6/Loops-Break new file mode 120000 index 0000000000..421dba8b1c --- /dev/null +++ b/Lang/Perl-6/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-Continue b/Lang/Perl-6/Loops-Continue new file mode 120000 index 0000000000..be3f3bf1d0 --- /dev/null +++ b/Lang/Perl-6/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-Do-while b/Lang/Perl-6/Loops-Do-while new file mode 120000 index 0000000000..c46909aa10 --- /dev/null +++ b/Lang/Perl-6/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-Downward-for b/Lang/Perl-6/Loops-Downward-for new file mode 120000 index 0000000000..d90b57368d --- /dev/null +++ b/Lang/Perl-6/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-For b/Lang/Perl-6/Loops-For new file mode 120000 index 0000000000..17c4ad2bb7 --- /dev/null +++ b/Lang/Perl-6/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-For-with-a-specified-step b/Lang/Perl-6/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..68664e0454 --- /dev/null +++ b/Lang/Perl-6/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-Foreach b/Lang/Perl-6/Loops-Foreach new file mode 120000 index 0000000000..6c69014463 --- /dev/null +++ b/Lang/Perl-6/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-Infinite b/Lang/Perl-6/Loops-Infinite new file mode 120000 index 0000000000..e193d97472 --- /dev/null +++ b/Lang/Perl-6/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-N-plus-one-half b/Lang/Perl-6/Loops-N-plus-one-half new file mode 120000 index 0000000000..71819cf1f3 --- /dev/null +++ b/Lang/Perl-6/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-Nested b/Lang/Perl-6/Loops-Nested new file mode 120000 index 0000000000..af3792b1ab --- /dev/null +++ b/Lang/Perl-6/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Loops-While b/Lang/Perl-6/Loops-While new file mode 120000 index 0000000000..509d54d6e3 --- /dev/null +++ b/Lang/Perl-6/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Lucas-Lehmer-test b/Lang/Perl-6/Lucas-Lehmer-test new file mode 120000 index 0000000000..4ce5590e55 --- /dev/null +++ b/Lang/Perl-6/Lucas-Lehmer-test @@ -0,0 +1 @@ +../../Task/Lucas-Lehmer-test/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Luhn-test-of-credit-card-numbers b/Lang/Perl-6/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..cd3e5a589d --- /dev/null +++ b/Lang/Perl-6/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/MD5 b/Lang/Perl-6/MD5 new file mode 120000 index 0000000000..f7398329de --- /dev/null +++ b/Lang/Perl-6/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/MD5-Implementation b/Lang/Perl-6/MD5-Implementation new file mode 120000 index 0000000000..2137556693 --- /dev/null +++ b/Lang/Perl-6/MD5-Implementation @@ -0,0 +1 @@ +../../Task/MD5-Implementation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Mad-Libs b/Lang/Perl-6/Mad-Libs new file mode 120000 index 0000000000..84dddee443 --- /dev/null +++ b/Lang/Perl-6/Mad-Libs @@ -0,0 +1 @@ +../../Task/Mad-Libs/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Main-step-of-GOST-28147-89 b/Lang/Perl-6/Main-step-of-GOST-28147-89 new file mode 120000 index 0000000000..1d02deea1c --- /dev/null +++ b/Lang/Perl-6/Main-step-of-GOST-28147-89 @@ -0,0 +1 @@ +../../Task/Main-step-of-GOST-28147-89/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Man-or-boy-test b/Lang/Perl-6/Man-or-boy-test new file mode 120000 index 0000000000..a38c9426d4 --- /dev/null +++ b/Lang/Perl-6/Man-or-boy-test @@ -0,0 +1 @@ +../../Task/Man-or-boy-test/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Mandelbrot-set b/Lang/Perl-6/Mandelbrot-set new file mode 120000 index 0000000000..1a17cf6a52 --- /dev/null +++ b/Lang/Perl-6/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Map-range b/Lang/Perl-6/Map-range new file mode 120000 index 0000000000..1afa5d44ad --- /dev/null +++ b/Lang/Perl-6/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Matrix-exponentiation-operator b/Lang/Perl-6/Matrix-exponentiation-operator new file mode 120000 index 0000000000..a27e67b4d1 --- /dev/null +++ b/Lang/Perl-6/Matrix-exponentiation-operator @@ -0,0 +1 @@ +../../Task/Matrix-exponentiation-operator/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Matrix-multiplication b/Lang/Perl-6/Matrix-multiplication new file mode 120000 index 0000000000..ab377b2cd8 --- /dev/null +++ b/Lang/Perl-6/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Matrix-transposition b/Lang/Perl-6/Matrix-transposition new file mode 120000 index 0000000000..65ffaf0379 --- /dev/null +++ b/Lang/Perl-6/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Maze-generation b/Lang/Perl-6/Maze-generation new file mode 120000 index 0000000000..1ffe91c172 --- /dev/null +++ b/Lang/Perl-6/Maze-generation @@ -0,0 +1 @@ +../../Task/Maze-generation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Maze-solving b/Lang/Perl-6/Maze-solving new file mode 120000 index 0000000000..6f6d777a85 --- /dev/null +++ b/Lang/Perl-6/Maze-solving @@ -0,0 +1 @@ +../../Task/Maze-solving/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Memory-allocation b/Lang/Perl-6/Memory-allocation new file mode 120000 index 0000000000..b0b3d17025 --- /dev/null +++ b/Lang/Perl-6/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Menu b/Lang/Perl-6/Menu new file mode 120000 index 0000000000..db00e88d1e --- /dev/null +++ b/Lang/Perl-6/Menu @@ -0,0 +1 @@ +../../Task/Menu/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Metaprogramming b/Lang/Perl-6/Metaprogramming new file mode 120000 index 0000000000..f1a5fd8dcf --- /dev/null +++ b/Lang/Perl-6/Metaprogramming @@ -0,0 +1 @@ +../../Task/Metaprogramming/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Metronome b/Lang/Perl-6/Metronome new file mode 120000 index 0000000000..a582419107 --- /dev/null +++ b/Lang/Perl-6/Metronome @@ -0,0 +1 @@ +../../Task/Metronome/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Middle-three-digits b/Lang/Perl-6/Middle-three-digits new file mode 120000 index 0000000000..648e7c3bc3 --- /dev/null +++ b/Lang/Perl-6/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Miller-Rabin-primality-test b/Lang/Perl-6/Miller-Rabin-primality-test new file mode 120000 index 0000000000..24b8ad3c0b --- /dev/null +++ b/Lang/Perl-6/Miller-Rabin-primality-test @@ -0,0 +1 @@ +../../Task/Miller-Rabin-primality-test/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Minesweeper-game b/Lang/Perl-6/Minesweeper-game new file mode 120000 index 0000000000..9928f8af71 --- /dev/null +++ b/Lang/Perl-6/Minesweeper-game @@ -0,0 +1 @@ +../../Task/Minesweeper-game/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Modular-exponentiation b/Lang/Perl-6/Modular-exponentiation new file mode 120000 index 0000000000..d39914879d --- /dev/null +++ b/Lang/Perl-6/Modular-exponentiation @@ -0,0 +1 @@ +../../Task/Modular-exponentiation/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Modular-inverse b/Lang/Perl-6/Modular-inverse new file mode 120000 index 0000000000..9e23024e7d --- /dev/null +++ b/Lang/Perl-6/Modular-inverse @@ -0,0 +1 @@ +../../Task/Modular-inverse/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Monte-Carlo-methods b/Lang/Perl-6/Monte-Carlo-methods new file mode 120000 index 0000000000..7d3eef0844 --- /dev/null +++ b/Lang/Perl-6/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Monty-Hall-problem b/Lang/Perl-6/Monty-Hall-problem new file mode 120000 index 0000000000..1117a05826 --- /dev/null +++ b/Lang/Perl-6/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Morse-code b/Lang/Perl-6/Morse-code new file mode 120000 index 0000000000..cb19723a5a --- /dev/null +++ b/Lang/Perl-6/Morse-code @@ -0,0 +1 @@ +../../Task/Morse-code/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Multifactorial b/Lang/Perl-6/Multifactorial new file mode 120000 index 0000000000..9570e1c19e --- /dev/null +++ b/Lang/Perl-6/Multifactorial @@ -0,0 +1 @@ +../../Task/Multifactorial/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Multiple-distinct-objects b/Lang/Perl-6/Multiple-distinct-objects new file mode 120000 index 0000000000..fc39c037d7 --- /dev/null +++ b/Lang/Perl-6/Multiple-distinct-objects @@ -0,0 +1 @@ +../../Task/Multiple-distinct-objects/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Multiplication-tables b/Lang/Perl-6/Multiplication-tables new file mode 120000 index 0000000000..d61b6958ad --- /dev/null +++ b/Lang/Perl-6/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Multisplit b/Lang/Perl-6/Multisplit new file mode 120000 index 0000000000..08038397fb --- /dev/null +++ b/Lang/Perl-6/Multisplit @@ -0,0 +1 @@ +../../Task/Multisplit/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Mutual-recursion b/Lang/Perl-6/Mutual-recursion new file mode 120000 index 0000000000..532bc33b43 --- /dev/null +++ b/Lang/Perl-6/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Narcissist b/Lang/Perl-6/Narcissist new file mode 120000 index 0000000000..a4dcd30103 --- /dev/null +++ b/Lang/Perl-6/Narcissist @@ -0,0 +1 @@ +../../Task/Narcissist/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Ordered-words b/Lang/Perl-6/Ordered-words new file mode 120000 index 0000000000..e1d47aea46 --- /dev/null +++ b/Lang/Perl-6/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Pi b/Lang/Perl-6/Pi new file mode 120000 index 0000000000..39c8d0938f --- /dev/null +++ b/Lang/Perl-6/Pi @@ -0,0 +1 @@ +../../Task/Pi/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Quine b/Lang/Perl-6/Quine new file mode 120000 index 0000000000..6fdc269ddf --- /dev/null +++ b/Lang/Perl-6/Quine @@ -0,0 +1 @@ +../../Task/Quine/Perl-6 \ No newline at end of file diff --git a/Lang/Perl-6/Search-a-list b/Lang/Perl-6/Search-a-list new file mode 120000 index 0000000000..9ccda6bc5f --- /dev/null +++ b/Lang/Perl-6/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Perl-6 \ No newline at end of file diff --git a/Lang/Perl/Arbitrary-precision-integers-(included) b/Lang/Perl/Arbitrary-precision-integers-(included) deleted file mode 120000 index 02d6c446d0..0000000000 --- a/Lang/Perl/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Perl \ No newline at end of file diff --git a/Lang/PicoLisp/Arbitrary-precision-integers-(included) b/Lang/PicoLisp/Arbitrary-precision-integers-(included) deleted file mode 120000 index 1c4a84fcba..0000000000 --- a/Lang/PicoLisp/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/PicoLisp \ No newline at end of file diff --git a/Lang/Piet/0DESCRIPTION b/Lang/Piet/0DESCRIPTION new file mode 100644 index 0000000000..94573375d8 --- /dev/null +++ b/Lang/Piet/0DESCRIPTION @@ -0,0 +1,12 @@ +{{language +|site=http://www.dangermouse.net/esoteric/piet.html}} + +Piet is an esoteric programming language designed so that programs resemble abstract art. It was named after the Dutch painter Piet Mondrian. + +Programs aren't written in text but instead drawn on an image. Contiguous areas of a single color represent numbers while transitions from one color to another encode the instructions. Piet uses six different colors in three shades (dark, normal, bright). Program flow starts in the upper left corner of the image and moves rightwards, initially but it can move pretty much all over the image eventually. Loops are, appropriately, actual loops for the program flow in the image. + +See also: [[eso:Piet|Esolangs]] + +{{stub}} + +[[Category:Esoteric Languages]] \ No newline at end of file diff --git a/Lang/Piet/A+B b/Lang/Piet/A+B new file mode 120000 index 0000000000..6c1849db87 --- /dev/null +++ b/Lang/Piet/A+B @@ -0,0 +1 @@ +../../Task/A+B/Piet \ No newline at end of file diff --git a/Lang/Piet/Factorial b/Lang/Piet/Factorial new file mode 120000 index 0000000000..a8e4280b80 --- /dev/null +++ b/Lang/Piet/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Piet \ No newline at end of file diff --git a/Lang/Pike/0DESCRIPTION b/Lang/Pike/0DESCRIPTION new file mode 100644 index 0000000000..6a9f781bb5 --- /dev/null +++ b/Lang/Pike/0DESCRIPTION @@ -0,0 +1,17 @@ +{{language|Pike +|exec=bytecode +|site=http://pike.ida.liu.se/ +|strength=strong +|safety=safe +|compat=structural +|express=explicit +|checking=both +|parampass=both +|gc=yes +|LCT=yes}} +{{language programming paradigm|Object-oriented}} + +From the official [http://pike.ida.liu.se web site], Pike is an interpreted, general-purpose, high-level, cross-platform, dynamic programming language, with a syntax similar to [[Java]] and [[C]]. + +==See also== +* [[wp:Pike_(programming_language)|Pike on Wikipedia]] \ No newline at end of file diff --git a/Lang/Pike/100-doors b/Lang/Pike/100-doors new file mode 120000 index 0000000000..78982fc578 --- /dev/null +++ b/Lang/Pike/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Pike \ No newline at end of file diff --git a/Lang/Pike/99-Bottles-of-Beer b/Lang/Pike/99-Bottles-of-Beer new file mode 120000 index 0000000000..3431426d1c --- /dev/null +++ b/Lang/Pike/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Pike \ No newline at end of file diff --git a/Lang/Pike/A+B b/Lang/Pike/A+B new file mode 120000 index 0000000000..6f4ab7ef31 --- /dev/null +++ b/Lang/Pike/A+B @@ -0,0 +1 @@ +../../Task/A+B/Pike \ No newline at end of file diff --git a/Lang/Pike/Ackermann-function b/Lang/Pike/Ackermann-function new file mode 120000 index 0000000000..567bb5c72d --- /dev/null +++ b/Lang/Pike/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Pike \ No newline at end of file diff --git a/Lang/Pike/Add-a-variable-to-a-class-instance-at-runtime b/Lang/Pike/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..a69039c966 --- /dev/null +++ b/Lang/Pike/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/Pike \ No newline at end of file diff --git a/Lang/Pike/Apply-a-callback-to-an-array b/Lang/Pike/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..0ee4867a1b --- /dev/null +++ b/Lang/Pike/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Pike \ No newline at end of file diff --git a/Lang/Pike/Arbitrary-precision-integers-included b/Lang/Pike/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..3309bbf95d --- /dev/null +++ b/Lang/Pike/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Pike \ No newline at end of file diff --git a/Lang/Pike/Arrays b/Lang/Pike/Arrays new file mode 120000 index 0000000000..1ef8c9f9dc --- /dev/null +++ b/Lang/Pike/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Pike \ No newline at end of file diff --git a/Lang/Pike/Associative-array-Iteration b/Lang/Pike/Associative-array-Iteration new file mode 120000 index 0000000000..ffa00163db --- /dev/null +++ b/Lang/Pike/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Pike \ No newline at end of file diff --git a/Lang/Pike/Boolean-values b/Lang/Pike/Boolean-values new file mode 120000 index 0000000000..4ac8eb8bf3 --- /dev/null +++ b/Lang/Pike/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/Pike \ No newline at end of file diff --git a/Lang/Pike/Calendar b/Lang/Pike/Calendar new file mode 120000 index 0000000000..470795a283 --- /dev/null +++ b/Lang/Pike/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/Pike \ No newline at end of file diff --git a/Lang/Pike/Call-an-object-method b/Lang/Pike/Call-an-object-method new file mode 120000 index 0000000000..24f4effbbb --- /dev/null +++ b/Lang/Pike/Call-an-object-method @@ -0,0 +1 @@ +../../Task/Call-an-object-method/Pike \ No newline at end of file diff --git a/Lang/Pike/Check-that-file-exists b/Lang/Pike/Check-that-file-exists new file mode 120000 index 0000000000..228006c7d5 --- /dev/null +++ b/Lang/Pike/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Pike \ No newline at end of file diff --git a/Lang/Pike/Comments b/Lang/Pike/Comments new file mode 120000 index 0000000000..7c62c9160a --- /dev/null +++ b/Lang/Pike/Comments @@ -0,0 +1 @@ +../../Task/Comments/Pike \ No newline at end of file diff --git a/Lang/Pike/Concurrent-computing b/Lang/Pike/Concurrent-computing new file mode 120000 index 0000000000..58b8f52b63 --- /dev/null +++ b/Lang/Pike/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/Pike \ No newline at end of file diff --git a/Lang/Pike/Create-a-file b/Lang/Pike/Create-a-file new file mode 120000 index 0000000000..65dc2648d3 --- /dev/null +++ b/Lang/Pike/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Pike \ No newline at end of file diff --git a/Lang/Pike/Date-format b/Lang/Pike/Date-format new file mode 120000 index 0000000000..48a08e43c2 --- /dev/null +++ b/Lang/Pike/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Pike \ No newline at end of file diff --git a/Lang/Pike/Date-manipulation b/Lang/Pike/Date-manipulation new file mode 120000 index 0000000000..2b294d7318 --- /dev/null +++ b/Lang/Pike/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/Pike \ No newline at end of file diff --git a/Lang/Pike/Day-of-the-week b/Lang/Pike/Day-of-the-week new file mode 120000 index 0000000000..f996bc578e --- /dev/null +++ b/Lang/Pike/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Pike \ No newline at end of file diff --git a/Lang/Pike/Delete-a-file b/Lang/Pike/Delete-a-file new file mode 120000 index 0000000000..e9d3f6832c --- /dev/null +++ b/Lang/Pike/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Pike \ No newline at end of file diff --git a/Lang/Pike/Determine-if-a-string-is-numeric b/Lang/Pike/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..3485af8089 --- /dev/null +++ b/Lang/Pike/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Pike \ No newline at end of file diff --git a/Lang/Pike/Dining-philosophers b/Lang/Pike/Dining-philosophers new file mode 120000 index 0000000000..277ca3fec6 --- /dev/null +++ b/Lang/Pike/Dining-philosophers @@ -0,0 +1 @@ +../../Task/Dining-philosophers/Pike \ No newline at end of file diff --git a/Lang/Pike/Discordian-date b/Lang/Pike/Discordian-date new file mode 120000 index 0000000000..c11e6cf66e --- /dev/null +++ b/Lang/Pike/Discordian-date @@ -0,0 +1 @@ +../../Task/Discordian-date/Pike \ No newline at end of file diff --git a/Lang/Pike/Empty-program b/Lang/Pike/Empty-program new file mode 120000 index 0000000000..231086b64e --- /dev/null +++ b/Lang/Pike/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Pike \ No newline at end of file diff --git a/Lang/Pike/Ethiopian-multiplication b/Lang/Pike/Ethiopian-multiplication new file mode 120000 index 0000000000..b85c95f274 --- /dev/null +++ b/Lang/Pike/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Pike \ No newline at end of file diff --git a/Lang/Pike/Even-or-odd b/Lang/Pike/Even-or-odd new file mode 120000 index 0000000000..51a2b32d26 --- /dev/null +++ b/Lang/Pike/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/Pike \ No newline at end of file diff --git a/Lang/Pike/Evolutionary-algorithm b/Lang/Pike/Evolutionary-algorithm new file mode 120000 index 0000000000..64b256a933 --- /dev/null +++ b/Lang/Pike/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/Pike \ No newline at end of file diff --git a/Lang/Pike/Executable-library b/Lang/Pike/Executable-library new file mode 120000 index 0000000000..435df13e65 --- /dev/null +++ b/Lang/Pike/Executable-library @@ -0,0 +1 @@ +../../Task/Executable-library/Pike \ No newline at end of file diff --git a/Lang/Pike/Execute-a-system-command b/Lang/Pike/Execute-a-system-command new file mode 120000 index 0000000000..f29e2458ea --- /dev/null +++ b/Lang/Pike/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Pike \ No newline at end of file diff --git a/Lang/Pike/Fibonacci-sequence b/Lang/Pike/Fibonacci-sequence new file mode 120000 index 0000000000..bbddcc11b6 --- /dev/null +++ b/Lang/Pike/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Pike \ No newline at end of file diff --git a/Lang/Pike/File-size b/Lang/Pike/File-size new file mode 120000 index 0000000000..30cf051421 --- /dev/null +++ b/Lang/Pike/File-size @@ -0,0 +1 @@ +../../Task/File-size/Pike \ No newline at end of file diff --git a/Lang/Pike/Find-common-directory-path b/Lang/Pike/Find-common-directory-path new file mode 120000 index 0000000000..4b87c8389c --- /dev/null +++ b/Lang/Pike/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/Pike \ No newline at end of file diff --git a/Lang/Pike/Five-weekends b/Lang/Pike/Five-weekends new file mode 120000 index 0000000000..1ad1d0c878 --- /dev/null +++ b/Lang/Pike/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/Pike \ No newline at end of file diff --git a/Lang/Pike/FizzBuzz b/Lang/Pike/FizzBuzz new file mode 120000 index 0000000000..c976798e9d --- /dev/null +++ b/Lang/Pike/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Pike \ No newline at end of file diff --git a/Lang/Pike/Flatten-a-list b/Lang/Pike/Flatten-a-list new file mode 120000 index 0000000000..c95486a103 --- /dev/null +++ b/Lang/Pike/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Pike \ No newline at end of file diff --git a/Lang/Pike/Function-definition b/Lang/Pike/Function-definition new file mode 120000 index 0000000000..23e8f38a0e --- /dev/null +++ b/Lang/Pike/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Pike \ No newline at end of file diff --git a/Lang/Pike/HTTP b/Lang/Pike/HTTP new file mode 120000 index 0000000000..e253a45c1a --- /dev/null +++ b/Lang/Pike/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Pike \ No newline at end of file diff --git a/Lang/Pike/HTTPS b/Lang/Pike/HTTPS new file mode 120000 index 0000000000..04e6319054 --- /dev/null +++ b/Lang/Pike/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/Pike \ No newline at end of file diff --git a/Lang/Pike/Hailstone-sequence b/Lang/Pike/Hailstone-sequence new file mode 120000 index 0000000000..e0e0ae001e --- /dev/null +++ b/Lang/Pike/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Pike \ No newline at end of file diff --git a/Lang/Pike/Hello-world-Text b/Lang/Pike/Hello-world-Text new file mode 120000 index 0000000000..b2cbc97e4a --- /dev/null +++ b/Lang/Pike/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Pike \ No newline at end of file diff --git a/Lang/Pike/Hostname b/Lang/Pike/Hostname new file mode 120000 index 0000000000..f703ccca6b --- /dev/null +++ b/Lang/Pike/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Pike \ No newline at end of file diff --git a/Lang/Pike/Increment-a-numerical-string b/Lang/Pike/Increment-a-numerical-string new file mode 120000 index 0000000000..33199d049f --- /dev/null +++ b/Lang/Pike/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Pike \ No newline at end of file diff --git a/Lang/Pike/Integer-comparison b/Lang/Pike/Integer-comparison new file mode 120000 index 0000000000..ebd1dd976e --- /dev/null +++ b/Lang/Pike/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Pike \ No newline at end of file diff --git a/Lang/Pike/Interactive-programming b/Lang/Pike/Interactive-programming new file mode 120000 index 0000000000..e38bd1a393 --- /dev/null +++ b/Lang/Pike/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Pike \ No newline at end of file diff --git a/Lang/Pike/JSON b/Lang/Pike/JSON new file mode 120000 index 0000000000..573ea6e4f0 --- /dev/null +++ b/Lang/Pike/JSON @@ -0,0 +1 @@ +../../Task/JSON/Pike \ No newline at end of file diff --git a/Lang/Pike/Last-Friday-of-each-month b/Lang/Pike/Last-Friday-of-each-month new file mode 120000 index 0000000000..ecb24fdf67 --- /dev/null +++ b/Lang/Pike/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/Pike \ No newline at end of file diff --git a/Lang/Pike/Literals-String b/Lang/Pike/Literals-String new file mode 120000 index 0000000000..d9f6c952b8 --- /dev/null +++ b/Lang/Pike/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Pike \ No newline at end of file diff --git a/Lang/Pike/Longest-string-challenge b/Lang/Pike/Longest-string-challenge new file mode 120000 index 0000000000..59e89ff0fe --- /dev/null +++ b/Lang/Pike/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-Break b/Lang/Pike/Loops-Break new file mode 120000 index 0000000000..4ef308c7dc --- /dev/null +++ b/Lang/Pike/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-Continue b/Lang/Pike/Loops-Continue new file mode 120000 index 0000000000..07699873e1 --- /dev/null +++ b/Lang/Pike/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-Do-while b/Lang/Pike/Loops-Do-while new file mode 120000 index 0000000000..ce5b5a949a --- /dev/null +++ b/Lang/Pike/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-Downward-for b/Lang/Pike/Loops-Downward-for new file mode 120000 index 0000000000..c1b44cf933 --- /dev/null +++ b/Lang/Pike/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-For b/Lang/Pike/Loops-For new file mode 120000 index 0000000000..fa0aa2d2f5 --- /dev/null +++ b/Lang/Pike/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-For-with-a-specified-step b/Lang/Pike/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..dde437a90a --- /dev/null +++ b/Lang/Pike/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-Foreach b/Lang/Pike/Loops-Foreach new file mode 120000 index 0000000000..0750ebc51d --- /dev/null +++ b/Lang/Pike/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-Infinite b/Lang/Pike/Loops-Infinite new file mode 120000 index 0000000000..eacb796fd7 --- /dev/null +++ b/Lang/Pike/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-N-plus-one-half b/Lang/Pike/Loops-N-plus-one-half new file mode 120000 index 0000000000..8367d1ffff --- /dev/null +++ b/Lang/Pike/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Pike \ No newline at end of file diff --git a/Lang/Pike/Loops-While b/Lang/Pike/Loops-While new file mode 120000 index 0000000000..d3574a87df --- /dev/null +++ b/Lang/Pike/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Pike \ No newline at end of file diff --git a/Lang/Pike/MD5 b/Lang/Pike/MD5 new file mode 120000 index 0000000000..9bc96193de --- /dev/null +++ b/Lang/Pike/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Pike \ No newline at end of file diff --git a/Lang/Pike/Mad-Libs b/Lang/Pike/Mad-Libs new file mode 120000 index 0000000000..2b50d5be17 --- /dev/null +++ b/Lang/Pike/Mad-Libs @@ -0,0 +1 @@ +../../Task/Mad-Libs/Pike \ No newline at end of file diff --git a/Lang/Pike/Multisplit b/Lang/Pike/Multisplit new file mode 120000 index 0000000000..7520515b2c --- /dev/null +++ b/Lang/Pike/Multisplit @@ -0,0 +1 @@ +../../Task/Multisplit/Pike \ No newline at end of file diff --git a/Lang/PlainTeX/0DESCRIPTION b/Lang/PlainTeX/0DESCRIPTION new file mode 100644 index 0000000000..7cd3f31b56 --- /dev/null +++ b/Lang/PlainTeX/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language|plainTeX}} +plainTeX is the name used to refer to the default set of ''macros'' which are always present on all [[TeX]] systems +(and it is the default preloaded format for tex executable). They were written by Knuth himself, and provide the basic to start using [[TeX]] (since "raw" [[TeX]] is not ready-to-use for documents creation). Often when one says simply "TeX document", s/he means s/he is using the plainTeX macros, even though nowadays the success of the complex feature-full [[LaTeX]] macros package creates a little bit of confusion and a lot of people, ignoring that LaTeX is just one of possible macro packages for TeX, think that LaTeX is TeX and viceversa. + +Extension to the plainTeX exists, like eplain(TeX). + +Even though [[LaTeX]] is nowadays almost a typesetting "standard" when using a [[TeX]] system, plainTeX is still usable and used. \ No newline at end of file diff --git a/Lang/PlainTeX/99-Bottles-of-Beer b/Lang/PlainTeX/99-Bottles-of-Beer new file mode 120000 index 0000000000..b3e05d83ab --- /dev/null +++ b/Lang/PlainTeX/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/PlainTeX \ No newline at end of file diff --git a/Lang/PlainTeX/Quine b/Lang/PlainTeX/Quine new file mode 120000 index 0000000000..b087659475 --- /dev/null +++ b/Lang/PlainTeX/Quine @@ -0,0 +1 @@ +../../Task/Quine/PlainTeX \ No newline at end of file diff --git a/Lang/Pop11/0DESCRIPTION b/Lang/Pop11/0DESCRIPTION new file mode 100644 index 0000000000..d53ac5e87b --- /dev/null +++ b/Lang/Pop11/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language|Pop11 +|strength=strong +|safety=safe +|express=implicit +|checking=dynamic +|gc=yes +|LCT=yes}}Pop11 is a dynamic multi-[[:Category:Programming Paradigms|paradigm]] language. It has good support for [[procedural programming|procedural]], [[object-oriented]] and [[functional programming]]. Pop11 is a main language of Poplog system. Poplog offers incremental compilers for several languages (Pop11, [[Lisp]], [[Standard ML|SML]] and [[Prolog]]). + +==See Also== +*[[wp:POP-11|Wikipedia article]] +*[http://www.cs.bham.ac.uk/research/poplog/freepoplog.html Main Poplog site] +*[http://www.cs.bham.ac.uk/research/poplog/poplog.info.html Additional Information about Poplog and Pop11] +*[http://www.cs.bham.ac.uk/research/poplog/primer/ Online Pop11 Primer] \ No newline at end of file diff --git a/Lang/Pop11/100-doors b/Lang/Pop11/100-doors new file mode 120000 index 0000000000..718a94ec8a --- /dev/null +++ b/Lang/Pop11/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/99-Bottles-of-Beer b/Lang/Pop11/99-Bottles-of-Beer new file mode 120000 index 0000000000..5da5c08f84 --- /dev/null +++ b/Lang/Pop11/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Add-a-variable-to-a-class-instance-at-runtime b/Lang/Pop11/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..516b766728 --- /dev/null +++ b/Lang/Pop11/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Apply-a-callback-to-an-array b/Lang/Pop11/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..91831c4494 --- /dev/null +++ b/Lang/Pop11/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Arithmetic-Complex b/Lang/Pop11/Arithmetic-Complex new file mode 120000 index 0000000000..f6f46e5d40 --- /dev/null +++ b/Lang/Pop11/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Arithmetic-Integer b/Lang/Pop11/Arithmetic-Integer new file mode 120000 index 0000000000..316214f68d --- /dev/null +++ b/Lang/Pop11/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Arithmetic-evaluation b/Lang/Pop11/Arithmetic-evaluation new file mode 120000 index 0000000000..4705ccdf73 --- /dev/null +++ b/Lang/Pop11/Arithmetic-evaluation @@ -0,0 +1 @@ +../../Task/Arithmetic-evaluation/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Associative-array-Creation b/Lang/Pop11/Associative-array-Creation new file mode 120000 index 0000000000..b3b502073d --- /dev/null +++ b/Lang/Pop11/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Averages-Arithmetic-mean b/Lang/Pop11/Averages-Arithmetic-mean new file mode 120000 index 0000000000..b8e040afce --- /dev/null +++ b/Lang/Pop11/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Binary-search b/Lang/Pop11/Binary-search new file mode 120000 index 0000000000..7e9a5756fc --- /dev/null +++ b/Lang/Pop11/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Bitwise-operations b/Lang/Pop11/Bitwise-operations new file mode 120000 index 0000000000..241ba2d38b --- /dev/null +++ b/Lang/Pop11/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Check-that-file-exists b/Lang/Pop11/Check-that-file-exists new file mode 120000 index 0000000000..25b44b4c75 --- /dev/null +++ b/Lang/Pop11/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Classes b/Lang/Pop11/Classes new file mode 120000 index 0000000000..4e3dba5ce1 --- /dev/null +++ b/Lang/Pop11/Classes @@ -0,0 +1 @@ +../../Task/Classes/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Combinations b/Lang/Pop11/Combinations new file mode 120000 index 0000000000..30b627acad --- /dev/null +++ b/Lang/Pop11/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Command-line-arguments b/Lang/Pop11/Command-line-arguments new file mode 120000 index 0000000000..a69bd39777 --- /dev/null +++ b/Lang/Pop11/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Comments b/Lang/Pop11/Comments new file mode 120000 index 0000000000..bebe6f1fa3 --- /dev/null +++ b/Lang/Pop11/Comments @@ -0,0 +1 @@ +../../Task/Comments/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Compound-data-type b/Lang/Pop11/Compound-data-type new file mode 120000 index 0000000000..f4b8198545 --- /dev/null +++ b/Lang/Pop11/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Conditional-structures b/Lang/Pop11/Conditional-structures new file mode 120000 index 0000000000..99776b8d12 --- /dev/null +++ b/Lang/Pop11/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Create-a-two-dimensional-array-at-runtime b/Lang/Pop11/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..c095a530f2 --- /dev/null +++ b/Lang/Pop11/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Delegates b/Lang/Pop11/Delegates new file mode 120000 index 0000000000..84519ea3ce --- /dev/null +++ b/Lang/Pop11/Delegates @@ -0,0 +1 @@ +../../Task/Delegates/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Doubly-linked-list-Element-definition b/Lang/Pop11/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..4575b729df --- /dev/null +++ b/Lang/Pop11/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Doubly-linked-list-Element-insertion b/Lang/Pop11/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..a9b2e5d652 --- /dev/null +++ b/Lang/Pop11/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Empty-program b/Lang/Pop11/Empty-program new file mode 120000 index 0000000000..ff7655b96e --- /dev/null +++ b/Lang/Pop11/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Exceptions b/Lang/Pop11/Exceptions new file mode 120000 index 0000000000..5e009eb8aa --- /dev/null +++ b/Lang/Pop11/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Execute-a-system-command b/Lang/Pop11/Execute-a-system-command new file mode 120000 index 0000000000..a8859231d2 --- /dev/null +++ b/Lang/Pop11/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Fibonacci-sequence b/Lang/Pop11/Fibonacci-sequence new file mode 120000 index 0000000000..af372716b2 --- /dev/null +++ b/Lang/Pop11/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/File-IO b/Lang/Pop11/File-IO new file mode 120000 index 0000000000..71262c1417 --- /dev/null +++ b/Lang/Pop11/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/File-modification-time b/Lang/Pop11/File-modification-time new file mode 120000 index 0000000000..82256e660a --- /dev/null +++ b/Lang/Pop11/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/File-size b/Lang/Pop11/File-size new file mode 120000 index 0000000000..7de38c047c --- /dev/null +++ b/Lang/Pop11/File-size @@ -0,0 +1 @@ +../../Task/File-size/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Filter b/Lang/Pop11/Filter new file mode 120000 index 0000000000..1081f7dabe --- /dev/null +++ b/Lang/Pop11/Filter @@ -0,0 +1 @@ +../../Task/Filter/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/FizzBuzz b/Lang/Pop11/FizzBuzz new file mode 120000 index 0000000000..98dfd92de3 --- /dev/null +++ b/Lang/Pop11/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Flow-control-structures b/Lang/Pop11/Flow-control-structures new file mode 120000 index 0000000000..d86830f157 --- /dev/null +++ b/Lang/Pop11/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Fork b/Lang/Pop11/Fork new file mode 120000 index 0000000000..1175d59023 --- /dev/null +++ b/Lang/Pop11/Fork @@ -0,0 +1 @@ +../../Task/Fork/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Formatted-numeric-output b/Lang/Pop11/Formatted-numeric-output new file mode 120000 index 0000000000..e952856fba --- /dev/null +++ b/Lang/Pop11/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Forward-difference b/Lang/Pop11/Forward-difference new file mode 120000 index 0000000000..6ba54cd8d8 --- /dev/null +++ b/Lang/Pop11/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Function-definition b/Lang/Pop11/Function-definition new file mode 120000 index 0000000000..d9b64f9655 --- /dev/null +++ b/Lang/Pop11/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Generic-swap b/Lang/Pop11/Generic-swap new file mode 120000 index 0000000000..57f3002c8e --- /dev/null +++ b/Lang/Pop11/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Greatest-common-divisor b/Lang/Pop11/Greatest-common-divisor new file mode 120000 index 0000000000..3a8825d83a --- /dev/null +++ b/Lang/Pop11/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Hash-from-two-arrays b/Lang/Pop11/Hash-from-two-arrays new file mode 120000 index 0000000000..98bf225934 --- /dev/null +++ b/Lang/Pop11/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Hello-world-Text b/Lang/Pop11/Hello-world-Text new file mode 120000 index 0000000000..45f0b04bf6 --- /dev/null +++ b/Lang/Pop11/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Higher-order-functions b/Lang/Pop11/Higher-order-functions new file mode 120000 index 0000000000..fe448f7e37 --- /dev/null +++ b/Lang/Pop11/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Hostname b/Lang/Pop11/Hostname new file mode 120000 index 0000000000..fe6cbc64a1 --- /dev/null +++ b/Lang/Pop11/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Increment-a-numerical-string b/Lang/Pop11/Increment-a-numerical-string new file mode 120000 index 0000000000..3668c2f1c6 --- /dev/null +++ b/Lang/Pop11/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Inheritance-Multiple b/Lang/Pop11/Inheritance-Multiple new file mode 120000 index 0000000000..6b168830fd --- /dev/null +++ b/Lang/Pop11/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Integer-comparison b/Lang/Pop11/Integer-comparison new file mode 120000 index 0000000000..3e630eda70 --- /dev/null +++ b/Lang/Pop11/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Introspection b/Lang/Pop11/Introspection new file mode 120000 index 0000000000..b95590d554 --- /dev/null +++ b/Lang/Pop11/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Literals-String b/Lang/Pop11/Literals-String new file mode 120000 index 0000000000..dbbda2e4f7 --- /dev/null +++ b/Lang/Pop11/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Logical-operations b/Lang/Pop11/Logical-operations new file mode 120000 index 0000000000..e88111cdd4 --- /dev/null +++ b/Lang/Pop11/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-Continue b/Lang/Pop11/Loops-Continue new file mode 120000 index 0000000000..56196e3c32 --- /dev/null +++ b/Lang/Pop11/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-Do-while b/Lang/Pop11/Loops-Do-while new file mode 120000 index 0000000000..b1056af2a3 --- /dev/null +++ b/Lang/Pop11/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-Downward-for b/Lang/Pop11/Loops-Downward-for new file mode 120000 index 0000000000..3953592bb9 --- /dev/null +++ b/Lang/Pop11/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-For b/Lang/Pop11/Loops-For new file mode 120000 index 0000000000..add7de60ad --- /dev/null +++ b/Lang/Pop11/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-Foreach b/Lang/Pop11/Loops-Foreach new file mode 120000 index 0000000000..66db9a24f1 --- /dev/null +++ b/Lang/Pop11/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-Infinite b/Lang/Pop11/Loops-Infinite new file mode 120000 index 0000000000..9940a2d511 --- /dev/null +++ b/Lang/Pop11/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-N-plus-one-half b/Lang/Pop11/Loops-N-plus-one-half new file mode 120000 index 0000000000..9d5c0f4bc2 --- /dev/null +++ b/Lang/Pop11/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Loops-While b/Lang/Pop11/Loops-While new file mode 120000 index 0000000000..21ef0792a6 --- /dev/null +++ b/Lang/Pop11/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Lucas-Lehmer-test b/Lang/Pop11/Lucas-Lehmer-test new file mode 120000 index 0000000000..d0667d6f89 --- /dev/null +++ b/Lang/Pop11/Lucas-Lehmer-test @@ -0,0 +1 @@ +../../Task/Lucas-Lehmer-test/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Matrix-multiplication b/Lang/Pop11/Matrix-multiplication new file mode 120000 index 0000000000..4ab94dc58f --- /dev/null +++ b/Lang/Pop11/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/Pop11 \ No newline at end of file diff --git a/Lang/Pop11/Matrix-transposition b/Lang/Pop11/Matrix-transposition new file mode 120000 index 0000000000..4c4b1ffbe3 --- /dev/null +++ b/Lang/Pop11/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Pop11 \ No newline at end of file diff --git a/Lang/PostScript/0DESCRIPTION b/Lang/PostScript/0DESCRIPTION new file mode 100644 index 0000000000..94b8f89f9c --- /dev/null +++ b/Lang/PostScript/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language|PostScript}} +'''PostScript''' is a concatenative dynamically typed language with abundant meta language facilites. It allows definition of new control structures at run time, allows reflection and reification of stack, scopes, and even continuations. With Display PostScript, the language even has facilities for multi-threaded execution. Since the language is based on stack, it is suitable for combinator based programming, and all the higher order combinators (initiated by joy language) is applicable in postscript. The language also allows a form of proto-type based object orientated programming using dictionaries. See {{libheader|initlib}} for implemention of higher order combinators. + +'''PostScript''' originated as a printer definition language invented by the founders of '''Adobe'''. The language was necessitated by the increasing demands of printing and rendering jobs on the computers of the 70s. These tasks were therefore pushed to the printers themselves, with the result that printers now had chips and built in interpreters for PostScript. With the growth of printing complexity, some printers ended up having even more powerful processors than the master systems themselves. + +Although now almost displaced by the '''Portable Document Format''' (PDF), also developed by Adobe, PostScript's USP lies in it's being a '''Turing complete''' language with support for the basic data types and fundamental structures and concepts of Computer Science. Many interpreters and viewers of PostScript are available, some even for free. Although primarily a language suited for 2D graphics, PostScript is complete as a language and able to hadle normal computation tasks. + +==See Also== +*[http://logand.com/sw/wps/index.html WPS - PostScript interpreter written in JavaScript] +*[http://code.google.com/p/postcanvas/ postcanvas - Open-source PostScript interpreter written in JavaScript] +*[http://pages.cs.wisc.edu/~ghost/ Ghostscript opensource postscript interpreter with a lot of extensions. ] + +{{Language programming paradigm|Concatenative}} \ No newline at end of file diff --git a/Lang/PostScript/100-doors b/Lang/PostScript/100-doors new file mode 120000 index 0000000000..217b6bcd51 --- /dev/null +++ b/Lang/PostScript/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/PostScript \ No newline at end of file diff --git a/Lang/PostScript/A+B b/Lang/PostScript/A+B new file mode 120000 index 0000000000..42e93cd450 --- /dev/null +++ b/Lang/PostScript/A+B @@ -0,0 +1 @@ +../../Task/A+B/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Accumulator-factory b/Lang/PostScript/Accumulator-factory new file mode 120000 index 0000000000..34000cb504 --- /dev/null +++ b/Lang/PostScript/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Ackermann-function b/Lang/PostScript/Ackermann-function new file mode 120000 index 0000000000..eb9905bd9b --- /dev/null +++ b/Lang/PostScript/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Anonymous-recursion b/Lang/PostScript/Anonymous-recursion new file mode 120000 index 0000000000..f6b2ef5086 --- /dev/null +++ b/Lang/PostScript/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Apply-a-callback-to-an-array b/Lang/PostScript/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..3925d8c872 --- /dev/null +++ b/Lang/PostScript/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Arithmetic-Complex b/Lang/PostScript/Arithmetic-Complex new file mode 120000 index 0000000000..5f97e1047e --- /dev/null +++ b/Lang/PostScript/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Arithmetic-Integer b/Lang/PostScript/Arithmetic-Integer new file mode 120000 index 0000000000..288d22e223 --- /dev/null +++ b/Lang/PostScript/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Array-concatenation b/Lang/PostScript/Array-concatenation new file mode 120000 index 0000000000..d708d4c6ce --- /dev/null +++ b/Lang/PostScript/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Arrays b/Lang/PostScript/Arrays new file mode 120000 index 0000000000..231b87ab41 --- /dev/null +++ b/Lang/PostScript/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Associative-array-Creation b/Lang/PostScript/Associative-array-Creation new file mode 120000 index 0000000000..495932c1f7 --- /dev/null +++ b/Lang/PostScript/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Associative-array-Iteration b/Lang/PostScript/Associative-array-Iteration new file mode 120000 index 0000000000..98e21bd0a2 --- /dev/null +++ b/Lang/PostScript/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Averages-Arithmetic-mean b/Lang/PostScript/Averages-Arithmetic-mean new file mode 120000 index 0000000000..8992d0795f --- /dev/null +++ b/Lang/PostScript/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Averages-Pythagorean-means b/Lang/PostScript/Averages-Pythagorean-means new file mode 120000 index 0000000000..c54b9338ec --- /dev/null +++ b/Lang/PostScript/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Averages-Root-mean-square b/Lang/PostScript/Averages-Root-mean-square new file mode 120000 index 0000000000..36afcaebb0 --- /dev/null +++ b/Lang/PostScript/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Boolean-values b/Lang/PostScript/Boolean-values new file mode 120000 index 0000000000..e5e99e35f2 --- /dev/null +++ b/Lang/PostScript/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Comments b/Lang/PostScript/Comments new file mode 120000 index 0000000000..c47cd29cda --- /dev/null +++ b/Lang/PostScript/Comments @@ -0,0 +1 @@ +../../Task/Comments/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Conditional-structures b/Lang/PostScript/Conditional-structures new file mode 120000 index 0000000000..2d56fe9a45 --- /dev/null +++ b/Lang/PostScript/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Conways-Game-of-Life b/Lang/PostScript/Conways-Game-of-Life new file mode 120000 index 0000000000..0cea858b02 --- /dev/null +++ b/Lang/PostScript/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Dot-product b/Lang/PostScript/Dot-product new file mode 120000 index 0000000000..33b9b8d9d6 --- /dev/null +++ b/Lang/PostScript/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Draw-a-sphere b/Lang/PostScript/Draw-a-sphere new file mode 120000 index 0000000000..ec84bd1b82 --- /dev/null +++ b/Lang/PostScript/Draw-a-sphere @@ -0,0 +1 @@ +../../Task/Draw-a-sphere/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Empty-program b/Lang/PostScript/Empty-program new file mode 120000 index 0000000000..859c6aef01 --- /dev/null +++ b/Lang/PostScript/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Factorial b/Lang/PostScript/Factorial new file mode 120000 index 0000000000..d93412c86a --- /dev/null +++ b/Lang/PostScript/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Fibonacci-sequence b/Lang/PostScript/Fibonacci-sequence new file mode 120000 index 0000000000..3a48d15e57 --- /dev/null +++ b/Lang/PostScript/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/PostScript \ No newline at end of file diff --git a/Lang/PostScript/File-size b/Lang/PostScript/File-size new file mode 120000 index 0000000000..440116b5f9 --- /dev/null +++ b/Lang/PostScript/File-size @@ -0,0 +1 @@ +../../Task/File-size/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Filter b/Lang/PostScript/Filter new file mode 120000 index 0000000000..612803eab0 --- /dev/null +++ b/Lang/PostScript/Filter @@ -0,0 +1 @@ +../../Task/Filter/PostScript \ No newline at end of file diff --git a/Lang/PostScript/FizzBuzz b/Lang/PostScript/FizzBuzz new file mode 120000 index 0000000000..9d94a3dd5a --- /dev/null +++ b/Lang/PostScript/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Flatten-a-list b/Lang/PostScript/Flatten-a-list new file mode 120000 index 0000000000..3a52e6cdb1 --- /dev/null +++ b/Lang/PostScript/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Forest-fire b/Lang/PostScript/Forest-fire new file mode 120000 index 0000000000..e81ad60872 --- /dev/null +++ b/Lang/PostScript/Forest-fire @@ -0,0 +1 @@ +../../Task/Forest-fire/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Fractal-tree b/Lang/PostScript/Fractal-tree new file mode 120000 index 0000000000..e290399594 --- /dev/null +++ b/Lang/PostScript/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Function-composition b/Lang/PostScript/Function-composition new file mode 120000 index 0000000000..0f50c42fd3 --- /dev/null +++ b/Lang/PostScript/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Function-definition b/Lang/PostScript/Function-definition new file mode 120000 index 0000000000..8890642383 --- /dev/null +++ b/Lang/PostScript/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Generic-swap b/Lang/PostScript/Generic-swap new file mode 120000 index 0000000000..b1547f238e --- /dev/null +++ b/Lang/PostScript/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Greatest-common-divisor b/Lang/PostScript/Greatest-common-divisor new file mode 120000 index 0000000000..4be6b2da7c --- /dev/null +++ b/Lang/PostScript/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Greatest-element-of-a-list b/Lang/PostScript/Greatest-element-of-a-list new file mode 120000 index 0000000000..a8dd861597 --- /dev/null +++ b/Lang/PostScript/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Hash-from-two-arrays b/Lang/PostScript/Hash-from-two-arrays new file mode 120000 index 0000000000..2811acea4c --- /dev/null +++ b/Lang/PostScript/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Hello-world-Graphical b/Lang/PostScript/Hello-world-Graphical new file mode 120000 index 0000000000..d0dc64ec04 --- /dev/null +++ b/Lang/PostScript/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Hello-world-Line-printer b/Lang/PostScript/Hello-world-Line-printer new file mode 120000 index 0000000000..bfc7620cb5 --- /dev/null +++ b/Lang/PostScript/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Hello-world-Standard-error b/Lang/PostScript/Hello-world-Standard-error new file mode 120000 index 0000000000..6b57dd3a77 --- /dev/null +++ b/Lang/PostScript/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Hello-world-Text b/Lang/PostScript/Hello-world-Text new file mode 120000 index 0000000000..2572b28416 --- /dev/null +++ b/Lang/PostScript/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Higher-order-functions b/Lang/PostScript/Higher-order-functions new file mode 120000 index 0000000000..81aff994ef --- /dev/null +++ b/Lang/PostScript/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Identity-matrix b/Lang/PostScript/Identity-matrix new file mode 120000 index 0000000000..c402240fa6 --- /dev/null +++ b/Lang/PostScript/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Infinity b/Lang/PostScript/Infinity new file mode 120000 index 0000000000..ed3d3c249b --- /dev/null +++ b/Lang/PostScript/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Integer-sequence b/Lang/PostScript/Integer-sequence new file mode 120000 index 0000000000..1c2cf227c6 --- /dev/null +++ b/Lang/PostScript/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Knights-tour b/Lang/PostScript/Knights-tour new file mode 120000 index 0000000000..797e437b4c --- /dev/null +++ b/Lang/PostScript/Knights-tour @@ -0,0 +1 @@ +../../Task/Knights-tour/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Leap-year b/Lang/PostScript/Leap-year new file mode 120000 index 0000000000..f0a1199466 --- /dev/null +++ b/Lang/PostScript/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Literals-Integer b/Lang/PostScript/Literals-Integer new file mode 120000 index 0000000000..18e59fcc4e --- /dev/null +++ b/Lang/PostScript/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Logical-operations b/Lang/PostScript/Logical-operations new file mode 120000 index 0000000000..9154c3766a --- /dev/null +++ b/Lang/PostScript/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Loop-over-multiple-arrays-simultaneously b/Lang/PostScript/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..765e4e2c20 --- /dev/null +++ b/Lang/PostScript/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Loops-Break b/Lang/PostScript/Loops-Break new file mode 120000 index 0000000000..8dde5a94be --- /dev/null +++ b/Lang/PostScript/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Loops-Foreach b/Lang/PostScript/Loops-Foreach new file mode 120000 index 0000000000..c0eb9ca337 --- /dev/null +++ b/Lang/PostScript/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Loops-Infinite b/Lang/PostScript/Loops-Infinite new file mode 120000 index 0000000000..8ed253e129 --- /dev/null +++ b/Lang/PostScript/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Loops-While b/Lang/PostScript/Loops-While new file mode 120000 index 0000000000..08c2e26cbe --- /dev/null +++ b/Lang/PostScript/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Mandelbrot-set b/Lang/PostScript/Mandelbrot-set new file mode 120000 index 0000000000..6271c0f907 --- /dev/null +++ b/Lang/PostScript/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Matrix-transposition b/Lang/PostScript/Matrix-transposition new file mode 120000 index 0000000000..f8708a27f5 --- /dev/null +++ b/Lang/PostScript/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Metaprogramming b/Lang/PostScript/Metaprogramming new file mode 120000 index 0000000000..445493b5d8 --- /dev/null +++ b/Lang/PostScript/Metaprogramming @@ -0,0 +1 @@ +../../Task/Metaprogramming/PostScript \ No newline at end of file diff --git a/Lang/PostScript/Mutual-recursion b/Lang/PostScript/Mutual-recursion new file mode 120000 index 0000000000..148821974d --- /dev/null +++ b/Lang/PostScript/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/PostScript \ No newline at end of file diff --git a/Lang/PowerBASIC/0DESCRIPTION b/Lang/PowerBASIC/0DESCRIPTION new file mode 100644 index 0000000000..5b8d18f9ac --- /dev/null +++ b/Lang/PowerBASIC/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language|PowerBASIC +|strength=strong +|safety=safe +|checking=static +|compat=nominative +|parampass=both +|exec=machine +|site=http://www.powerbasic.com/}} +{{implementation|BASIC}} +'''PowerBASIC''' is a small family of compilers for [[DOS]] and [[Windows]] by PowerBASIC, Inc. Its main selling point is the efficiency of the compiler and its ease of use. (The "easy" part is debatable; working with windows is not as easy as [[Visual Basic]], but then, almost nothing is.) For a brief history of PowerBASIC, read [[wp:PowerBASIC|its Wikipedia entry]]. + +== Code example == +Many of the [[BASIC]] examples listed on Rosetta Code will work unchanged in PowerBASIC -- especially the DOS version -- although there are often enough differences between PB and the various other BASICs (especially the Windows versions) to warrant PB-specific examples. \ No newline at end of file diff --git a/Lang/PowerBASIC/Ackermann-function b/Lang/PowerBASIC/Ackermann-function new file mode 120000 index 0000000000..7c9cdc3f9f --- /dev/null +++ b/Lang/PowerBASIC/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Address-of-a-variable b/Lang/PowerBASIC/Address-of-a-variable new file mode 120000 index 0000000000..153e941419 --- /dev/null +++ b/Lang/PowerBASIC/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Boolean-values b/Lang/PowerBASIC/Boolean-values new file mode 120000 index 0000000000..96a94bf501 --- /dev/null +++ b/Lang/PowerBASIC/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Call-a-function-in-a-shared-library b/Lang/PowerBASIC/Call-a-function-in-a-shared-library new file mode 120000 index 0000000000..f109a86036 --- /dev/null +++ b/Lang/PowerBASIC/Call-a-function-in-a-shared-library @@ -0,0 +1 @@ +../../Task/Call-a-function-in-a-shared-library/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Command-line-arguments b/Lang/PowerBASIC/Command-line-arguments new file mode 120000 index 0000000000..b826e1c5b9 --- /dev/null +++ b/Lang/PowerBASIC/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Count-occurrences-of-a-substring b/Lang/PowerBASIC/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..1cfc9e3b0c --- /dev/null +++ b/Lang/PowerBASIC/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Discordian-date b/Lang/PowerBASIC/Discordian-date new file mode 120000 index 0000000000..be429373d7 --- /dev/null +++ b/Lang/PowerBASIC/Discordian-date @@ -0,0 +1 @@ +../../Task/Discordian-date/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Enforced-immutability b/Lang/PowerBASIC/Enforced-immutability new file mode 120000 index 0000000000..8be178c244 --- /dev/null +++ b/Lang/PowerBASIC/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Factorial b/Lang/PowerBASIC/Factorial new file mode 120000 index 0000000000..081c27157d --- /dev/null +++ b/Lang/PowerBASIC/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Fibonacci-sequence b/Lang/PowerBASIC/Fibonacci-sequence new file mode 120000 index 0000000000..386de60b44 --- /dev/null +++ b/Lang/PowerBASIC/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Globally-replace-text-in-several-files b/Lang/PowerBASIC/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..40764f69de --- /dev/null +++ b/Lang/PowerBASIC/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Gray-code b/Lang/PowerBASIC/Gray-code new file mode 120000 index 0000000000..da209b76f5 --- /dev/null +++ b/Lang/PowerBASIC/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Greatest-element-of-a-list b/Lang/PowerBASIC/Greatest-element-of-a-list new file mode 120000 index 0000000000..5d8f351d68 --- /dev/null +++ b/Lang/PowerBASIC/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Hello-world-Graphical b/Lang/PowerBASIC/Hello-world-Graphical new file mode 120000 index 0000000000..869c6a60e7 --- /dev/null +++ b/Lang/PowerBASIC/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Hello-world-Standard-error b/Lang/PowerBASIC/Hello-world-Standard-error new file mode 120000 index 0000000000..a0483cd628 --- /dev/null +++ b/Lang/PowerBASIC/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Hostname b/Lang/PowerBASIC/Hostname new file mode 120000 index 0000000000..6730d27af6 --- /dev/null +++ b/Lang/PowerBASIC/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Look-and-say-sequence b/Lang/PowerBASIC/Look-and-say-sequence new file mode 120000 index 0000000000..c5c4d3a6d7 --- /dev/null +++ b/Lang/PowerBASIC/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Loop-over-multiple-arrays-simultaneously b/Lang/PowerBASIC/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..f48b5b9a7d --- /dev/null +++ b/Lang/PowerBASIC/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Quine b/Lang/PowerBASIC/Quine new file mode 120000 index 0000000000..cac85e521b --- /dev/null +++ b/Lang/PowerBASIC/Quine @@ -0,0 +1 @@ +../../Task/Quine/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerBASIC/Search-a-list b/Lang/PowerBASIC/Search-a-list new file mode 120000 index 0000000000..fdde0685a3 --- /dev/null +++ b/Lang/PowerBASIC/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/PowerBASIC \ No newline at end of file diff --git a/Lang/PowerShell/0DESCRIPTION b/Lang/PowerShell/0DESCRIPTION new file mode 100644 index 0000000000..a6a3a80899 --- /dev/null +++ b/Lang/PowerShell/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language|PowerShell +|strength=strong +|safety=safe +|express=implicit +|checking=dynamic +|LCT=yes +|site=http://www.microsoft.com/powershell +|bnf=http://www.manning.com/payette/AppCexcerpt.pdf}} +{{language programming paradigm|imperative}} +{{language programming paradigm|object-oriented}} +{{language programming paradigm|functional}} +{{language programming paradigm|reflective}}'''PowerShell''' is a shell and scripting language released by [[Microsoft]] in 2006. Like other shells, PowerShell has a piping mechanism where the output of one command is passed as input to another command. However, unlike most shells, PowerShell passes ''objects'' rather than strings. This eliminates the text munging overhead usually necessary to make the pieces of a script fit together. + +PowerShell is built on Microsoft's [[.NET]] framework and has full access to the CLR. \ No newline at end of file diff --git a/Lang/PowerShell/100-doors b/Lang/PowerShell/100-doors new file mode 120000 index 0000000000..1c0fcaf5c8 --- /dev/null +++ b/Lang/PowerShell/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/24-game b/Lang/PowerShell/24-game new file mode 120000 index 0000000000..b64678d668 --- /dev/null +++ b/Lang/PowerShell/24-game @@ -0,0 +1 @@ +../../Task/24-game/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/99-Bottles-of-Beer b/Lang/PowerShell/99-Bottles-of-Beer new file mode 120000 index 0000000000..87efcf6679 --- /dev/null +++ b/Lang/PowerShell/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/A+B b/Lang/PowerShell/A+B new file mode 120000 index 0000000000..5ba5009dee --- /dev/null +++ b/Lang/PowerShell/A+B @@ -0,0 +1 @@ +../../Task/A+B/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Ackermann-function b/Lang/PowerShell/Ackermann-function new file mode 120000 index 0000000000..46dadc014f --- /dev/null +++ b/Lang/PowerShell/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Add-a-variable-to-a-class-instance-at-runtime b/Lang/PowerShell/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..fbbf2c04d6 --- /dev/null +++ b/Lang/PowerShell/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Anagrams b/Lang/PowerShell/Anagrams new file mode 120000 index 0000000000..09c819c039 --- /dev/null +++ b/Lang/PowerShell/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Apply-a-callback-to-an-array b/Lang/PowerShell/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..28c84168b1 --- /dev/null +++ b/Lang/PowerShell/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Arithmetic-Integer b/Lang/PowerShell/Arithmetic-Integer new file mode 120000 index 0000000000..c8359b9be8 --- /dev/null +++ b/Lang/PowerShell/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Array-concatenation b/Lang/PowerShell/Array-concatenation new file mode 120000 index 0000000000..7b08676ff4 --- /dev/null +++ b/Lang/PowerShell/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Arrays b/Lang/PowerShell/Arrays new file mode 120000 index 0000000000..50c787a32e --- /dev/null +++ b/Lang/PowerShell/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Associative-array-Creation b/Lang/PowerShell/Associative-array-Creation new file mode 120000 index 0000000000..632132139e --- /dev/null +++ b/Lang/PowerShell/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Associative-array-Iteration b/Lang/PowerShell/Associative-array-Iteration new file mode 120000 index 0000000000..534d73b30e --- /dev/null +++ b/Lang/PowerShell/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Averages-Arithmetic-mean b/Lang/PowerShell/Averages-Arithmetic-mean new file mode 120000 index 0000000000..471a24f084 --- /dev/null +++ b/Lang/PowerShell/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Averages-Mode b/Lang/PowerShell/Averages-Mode new file mode 120000 index 0000000000..e21f264dd7 --- /dev/null +++ b/Lang/PowerShell/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Averages-Pythagorean-means b/Lang/PowerShell/Averages-Pythagorean-means new file mode 120000 index 0000000000..916d4c4a0c --- /dev/null +++ b/Lang/PowerShell/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Averages-Root-mean-square b/Lang/PowerShell/Averages-Root-mean-square new file mode 120000 index 0000000000..66523d9b57 --- /dev/null +++ b/Lang/PowerShell/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Best-shuffle b/Lang/PowerShell/Best-shuffle new file mode 120000 index 0000000000..6ffdf63628 --- /dev/null +++ b/Lang/PowerShell/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Boolean-values b/Lang/PowerShell/Boolean-values new file mode 120000 index 0000000000..1ffa0888bb --- /dev/null +++ b/Lang/PowerShell/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/CSV-to-HTML-translation b/Lang/PowerShell/CSV-to-HTML-translation new file mode 120000 index 0000000000..7ece160e53 --- /dev/null +++ b/Lang/PowerShell/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Character-codes b/Lang/PowerShell/Character-codes new file mode 120000 index 0000000000..e9f4d3d3aa --- /dev/null +++ b/Lang/PowerShell/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Character-matching b/Lang/PowerShell/Character-matching new file mode 120000 index 0000000000..9abb929c9a --- /dev/null +++ b/Lang/PowerShell/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Check-that-file-exists b/Lang/PowerShell/Check-that-file-exists new file mode 120000 index 0000000000..af310d8208 --- /dev/null +++ b/Lang/PowerShell/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Command-line-arguments b/Lang/PowerShell/Command-line-arguments new file mode 120000 index 0000000000..8d88bff131 --- /dev/null +++ b/Lang/PowerShell/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Comments b/Lang/PowerShell/Comments new file mode 120000 index 0000000000..32a7eab6bd --- /dev/null +++ b/Lang/PowerShell/Comments @@ -0,0 +1 @@ +../../Task/Comments/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Conditional-structures b/Lang/PowerShell/Conditional-structures new file mode 120000 index 0000000000..fa4fd7b3f8 --- /dev/null +++ b/Lang/PowerShell/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Create-a-file b/Lang/PowerShell/Create-a-file new file mode 120000 index 0000000000..290d743169 --- /dev/null +++ b/Lang/PowerShell/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Date-format b/Lang/PowerShell/Date-format new file mode 120000 index 0000000000..6c3d901be5 --- /dev/null +++ b/Lang/PowerShell/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Date-manipulation b/Lang/PowerShell/Date-manipulation new file mode 120000 index 0000000000..44cff84048 --- /dev/null +++ b/Lang/PowerShell/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Day-of-the-week b/Lang/PowerShell/Day-of-the-week new file mode 120000 index 0000000000..3a2e6a1ad8 --- /dev/null +++ b/Lang/PowerShell/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Delete-a-file b/Lang/PowerShell/Delete-a-file new file mode 120000 index 0000000000..384eba3dfe --- /dev/null +++ b/Lang/PowerShell/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Determine-if-a-string-is-numeric b/Lang/PowerShell/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..e01dd86b60 --- /dev/null +++ b/Lang/PowerShell/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Dynamic-variable-names b/Lang/PowerShell/Dynamic-variable-names new file mode 120000 index 0000000000..95843a260c --- /dev/null +++ b/Lang/PowerShell/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Ethiopian-multiplication b/Lang/PowerShell/Ethiopian-multiplication new file mode 120000 index 0000000000..57f1aabf77 --- /dev/null +++ b/Lang/PowerShell/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Execute-a-system-command b/Lang/PowerShell/Execute-a-system-command new file mode 120000 index 0000000000..3de05174ec --- /dev/null +++ b/Lang/PowerShell/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Exponentiation-operator b/Lang/PowerShell/Exponentiation-operator new file mode 120000 index 0000000000..f586964f54 --- /dev/null +++ b/Lang/PowerShell/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Factorial b/Lang/PowerShell/Factorial new file mode 120000 index 0000000000..e6e18523b2 --- /dev/null +++ b/Lang/PowerShell/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Factors-of-an-integer b/Lang/PowerShell/Factors-of-an-integer new file mode 120000 index 0000000000..28b48479b4 --- /dev/null +++ b/Lang/PowerShell/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Fibonacci-sequence b/Lang/PowerShell/Fibonacci-sequence new file mode 120000 index 0000000000..d15bd6c21e --- /dev/null +++ b/Lang/PowerShell/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/File-IO b/Lang/PowerShell/File-IO new file mode 120000 index 0000000000..8ea671e0cd --- /dev/null +++ b/Lang/PowerShell/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/File-modification-time b/Lang/PowerShell/File-modification-time new file mode 120000 index 0000000000..7a2acf05c0 --- /dev/null +++ b/Lang/PowerShell/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/File-size b/Lang/PowerShell/File-size new file mode 120000 index 0000000000..998b6b3071 --- /dev/null +++ b/Lang/PowerShell/File-size @@ -0,0 +1 @@ +../../Task/File-size/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Filter b/Lang/PowerShell/Filter new file mode 120000 index 0000000000..4e2183d49e --- /dev/null +++ b/Lang/PowerShell/Filter @@ -0,0 +1 @@ +../../Task/Filter/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Find-common-directory-path b/Lang/PowerShell/Find-common-directory-path new file mode 120000 index 0000000000..c3f0d79976 --- /dev/null +++ b/Lang/PowerShell/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Find-limit-of-recursion b/Lang/PowerShell/Find-limit-of-recursion new file mode 120000 index 0000000000..6e8fd2c007 --- /dev/null +++ b/Lang/PowerShell/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/FizzBuzz b/Lang/PowerShell/FizzBuzz new file mode 120000 index 0000000000..14417cdc3a --- /dev/null +++ b/Lang/PowerShell/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Formatted-numeric-output b/Lang/PowerShell/Formatted-numeric-output new file mode 120000 index 0000000000..040cbdf286 --- /dev/null +++ b/Lang/PowerShell/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Forward-difference b/Lang/PowerShell/Forward-difference new file mode 120000 index 0000000000..192446f73c --- /dev/null +++ b/Lang/PowerShell/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Four-bit-adder b/Lang/PowerShell/Four-bit-adder new file mode 120000 index 0000000000..75ad9629e1 --- /dev/null +++ b/Lang/PowerShell/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Function-definition b/Lang/PowerShell/Function-definition new file mode 120000 index 0000000000..4ddb58e133 --- /dev/null +++ b/Lang/PowerShell/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Generic-swap b/Lang/PowerShell/Generic-swap new file mode 120000 index 0000000000..d30052072a --- /dev/null +++ b/Lang/PowerShell/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Greatest-common-divisor b/Lang/PowerShell/Greatest-common-divisor new file mode 120000 index 0000000000..456be864c0 --- /dev/null +++ b/Lang/PowerShell/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Greatest-element-of-a-list b/Lang/PowerShell/Greatest-element-of-a-list new file mode 120000 index 0000000000..8f6d7d23b5 --- /dev/null +++ b/Lang/PowerShell/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Guess-the-number b/Lang/PowerShell/Guess-the-number new file mode 120000 index 0000000000..cbb76a575f --- /dev/null +++ b/Lang/PowerShell/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/HTTP b/Lang/PowerShell/HTTP new file mode 120000 index 0000000000..d8b2a6b473 --- /dev/null +++ b/Lang/PowerShell/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/HTTPS b/Lang/PowerShell/HTTPS new file mode 120000 index 0000000000..69b8f0e83c --- /dev/null +++ b/Lang/PowerShell/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Happy-numbers b/Lang/PowerShell/Happy-numbers new file mode 120000 index 0000000000..fcfb5754a1 --- /dev/null +++ b/Lang/PowerShell/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Hash-from-two-arrays b/Lang/PowerShell/Hash-from-two-arrays new file mode 120000 index 0000000000..6684bed0e0 --- /dev/null +++ b/Lang/PowerShell/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Hello-world-Graphical b/Lang/PowerShell/Hello-world-Graphical new file mode 120000 index 0000000000..30f0134cf9 --- /dev/null +++ b/Lang/PowerShell/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Hello-world-Standard-error b/Lang/PowerShell/Hello-world-Standard-error new file mode 120000 index 0000000000..82582da8e3 --- /dev/null +++ b/Lang/PowerShell/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Hello-world-Text b/Lang/PowerShell/Hello-world-Text new file mode 120000 index 0000000000..e25fcbc9ff --- /dev/null +++ b/Lang/PowerShell/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Here-document b/Lang/PowerShell/Here-document new file mode 120000 index 0000000000..1388e5bba5 --- /dev/null +++ b/Lang/PowerShell/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Host-introspection b/Lang/PowerShell/Host-introspection new file mode 120000 index 0000000000..d468f4951a --- /dev/null +++ b/Lang/PowerShell/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Hostname b/Lang/PowerShell/Hostname new file mode 120000 index 0000000000..5a3b4d5a54 --- /dev/null +++ b/Lang/PowerShell/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Increment-a-numerical-string b/Lang/PowerShell/Increment-a-numerical-string new file mode 120000 index 0000000000..1aad9eecaf --- /dev/null +++ b/Lang/PowerShell/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Infinity b/Lang/PowerShell/Infinity new file mode 120000 index 0000000000..bc8e1acad2 --- /dev/null +++ b/Lang/PowerShell/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Integer-comparison b/Lang/PowerShell/Integer-comparison new file mode 120000 index 0000000000..96adb51183 --- /dev/null +++ b/Lang/PowerShell/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Interactive-programming b/Lang/PowerShell/Interactive-programming new file mode 120000 index 0000000000..b46eeb2633 --- /dev/null +++ b/Lang/PowerShell/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Introspection b/Lang/PowerShell/Introspection new file mode 120000 index 0000000000..81fdba0351 --- /dev/null +++ b/Lang/PowerShell/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Keyboard-input-Flush-the-keyboard-buffer b/Lang/PowerShell/Keyboard-input-Flush-the-keyboard-buffer new file mode 120000 index 0000000000..d579449078 --- /dev/null +++ b/Lang/PowerShell/Keyboard-input-Flush-the-keyboard-buffer @@ -0,0 +1 @@ +../../Task/Keyboard-input-Flush-the-keyboard-buffer/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Keyboard-input-Keypress-check b/Lang/PowerShell/Keyboard-input-Keypress-check new file mode 120000 index 0000000000..f59b3ad9d1 --- /dev/null +++ b/Lang/PowerShell/Keyboard-input-Keypress-check @@ -0,0 +1 @@ +../../Task/Keyboard-input-Keypress-check/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Knuth-shuffle b/Lang/PowerShell/Knuth-shuffle new file mode 120000 index 0000000000..c3f5a0c8f6 --- /dev/null +++ b/Lang/PowerShell/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Leap-year b/Lang/PowerShell/Leap-year new file mode 120000 index 0000000000..acd07cf530 --- /dev/null +++ b/Lang/PowerShell/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Literals-Integer b/Lang/PowerShell/Literals-Integer new file mode 120000 index 0000000000..02f287de85 --- /dev/null +++ b/Lang/PowerShell/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Logical-operations b/Lang/PowerShell/Logical-operations new file mode 120000 index 0000000000..20c39745f5 --- /dev/null +++ b/Lang/PowerShell/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Long-multiplication b/Lang/PowerShell/Long-multiplication new file mode 120000 index 0000000000..d469f3b86f --- /dev/null +++ b/Lang/PowerShell/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Look-and-say-sequence b/Lang/PowerShell/Look-and-say-sequence new file mode 120000 index 0000000000..0233c739e0 --- /dev/null +++ b/Lang/PowerShell/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-Break b/Lang/PowerShell/Loops-Break new file mode 120000 index 0000000000..87e66faa0b --- /dev/null +++ b/Lang/PowerShell/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-Continue b/Lang/PowerShell/Loops-Continue new file mode 120000 index 0000000000..e9afd5127f --- /dev/null +++ b/Lang/PowerShell/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-Do-while b/Lang/PowerShell/Loops-Do-while new file mode 120000 index 0000000000..b93be5a1e1 --- /dev/null +++ b/Lang/PowerShell/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-Downward-for b/Lang/PowerShell/Loops-Downward-for new file mode 120000 index 0000000000..d1ce01ddf3 --- /dev/null +++ b/Lang/PowerShell/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-For b/Lang/PowerShell/Loops-For new file mode 120000 index 0000000000..d3cb2242af --- /dev/null +++ b/Lang/PowerShell/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-For-with-a-specified-step b/Lang/PowerShell/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..3577bca74a --- /dev/null +++ b/Lang/PowerShell/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-Foreach b/Lang/PowerShell/Loops-Foreach new file mode 120000 index 0000000000..922e559f98 --- /dev/null +++ b/Lang/PowerShell/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-Infinite b/Lang/PowerShell/Loops-Infinite new file mode 120000 index 0000000000..9ba37fd1e2 --- /dev/null +++ b/Lang/PowerShell/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-N-plus-one-half b/Lang/PowerShell/Loops-N-plus-one-half new file mode 120000 index 0000000000..6ea7ee24ee --- /dev/null +++ b/Lang/PowerShell/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Loops-While b/Lang/PowerShell/Loops-While new file mode 120000 index 0000000000..267972ce34 --- /dev/null +++ b/Lang/PowerShell/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/MD5 b/Lang/PowerShell/MD5 new file mode 120000 index 0000000000..b818edd4b9 --- /dev/null +++ b/Lang/PowerShell/MD5 @@ -0,0 +1 @@ +../../Task/MD5/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Menu b/Lang/PowerShell/Menu new file mode 120000 index 0000000000..197e6744f5 --- /dev/null +++ b/Lang/PowerShell/Menu @@ -0,0 +1 @@ +../../Task/Menu/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Monte-Carlo-methods b/Lang/PowerShell/Monte-Carlo-methods new file mode 120000 index 0000000000..4c0b381761 --- /dev/null +++ b/Lang/PowerShell/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Monty-Hall-problem b/Lang/PowerShell/Monty-Hall-problem new file mode 120000 index 0000000000..494b35a1bb --- /dev/null +++ b/Lang/PowerShell/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Mutual-recursion b/Lang/PowerShell/Mutual-recursion new file mode 120000 index 0000000000..67e1109a93 --- /dev/null +++ b/Lang/PowerShell/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/PowerShell \ No newline at end of file diff --git a/Lang/PowerShell/Quine b/Lang/PowerShell/Quine new file mode 120000 index 0000000000..42b7ec5c86 --- /dev/null +++ b/Lang/PowerShell/Quine @@ -0,0 +1 @@ +../../Task/Quine/PowerShell \ No newline at end of file diff --git a/Lang/ProDOS/0DESCRIPTION b/Lang/ProDOS/0DESCRIPTION new file mode 100644 index 0000000000..3affb9c53a --- /dev/null +++ b/Lang/ProDOS/0DESCRIPTION @@ -0,0 +1,21 @@ +{{language}} +ProDOS is an open-source command-based programming language created by Riley Houlahan. It is the first language of its kind to be created entirely in Windows 7 Batch (see [[:Category:Batch File|Batch File]]). It is currently in developmental form and is expected to be released in version 1.0 by early next year (2012). + +===Overview=== +ProDOS is a command-based language. This term refers to any form of language that uses built-in commands to function, instead of strings of keywords to function. For example: + +printline Hello, World! + +The command "printline" is used to display the line "Hello, World". For clarification, in Java the alternative would be: +public class HelloWorld +{ + public static void main(String[] args) + { + System.out.println("Goodbye, World!"); + } +} + +As you can see, the difference is quite significant. The command "printline" is pre-defined, this means that the user does not have to define classes,etc. + +===Future Implementations=== +ProDOS has not yet reached a release stage, but due to it being only a few months left until it is able to be released, ProDOS 1 will be ready to be released for public distribution by early 2012. \ No newline at end of file diff --git a/Lang/ProDOS/100-doors b/Lang/ProDOS/100-doors new file mode 120000 index 0000000000..966a0ebc45 --- /dev/null +++ b/Lang/ProDOS/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/24-game b/Lang/ProDOS/24-game new file mode 120000 index 0000000000..741675cb82 --- /dev/null +++ b/Lang/ProDOS/24-game @@ -0,0 +1 @@ +../../Task/24-game/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/24-game-Solve b/Lang/ProDOS/24-game-Solve new file mode 120000 index 0000000000..f67a2ba4c5 --- /dev/null +++ b/Lang/ProDOS/24-game-Solve @@ -0,0 +1 @@ +../../Task/24-game-Solve/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/99-Bottles-of-Beer b/Lang/ProDOS/99-Bottles-of-Beer new file mode 120000 index 0000000000..fe2e9d444b --- /dev/null +++ b/Lang/ProDOS/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/A+B b/Lang/ProDOS/A+B new file mode 120000 index 0000000000..68993a9b97 --- /dev/null +++ b/Lang/ProDOS/A+B @@ -0,0 +1 @@ +../../Task/A+B/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Arithmetic-Integer b/Lang/ProDOS/Arithmetic-Integer new file mode 120000 index 0000000000..8c8e2fc4eb --- /dev/null +++ b/Lang/ProDOS/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Comments b/Lang/ProDOS/Comments new file mode 120000 index 0000000000..0a2828d597 --- /dev/null +++ b/Lang/ProDOS/Comments @@ -0,0 +1 @@ +../../Task/Comments/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Create-a-file b/Lang/ProDOS/Create-a-file new file mode 120000 index 0000000000..214b698a40 --- /dev/null +++ b/Lang/ProDOS/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Delete-a-file b/Lang/ProDOS/Delete-a-file new file mode 120000 index 0000000000..cd15b2a92b --- /dev/null +++ b/Lang/ProDOS/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Dynamic-variable-names b/Lang/ProDOS/Dynamic-variable-names new file mode 120000 index 0000000000..c3fb56d3c2 --- /dev/null +++ b/Lang/ProDOS/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Empty-program b/Lang/ProDOS/Empty-program new file mode 120000 index 0000000000..178e36ffa0 --- /dev/null +++ b/Lang/ProDOS/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Factors-of-an-integer b/Lang/ProDOS/Factors-of-an-integer new file mode 120000 index 0000000000..e42510295b --- /dev/null +++ b/Lang/ProDOS/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Guess-the-number b/Lang/ProDOS/Guess-the-number new file mode 120000 index 0000000000..e019d198ef --- /dev/null +++ b/Lang/ProDOS/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Hello-world-Text b/Lang/ProDOS/Hello-world-Text new file mode 120000 index 0000000000..6aeed36184 --- /dev/null +++ b/Lang/ProDOS/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/ProDOS \ No newline at end of file diff --git a/Lang/ProDOS/Menu b/Lang/ProDOS/Menu new file mode 120000 index 0000000000..bde68a5d0b --- /dev/null +++ b/Lang/ProDOS/Menu @@ -0,0 +1 @@ +../../Task/Menu/ProDOS \ No newline at end of file diff --git a/Lang/Processing/0DESCRIPTION b/Lang/Processing/0DESCRIPTION new file mode 100644 index 0000000000..3e91ceb70a --- /dev/null +++ b/Lang/Processing/0DESCRIPTION @@ -0,0 +1,5 @@ +{{language|Processing +|exec=Virtual Machine +|site=http://processing.org/}} + +Processing is a programming language for create images, animations, and interactions. \ No newline at end of file diff --git a/Lang/Processing/Langtons-ant b/Lang/Processing/Langtons-ant new file mode 120000 index 0000000000..1a1dd3596a --- /dev/null +++ b/Lang/Processing/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/Processing \ No newline at end of file diff --git a/Lang/Protium/0DESCRIPTION b/Lang/Protium/0DESCRIPTION new file mode 100644 index 0000000000..bd00fa02bb --- /dev/null +++ b/Lang/Protium/0DESCRIPTION @@ -0,0 +1,8 @@ +{{Stub}} +{{language|Protium +|site=http://www.protiumblue.com/ +}} +Protium is a universal, symbolic programming language system, based on a systematic a priori analysis of the tasks required for computation. + +== See Also == +* [http://lambda-the-ultimate.org/node/2586 Lambda the Ultimate Discusion of Protium] \ No newline at end of file diff --git a/Lang/Protium/Comments b/Lang/Protium/Comments new file mode 120000 index 0000000000..00b35f60b4 --- /dev/null +++ b/Lang/Protium/Comments @@ -0,0 +1 @@ +../../Task/Comments/Protium \ No newline at end of file diff --git a/Lang/Protium/Create-an-HTML-table b/Lang/Protium/Create-an-HTML-table new file mode 120000 index 0000000000..2ca41736a9 --- /dev/null +++ b/Lang/Protium/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/Protium \ No newline at end of file diff --git a/Lang/Protium/Day-of-the-week b/Lang/Protium/Day-of-the-week new file mode 120000 index 0000000000..9ab0611728 --- /dev/null +++ b/Lang/Protium/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Protium \ No newline at end of file diff --git a/Lang/Protium/Factorial b/Lang/Protium/Factorial new file mode 120000 index 0000000000..60cfeea912 --- /dev/null +++ b/Lang/Protium/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Protium \ No newline at end of file diff --git a/Lang/Protium/Filter b/Lang/Protium/Filter new file mode 120000 index 0000000000..40889c8904 --- /dev/null +++ b/Lang/Protium/Filter @@ -0,0 +1 @@ +../../Task/Filter/Protium \ No newline at end of file diff --git a/Lang/Protium/FizzBuzz b/Lang/Protium/FizzBuzz new file mode 120000 index 0000000000..26be33a1e8 --- /dev/null +++ b/Lang/Protium/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Protium \ No newline at end of file diff --git a/Lang/Protium/HTTP b/Lang/Protium/HTTP new file mode 120000 index 0000000000..fd487b07e4 --- /dev/null +++ b/Lang/Protium/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Protium \ No newline at end of file diff --git a/Lang/Protium/History-variables b/Lang/Protium/History-variables new file mode 120000 index 0000000000..435783db23 --- /dev/null +++ b/Lang/Protium/History-variables @@ -0,0 +1 @@ +../../Task/History-variables/Protium \ No newline at end of file diff --git a/Lang/Pure-Data/0DESCRIPTION b/Lang/Pure-Data/0DESCRIPTION new file mode 100644 index 0000000000..86052767ae --- /dev/null +++ b/Lang/Pure-Data/0DESCRIPTION @@ -0,0 +1,5 @@ +{{stub}} +{{language +|site=http://puredata.info/ +}} +Pd (aka Pure Data) is a real-time graphical programming environment for audio, video, and graphical processing. \ No newline at end of file diff --git a/Lang/Pure/0DESCRIPTION b/Lang/Pure/0DESCRIPTION new file mode 100644 index 0000000000..9a23a85244 --- /dev/null +++ b/Lang/Pure/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language|Pure +|site=http://code.google.com/p/pure-lang/ +|compat=structural +|checking=dynamic +|strength=strong +|gc=yes +|LCT=yes}}{{language programming paradigm|Dynamic}}{{language programming paradigm|Functional}} + +From the official [http://pure-lang.googlecode.com/svn/docs/pure.html Pure manual]: "Pure is a modern-style functional programming language based on term rewriting. Pure programs are basically collections of equational rules used to evaluate expressions in a symbolic fashion by reducing them to normal form." + +The Pure interpreter uses LLVM to JIT-compile code; in addition, Pure programs can be compiled with LLVM to machine code as well. + +==See Also== +* [[wp:Pure_(programming_language)|Wikipedia:Pure (programming language)]] \ No newline at end of file diff --git a/Lang/Pure/A+B b/Lang/Pure/A+B new file mode 120000 index 0000000000..62539930aa --- /dev/null +++ b/Lang/Pure/A+B @@ -0,0 +1 @@ +../../Task/A+B/Pure \ No newline at end of file diff --git a/Lang/Pure/Ackermann-function b/Lang/Pure/Ackermann-function new file mode 120000 index 0000000000..df1ebad303 --- /dev/null +++ b/Lang/Pure/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Pure \ No newline at end of file diff --git a/Lang/Pure/Averages-Median b/Lang/Pure/Averages-Median new file mode 120000 index 0000000000..0e66ee464e --- /dev/null +++ b/Lang/Pure/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Pure \ No newline at end of file diff --git a/Lang/Pure/Combinations b/Lang/Pure/Combinations new file mode 120000 index 0000000000..6cb3896b05 --- /dev/null +++ b/Lang/Pure/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Pure \ No newline at end of file diff --git a/Lang/Pure/Command-line-arguments b/Lang/Pure/Command-line-arguments new file mode 120000 index 0000000000..5b1b83c189 --- /dev/null +++ b/Lang/Pure/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Pure \ No newline at end of file diff --git a/Lang/Pure/Detect-division-by-zero b/Lang/Pure/Detect-division-by-zero new file mode 120000 index 0000000000..d8caedebac --- /dev/null +++ b/Lang/Pure/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Pure \ No newline at end of file diff --git a/Lang/Pure/Factorial b/Lang/Pure/Factorial new file mode 120000 index 0000000000..b24225ffe7 --- /dev/null +++ b/Lang/Pure/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Pure \ No newline at end of file diff --git a/Lang/Pure/Fibonacci-sequence b/Lang/Pure/Fibonacci-sequence new file mode 120000 index 0000000000..134884fccb --- /dev/null +++ b/Lang/Pure/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Pure \ No newline at end of file diff --git a/Lang/Pure/Hailstone-sequence b/Lang/Pure/Hailstone-sequence new file mode 120000 index 0000000000..a31945cadc --- /dev/null +++ b/Lang/Pure/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Pure \ No newline at end of file diff --git a/Lang/Pure/Hello-world-Text b/Lang/Pure/Hello-world-Text new file mode 120000 index 0000000000..01f315f4af --- /dev/null +++ b/Lang/Pure/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Pure \ No newline at end of file diff --git a/Lang/Pure/Look-and-say-sequence b/Lang/Pure/Look-and-say-sequence new file mode 120000 index 0000000000..1623b99165 --- /dev/null +++ b/Lang/Pure/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Pure \ No newline at end of file diff --git a/Lang/Pure/Mutual-recursion b/Lang/Pure/Mutual-recursion new file mode 120000 index 0000000000..e573f0704a --- /dev/null +++ b/Lang/Pure/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Pure \ No newline at end of file diff --git a/Lang/PureBasic/0DESCRIPTION b/Lang/PureBasic/0DESCRIPTION new file mode 100644 index 0000000000..a75d066904 --- /dev/null +++ b/Lang/PureBasic/0DESCRIPTION @@ -0,0 +1,40 @@ +{{language|PureBasic +|exec=machine +|parampass=both +|gc=no +|express=implicit +|tags=purebasic +|site=http://www.purebasic.com/}} +{{implementation|BASIC}}'''PureBasic''' is a "high-level" programming language based on "BASIC" rules. PureBasic has been created for beginners and experts alike. + +PureBasic is a portable programming language with current up to date implementations on Windows, Linux, and MacOS. The same code can be compiled and run natively on each OS. An older version for the Amiga platform is no longer maintained. + +PureBasic was first released by '''Fantaisie Software''' [http://www.purebasic.com www.purebasic.com] in 2001. Since then the language is being improved and expanded continuously. + +==Features== +* x86, x64, 680x0 and PowerPC support +* Built-in arrays, dynamic linked lists, complex structures, pointers and variable definitions +* Supported types: Byte (8 bits), Word (16 bits), Long (32 bits), Quad (64 bits), Float (32 bits), Double (64 bits) and Characters +* User defined types (structures) +* Built-in string types (characters), including ascii and unicode +* Powerful macro support +* Constants, binary and hexadecimal numbers supported +* Expression reducer by grouping constants and numeric numbers together +* Standard arithmetic support in respect of sign priority and parenthesis: +, -, /, *, and, or, <<, >> +* Extremely fast compilation +* Procedure support for structured programming with local and global variables +* All Standard BASIC keywords: If-Else-EndIf, Repeat-Until, etc +* Specialized libraries to manipulate BMP pictures, windows, gadgets, DirectX, etc +* Specialized libraries are very optimized for maximum speed and compactness +* The Win32 API is fully supported as if they were BASIC keywords +* Inline Assembler +* Precompiled structures with constants files for extra-fast compilation +* Configurable CLI compiler +* High productivity, comprehensive keywords, online help +* System friendly, easy to install and easy to use + +==See Also== +* [[wp:PureBasic|Wikipedia: PureBasic]] + +{{language programming paradigm|procedural}} +{{language programming paradigm|imperative}} \ No newline at end of file diff --git a/Lang/PureBasic/100-doors b/Lang/PureBasic/100-doors new file mode 120000 index 0000000000..b5c163f4fd --- /dev/null +++ b/Lang/PureBasic/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/24-game b/Lang/PureBasic/24-game new file mode 120000 index 0000000000..f515ff593e --- /dev/null +++ b/Lang/PureBasic/24-game @@ -0,0 +1 @@ +../../Task/24-game/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/99-Bottles-of-Beer b/Lang/PureBasic/99-Bottles-of-Beer new file mode 120000 index 0000000000..9502083317 --- /dev/null +++ b/Lang/PureBasic/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/A+B b/Lang/PureBasic/A+B new file mode 120000 index 0000000000..505cba0765 --- /dev/null +++ b/Lang/PureBasic/A+B @@ -0,0 +1 @@ +../../Task/A+B/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Ackermann-function b/Lang/PureBasic/Ackermann-function new file mode 120000 index 0000000000..b6df5d0610 --- /dev/null +++ b/Lang/PureBasic/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Active-object b/Lang/PureBasic/Active-object new file mode 120000 index 0000000000..b9760a3228 --- /dev/null +++ b/Lang/PureBasic/Active-object @@ -0,0 +1 @@ +../../Task/Active-object/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Address-of-a-variable b/Lang/PureBasic/Address-of-a-variable new file mode 120000 index 0000000000..401f549963 --- /dev/null +++ b/Lang/PureBasic/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Align-columns b/Lang/PureBasic/Align-columns new file mode 120000 index 0000000000..51c51625d0 --- /dev/null +++ b/Lang/PureBasic/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Anagrams b/Lang/PureBasic/Anagrams new file mode 120000 index 0000000000..392a3de419 --- /dev/null +++ b/Lang/PureBasic/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Anagrams-Deranged-anagrams b/Lang/PureBasic/Anagrams-Deranged-anagrams new file mode 120000 index 0000000000..7bd4e57059 --- /dev/null +++ b/Lang/PureBasic/Anagrams-Deranged-anagrams @@ -0,0 +1 @@ +../../Task/Anagrams-Deranged-anagrams/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Animate-a-pendulum b/Lang/PureBasic/Animate-a-pendulum new file mode 120000 index 0000000000..d0039e93e9 --- /dev/null +++ b/Lang/PureBasic/Animate-a-pendulum @@ -0,0 +1 @@ +../../Task/Animate-a-pendulum/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Animation b/Lang/PureBasic/Animation new file mode 120000 index 0000000000..4222ce490a --- /dev/null +++ b/Lang/PureBasic/Animation @@ -0,0 +1 @@ +../../Task/Animation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Apply-a-callback-to-an-array b/Lang/PureBasic/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..25b7eb5331 --- /dev/null +++ b/Lang/PureBasic/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Arbitrary-precision-integers-included b/Lang/PureBasic/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..c2272798fe --- /dev/null +++ b/Lang/PureBasic/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Arithmetic-Complex b/Lang/PureBasic/Arithmetic-Complex new file mode 120000 index 0000000000..d63f65fac6 --- /dev/null +++ b/Lang/PureBasic/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Arithmetic-Integer b/Lang/PureBasic/Arithmetic-Integer new file mode 120000 index 0000000000..dc07a10a4b --- /dev/null +++ b/Lang/PureBasic/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Arithmetic-geometric-mean b/Lang/PureBasic/Arithmetic-geometric-mean new file mode 120000 index 0000000000..f101d2cf9e --- /dev/null +++ b/Lang/PureBasic/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Array-concatenation b/Lang/PureBasic/Array-concatenation new file mode 120000 index 0000000000..b3bc93f5c9 --- /dev/null +++ b/Lang/PureBasic/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Arrays b/Lang/PureBasic/Arrays new file mode 120000 index 0000000000..b164ccfbcf --- /dev/null +++ b/Lang/PureBasic/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Assertions b/Lang/PureBasic/Assertions new file mode 120000 index 0000000000..a4dde644c1 --- /dev/null +++ b/Lang/PureBasic/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Associative-array-Creation b/Lang/PureBasic/Associative-array-Creation new file mode 120000 index 0000000000..7218e592fa --- /dev/null +++ b/Lang/PureBasic/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Associative-array-Iteration b/Lang/PureBasic/Associative-array-Iteration new file mode 120000 index 0000000000..db0d8cd17a --- /dev/null +++ b/Lang/PureBasic/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Atomic-updates b/Lang/PureBasic/Atomic-updates new file mode 120000 index 0000000000..398b65e383 --- /dev/null +++ b/Lang/PureBasic/Atomic-updates @@ -0,0 +1 @@ +../../Task/Atomic-updates/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Averages-Arithmetic-mean b/Lang/PureBasic/Averages-Arithmetic-mean new file mode 120000 index 0000000000..5b7af91529 --- /dev/null +++ b/Lang/PureBasic/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Averages-Median b/Lang/PureBasic/Averages-Median new file mode 120000 index 0000000000..4b57d92d85 --- /dev/null +++ b/Lang/PureBasic/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Averages-Mode b/Lang/PureBasic/Averages-Mode new file mode 120000 index 0000000000..97e182e3fc --- /dev/null +++ b/Lang/PureBasic/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Averages-Pythagorean-means b/Lang/PureBasic/Averages-Pythagorean-means new file mode 120000 index 0000000000..fe11d104e9 --- /dev/null +++ b/Lang/PureBasic/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Averages-Root-mean-square b/Lang/PureBasic/Averages-Root-mean-square new file mode 120000 index 0000000000..35a657c1a4 --- /dev/null +++ b/Lang/PureBasic/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Averages-Simple-moving-average b/Lang/PureBasic/Averages-Simple-moving-average new file mode 120000 index 0000000000..8049c9e178 --- /dev/null +++ b/Lang/PureBasic/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Balanced-brackets b/Lang/PureBasic/Balanced-brackets new file mode 120000 index 0000000000..1a3f15c3a8 --- /dev/null +++ b/Lang/PureBasic/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Best-shuffle b/Lang/PureBasic/Best-shuffle new file mode 120000 index 0000000000..d33ab6dd94 --- /dev/null +++ b/Lang/PureBasic/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Binary-search b/Lang/PureBasic/Binary-search new file mode 120000 index 0000000000..d0dc5e4c05 --- /dev/null +++ b/Lang/PureBasic/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Binary-strings b/Lang/PureBasic/Binary-strings new file mode 120000 index 0000000000..eed234c08b --- /dev/null +++ b/Lang/PureBasic/Binary-strings @@ -0,0 +1 @@ +../../Task/Binary-strings/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap b/Lang/PureBasic/Bitmap new file mode 120000 index 0000000000..420c815f80 --- /dev/null +++ b/Lang/PureBasic/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-B-zier-curves-Cubic b/Lang/PureBasic/Bitmap-B-zier-curves-Cubic new file mode 120000 index 0000000000..f291bb623a --- /dev/null +++ b/Lang/PureBasic/Bitmap-B-zier-curves-Cubic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Cubic/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-B-zier-curves-Quadratic b/Lang/PureBasic/Bitmap-B-zier-curves-Quadratic new file mode 120000 index 0000000000..27f1422b7d --- /dev/null +++ b/Lang/PureBasic/Bitmap-B-zier-curves-Quadratic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Quadratic/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-Bresenhams-line-algorithm b/Lang/PureBasic/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..44aec1c596 --- /dev/null +++ b/Lang/PureBasic/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-Flood-fill b/Lang/PureBasic/Bitmap-Flood-fill new file mode 120000 index 0000000000..132f3c04dd --- /dev/null +++ b/Lang/PureBasic/Bitmap-Flood-fill @@ -0,0 +1 @@ +../../Task/Bitmap-Flood-fill/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-Histogram b/Lang/PureBasic/Bitmap-Histogram new file mode 120000 index 0000000000..bb1c72b03c --- /dev/null +++ b/Lang/PureBasic/Bitmap-Histogram @@ -0,0 +1 @@ +../../Task/Bitmap-Histogram/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-Midpoint-circle-algorithm b/Lang/PureBasic/Bitmap-Midpoint-circle-algorithm new file mode 120000 index 0000000000..a5dc72db69 --- /dev/null +++ b/Lang/PureBasic/Bitmap-Midpoint-circle-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Midpoint-circle-algorithm/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-Read-a-PPM-file b/Lang/PureBasic/Bitmap-Read-a-PPM-file new file mode 120000 index 0000000000..035dfdfe92 --- /dev/null +++ b/Lang/PureBasic/Bitmap-Read-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Read-a-PPM-file/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitmap-Write-a-PPM-file b/Lang/PureBasic/Bitmap-Write-a-PPM-file new file mode 120000 index 0000000000..16ecea0312 --- /dev/null +++ b/Lang/PureBasic/Bitmap-Write-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Write-a-PPM-file/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitwise-IO b/Lang/PureBasic/Bitwise-IO new file mode 120000 index 0000000000..3149e47116 --- /dev/null +++ b/Lang/PureBasic/Bitwise-IO @@ -0,0 +1 @@ +../../Task/Bitwise-IO/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bitwise-operations b/Lang/PureBasic/Bitwise-operations new file mode 120000 index 0000000000..cd8defdf17 --- /dev/null +++ b/Lang/PureBasic/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Box-the-compass b/Lang/PureBasic/Box-the-compass new file mode 120000 index 0000000000..6c481d4d7a --- /dev/null +++ b/Lang/PureBasic/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bulls-and-cows b/Lang/PureBasic/Bulls-and-cows new file mode 120000 index 0000000000..45c31072be --- /dev/null +++ b/Lang/PureBasic/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Bulls-and-cows-Player b/Lang/PureBasic/Bulls-and-cows-Player new file mode 120000 index 0000000000..1a73c97aa2 --- /dev/null +++ b/Lang/PureBasic/Bulls-and-cows-Player @@ -0,0 +1 @@ +../../Task/Bulls-and-cows-Player/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Caesar-cipher b/Lang/PureBasic/Caesar-cipher new file mode 120000 index 0000000000..dbd28b2612 --- /dev/null +++ b/Lang/PureBasic/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Call-a-foreign-language-function b/Lang/PureBasic/Call-a-foreign-language-function new file mode 120000 index 0000000000..66ea0a2923 --- /dev/null +++ b/Lang/PureBasic/Call-a-foreign-language-function @@ -0,0 +1 @@ +../../Task/Call-a-foreign-language-function/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Call-a-function-in-a-shared-library b/Lang/PureBasic/Call-a-function-in-a-shared-library new file mode 120000 index 0000000000..60de18c944 --- /dev/null +++ b/Lang/PureBasic/Call-a-function-in-a-shared-library @@ -0,0 +1 @@ +../../Task/Call-a-function-in-a-shared-library/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Case-sensitivity-of-identifiers b/Lang/PureBasic/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..4350a693bf --- /dev/null +++ b/Lang/PureBasic/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Character-codes b/Lang/PureBasic/Character-codes new file mode 120000 index 0000000000..3ab769e64d --- /dev/null +++ b/Lang/PureBasic/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Character-matching b/Lang/PureBasic/Character-matching new file mode 120000 index 0000000000..e99f64e1a9 --- /dev/null +++ b/Lang/PureBasic/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Check-that-file-exists b/Lang/PureBasic/Check-that-file-exists new file mode 120000 index 0000000000..8dfbcdb048 --- /dev/null +++ b/Lang/PureBasic/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Checkpoint-synchronization b/Lang/PureBasic/Checkpoint-synchronization new file mode 120000 index 0000000000..79c94e81ab --- /dev/null +++ b/Lang/PureBasic/Checkpoint-synchronization @@ -0,0 +1 @@ +../../Task/Checkpoint-synchronization/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Classes b/Lang/PureBasic/Classes new file mode 120000 index 0000000000..4d2d92b8d9 --- /dev/null +++ b/Lang/PureBasic/Classes @@ -0,0 +1 @@ +../../Task/Classes/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Closest-pair-problem b/Lang/PureBasic/Closest-pair-problem new file mode 120000 index 0000000000..6c3aa7f2ae --- /dev/null +++ b/Lang/PureBasic/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Collections b/Lang/PureBasic/Collections new file mode 120000 index 0000000000..c80307db8a --- /dev/null +++ b/Lang/PureBasic/Collections @@ -0,0 +1 @@ +../../Task/Collections/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Color-of-a-screen-pixel b/Lang/PureBasic/Color-of-a-screen-pixel new file mode 120000 index 0000000000..a523d8d53d --- /dev/null +++ b/Lang/PureBasic/Color-of-a-screen-pixel @@ -0,0 +1 @@ +../../Task/Color-of-a-screen-pixel/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Color-quantization b/Lang/PureBasic/Color-quantization new file mode 120000 index 0000000000..ae2a790f0b --- /dev/null +++ b/Lang/PureBasic/Color-quantization @@ -0,0 +1 @@ +../../Task/Color-quantization/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Colour-bars-Display b/Lang/PureBasic/Colour-bars-Display new file mode 120000 index 0000000000..c734bc3566 --- /dev/null +++ b/Lang/PureBasic/Colour-bars-Display @@ -0,0 +1 @@ +../../Task/Colour-bars-Display/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Colour-pinstripe-Display b/Lang/PureBasic/Colour-pinstripe-Display new file mode 120000 index 0000000000..367bf61e70 --- /dev/null +++ b/Lang/PureBasic/Colour-pinstripe-Display @@ -0,0 +1 @@ +../../Task/Colour-pinstripe-Display/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Combinations b/Lang/PureBasic/Combinations new file mode 120000 index 0000000000..5532c0b7a8 --- /dev/null +++ b/Lang/PureBasic/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Combinations-with-repetitions b/Lang/PureBasic/Combinations-with-repetitions new file mode 120000 index 0000000000..b5a73a96f4 --- /dev/null +++ b/Lang/PureBasic/Combinations-with-repetitions @@ -0,0 +1 @@ +../../Task/Combinations-with-repetitions/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Command-line-arguments b/Lang/PureBasic/Command-line-arguments new file mode 120000 index 0000000000..85462174ca --- /dev/null +++ b/Lang/PureBasic/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Comments b/Lang/PureBasic/Comments new file mode 120000 index 0000000000..4c2b349bdb --- /dev/null +++ b/Lang/PureBasic/Comments @@ -0,0 +1 @@ +../../Task/Comments/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Compile-time-calculation b/Lang/PureBasic/Compile-time-calculation new file mode 120000 index 0000000000..b909998c3d --- /dev/null +++ b/Lang/PureBasic/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Compound-data-type b/Lang/PureBasic/Compound-data-type new file mode 120000 index 0000000000..d180593099 --- /dev/null +++ b/Lang/PureBasic/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Concurrent-computing b/Lang/PureBasic/Concurrent-computing new file mode 120000 index 0000000000..b21eb8c1cb --- /dev/null +++ b/Lang/PureBasic/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Conditional-structures b/Lang/PureBasic/Conditional-structures new file mode 120000 index 0000000000..48edae41c2 --- /dev/null +++ b/Lang/PureBasic/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Constrained-random-points-on-a-circle b/Lang/PureBasic/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..b6eea8c2bb --- /dev/null +++ b/Lang/PureBasic/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Conways-Game-of-Life b/Lang/PureBasic/Conways-Game-of-Life new file mode 120000 index 0000000000..05347f3c59 --- /dev/null +++ b/Lang/PureBasic/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Count-in-factors b/Lang/PureBasic/Count-in-factors new file mode 120000 index 0000000000..8cd97c7000 --- /dev/null +++ b/Lang/PureBasic/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Count-in-octal b/Lang/PureBasic/Count-in-octal new file mode 120000 index 0000000000..4c4bccb18a --- /dev/null +++ b/Lang/PureBasic/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Count-occurrences-of-a-substring b/Lang/PureBasic/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..82a3b6b2da --- /dev/null +++ b/Lang/PureBasic/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Create-a-file b/Lang/PureBasic/Create-a-file new file mode 120000 index 0000000000..133b452d56 --- /dev/null +++ b/Lang/PureBasic/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Create-a-two-dimensional-array-at-runtime b/Lang/PureBasic/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..0ec4825cf6 --- /dev/null +++ b/Lang/PureBasic/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Create-an-object-at-a-given-address b/Lang/PureBasic/Create-an-object-at-a-given-address new file mode 120000 index 0000000000..d519732766 --- /dev/null +++ b/Lang/PureBasic/Create-an-object-at-a-given-address @@ -0,0 +1 @@ +../../Task/Create-an-object-at-a-given-address/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Date-format b/Lang/PureBasic/Date-format new file mode 120000 index 0000000000..b139639ceb --- /dev/null +++ b/Lang/PureBasic/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Day-of-the-week b/Lang/PureBasic/Day-of-the-week new file mode 120000 index 0000000000..a837fd5e3c --- /dev/null +++ b/Lang/PureBasic/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Deal-cards-for-FreeCell b/Lang/PureBasic/Deal-cards-for-FreeCell new file mode 120000 index 0000000000..bead7e4201 --- /dev/null +++ b/Lang/PureBasic/Deal-cards-for-FreeCell @@ -0,0 +1 @@ +../../Task/Deal-cards-for-FreeCell/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Delete-a-file b/Lang/PureBasic/Delete-a-file new file mode 120000 index 0000000000..ea5ea78469 --- /dev/null +++ b/Lang/PureBasic/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Detect-division-by-zero b/Lang/PureBasic/Detect-division-by-zero new file mode 120000 index 0000000000..6a32f8cde3 --- /dev/null +++ b/Lang/PureBasic/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Determine-if-a-string-is-numeric b/Lang/PureBasic/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..27cd0bd043 --- /dev/null +++ b/Lang/PureBasic/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Determine-if-only-one-instance-is-running b/Lang/PureBasic/Determine-if-only-one-instance-is-running new file mode 120000 index 0000000000..9fa80d0d5f --- /dev/null +++ b/Lang/PureBasic/Determine-if-only-one-instance-is-running @@ -0,0 +1 @@ +../../Task/Determine-if-only-one-instance-is-running/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Digital-root b/Lang/PureBasic/Digital-root new file mode 120000 index 0000000000..3a1f6d5d08 --- /dev/null +++ b/Lang/PureBasic/Digital-root @@ -0,0 +1 @@ +../../Task/Digital-root/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Dinesmans-multiple-dwelling-problem b/Lang/PureBasic/Dinesmans-multiple-dwelling-problem new file mode 120000 index 0000000000..50cff2100e --- /dev/null +++ b/Lang/PureBasic/Dinesmans-multiple-dwelling-problem @@ -0,0 +1 @@ +../../Task/Dinesmans-multiple-dwelling-problem/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Dining-philosophers b/Lang/PureBasic/Dining-philosophers new file mode 120000 index 0000000000..b3c2b34288 --- /dev/null +++ b/Lang/PureBasic/Dining-philosophers @@ -0,0 +1 @@ +../../Task/Dining-philosophers/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Discordian-date b/Lang/PureBasic/Discordian-date new file mode 120000 index 0000000000..901f388dbd --- /dev/null +++ b/Lang/PureBasic/Discordian-date @@ -0,0 +1 @@ +../../Task/Discordian-date/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Documentation b/Lang/PureBasic/Documentation new file mode 120000 index 0000000000..3165fdb036 --- /dev/null +++ b/Lang/PureBasic/Documentation @@ -0,0 +1 @@ +../../Task/Documentation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Dot-product b/Lang/PureBasic/Dot-product new file mode 120000 index 0000000000..0eb1f59b9e --- /dev/null +++ b/Lang/PureBasic/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Doubly-linked-list-Definition b/Lang/PureBasic/Doubly-linked-list-Definition new file mode 120000 index 0000000000..1013617548 --- /dev/null +++ b/Lang/PureBasic/Doubly-linked-list-Definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Definition/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Doubly-linked-list-Element-definition b/Lang/PureBasic/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..f170edce62 --- /dev/null +++ b/Lang/PureBasic/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Doubly-linked-list-Element-insertion b/Lang/PureBasic/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..9d68b2fe79 --- /dev/null +++ b/Lang/PureBasic/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Doubly-linked-list-Traversal b/Lang/PureBasic/Doubly-linked-list-Traversal new file mode 120000 index 0000000000..018f1e2dd9 --- /dev/null +++ b/Lang/PureBasic/Doubly-linked-list-Traversal @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Traversal/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Draw-a-cuboid b/Lang/PureBasic/Draw-a-cuboid new file mode 120000 index 0000000000..da8416c01e --- /dev/null +++ b/Lang/PureBasic/Draw-a-cuboid @@ -0,0 +1 @@ +../../Task/Draw-a-cuboid/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Draw-a-sphere b/Lang/PureBasic/Draw-a-sphere new file mode 120000 index 0000000000..7d51f87b9d --- /dev/null +++ b/Lang/PureBasic/Draw-a-sphere @@ -0,0 +1 @@ +../../Task/Draw-a-sphere/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Echo-server b/Lang/PureBasic/Echo-server new file mode 120000 index 0000000000..72bb3cf477 --- /dev/null +++ b/Lang/PureBasic/Echo-server @@ -0,0 +1 @@ +../../Task/Echo-server/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Empty-directory b/Lang/PureBasic/Empty-directory new file mode 120000 index 0000000000..7b4f04778f --- /dev/null +++ b/Lang/PureBasic/Empty-directory @@ -0,0 +1 @@ +../../Task/Empty-directory/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Empty-program b/Lang/PureBasic/Empty-program new file mode 120000 index 0000000000..b02cf215ef --- /dev/null +++ b/Lang/PureBasic/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Empty-string b/Lang/PureBasic/Empty-string new file mode 120000 index 0000000000..a6b48ead66 --- /dev/null +++ b/Lang/PureBasic/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Enforced-immutability b/Lang/PureBasic/Enforced-immutability new file mode 120000 index 0000000000..a530917ce2 --- /dev/null +++ b/Lang/PureBasic/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Enumerations b/Lang/PureBasic/Enumerations new file mode 120000 index 0000000000..c737a589c4 --- /dev/null +++ b/Lang/PureBasic/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Equilibrium-index b/Lang/PureBasic/Equilibrium-index new file mode 120000 index 0000000000..900309a248 --- /dev/null +++ b/Lang/PureBasic/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Ethiopian-multiplication b/Lang/PureBasic/Ethiopian-multiplication new file mode 120000 index 0000000000..e72cb68d85 --- /dev/null +++ b/Lang/PureBasic/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Euler-method b/Lang/PureBasic/Euler-method new file mode 120000 index 0000000000..30b8452a51 --- /dev/null +++ b/Lang/PureBasic/Euler-method @@ -0,0 +1 @@ +../../Task/Euler-method/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Evaluate-binomial-coefficients b/Lang/PureBasic/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..6fc647cbf9 --- /dev/null +++ b/Lang/PureBasic/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Even-or-odd b/Lang/PureBasic/Even-or-odd new file mode 120000 index 0000000000..c7f792d1b3 --- /dev/null +++ b/Lang/PureBasic/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Events b/Lang/PureBasic/Events new file mode 120000 index 0000000000..43207f761a --- /dev/null +++ b/Lang/PureBasic/Events @@ -0,0 +1 @@ +../../Task/Events/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Evolutionary-algorithm b/Lang/PureBasic/Evolutionary-algorithm new file mode 120000 index 0000000000..ea7ac8c68e --- /dev/null +++ b/Lang/PureBasic/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Exceptions b/Lang/PureBasic/Exceptions new file mode 120000 index 0000000000..e74677b1e1 --- /dev/null +++ b/Lang/PureBasic/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Execute-HQ9+ b/Lang/PureBasic/Execute-HQ9+ new file mode 120000 index 0000000000..bba713c4af --- /dev/null +++ b/Lang/PureBasic/Execute-HQ9+ @@ -0,0 +1 @@ +../../Task/Execute-HQ9+/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Execute-a-system-command b/Lang/PureBasic/Execute-a-system-command new file mode 120000 index 0000000000..51167f8ac5 --- /dev/null +++ b/Lang/PureBasic/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Exponentiation-operator b/Lang/PureBasic/Exponentiation-operator new file mode 120000 index 0000000000..0ab2d02613 --- /dev/null +++ b/Lang/PureBasic/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Extreme-floating-point-values b/Lang/PureBasic/Extreme-floating-point-values new file mode 120000 index 0000000000..5736c047b8 --- /dev/null +++ b/Lang/PureBasic/Extreme-floating-point-values @@ -0,0 +1 @@ +../../Task/Extreme-floating-point-values/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Factorial b/Lang/PureBasic/Factorial new file mode 120000 index 0000000000..1888d66023 --- /dev/null +++ b/Lang/PureBasic/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Factors-of-an-integer b/Lang/PureBasic/Factors-of-an-integer new file mode 120000 index 0000000000..6f1daa8965 --- /dev/null +++ b/Lang/PureBasic/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Fibonacci-n-step-number-sequences b/Lang/PureBasic/Fibonacci-n-step-number-sequences new file mode 120000 index 0000000000..56e73149ca --- /dev/null +++ b/Lang/PureBasic/Fibonacci-n-step-number-sequences @@ -0,0 +1 @@ +../../Task/Fibonacci-n-step-number-sequences/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Fibonacci-sequence b/Lang/PureBasic/Fibonacci-sequence new file mode 120000 index 0000000000..bcc7d34a82 --- /dev/null +++ b/Lang/PureBasic/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/File-IO b/Lang/PureBasic/File-IO new file mode 120000 index 0000000000..b566c9f77a --- /dev/null +++ b/Lang/PureBasic/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/File-modification-time b/Lang/PureBasic/File-modification-time new file mode 120000 index 0000000000..e3386f53e5 --- /dev/null +++ b/Lang/PureBasic/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/File-size b/Lang/PureBasic/File-size new file mode 120000 index 0000000000..b8dbdd9436 --- /dev/null +++ b/Lang/PureBasic/File-size @@ -0,0 +1 @@ +../../Task/File-size/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Filter b/Lang/PureBasic/Filter new file mode 120000 index 0000000000..f8c8a1a9d9 --- /dev/null +++ b/Lang/PureBasic/Filter @@ -0,0 +1 @@ +../../Task/Filter/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Find-common-directory-path b/Lang/PureBasic/Find-common-directory-path new file mode 120000 index 0000000000..9843dc50b0 --- /dev/null +++ b/Lang/PureBasic/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Find-limit-of-recursion b/Lang/PureBasic/Find-limit-of-recursion new file mode 120000 index 0000000000..e57b9ada98 --- /dev/null +++ b/Lang/PureBasic/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Find-the-missing-permutation b/Lang/PureBasic/Find-the-missing-permutation new file mode 120000 index 0000000000..fe1e16af87 --- /dev/null +++ b/Lang/PureBasic/Find-the-missing-permutation @@ -0,0 +1 @@ +../../Task/Find-the-missing-permutation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Five-weekends b/Lang/PureBasic/Five-weekends new file mode 120000 index 0000000000..dbe7dc9546 --- /dev/null +++ b/Lang/PureBasic/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/FizzBuzz b/Lang/PureBasic/FizzBuzz new file mode 120000 index 0000000000..b02d41c08c --- /dev/null +++ b/Lang/PureBasic/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Flatten-a-list b/Lang/PureBasic/Flatten-a-list new file mode 120000 index 0000000000..989d9d9b89 --- /dev/null +++ b/Lang/PureBasic/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Flow-control-structures b/Lang/PureBasic/Flow-control-structures new file mode 120000 index 0000000000..bbe1e7dd8c --- /dev/null +++ b/Lang/PureBasic/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Floyds-triangle b/Lang/PureBasic/Floyds-triangle new file mode 120000 index 0000000000..09242de2ea --- /dev/null +++ b/Lang/PureBasic/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Forest-fire b/Lang/PureBasic/Forest-fire new file mode 120000 index 0000000000..17b815da23 --- /dev/null +++ b/Lang/PureBasic/Forest-fire @@ -0,0 +1 @@ +../../Task/Forest-fire/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Formatted-numeric-output b/Lang/PureBasic/Formatted-numeric-output new file mode 120000 index 0000000000..c3a1cdca47 --- /dev/null +++ b/Lang/PureBasic/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Forward-difference b/Lang/PureBasic/Forward-difference new file mode 120000 index 0000000000..479efeaaff --- /dev/null +++ b/Lang/PureBasic/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Four-bit-adder b/Lang/PureBasic/Four-bit-adder new file mode 120000 index 0000000000..25f459fe70 --- /dev/null +++ b/Lang/PureBasic/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Fractal-tree b/Lang/PureBasic/Fractal-tree new file mode 120000 index 0000000000..1663d73136 --- /dev/null +++ b/Lang/PureBasic/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Function-composition b/Lang/PureBasic/Function-composition new file mode 120000 index 0000000000..22da15052d --- /dev/null +++ b/Lang/PureBasic/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Function-definition b/Lang/PureBasic/Function-definition new file mode 120000 index 0000000000..c1071bafc0 --- /dev/null +++ b/Lang/PureBasic/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/GUI-Maximum-window-dimensions b/Lang/PureBasic/GUI-Maximum-window-dimensions new file mode 120000 index 0000000000..b4596a8cb3 --- /dev/null +++ b/Lang/PureBasic/GUI-Maximum-window-dimensions @@ -0,0 +1 @@ +../../Task/GUI-Maximum-window-dimensions/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/GUI-component-interaction b/Lang/PureBasic/GUI-component-interaction new file mode 120000 index 0000000000..dd7db2aef7 --- /dev/null +++ b/Lang/PureBasic/GUI-component-interaction @@ -0,0 +1 @@ +../../Task/GUI-component-interaction/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/GUI-enabling-disabling-of-controls b/Lang/PureBasic/GUI-enabling-disabling-of-controls new file mode 120000 index 0000000000..e2372db5f4 --- /dev/null +++ b/Lang/PureBasic/GUI-enabling-disabling-of-controls @@ -0,0 +1 @@ +../../Task/GUI-enabling-disabling-of-controls/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Galton-box-animation b/Lang/PureBasic/Galton-box-animation new file mode 120000 index 0000000000..5620f792be --- /dev/null +++ b/Lang/PureBasic/Galton-box-animation @@ -0,0 +1 @@ +../../Task/Galton-box-animation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Gamma-function b/Lang/PureBasic/Gamma-function new file mode 120000 index 0000000000..c296d1a559 --- /dev/null +++ b/Lang/PureBasic/Gamma-function @@ -0,0 +1 @@ +../../Task/Gamma-function/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Generic-swap b/Lang/PureBasic/Generic-swap new file mode 120000 index 0000000000..821d1ae728 --- /dev/null +++ b/Lang/PureBasic/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Globally-replace-text-in-several-files b/Lang/PureBasic/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..6c91f61ee2 --- /dev/null +++ b/Lang/PureBasic/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Gray-code b/Lang/PureBasic/Gray-code new file mode 120000 index 0000000000..91888ebbaf --- /dev/null +++ b/Lang/PureBasic/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Grayscale-image b/Lang/PureBasic/Grayscale-image new file mode 120000 index 0000000000..4219098250 --- /dev/null +++ b/Lang/PureBasic/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Greatest-common-divisor b/Lang/PureBasic/Greatest-common-divisor new file mode 120000 index 0000000000..76d6b4a7b0 --- /dev/null +++ b/Lang/PureBasic/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Greatest-element-of-a-list b/Lang/PureBasic/Greatest-element-of-a-list new file mode 120000 index 0000000000..179251c191 --- /dev/null +++ b/Lang/PureBasic/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Greatest-subsequential-sum b/Lang/PureBasic/Greatest-subsequential-sum new file mode 120000 index 0000000000..52ae17c418 --- /dev/null +++ b/Lang/PureBasic/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Greyscale-bars-Display b/Lang/PureBasic/Greyscale-bars-Display new file mode 120000 index 0000000000..e5f55a2fba --- /dev/null +++ b/Lang/PureBasic/Greyscale-bars-Display @@ -0,0 +1 @@ +../../Task/Greyscale-bars-Display/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Guess-the-number b/Lang/PureBasic/Guess-the-number new file mode 120000 index 0000000000..460d775fe6 --- /dev/null +++ b/Lang/PureBasic/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Guess-the-number-With-feedback b/Lang/PureBasic/Guess-the-number-With-feedback new file mode 120000 index 0000000000..f3c330d058 --- /dev/null +++ b/Lang/PureBasic/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Guess-the-number-With-feedback-player b/Lang/PureBasic/Guess-the-number-With-feedback-player new file mode 120000 index 0000000000..2965b502e7 --- /dev/null +++ b/Lang/PureBasic/Guess-the-number-With-feedback-player @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback-player/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/HTTP b/Lang/PureBasic/HTTP new file mode 120000 index 0000000000..30be88b732 --- /dev/null +++ b/Lang/PureBasic/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hailstone-sequence b/Lang/PureBasic/Hailstone-sequence new file mode 120000 index 0000000000..dd23191669 --- /dev/null +++ b/Lang/PureBasic/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Handle-a-signal b/Lang/PureBasic/Handle-a-signal new file mode 120000 index 0000000000..2614e8828c --- /dev/null +++ b/Lang/PureBasic/Handle-a-signal @@ -0,0 +1 @@ +../../Task/Handle-a-signal/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Happy-numbers b/Lang/PureBasic/Happy-numbers new file mode 120000 index 0000000000..ea6e453bb4 --- /dev/null +++ b/Lang/PureBasic/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hash-from-two-arrays b/Lang/PureBasic/Hash-from-two-arrays new file mode 120000 index 0000000000..bff6ac515f --- /dev/null +++ b/Lang/PureBasic/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hello-world-Graphical b/Lang/PureBasic/Hello-world-Graphical new file mode 120000 index 0000000000..569fb29cec --- /dev/null +++ b/Lang/PureBasic/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hello-world-Line-printer b/Lang/PureBasic/Hello-world-Line-printer new file mode 120000 index 0000000000..dd82c4e72f --- /dev/null +++ b/Lang/PureBasic/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hello-world-Newline-omission b/Lang/PureBasic/Hello-world-Newline-omission new file mode 120000 index 0000000000..7fecfdb25f --- /dev/null +++ b/Lang/PureBasic/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hello-world-Standard-error b/Lang/PureBasic/Hello-world-Standard-error new file mode 120000 index 0000000000..e7b96e0685 --- /dev/null +++ b/Lang/PureBasic/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hello-world-Text b/Lang/PureBasic/Hello-world-Text new file mode 120000 index 0000000000..c106805dc7 --- /dev/null +++ b/Lang/PureBasic/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hello-world-Web-server b/Lang/PureBasic/Hello-world-Web-server new file mode 120000 index 0000000000..0915a23df5 --- /dev/null +++ b/Lang/PureBasic/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Higher-order-functions b/Lang/PureBasic/Higher-order-functions new file mode 120000 index 0000000000..c35c8a3760 --- /dev/null +++ b/Lang/PureBasic/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/History-variables b/Lang/PureBasic/History-variables new file mode 120000 index 0000000000..38adb56b18 --- /dev/null +++ b/Lang/PureBasic/History-variables @@ -0,0 +1 @@ +../../Task/History-variables/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hofstadter-Conway-$10,000-sequence b/Lang/PureBasic/Hofstadter-Conway-$10,000-sequence new file mode 120000 index 0000000000..60d0c3e79b --- /dev/null +++ b/Lang/PureBasic/Hofstadter-Conway-$10,000-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Conway-$10,000-sequence/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Honeycombs b/Lang/PureBasic/Honeycombs new file mode 120000 index 0000000000..1d6606c1aa --- /dev/null +++ b/Lang/PureBasic/Honeycombs @@ -0,0 +1 @@ +../../Task/Honeycombs/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Horizontal-sundial-calculations b/Lang/PureBasic/Horizontal-sundial-calculations new file mode 120000 index 0000000000..6580316a8b --- /dev/null +++ b/Lang/PureBasic/Horizontal-sundial-calculations @@ -0,0 +1 @@ +../../Task/Horizontal-sundial-calculations/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Horners-rule-for-polynomial-evaluation b/Lang/PureBasic/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..d49171dc96 --- /dev/null +++ b/Lang/PureBasic/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Host-introspection b/Lang/PureBasic/Host-introspection new file mode 120000 index 0000000000..d6b15b44a9 --- /dev/null +++ b/Lang/PureBasic/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Hostname b/Lang/PureBasic/Hostname new file mode 120000 index 0000000000..92b633b0bf --- /dev/null +++ b/Lang/PureBasic/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Huffman-coding b/Lang/PureBasic/Huffman-coding new file mode 120000 index 0000000000..6672641074 --- /dev/null +++ b/Lang/PureBasic/Huffman-coding @@ -0,0 +1 @@ +../../Task/Huffman-coding/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Identity-matrix b/Lang/PureBasic/Identity-matrix new file mode 120000 index 0000000000..45883e3b60 --- /dev/null +++ b/Lang/PureBasic/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Image-noise b/Lang/PureBasic/Image-noise new file mode 120000 index 0000000000..27f6f92f28 --- /dev/null +++ b/Lang/PureBasic/Image-noise @@ -0,0 +1 @@ +../../Task/Image-noise/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Include-a-file b/Lang/PureBasic/Include-a-file new file mode 120000 index 0000000000..db38a350d7 --- /dev/null +++ b/Lang/PureBasic/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Increment-a-numerical-string b/Lang/PureBasic/Increment-a-numerical-string new file mode 120000 index 0000000000..fb7b0d8dcf --- /dev/null +++ b/Lang/PureBasic/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Infinity b/Lang/PureBasic/Infinity new file mode 120000 index 0000000000..bb17066cd8 --- /dev/null +++ b/Lang/PureBasic/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Inheritance-Multiple b/Lang/PureBasic/Inheritance-Multiple new file mode 120000 index 0000000000..baa714557d --- /dev/null +++ b/Lang/PureBasic/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Inheritance-Single b/Lang/PureBasic/Inheritance-Single new file mode 120000 index 0000000000..33a40b6cd7 --- /dev/null +++ b/Lang/PureBasic/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Input-loop b/Lang/PureBasic/Input-loop new file mode 120000 index 0000000000..7dd55a2ba8 --- /dev/null +++ b/Lang/PureBasic/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Integer-comparison b/Lang/PureBasic/Integer-comparison new file mode 120000 index 0000000000..6996320dd1 --- /dev/null +++ b/Lang/PureBasic/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Integer-sequence b/Lang/PureBasic/Integer-sequence new file mode 120000 index 0000000000..18b36baa4d --- /dev/null +++ b/Lang/PureBasic/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Introspection b/Lang/PureBasic/Introspection new file mode 120000 index 0000000000..eccd7a4f40 --- /dev/null +++ b/Lang/PureBasic/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Jensens-Device b/Lang/PureBasic/Jensens-Device new file mode 120000 index 0000000000..b6ba7b3b95 --- /dev/null +++ b/Lang/PureBasic/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Joystick-position b/Lang/PureBasic/Joystick-position new file mode 120000 index 0000000000..88f310fa43 --- /dev/null +++ b/Lang/PureBasic/Joystick-position @@ -0,0 +1 @@ +../../Task/Joystick-position/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Kaprekar-numbers b/Lang/PureBasic/Kaprekar-numbers new file mode 120000 index 0000000000..63d56e3620 --- /dev/null +++ b/Lang/PureBasic/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Keyboard-input-Flush-the-keyboard-buffer b/Lang/PureBasic/Keyboard-input-Flush-the-keyboard-buffer new file mode 120000 index 0000000000..30c6fa8bc2 --- /dev/null +++ b/Lang/PureBasic/Keyboard-input-Flush-the-keyboard-buffer @@ -0,0 +1 @@ +../../Task/Keyboard-input-Flush-the-keyboard-buffer/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Keyboard-input-Keypress-check b/Lang/PureBasic/Keyboard-input-Keypress-check new file mode 120000 index 0000000000..8588b613b2 --- /dev/null +++ b/Lang/PureBasic/Keyboard-input-Keypress-check @@ -0,0 +1 @@ +../../Task/Keyboard-input-Keypress-check/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/PureBasic/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..11854fc150 --- /dev/null +++ b/Lang/PureBasic/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Keyboard-macros b/Lang/PureBasic/Keyboard-macros new file mode 120000 index 0000000000..b215abd00a --- /dev/null +++ b/Lang/PureBasic/Keyboard-macros @@ -0,0 +1 @@ +../../Task/Keyboard-macros/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Knapsack-problem-0-1 b/Lang/PureBasic/Knapsack-problem-0-1 new file mode 120000 index 0000000000..c8de79f45c --- /dev/null +++ b/Lang/PureBasic/Knapsack-problem-0-1 @@ -0,0 +1 @@ +../../Task/Knapsack-problem-0-1/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Knapsack-problem-Continuous b/Lang/PureBasic/Knapsack-problem-Continuous new file mode 120000 index 0000000000..6f51a63500 --- /dev/null +++ b/Lang/PureBasic/Knapsack-problem-Continuous @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Continuous/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Knapsack-problem-Unbounded b/Lang/PureBasic/Knapsack-problem-Unbounded new file mode 120000 index 0000000000..460f96b6d1 --- /dev/null +++ b/Lang/PureBasic/Knapsack-problem-Unbounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Unbounded/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Knuth-shuffle b/Lang/PureBasic/Knuth-shuffle new file mode 120000 index 0000000000..aa6f3d5b74 --- /dev/null +++ b/Lang/PureBasic/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/LZW-compression b/Lang/PureBasic/LZW-compression new file mode 120000 index 0000000000..6ee7b4f559 --- /dev/null +++ b/Lang/PureBasic/LZW-compression @@ -0,0 +1 @@ +../../Task/LZW-compression/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Langtons-ant b/Lang/PureBasic/Langtons-ant new file mode 120000 index 0000000000..9a8937e231 --- /dev/null +++ b/Lang/PureBasic/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Leap-year b/Lang/PureBasic/Leap-year new file mode 120000 index 0000000000..fd490f5562 --- /dev/null +++ b/Lang/PureBasic/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Least-common-multiple b/Lang/PureBasic/Least-common-multiple new file mode 120000 index 0000000000..422bb6258f --- /dev/null +++ b/Lang/PureBasic/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Letter-frequency b/Lang/PureBasic/Letter-frequency new file mode 120000 index 0000000000..fabd71abec --- /dev/null +++ b/Lang/PureBasic/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Levenshtein-distance b/Lang/PureBasic/Levenshtein-distance new file mode 120000 index 0000000000..db1b50ca27 --- /dev/null +++ b/Lang/PureBasic/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Linear-congruential-generator b/Lang/PureBasic/Linear-congruential-generator new file mode 120000 index 0000000000..b7379867c6 --- /dev/null +++ b/Lang/PureBasic/Linear-congruential-generator @@ -0,0 +1 @@ +../../Task/Linear-congruential-generator/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Literals-Integer b/Lang/PureBasic/Literals-Integer new file mode 120000 index 0000000000..e53742c34d --- /dev/null +++ b/Lang/PureBasic/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Literals-String b/Lang/PureBasic/Literals-String new file mode 120000 index 0000000000..d4da585e3a --- /dev/null +++ b/Lang/PureBasic/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Logical-operations b/Lang/PureBasic/Logical-operations new file mode 120000 index 0000000000..cc15668655 --- /dev/null +++ b/Lang/PureBasic/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Long-multiplication b/Lang/PureBasic/Long-multiplication new file mode 120000 index 0000000000..c483c479ba --- /dev/null +++ b/Lang/PureBasic/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Longest-common-subsequence b/Lang/PureBasic/Longest-common-subsequence new file mode 120000 index 0000000000..870c8fb9da --- /dev/null +++ b/Lang/PureBasic/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Longest-string-challenge b/Lang/PureBasic/Longest-string-challenge new file mode 120000 index 0000000000..0dd39b9e64 --- /dev/null +++ b/Lang/PureBasic/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Look-and-say-sequence b/Lang/PureBasic/Look-and-say-sequence new file mode 120000 index 0000000000..874ac220cb --- /dev/null +++ b/Lang/PureBasic/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loop-over-multiple-arrays-simultaneously b/Lang/PureBasic/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..fe1185413a --- /dev/null +++ b/Lang/PureBasic/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-Break b/Lang/PureBasic/Loops-Break new file mode 120000 index 0000000000..6fba81f2f7 --- /dev/null +++ b/Lang/PureBasic/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-Continue b/Lang/PureBasic/Loops-Continue new file mode 120000 index 0000000000..ab2ff10d05 --- /dev/null +++ b/Lang/PureBasic/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-Do-while b/Lang/PureBasic/Loops-Do-while new file mode 120000 index 0000000000..e5234af075 --- /dev/null +++ b/Lang/PureBasic/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-Downward-for b/Lang/PureBasic/Loops-Downward-for new file mode 120000 index 0000000000..73a4d3de7d --- /dev/null +++ b/Lang/PureBasic/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-For b/Lang/PureBasic/Loops-For new file mode 120000 index 0000000000..6227e7c2f8 --- /dev/null +++ b/Lang/PureBasic/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-For-with-a-specified-step b/Lang/PureBasic/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..2f55bb8f38 --- /dev/null +++ b/Lang/PureBasic/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-Foreach b/Lang/PureBasic/Loops-Foreach new file mode 120000 index 0000000000..5c8c42f63d --- /dev/null +++ b/Lang/PureBasic/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-Infinite b/Lang/PureBasic/Loops-Infinite new file mode 120000 index 0000000000..41c2facca8 --- /dev/null +++ b/Lang/PureBasic/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-N-plus-one-half b/Lang/PureBasic/Loops-N-plus-one-half new file mode 120000 index 0000000000..4cd1dc0db7 --- /dev/null +++ b/Lang/PureBasic/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-Nested b/Lang/PureBasic/Loops-Nested new file mode 120000 index 0000000000..7fb893e1c8 --- /dev/null +++ b/Lang/PureBasic/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Loops-While b/Lang/PureBasic/Loops-While new file mode 120000 index 0000000000..e6d82c4deb --- /dev/null +++ b/Lang/PureBasic/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Lucas-Lehmer-test b/Lang/PureBasic/Lucas-Lehmer-test new file mode 120000 index 0000000000..66b48f4e36 --- /dev/null +++ b/Lang/PureBasic/Lucas-Lehmer-test @@ -0,0 +1 @@ +../../Task/Lucas-Lehmer-test/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Luhn-test-of-credit-card-numbers b/Lang/PureBasic/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..3f4768b068 --- /dev/null +++ b/Lang/PureBasic/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/MD5 b/Lang/PureBasic/MD5 new file mode 120000 index 0000000000..ed89ed33e3 --- /dev/null +++ b/Lang/PureBasic/MD5 @@ -0,0 +1 @@ +../../Task/MD5/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Mandelbrot-set b/Lang/PureBasic/Mandelbrot-set new file mode 120000 index 0000000000..6542e00d27 --- /dev/null +++ b/Lang/PureBasic/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Map-range b/Lang/PureBasic/Map-range new file mode 120000 index 0000000000..e36be23a04 --- /dev/null +++ b/Lang/PureBasic/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Matrix-multiplication b/Lang/PureBasic/Matrix-multiplication new file mode 120000 index 0000000000..1c103db323 --- /dev/null +++ b/Lang/PureBasic/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Matrix-transposition b/Lang/PureBasic/Matrix-transposition new file mode 120000 index 0000000000..63e2e46e4f --- /dev/null +++ b/Lang/PureBasic/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Maze-generation b/Lang/PureBasic/Maze-generation new file mode 120000 index 0000000000..4a32554ab1 --- /dev/null +++ b/Lang/PureBasic/Maze-generation @@ -0,0 +1 @@ +../../Task/Maze-generation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Maze-solving b/Lang/PureBasic/Maze-solving new file mode 120000 index 0000000000..f7658378e6 --- /dev/null +++ b/Lang/PureBasic/Maze-solving @@ -0,0 +1 @@ +../../Task/Maze-solving/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Memory-allocation b/Lang/PureBasic/Memory-allocation new file mode 120000 index 0000000000..850227d57a --- /dev/null +++ b/Lang/PureBasic/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Menu b/Lang/PureBasic/Menu new file mode 120000 index 0000000000..dfb6d6b5cd --- /dev/null +++ b/Lang/PureBasic/Menu @@ -0,0 +1 @@ +../../Task/Menu/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Metered-concurrency b/Lang/PureBasic/Metered-concurrency new file mode 120000 index 0000000000..9654a360e3 --- /dev/null +++ b/Lang/PureBasic/Metered-concurrency @@ -0,0 +1 @@ +../../Task/Metered-concurrency/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Metronome b/Lang/PureBasic/Metronome new file mode 120000 index 0000000000..96c342cc13 --- /dev/null +++ b/Lang/PureBasic/Metronome @@ -0,0 +1 @@ +../../Task/Metronome/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Miller-Rabin-primality-test b/Lang/PureBasic/Miller-Rabin-primality-test new file mode 120000 index 0000000000..af69162304 --- /dev/null +++ b/Lang/PureBasic/Miller-Rabin-primality-test @@ -0,0 +1 @@ +../../Task/Miller-Rabin-primality-test/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Minesweeper-game b/Lang/PureBasic/Minesweeper-game new file mode 120000 index 0000000000..5bbad94ad5 --- /dev/null +++ b/Lang/PureBasic/Minesweeper-game @@ -0,0 +1 @@ +../../Task/Minesweeper-game/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Monte-Carlo-methods b/Lang/PureBasic/Monte-Carlo-methods new file mode 120000 index 0000000000..abcfcfb157 --- /dev/null +++ b/Lang/PureBasic/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Monty-Hall-problem b/Lang/PureBasic/Monty-Hall-problem new file mode 120000 index 0000000000..1928590d42 --- /dev/null +++ b/Lang/PureBasic/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Morse-code b/Lang/PureBasic/Morse-code new file mode 120000 index 0000000000..5e7a7949aa --- /dev/null +++ b/Lang/PureBasic/Morse-code @@ -0,0 +1 @@ +../../Task/Morse-code/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Mouse-position b/Lang/PureBasic/Mouse-position new file mode 120000 index 0000000000..f8ae18d590 --- /dev/null +++ b/Lang/PureBasic/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Multiple-distinct-objects b/Lang/PureBasic/Multiple-distinct-objects new file mode 120000 index 0000000000..6ebb9f1985 --- /dev/null +++ b/Lang/PureBasic/Multiple-distinct-objects @@ -0,0 +1 @@ +../../Task/Multiple-distinct-objects/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Multiplication-tables b/Lang/PureBasic/Multiplication-tables new file mode 120000 index 0000000000..d63a029bf7 --- /dev/null +++ b/Lang/PureBasic/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Mutex b/Lang/PureBasic/Mutex new file mode 120000 index 0000000000..fb6c8e3de7 --- /dev/null +++ b/Lang/PureBasic/Mutex @@ -0,0 +1 @@ +../../Task/Mutex/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Mutual-recursion b/Lang/PureBasic/Mutual-recursion new file mode 120000 index 0000000000..322bf1381d --- /dev/null +++ b/Lang/PureBasic/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Ordered-words b/Lang/PureBasic/Ordered-words new file mode 120000 index 0000000000..85f7be1a62 --- /dev/null +++ b/Lang/PureBasic/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Pi b/Lang/PureBasic/Pi new file mode 120000 index 0000000000..a7876fa49c --- /dev/null +++ b/Lang/PureBasic/Pi @@ -0,0 +1 @@ +../../Task/Pi/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Quine b/Lang/PureBasic/Quine new file mode 120000 index 0000000000..bcd1927834 --- /dev/null +++ b/Lang/PureBasic/Quine @@ -0,0 +1 @@ +../../Task/Quine/PureBasic \ No newline at end of file diff --git a/Lang/PureBasic/Search-a-list b/Lang/PureBasic/Search-a-list new file mode 120000 index 0000000000..362f15bc59 --- /dev/null +++ b/Lang/PureBasic/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/PureBasic \ No newline at end of file diff --git a/Lang/Purity/0DESCRIPTION b/Lang/Purity/0DESCRIPTION new file mode 100644 index 0000000000..9b7c415b29 --- /dev/null +++ b/Lang/Purity/0DESCRIPTION @@ -0,0 +1,10 @@ +{{stub}} +{{language| +express=implicit}} +'''Purity''' is a total functional programming language inspired conceptually and syntactically by languages like [[Haskell]] and [[Charity]]. +{{language programming paradigm|Functional}} + +== Implementations == + +* [http://github.com/paf31/Purity Purity Compiler at GitHub] +* [http://apps.typesandotherdistractions.com/REPL/index.html Purity Silverlight REPL] \ No newline at end of file diff --git a/Lang/Purity/Ackermann-function b/Lang/Purity/Ackermann-function new file mode 120000 index 0000000000..ad9e813a75 --- /dev/null +++ b/Lang/Purity/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Purity \ No newline at end of file diff --git a/Lang/Purity/Fibonacci-sequence b/Lang/Purity/Fibonacci-sequence new file mode 120000 index 0000000000..370af61f7c --- /dev/null +++ b/Lang/Purity/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Purity \ No newline at end of file diff --git a/Lang/Purity/Function-composition b/Lang/Purity/Function-composition new file mode 120000 index 0000000000..f51c17810f --- /dev/null +++ b/Lang/Purity/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Purity \ No newline at end of file diff --git a/Lang/Purity/Greatest-common-divisor b/Lang/Purity/Greatest-common-divisor new file mode 120000 index 0000000000..bc495444f7 --- /dev/null +++ b/Lang/Purity/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Purity \ No newline at end of file diff --git a/Lang/Python/Arbitrary-precision-integers-(included) b/Lang/Python/Arbitrary-precision-integers-(included) deleted file mode 120000 index b7e3217bd5..0000000000 --- a/Lang/Python/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Python \ No newline at end of file diff --git a/Lang/Q/0DESCRIPTION b/Lang/Q/0DESCRIPTION new file mode 100644 index 0000000000..761de14eda --- /dev/null +++ b/Lang/Q/0DESCRIPTION @@ -0,0 +1,5 @@ +{{language}}Q is another vector language (in the family of [[APL]] [[J]] [[K]] and [[Nial]]) + +There is a totally unrelated language called Q [http://q-lang.sourceforge.net/ here]. (It is an equational programming language) + +Q [https://code.kx.com/trac/wiki/QforMortals docs](anonymous/anonymous) \ No newline at end of file diff --git a/Lang/Q/100-doors b/Lang/Q/100-doors new file mode 120000 index 0000000000..9c364d0e55 --- /dev/null +++ b/Lang/Q/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Q \ No newline at end of file diff --git a/Lang/Q/Factorial b/Lang/Q/Factorial new file mode 120000 index 0000000000..296fa683cd --- /dev/null +++ b/Lang/Q/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Q \ No newline at end of file diff --git a/Lang/Q/Function-definition b/Lang/Q/Function-definition new file mode 120000 index 0000000000..e99c4c54f4 --- /dev/null +++ b/Lang/Q/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Q \ No newline at end of file diff --git a/Lang/Qi/0DESCRIPTION b/Lang/Qi/0DESCRIPTION new file mode 100644 index 0000000000..bd9db24f5e --- /dev/null +++ b/Lang/Qi/0DESCRIPTION @@ -0,0 +1,5 @@ +{{stub}}{{language +|site=http://www.lambdassociates.org/ +|express=explicit}} + +* [[wp:Qi (programming language)]] \ No newline at end of file diff --git a/Lang/Qi/Anonymous-recursion b/Lang/Qi/Anonymous-recursion new file mode 120000 index 0000000000..b7a2034fc4 --- /dev/null +++ b/Lang/Qi/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/Qi \ No newline at end of file diff --git a/Lang/Qi/Averages-Root-mean-square b/Lang/Qi/Averages-Root-mean-square new file mode 120000 index 0000000000..c255e532e0 --- /dev/null +++ b/Lang/Qi/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Qi \ No newline at end of file diff --git a/Lang/Qi/Balanced-brackets b/Lang/Qi/Balanced-brackets new file mode 120000 index 0000000000..a595f14cf5 --- /dev/null +++ b/Lang/Qi/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/Qi \ No newline at end of file diff --git a/Lang/Qi/Fibonacci-sequence b/Lang/Qi/Fibonacci-sequence new file mode 120000 index 0000000000..fe91fc27d2 --- /dev/null +++ b/Lang/Qi/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Qi \ No newline at end of file diff --git a/Lang/Qi/Function-composition b/Lang/Qi/Function-composition new file mode 120000 index 0000000000..4227d0611b --- /dev/null +++ b/Lang/Qi/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Qi \ No newline at end of file diff --git a/Lang/Qi/Greatest-common-divisor b/Lang/Qi/Greatest-common-divisor new file mode 120000 index 0000000000..5221341982 --- /dev/null +++ b/Lang/Qi/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Qi \ No newline at end of file diff --git a/Lang/Qi/Hamming-numbers b/Lang/Qi/Hamming-numbers new file mode 120000 index 0000000000..0f83f6b84a --- /dev/null +++ b/Lang/Qi/Hamming-numbers @@ -0,0 +1 @@ +../../Task/Hamming-numbers/Qi \ No newline at end of file diff --git a/Lang/Qi/Inverted-syntax b/Lang/Qi/Inverted-syntax new file mode 120000 index 0000000000..8f0da6670d --- /dev/null +++ b/Lang/Qi/Inverted-syntax @@ -0,0 +1 @@ +../../Task/Inverted-syntax/Qi \ No newline at end of file diff --git a/Lang/Qi/Least-common-multiple b/Lang/Qi/Least-common-multiple new file mode 120000 index 0000000000..a2fa99befc --- /dev/null +++ b/Lang/Qi/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Qi \ No newline at end of file diff --git a/Lang/Qi/Loops-Break b/Lang/Qi/Loops-Break new file mode 120000 index 0000000000..01cb50fc0a --- /dev/null +++ b/Lang/Qi/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Qi \ No newline at end of file diff --git a/Lang/Qi/Loops-Nested b/Lang/Qi/Loops-Nested new file mode 120000 index 0000000000..a23bd66893 --- /dev/null +++ b/Lang/Qi/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/Qi \ No newline at end of file diff --git a/Lang/Qore/0DESCRIPTION b/Lang/Qore/0DESCRIPTION new file mode 100644 index 0000000000..8d88e2eaba --- /dev/null +++ b/Lang/Qore/0DESCRIPTION @@ -0,0 +1,4 @@ +{{language +|site=http://www.qore.org +|strength=weak +|exec=interpreted}}Qore is a high-level, general-purpose, interpreted, dynamic programming language. It's a thread-capable, embeddable, weakly typed language with optional strong typing and procedural and object-oriented features designed for anything from quick scripting to complex multithreaded, network-aware application development to embedded application scripting. Qore was initially designed to facilitate the rapid implementation of sophisticated interfaces in embedded code in an enterprise environment, and has since grown into a general-purpose language as well. \ No newline at end of file diff --git a/Lang/Qore/99-Bottles-of-Beer b/Lang/Qore/99-Bottles-of-Beer new file mode 120000 index 0000000000..af6819080d --- /dev/null +++ b/Lang/Qore/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Qore \ No newline at end of file diff --git a/Lang/QuakeC/0DESCRIPTION b/Lang/QuakeC/0DESCRIPTION new file mode 100644 index 0000000000..c115fd8043 --- /dev/null +++ b/Lang/QuakeC/0DESCRIPTION @@ -0,0 +1 @@ +{{stub}}{{language}}QuakeC was developed as the game logic language for id Software's first-person shooter, Quake. Its various implementations are not necessarily compatible. \ No newline at end of file diff --git a/Lang/Quill/0DESCRIPTION b/Lang/Quill/0DESCRIPTION new file mode 100644 index 0000000000..4d3d27c049 --- /dev/null +++ b/Lang/Quill/0DESCRIPTION @@ -0,0 +1 @@ +{{stub}}{{language}} \ No newline at end of file diff --git a/Lang/Quill/99-Bottles-of-Beer b/Lang/Quill/99-Bottles-of-Beer new file mode 120000 index 0000000000..75dd021ffe --- /dev/null +++ b/Lang/Quill/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Quill \ No newline at end of file diff --git a/Lang/Quill/Hello-world-Text b/Lang/Quill/Hello-world-Text new file mode 120000 index 0000000000..7f603d875f --- /dev/null +++ b/Lang/Quill/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Quill \ No newline at end of file diff --git a/Lang/R/Arbitrary-precision-integers-(included) b/Lang/R/Arbitrary-precision-integers-(included) deleted file mode 120000 index e0676cbbd9..0000000000 --- a/Lang/R/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/R \ No newline at end of file diff --git a/Lang/REALbasic/0DESCRIPTION b/Lang/REALbasic/0DESCRIPTION new file mode 100644 index 0000000000..cde2d45284 --- /dev/null +++ b/Lang/REALbasic/0DESCRIPTION @@ -0,0 +1,10 @@ +{{Language|REALbasic +|strength=strong +|safety=safe}} +{{implementation|BASIC}}{{IDE}}{{Compiler}} +{{language programming paradigm|Object-oriented}} +'''REALbasic''' (or '''RB''') is a [[BASIC]] compiler for [[Windows]], [[Mac OS]], and [[Linux]], made by [http://www.realsoftware.com/ REAL Software, Inc.] It has its own [[IDE]], and projects are saved to a proprietary binary format. Unlike most BASICs, REALbasic is heavily object-oriented. + +REALbasic is not compatible with other BASICs, for the most part; examples from other BASICs usually have to be completely rewritten to work in RB. + +[[wp:REALbasic|The Wikipedia article]] has lots of information about REALbasic's history, capabilities, and features. \ No newline at end of file diff --git a/Lang/REALbasic/100-doors b/Lang/REALbasic/100-doors new file mode 120000 index 0000000000..bbeed721d8 --- /dev/null +++ b/Lang/REALbasic/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/99-Bottles-of-Beer b/Lang/REALbasic/99-Bottles-of-Beer new file mode 120000 index 0000000000..9b93d03776 --- /dev/null +++ b/Lang/REALbasic/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Bitmap b/Lang/REALbasic/Bitmap new file mode 120000 index 0000000000..b692ae5fca --- /dev/null +++ b/Lang/REALbasic/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Call-a-foreign-language-function b/Lang/REALbasic/Call-a-foreign-language-function new file mode 120000 index 0000000000..ff3d89059b --- /dev/null +++ b/Lang/REALbasic/Call-a-foreign-language-function @@ -0,0 +1 @@ +../../Task/Call-a-foreign-language-function/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Command-line-arguments b/Lang/REALbasic/Command-line-arguments new file mode 120000 index 0000000000..e3ba80ecaf --- /dev/null +++ b/Lang/REALbasic/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Comments b/Lang/REALbasic/Comments new file mode 120000 index 0000000000..0a3da49bde --- /dev/null +++ b/Lang/REALbasic/Comments @@ -0,0 +1 @@ +../../Task/Comments/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Factors-of-an-integer b/Lang/REALbasic/Factors-of-an-integer new file mode 120000 index 0000000000..ff2ab6004f --- /dev/null +++ b/Lang/REALbasic/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Fibonacci-sequence b/Lang/REALbasic/Fibonacci-sequence new file mode 120000 index 0000000000..6a5b24af21 --- /dev/null +++ b/Lang/REALbasic/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/File-IO b/Lang/REALbasic/File-IO new file mode 120000 index 0000000000..3b6884bf31 --- /dev/null +++ b/Lang/REALbasic/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/File-modification-time b/Lang/REALbasic/File-modification-time new file mode 120000 index 0000000000..77075c39f4 --- /dev/null +++ b/Lang/REALbasic/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Forest-fire b/Lang/REALbasic/Forest-fire new file mode 120000 index 0000000000..df5171cf6f --- /dev/null +++ b/Lang/REALbasic/Forest-fire @@ -0,0 +1 @@ +../../Task/Forest-fire/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/HTTP b/Lang/REALbasic/HTTP new file mode 120000 index 0000000000..1555262ea1 --- /dev/null +++ b/Lang/REALbasic/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/HTTPS b/Lang/REALbasic/HTTPS new file mode 120000 index 0000000000..b2c13ff226 --- /dev/null +++ b/Lang/REALbasic/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/REALbasic \ No newline at end of file diff --git a/Lang/REALbasic/Hello-world-Text b/Lang/REALbasic/Hello-world-Text new file mode 120000 index 0000000000..6182e3925b --- /dev/null +++ b/Lang/REALbasic/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/REALbasic \ No newline at end of file diff --git a/Lang/REBOL/0DESCRIPTION b/Lang/REBOL/0DESCRIPTION new file mode 100644 index 0000000000..0117c8198c --- /dev/null +++ b/Lang/REBOL/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language|REBOL +|site=http://rebol.com}} +REBOL stands for Relative Expression Based Object Language. \ No newline at end of file diff --git a/Lang/REBOL/100-doors b/Lang/REBOL/100-doors new file mode 120000 index 0000000000..3c604849c4 --- /dev/null +++ b/Lang/REBOL/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/REBOL \ No newline at end of file diff --git a/Lang/REBOL/99-Bottles-of-Beer b/Lang/REBOL/99-Bottles-of-Beer new file mode 120000 index 0000000000..8cec009125 --- /dev/null +++ b/Lang/REBOL/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/REBOL \ No newline at end of file diff --git a/Lang/REBOL/A+B b/Lang/REBOL/A+B new file mode 120000 index 0000000000..a6531c3ec1 --- /dev/null +++ b/Lang/REBOL/A+B @@ -0,0 +1 @@ +../../Task/A+B/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Abstract-type b/Lang/REBOL/Abstract-type new file mode 120000 index 0000000000..c01205f584 --- /dev/null +++ b/Lang/REBOL/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Accumulator-factory b/Lang/REBOL/Accumulator-factory new file mode 120000 index 0000000000..9f94ac82f1 --- /dev/null +++ b/Lang/REBOL/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Add-a-variable-to-a-class-instance-at-runtime b/Lang/REBOL/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..901f7e7487 --- /dev/null +++ b/Lang/REBOL/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Align-columns b/Lang/REBOL/Align-columns new file mode 120000 index 0000000000..67ffa18d54 --- /dev/null +++ b/Lang/REBOL/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Animation b/Lang/REBOL/Animation new file mode 120000 index 0000000000..0fccfbad33 --- /dev/null +++ b/Lang/REBOL/Animation @@ -0,0 +1 @@ +../../Task/Animation/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Apply-a-callback-to-an-array b/Lang/REBOL/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..a9a331e92d --- /dev/null +++ b/Lang/REBOL/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Arithmetic-Integer b/Lang/REBOL/Arithmetic-Integer new file mode 120000 index 0000000000..acafb7724e --- /dev/null +++ b/Lang/REBOL/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Array-concatenation b/Lang/REBOL/Array-concatenation new file mode 120000 index 0000000000..679c10ed62 --- /dev/null +++ b/Lang/REBOL/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Arrays b/Lang/REBOL/Arrays new file mode 120000 index 0000000000..9fc95551ee --- /dev/null +++ b/Lang/REBOL/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Averages-Arithmetic-mean b/Lang/REBOL/Averages-Arithmetic-mean new file mode 120000 index 0000000000..de8cb5e395 --- /dev/null +++ b/Lang/REBOL/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Averages-Median b/Lang/REBOL/Averages-Median new file mode 120000 index 0000000000..96ef2cd694 --- /dev/null +++ b/Lang/REBOL/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Check-that-file-exists b/Lang/REBOL/Check-that-file-exists new file mode 120000 index 0000000000..70f5435458 --- /dev/null +++ b/Lang/REBOL/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Classes b/Lang/REBOL/Classes new file mode 120000 index 0000000000..f823823847 --- /dev/null +++ b/Lang/REBOL/Classes @@ -0,0 +1 @@ +../../Task/Classes/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Comments b/Lang/REBOL/Comments new file mode 120000 index 0000000000..2dad54191c --- /dev/null +++ b/Lang/REBOL/Comments @@ -0,0 +1 @@ +../../Task/Comments/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Create-a-file b/Lang/REBOL/Create-a-file new file mode 120000 index 0000000000..3089537d01 --- /dev/null +++ b/Lang/REBOL/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Date-format b/Lang/REBOL/Date-format new file mode 120000 index 0000000000..33ce065e87 --- /dev/null +++ b/Lang/REBOL/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Date-manipulation b/Lang/REBOL/Date-manipulation new file mode 120000 index 0000000000..2722a008ce --- /dev/null +++ b/Lang/REBOL/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Day-of-the-week b/Lang/REBOL/Day-of-the-week new file mode 120000 index 0000000000..82d7509a60 --- /dev/null +++ b/Lang/REBOL/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Delete-a-file b/Lang/REBOL/Delete-a-file new file mode 120000 index 0000000000..66f14845d7 --- /dev/null +++ b/Lang/REBOL/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Detect-division-by-zero b/Lang/REBOL/Detect-division-by-zero new file mode 120000 index 0000000000..b0ccafd718 --- /dev/null +++ b/Lang/REBOL/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Determine-if-a-string-is-numeric b/Lang/REBOL/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..045a0ae13f --- /dev/null +++ b/Lang/REBOL/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Documentation b/Lang/REBOL/Documentation new file mode 120000 index 0000000000..daa69740d8 --- /dev/null +++ b/Lang/REBOL/Documentation @@ -0,0 +1 @@ +../../Task/Documentation/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Dynamic-variable-names b/Lang/REBOL/Dynamic-variable-names new file mode 120000 index 0000000000..dc26f8842e --- /dev/null +++ b/Lang/REBOL/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Echo-server b/Lang/REBOL/Echo-server new file mode 120000 index 0000000000..e5f15ce096 --- /dev/null +++ b/Lang/REBOL/Echo-server @@ -0,0 +1 @@ +../../Task/Echo-server/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Empty-program b/Lang/REBOL/Empty-program new file mode 120000 index 0000000000..15b162acc2 --- /dev/null +++ b/Lang/REBOL/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Execute-a-system-command b/Lang/REBOL/Execute-a-system-command new file mode 120000 index 0000000000..6177e36583 --- /dev/null +++ b/Lang/REBOL/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Factorial b/Lang/REBOL/Factorial new file mode 120000 index 0000000000..8643656c0a --- /dev/null +++ b/Lang/REBOL/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/REBOL \ No newline at end of file diff --git a/Lang/REBOL/File-IO b/Lang/REBOL/File-IO new file mode 120000 index 0000000000..91195054f9 --- /dev/null +++ b/Lang/REBOL/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/REBOL \ No newline at end of file diff --git a/Lang/REBOL/File-size b/Lang/REBOL/File-size new file mode 120000 index 0000000000..61c4252f32 --- /dev/null +++ b/Lang/REBOL/File-size @@ -0,0 +1 @@ +../../Task/File-size/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Filter b/Lang/REBOL/Filter new file mode 120000 index 0000000000..d25c807398 --- /dev/null +++ b/Lang/REBOL/Filter @@ -0,0 +1 @@ +../../Task/Filter/REBOL \ No newline at end of file diff --git a/Lang/REBOL/First-class-functions b/Lang/REBOL/First-class-functions new file mode 120000 index 0000000000..729d2ef773 --- /dev/null +++ b/Lang/REBOL/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/REBOL \ No newline at end of file diff --git a/Lang/REBOL/FizzBuzz b/Lang/REBOL/FizzBuzz new file mode 120000 index 0000000000..5fada5dc79 --- /dev/null +++ b/Lang/REBOL/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Flatten-a-list b/Lang/REBOL/Flatten-a-list new file mode 120000 index 0000000000..c63e60f1ae --- /dev/null +++ b/Lang/REBOL/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Flow-control-structures b/Lang/REBOL/Flow-control-structures new file mode 120000 index 0000000000..02978f970b --- /dev/null +++ b/Lang/REBOL/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Formatted-numeric-output b/Lang/REBOL/Formatted-numeric-output new file mode 120000 index 0000000000..6231201b56 --- /dev/null +++ b/Lang/REBOL/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Function-composition b/Lang/REBOL/Function-composition new file mode 120000 index 0000000000..00fbef410f --- /dev/null +++ b/Lang/REBOL/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Function-definition b/Lang/REBOL/Function-definition new file mode 120000 index 0000000000..24045b17c8 --- /dev/null +++ b/Lang/REBOL/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Generic-swap b/Lang/REBOL/Generic-swap new file mode 120000 index 0000000000..252d05095f --- /dev/null +++ b/Lang/REBOL/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Greatest-common-divisor b/Lang/REBOL/Greatest-common-divisor new file mode 120000 index 0000000000..66251fda3d --- /dev/null +++ b/Lang/REBOL/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Greatest-element-of-a-list b/Lang/REBOL/Greatest-element-of-a-list new file mode 120000 index 0000000000..bf835b648c --- /dev/null +++ b/Lang/REBOL/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/REBOL \ No newline at end of file diff --git a/Lang/REBOL/HTTP b/Lang/REBOL/HTTP new file mode 120000 index 0000000000..7ade844f73 --- /dev/null +++ b/Lang/REBOL/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Hello-world-Graphical b/Lang/REBOL/Hello-world-Graphical new file mode 120000 index 0000000000..65375f6063 --- /dev/null +++ b/Lang/REBOL/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Hello-world-Text b/Lang/REBOL/Hello-world-Text new file mode 120000 index 0000000000..417f675e90 --- /dev/null +++ b/Lang/REBOL/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Higher-order-functions b/Lang/REBOL/Higher-order-functions new file mode 120000 index 0000000000..e0da7764d4 --- /dev/null +++ b/Lang/REBOL/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Hostname b/Lang/REBOL/Hostname new file mode 120000 index 0000000000..00509fe88c --- /dev/null +++ b/Lang/REBOL/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Increment-a-numerical-string b/Lang/REBOL/Increment-a-numerical-string new file mode 120000 index 0000000000..0b8ae5b473 --- /dev/null +++ b/Lang/REBOL/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Inheritance-Single b/Lang/REBOL/Inheritance-Single new file mode 120000 index 0000000000..8790c38450 --- /dev/null +++ b/Lang/REBOL/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Input-loop b/Lang/REBOL/Input-loop new file mode 120000 index 0000000000..81d9914a81 --- /dev/null +++ b/Lang/REBOL/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Integer-comparison b/Lang/REBOL/Integer-comparison new file mode 120000 index 0000000000..6f12d33801 --- /dev/null +++ b/Lang/REBOL/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/REBOL \ No newline at end of file diff --git a/Lang/REBOL/JSON b/Lang/REBOL/JSON new file mode 120000 index 0000000000..bbdd962074 --- /dev/null +++ b/Lang/REBOL/JSON @@ -0,0 +1 @@ +../../Task/JSON/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Keyboard-macros b/Lang/REBOL/Keyboard-macros new file mode 120000 index 0000000000..4c918106f7 --- /dev/null +++ b/Lang/REBOL/Keyboard-macros @@ -0,0 +1 @@ +../../Task/Keyboard-macros/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Knuth-shuffle b/Lang/REBOL/Knuth-shuffle new file mode 120000 index 0000000000..e1ef5ac835 --- /dev/null +++ b/Lang/REBOL/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Leap-year b/Lang/REBOL/Leap-year new file mode 120000 index 0000000000..e1fde0d2a0 --- /dev/null +++ b/Lang/REBOL/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Literals-Integer b/Lang/REBOL/Literals-Integer new file mode 120000 index 0000000000..c018808d2d --- /dev/null +++ b/Lang/REBOL/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Logical-operations b/Lang/REBOL/Logical-operations new file mode 120000 index 0000000000..b2be03cb20 --- /dev/null +++ b/Lang/REBOL/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-Break b/Lang/REBOL/Loops-Break new file mode 120000 index 0000000000..b12b588bcd --- /dev/null +++ b/Lang/REBOL/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-Continue b/Lang/REBOL/Loops-Continue new file mode 120000 index 0000000000..620f8d42c2 --- /dev/null +++ b/Lang/REBOL/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-Do-while b/Lang/REBOL/Loops-Do-while new file mode 120000 index 0000000000..a092621ef7 --- /dev/null +++ b/Lang/REBOL/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-Downward-for b/Lang/REBOL/Loops-Downward-for new file mode 120000 index 0000000000..e956288e68 --- /dev/null +++ b/Lang/REBOL/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-For b/Lang/REBOL/Loops-For new file mode 120000 index 0000000000..9c59f991f0 --- /dev/null +++ b/Lang/REBOL/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-For-with-a-specified-step b/Lang/REBOL/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..3174e4899e --- /dev/null +++ b/Lang/REBOL/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-Foreach b/Lang/REBOL/Loops-Foreach new file mode 120000 index 0000000000..98cc61392e --- /dev/null +++ b/Lang/REBOL/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-Infinite b/Lang/REBOL/Loops-Infinite new file mode 120000 index 0000000000..cd80f1fc2f --- /dev/null +++ b/Lang/REBOL/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-N-plus-one-half b/Lang/REBOL/Loops-N-plus-one-half new file mode 120000 index 0000000000..530a004b19 --- /dev/null +++ b/Lang/REBOL/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-Nested b/Lang/REBOL/Loops-Nested new file mode 120000 index 0000000000..fad704e1b5 --- /dev/null +++ b/Lang/REBOL/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Loops-While b/Lang/REBOL/Loops-While new file mode 120000 index 0000000000..7caecdb43d --- /dev/null +++ b/Lang/REBOL/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/REBOL \ No newline at end of file diff --git a/Lang/REBOL/MD5 b/Lang/REBOL/MD5 new file mode 120000 index 0000000000..5cb019110c --- /dev/null +++ b/Lang/REBOL/MD5 @@ -0,0 +1 @@ +../../Task/MD5/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Menu b/Lang/REBOL/Menu new file mode 120000 index 0000000000..3b0b7dc2de --- /dev/null +++ b/Lang/REBOL/Menu @@ -0,0 +1 @@ +../../Task/Menu/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Multiplication-tables b/Lang/REBOL/Multiplication-tables new file mode 120000 index 0000000000..1b70d39ee9 --- /dev/null +++ b/Lang/REBOL/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Mutual-recursion b/Lang/REBOL/Mutual-recursion new file mode 120000 index 0000000000..cb2de22d29 --- /dev/null +++ b/Lang/REBOL/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Quine b/Lang/REBOL/Quine new file mode 120000 index 0000000000..391f27dc9c --- /dev/null +++ b/Lang/REBOL/Quine @@ -0,0 +1 @@ +../../Task/Quine/REBOL \ No newline at end of file diff --git a/Lang/REBOL/Search-a-list b/Lang/REBOL/Search-a-list new file mode 120000 index 0000000000..30c4450829 --- /dev/null +++ b/Lang/REBOL/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/REBOL \ No newline at end of file diff --git a/Lang/REXX/Arbitrary-precision-integers-(included) b/Lang/REXX/Arbitrary-precision-integers-(included) deleted file mode 120000 index dd68e3d6a6..0000000000 --- a/Lang/REXX/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/REXX \ No newline at end of file diff --git a/Lang/RLSL/0DESCRIPTION b/Lang/RLSL/0DESCRIPTION new file mode 100644 index 0000000000..43066f76ff --- /dev/null +++ b/Lang/RLSL/0DESCRIPTION @@ -0,0 +1,6 @@ +{{language +|site=http://www.caustic.com/ +}} +RLSL is the shading language that is supported by the Open Ray Tracing Library. + +[[Category:Raytracing]] \ No newline at end of file diff --git a/Lang/RLaB/0DESCRIPTION b/Lang/RLaB/0DESCRIPTION new file mode 100644 index 0000000000..ce4ab40e28 --- /dev/null +++ b/Lang/RLaB/0DESCRIPTION @@ -0,0 +1,19 @@ +{{language +|site=http://rlabplus.sourceforge.net/ +}} + +RLaB is an interactive, interpreted scientific programming environment which provides fast prototyping and program development. RLaB is not a clone of languages such as those used by tools like [[MATLAB]] or Matrix-X/Xmath. However, as RLaB focuses on creating a good experimental environment (or laboratory) in which to do matrix math, it can be called "Matlab-like"; since the programming language possesses similar operators and concepts. +RLaB does not try to be a Matlab clone. Instead, it borrows what might be the best features of the Matlab language and provides improved language syntax and semantics. The syntax has been improved to allow users more expression and reduce ambiguities. The variable scoping rules have been improved to facilitate creation of larger programs and program libraries. + +The project ''rlabplus'' is its successor for 32- and 64-bit linux operating systems. +It adds new solvers, functions and procedures, while updating the existing ones, all with purpose of +increasing the versatility of RLaB. +It integrates data-visualization capabilities using the standard plotting packages +[http://www.astro.caltech.edu/~tjp/pgplot/ pgplot], +[http://www.gnuplot.info/ Gnuplot], or [http://plasma-gate.weizmann.ac.il/Grace/ xmgr]. +''rlabplus'' also supports data-export to different formats, e.g., to [http://www.openoffice.org/ openoffice.org], +and reads and writes more advanced data formats, e.g., [http://www.hdfgroup.org/HDF5/ HDF5]. +It can also communicate with the outside world through serial port or GPIB interfaces, or through tcp/ip or http/ftp. + +RLaB was created by Ian Searle and collaborators. +''rlabplus'' is being actively developed by Marijan Kostrun. \ No newline at end of file diff --git a/Lang/RLaB/Animate-a-pendulum b/Lang/RLaB/Animate-a-pendulum new file mode 120000 index 0000000000..8a68ce0037 --- /dev/null +++ b/Lang/RLaB/Animate-a-pendulum @@ -0,0 +1 @@ +../../Task/Animate-a-pendulum/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Apply-a-callback-to-an-array b/Lang/RLaB/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..9f2331ae74 --- /dev/null +++ b/Lang/RLaB/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Arithmetic-Complex b/Lang/RLaB/Arithmetic-Complex new file mode 120000 index 0000000000..a05611f1ba --- /dev/null +++ b/Lang/RLaB/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Array-concatenation b/Lang/RLaB/Array-concatenation new file mode 120000 index 0000000000..e92a905cbd --- /dev/null +++ b/Lang/RLaB/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Arrays b/Lang/RLaB/Arrays new file mode 120000 index 0000000000..95419af6a8 --- /dev/null +++ b/Lang/RLaB/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Assertions b/Lang/RLaB/Assertions new file mode 120000 index 0000000000..0f800c74c5 --- /dev/null +++ b/Lang/RLaB/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Associative-array-Creation b/Lang/RLaB/Associative-array-Creation new file mode 120000 index 0000000000..ea7170ab0e --- /dev/null +++ b/Lang/RLaB/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Associative-array-Iteration b/Lang/RLaB/Associative-array-Iteration new file mode 120000 index 0000000000..a233d70a8e --- /dev/null +++ b/Lang/RLaB/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Bitwise-operations b/Lang/RLaB/Bitwise-operations new file mode 120000 index 0000000000..3953700f8b --- /dev/null +++ b/Lang/RLaB/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Check-that-file-exists b/Lang/RLaB/Check-that-file-exists new file mode 120000 index 0000000000..58b1965c15 --- /dev/null +++ b/Lang/RLaB/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Comments b/Lang/RLaB/Comments new file mode 120000 index 0000000000..3aa9ac74e0 --- /dev/null +++ b/Lang/RLaB/Comments @@ -0,0 +1 @@ +../../Task/Comments/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Conditional-structures b/Lang/RLaB/Conditional-structures new file mode 120000 index 0000000000..f1927a3d79 --- /dev/null +++ b/Lang/RLaB/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Dot-product b/Lang/RLaB/Dot-product new file mode 120000 index 0000000000..268390349f --- /dev/null +++ b/Lang/RLaB/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Dynamic-variable-names b/Lang/RLaB/Dynamic-variable-names new file mode 120000 index 0000000000..152770b4a6 --- /dev/null +++ b/Lang/RLaB/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Function-definition b/Lang/RLaB/Function-definition new file mode 120000 index 0000000000..051af24ff9 --- /dev/null +++ b/Lang/RLaB/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Generic-swap b/Lang/RLaB/Generic-swap new file mode 120000 index 0000000000..3fdaaf21d9 --- /dev/null +++ b/Lang/RLaB/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/RLaB \ No newline at end of file diff --git a/Lang/RLaB/HTTP b/Lang/RLaB/HTTP new file mode 120000 index 0000000000..dbf3d824f7 --- /dev/null +++ b/Lang/RLaB/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Horners-rule-for-polynomial-evaluation b/Lang/RLaB/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..afd3171c1d --- /dev/null +++ b/Lang/RLaB/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Infinity b/Lang/RLaB/Infinity new file mode 120000 index 0000000000..01daa1a066 --- /dev/null +++ b/Lang/RLaB/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Logical-operations b/Lang/RLaB/Logical-operations new file mode 120000 index 0000000000..43023a32aa --- /dev/null +++ b/Lang/RLaB/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/RLaB \ No newline at end of file diff --git a/Lang/RLaB/MD5 b/Lang/RLaB/MD5 new file mode 120000 index 0000000000..829e8f174a --- /dev/null +++ b/Lang/RLaB/MD5 @@ -0,0 +1 @@ +../../Task/MD5/RLaB \ No newline at end of file diff --git a/Lang/RLaB/Matrix-transposition b/Lang/RLaB/Matrix-transposition new file mode 120000 index 0000000000..22c821437c --- /dev/null +++ b/Lang/RLaB/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/RLaB \ No newline at end of file diff --git a/Lang/RPG/0DESCRIPTION b/Lang/RPG/0DESCRIPTION new file mode 100644 index 0000000000..180428a720 --- /dev/null +++ b/Lang/RPG/0DESCRIPTION @@ -0,0 +1,4 @@ +{{language}} +RPG II, III, 400 and RPG IV are a family of languages created and primarily distributed by [[IBM]]. The initials initially stood for '''Report Program Generator''', though that usage is no longer in vogue. These languages were widely used for the IBM S/3, S/32, S/34, S/36, S/38 and AS/400 midrange computers. + +The latest version of RPG ( RPG IV or RPGLE ) contains features such as prototyped functions and procedures, static and dynamic binding, access to C routine libraries, dynamic link libraries, and fully recursive and re-entrant modular code. \ No newline at end of file diff --git a/Lang/RPG/Arrays b/Lang/RPG/Arrays new file mode 120000 index 0000000000..edcac370b3 --- /dev/null +++ b/Lang/RPG/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/RPG \ No newline at end of file diff --git a/Lang/RPG/Hello-world-Line-printer b/Lang/RPG/Hello-world-Line-printer new file mode 120000 index 0000000000..09e3f7078f --- /dev/null +++ b/Lang/RPG/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/RPG \ No newline at end of file diff --git a/Lang/RPG/Include-a-file b/Lang/RPG/Include-a-file new file mode 120000 index 0000000000..74cb584b36 --- /dev/null +++ b/Lang/RPG/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/RPG \ No newline at end of file diff --git a/Lang/RPL-2/0DESCRIPTION b/Lang/RPL-2/0DESCRIPTION new file mode 100644 index 0000000000..364ccd4da3 --- /dev/null +++ b/Lang/RPL-2/0DESCRIPTION @@ -0,0 +1,24 @@ +{{language|RPL/2 +|strength=weak +|safety=safe +|checking=dynamic +|exec=bytecode +|gc=no +|site=http://www.rpl2.net/}} +{{implementation|RPL/2}} + +== Informations == +RPL/2, or Reverse Polish Lisp/2, is an functional language designed for efficient computations on parallel servers or clusters. RPL/2 programs can be interpreted or compiled on POSIX systems. RPL/2 is an open source project available +under CeCILL license (a french GPL compliant license). + +See '''http://www.rpl2.net''' + +== Example == + +MAIN +<< + "Hello, world" disp +>> + + +{{language programming paradigm|Procedural}} \ No newline at end of file diff --git a/Lang/RPL-2/99-Bottles-of-Beer b/Lang/RPL-2/99-Bottles-of-Beer new file mode 120000 index 0000000000..085e3899ec --- /dev/null +++ b/Lang/RPL-2/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/RPL-2 \ No newline at end of file diff --git a/Lang/RTL-2/0DESCRIPTION b/Lang/RTL-2/0DESCRIPTION new file mode 100644 index 0000000000..4f020fcdf0 --- /dev/null +++ b/Lang/RTL-2/0DESCRIPTION @@ -0,0 +1,132 @@ + +{{wikipedia|RTL/2}} +{{language|ALGOL 68 +|parampass=both +|strength=weak +|safety=safe +|express=explicit +|compat=structural +|checking=both +|LCT=yes}} + +RTL/2 was a high-level programming language developed at [[wp:Imperial Chemical Industries|Imperial Chemical Industries Ltd]] by [[wp:John Barnes (computer scientist)|J.G.P. Barnes]]. It was originally used internally within ICI but was distributed by SPL International in 1974Barnes J.G.P., The Standardisation of RTL/2, Software Practice and Experience, Volume 10 Issue 9, pp 707 - 719, Wyley, September 1980 +It was designed for use in real-time computing (hence the acronym RTL = real-time language). Based on concepts from [[Algol 68]], it was intended to be a small, simple language.RTL/2 Language Specificationhttp://hopl.murdoch.edu.au/showlanguage2.prx?exp=596#_jmp0_ RTL/2 was standardised in 1980 by the [[wp:British Standards Institution|British Standards Institution]]http://shop.bsigroup.com/en/ProductDetail/?pid=000000000000133906. + +RTL/2 was a [[wp:Weakly-typed programming language|weakly typed language]] with separate compilation. The [[wp:compilation unit|compilation units]] contained one or more items known as "bricks", i.e.: + +* procedure bricks, +* data bricks, +* stack bricks. + +A procedure brick was a procedure, which may or may not return a (scalar) value, have (scalar) parameters, or have local (scalar) variables. The entry mechanism and implementation of local variables was [[wp:Reentrant_(subroutine)|re-entrant]]. Non-scalar data could only be accessed via reference (so-called REF variables were considered scalar). + +A data brick was a named static collection of scalars, arrays and records. Programmers had to implement memory management themselves (there was no heap or garbage collection). + +A stack brick was an area of storage reserved for running all the procedures of a single process and contained the call stack, local variables and other housekeeping items. The extent to which stack bricks were actually used varied depending upon the host environment in which RTL/2 programs actually ran. + +Access to the host environment of an RTL/2 program was provided via special procedure and data bricks called SVC procedures and SVC data. These were accessible in RTL/2 but implemented in some other language in the host environment. + +== Dropping into Assembler == + +RTL/2 compiles to assembly language and provides the CODE statement to permit assembly language to be inserted directly into RTL/2 programs. This is only available when compiled with a systems programming option (CN:F) + +The Code statement takes two operands: the number of bytes used by the code insert and the number of bytes of stack used. + +Within code statements two trip characters are used to access RTL/2 variables. These vary from operating system to operating system. +On PDP-11 and VAX/VMS the trip characters are '*' and '/' + +While the specifics varied by operating system the following is an example of a code insert on [[wp:VAX/VMS|VAX/VMS]]: + +:CODE 6,0; +:JMP CODE_ENT ; This code insert can be set to a fixed length as it jumps to a new psect. +::::; this technique is especially useful on systems such as VMS where the length +::::; of instructions is variable +:.SAVE_PSECT ; Save current program section +:.PSECT ASMB_CODE,EXE,NOWRT,LONG +:CODE_ENT: +:MOVL *PARAM1(AP),*COUNTER/MYDATA +:JMP CODE_EX +:.RESTORE_PSECT +:CODE_EX: +: *RTL + +This code insert moves the value of a variable passed into the RTL/2 procedure into a variable called COUNTER in a data brick called MYDATA. + +== Reserved Words == +ABS +AND +ARRAY +BIN +BLOCK +BY +BYTE +CODE +DATA +DO +ELSE +ELSEIF +END +ENDBLOCK +ENDDATA +ENDPROC +ENT +EXT +FOR +FRAC +GOTO +HEX +IF +INT +LABEL +LAND +LENGTH +LET +LOR +MOD +NEV +NOT +OCT +OF +OPTION +OR +PROC +REAL +REF +REP +RETURN +RTL +SHA +SHL +SLA +SLL +SRA +SRL +STACK +SVC +SWITCH +THEN +TITLE +TO +VAL +WHILE + +== References== +=== SPL Documentation === + +SPL published a range of documentation for RTL/2. Each of these documents had a reference number assigned. The following is an incomplete list. + RTL/2 Ref 1 - Language Specification + RTL/2 Ref 2 - Introduction to RTL/2 + RTL/2 Ref 3 - RTL/2 Training Manual + RTL/2 Ref 4 - System Standards + RTL/2 Ref 5 - Stream I/O + RTL/2 Ref 18 - Hints on writing RTL/2 Programs + RTL/2 Ref 26 - Language Reference Card + RTL/2 Ref 39 - Run time environment on the PDP-11 + RTL/2 Ref 63 - User Manual for the PDP-11 under RSX-11M + RTL/2 Ref 107- VAX/VMS RTL/2 User Manual + RTL/2 REF 130- The RTL/2 32 bit run time environment on the VAX +{{Reflist}} + +== Code Specimen == +{{language programming paradigm|Imperative}} +{{stub}} \ No newline at end of file diff --git a/Lang/RTL-2/Hello-world-Text b/Lang/RTL-2/Hello-world-Text new file mode 120000 index 0000000000..47cee6b493 --- /dev/null +++ b/Lang/RTL-2/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/RTL-2 \ No newline at end of file diff --git a/Lang/RTSL/0DESCRIPTION b/Lang/RTSL/0DESCRIPTION new file mode 100644 index 0000000000..2e3e3d5295 --- /dev/null +++ b/Lang/RTSL/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language +|site=http://citeseerx.ist.psu.edu/ +}} + +RTSL is a domain specific programming language for extending ray tracing systems. + +[[Category:Raytracing]] \ No newline at end of file diff --git a/Lang/Racket/Arbitrary-precision-integers-(included) b/Lang/Racket/Arbitrary-precision-integers-(included) deleted file mode 120000 index 345e5d6de9..0000000000 --- a/Lang/Racket/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Racket \ No newline at end of file diff --git a/Lang/RapidQ/0DESCRIPTION b/Lang/RapidQ/0DESCRIPTION new file mode 100644 index 0000000000..2bd6564940 --- /dev/null +++ b/Lang/RapidQ/0DESCRIPTION @@ -0,0 +1,15 @@ +{{language|RapidQ +|strength=strong +|safety=safe +|checking=static +|parampass=both +|tags=rapidq +|LCT=yes}}'''RapidQ''' (also known as Rapid-Q) is a proprietary freeware, cross-platform, semi-[[object-oriented language|object-oriented]] [[programming language]] similar to [[BASIC]]. It can create console, [[GUI]], and CGI applications. The [[IDE]] includes a drag-and-drop form designer, syntax highlighting and single button compilation. + +== Rosetta Code examples == +Most [[BASIC]] examples work with RapidQ directly or with small modifications. Therefore, RapidQ specific examples are only needed in cases where RapidQ differs from standard BASIC. This typically means file handling, graphics, GUI functions and [[object-oriented programming]]. +==Citations== +* [[wp:RapidQ|Wikipedia's RapidQ entry]] +* [http://tech.groups.yahoo.com/group/rapidq RapidQ Yahoo group] - The compiler and documentation can be downloaded from the files section. + +[[Category:BASIC Implementations]] \ No newline at end of file diff --git a/Lang/RapidQ/Bitmap b/Lang/RapidQ/Bitmap new file mode 120000 index 0000000000..0b38586f31 --- /dev/null +++ b/Lang/RapidQ/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/Bitmap-Bresenhams-line-algorithm b/Lang/RapidQ/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..588ed51199 --- /dev/null +++ b/Lang/RapidQ/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/Classes b/Lang/RapidQ/Classes new file mode 120000 index 0000000000..7680af9f46 --- /dev/null +++ b/Lang/RapidQ/Classes @@ -0,0 +1 @@ +../../Task/Classes/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/Command-line-arguments b/Lang/RapidQ/Command-line-arguments new file mode 120000 index 0000000000..2c32e763a3 --- /dev/null +++ b/Lang/RapidQ/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/Determine-if-a-string-is-numeric b/Lang/RapidQ/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..f2da1f7dff --- /dev/null +++ b/Lang/RapidQ/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/File-IO b/Lang/RapidQ/File-IO new file mode 120000 index 0000000000..9051de57d7 --- /dev/null +++ b/Lang/RapidQ/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/File-modification-time b/Lang/RapidQ/File-modification-time new file mode 120000 index 0000000000..b77f80096d --- /dev/null +++ b/Lang/RapidQ/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/File-size b/Lang/RapidQ/File-size new file mode 120000 index 0000000000..e013428777 --- /dev/null +++ b/Lang/RapidQ/File-size @@ -0,0 +1 @@ +../../Task/File-size/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/FizzBuzz b/Lang/RapidQ/FizzBuzz new file mode 120000 index 0000000000..334d5efa6d --- /dev/null +++ b/Lang/RapidQ/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/RapidQ \ No newline at end of file diff --git a/Lang/RapidQ/Hello-world-Graphical b/Lang/RapidQ/Hello-world-Graphical new file mode 120000 index 0000000000..6fbb5256bb --- /dev/null +++ b/Lang/RapidQ/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/RapidQ \ No newline at end of file diff --git a/Lang/Rascal/0DESCRIPTION b/Lang/Rascal/0DESCRIPTION new file mode 100644 index 0000000000..a50886d107 --- /dev/null +++ b/Lang/Rascal/0DESCRIPTION @@ -0,0 +1,68 @@ +{{language|Rascal +|site=http://www.rascal-mpl.org/ +|exec=interpreted +|strength=strong +|safety=safe +|express=partially implicit +|checking=dynamic +|parampass=value +|gc=yes +}} + +Rascal is a [http://www.rascal-mpl.org/Rascal/RascalDomain domain specific] language for source code analysis and manipulation a.k.a. meta-programming. It is currently being developed and tested at [http://www.cwi.nl/ CWI]. No formal release has been made yet, but alpha quality "previews" are available on the [http://www.rascal-mpl.org/Rascal/Download Download] page.http://www.rascal-mpl.org/ +[[Image:RascalLogo.png|200px|thumb|right|The Rascal logo]] + +==Why Rascal?== +Rascal is a new language for ''meta-programming'', this is the activity of writing meta-programshttp://tutor.rascal-mpl.org/Courses/Rascal/Rascal.html#/Courses/Rascal/Motivation/Motivation.html. Using Rascal you create programs that read, analyse, transform, generate and/or visualize other programs. +Meta-programs are programs that analyze, transform or generate other programs. Ordinary programs work on data; meta-programs work on programs. + +The ''range of programs'' to which meta-programming can be applied is large: from programs in standard languages like C and Java to domain-specific languages for describing high-level system models or applications in specialized areas like gaming or finance. In some cases, even test results or performance data are used as input for meta-programs. + +The ''range of kinds of meta programs'' that can be applied is also large. There are simple meta programs that generate boilerplate code from a list of items. There are complex meta programs that reverse engineer and statically analyse a big software system before visualizing the results. The point of Rascal is that in all these kinds of meta programs one needs similar operations and similar data-types. + +The ''point of Rascal'' is to provide a reusable set of primitives to build and manipulate program representations. The point is not to be or provide a unified representation of programs to let generic algorithms operate on. In meta programming the devil is often in the details. Rascal makes sure to not a priori abstract from the important details programming language syntax and semantics. + +Rascal is a ''domain specific programming language''. We emphasize programming here because Rascal is intended as an engineering tool for programmers that need to construct meta programs. Rascal programs allow running, inspecting, debugging, tracing, profiling, etc. just as normal programs do. The skills of any good programmer are enough to easily write good Rascal programs. +===Examples=== +Typical applications of Rascal are: +#Refactoring of Java source code. +#Analyzing PHP code. +#Searching for buffer overflows in C code. +#Analyzing the version history of a large software project. +#Implementing a domain-specific language (DSL) for describing games or business processes. + +All these cases involve a form of meta-programming: software programs (in a wide sense) are the objects-of-interest that are being analyzed, transformed or generated. The Rascal language is designed for meta-programming following the [http://tutor.rascal-mpl.org/Courses/EASY/EASY.html EASY] paradigm. It can be applied in domains ranging from compiler construction and implementing domain-specific languages to constraint solving and software renovation. + +Since representation of information is central to the approach, Rascal provides a rich set of built-in data types. To support extraction and analysis, parsing and advanced pattern matching are provided. High-level control structures make analysis and synthesis of complex datastructures simple. + +===Benefits=== +#'''Familiar syntax''' in a what-you-see is-what-you-get style is used even for sophisticated concepts and this makes the language easy to learn and easy to use. +#'''Sophisticated built-in data types''' provide standard solutions for many meta-programming problems. +#'''Safety''' is achieved by finding most errors before the program is executed and by making common errors like missing initializations or invalid pointers impossible. +#'''Local type inference''' makes local variable declarations redundant. +#'''Pattern matching''' can be used to analyze all complex datastructures. +#'''Syntax definitions''' make it possible to define new and existing languages and to write tools for them. +#'''Visiting''' makes it easy to traverse datastructures and to extract information from them or to synthesize results. +#'''Templates''' enable easy code generation. +#'''Functions as values''' permit programming styles with high re-use. +#'''Generic types''' allow writing functions that are applicable for many different types. +#'''Eclipse integration''' makes Rascal programming a breeze. All familiar tools are at your fingertips. + +===Pitfalls=== +#Rascal programs are not yet highly optimized so execution maybe slow for some programs. +#At the time of writing, this checking is done during execution, but we are working on this. + +==Facts== +Here's a list of factshttp://www.rascal-mpl.org/Rascal/Facts about Rascal that you might find interesting: + +# Rascal is the successor of the [http://www.meta-environment.org/ ASF+SDF Meta-Environment]. +# Like [http://www.asfsdf.org/ ASF+SDF], it fully supports embedded concrete syntax fragments for "syntax safe" matching and construction of source code. +# Like [http://www.stringtemplate.org/ StringTemplate], it supports recursive string templates for code generation in the absence of a context-free grammar. +# [http://www.tobiasart.eu/ Tobias Baanders] designed the Rascal logo. +# It employs a parsing architecture inspired by Scott and Johnstone's GLL parsing. +# It's fundamental run-time data representation and manipulation API (pdb.values) is a part of [http://www.eclipse.org/imp/ Eclipse IMP]. +# PDB.values was inspired (mostly) by the [http://www.meta-environment.org/Meta-Environment/ATerms ATerm library] and [http://www.meta-environment.org/twiki/login/Meta-Environment/RScript?origurl=%2FMeta-Environment%2FRScript RScript]. +# We used Rascal itself to transform its Java-based interpreter from the Visitor design pattern to the Interpreter design pattern automagically. + +==References== + \ No newline at end of file diff --git a/Lang/Rascal/99-Bottles-of-Beer b/Lang/Rascal/99-Bottles-of-Beer new file mode 120000 index 0000000000..baa5fd6a4c --- /dev/null +++ b/Lang/Rascal/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Anagrams b/Lang/Rascal/Anagrams new file mode 120000 index 0000000000..aff0195df7 --- /dev/null +++ b/Lang/Rascal/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Best-shuffle b/Lang/Rascal/Best-shuffle new file mode 120000 index 0000000000..85f3294daf --- /dev/null +++ b/Lang/Rascal/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Create-an-HTML-table b/Lang/Rascal/Create-an-HTML-table new file mode 120000 index 0000000000..1a0fec6511 --- /dev/null +++ b/Lang/Rascal/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Dot-product b/Lang/Rascal/Dot-product new file mode 120000 index 0000000000..0766c5da14 --- /dev/null +++ b/Lang/Rascal/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Empty-string b/Lang/Rascal/Empty-string new file mode 120000 index 0000000000..cfb18bc929 --- /dev/null +++ b/Lang/Rascal/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Ethiopian-multiplication b/Lang/Rascal/Ethiopian-multiplication new file mode 120000 index 0000000000..f5ea74eb26 --- /dev/null +++ b/Lang/Rascal/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Even-or-odd b/Lang/Rascal/Even-or-odd new file mode 120000 index 0000000000..7bb7864c54 --- /dev/null +++ b/Lang/Rascal/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Factorial b/Lang/Rascal/Factorial new file mode 120000 index 0000000000..ea9f868d0d --- /dev/null +++ b/Lang/Rascal/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Rascal \ No newline at end of file diff --git a/Lang/Rascal/FizzBuzz b/Lang/Rascal/FizzBuzz new file mode 120000 index 0000000000..d76e7d619e --- /dev/null +++ b/Lang/Rascal/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Greatest-common-divisor b/Lang/Rascal/Greatest-common-divisor new file mode 120000 index 0000000000..51f932dc07 --- /dev/null +++ b/Lang/Rascal/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Greatest-element-of-a-list b/Lang/Rascal/Greatest-element-of-a-list new file mode 120000 index 0000000000..00b1e2fc32 --- /dev/null +++ b/Lang/Rascal/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Guess-the-number b/Lang/Rascal/Guess-the-number new file mode 120000 index 0000000000..5e6db43898 --- /dev/null +++ b/Lang/Rascal/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Hello-world-Graphical b/Lang/Rascal/Hello-world-Graphical new file mode 120000 index 0000000000..807b4f357b --- /dev/null +++ b/Lang/Rascal/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Horners-rule-for-polynomial-evaluation b/Lang/Rascal/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..0dae9d2a53 --- /dev/null +++ b/Lang/Rascal/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Increment-a-numerical-string b/Lang/Rascal/Increment-a-numerical-string new file mode 120000 index 0000000000..4718fbf32c --- /dev/null +++ b/Lang/Rascal/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Jensens-Device b/Lang/Rascal/Jensens-Device new file mode 120000 index 0000000000..489f834ab4 --- /dev/null +++ b/Lang/Rascal/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/Rascal \ No newline at end of file diff --git a/Lang/Rascal/List-comprehensions b/Lang/Rascal/List-comprehensions new file mode 120000 index 0000000000..60e93e9d0b --- /dev/null +++ b/Lang/Rascal/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Logical-operations b/Lang/Rascal/Logical-operations new file mode 120000 index 0000000000..bd1bce7409 --- /dev/null +++ b/Lang/Rascal/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Matrix-multiplication b/Lang/Rascal/Matrix-multiplication new file mode 120000 index 0000000000..9a39c13025 --- /dev/null +++ b/Lang/Rascal/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Matrix-transposition b/Lang/Rascal/Matrix-transposition new file mode 120000 index 0000000000..60ff2781cc --- /dev/null +++ b/Lang/Rascal/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Maze-generation b/Lang/Rascal/Maze-generation new file mode 120000 index 0000000000..a01550ed88 --- /dev/null +++ b/Lang/Rascal/Maze-generation @@ -0,0 +1 @@ +../../Task/Maze-generation/Rascal \ No newline at end of file diff --git a/Lang/Rascal/Metaprogramming b/Lang/Rascal/Metaprogramming new file mode 120000 index 0000000000..5838b634f1 --- /dev/null +++ b/Lang/Rascal/Metaprogramming @@ -0,0 +1 @@ +../../Task/Metaprogramming/Rascal \ No newline at end of file diff --git a/Lang/Raven/0DESCRIPTION b/Lang/Raven/0DESCRIPTION new file mode 100644 index 0000000000..a500b93e07 --- /dev/null +++ b/Lang/Raven/0DESCRIPTION @@ -0,0 +1,33 @@ +{{language|Raven}}Raven is an eclectic language with features derived from [[derived from::Python]], [[derived from::Forth]], and [[derived from::Perl]]. It was developed independently by [[User:Mythago|Sean Pringle]]. Raven is available from [http://aerosuidae.net aerosuidae.net] under the GNU General Public License. It is currently only available for the [[runs on::Linux]] platform. + +==Features== +Its described feature set includes: + +===From Python=== +* Whitespace indentation to define code blocks. +* Some common function names. + +===From Forth=== + +* Postfix Notation and the Data Stack. +* Dictionary of short atomic functions. + +===From Perl=== + +* Lists and Hash tables. +* [[Regular_expression_matching|Regular Expressions]]. + +===Other design goals=== + +* Use clear and concise syntax. +* Be fast to write and fast to run. +* Use [[closures]] as a simple object model. +* Have minimal restrictions on variable and function names. +* Rely on best practices guidelines rather than imposing rules for everything. +* Interface to [[MySQL]] and SQLite. +* Support multithreading. + +Source: [http://aerosuidae.net/raven.html The Raven home page] + +==Other Resources== +* [http://aerosuidae.net/raven.html Raven Manual] \ No newline at end of file diff --git a/Lang/Raven/Apply-a-callback-to-an-array b/Lang/Raven/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..11b953f16e --- /dev/null +++ b/Lang/Raven/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Raven \ No newline at end of file diff --git a/Lang/Raven/Arithmetic-Integer b/Lang/Raven/Arithmetic-Integer new file mode 120000 index 0000000000..4adbbe92d0 --- /dev/null +++ b/Lang/Raven/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Raven \ No newline at end of file diff --git a/Lang/Raven/Associative-array-Creation b/Lang/Raven/Associative-array-Creation new file mode 120000 index 0000000000..8f4abbb9b5 --- /dev/null +++ b/Lang/Raven/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Raven \ No newline at end of file diff --git a/Lang/Raven/Check-that-file-exists b/Lang/Raven/Check-that-file-exists new file mode 120000 index 0000000000..a805414526 --- /dev/null +++ b/Lang/Raven/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Raven \ No newline at end of file diff --git a/Lang/Raven/Classes b/Lang/Raven/Classes new file mode 120000 index 0000000000..fa16f38475 --- /dev/null +++ b/Lang/Raven/Classes @@ -0,0 +1 @@ +../../Task/Classes/Raven \ No newline at end of file diff --git a/Lang/Raven/Collections b/Lang/Raven/Collections new file mode 120000 index 0000000000..f547428058 --- /dev/null +++ b/Lang/Raven/Collections @@ -0,0 +1 @@ +../../Task/Collections/Raven \ No newline at end of file diff --git a/Lang/Raven/Command-line-arguments b/Lang/Raven/Command-line-arguments new file mode 120000 index 0000000000..e7345d90b3 --- /dev/null +++ b/Lang/Raven/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Raven \ No newline at end of file diff --git a/Lang/Raven/Comments b/Lang/Raven/Comments new file mode 120000 index 0000000000..33089e37a9 --- /dev/null +++ b/Lang/Raven/Comments @@ -0,0 +1 @@ +../../Task/Comments/Raven \ No newline at end of file diff --git a/Lang/Raven/Concurrent-computing b/Lang/Raven/Concurrent-computing new file mode 120000 index 0000000000..da5d0c1bd0 --- /dev/null +++ b/Lang/Raven/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/Raven \ No newline at end of file diff --git a/Lang/Raven/Create-a-file b/Lang/Raven/Create-a-file new file mode 120000 index 0000000000..564b7f6ce7 --- /dev/null +++ b/Lang/Raven/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Raven \ No newline at end of file diff --git a/Lang/Raven/Date-format b/Lang/Raven/Date-format new file mode 120000 index 0000000000..95e66aa74f --- /dev/null +++ b/Lang/Raven/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Raven \ No newline at end of file diff --git a/Lang/Raven/Delete-a-file b/Lang/Raven/Delete-a-file new file mode 120000 index 0000000000..5ca0df975d --- /dev/null +++ b/Lang/Raven/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Raven \ No newline at end of file diff --git a/Lang/Raven/Enumerations b/Lang/Raven/Enumerations new file mode 120000 index 0000000000..1b32aa3a86 --- /dev/null +++ b/Lang/Raven/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Raven \ No newline at end of file diff --git a/Lang/Raven/Exceptions b/Lang/Raven/Exceptions new file mode 120000 index 0000000000..f32f82c220 --- /dev/null +++ b/Lang/Raven/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Raven \ No newline at end of file diff --git a/Lang/Raven/Execute-a-system-command b/Lang/Raven/Execute-a-system-command new file mode 120000 index 0000000000..11cbe65da4 --- /dev/null +++ b/Lang/Raven/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Raven \ No newline at end of file diff --git a/Lang/Raven/File-IO b/Lang/Raven/File-IO new file mode 120000 index 0000000000..97a4398831 --- /dev/null +++ b/Lang/Raven/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Raven \ No newline at end of file diff --git a/Lang/Raven/File-size b/Lang/Raven/File-size new file mode 120000 index 0000000000..9d31225850 --- /dev/null +++ b/Lang/Raven/File-size @@ -0,0 +1 @@ +../../Task/File-size/Raven \ No newline at end of file diff --git a/Lang/Raven/Filter b/Lang/Raven/Filter new file mode 120000 index 0000000000..0151c432cb --- /dev/null +++ b/Lang/Raven/Filter @@ -0,0 +1 @@ +../../Task/Filter/Raven \ No newline at end of file diff --git a/Lang/Raven/FizzBuzz b/Lang/Raven/FizzBuzz new file mode 120000 index 0000000000..1c6a0232a0 --- /dev/null +++ b/Lang/Raven/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Raven \ No newline at end of file diff --git a/Lang/Raven/Formatted-numeric-output b/Lang/Raven/Formatted-numeric-output new file mode 120000 index 0000000000..d66a462123 --- /dev/null +++ b/Lang/Raven/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Raven \ No newline at end of file diff --git a/Lang/Raven/Function-definition b/Lang/Raven/Function-definition new file mode 120000 index 0000000000..c84c6259ad --- /dev/null +++ b/Lang/Raven/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Raven \ No newline at end of file diff --git a/Lang/Raven/Hash-from-two-arrays b/Lang/Raven/Hash-from-two-arrays new file mode 120000 index 0000000000..614a825971 --- /dev/null +++ b/Lang/Raven/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Raven \ No newline at end of file diff --git a/Lang/Raven/Hello-world-Text b/Lang/Raven/Hello-world-Text new file mode 120000 index 0000000000..13bd2acc3e --- /dev/null +++ b/Lang/Raven/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Raven \ No newline at end of file diff --git a/Lang/Raven/Introspection b/Lang/Raven/Introspection new file mode 120000 index 0000000000..b299e7e5dd --- /dev/null +++ b/Lang/Raven/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Raven \ No newline at end of file diff --git a/Lang/Raven/Metered-concurrency b/Lang/Raven/Metered-concurrency new file mode 120000 index 0000000000..7345834f98 --- /dev/null +++ b/Lang/Raven/Metered-concurrency @@ -0,0 +1 @@ +../../Task/Metered-concurrency/Raven \ No newline at end of file diff --git a/Lang/Refal/0DESCRIPTION b/Lang/Refal/0DESCRIPTION new file mode 100644 index 0000000000..f66cf163bf --- /dev/null +++ b/Lang/Refal/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/Retro/0DESCRIPTION b/Lang/Retro/0DESCRIPTION new file mode 100644 index 0000000000..055916b1a1 --- /dev/null +++ b/Lang/Retro/0DESCRIPTION @@ -0,0 +1,16 @@ +{{language|Retro +|exec=machine +|site=http://rx-core.org +|gc=no +|parampass=reference +|untyped=yes +|tags=retro +}} + +Retro is a stack-based, concatenative programming language with roots in [[Forth]]. + +==Links== +*[http://rx-core.org Main Site] +*[http://rx-core.org/rx.fossil/wiki?name=documentation Documentation] + +{{Language programming paradigm|Concatenative}} \ No newline at end of file diff --git a/Lang/Retro/100-doors b/Lang/Retro/100-doors new file mode 120000 index 0000000000..42d0bf05b0 --- /dev/null +++ b/Lang/Retro/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Retro \ No newline at end of file diff --git a/Lang/Retro/99-Bottles-of-Beer b/Lang/Retro/99-Bottles-of-Beer new file mode 120000 index 0000000000..4525b6169c --- /dev/null +++ b/Lang/Retro/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Retro \ No newline at end of file diff --git a/Lang/Retro/A+B b/Lang/Retro/A+B new file mode 120000 index 0000000000..6c4608b9a9 --- /dev/null +++ b/Lang/Retro/A+B @@ -0,0 +1 @@ +../../Task/A+B/Retro \ No newline at end of file diff --git a/Lang/Retro/Accumulator-factory b/Lang/Retro/Accumulator-factory new file mode 120000 index 0000000000..388b5f1850 --- /dev/null +++ b/Lang/Retro/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Retro \ No newline at end of file diff --git a/Lang/Retro/Address-of-a-variable b/Lang/Retro/Address-of-a-variable new file mode 120000 index 0000000000..dff1bc9eb6 --- /dev/null +++ b/Lang/Retro/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/Retro \ No newline at end of file diff --git a/Lang/Retro/Apply-a-callback-to-an-array b/Lang/Retro/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..7bea060944 --- /dev/null +++ b/Lang/Retro/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Retro \ No newline at end of file diff --git a/Lang/Retro/Arithmetic-Integer b/Lang/Retro/Arithmetic-Integer new file mode 120000 index 0000000000..aa72e64ab6 --- /dev/null +++ b/Lang/Retro/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Retro \ No newline at end of file diff --git a/Lang/Retro/Array-concatenation b/Lang/Retro/Array-concatenation new file mode 120000 index 0000000000..03596668c4 --- /dev/null +++ b/Lang/Retro/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Retro \ No newline at end of file diff --git a/Lang/Retro/Arrays b/Lang/Retro/Arrays new file mode 120000 index 0000000000..22735dd2e1 --- /dev/null +++ b/Lang/Retro/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Retro \ No newline at end of file diff --git a/Lang/Retro/Associative-array-Creation b/Lang/Retro/Associative-array-Creation new file mode 120000 index 0000000000..e529caf2d3 --- /dev/null +++ b/Lang/Retro/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Retro \ No newline at end of file diff --git a/Lang/Retro/Bitwise-operations b/Lang/Retro/Bitwise-operations new file mode 120000 index 0000000000..8d6ec5a569 --- /dev/null +++ b/Lang/Retro/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Retro \ No newline at end of file diff --git a/Lang/Retro/CSV-to-HTML-translation b/Lang/Retro/CSV-to-HTML-translation new file mode 120000 index 0000000000..be3389b471 --- /dev/null +++ b/Lang/Retro/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/Retro \ No newline at end of file diff --git a/Lang/Retro/Caesar-cipher b/Lang/Retro/Caesar-cipher new file mode 120000 index 0000000000..b70c856ab4 --- /dev/null +++ b/Lang/Retro/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/Retro \ No newline at end of file diff --git a/Lang/Retro/Case-sensitivity-of-identifiers b/Lang/Retro/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..04a36c58f4 --- /dev/null +++ b/Lang/Retro/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/Retro \ No newline at end of file diff --git a/Lang/Retro/Character-codes b/Lang/Retro/Character-codes new file mode 120000 index 0000000000..e41c20615c --- /dev/null +++ b/Lang/Retro/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Retro \ No newline at end of file diff --git a/Lang/Retro/Character-matching b/Lang/Retro/Character-matching new file mode 120000 index 0000000000..e2512dbd24 --- /dev/null +++ b/Lang/Retro/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/Retro \ No newline at end of file diff --git a/Lang/Retro/Comments b/Lang/Retro/Comments new file mode 120000 index 0000000000..ccc2cb016e --- /dev/null +++ b/Lang/Retro/Comments @@ -0,0 +1 @@ +../../Task/Comments/Retro \ No newline at end of file diff --git a/Lang/Retro/Conditional-structures b/Lang/Retro/Conditional-structures new file mode 120000 index 0000000000..9ec5a3b044 --- /dev/null +++ b/Lang/Retro/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Retro \ No newline at end of file diff --git a/Lang/Retro/Conways-Game-of-Life b/Lang/Retro/Conways-Game-of-Life new file mode 120000 index 0000000000..c1d4470eb9 --- /dev/null +++ b/Lang/Retro/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/Retro \ No newline at end of file diff --git a/Lang/Retro/Count-in-octal b/Lang/Retro/Count-in-octal new file mode 120000 index 0000000000..ea84680735 --- /dev/null +++ b/Lang/Retro/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/Retro \ No newline at end of file diff --git a/Lang/Retro/Create-a-file b/Lang/Retro/Create-a-file new file mode 120000 index 0000000000..2cae7ad3fc --- /dev/null +++ b/Lang/Retro/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Retro \ No newline at end of file diff --git a/Lang/Retro/Create-an-HTML-table b/Lang/Retro/Create-an-HTML-table new file mode 120000 index 0000000000..78953ecba0 --- /dev/null +++ b/Lang/Retro/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/Retro \ No newline at end of file diff --git a/Lang/Retro/Define-a-primitive-data-type b/Lang/Retro/Define-a-primitive-data-type new file mode 120000 index 0000000000..8ff859f54e --- /dev/null +++ b/Lang/Retro/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Retro \ No newline at end of file diff --git a/Lang/Retro/Delete-a-file b/Lang/Retro/Delete-a-file new file mode 120000 index 0000000000..eb24db8521 --- /dev/null +++ b/Lang/Retro/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Retro \ No newline at end of file diff --git a/Lang/Retro/Determine-if-a-string-is-numeric b/Lang/Retro/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..9ef1500c10 --- /dev/null +++ b/Lang/Retro/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Retro \ No newline at end of file diff --git a/Lang/Retro/Documentation b/Lang/Retro/Documentation new file mode 120000 index 0000000000..1d6a15d2ef --- /dev/null +++ b/Lang/Retro/Documentation @@ -0,0 +1 @@ +../../Task/Documentation/Retro \ No newline at end of file diff --git a/Lang/Retro/Draw-a-cuboid b/Lang/Retro/Draw-a-cuboid new file mode 120000 index 0000000000..74de8fe14e --- /dev/null +++ b/Lang/Retro/Draw-a-cuboid @@ -0,0 +1 @@ +../../Task/Draw-a-cuboid/Retro \ No newline at end of file diff --git a/Lang/Retro/Dynamic-variable-names b/Lang/Retro/Dynamic-variable-names new file mode 120000 index 0000000000..ab348bd8a9 --- /dev/null +++ b/Lang/Retro/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/Retro \ No newline at end of file diff --git a/Lang/Retro/Empty-program b/Lang/Retro/Empty-program new file mode 120000 index 0000000000..5bd873f583 --- /dev/null +++ b/Lang/Retro/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Retro \ No newline at end of file diff --git a/Lang/Retro/Empty-string b/Lang/Retro/Empty-string new file mode 120000 index 0000000000..d67860c5c0 --- /dev/null +++ b/Lang/Retro/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/Retro \ No newline at end of file diff --git a/Lang/Retro/Enumerations b/Lang/Retro/Enumerations new file mode 120000 index 0000000000..6cdab39202 --- /dev/null +++ b/Lang/Retro/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Retro \ No newline at end of file diff --git a/Lang/Retro/Exponentiation-operator b/Lang/Retro/Exponentiation-operator new file mode 120000 index 0000000000..f5d3eb8355 --- /dev/null +++ b/Lang/Retro/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/Retro \ No newline at end of file diff --git a/Lang/Retro/Extend-your-language b/Lang/Retro/Extend-your-language new file mode 120000 index 0000000000..42d258a3d7 --- /dev/null +++ b/Lang/Retro/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/Retro \ No newline at end of file diff --git a/Lang/Retro/Factorial b/Lang/Retro/Factorial new file mode 120000 index 0000000000..013c6e7926 --- /dev/null +++ b/Lang/Retro/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Retro \ No newline at end of file diff --git a/Lang/Retro/Fibonacci-sequence b/Lang/Retro/Fibonacci-sequence new file mode 120000 index 0000000000..e3de5dd9e1 --- /dev/null +++ b/Lang/Retro/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Retro \ No newline at end of file diff --git a/Lang/Retro/File-IO b/Lang/Retro/File-IO new file mode 120000 index 0000000000..b4466fa9c1 --- /dev/null +++ b/Lang/Retro/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Retro \ No newline at end of file diff --git a/Lang/Retro/File-size b/Lang/Retro/File-size new file mode 120000 index 0000000000..fe1532f982 --- /dev/null +++ b/Lang/Retro/File-size @@ -0,0 +1 @@ +../../Task/File-size/Retro \ No newline at end of file diff --git a/Lang/Retro/Find-limit-of-recursion b/Lang/Retro/Find-limit-of-recursion new file mode 120000 index 0000000000..4fd44771b5 --- /dev/null +++ b/Lang/Retro/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/Retro \ No newline at end of file diff --git a/Lang/Retro/FizzBuzz b/Lang/Retro/FizzBuzz new file mode 120000 index 0000000000..17c48a635d --- /dev/null +++ b/Lang/Retro/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Retro \ No newline at end of file diff --git a/Lang/Retro/Function-definition b/Lang/Retro/Function-definition new file mode 120000 index 0000000000..9b4b505bd9 --- /dev/null +++ b/Lang/Retro/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Retro \ No newline at end of file diff --git a/Lang/Retro/Generic-swap b/Lang/Retro/Generic-swap new file mode 120000 index 0000000000..55934621a9 --- /dev/null +++ b/Lang/Retro/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Retro \ No newline at end of file diff --git a/Lang/Retro/Greatest-common-divisor b/Lang/Retro/Greatest-common-divisor new file mode 120000 index 0000000000..aca5ebdb91 --- /dev/null +++ b/Lang/Retro/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Retro \ No newline at end of file diff --git a/Lang/Retro/Guess-the-number b/Lang/Retro/Guess-the-number new file mode 120000 index 0000000000..b3fe36a74b --- /dev/null +++ b/Lang/Retro/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Retro \ No newline at end of file diff --git a/Lang/Retro/Guess-the-number-With-feedback b/Lang/Retro/Guess-the-number-With-feedback new file mode 120000 index 0000000000..732bb11b82 --- /dev/null +++ b/Lang/Retro/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/Retro \ No newline at end of file diff --git a/Lang/Retro/Hello-world-Newline-omission b/Lang/Retro/Hello-world-Newline-omission new file mode 120000 index 0000000000..3c8059ae5b --- /dev/null +++ b/Lang/Retro/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Retro \ No newline at end of file diff --git a/Lang/Retro/Hello-world-Standard-error b/Lang/Retro/Hello-world-Standard-error new file mode 120000 index 0000000000..ac7b35b8ba --- /dev/null +++ b/Lang/Retro/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Retro \ No newline at end of file diff --git a/Lang/Retro/Hello-world-Text b/Lang/Retro/Hello-world-Text new file mode 120000 index 0000000000..16bd46ae7a --- /dev/null +++ b/Lang/Retro/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Retro \ No newline at end of file diff --git a/Lang/Retro/Here-document b/Lang/Retro/Here-document new file mode 120000 index 0000000000..36bf09f31d --- /dev/null +++ b/Lang/Retro/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/Retro \ No newline at end of file diff --git a/Lang/Retro/Higher-order-functions b/Lang/Retro/Higher-order-functions new file mode 120000 index 0000000000..e65a672c23 --- /dev/null +++ b/Lang/Retro/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Retro \ No newline at end of file diff --git a/Lang/Retro/Host-introspection b/Lang/Retro/Host-introspection new file mode 120000 index 0000000000..571de2b0a9 --- /dev/null +++ b/Lang/Retro/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/Retro \ No newline at end of file diff --git a/Lang/Retro/Include-a-file b/Lang/Retro/Include-a-file new file mode 120000 index 0000000000..61cd2e26d6 --- /dev/null +++ b/Lang/Retro/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/Retro \ No newline at end of file diff --git a/Lang/Retro/Increment-a-numerical-string b/Lang/Retro/Increment-a-numerical-string new file mode 120000 index 0000000000..b7c7aeb264 --- /dev/null +++ b/Lang/Retro/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Retro \ No newline at end of file diff --git a/Lang/Retro/Integer-comparison b/Lang/Retro/Integer-comparison new file mode 120000 index 0000000000..fb8fdf5f42 --- /dev/null +++ b/Lang/Retro/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Retro \ No newline at end of file diff --git a/Lang/Retro/Integer-sequence b/Lang/Retro/Integer-sequence new file mode 120000 index 0000000000..ad06b200f4 --- /dev/null +++ b/Lang/Retro/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Retro \ No newline at end of file diff --git a/Lang/Retro/Interactive-programming b/Lang/Retro/Interactive-programming new file mode 120000 index 0000000000..4842e5dfc9 --- /dev/null +++ b/Lang/Retro/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Retro \ No newline at end of file diff --git a/Lang/Retro/Introspection b/Lang/Retro/Introspection new file mode 120000 index 0000000000..78f6169da0 --- /dev/null +++ b/Lang/Retro/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Retro \ No newline at end of file diff --git a/Lang/Retro/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Retro/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..ccbbbc7522 --- /dev/null +++ b/Lang/Retro/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Retro \ No newline at end of file diff --git a/Lang/Retro/Keyboard-macros b/Lang/Retro/Keyboard-macros new file mode 120000 index 0000000000..c83291c6a2 --- /dev/null +++ b/Lang/Retro/Keyboard-macros @@ -0,0 +1 @@ +../../Task/Keyboard-macros/Retro \ No newline at end of file diff --git a/Lang/Retro/Leap-year b/Lang/Retro/Leap-year new file mode 120000 index 0000000000..27c41c9e11 --- /dev/null +++ b/Lang/Retro/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Retro \ No newline at end of file diff --git a/Lang/Retro/Least-common-multiple b/Lang/Retro/Least-common-multiple new file mode 120000 index 0000000000..326967b4b5 --- /dev/null +++ b/Lang/Retro/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Retro \ No newline at end of file diff --git a/Lang/Retro/Literals-Integer b/Lang/Retro/Literals-Integer new file mode 120000 index 0000000000..c72a1ca6c3 --- /dev/null +++ b/Lang/Retro/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Retro \ No newline at end of file diff --git a/Lang/Retro/Literals-String b/Lang/Retro/Literals-String new file mode 120000 index 0000000000..f643cd24fe --- /dev/null +++ b/Lang/Retro/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Retro \ No newline at end of file diff --git a/Lang/Retro/Logical-operations b/Lang/Retro/Logical-operations new file mode 120000 index 0000000000..88ff02bc1e --- /dev/null +++ b/Lang/Retro/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Retro \ No newline at end of file diff --git a/Lang/Retro/Loops-Break b/Lang/Retro/Loops-Break new file mode 120000 index 0000000000..211b1c8cbf --- /dev/null +++ b/Lang/Retro/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Retro \ No newline at end of file diff --git a/Lang/Retro/Loops-Downward-for b/Lang/Retro/Loops-Downward-for new file mode 120000 index 0000000000..2a0bc640b1 --- /dev/null +++ b/Lang/Retro/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Retro \ No newline at end of file diff --git a/Lang/Retro/Loops-For b/Lang/Retro/Loops-For new file mode 120000 index 0000000000..8aed74e52c --- /dev/null +++ b/Lang/Retro/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Retro \ No newline at end of file diff --git a/Lang/Retro/Loops-Foreach b/Lang/Retro/Loops-Foreach new file mode 120000 index 0000000000..c0e0046029 --- /dev/null +++ b/Lang/Retro/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Retro \ No newline at end of file diff --git a/Lang/Retro/Loops-Infinite b/Lang/Retro/Loops-Infinite new file mode 120000 index 0000000000..7c69b5e2d7 --- /dev/null +++ b/Lang/Retro/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Retro \ No newline at end of file diff --git a/Lang/Retro/Loops-While b/Lang/Retro/Loops-While new file mode 120000 index 0000000000..b925742216 --- /dev/null +++ b/Lang/Retro/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Retro \ No newline at end of file diff --git a/Lang/Retro/Memory-allocation b/Lang/Retro/Memory-allocation new file mode 120000 index 0000000000..d6f14f96aa --- /dev/null +++ b/Lang/Retro/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/Retro \ No newline at end of file diff --git a/Lang/Retro/Mouse-position b/Lang/Retro/Mouse-position new file mode 120000 index 0000000000..2402614e1c --- /dev/null +++ b/Lang/Retro/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/Retro \ No newline at end of file diff --git a/Lang/Revolution/0DESCRIPTION b/Lang/Revolution/0DESCRIPTION new file mode 100644 index 0000000000..8679eb5b56 --- /dev/null +++ b/Lang/Revolution/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language|Revolution +|exec=bytecode +|gc=yes +|site= http://www.runrev.com +|LCT=yes}}{{language programming paradigm|Dynamic}} +{{language programming paradigm|Object-oriented}} +{{language programming paradigm|Imperative}} +Revolution is an interpreted language created by [http://www.runrev.com Runtime Revolution] + +It is descended from HyperCard/HyperTalk, but extends that heritage by: +*Running on OS X, Mac Classic, Windows, Unix, and in modern web browsers +*Having a full interface toolkit with native widgets on all platforms +*Incorporating modern language features like regex, associative arrays, support for internet protocols, etc. +*Last but not least, supporting color natively (HyperCard die-hards are now breathing a sigh of relief) \ No newline at end of file diff --git a/Lang/Revolution/Anagrams b/Lang/Revolution/Anagrams new file mode 120000 index 0000000000..0601ef93de --- /dev/null +++ b/Lang/Revolution/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Revolution \ No newline at end of file diff --git a/Lang/Rhope/0DESCRIPTION b/Lang/Rhope/0DESCRIPTION new file mode 100644 index 0000000000..d46ce2dcb9 --- /dev/null +++ b/Lang/Rhope/0DESCRIPTION @@ -0,0 +1,3 @@ +{{language|Rhope +|site=http://rhope.retrodev.com/}} +{{language programming paradigm|concurrent}}'''Rhope''' is a general purpose, multi-[[:Category:Programming Paradigms|paradigm]] language designed by Michael Pavone. It uses a combination of the dataflow paradigm and a transaction mechanism to make [[concurrent programming]] easier. \ No newline at end of file diff --git a/Lang/Rhope/Concurrent-computing b/Lang/Rhope/Concurrent-computing new file mode 120000 index 0000000000..fe3a7c006c --- /dev/null +++ b/Lang/Rhope/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/Rhope \ No newline at end of file diff --git a/Lang/Rhope/Conditional-structures b/Lang/Rhope/Conditional-structures new file mode 120000 index 0000000000..a4b1afae7a --- /dev/null +++ b/Lang/Rhope/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Rhope \ No newline at end of file diff --git a/Lang/Ruby/Arbitrary-precision-integers-(included) b/Lang/Ruby/Arbitrary-precision-integers-(included) deleted file mode 120000 index e9718d891c..0000000000 --- a/Lang/Ruby/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Ruby \ No newline at end of file diff --git a/Lang/Ruby/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) b/Lang/Ruby/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) deleted file mode 120000 index d5c43ece95..0000000000 --- a/Lang/Ruby/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby \ No newline at end of file diff --git a/Lang/Run-BASIC/0DESCRIPTION b/Lang/Run-BASIC/0DESCRIPTION new file mode 100644 index 0000000000..5c9241833c --- /dev/null +++ b/Lang/Run-BASIC/0DESCRIPTION @@ -0,0 +1,15 @@ +{{wikipedia|Run BASIC}} +{{language +|hopl=no +}} +{{implementation|Liberty BASIC}} +'''Run BASIC''' is a [[wp:web application|web application]] server, based on [[:Category:Liberty BASIC|Liberty BASIC]] (and made by the same company, Shoptalk Systems). + +Run BASIC serves a similar purpose to other languages like [[:Category:ASP|ASP]], [[:Category:Perl|Perl]], and [[:Category:PHP|PHP]]; unlike those languages, however, it is not an add-on module to web servers, instead including its own HTTP server. Web pages are generated dynamically by the program. High-level commands automatically generate [[:Category:HTML|HTML]], colors, fonts, backgrounds, and [[wp:Cascading Style Sheets|Cascading Style Sheets]] (CSS). If needed, [[:Category:JavaScript|JavaScript]] can also be injected into a page. Graphics can be drawn and rendered via code. Files can be fetched from other web sites using GET and POST, and a built-in XML parser can be used to extract data. + +Database capability is included via the [[:Category:SQLite|SQLite]] database engine. + +==See also== +*[http://www.runbasic.com/ Run BASIC homepage] +*[[wp:Run BASIC|Run BASIC on Wikipedia]] +*[http://runbasichosting.com/ The Run BASIC Hosting Service] -- "a reliable, hassle-free way to publish your Run BASIC web applications" \ No newline at end of file diff --git a/Lang/Run-BASIC/100-doors b/Lang/Run-BASIC/100-doors new file mode 120000 index 0000000000..0ed55c6e52 --- /dev/null +++ b/Lang/Run-BASIC/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/99-Bottles-of-Beer b/Lang/Run-BASIC/99-Bottles-of-Beer new file mode 120000 index 0000000000..cf56317fda --- /dev/null +++ b/Lang/Run-BASIC/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/A+B b/Lang/Run-BASIC/A+B new file mode 120000 index 0000000000..3e589c160c --- /dev/null +++ b/Lang/Run-BASIC/A+B @@ -0,0 +1 @@ +../../Task/A+B/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Ackermann-function b/Lang/Run-BASIC/Ackermann-function new file mode 120000 index 0000000000..c9a071a8cc --- /dev/null +++ b/Lang/Run-BASIC/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Active-Directory-Connect b/Lang/Run-BASIC/Active-Directory-Connect new file mode 120000 index 0000000000..82d01f6e40 --- /dev/null +++ b/Lang/Run-BASIC/Active-Directory-Connect @@ -0,0 +1 @@ +../../Task/Active-Directory-Connect/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Active-Directory-Search-for-a-user b/Lang/Run-BASIC/Active-Directory-Search-for-a-user new file mode 120000 index 0000000000..8f525009a4 --- /dev/null +++ b/Lang/Run-BASIC/Active-Directory-Search-for-a-user @@ -0,0 +1 @@ +../../Task/Active-Directory-Search-for-a-user/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Align-columns b/Lang/Run-BASIC/Align-columns new file mode 120000 index 0000000000..a5037f6ca0 --- /dev/null +++ b/Lang/Run-BASIC/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Anagrams b/Lang/Run-BASIC/Anagrams new file mode 120000 index 0000000000..ea6d5ee0ce --- /dev/null +++ b/Lang/Run-BASIC/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Anagrams-Deranged-anagrams b/Lang/Run-BASIC/Anagrams-Deranged-anagrams new file mode 120000 index 0000000000..ba075f98e4 --- /dev/null +++ b/Lang/Run-BASIC/Anagrams-Deranged-anagrams @@ -0,0 +1 @@ +../../Task/Anagrams-Deranged-anagrams/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Arbitrary-precision-integers-included b/Lang/Run-BASIC/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..0acac1ad91 --- /dev/null +++ b/Lang/Run-BASIC/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Arithmetic-Integer b/Lang/Run-BASIC/Arithmetic-Integer new file mode 120000 index 0000000000..98a975f34e --- /dev/null +++ b/Lang/Run-BASIC/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Arithmetic-geometric-mean b/Lang/Run-BASIC/Arithmetic-geometric-mean new file mode 120000 index 0000000000..7eadb4c330 --- /dev/null +++ b/Lang/Run-BASIC/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Arrays b/Lang/Run-BASIC/Arrays new file mode 120000 index 0000000000..1daa5ee3f8 --- /dev/null +++ b/Lang/Run-BASIC/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Atomic-updates b/Lang/Run-BASIC/Atomic-updates new file mode 120000 index 0000000000..0f1c17b518 --- /dev/null +++ b/Lang/Run-BASIC/Atomic-updates @@ -0,0 +1 @@ +../../Task/Atomic-updates/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Averages-Arithmetic-mean b/Lang/Run-BASIC/Averages-Arithmetic-mean new file mode 120000 index 0000000000..a1087837d5 --- /dev/null +++ b/Lang/Run-BASIC/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Averages-Pythagorean-means b/Lang/Run-BASIC/Averages-Pythagorean-means new file mode 120000 index 0000000000..68d797efae --- /dev/null +++ b/Lang/Run-BASIC/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Averages-Root-mean-square b/Lang/Run-BASIC/Averages-Root-mean-square new file mode 120000 index 0000000000..ded6a2f721 --- /dev/null +++ b/Lang/Run-BASIC/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Balanced-brackets b/Lang/Run-BASIC/Balanced-brackets new file mode 120000 index 0000000000..cc52e21447 --- /dev/null +++ b/Lang/Run-BASIC/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Binary-search b/Lang/Run-BASIC/Binary-search new file mode 120000 index 0000000000..81a15c0adb --- /dev/null +++ b/Lang/Run-BASIC/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Binary-strings b/Lang/Run-BASIC/Binary-strings new file mode 120000 index 0000000000..916379aa30 --- /dev/null +++ b/Lang/Run-BASIC/Binary-strings @@ -0,0 +1 @@ +../../Task/Binary-strings/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Boolean-values b/Lang/Run-BASIC/Boolean-values new file mode 120000 index 0000000000..bf91f317b0 --- /dev/null +++ b/Lang/Run-BASIC/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Box-the-compass b/Lang/Run-BASIC/Box-the-compass new file mode 120000 index 0000000000..2692a40f10 --- /dev/null +++ b/Lang/Run-BASIC/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/CSV-to-HTML-translation b/Lang/Run-BASIC/CSV-to-HTML-translation new file mode 120000 index 0000000000..ff81309e59 --- /dev/null +++ b/Lang/Run-BASIC/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Caesar-cipher b/Lang/Run-BASIC/Caesar-cipher new file mode 120000 index 0000000000..83db2d71eb --- /dev/null +++ b/Lang/Run-BASIC/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Calendar b/Lang/Run-BASIC/Calendar new file mode 120000 index 0000000000..378fbefc0f --- /dev/null +++ b/Lang/Run-BASIC/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Case-sensitivity-of-identifiers b/Lang/Run-BASIC/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..b89f9275f2 --- /dev/null +++ b/Lang/Run-BASIC/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Character-codes b/Lang/Run-BASIC/Character-codes new file mode 120000 index 0000000000..e15e61027a --- /dev/null +++ b/Lang/Run-BASIC/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Character-matching b/Lang/Run-BASIC/Character-matching new file mode 120000 index 0000000000..cfdca3503b --- /dev/null +++ b/Lang/Run-BASIC/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Check-that-file-exists b/Lang/Run-BASIC/Check-that-file-exists new file mode 120000 index 0000000000..f4b3cbcdb2 --- /dev/null +++ b/Lang/Run-BASIC/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Closest-pair-problem b/Lang/Run-BASIC/Closest-pair-problem new file mode 120000 index 0000000000..42bc3efb79 --- /dev/null +++ b/Lang/Run-BASIC/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Colour-bars-Display b/Lang/Run-BASIC/Colour-bars-Display new file mode 120000 index 0000000000..8597b7a389 --- /dev/null +++ b/Lang/Run-BASIC/Colour-bars-Display @@ -0,0 +1 @@ +../../Task/Colour-bars-Display/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Comments b/Lang/Run-BASIC/Comments new file mode 120000 index 0000000000..44f6805859 --- /dev/null +++ b/Lang/Run-BASIC/Comments @@ -0,0 +1 @@ +../../Task/Comments/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Conditional-structures b/Lang/Run-BASIC/Conditional-structures new file mode 120000 index 0000000000..e9b0cc3be4 --- /dev/null +++ b/Lang/Run-BASIC/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Constrained-random-points-on-a-circle b/Lang/Run-BASIC/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..856c6b3f62 --- /dev/null +++ b/Lang/Run-BASIC/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Count-in-factors b/Lang/Run-BASIC/Count-in-factors new file mode 120000 index 0000000000..a555b511bc --- /dev/null +++ b/Lang/Run-BASIC/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Count-in-octal b/Lang/Run-BASIC/Count-in-octal new file mode 120000 index 0000000000..45028fba68 --- /dev/null +++ b/Lang/Run-BASIC/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Count-occurrences-of-a-substring b/Lang/Run-BASIC/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..7ae41a7b84 --- /dev/null +++ b/Lang/Run-BASIC/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Count-the-coins b/Lang/Run-BASIC/Count-the-coins new file mode 120000 index 0000000000..47a667cb0e --- /dev/null +++ b/Lang/Run-BASIC/Count-the-coins @@ -0,0 +1 @@ +../../Task/Count-the-coins/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Create-a-file b/Lang/Run-BASIC/Create-a-file new file mode 120000 index 0000000000..5a80ba3c6e --- /dev/null +++ b/Lang/Run-BASIC/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Create-a-two-dimensional-array-at-runtime b/Lang/Run-BASIC/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..16f5d9826f --- /dev/null +++ b/Lang/Run-BASIC/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Create-an-HTML-table b/Lang/Run-BASIC/Create-an-HTML-table new file mode 120000 index 0000000000..0cbd89791c --- /dev/null +++ b/Lang/Run-BASIC/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Date-format b/Lang/Run-BASIC/Date-format new file mode 120000 index 0000000000..4bf4dc47a2 --- /dev/null +++ b/Lang/Run-BASIC/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Date-manipulation b/Lang/Run-BASIC/Date-manipulation new file mode 120000 index 0000000000..6856ebdc95 --- /dev/null +++ b/Lang/Run-BASIC/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Day-of-the-week b/Lang/Run-BASIC/Day-of-the-week new file mode 120000 index 0000000000..77e8afd4d2 --- /dev/null +++ b/Lang/Run-BASIC/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Deal-cards-for-FreeCell b/Lang/Run-BASIC/Deal-cards-for-FreeCell new file mode 120000 index 0000000000..662e8ce0de --- /dev/null +++ b/Lang/Run-BASIC/Deal-cards-for-FreeCell @@ -0,0 +1 @@ +../../Task/Deal-cards-for-FreeCell/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Delete-a-file b/Lang/Run-BASIC/Delete-a-file new file mode 120000 index 0000000000..f267d51b90 --- /dev/null +++ b/Lang/Run-BASIC/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Detect-division-by-zero b/Lang/Run-BASIC/Detect-division-by-zero new file mode 120000 index 0000000000..8822b84d8c --- /dev/null +++ b/Lang/Run-BASIC/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Determine-if-a-string-is-numeric b/Lang/Run-BASIC/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..f526c355c6 --- /dev/null +++ b/Lang/Run-BASIC/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Determine-if-only-one-instance-is-running b/Lang/Run-BASIC/Determine-if-only-one-instance-is-running new file mode 120000 index 0000000000..7e884f8ae3 --- /dev/null +++ b/Lang/Run-BASIC/Determine-if-only-one-instance-is-running @@ -0,0 +1 @@ +../../Task/Determine-if-only-one-instance-is-running/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Digital-root b/Lang/Run-BASIC/Digital-root new file mode 120000 index 0000000000..3c0e9d359a --- /dev/null +++ b/Lang/Run-BASIC/Digital-root @@ -0,0 +1 @@ +../../Task/Digital-root/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Dinesmans-multiple-dwelling-problem b/Lang/Run-BASIC/Dinesmans-multiple-dwelling-problem new file mode 120000 index 0000000000..9cdbc1b4b2 --- /dev/null +++ b/Lang/Run-BASIC/Dinesmans-multiple-dwelling-problem @@ -0,0 +1 @@ +../../Task/Dinesmans-multiple-dwelling-problem/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Dot-product b/Lang/Run-BASIC/Dot-product new file mode 120000 index 0000000000..c6c4dc461a --- /dev/null +++ b/Lang/Run-BASIC/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Draw-a-sphere b/Lang/Run-BASIC/Draw-a-sphere new file mode 120000 index 0000000000..d5f8d62c21 --- /dev/null +++ b/Lang/Run-BASIC/Draw-a-sphere @@ -0,0 +1 @@ +../../Task/Draw-a-sphere/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Empty-directory b/Lang/Run-BASIC/Empty-directory new file mode 120000 index 0000000000..420ccb6807 --- /dev/null +++ b/Lang/Run-BASIC/Empty-directory @@ -0,0 +1 @@ +../../Task/Empty-directory/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Empty-string b/Lang/Run-BASIC/Empty-string new file mode 120000 index 0000000000..705c8a6a64 --- /dev/null +++ b/Lang/Run-BASIC/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Euler-method b/Lang/Run-BASIC/Euler-method new file mode 120000 index 0000000000..6e89af9943 --- /dev/null +++ b/Lang/Run-BASIC/Euler-method @@ -0,0 +1 @@ +../../Task/Euler-method/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Evaluate-binomial-coefficients b/Lang/Run-BASIC/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..b048821aff --- /dev/null +++ b/Lang/Run-BASIC/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Even-or-odd b/Lang/Run-BASIC/Even-or-odd new file mode 120000 index 0000000000..d9e995ebf7 --- /dev/null +++ b/Lang/Run-BASIC/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Execute-a-system-command b/Lang/Run-BASIC/Execute-a-system-command new file mode 120000 index 0000000000..e0443e4bff --- /dev/null +++ b/Lang/Run-BASIC/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Exponentiation-operator b/Lang/Run-BASIC/Exponentiation-operator new file mode 120000 index 0000000000..edabaa024c --- /dev/null +++ b/Lang/Run-BASIC/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Fast-Fourier-transform b/Lang/Run-BASIC/Fast-Fourier-transform new file mode 120000 index 0000000000..a68dc286d6 --- /dev/null +++ b/Lang/Run-BASIC/Fast-Fourier-transform @@ -0,0 +1 @@ +../../Task/Fast-Fourier-transform/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Fibonacci-n-step-number-sequences b/Lang/Run-BASIC/Fibonacci-n-step-number-sequences new file mode 120000 index 0000000000..af8162fbf9 --- /dev/null +++ b/Lang/Run-BASIC/Fibonacci-n-step-number-sequences @@ -0,0 +1 @@ +../../Task/Fibonacci-n-step-number-sequences/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Fibonacci-sequence b/Lang/Run-BASIC/Fibonacci-sequence new file mode 120000 index 0000000000..6be22d3994 --- /dev/null +++ b/Lang/Run-BASIC/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/File-IO b/Lang/Run-BASIC/File-IO new file mode 120000 index 0000000000..6e45dc07fd --- /dev/null +++ b/Lang/Run-BASIC/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/File-modification-time b/Lang/Run-BASIC/File-modification-time new file mode 120000 index 0000000000..d6a97b820d --- /dev/null +++ b/Lang/Run-BASIC/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/File-size b/Lang/Run-BASIC/File-size new file mode 120000 index 0000000000..04728cbcc3 --- /dev/null +++ b/Lang/Run-BASIC/File-size @@ -0,0 +1 @@ +../../Task/File-size/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Filter b/Lang/Run-BASIC/Filter new file mode 120000 index 0000000000..f1d4aca2d0 --- /dev/null +++ b/Lang/Run-BASIC/Filter @@ -0,0 +1 @@ +../../Task/Filter/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Find-common-directory-path b/Lang/Run-BASIC/Find-common-directory-path new file mode 120000 index 0000000000..e54b0d45b5 --- /dev/null +++ b/Lang/Run-BASIC/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Find-limit-of-recursion b/Lang/Run-BASIC/Find-limit-of-recursion new file mode 120000 index 0000000000..61f466abc4 --- /dev/null +++ b/Lang/Run-BASIC/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Find-the-missing-permutation b/Lang/Run-BASIC/Find-the-missing-permutation new file mode 120000 index 0000000000..bde78db025 --- /dev/null +++ b/Lang/Run-BASIC/Find-the-missing-permutation @@ -0,0 +1 @@ +../../Task/Find-the-missing-permutation/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Five-weekends b/Lang/Run-BASIC/Five-weekends new file mode 120000 index 0000000000..78ab4fad41 --- /dev/null +++ b/Lang/Run-BASIC/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/FizzBuzz b/Lang/Run-BASIC/FizzBuzz new file mode 120000 index 0000000000..42435f2d57 --- /dev/null +++ b/Lang/Run-BASIC/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Flatten-a-list b/Lang/Run-BASIC/Flatten-a-list new file mode 120000 index 0000000000..5fa4d8ffbe --- /dev/null +++ b/Lang/Run-BASIC/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Floyds-triangle b/Lang/Run-BASIC/Floyds-triangle new file mode 120000 index 0000000000..8188754d0e --- /dev/null +++ b/Lang/Run-BASIC/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Forest-fire b/Lang/Run-BASIC/Forest-fire new file mode 120000 index 0000000000..f76dbb908c --- /dev/null +++ b/Lang/Run-BASIC/Forest-fire @@ -0,0 +1 @@ +../../Task/Forest-fire/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Fork b/Lang/Run-BASIC/Fork new file mode 120000 index 0000000000..2001a2e6a0 --- /dev/null +++ b/Lang/Run-BASIC/Fork @@ -0,0 +1 @@ +../../Task/Fork/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Formatted-numeric-output b/Lang/Run-BASIC/Formatted-numeric-output new file mode 120000 index 0000000000..9169b1f640 --- /dev/null +++ b/Lang/Run-BASIC/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/GUI-Maximum-window-dimensions b/Lang/Run-BASIC/GUI-Maximum-window-dimensions new file mode 120000 index 0000000000..129827df5a --- /dev/null +++ b/Lang/Run-BASIC/GUI-Maximum-window-dimensions @@ -0,0 +1 @@ +../../Task/GUI-Maximum-window-dimensions/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/GUI-component-interaction b/Lang/Run-BASIC/GUI-component-interaction new file mode 120000 index 0000000000..f98d9b5ae6 --- /dev/null +++ b/Lang/Run-BASIC/GUI-component-interaction @@ -0,0 +1 @@ +../../Task/GUI-component-interaction/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Generic-swap b/Lang/Run-BASIC/Generic-swap new file mode 120000 index 0000000000..4dcddc2b8b --- /dev/null +++ b/Lang/Run-BASIC/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Globally-replace-text-in-several-files b/Lang/Run-BASIC/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..a7bbfc8ace --- /dev/null +++ b/Lang/Run-BASIC/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Greatest-common-divisor b/Lang/Run-BASIC/Greatest-common-divisor new file mode 120000 index 0000000000..1c02197c18 --- /dev/null +++ b/Lang/Run-BASIC/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Greatest-element-of-a-list b/Lang/Run-BASIC/Greatest-element-of-a-list new file mode 120000 index 0000000000..97f429bb5d --- /dev/null +++ b/Lang/Run-BASIC/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Greatest-subsequential-sum b/Lang/Run-BASIC/Greatest-subsequential-sum new file mode 120000 index 0000000000..b2bc68d19d --- /dev/null +++ b/Lang/Run-BASIC/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Greyscale-bars-Display b/Lang/Run-BASIC/Greyscale-bars-Display new file mode 120000 index 0000000000..5e6e95c8ce --- /dev/null +++ b/Lang/Run-BASIC/Greyscale-bars-Display @@ -0,0 +1 @@ +../../Task/Greyscale-bars-Display/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Guess-the-number b/Lang/Run-BASIC/Guess-the-number new file mode 120000 index 0000000000..f95c1b42e6 --- /dev/null +++ b/Lang/Run-BASIC/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/HTTP b/Lang/Run-BASIC/HTTP new file mode 120000 index 0000000000..5bca67720c --- /dev/null +++ b/Lang/Run-BASIC/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/HTTPS-Client-authenticated b/Lang/Run-BASIC/HTTPS-Client-authenticated new file mode 120000 index 0000000000..5626762629 --- /dev/null +++ b/Lang/Run-BASIC/HTTPS-Client-authenticated @@ -0,0 +1 @@ +../../Task/HTTPS-Client-authenticated/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hailstone-sequence b/Lang/Run-BASIC/Hailstone-sequence new file mode 120000 index 0000000000..5a75245ea8 --- /dev/null +++ b/Lang/Run-BASIC/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hamming-numbers b/Lang/Run-BASIC/Hamming-numbers new file mode 120000 index 0000000000..0c40440a63 --- /dev/null +++ b/Lang/Run-BASIC/Hamming-numbers @@ -0,0 +1 @@ +../../Task/Hamming-numbers/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Happy-numbers b/Lang/Run-BASIC/Happy-numbers new file mode 120000 index 0000000000..d88c4893a7 --- /dev/null +++ b/Lang/Run-BASIC/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Harshad-or-Niven-series b/Lang/Run-BASIC/Harshad-or-Niven-series new file mode 120000 index 0000000000..d0bcc2e10a --- /dev/null +++ b/Lang/Run-BASIC/Harshad-or-Niven-series @@ -0,0 +1 @@ +../../Task/Harshad-or-Niven-series/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Haversine-formula b/Lang/Run-BASIC/Haversine-formula new file mode 120000 index 0000000000..0272de7053 --- /dev/null +++ b/Lang/Run-BASIC/Haversine-formula @@ -0,0 +1 @@ +../../Task/Haversine-formula/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hello-world-Graphical b/Lang/Run-BASIC/Hello-world-Graphical new file mode 120000 index 0000000000..bfbb2c9622 --- /dev/null +++ b/Lang/Run-BASIC/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hello-world-Line-printer b/Lang/Run-BASIC/Hello-world-Line-printer new file mode 120000 index 0000000000..bff07d7ed9 --- /dev/null +++ b/Lang/Run-BASIC/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hello-world-Standard-error b/Lang/Run-BASIC/Hello-world-Standard-error new file mode 120000 index 0000000000..1c3851bf7d --- /dev/null +++ b/Lang/Run-BASIC/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hello-world-Text b/Lang/Run-BASIC/Hello-world-Text new file mode 120000 index 0000000000..b0f0539439 --- /dev/null +++ b/Lang/Run-BASIC/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hello-world-Web-server b/Lang/Run-BASIC/Hello-world-Web-server new file mode 120000 index 0000000000..8abd046b2d --- /dev/null +++ b/Lang/Run-BASIC/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Here-document b/Lang/Run-BASIC/Here-document new file mode 120000 index 0000000000..8d69cfdca5 --- /dev/null +++ b/Lang/Run-BASIC/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hofstadter-Conway-$10,000-sequence b/Lang/Run-BASIC/Hofstadter-Conway-$10,000-sequence new file mode 120000 index 0000000000..604971ca38 --- /dev/null +++ b/Lang/Run-BASIC/Hofstadter-Conway-$10,000-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Conway-$10,000-sequence/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Horizontal-sundial-calculations b/Lang/Run-BASIC/Horizontal-sundial-calculations new file mode 120000 index 0000000000..094c9b6e21 --- /dev/null +++ b/Lang/Run-BASIC/Horizontal-sundial-calculations @@ -0,0 +1 @@ +../../Task/Horizontal-sundial-calculations/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Horners-rule-for-polynomial-evaluation b/Lang/Run-BASIC/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..99a1f37976 --- /dev/null +++ b/Lang/Run-BASIC/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Hostname b/Lang/Run-BASIC/Hostname new file mode 120000 index 0000000000..1c63dacefc --- /dev/null +++ b/Lang/Run-BASIC/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Identity-matrix b/Lang/Run-BASIC/Identity-matrix new file mode 120000 index 0000000000..c27509e419 --- /dev/null +++ b/Lang/Run-BASIC/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Image-noise b/Lang/Run-BASIC/Image-noise new file mode 120000 index 0000000000..584d434c50 --- /dev/null +++ b/Lang/Run-BASIC/Image-noise @@ -0,0 +1 @@ +../../Task/Image-noise/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Include-a-file b/Lang/Run-BASIC/Include-a-file new file mode 120000 index 0000000000..f38433b166 --- /dev/null +++ b/Lang/Run-BASIC/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Increment-a-numerical-string b/Lang/Run-BASIC/Increment-a-numerical-string new file mode 120000 index 0000000000..f15c8f63c1 --- /dev/null +++ b/Lang/Run-BASIC/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Input-loop b/Lang/Run-BASIC/Input-loop new file mode 120000 index 0000000000..cc764ad0e9 --- /dev/null +++ b/Lang/Run-BASIC/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Integer-comparison b/Lang/Run-BASIC/Integer-comparison new file mode 120000 index 0000000000..5245df16a1 --- /dev/null +++ b/Lang/Run-BASIC/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Integer-sequence b/Lang/Run-BASIC/Integer-sequence new file mode 120000 index 0000000000..2c5a33418f --- /dev/null +++ b/Lang/Run-BASIC/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Kaprekar-numbers b/Lang/Run-BASIC/Kaprekar-numbers new file mode 120000 index 0000000000..0ea1ea01bc --- /dev/null +++ b/Lang/Run-BASIC/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Run-BASIC/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..28b2c5b981 --- /dev/null +++ b/Lang/Run-BASIC/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Knapsack-problem-Continuous b/Lang/Run-BASIC/Knapsack-problem-Continuous new file mode 120000 index 0000000000..f2277726b5 --- /dev/null +++ b/Lang/Run-BASIC/Knapsack-problem-Continuous @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Continuous/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Knuth-shuffle b/Lang/Run-BASIC/Knuth-shuffle new file mode 120000 index 0000000000..e7d0267f8d --- /dev/null +++ b/Lang/Run-BASIC/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Langtons-ant b/Lang/Run-BASIC/Langtons-ant new file mode 120000 index 0000000000..fe40085945 --- /dev/null +++ b/Lang/Run-BASIC/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Largest-int-from-concatenated-ints b/Lang/Run-BASIC/Largest-int-from-concatenated-ints new file mode 120000 index 0000000000..14b4079800 --- /dev/null +++ b/Lang/Run-BASIC/Largest-int-from-concatenated-ints @@ -0,0 +1 @@ +../../Task/Largest-int-from-concatenated-ints/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Last-Friday-of-each-month b/Lang/Run-BASIC/Last-Friday-of-each-month new file mode 120000 index 0000000000..dead3af1c6 --- /dev/null +++ b/Lang/Run-BASIC/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Leap-year b/Lang/Run-BASIC/Leap-year new file mode 120000 index 0000000000..9221429d1c --- /dev/null +++ b/Lang/Run-BASIC/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Least-common-multiple b/Lang/Run-BASIC/Least-common-multiple new file mode 120000 index 0000000000..605942c48d --- /dev/null +++ b/Lang/Run-BASIC/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Letter-frequency b/Lang/Run-BASIC/Letter-frequency new file mode 120000 index 0000000000..598ff10a58 --- /dev/null +++ b/Lang/Run-BASIC/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Levenshtein-distance b/Lang/Run-BASIC/Levenshtein-distance new file mode 120000 index 0000000000..195ed6d045 --- /dev/null +++ b/Lang/Run-BASIC/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/List-comprehensions b/Lang/Run-BASIC/List-comprehensions new file mode 120000 index 0000000000..cd9419602a --- /dev/null +++ b/Lang/Run-BASIC/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Long-multiplication b/Lang/Run-BASIC/Long-multiplication new file mode 120000 index 0000000000..2985d7ba61 --- /dev/null +++ b/Lang/Run-BASIC/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Longest-common-subsequence b/Lang/Run-BASIC/Longest-common-subsequence new file mode 120000 index 0000000000..2a9893c4a4 --- /dev/null +++ b/Lang/Run-BASIC/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Longest-string-challenge b/Lang/Run-BASIC/Longest-string-challenge new file mode 120000 index 0000000000..043ac245cd --- /dev/null +++ b/Lang/Run-BASIC/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Loop-over-multiple-arrays-simultaneously b/Lang/Run-BASIC/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..c3f5c4495f --- /dev/null +++ b/Lang/Run-BASIC/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Loops-Continue b/Lang/Run-BASIC/Loops-Continue new file mode 120000 index 0000000000..a1fabfaed1 --- /dev/null +++ b/Lang/Run-BASIC/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Loops-For-with-a-specified-step b/Lang/Run-BASIC/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..f4dab07669 --- /dev/null +++ b/Lang/Run-BASIC/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Loops-Foreach b/Lang/Run-BASIC/Loops-Foreach new file mode 120000 index 0000000000..e239698800 --- /dev/null +++ b/Lang/Run-BASIC/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Loops-Infinite b/Lang/Run-BASIC/Loops-Infinite new file mode 120000 index 0000000000..55f90ac540 --- /dev/null +++ b/Lang/Run-BASIC/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Loops-Nested b/Lang/Run-BASIC/Loops-Nested new file mode 120000 index 0000000000..e80cdaef0f --- /dev/null +++ b/Lang/Run-BASIC/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Loops-While b/Lang/Run-BASIC/Loops-While new file mode 120000 index 0000000000..ca0f21e5d7 --- /dev/null +++ b/Lang/Run-BASIC/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Luhn-test-of-credit-card-numbers b/Lang/Run-BASIC/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..562ff95845 --- /dev/null +++ b/Lang/Run-BASIC/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Mad-Libs b/Lang/Run-BASIC/Mad-Libs new file mode 120000 index 0000000000..27c6417afe --- /dev/null +++ b/Lang/Run-BASIC/Mad-Libs @@ -0,0 +1 @@ +../../Task/Mad-Libs/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Matrix-transposition b/Lang/Run-BASIC/Matrix-transposition new file mode 120000 index 0000000000..c4ff119c12 --- /dev/null +++ b/Lang/Run-BASIC/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Menu b/Lang/Run-BASIC/Menu new file mode 120000 index 0000000000..1b5bcd7cee --- /dev/null +++ b/Lang/Run-BASIC/Menu @@ -0,0 +1 @@ +../../Task/Menu/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Metaprogramming b/Lang/Run-BASIC/Metaprogramming new file mode 120000 index 0000000000..5c7983e01a --- /dev/null +++ b/Lang/Run-BASIC/Metaprogramming @@ -0,0 +1 @@ +../../Task/Metaprogramming/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Middle-three-digits b/Lang/Run-BASIC/Middle-three-digits new file mode 120000 index 0000000000..213f96d558 --- /dev/null +++ b/Lang/Run-BASIC/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Miller-Rabin-primality-test b/Lang/Run-BASIC/Miller-Rabin-primality-test new file mode 120000 index 0000000000..13b7319b57 --- /dev/null +++ b/Lang/Run-BASIC/Miller-Rabin-primality-test @@ -0,0 +1 @@ +../../Task/Miller-Rabin-primality-test/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Modular-inverse b/Lang/Run-BASIC/Modular-inverse new file mode 120000 index 0000000000..b805e5f6e7 --- /dev/null +++ b/Lang/Run-BASIC/Modular-inverse @@ -0,0 +1 @@ +../../Task/Modular-inverse/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Monty-Hall-problem b/Lang/Run-BASIC/Monty-Hall-problem new file mode 120000 index 0000000000..de9f5d7122 --- /dev/null +++ b/Lang/Run-BASIC/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Multisplit b/Lang/Run-BASIC/Multisplit new file mode 120000 index 0000000000..ea4c1efc39 --- /dev/null +++ b/Lang/Run-BASIC/Multisplit @@ -0,0 +1 @@ +../../Task/Multisplit/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Mutual-recursion b/Lang/Run-BASIC/Mutual-recursion new file mode 120000 index 0000000000..98431dc94f --- /dev/null +++ b/Lang/Run-BASIC/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Ordered-words b/Lang/Run-BASIC/Ordered-words new file mode 120000 index 0000000000..f85bfc32d9 --- /dev/null +++ b/Lang/Run-BASIC/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/Run-BASIC \ No newline at end of file diff --git a/Lang/Run-BASIC/Search-a-list b/Lang/Run-BASIC/Search-a-list new file mode 120000 index 0000000000..c69a56e6ed --- /dev/null +++ b/Lang/Run-BASIC/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Run-BASIC \ No newline at end of file diff --git a/Lang/Rust/0DESCRIPTION b/Lang/Rust/0DESCRIPTION new file mode 100644 index 0000000000..426fc3c260 --- /dev/null +++ b/Lang/Rust/0DESCRIPTION @@ -0,0 +1,9 @@ +{{stub}}{{language +|checking=static +|strength=strong +|express=implicit +|compat=structural +|gc=allowed +|exec=machine +|safety=safe +|site=http://www.rust-lang.org}} \ No newline at end of file diff --git a/Lang/Rust/100-doors b/Lang/Rust/100-doors new file mode 120000 index 0000000000..110ff7c778 --- /dev/null +++ b/Lang/Rust/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Rust \ No newline at end of file diff --git a/Lang/Rust/Fibonacci-sequence b/Lang/Rust/Fibonacci-sequence new file mode 120000 index 0000000000..0556887ef4 --- /dev/null +++ b/Lang/Rust/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Rust \ No newline at end of file diff --git a/Lang/Rust/FizzBuzz b/Lang/Rust/FizzBuzz new file mode 120000 index 0000000000..f8d31f1436 --- /dev/null +++ b/Lang/Rust/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Rust \ No newline at end of file diff --git a/Lang/Rust/Greatest-common-divisor b/Lang/Rust/Greatest-common-divisor new file mode 120000 index 0000000000..6487137ff6 --- /dev/null +++ b/Lang/Rust/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Rust \ No newline at end of file diff --git a/Lang/Rust/Hello-world-Text b/Lang/Rust/Hello-world-Text new file mode 120000 index 0000000000..195e253a57 --- /dev/null +++ b/Lang/Rust/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Rust \ No newline at end of file diff --git a/Lang/Rust/Horners-rule-for-polynomial-evaluation b/Lang/Rust/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..dfb013c72a --- /dev/null +++ b/Lang/Rust/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Rust \ No newline at end of file diff --git a/Lang/Rust/Middle-three-digits b/Lang/Rust/Middle-three-digits new file mode 120000 index 0000000000..da825fca24 --- /dev/null +++ b/Lang/Rust/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/Rust \ No newline at end of file diff --git a/Lang/Rust/Ordered-words b/Lang/Rust/Ordered-words new file mode 120000 index 0000000000..a4fd359076 --- /dev/null +++ b/Lang/Rust/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/Rust \ No newline at end of file diff --git a/Lang/S-lang/0DESCRIPTION b/Lang/S-lang/0DESCRIPTION new file mode 100644 index 0000000000..5da579aa67 --- /dev/null +++ b/Lang/S-lang/0DESCRIPTION @@ -0,0 +1,13 @@ +{{stub}} +{{language +|site=http://www.jedsoft.org/slang/ +|checking=dynamic +}} +S-Lang is a multi-platform programmer's library designed to allow a developer to create robust multi-platform software. It provides facilities required by interactive applications such as display/screen management, keyboard input, keymaps, and so on. The most exciting feature of the library is the slang interpreter that may be easily embedded into a program to make it extensible. While the emphasis has always been on the embedded nature of the interpreter, it may also be used in a stand-alone fashion through the use of slsh, which is part of the S-Lang distribution. + +Unlike many interpreters, the S-Lang interpreter supports all of the native C integer types (signed and unsigned versions of char, short, int, long, and long long), and both single and double precision types, as well as a double precision complex type. Other data types supported by the interpreter include strings, lists, associative arrays (hashes), user-defined structures, and multi-dimensional arrays of any data-type. + +The S-Lang interpreter has very strong support for array-based operations making it ideal for numerical applications. (from [http://www.jedsoft.org/slang/ the official web site]]) + +== See Also == +[[wp:S-Lang_(programming_language)|Wikipedia:S-Lang(programming language)]] \ No newline at end of file diff --git a/Lang/S-lang/100-doors b/Lang/S-lang/100-doors new file mode 120000 index 0000000000..2b98b2f2f4 --- /dev/null +++ b/Lang/S-lang/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/S-lang \ No newline at end of file diff --git a/Lang/S-lang/Flatten-a-list b/Lang/S-lang/Flatten-a-list new file mode 120000 index 0000000000..cefb794ef4 --- /dev/null +++ b/Lang/S-lang/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/S-lang \ No newline at end of file diff --git a/Lang/SAS/0DESCRIPTION b/Lang/SAS/0DESCRIPTION new file mode 100644 index 0000000000..e01909eae8 --- /dev/null +++ b/Lang/SAS/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language|SAS +|site=http://www.sas.com/ +|LCT=no +}} +{{implementation|SQL}}{{stub}} + +SAS is a [[proprietary]] statistical analysis language. \ No newline at end of file diff --git a/Lang/SAS/100-doors b/Lang/SAS/100-doors new file mode 120000 index 0000000000..4e02784617 --- /dev/null +++ b/Lang/SAS/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/SAS \ No newline at end of file diff --git a/Lang/SAS/Bitwise-operations b/Lang/SAS/Bitwise-operations new file mode 120000 index 0000000000..6ece79c927 --- /dev/null +++ b/Lang/SAS/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/SAS \ No newline at end of file diff --git a/Lang/SAS/Comments b/Lang/SAS/Comments new file mode 120000 index 0000000000..a7ea6ae43a --- /dev/null +++ b/Lang/SAS/Comments @@ -0,0 +1 @@ +../../Task/Comments/SAS \ No newline at end of file diff --git a/Lang/SAS/Day-of-the-week b/Lang/SAS/Day-of-the-week new file mode 120000 index 0000000000..ac954b376e --- /dev/null +++ b/Lang/SAS/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/SAS \ No newline at end of file diff --git a/Lang/SAS/Fibonacci-sequence b/Lang/SAS/Fibonacci-sequence new file mode 120000 index 0000000000..7e20ee4647 --- /dev/null +++ b/Lang/SAS/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/SAS \ No newline at end of file diff --git a/Lang/SAS/Flow-control-structures b/Lang/SAS/Flow-control-structures new file mode 120000 index 0000000000..736cd94bb9 --- /dev/null +++ b/Lang/SAS/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/SAS \ No newline at end of file diff --git a/Lang/SAS/Hello-world-Text b/Lang/SAS/Hello-world-Text new file mode 120000 index 0000000000..bdb374eaa4 --- /dev/null +++ b/Lang/SAS/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/SAS \ No newline at end of file diff --git a/Lang/SAS/Integer-comparison b/Lang/SAS/Integer-comparison new file mode 120000 index 0000000000..a34c2af0b1 --- /dev/null +++ b/Lang/SAS/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/SAS \ No newline at end of file diff --git a/Lang/SAS/Knapsack-problem-Unbounded b/Lang/SAS/Knapsack-problem-Unbounded new file mode 120000 index 0000000000..392916e922 --- /dev/null +++ b/Lang/SAS/Knapsack-problem-Unbounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Unbounded/SAS \ No newline at end of file diff --git a/Lang/SAS/Loops-Break b/Lang/SAS/Loops-Break new file mode 120000 index 0000000000..61116585f3 --- /dev/null +++ b/Lang/SAS/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/SAS \ No newline at end of file diff --git a/Lang/SAS/Loops-Do-while b/Lang/SAS/Loops-Do-while new file mode 120000 index 0000000000..258ec7a000 --- /dev/null +++ b/Lang/SAS/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/SAS \ No newline at end of file diff --git a/Lang/SAS/Loops-For b/Lang/SAS/Loops-For new file mode 120000 index 0000000000..1a478c965b --- /dev/null +++ b/Lang/SAS/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/SAS \ No newline at end of file diff --git a/Lang/SAS/Loops-For-with-a-specified-step b/Lang/SAS/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..9213e57a32 --- /dev/null +++ b/Lang/SAS/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/SAS \ No newline at end of file diff --git a/Lang/SAS/Loops-Foreach b/Lang/SAS/Loops-Foreach new file mode 120000 index 0000000000..344cf9d955 --- /dev/null +++ b/Lang/SAS/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/SAS \ No newline at end of file diff --git a/Lang/SAS/Loops-While b/Lang/SAS/Loops-While new file mode 120000 index 0000000000..018765ddf4 --- /dev/null +++ b/Lang/SAS/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/SAS \ No newline at end of file diff --git a/Lang/SETL/0DESCRIPTION b/Lang/SETL/0DESCRIPTION new file mode 100644 index 0000000000..11dc465c5e --- /dev/null +++ b/Lang/SETL/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language|SETL +|site=http://setl.org/setl/ +}}'''SETL''' (SET Language) developed by [[Jack Schwartz]] at the New York University Courant Institute of Mathematical Sciences in the 1969. + +SETL is the ancestor of [[ABC]]. + +The first [[Ada]] compiler was written in SETL. \ No newline at end of file diff --git a/Lang/SETL/100-doors b/Lang/SETL/100-doors new file mode 120000 index 0000000000..2002534d33 --- /dev/null +++ b/Lang/SETL/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/SETL \ No newline at end of file diff --git a/Lang/SETL/Ackermann-function b/Lang/SETL/Ackermann-function new file mode 120000 index 0000000000..e5d4b61bc9 --- /dev/null +++ b/Lang/SETL/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/SETL \ No newline at end of file diff --git a/Lang/SETL/Anagrams b/Lang/SETL/Anagrams new file mode 120000 index 0000000000..3f0c116b9b --- /dev/null +++ b/Lang/SETL/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/SETL \ No newline at end of file diff --git a/Lang/SETL/Combinations b/Lang/SETL/Combinations new file mode 120000 index 0000000000..eb98ff45db --- /dev/null +++ b/Lang/SETL/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/SETL \ No newline at end of file diff --git a/Lang/SETL/Conways-Game-of-Life b/Lang/SETL/Conways-Game-of-Life new file mode 120000 index 0000000000..ed1b884c97 --- /dev/null +++ b/Lang/SETL/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/SETL \ No newline at end of file diff --git a/Lang/SETL/Greatest-common-divisor b/Lang/SETL/Greatest-common-divisor new file mode 120000 index 0000000000..38b1a4547d --- /dev/null +++ b/Lang/SETL/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/SETL \ No newline at end of file diff --git a/Lang/SETL/Happy-numbers b/Lang/SETL/Happy-numbers new file mode 120000 index 0000000000..6434dcd91c --- /dev/null +++ b/Lang/SETL/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/SETL \ No newline at end of file diff --git a/Lang/SETL/Huffman-coding b/Lang/SETL/Huffman-coding new file mode 120000 index 0000000000..063a7cbb96 --- /dev/null +++ b/Lang/SETL/Huffman-coding @@ -0,0 +1 @@ +../../Task/Huffman-coding/SETL \ No newline at end of file diff --git a/Lang/SETL/Longest-common-subsequence b/Lang/SETL/Longest-common-subsequence new file mode 120000 index 0000000000..6db514f9bc --- /dev/null +++ b/Lang/SETL/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/SETL \ No newline at end of file diff --git a/Lang/SIMPOL/0DESCRIPTION b/Lang/SIMPOL/0DESCRIPTION new file mode 100644 index 0000000000..d835d3adcd --- /dev/null +++ b/Lang/SIMPOL/0DESCRIPTION @@ -0,0 +1,16 @@ +{{language|SIMPOL +|site=http://www.simpol.com +|LCT=no +}} +SIMPOL is an [[object-oriented]], [[reflective programming]], and [[functional programming]] language that can be used for both general purpose and database-oriented programming. + +It comes as a core library with various loaders for console, CGI, and GUI-style programs. It is component-based, so only the required components need be shipped with a program. + +SIMPOL also comes with its own single- and multi-user database engines that share a common storage format. + +The language itself has a very small keyword set and a small set of operators. It has built-in support for the value NULL (.nul) and infinity (.inf). + +There are some interesting quirks in the language, especially with the operators. For example, strings can be not only added (concatenated), they can be used with the the unary minus, subtraction, and multiplication operators. + +Programs are developed and debugged using a Windows-based IDE and a set of RAD tools for creating databases and forms. Resulting programs are compiled to a cross-platform byte code that is executed using the SIMPOL runtime environment. +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/SIMPOL/Arbitrary-precision-integers-included b/Lang/SIMPOL/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..975a0231cc --- /dev/null +++ b/Lang/SIMPOL/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/SIMPOL \ No newline at end of file diff --git a/Lang/SIMPOL/Compound-data-type b/Lang/SIMPOL/Compound-data-type new file mode 120000 index 0000000000..6d1b7eee1b --- /dev/null +++ b/Lang/SIMPOL/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/SIMPOL \ No newline at end of file diff --git a/Lang/SIMPOL/Conditional-structures b/Lang/SIMPOL/Conditional-structures new file mode 120000 index 0000000000..726c9b1940 --- /dev/null +++ b/Lang/SIMPOL/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/SIMPOL \ No newline at end of file diff --git a/Lang/SIMPOL/Hello-world-Text b/Lang/SIMPOL/Hello-world-Text new file mode 120000 index 0000000000..684e6f948a --- /dev/null +++ b/Lang/SIMPOL/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/SIMPOL \ No newline at end of file diff --git a/Lang/SIMPOL/Letter-frequency b/Lang/SIMPOL/Letter-frequency new file mode 120000 index 0000000000..8dd1656ee9 --- /dev/null +++ b/Lang/SIMPOL/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/SIMPOL \ No newline at end of file diff --git a/Lang/SMEQL/0DESCRIPTION b/Lang/SMEQL/0DESCRIPTION new file mode 100644 index 0000000000..546cd475d0 --- /dev/null +++ b/Lang/SMEQL/0DESCRIPTION @@ -0,0 +1,57 @@ +{{language|SMEQL +|site=http://www.c2.com/cgi/wiki?TqlRoadmap +|LCT=no +}} + +SMEQL is a draft query language that is meant to solve the shortcomings and annoyances of [[SQL]]. SMEQL stands for "structured meta-enabled query language" (pronounced "smeegle"). + +It is influenced by IBM's "Business-System 12" (BS-12) relational query language. BS-12 predated SQL, but was rejected over SQL because IBM felt it was too "mathy", potentially harming sales. However, it's math-like nature is also what makes it more powerful than SQL. It's designed to please nerds, not managers. (It uses "functional programming" to be more specific.) + +The general syntax of an element is: + + resultTable = operation(parameters.....) + +One can optionally nest these: + + t1 = foo(blah) + t2 = bar(t1, zog) + +to get this: + + t2 = bar(foo(blah), zog) + +The final result set name is not needed. Thus, one could type: + + bar(foo(blah), zog) + +However, examples here will not use the nested form. The intermediate tables should be considered virtual tables. They are not assumed to be "saved" unless explicitly requested by other operations. They are merely a way to linguistically reference query "chunks". (SQL provides views and/or nested SELECT's for a similar purpose, but these are often awkward or require DBA's.) + +Here is a sample to whet your appitite: + + srt = orderBy(Employees, [dept, salary], order) + top = group(srt, [(dept) dept2, max(order) order]) + join(srt, top, a.dept=b.dept2 and b.order - a.order < 6) + +This example returns the top 6 earners in each department based on +this table schema: + + table: Employees + ---------------- + empID + dept + empName + salary + +Here's a brief summary of common SMEQL operators: + +* '''calc'''(table, columnTable) // ''similar to SELECT clause in SQL'' +* '''filter'''(table, expression) // ''similar to WHERE clause in SQL'' +* '''group'''(table, columnTable) // ''roughly similar to GROUP BY in SQL'' +* '''join'''(table_1, table_2, expression) +* '''leftJoin'''(table_1, table_2, expression) +* '''orderBy'''(table, columnTable, [sequenceColumn]) // ''sorts or produces sequence numbers'' +* '''union'''(table_1, table_2) + +A "column table" is merely a way to represent or store column information in tabular form. SMEQL provides a shortcut syntax that is similar to an SQL "WHERE" clause. Any place above where a column-table is required, one can use the shortcut syntax within square brackets "[...]" (not to be confused with "optional" syntax indicators). Column tables potentially allow you to "calculate" column lists instead of having to type them in manually. + +More info can be found at: http://www.c2.com/cgi/wiki?TqlRoadmap \ No newline at end of file diff --git a/Lang/SNOBOL4/0DESCRIPTION b/Lang/SNOBOL4/0DESCRIPTION new file mode 100644 index 0000000000..c905e459d3 --- /dev/null +++ b/Lang/SNOBOL4/0DESCRIPTION @@ -0,0 +1,15 @@ +{{language +|site=http://www.snobol4.org/ +|gc=yes}} +SNOBOL4 (StriNg Oriented and symBOlic Language) is a language for text processing, pattern matching, and much more, first designed and implemented at [[Bell Labs|Bell Telephone Laboratories, Inc.]] (BTL) in the 1970's. + +SNOBOL4, while known primarily as a string language excels at any task involving symbolic manipulations. It provides run time typing, garbage collection, user data types, on the fly compilation. The language has a simple and highly orthogonal syntax, making it easy to learn. + +A later implementation, developed by Robert B. K. Dewar and called "SPITBOL", added several major enhancements to the language, which include providing several structured programming type concepts but without requiring traditional keywords. These so-called "SPITBOL extensions" have since been retrofitted into most modern implementations of SNOBOL4 as well. + +The use of the code() built-in function (which takes source code as input and returns executable code) combined with user-defined datatypes (implemented using the data() built-in function), provides the ability to rather easily implement many object-oriented techniques, including what are essentially constructors and methods (although this terminology evolved after SNOBOL4 and SPITBOL). + +CSnobol4 [ftp://ftp.snobol4.org/snobol sources] and [ftp://ftp.snobol4.org/snobol/win32/1.2/ Win32 binary] + +Above also included in Rafal M. Sulejman's [http://rms.republika.pl/slide.shtml TkS*LIDE SNOBOL4 IDE] +[[File:Tkslide.png]] \ No newline at end of file diff --git a/Lang/SNOBOL4/100-doors b/Lang/SNOBOL4/100-doors new file mode 120000 index 0000000000..b7bfc88bcb --- /dev/null +++ b/Lang/SNOBOL4/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/99-Bottles-of-Beer b/Lang/SNOBOL4/99-Bottles-of-Beer new file mode 120000 index 0000000000..1fde70cee6 --- /dev/null +++ b/Lang/SNOBOL4/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/A+B b/Lang/SNOBOL4/A+B new file mode 120000 index 0000000000..270d76e512 --- /dev/null +++ b/Lang/SNOBOL4/A+B @@ -0,0 +1 @@ +../../Task/A+B/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Ackermann-function b/Lang/SNOBOL4/Ackermann-function new file mode 120000 index 0000000000..12c26571b8 --- /dev/null +++ b/Lang/SNOBOL4/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Anagrams b/Lang/SNOBOL4/Anagrams new file mode 120000 index 0000000000..73dbb27932 --- /dev/null +++ b/Lang/SNOBOL4/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Arithmetic-Complex b/Lang/SNOBOL4/Arithmetic-Complex new file mode 120000 index 0000000000..a6120bf8ce --- /dev/null +++ b/Lang/SNOBOL4/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Arithmetic-Integer b/Lang/SNOBOL4/Arithmetic-Integer new file mode 120000 index 0000000000..326750011a --- /dev/null +++ b/Lang/SNOBOL4/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Array-concatenation b/Lang/SNOBOL4/Array-concatenation new file mode 120000 index 0000000000..90d1099503 --- /dev/null +++ b/Lang/SNOBOL4/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Associative-array-Creation b/Lang/SNOBOL4/Associative-array-Creation new file mode 120000 index 0000000000..ccc0dc37bb --- /dev/null +++ b/Lang/SNOBOL4/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Associative-array-Iteration b/Lang/SNOBOL4/Associative-array-Iteration new file mode 120000 index 0000000000..c6ba35ef60 --- /dev/null +++ b/Lang/SNOBOL4/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Averages-Arithmetic-mean b/Lang/SNOBOL4/Averages-Arithmetic-mean new file mode 120000 index 0000000000..741dfe921c --- /dev/null +++ b/Lang/SNOBOL4/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Averages-Root-mean-square b/Lang/SNOBOL4/Averages-Root-mean-square new file mode 120000 index 0000000000..9ca8e8b2e6 --- /dev/null +++ b/Lang/SNOBOL4/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Character-codes b/Lang/SNOBOL4/Character-codes new file mode 120000 index 0000000000..b1595a84ac --- /dev/null +++ b/Lang/SNOBOL4/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Comments b/Lang/SNOBOL4/Comments new file mode 120000 index 0000000000..9188684958 --- /dev/null +++ b/Lang/SNOBOL4/Comments @@ -0,0 +1 @@ +../../Task/Comments/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Compound-data-type b/Lang/SNOBOL4/Compound-data-type new file mode 120000 index 0000000000..feb02426d5 --- /dev/null +++ b/Lang/SNOBOL4/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Conditional-structures b/Lang/SNOBOL4/Conditional-structures new file mode 120000 index 0000000000..7f31023d85 --- /dev/null +++ b/Lang/SNOBOL4/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Count-occurrences-of-a-substring b/Lang/SNOBOL4/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..0a4679aca3 --- /dev/null +++ b/Lang/SNOBOL4/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Create-a-file b/Lang/SNOBOL4/Create-a-file new file mode 120000 index 0000000000..4a9fa56d84 --- /dev/null +++ b/Lang/SNOBOL4/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Create-a-two-dimensional-array-at-runtime b/Lang/SNOBOL4/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..5f5bbbe779 --- /dev/null +++ b/Lang/SNOBOL4/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Detect-division-by-zero b/Lang/SNOBOL4/Detect-division-by-zero new file mode 120000 index 0000000000..a3f17e6cfc --- /dev/null +++ b/Lang/SNOBOL4/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Determine-if-a-string-is-numeric b/Lang/SNOBOL4/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..c2f124648d --- /dev/null +++ b/Lang/SNOBOL4/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Dot-product b/Lang/SNOBOL4/Dot-product new file mode 120000 index 0000000000..6258c3413d --- /dev/null +++ b/Lang/SNOBOL4/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Dynamic-variable-names b/Lang/SNOBOL4/Dynamic-variable-names new file mode 120000 index 0000000000..d9f910603b --- /dev/null +++ b/Lang/SNOBOL4/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Empty-program b/Lang/SNOBOL4/Empty-program new file mode 120000 index 0000000000..f417ecf658 --- /dev/null +++ b/Lang/SNOBOL4/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Ethiopian-multiplication b/Lang/SNOBOL4/Ethiopian-multiplication new file mode 120000 index 0000000000..454a78b172 --- /dev/null +++ b/Lang/SNOBOL4/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Factorial b/Lang/SNOBOL4/Factorial new file mode 120000 index 0000000000..05f7dc9068 --- /dev/null +++ b/Lang/SNOBOL4/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Fibonacci-sequence b/Lang/SNOBOL4/Fibonacci-sequence new file mode 120000 index 0000000000..6deb8e6e5b --- /dev/null +++ b/Lang/SNOBOL4/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/File-IO b/Lang/SNOBOL4/File-IO new file mode 120000 index 0000000000..b4358a349a --- /dev/null +++ b/Lang/SNOBOL4/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/FizzBuzz b/Lang/SNOBOL4/FizzBuzz new file mode 120000 index 0000000000..42dbfe61ae --- /dev/null +++ b/Lang/SNOBOL4/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Function-definition b/Lang/SNOBOL4/Function-definition new file mode 120000 index 0000000000..499c473941 --- /dev/null +++ b/Lang/SNOBOL4/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Generic-swap b/Lang/SNOBOL4/Generic-swap new file mode 120000 index 0000000000..7b2970b0ee --- /dev/null +++ b/Lang/SNOBOL4/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Greatest-common-divisor b/Lang/SNOBOL4/Greatest-common-divisor new file mode 120000 index 0000000000..aae979ab94 --- /dev/null +++ b/Lang/SNOBOL4/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Greatest-element-of-a-list b/Lang/SNOBOL4/Greatest-element-of-a-list new file mode 120000 index 0000000000..93544d36cd --- /dev/null +++ b/Lang/SNOBOL4/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/HTTP b/Lang/SNOBOL4/HTTP new file mode 120000 index 0000000000..ed6d480664 --- /dev/null +++ b/Lang/SNOBOL4/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Hash-from-two-arrays b/Lang/SNOBOL4/Hash-from-two-arrays new file mode 120000 index 0000000000..7bd45175bf --- /dev/null +++ b/Lang/SNOBOL4/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Hello-world-Line-printer b/Lang/SNOBOL4/Hello-world-Line-printer new file mode 120000 index 0000000000..ef0d94d043 --- /dev/null +++ b/Lang/SNOBOL4/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Hello-world-Standard-error b/Lang/SNOBOL4/Hello-world-Standard-error new file mode 120000 index 0000000000..edb8af3fb0 --- /dev/null +++ b/Lang/SNOBOL4/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Hello-world-Text b/Lang/SNOBOL4/Hello-world-Text new file mode 120000 index 0000000000..0a69712477 --- /dev/null +++ b/Lang/SNOBOL4/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Hostname b/Lang/SNOBOL4/Hostname new file mode 120000 index 0000000000..6a58f723da --- /dev/null +++ b/Lang/SNOBOL4/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Increment-a-numerical-string b/Lang/SNOBOL4/Increment-a-numerical-string new file mode 120000 index 0000000000..1aebcc3aae --- /dev/null +++ b/Lang/SNOBOL4/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Input-loop b/Lang/SNOBOL4/Input-loop new file mode 120000 index 0000000000..c693bace87 --- /dev/null +++ b/Lang/SNOBOL4/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Integer-comparison b/Lang/SNOBOL4/Integer-comparison new file mode 120000 index 0000000000..903bb6934a --- /dev/null +++ b/Lang/SNOBOL4/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Knuth-shuffle b/Lang/SNOBOL4/Knuth-shuffle new file mode 120000 index 0000000000..a12b7f8e9d --- /dev/null +++ b/Lang/SNOBOL4/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Leap-year b/Lang/SNOBOL4/Leap-year new file mode 120000 index 0000000000..fd1c1dd431 --- /dev/null +++ b/Lang/SNOBOL4/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Look-and-say-sequence b/Lang/SNOBOL4/Look-and-say-sequence new file mode 120000 index 0000000000..b438c32c8c --- /dev/null +++ b/Lang/SNOBOL4/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Loops-Break b/Lang/SNOBOL4/Loops-Break new file mode 120000 index 0000000000..75805b647d --- /dev/null +++ b/Lang/SNOBOL4/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Loops-For b/Lang/SNOBOL4/Loops-For new file mode 120000 index 0000000000..0bbb69615d --- /dev/null +++ b/Lang/SNOBOL4/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Loops-Infinite b/Lang/SNOBOL4/Loops-Infinite new file mode 120000 index 0000000000..d09a7d5da6 --- /dev/null +++ b/Lang/SNOBOL4/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Loops-N-plus-one-half b/Lang/SNOBOL4/Loops-N-plus-one-half new file mode 120000 index 0000000000..505354efae --- /dev/null +++ b/Lang/SNOBOL4/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Luhn-test-of-credit-card-numbers b/Lang/SNOBOL4/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..c5b09d385a --- /dev/null +++ b/Lang/SNOBOL4/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Memory-allocation b/Lang/SNOBOL4/Memory-allocation new file mode 120000 index 0000000000..367ae8925a --- /dev/null +++ b/Lang/SNOBOL4/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Metaprogramming b/Lang/SNOBOL4/Metaprogramming new file mode 120000 index 0000000000..325193ae61 --- /dev/null +++ b/Lang/SNOBOL4/Metaprogramming @@ -0,0 +1 @@ +../../Task/Metaprogramming/SNOBOL4 \ No newline at end of file diff --git a/Lang/SNOBOL4/Mutual-recursion b/Lang/SNOBOL4/Mutual-recursion new file mode 120000 index 0000000000..a5f3a436ef --- /dev/null +++ b/Lang/SNOBOL4/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/SNOBOL4 \ No newline at end of file diff --git a/Lang/SPARC-Assembly/0DESCRIPTION b/Lang/SPARC-Assembly/0DESCRIPTION new file mode 100644 index 0000000000..95309450b0 --- /dev/null +++ b/Lang/SPARC-Assembly/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{assembler language}}{{stub}} \ No newline at end of file diff --git a/Lang/SPARK/0DESCRIPTION b/Lang/SPARK/0DESCRIPTION new file mode 100644 index 0000000000..3dd36e5585 --- /dev/null +++ b/Lang/SPARK/0DESCRIPTION @@ -0,0 +1,36 @@ +{{language|SPARK +|site=http://www.altran-praxis.com/spark.aspx +|tags=spark +|exec=machine +|gc=allowed +|parampass=both +|checking=static +|compat=nominative +|express=explicit +|strength=strong +|safety=safe +|LCT=yes}} +{{language programming paradigm|concurrent}} +{{language programming paradigm|imperative}} +{{language programming paradigm|object-oriented}} +[[wp:SPARK_programming_language|'''SPARK''']] or '''SPARK Ada''' is a sub-language of [[Ada]], supplemented with annotations (formal comments). Its primary purpose is for high-integrity applications, where static analysis of the source is used to determine properties of the program. + +The properties that SPARK code can be analysed for are: +*Freedom from data-flow errors. +*Freedom from information flow errors. +*Freedom from information flows that violate safety or security. +*Type safety (freedom from run-time errors). +*Functional correctness. +*Absence of dead paths. + +The annotations always begin, on each line, with the Ada comment symbol “--”, so all SPARK programs comply with the [[Ada]] standard. + +A SPARK program can be compiled by any [[Ada]] compiler or processed by any other [[Ada]] tool. + +The annotations state the required properties of a program. Different properties may require different types of annotation. + +A description of the SPARK Proof process is [[SPARK_Proof_Process|here]]. + +The SPARK tools are freely available under the GNU GPL. The SPARK language definition is proprietary - the main copyright is held by [http://www.sparkada.com/ Altran-Praxis]. + +The [news:comp.lang.ada comp.lang.ada] [[newsgroup]] ([http://groups.google.com/group/comp.lang.ada/topics access via Google Groups])is the main forum for discussing or asking questions about SPARK. \ No newline at end of file diff --git a/Lang/SPARK/A+B b/Lang/SPARK/A+B new file mode 120000 index 0000000000..ea38017f7a --- /dev/null +++ b/Lang/SPARK/A+B @@ -0,0 +1 @@ +../../Task/A+B/SPARK \ No newline at end of file diff --git a/Lang/SPARK/Assertions b/Lang/SPARK/Assertions new file mode 120000 index 0000000000..33d238ff32 --- /dev/null +++ b/Lang/SPARK/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/SPARK \ No newline at end of file diff --git a/Lang/SPARK/Binary-search b/Lang/SPARK/Binary-search new file mode 120000 index 0000000000..a587edd69a --- /dev/null +++ b/Lang/SPARK/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/SPARK \ No newline at end of file diff --git a/Lang/SPARK/Dot-product b/Lang/SPARK/Dot-product new file mode 120000 index 0000000000..c3399a3fec --- /dev/null +++ b/Lang/SPARK/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/SPARK \ No newline at end of file diff --git a/Lang/SPARK/Function-definition b/Lang/SPARK/Function-definition new file mode 120000 index 0000000000..e1cb04833e --- /dev/null +++ b/Lang/SPARK/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/SPARK \ No newline at end of file diff --git a/Lang/SPARK/Luhn-test-of-credit-card-numbers b/Lang/SPARK/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..0c57401236 --- /dev/null +++ b/Lang/SPARK/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/SPARK \ No newline at end of file diff --git a/Lang/SQL/0DESCRIPTION b/Lang/SQL/0DESCRIPTION new file mode 100644 index 0000000000..13254faeef --- /dev/null +++ b/Lang/SQL/0DESCRIPTION @@ -0,0 +1,10 @@ +{{stub}} +{{language|SQL|bnf=http://savage.net.au/SQL/sql-2003-2.bnf.html}} + +'''[[wp:SQL|Structured Query Language]]''' (SQL) is the ''lingua franca'' for modifying and performing queries in database systems based on Dr. Edgar F. Codd's relational model. (Dr. Codd did not create the SQL language itself.) + +It is mostly declarative, but each database vendor has extended their dialect of SQL in various incompatible ways to give it more power or to simplify their implementation. + +==See Also== + +[[SMEQL]] \ No newline at end of file diff --git a/Lang/SQL/99-Bottles-of-Beer b/Lang/SQL/99-Bottles-of-Beer new file mode 120000 index 0000000000..80754bd712 --- /dev/null +++ b/Lang/SQL/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/SQL \ No newline at end of file diff --git a/Lang/SQL/A+B b/Lang/SQL/A+B new file mode 120000 index 0000000000..0e4b194bfe --- /dev/null +++ b/Lang/SQL/A+B @@ -0,0 +1 @@ +../../Task/A+B/SQL \ No newline at end of file diff --git a/Lang/SQL/Conditional-structures b/Lang/SQL/Conditional-structures new file mode 120000 index 0000000000..2b0e5c874e --- /dev/null +++ b/Lang/SQL/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/SQL \ No newline at end of file diff --git a/Lang/SQL/Determine-if-a-string-is-numeric b/Lang/SQL/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..b372ef1737 --- /dev/null +++ b/Lang/SQL/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/SQL \ No newline at end of file diff --git a/Lang/SQL/Dot-product b/Lang/SQL/Dot-product new file mode 120000 index 0000000000..184b05075c --- /dev/null +++ b/Lang/SQL/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/SQL \ No newline at end of file diff --git a/Lang/SQL/Filter b/Lang/SQL/Filter new file mode 120000 index 0000000000..69943730e3 --- /dev/null +++ b/Lang/SQL/Filter @@ -0,0 +1 @@ +../../Task/Filter/SQL \ No newline at end of file diff --git a/Lang/SQL/FizzBuzz b/Lang/SQL/FizzBuzz new file mode 120000 index 0000000000..110e0b8f32 --- /dev/null +++ b/Lang/SQL/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/SQL \ No newline at end of file diff --git a/Lang/SQL/Formatted-numeric-output b/Lang/SQL/Formatted-numeric-output new file mode 120000 index 0000000000..3cc6e7596b --- /dev/null +++ b/Lang/SQL/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/SQL \ No newline at end of file diff --git a/Lang/SQL/Forward-difference b/Lang/SQL/Forward-difference new file mode 120000 index 0000000000..c8203b5706 --- /dev/null +++ b/Lang/SQL/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/SQL \ No newline at end of file diff --git a/Lang/SQL/Look-and-say-sequence b/Lang/SQL/Look-and-say-sequence new file mode 120000 index 0000000000..81e9771ba4 --- /dev/null +++ b/Lang/SQL/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/SQL \ No newline at end of file diff --git a/Lang/SQL/MD5 b/Lang/SQL/MD5 new file mode 120000 index 0000000000..156202aa59 --- /dev/null +++ b/Lang/SQL/MD5 @@ -0,0 +1 @@ +../../Task/MD5/SQL \ No newline at end of file diff --git a/Lang/SQL/Matrix-multiplication b/Lang/SQL/Matrix-multiplication new file mode 120000 index 0000000000..7b0e9ffafe --- /dev/null +++ b/Lang/SQL/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/SQL \ No newline at end of file diff --git a/Lang/Sage/0DESCRIPTION b/Lang/Sage/0DESCRIPTION new file mode 100644 index 0000000000..2c53211c2c --- /dev/null +++ b/Lang/Sage/0DESCRIPTION @@ -0,0 +1,6 @@ +{{language|Sage +|site=http://www.sagemath.org/}} + + + +'''[http://www.sagemath.org Sage]''': open source mathematical software system. \ No newline at end of file diff --git a/Lang/Salmon/0DESCRIPTION b/Lang/Salmon/0DESCRIPTION new file mode 100644 index 0000000000..28b2933c89 --- /dev/null +++ b/Lang/Salmon/0DESCRIPTION @@ -0,0 +1,18 @@ +{{language|Salmon +|site=http://salmonpl.net/ +|LCT=no +}} + +Salmon is a general-purpose, multi-paradigm language that supports imperative, object-oriented, and functional programming styles, among others. It supports writing code at either a high level or a low level, and intermixing the two. Salmon is designed to support the full range of programming tasks, from quick and simple scripts to large, multi-developer software projects, with strong support for modularity. It is designed to support interpretation or compilation, with the ability to specify low-level details where needed to optimize compiled code. Readability and maintainability of code are a priority with Salmon. + +Salmon has a powerful, flexible, strong type system. The programmer is allowed to leave off all explicit type information, as in a traditional dynamically-typed language. The programmer may also put in full static type information, allowing a compiler to do full static type checking and generate code that does not have to do any dynamic type checking or dispatch at run time. Or the programmer may put in type information in some places but not others. A Salmon program may gradually evolve from an initial, quick prototype with no type information specified to a more mature system with detailed type information. + +The Salmon type system also allows an unusual degree of freedom in expressing types. For example, the user may specify a given variable has a value that is an integer in either of the ranges 0 - 15 or 20 - 25. Or the user may specify a variable may be any string matching a given regular expression. Types can also be specified that won't be known until run time, and types are first-class values in Salmon, allowing them to be passed into functions, stored in data structures, and created on the fly. + +Memory management in Salmon may either be explicit or implicit, or a mixture of the two. The programmer may do explicit memory management either by specifying finite lifetimes for scoped variables and other declarations that implicitly end when the scope does (stack lifetimes) or by explicitly calling a delete() procedure to end the lifetimes of indefinite-lifetime entities (heap lifetimes). Or the programmer may let automatic garbage collection de-allocate things that are no longer needed. Even when the programmer explicitly de-allocates entities, safety is maintained -- trying to use a reference to an entity that no longer exists always results in an exception that can be caught and handled rather than undefined behavior. + +Other unusual features of Salmon include support for modules adding private data to datastructures shared with other modules and a theorem/proof system to allow the compiler to check the reasoning of the programmer about virtually any property, though the current implementation of Salmon does not yet support checking such proofs. + +Salmon currently has a full implementation in the form of a portable interpreter written in C, and a detailed reference manual specifying the language. A plug-in mechanism in the interpreter allows native code modules to be dynamically loaded and called from Salmon, allowing code written in C or any other compiled language to be called from Salmon. + +The Salmon interpreter and documentation are all in the public domain. \ No newline at end of file diff --git a/Lang/Salmon/100-doors b/Lang/Salmon/100-doors new file mode 120000 index 0000000000..62c6857615 --- /dev/null +++ b/Lang/Salmon/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Apply-a-callback-to-an-array b/Lang/Salmon/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..0dffa11cf9 --- /dev/null +++ b/Lang/Salmon/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Count-in-octal b/Lang/Salmon/Count-in-octal new file mode 120000 index 0000000000..f7afc6dee8 --- /dev/null +++ b/Lang/Salmon/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Doubly-linked-list-Traversal b/Lang/Salmon/Doubly-linked-list-Traversal new file mode 120000 index 0000000000..ab91d0a154 --- /dev/null +++ b/Lang/Salmon/Doubly-linked-list-Traversal @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Traversal/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Filter b/Lang/Salmon/Filter new file mode 120000 index 0000000000..31f96fc76b --- /dev/null +++ b/Lang/Salmon/Filter @@ -0,0 +1 @@ +../../Task/Filter/Salmon \ No newline at end of file diff --git a/Lang/Salmon/FizzBuzz b/Lang/Salmon/FizzBuzz new file mode 120000 index 0000000000..840f1b406a --- /dev/null +++ b/Lang/Salmon/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Happy-numbers b/Lang/Salmon/Happy-numbers new file mode 120000 index 0000000000..d6dd1a3d4f --- /dev/null +++ b/Lang/Salmon/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Hello-world-Line-printer b/Lang/Salmon/Hello-world-Line-printer new file mode 120000 index 0000000000..658d958524 --- /dev/null +++ b/Lang/Salmon/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Hello-world-Newline-omission b/Lang/Salmon/Hello-world-Newline-omission new file mode 120000 index 0000000000..75a1cbcf52 --- /dev/null +++ b/Lang/Salmon/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Hello-world-Standard-error b/Lang/Salmon/Hello-world-Standard-error new file mode 120000 index 0000000000..b8cd4639a5 --- /dev/null +++ b/Lang/Salmon/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Hello-world-Text b/Lang/Salmon/Hello-world-Text new file mode 120000 index 0000000000..ab2041bccf --- /dev/null +++ b/Lang/Salmon/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Hello-world-Web-server b/Lang/Salmon/Hello-world-Web-server new file mode 120000 index 0000000000..e53e67ccf6 --- /dev/null +++ b/Lang/Salmon/Hello-world-Web-server @@ -0,0 +1 @@ +../../Task/Hello-world-Web-server/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Integer-sequence b/Lang/Salmon/Integer-sequence new file mode 120000 index 0000000000..d47d7484cd --- /dev/null +++ b/Lang/Salmon/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loop-over-multiple-arrays-simultaneously b/Lang/Salmon/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..c51c06b700 --- /dev/null +++ b/Lang/Salmon/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-Continue b/Lang/Salmon/Loops-Continue new file mode 120000 index 0000000000..bc5b11c09c --- /dev/null +++ b/Lang/Salmon/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-Do-while b/Lang/Salmon/Loops-Do-while new file mode 120000 index 0000000000..55ef76aafa --- /dev/null +++ b/Lang/Salmon/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-Downward-for b/Lang/Salmon/Loops-Downward-for new file mode 120000 index 0000000000..082cfe8420 --- /dev/null +++ b/Lang/Salmon/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-For b/Lang/Salmon/Loops-For new file mode 120000 index 0000000000..0a1db4fbe3 --- /dev/null +++ b/Lang/Salmon/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-For-with-a-specified-step b/Lang/Salmon/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..a9867f0d88 --- /dev/null +++ b/Lang/Salmon/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-Foreach b/Lang/Salmon/Loops-Foreach new file mode 120000 index 0000000000..38d9fc94fc --- /dev/null +++ b/Lang/Salmon/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-Infinite b/Lang/Salmon/Loops-Infinite new file mode 120000 index 0000000000..da7e93b559 --- /dev/null +++ b/Lang/Salmon/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Salmon \ No newline at end of file diff --git a/Lang/Salmon/Loops-N-plus-one-half b/Lang/Salmon/Loops-N-plus-one-half new file mode 120000 index 0000000000..e660593017 --- /dev/null +++ b/Lang/Salmon/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Salmon \ No newline at end of file diff --git a/Lang/Sather/Arbitrary-precision-integers-(included) b/Lang/Sather/Arbitrary-precision-integers-(included) deleted file mode 120000 index 073407923a..0000000000 --- a/Lang/Sather/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Sather \ No newline at end of file diff --git a/Lang/Scala/Arbitrary-precision-integers-(included) b/Lang/Scala/Arbitrary-precision-integers-(included) deleted file mode 120000 index fba506188d..0000000000 --- a/Lang/Scala/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Scala \ No newline at end of file diff --git a/Lang/Scheme/Arbitrary-precision-integers-(included) b/Lang/Scheme/Arbitrary-precision-integers-(included) deleted file mode 120000 index 853ed76c0e..0000000000 --- a/Lang/Scheme/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Scheme \ No newline at end of file diff --git a/Lang/Scilab/0DESCRIPTION b/Lang/Scilab/0DESCRIPTION new file mode 100644 index 0000000000..b8442afe01 --- /dev/null +++ b/Lang/Scilab/0DESCRIPTION @@ -0,0 +1,11 @@ +{{stub}} +{{language|Scilabno +|site=http://www.scilab.org/ +|LCT= +}} + +{{Wikipedia}} +Scilab is an open source, cross-platform numerical computational package and a high-level, numerically oriented programming language. It can be used for signal processing, statistical analysis, image enhancement, fluid dynamics simulations, numerical optimization, and modeling and simulation of explicit and implicit dynamical systems. [[MATLAB]] code, which is similar in syntax, can be converted to Scilab. Scilab is one of several open source alternatives to MATLAB. + +== See Also == +[[Octave]] \ No newline at end of file diff --git a/Lang/Scratch/0DESCRIPTION b/Lang/Scratch/0DESCRIPTION new file mode 100644 index 0000000000..e154630a25 --- /dev/null +++ b/Lang/Scratch/0DESCRIPTION @@ -0,0 +1,8 @@ +{{stub}} +{{language +|checking=dynamic +|hopl=no +|site=http://scratch.mit.edu/}} +{{language programming paradigm|object-oriented}} +{{Wikipedia|Scratch (programming language)}} +Scratch is an educational programming language that allows people of any experience background and age to experiment with the concepts of fully versatile computer programming by using an alterable GUI. It is developed by the Lifelong Kindergarten group at the MIT Media Lab by a team led by Mitchel Resnick and first appeared in the summer of 2007. Scratch can be installed and freely redistributed on any Windows, Mac OS X or Linux computer. The source code is made available under a license that allows modifications for non-commercial uses. \ No newline at end of file diff --git a/Lang/Script-Basic/0DESCRIPTION b/Lang/Script-Basic/0DESCRIPTION new file mode 100644 index 0000000000..541600daea --- /dev/null +++ b/Lang/Script-Basic/0DESCRIPTION @@ -0,0 +1,9 @@ +{{language|ScriptBasic +|exec=interpreted +|site=http://www.scriptbasic.org/}} +{{implementation|BASIC}}'''ScriptBasic''' is an interpreted basic suitable for general purpose terminal mode application programming and [[CGI|common gateway interface]] scripting. + +==Features== + +{{language programming paradigm|procedural}} +{{language programming paradigm|imperative}} \ No newline at end of file diff --git a/Lang/Script3D/0DESCRIPTION b/Lang/Script3D/0DESCRIPTION new file mode 100644 index 0000000000..6793e07d9b --- /dev/null +++ b/Lang/Script3D/0DESCRIPTION @@ -0,0 +1,8 @@ +{{language|Script3D +|exec=bytecode +|LCT=no +}}'''Script3D''' (S3D) is a programming language for 3D applications adopted in the [http://www.vrmedia.it XVR] Virtual Reality Framework. It is an object oriented language with some specific features for 3D computations. + +This language has been designed by Scuola Superiore S.Anna in Pisa, Italy, and is used for a variety of virtual reality applications, mostly in Europe. It is taught in some introductory university courses for virtual reality applications. + +The language is typically compiled to [[bytecode]] and executed by the XVR Virtual Machine inside a Web Browser or as a standalone application. \ No newline at end of file diff --git a/Lang/ScriptBasic/0DESCRIPTION b/Lang/ScriptBasic/0DESCRIPTION new file mode 100644 index 0000000000..541600daea --- /dev/null +++ b/Lang/ScriptBasic/0DESCRIPTION @@ -0,0 +1,9 @@ +{{language|ScriptBasic +|exec=interpreted +|site=http://www.scriptbasic.org/}} +{{implementation|BASIC}}'''ScriptBasic''' is an interpreted basic suitable for general purpose terminal mode application programming and [[CGI|common gateway interface]] scripting. + +==Features== + +{{language programming paradigm|procedural}} +{{language programming paradigm|imperative}} \ No newline at end of file diff --git a/Lang/Sed/0DESCRIPTION b/Lang/Sed/0DESCRIPTION new file mode 100644 index 0000000000..ace8ce1731 --- /dev/null +++ b/Lang/Sed/0DESCRIPTION @@ -0,0 +1,2 @@ +{{stub}}{{language}} +This is the command language used by the line oriented stream editor (a non interactive tool for text manipulation and filtering). \ No newline at end of file diff --git a/Lang/Sed/CSV-to-HTML-translation b/Lang/Sed/CSV-to-HTML-translation new file mode 120000 index 0000000000..54d166894d --- /dev/null +++ b/Lang/Sed/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/Sed \ No newline at end of file diff --git a/Lang/Sed/Greatest-common-divisor b/Lang/Sed/Greatest-common-divisor new file mode 120000 index 0000000000..ce8d5203c8 --- /dev/null +++ b/Lang/Sed/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Sed \ No newline at end of file diff --git a/Lang/Sed/Increment-a-numerical-string b/Lang/Sed/Increment-a-numerical-string new file mode 120000 index 0000000000..096983a864 --- /dev/null +++ b/Lang/Sed/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Sed \ No newline at end of file diff --git a/Lang/Seed7/0DESCRIPTION b/Lang/Seed7/0DESCRIPTION new file mode 100644 index 0000000000..b89818e07b --- /dev/null +++ b/Lang/Seed7/0DESCRIPTION @@ -0,0 +1,11 @@ +{{language|Seed7 +|site=http://seed7.sourceforge.net/ +|checking=static +|exec=interpreted}} +{{language programming paradigm|object-oriented}}'''Seed7''' is a general-purpose programming language designed by Thomas Mertes. It is a higher level language compared to [[Ada]], [[C]] / [[C++]] and [[Java]]. The Seed7 interpreter, and the example programs are [[Open source|open-source]] software. An open-source Seed7 [[compiler]] is also available. + +In Seed7 new statements and operators can be declared easily. Functions with type results and type parameters are more elegant than the usual template or generics concept. [[Object-oriented_programming|Object orientation]] is used when it brings advantages and not in places when other solutions are more obvious. Although Seed7 contains several concepts of other programming languages it cannot be seen as direct descendant of another programming language. + +==See also== +* [[wp:Seed7|Seed7 on Wikipedia]] +* [http://seed7.sourceforge.net/ Seed7 Homepage] \ No newline at end of file diff --git a/Lang/Seed7/100-doors b/Lang/Seed7/100-doors new file mode 120000 index 0000000000..6ff7d3e95d --- /dev/null +++ b/Lang/Seed7/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/99-Bottles-of-Beer b/Lang/Seed7/99-Bottles-of-Beer new file mode 120000 index 0000000000..d84aed7dd0 --- /dev/null +++ b/Lang/Seed7/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/A+B b/Lang/Seed7/A+B new file mode 120000 index 0000000000..a348fc5de8 --- /dev/null +++ b/Lang/Seed7/A+B @@ -0,0 +1 @@ +../../Task/A+B/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Ackermann-function b/Lang/Seed7/Ackermann-function new file mode 120000 index 0000000000..b6d193ee0b --- /dev/null +++ b/Lang/Seed7/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Align-columns b/Lang/Seed7/Align-columns new file mode 120000 index 0000000000..2b81c54bc6 --- /dev/null +++ b/Lang/Seed7/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Arbitrary-precision-integers-included b/Lang/Seed7/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..76f16a7fd3 --- /dev/null +++ b/Lang/Seed7/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Arithmetic-Complex b/Lang/Seed7/Arithmetic-Complex new file mode 120000 index 0000000000..825cd8c38d --- /dev/null +++ b/Lang/Seed7/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Arithmetic-Integer b/Lang/Seed7/Arithmetic-Integer new file mode 120000 index 0000000000..99ba5a1f72 --- /dev/null +++ b/Lang/Seed7/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Array-concatenation b/Lang/Seed7/Array-concatenation new file mode 120000 index 0000000000..5de353851e --- /dev/null +++ b/Lang/Seed7/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Associative-array-Creation b/Lang/Seed7/Associative-array-Creation new file mode 120000 index 0000000000..3eb56037d7 --- /dev/null +++ b/Lang/Seed7/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Associative-array-Iteration b/Lang/Seed7/Associative-array-Iteration new file mode 120000 index 0000000000..7d454ba23b --- /dev/null +++ b/Lang/Seed7/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Averages-Arithmetic-mean b/Lang/Seed7/Averages-Arithmetic-mean new file mode 120000 index 0000000000..cbbeab214f --- /dev/null +++ b/Lang/Seed7/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Averages-Median b/Lang/Seed7/Averages-Median new file mode 120000 index 0000000000..3196394006 --- /dev/null +++ b/Lang/Seed7/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Averages-Pythagorean-means b/Lang/Seed7/Averages-Pythagorean-means new file mode 120000 index 0000000000..bf73ec0db6 --- /dev/null +++ b/Lang/Seed7/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Averages-Root-mean-square b/Lang/Seed7/Averages-Root-mean-square new file mode 120000 index 0000000000..fd87bdbab9 --- /dev/null +++ b/Lang/Seed7/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Balanced-brackets b/Lang/Seed7/Balanced-brackets new file mode 120000 index 0000000000..4bae2392c6 --- /dev/null +++ b/Lang/Seed7/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Binary-search b/Lang/Seed7/Binary-search new file mode 120000 index 0000000000..ee2f7b24ac --- /dev/null +++ b/Lang/Seed7/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Bitmap b/Lang/Seed7/Bitmap new file mode 120000 index 0000000000..dc75166562 --- /dev/null +++ b/Lang/Seed7/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Bitmap-Read-a-PPM-file b/Lang/Seed7/Bitmap-Read-a-PPM-file new file mode 120000 index 0000000000..f6d4296321 --- /dev/null +++ b/Lang/Seed7/Bitmap-Read-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Read-a-PPM-file/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Bitmap-Write-a-PPM-file b/Lang/Seed7/Bitmap-Write-a-PPM-file new file mode 120000 index 0000000000..870512a284 --- /dev/null +++ b/Lang/Seed7/Bitmap-Write-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Write-a-PPM-file/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Box-the-compass b/Lang/Seed7/Box-the-compass new file mode 120000 index 0000000000..f7d546ff01 --- /dev/null +++ b/Lang/Seed7/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/CSV-to-HTML-translation b/Lang/Seed7/CSV-to-HTML-translation new file mode 120000 index 0000000000..33de625e33 --- /dev/null +++ b/Lang/Seed7/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Caesar-cipher b/Lang/Seed7/Caesar-cipher new file mode 120000 index 0000000000..e242b069cd --- /dev/null +++ b/Lang/Seed7/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Calendar b/Lang/Seed7/Calendar new file mode 120000 index 0000000000..54a86f61a2 --- /dev/null +++ b/Lang/Seed7/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Case-sensitivity-of-identifiers b/Lang/Seed7/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..02234eb765 --- /dev/null +++ b/Lang/Seed7/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Character-codes b/Lang/Seed7/Character-codes new file mode 120000 index 0000000000..a9fb08657d --- /dev/null +++ b/Lang/Seed7/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Character-matching b/Lang/Seed7/Character-matching new file mode 120000 index 0000000000..f9193ddbd8 --- /dev/null +++ b/Lang/Seed7/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Check-that-file-exists b/Lang/Seed7/Check-that-file-exists new file mode 120000 index 0000000000..be2d2b93cb --- /dev/null +++ b/Lang/Seed7/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Closest-pair-problem b/Lang/Seed7/Closest-pair-problem new file mode 120000 index 0000000000..58a1cf7c9e --- /dev/null +++ b/Lang/Seed7/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Collections b/Lang/Seed7/Collections new file mode 120000 index 0000000000..6aa3a55d59 --- /dev/null +++ b/Lang/Seed7/Collections @@ -0,0 +1 @@ +../../Task/Collections/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Combinations b/Lang/Seed7/Combinations new file mode 120000 index 0000000000..a19e51b5f9 --- /dev/null +++ b/Lang/Seed7/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Command-line-arguments b/Lang/Seed7/Command-line-arguments new file mode 120000 index 0000000000..b8c8df4ddf --- /dev/null +++ b/Lang/Seed7/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Comments b/Lang/Seed7/Comments new file mode 120000 index 0000000000..7f96cbe321 --- /dev/null +++ b/Lang/Seed7/Comments @@ -0,0 +1 @@ +../../Task/Comments/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Compile-time-calculation b/Lang/Seed7/Compile-time-calculation new file mode 120000 index 0000000000..bb1c1babe4 --- /dev/null +++ b/Lang/Seed7/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Compound-data-type b/Lang/Seed7/Compound-data-type new file mode 120000 index 0000000000..9a4b3a2694 --- /dev/null +++ b/Lang/Seed7/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Conditional-structures b/Lang/Seed7/Conditional-structures new file mode 120000 index 0000000000..1b266e401f --- /dev/null +++ b/Lang/Seed7/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Count-in-factors b/Lang/Seed7/Count-in-factors new file mode 120000 index 0000000000..bc82d1048e --- /dev/null +++ b/Lang/Seed7/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Count-in-octal b/Lang/Seed7/Count-in-octal new file mode 120000 index 0000000000..90a7a6697f --- /dev/null +++ b/Lang/Seed7/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Count-occurrences-of-a-substring b/Lang/Seed7/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..a5d5510f6a --- /dev/null +++ b/Lang/Seed7/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Count-the-coins b/Lang/Seed7/Count-the-coins new file mode 120000 index 0000000000..b6e972ffcf --- /dev/null +++ b/Lang/Seed7/Count-the-coins @@ -0,0 +1 @@ +../../Task/Count-the-coins/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Create-a-file b/Lang/Seed7/Create-a-file new file mode 120000 index 0000000000..9e238f25d4 --- /dev/null +++ b/Lang/Seed7/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Create-a-two-dimensional-array-at-runtime b/Lang/Seed7/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..958925af19 --- /dev/null +++ b/Lang/Seed7/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Create-an-HTML-table b/Lang/Seed7/Create-an-HTML-table new file mode 120000 index 0000000000..5ac98af3ae --- /dev/null +++ b/Lang/Seed7/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/DNS-query b/Lang/Seed7/DNS-query new file mode 120000 index 0000000000..f532236463 --- /dev/null +++ b/Lang/Seed7/DNS-query @@ -0,0 +1 @@ +../../Task/DNS-query/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Date-format b/Lang/Seed7/Date-format new file mode 120000 index 0000000000..da357c7b10 --- /dev/null +++ b/Lang/Seed7/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Date-manipulation b/Lang/Seed7/Date-manipulation new file mode 120000 index 0000000000..92f5f956f7 --- /dev/null +++ b/Lang/Seed7/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Day-of-the-week b/Lang/Seed7/Day-of-the-week new file mode 120000 index 0000000000..29a27a77ce --- /dev/null +++ b/Lang/Seed7/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Detect-division-by-zero b/Lang/Seed7/Detect-division-by-zero new file mode 120000 index 0000000000..e48148b278 --- /dev/null +++ b/Lang/Seed7/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Dot-product b/Lang/Seed7/Dot-product new file mode 120000 index 0000000000..2ce240fc9a --- /dev/null +++ b/Lang/Seed7/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Empty-directory b/Lang/Seed7/Empty-directory new file mode 120000 index 0000000000..36b416f5f5 --- /dev/null +++ b/Lang/Seed7/Empty-directory @@ -0,0 +1 @@ +../../Task/Empty-directory/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Empty-program b/Lang/Seed7/Empty-program new file mode 120000 index 0000000000..4e24643faf --- /dev/null +++ b/Lang/Seed7/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Empty-string b/Lang/Seed7/Empty-string new file mode 120000 index 0000000000..f9a6ee0822 --- /dev/null +++ b/Lang/Seed7/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Enforced-immutability b/Lang/Seed7/Enforced-immutability new file mode 120000 index 0000000000..69944d6ddd --- /dev/null +++ b/Lang/Seed7/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Enumerations b/Lang/Seed7/Enumerations new file mode 120000 index 0000000000..ebe700cd08 --- /dev/null +++ b/Lang/Seed7/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Equilibrium-index b/Lang/Seed7/Equilibrium-index new file mode 120000 index 0000000000..259531d18d --- /dev/null +++ b/Lang/Seed7/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Ethiopian-multiplication b/Lang/Seed7/Ethiopian-multiplication new file mode 120000 index 0000000000..d8d80f81b0 --- /dev/null +++ b/Lang/Seed7/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Evaluate-binomial-coefficients b/Lang/Seed7/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..20bf958b40 --- /dev/null +++ b/Lang/Seed7/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Even-or-odd b/Lang/Seed7/Even-or-odd new file mode 120000 index 0000000000..255edbfe83 --- /dev/null +++ b/Lang/Seed7/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Evolutionary-algorithm b/Lang/Seed7/Evolutionary-algorithm new file mode 120000 index 0000000000..53147fa4e0 --- /dev/null +++ b/Lang/Seed7/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Execute-HQ9+ b/Lang/Seed7/Execute-HQ9+ new file mode 120000 index 0000000000..1d10f90e0e --- /dev/null +++ b/Lang/Seed7/Execute-HQ9+ @@ -0,0 +1 @@ +../../Task/Execute-HQ9+/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Execute-a-system-command b/Lang/Seed7/Execute-a-system-command new file mode 120000 index 0000000000..b79a4bd10c --- /dev/null +++ b/Lang/Seed7/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Exponentiation-operator b/Lang/Seed7/Exponentiation-operator new file mode 120000 index 0000000000..2c16b8148b --- /dev/null +++ b/Lang/Seed7/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Extend-your-language b/Lang/Seed7/Extend-your-language new file mode 120000 index 0000000000..ccb52ff9c9 --- /dev/null +++ b/Lang/Seed7/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Extreme-floating-point-values b/Lang/Seed7/Extreme-floating-point-values new file mode 120000 index 0000000000..5041cffc31 --- /dev/null +++ b/Lang/Seed7/Extreme-floating-point-values @@ -0,0 +1 @@ +../../Task/Extreme-floating-point-values/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Factorial b/Lang/Seed7/Factorial new file mode 120000 index 0000000000..7cf63b4c3e --- /dev/null +++ b/Lang/Seed7/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Factors-of-an-integer b/Lang/Seed7/Factors-of-an-integer new file mode 120000 index 0000000000..86fa6e0c0c --- /dev/null +++ b/Lang/Seed7/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Fibonacci-sequence b/Lang/Seed7/Fibonacci-sequence new file mode 120000 index 0000000000..f250eb6115 --- /dev/null +++ b/Lang/Seed7/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/File-IO b/Lang/Seed7/File-IO new file mode 120000 index 0000000000..8327757aa5 --- /dev/null +++ b/Lang/Seed7/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/File-modification-time b/Lang/Seed7/File-modification-time new file mode 120000 index 0000000000..77a1c4e6c7 --- /dev/null +++ b/Lang/Seed7/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/File-size b/Lang/Seed7/File-size new file mode 120000 index 0000000000..995b48c518 --- /dev/null +++ b/Lang/Seed7/File-size @@ -0,0 +1 @@ +../../Task/File-size/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Filter b/Lang/Seed7/Filter new file mode 120000 index 0000000000..c707de36e6 --- /dev/null +++ b/Lang/Seed7/Filter @@ -0,0 +1 @@ +../../Task/Filter/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Find-common-directory-path b/Lang/Seed7/Find-common-directory-path new file mode 120000 index 0000000000..6f70947c13 --- /dev/null +++ b/Lang/Seed7/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Five-weekends b/Lang/Seed7/Five-weekends new file mode 120000 index 0000000000..63f90f826e --- /dev/null +++ b/Lang/Seed7/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/FizzBuzz b/Lang/Seed7/FizzBuzz new file mode 120000 index 0000000000..5367c1c8d6 --- /dev/null +++ b/Lang/Seed7/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Formatted-numeric-output b/Lang/Seed7/Formatted-numeric-output new file mode 120000 index 0000000000..538fc1c394 --- /dev/null +++ b/Lang/Seed7/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Forward-difference b/Lang/Seed7/Forward-difference new file mode 120000 index 0000000000..4be03ea7ae --- /dev/null +++ b/Lang/Seed7/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Fractal-tree b/Lang/Seed7/Fractal-tree new file mode 120000 index 0000000000..3ebce9459b --- /dev/null +++ b/Lang/Seed7/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Function-definition b/Lang/Seed7/Function-definition new file mode 120000 index 0000000000..8117856e0b --- /dev/null +++ b/Lang/Seed7/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Gamma-function b/Lang/Seed7/Gamma-function new file mode 120000 index 0000000000..ede51b3f44 --- /dev/null +++ b/Lang/Seed7/Gamma-function @@ -0,0 +1 @@ +../../Task/Gamma-function/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Generic-swap b/Lang/Seed7/Generic-swap new file mode 120000 index 0000000000..daf8bb7391 --- /dev/null +++ b/Lang/Seed7/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Globally-replace-text-in-several-files b/Lang/Seed7/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..454a1b1c96 --- /dev/null +++ b/Lang/Seed7/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Greatest-common-divisor b/Lang/Seed7/Greatest-common-divisor new file mode 120000 index 0000000000..78d09c4102 --- /dev/null +++ b/Lang/Seed7/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Greatest-element-of-a-list b/Lang/Seed7/Greatest-element-of-a-list new file mode 120000 index 0000000000..79e66af9fa --- /dev/null +++ b/Lang/Seed7/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Greatest-subsequential-sum b/Lang/Seed7/Greatest-subsequential-sum new file mode 120000 index 0000000000..0ccf5b8601 --- /dev/null +++ b/Lang/Seed7/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Greyscale-bars-Display b/Lang/Seed7/Greyscale-bars-Display new file mode 120000 index 0000000000..957613b03c --- /dev/null +++ b/Lang/Seed7/Greyscale-bars-Display @@ -0,0 +1 @@ +../../Task/Greyscale-bars-Display/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Guess-the-number b/Lang/Seed7/Guess-the-number new file mode 120000 index 0000000000..0f8cba3039 --- /dev/null +++ b/Lang/Seed7/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Guess-the-number-With-feedback b/Lang/Seed7/Guess-the-number-With-feedback new file mode 120000 index 0000000000..b34f1b926d --- /dev/null +++ b/Lang/Seed7/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/HTTP b/Lang/Seed7/HTTP new file mode 120000 index 0000000000..2c0ba23fc5 --- /dev/null +++ b/Lang/Seed7/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hailstone-sequence b/Lang/Seed7/Hailstone-sequence new file mode 120000 index 0000000000..f287c425a1 --- /dev/null +++ b/Lang/Seed7/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hamming-numbers b/Lang/Seed7/Hamming-numbers new file mode 120000 index 0000000000..3c58e3b026 --- /dev/null +++ b/Lang/Seed7/Hamming-numbers @@ -0,0 +1 @@ +../../Task/Hamming-numbers/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hash-from-two-arrays b/Lang/Seed7/Hash-from-two-arrays new file mode 120000 index 0000000000..09b4d69a76 --- /dev/null +++ b/Lang/Seed7/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hello-world-Graphical b/Lang/Seed7/Hello-world-Graphical new file mode 120000 index 0000000000..4a631fb9b2 --- /dev/null +++ b/Lang/Seed7/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hello-world-Newline-omission b/Lang/Seed7/Hello-world-Newline-omission new file mode 120000 index 0000000000..b56f38e059 --- /dev/null +++ b/Lang/Seed7/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hello-world-Standard-error b/Lang/Seed7/Hello-world-Standard-error new file mode 120000 index 0000000000..59c8e35a6d --- /dev/null +++ b/Lang/Seed7/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hello-world-Text b/Lang/Seed7/Hello-world-Text new file mode 120000 index 0000000000..b9823339bb --- /dev/null +++ b/Lang/Seed7/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hofstadter-Q-sequence b/Lang/Seed7/Hofstadter-Q-sequence new file mode 120000 index 0000000000..af05f56ecb --- /dev/null +++ b/Lang/Seed7/Hofstadter-Q-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Q-sequence/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Horizontal-sundial-calculations b/Lang/Seed7/Horizontal-sundial-calculations new file mode 120000 index 0000000000..d0097002f5 --- /dev/null +++ b/Lang/Seed7/Horizontal-sundial-calculations @@ -0,0 +1 @@ +../../Task/Horizontal-sundial-calculations/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Horners-rule-for-polynomial-evaluation b/Lang/Seed7/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..edf33a05c3 --- /dev/null +++ b/Lang/Seed7/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Hostname b/Lang/Seed7/Hostname new file mode 120000 index 0000000000..fbb0840192 --- /dev/null +++ b/Lang/Seed7/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Include-a-file b/Lang/Seed7/Include-a-file new file mode 120000 index 0000000000..17665cda62 --- /dev/null +++ b/Lang/Seed7/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Increment-a-numerical-string b/Lang/Seed7/Increment-a-numerical-string new file mode 120000 index 0000000000..dd16ad7da7 --- /dev/null +++ b/Lang/Seed7/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Infinity b/Lang/Seed7/Infinity new file mode 120000 index 0000000000..2ebc07bcac --- /dev/null +++ b/Lang/Seed7/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Input-loop b/Lang/Seed7/Input-loop new file mode 120000 index 0000000000..66813bb854 --- /dev/null +++ b/Lang/Seed7/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Integer-comparison b/Lang/Seed7/Integer-comparison new file mode 120000 index 0000000000..45c6974c29 --- /dev/null +++ b/Lang/Seed7/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Integer-sequence b/Lang/Seed7/Integer-sequence new file mode 120000 index 0000000000..87bb042890 --- /dev/null +++ b/Lang/Seed7/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Jensens-Device b/Lang/Seed7/Jensens-Device new file mode 120000 index 0000000000..037c483f4e --- /dev/null +++ b/Lang/Seed7/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Kaprekar-numbers b/Lang/Seed7/Kaprekar-numbers new file mode 120000 index 0000000000..013a7214ea --- /dev/null +++ b/Lang/Seed7/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Keyboard-input-Flush-the-keyboard-buffer b/Lang/Seed7/Keyboard-input-Flush-the-keyboard-buffer new file mode 120000 index 0000000000..71db88e8c8 --- /dev/null +++ b/Lang/Seed7/Keyboard-input-Flush-the-keyboard-buffer @@ -0,0 +1 @@ +../../Task/Keyboard-input-Flush-the-keyboard-buffer/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Keyboard-input-Keypress-check b/Lang/Seed7/Keyboard-input-Keypress-check new file mode 120000 index 0000000000..c06fb6cb73 --- /dev/null +++ b/Lang/Seed7/Keyboard-input-Keypress-check @@ -0,0 +1 @@ +../../Task/Keyboard-input-Keypress-check/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Seed7/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..64183be0f8 --- /dev/null +++ b/Lang/Seed7/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/LZW-compression b/Lang/Seed7/LZW-compression new file mode 120000 index 0000000000..8ddbb6dffb --- /dev/null +++ b/Lang/Seed7/LZW-compression @@ -0,0 +1 @@ +../../Task/LZW-compression/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Last-letter-first-letter b/Lang/Seed7/Last-letter-first-letter new file mode 120000 index 0000000000..c460ffbf7b --- /dev/null +++ b/Lang/Seed7/Last-letter-first-letter @@ -0,0 +1 @@ +../../Task/Last-letter-first-letter/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Leap-year b/Lang/Seed7/Leap-year new file mode 120000 index 0000000000..da643041f7 --- /dev/null +++ b/Lang/Seed7/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Least-common-multiple b/Lang/Seed7/Least-common-multiple new file mode 120000 index 0000000000..52a6fdd844 --- /dev/null +++ b/Lang/Seed7/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Letter-frequency b/Lang/Seed7/Letter-frequency new file mode 120000 index 0000000000..268455ea56 --- /dev/null +++ b/Lang/Seed7/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Levenshtein-distance b/Lang/Seed7/Levenshtein-distance new file mode 120000 index 0000000000..99c291f60f --- /dev/null +++ b/Lang/Seed7/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Literals-Floating-point b/Lang/Seed7/Literals-Floating-point new file mode 120000 index 0000000000..91670ee072 --- /dev/null +++ b/Lang/Seed7/Literals-Floating-point @@ -0,0 +1 @@ +../../Task/Literals-Floating-point/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Literals-Integer b/Lang/Seed7/Literals-Integer new file mode 120000 index 0000000000..1a83cd9389 --- /dev/null +++ b/Lang/Seed7/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Literals-String b/Lang/Seed7/Literals-String new file mode 120000 index 0000000000..5ba4f8882a --- /dev/null +++ b/Lang/Seed7/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Logical-operations b/Lang/Seed7/Logical-operations new file mode 120000 index 0000000000..cf0cb16ca8 --- /dev/null +++ b/Lang/Seed7/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Long-multiplication b/Lang/Seed7/Long-multiplication new file mode 120000 index 0000000000..68c992105c --- /dev/null +++ b/Lang/Seed7/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Look-and-say-sequence b/Lang/Seed7/Look-and-say-sequence new file mode 120000 index 0000000000..d34b982018 --- /dev/null +++ b/Lang/Seed7/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-Do-while b/Lang/Seed7/Loops-Do-while new file mode 120000 index 0000000000..97693c222b --- /dev/null +++ b/Lang/Seed7/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-Downward-for b/Lang/Seed7/Loops-Downward-for new file mode 120000 index 0000000000..dfe3c9a7ff --- /dev/null +++ b/Lang/Seed7/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-For b/Lang/Seed7/Loops-For new file mode 120000 index 0000000000..895c5cb685 --- /dev/null +++ b/Lang/Seed7/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-For-with-a-specified-step b/Lang/Seed7/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..c02d6a88e5 --- /dev/null +++ b/Lang/Seed7/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-Foreach b/Lang/Seed7/Loops-Foreach new file mode 120000 index 0000000000..665c1471e3 --- /dev/null +++ b/Lang/Seed7/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-Infinite b/Lang/Seed7/Loops-Infinite new file mode 120000 index 0000000000..ba513b064e --- /dev/null +++ b/Lang/Seed7/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-N-plus-one-half b/Lang/Seed7/Loops-N-plus-one-half new file mode 120000 index 0000000000..0b47bdf565 --- /dev/null +++ b/Lang/Seed7/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Loops-While b/Lang/Seed7/Loops-While new file mode 120000 index 0000000000..3bedf8f85c --- /dev/null +++ b/Lang/Seed7/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Lucas-Lehmer-test b/Lang/Seed7/Lucas-Lehmer-test new file mode 120000 index 0000000000..cd91b6603b --- /dev/null +++ b/Lang/Seed7/Lucas-Lehmer-test @@ -0,0 +1 @@ +../../Task/Lucas-Lehmer-test/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Luhn-test-of-credit-card-numbers b/Lang/Seed7/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..713ef22992 --- /dev/null +++ b/Lang/Seed7/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Map-range b/Lang/Seed7/Map-range new file mode 120000 index 0000000000..c00f3fb23b --- /dev/null +++ b/Lang/Seed7/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Matrix-exponentiation-operator b/Lang/Seed7/Matrix-exponentiation-operator new file mode 120000 index 0000000000..79a4fe5ae5 --- /dev/null +++ b/Lang/Seed7/Matrix-exponentiation-operator @@ -0,0 +1 @@ +../../Task/Matrix-exponentiation-operator/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Matrix-multiplication b/Lang/Seed7/Matrix-multiplication new file mode 120000 index 0000000000..a9daefe45d --- /dev/null +++ b/Lang/Seed7/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Matrix-transposition b/Lang/Seed7/Matrix-transposition new file mode 120000 index 0000000000..3827a56d10 --- /dev/null +++ b/Lang/Seed7/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Menu b/Lang/Seed7/Menu new file mode 120000 index 0000000000..eade6561d7 --- /dev/null +++ b/Lang/Seed7/Menu @@ -0,0 +1 @@ +../../Task/Menu/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Monte-Carlo-methods b/Lang/Seed7/Monte-Carlo-methods new file mode 120000 index 0000000000..527c70af6f --- /dev/null +++ b/Lang/Seed7/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Monty-Hall-problem b/Lang/Seed7/Monty-Hall-problem new file mode 120000 index 0000000000..9c9b32695f --- /dev/null +++ b/Lang/Seed7/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Mouse-position b/Lang/Seed7/Mouse-position new file mode 120000 index 0000000000..db26b56f12 --- /dev/null +++ b/Lang/Seed7/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Multiplication-tables b/Lang/Seed7/Multiplication-tables new file mode 120000 index 0000000000..a519054400 --- /dev/null +++ b/Lang/Seed7/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Mutual-recursion b/Lang/Seed7/Mutual-recursion new file mode 120000 index 0000000000..e20da6cfdf --- /dev/null +++ b/Lang/Seed7/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Ordered-words b/Lang/Seed7/Ordered-words new file mode 120000 index 0000000000..2b0b76f423 --- /dev/null +++ b/Lang/Seed7/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/Seed7 \ No newline at end of file diff --git a/Lang/Seed7/Quine b/Lang/Seed7/Quine new file mode 120000 index 0000000000..f0df651395 --- /dev/null +++ b/Lang/Seed7/Quine @@ -0,0 +1 @@ +../../Task/Quine/Seed7 \ No newline at end of file diff --git a/Lang/Self/0DESCRIPTION b/Lang/Self/0DESCRIPTION new file mode 100644 index 0000000000..fc604dbf65 --- /dev/null +++ b/Lang/Self/0DESCRIPTION @@ -0,0 +1,9 @@ +{{language|Self +|site=http://selflanguage.org/ +|LCT=no +}} + +'''Self''' is an [[object-oriented]] programming language based on the concept of prototypes. It was used primarily as an experimental test system for language design in the 1980s and 1990s; however, as of July of 2006, Self is still being actively developed as part of the Klein project which is a Self virtual machine written entirely in Self. The latest major version is 4.3, which was released in July 2006. + +==Citations== +* [[wp:Self_%28programming_language%29|Wikipedia:Self (programming language)]] \ No newline at end of file diff --git a/Lang/Self/Hello-world-Text b/Lang/Self/Hello-world-Text new file mode 120000 index 0000000000..1cb2f3071c --- /dev/null +++ b/Lang/Self/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Self \ No newline at end of file diff --git a/Lang/SheerPower-4GL/0DESCRIPTION b/Lang/SheerPower-4GL/0DESCRIPTION new file mode 100644 index 0000000000..bd4b7049ad --- /dev/null +++ b/Lang/SheerPower-4GL/0DESCRIPTION @@ -0,0 +1,19 @@ +{{stub}} +{{language +|site=http://www.sp4gl.com/ +}} +SheerPower 4GL is a Fourth-generation programming language developed by Touch Technologies, Inc. + +SheerPower 4GL has several key features: + +#It is free for hobbyists and non-profit organizations +#It is extremely fast, able to compile millions of lines per minute on more modern systems. +#Web scripting features make it fast and easy to develop dynamic web pages using SheerPower's BASIC-like syntax. [3] Version 5.0 was the official release containing the syntax and logic for web scripting in SheerPower. +#SheerPower utilizes a "Perfect Precision Math Package" [4] for which the patent 7149765 "Apparatus and method for precision binary numbers and numerical operations" [1] is applied to. This precision math eliminates the rounding off errors experienced when using a floating point data type [2]. +#SheerPower comes bundled with ARS - Advanced Record System database engine. [5] ARS is a proprietary database engine also developed by Touch Technologies, Inc. TTI created the ARS engine because performance is critical in many applications. For example, ARS is over 20 times faster than MySQL for shared read/write operations. +#Open Database Connectivity - SheerPower supports other database engines through its ODBC interface, and its own ARS engine can be accessed via ODBC in other database applications. +#SheerPower Internet Services (SPINS) Webserver also comes bundled with SheerPower 4GL. The SPINS Webserver comes bundled with SheerPower and was developed for simplicity in use and high-speed for performance. On a modern multi-core system, the SPINS web server can perform over 1,000 page hits per second -- given enough bandwidth of course. +#There is also a Common Gateway Interface (CGI) interface built into SheerPower, along with many other built-in functions designed for high-performance and increased programmer productivity. + +== See Also == +[[wp:SheerPower4GL|Wikipedia:SheerPower4GL]] \ No newline at end of file diff --git a/Lang/Shiny/0DESCRIPTION b/Lang/Shiny/0DESCRIPTION new file mode 100644 index 0000000000..50f2563e02 --- /dev/null +++ b/Lang/Shiny/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language}} + +http://aerosuidae.net/shiny.html \ No newline at end of file diff --git a/Lang/Shiny/99-Bottles-of-Beer b/Lang/Shiny/99-Bottles-of-Beer new file mode 120000 index 0000000000..9e55e69ccd --- /dev/null +++ b/Lang/Shiny/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Shiny \ No newline at end of file diff --git a/Lang/Shiny/A+B b/Lang/Shiny/A+B new file mode 120000 index 0000000000..e750a0f828 --- /dev/null +++ b/Lang/Shiny/A+B @@ -0,0 +1 @@ +../../Task/A+B/Shiny \ No newline at end of file diff --git a/Lang/Shiny/Align-columns b/Lang/Shiny/Align-columns new file mode 120000 index 0000000000..e24035678a --- /dev/null +++ b/Lang/Shiny/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/Shiny \ No newline at end of file diff --git a/Lang/Shiny/Date-format b/Lang/Shiny/Date-format new file mode 120000 index 0000000000..b7883073de --- /dev/null +++ b/Lang/Shiny/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Shiny \ No newline at end of file diff --git a/Lang/Shiny/Hello-world-Text b/Lang/Shiny/Hello-world-Text new file mode 120000 index 0000000000..fafffbb70e --- /dev/null +++ b/Lang/Shiny/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Shiny \ No newline at end of file diff --git a/Lang/Simula/0DESCRIPTION b/Lang/Simula/0DESCRIPTION new file mode 100644 index 0000000000..4cff0ca28c --- /dev/null +++ b/Lang/Simula/0DESCRIPTION @@ -0,0 +1,9 @@ +{{stub}} +{{language}} +Simula is considered the first object-oriented programming language. As its name implies, Simula was designed for doing simulations, and the needs of that domain provided the framework for many of the features of object-oriented languages today. + +Simula has been used in a wide range of applications such as simulating VLSI designs, process modeling, protocols, algorithms, and other applications such as typesetting, computer graphics, and education. Since Simula-type objects are reimplemented in [[C++]], [[Java]] and [[C#]] the influence of Simula is often understated. The creator of C++, Bjarne Stroustrup, has acknowledged that Simula 67 was the greatest influence on him to develop C++, to bring the kind of productivity enhancements offered by Simula to the raw computational speed offered by lower level languages like [[BCPL]].[[#Citation|[1]]] + + +==Citations== +#[[wp:Simula|Wikipedia Simula]] \ No newline at end of file diff --git a/Lang/Sisal/0DESCRIPTION b/Lang/Sisal/0DESCRIPTION new file mode 100644 index 0000000000..91bc351847 --- /dev/null +++ b/Lang/Sisal/0DESCRIPTION @@ -0,0 +1,9 @@ +{{stub}} +{{language +|site=http://sisal.sourceforge.net/ +|LCT=no +}} +{{Wikipedia}} +SISAL (Streams and Iteration in a Single Assignment Language) is a general-purpose single assignment functional programming language with strict semantics, implicit parallelism, and efficient array handling. SISAL outputs a dataflow graph in Intermediary Form 1 (IF1). It was derived from [[derived from::VAL]] (Value-oriented Algorithmic Language), and adds recursion and finite streams. It has a [[Pascal]]-like syntax and was designed to be a common high-level language for numerical programs on a variety of multiprocessors. +==See Also== +[http://www2.cmp.uea.ac.uk/~jrwg/Sisal/ A Tutorial Introduction to Sisal A High Performance, Portable, Parallel Programming Language] \ No newline at end of file diff --git a/Lang/Sisal/Factorial b/Lang/Sisal/Factorial new file mode 120000 index 0000000000..85be5c1865 --- /dev/null +++ b/Lang/Sisal/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Sisal \ No newline at end of file diff --git a/Lang/Sisal/Hello-world-Text b/Lang/Sisal/Hello-world-Text new file mode 120000 index 0000000000..a918cf4f0d --- /dev/null +++ b/Lang/Sisal/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Sisal \ No newline at end of file diff --git a/Lang/Slate/0DESCRIPTION b/Lang/Slate/0DESCRIPTION new file mode 100644 index 0000000000..0ebadac6bc --- /dev/null +++ b/Lang/Slate/0DESCRIPTION @@ -0,0 +1,11 @@ +{{language|Slate +|strength=strong +|checking=dynamic +|site=http://slatelanguage.org/ +|gc=yes +|safety=safe +|express=implicit +|parampass=reference +|compat=duck +|LCT=yes}}'''Slate''' is a prototype-based object-oriented programming language based on [[Self]], [[Common Lisp|CLOS]], and [[Smalltalk]]-80. Slate syntax is intended to be as familiar as possible to a Smalltalker, for the clarity of messages as phrases. Unlike the Smalltalk family, methods within Slate can be assigned to a signature of objects, instead of being installed on one favored receiver. Slate has also many further expansions of the semantics which enable more concise and natural ways to express solutions to problems. Particular attention is being paid to the design of a fuller and more useful set of libraries than even the usual Smalltalk set, for collections, streams, meta-level protocols, concurrency, and exception-handling, among others. Our prime inspirations are the libraries of Strongtalk, [[Common Lisp]], and [[Dylan]]. +
\ No newline at end of file diff --git a/Lang/Slate/100-doors b/Lang/Slate/100-doors new file mode 120000 index 0000000000..ff491b874e --- /dev/null +++ b/Lang/Slate/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Slate \ No newline at end of file diff --git a/Lang/Slate/99-Bottles-of-Beer b/Lang/Slate/99-Bottles-of-Beer new file mode 120000 index 0000000000..a2a1c9914e --- /dev/null +++ b/Lang/Slate/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Slate \ No newline at end of file diff --git a/Lang/Slate/Ackermann-function b/Lang/Slate/Ackermann-function new file mode 120000 index 0000000000..29e0c29fcb --- /dev/null +++ b/Lang/Slate/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Slate \ No newline at end of file diff --git a/Lang/Slate/Add-a-variable-to-a-class-instance-at-runtime b/Lang/Slate/Add-a-variable-to-a-class-instance-at-runtime new file mode 120000 index 0000000000..70ec0b78a7 --- /dev/null +++ b/Lang/Slate/Add-a-variable-to-a-class-instance-at-runtime @@ -0,0 +1 @@ +../../Task/Add-a-variable-to-a-class-instance-at-runtime/Slate \ No newline at end of file diff --git a/Lang/Slate/Apply-a-callback-to-an-array b/Lang/Slate/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..85faed7ed3 --- /dev/null +++ b/Lang/Slate/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Slate \ No newline at end of file diff --git a/Lang/Slate/Arithmetic-Complex b/Lang/Slate/Arithmetic-Complex new file mode 120000 index 0000000000..79d906d571 --- /dev/null +++ b/Lang/Slate/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Slate \ No newline at end of file diff --git a/Lang/Slate/Arithmetic-Integer b/Lang/Slate/Arithmetic-Integer new file mode 120000 index 0000000000..c516047a5e --- /dev/null +++ b/Lang/Slate/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Slate \ No newline at end of file diff --git a/Lang/Slate/Arithmetic-Rational b/Lang/Slate/Arithmetic-Rational new file mode 120000 index 0000000000..cb8c14e006 --- /dev/null +++ b/Lang/Slate/Arithmetic-Rational @@ -0,0 +1 @@ +../../Task/Arithmetic-Rational/Slate \ No newline at end of file diff --git a/Lang/Slate/Array-concatenation b/Lang/Slate/Array-concatenation new file mode 120000 index 0000000000..3b5f04f625 --- /dev/null +++ b/Lang/Slate/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Slate \ No newline at end of file diff --git a/Lang/Slate/Arrays b/Lang/Slate/Arrays new file mode 120000 index 0000000000..73756794bf --- /dev/null +++ b/Lang/Slate/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Slate \ No newline at end of file diff --git a/Lang/Slate/Assertions b/Lang/Slate/Assertions new file mode 120000 index 0000000000..fe6b58157b --- /dev/null +++ b/Lang/Slate/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Slate \ No newline at end of file diff --git a/Lang/Slate/Associative-array-Creation b/Lang/Slate/Associative-array-Creation new file mode 120000 index 0000000000..8c0f7b105f --- /dev/null +++ b/Lang/Slate/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Slate \ No newline at end of file diff --git a/Lang/Slate/Associative-array-Iteration b/Lang/Slate/Associative-array-Iteration new file mode 120000 index 0000000000..2b661bee5f --- /dev/null +++ b/Lang/Slate/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Slate \ No newline at end of file diff --git a/Lang/Slate/Averages-Arithmetic-mean b/Lang/Slate/Averages-Arithmetic-mean new file mode 120000 index 0000000000..a08f7e7787 --- /dev/null +++ b/Lang/Slate/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Slate \ No newline at end of file diff --git a/Lang/Slate/Averages-Median b/Lang/Slate/Averages-Median new file mode 120000 index 0000000000..0448358d08 --- /dev/null +++ b/Lang/Slate/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Slate \ No newline at end of file diff --git a/Lang/Slate/Averages-Mode b/Lang/Slate/Averages-Mode new file mode 120000 index 0000000000..92433744b0 --- /dev/null +++ b/Lang/Slate/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/Slate \ No newline at end of file diff --git a/Lang/Slate/Bitwise-operations b/Lang/Slate/Bitwise-operations new file mode 120000 index 0000000000..761b83be0f --- /dev/null +++ b/Lang/Slate/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Slate \ No newline at end of file diff --git a/Lang/Slate/Character-codes b/Lang/Slate/Character-codes new file mode 120000 index 0000000000..754bd0f56a --- /dev/null +++ b/Lang/Slate/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Slate \ No newline at end of file diff --git a/Lang/Slate/Check-that-file-exists b/Lang/Slate/Check-that-file-exists new file mode 120000 index 0000000000..fb11dd63bf --- /dev/null +++ b/Lang/Slate/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Slate \ No newline at end of file diff --git a/Lang/Slate/Classes b/Lang/Slate/Classes new file mode 120000 index 0000000000..b0f1e8c2b4 --- /dev/null +++ b/Lang/Slate/Classes @@ -0,0 +1 @@ +../../Task/Classes/Slate \ No newline at end of file diff --git a/Lang/Slate/Collections b/Lang/Slate/Collections new file mode 120000 index 0000000000..593de4e709 --- /dev/null +++ b/Lang/Slate/Collections @@ -0,0 +1 @@ +../../Task/Collections/Slate \ No newline at end of file diff --git a/Lang/Slate/Command-line-arguments b/Lang/Slate/Command-line-arguments new file mode 120000 index 0000000000..51adfe919d --- /dev/null +++ b/Lang/Slate/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Slate \ No newline at end of file diff --git a/Lang/Slate/Comments b/Lang/Slate/Comments new file mode 120000 index 0000000000..d2aac1b062 --- /dev/null +++ b/Lang/Slate/Comments @@ -0,0 +1 @@ +../../Task/Comments/Slate \ No newline at end of file diff --git a/Lang/Slate/Conditional-structures b/Lang/Slate/Conditional-structures new file mode 120000 index 0000000000..ac0f8c2888 --- /dev/null +++ b/Lang/Slate/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Slate \ No newline at end of file diff --git a/Lang/Slate/Create-a-file b/Lang/Slate/Create-a-file new file mode 120000 index 0000000000..a23918ed0c --- /dev/null +++ b/Lang/Slate/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Slate \ No newline at end of file diff --git a/Lang/Slate/Delete-a-file b/Lang/Slate/Delete-a-file new file mode 120000 index 0000000000..9e6b57bf46 --- /dev/null +++ b/Lang/Slate/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Slate \ No newline at end of file diff --git a/Lang/Slate/Detect-division-by-zero b/Lang/Slate/Detect-division-by-zero new file mode 120000 index 0000000000..4e06bf0fd2 --- /dev/null +++ b/Lang/Slate/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Slate \ No newline at end of file diff --git a/Lang/Slate/Dot-product b/Lang/Slate/Dot-product new file mode 120000 index 0000000000..e0840092a7 --- /dev/null +++ b/Lang/Slate/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Slate \ No newline at end of file diff --git a/Lang/Slate/Dynamic-variable-names b/Lang/Slate/Dynamic-variable-names new file mode 120000 index 0000000000..3b2b86d4a1 --- /dev/null +++ b/Lang/Slate/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/Slate \ No newline at end of file diff --git a/Lang/Slate/Empty-program b/Lang/Slate/Empty-program new file mode 120000 index 0000000000..cea8e90b74 --- /dev/null +++ b/Lang/Slate/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Slate \ No newline at end of file diff --git a/Lang/Slate/Enumerations b/Lang/Slate/Enumerations new file mode 120000 index 0000000000..6372b09523 --- /dev/null +++ b/Lang/Slate/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Slate \ No newline at end of file diff --git a/Lang/Slate/Exceptions b/Lang/Slate/Exceptions new file mode 120000 index 0000000000..4a0a25a13f --- /dev/null +++ b/Lang/Slate/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Slate \ No newline at end of file diff --git a/Lang/Slate/Execute-a-system-command b/Lang/Slate/Execute-a-system-command new file mode 120000 index 0000000000..51f8c445b3 --- /dev/null +++ b/Lang/Slate/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Slate \ No newline at end of file diff --git a/Lang/Slate/Exponentiation-operator b/Lang/Slate/Exponentiation-operator new file mode 120000 index 0000000000..1f1a54a919 --- /dev/null +++ b/Lang/Slate/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/Slate \ No newline at end of file diff --git a/Lang/Slate/Factorial b/Lang/Slate/Factorial new file mode 120000 index 0000000000..5e42800737 --- /dev/null +++ b/Lang/Slate/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Slate \ No newline at end of file diff --git a/Lang/Slate/Factors-of-an-integer b/Lang/Slate/Factors-of-an-integer new file mode 120000 index 0000000000..c3d05d3715 --- /dev/null +++ b/Lang/Slate/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Slate \ No newline at end of file diff --git a/Lang/Slate/Fibonacci-sequence b/Lang/Slate/Fibonacci-sequence new file mode 120000 index 0000000000..90efb465f1 --- /dev/null +++ b/Lang/Slate/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Slate \ No newline at end of file diff --git a/Lang/Slate/File-IO b/Lang/Slate/File-IO new file mode 120000 index 0000000000..cebb12c3ea --- /dev/null +++ b/Lang/Slate/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Slate \ No newline at end of file diff --git a/Lang/Slate/File-modification-time b/Lang/Slate/File-modification-time new file mode 120000 index 0000000000..de770cc6e7 --- /dev/null +++ b/Lang/Slate/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Slate \ No newline at end of file diff --git a/Lang/Slate/File-size b/Lang/Slate/File-size new file mode 120000 index 0000000000..a850a8fc4a --- /dev/null +++ b/Lang/Slate/File-size @@ -0,0 +1 @@ +../../Task/File-size/Slate \ No newline at end of file diff --git a/Lang/Slate/Filter b/Lang/Slate/Filter new file mode 120000 index 0000000000..8b23579241 --- /dev/null +++ b/Lang/Slate/Filter @@ -0,0 +1 @@ +../../Task/Filter/Slate \ No newline at end of file diff --git a/Lang/Slate/First-class-functions b/Lang/Slate/First-class-functions new file mode 120000 index 0000000000..b8a78bb4fe --- /dev/null +++ b/Lang/Slate/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/Slate \ No newline at end of file diff --git a/Lang/Slate/First-class-functions-Use-numbers-analogously b/Lang/Slate/First-class-functions-Use-numbers-analogously new file mode 120000 index 0000000000..ddd733313c --- /dev/null +++ b/Lang/Slate/First-class-functions-Use-numbers-analogously @@ -0,0 +1 @@ +../../Task/First-class-functions-Use-numbers-analogously/Slate \ No newline at end of file diff --git a/Lang/Slate/FizzBuzz b/Lang/Slate/FizzBuzz new file mode 120000 index 0000000000..b44912ddbf --- /dev/null +++ b/Lang/Slate/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Slate \ No newline at end of file diff --git a/Lang/Slate/Flatten-a-list b/Lang/Slate/Flatten-a-list new file mode 120000 index 0000000000..ae4c7ea876 --- /dev/null +++ b/Lang/Slate/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Slate \ No newline at end of file diff --git a/Lang/Slate/Fork b/Lang/Slate/Fork new file mode 120000 index 0000000000..02d61d1547 --- /dev/null +++ b/Lang/Slate/Fork @@ -0,0 +1 @@ +../../Task/Fork/Slate \ No newline at end of file diff --git a/Lang/Slate/Forward-difference b/Lang/Slate/Forward-difference new file mode 120000 index 0000000000..a44c0d7fc6 --- /dev/null +++ b/Lang/Slate/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Slate \ No newline at end of file diff --git a/Lang/Slate/Function-composition b/Lang/Slate/Function-composition new file mode 120000 index 0000000000..2aa9985c23 --- /dev/null +++ b/Lang/Slate/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Slate \ No newline at end of file diff --git a/Lang/Slate/Function-definition b/Lang/Slate/Function-definition new file mode 120000 index 0000000000..604edc2478 --- /dev/null +++ b/Lang/Slate/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Slate \ No newline at end of file diff --git a/Lang/Slate/Generic-swap b/Lang/Slate/Generic-swap new file mode 120000 index 0000000000..4fb8e877d2 --- /dev/null +++ b/Lang/Slate/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Slate \ No newline at end of file diff --git a/Lang/Slate/Greatest-common-divisor b/Lang/Slate/Greatest-common-divisor new file mode 120000 index 0000000000..801fae0e86 --- /dev/null +++ b/Lang/Slate/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Slate \ No newline at end of file diff --git a/Lang/Slate/Greatest-element-of-a-list b/Lang/Slate/Greatest-element-of-a-list new file mode 120000 index 0000000000..0a170cffe2 --- /dev/null +++ b/Lang/Slate/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Slate \ No newline at end of file diff --git a/Lang/Slate/Hello-world-Standard-error b/Lang/Slate/Hello-world-Standard-error new file mode 120000 index 0000000000..dcc063be98 --- /dev/null +++ b/Lang/Slate/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Slate \ No newline at end of file diff --git a/Lang/Slate/Hello-world-Text b/Lang/Slate/Hello-world-Text new file mode 120000 index 0000000000..205f75f1e2 --- /dev/null +++ b/Lang/Slate/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Slate \ No newline at end of file diff --git a/Lang/Slate/Higher-order-functions b/Lang/Slate/Higher-order-functions new file mode 120000 index 0000000000..fc0fbb25e3 --- /dev/null +++ b/Lang/Slate/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Slate \ No newline at end of file diff --git a/Lang/Slate/Host-introspection b/Lang/Slate/Host-introspection new file mode 120000 index 0000000000..a7cb98ac56 --- /dev/null +++ b/Lang/Slate/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/Slate \ No newline at end of file diff --git a/Lang/Slate/Hostname b/Lang/Slate/Hostname new file mode 120000 index 0000000000..caf6db45b0 --- /dev/null +++ b/Lang/Slate/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Slate \ No newline at end of file diff --git a/Lang/Slate/Increment-a-numerical-string b/Lang/Slate/Increment-a-numerical-string new file mode 120000 index 0000000000..f43b3a31cf --- /dev/null +++ b/Lang/Slate/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Slate \ No newline at end of file diff --git a/Lang/Slate/Infinity b/Lang/Slate/Infinity new file mode 120000 index 0000000000..a35f4983c3 --- /dev/null +++ b/Lang/Slate/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Slate \ No newline at end of file diff --git a/Lang/Slate/Inheritance-Multiple b/Lang/Slate/Inheritance-Multiple new file mode 120000 index 0000000000..264695ab8b --- /dev/null +++ b/Lang/Slate/Inheritance-Multiple @@ -0,0 +1 @@ +../../Task/Inheritance-Multiple/Slate \ No newline at end of file diff --git a/Lang/Slate/Inheritance-Single b/Lang/Slate/Inheritance-Single new file mode 120000 index 0000000000..d8cd336b36 --- /dev/null +++ b/Lang/Slate/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/Slate \ No newline at end of file diff --git a/Lang/Slate/Input-loop b/Lang/Slate/Input-loop new file mode 120000 index 0000000000..ca68e74b3b --- /dev/null +++ b/Lang/Slate/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Slate \ No newline at end of file diff --git a/Lang/Slate/Integer-comparison b/Lang/Slate/Integer-comparison new file mode 120000 index 0000000000..2961c8e74c --- /dev/null +++ b/Lang/Slate/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Slate \ No newline at end of file diff --git a/Lang/Slate/Interactive-programming b/Lang/Slate/Interactive-programming new file mode 120000 index 0000000000..758c825dfc --- /dev/null +++ b/Lang/Slate/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Slate \ No newline at end of file diff --git a/Lang/Slate/Introspection b/Lang/Slate/Introspection new file mode 120000 index 0000000000..1d58d03c27 --- /dev/null +++ b/Lang/Slate/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Slate \ No newline at end of file diff --git a/Lang/Slate/Literals-Integer b/Lang/Slate/Literals-Integer new file mode 120000 index 0000000000..a4adfa3a3d --- /dev/null +++ b/Lang/Slate/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Slate \ No newline at end of file diff --git a/Lang/Slate/Literals-String b/Lang/Slate/Literals-String new file mode 120000 index 0000000000..b66909b724 --- /dev/null +++ b/Lang/Slate/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Slate \ No newline at end of file diff --git a/Lang/Slate/Logical-operations b/Lang/Slate/Logical-operations new file mode 120000 index 0000000000..9ed3f926ba --- /dev/null +++ b/Lang/Slate/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Slate \ No newline at end of file diff --git a/Lang/Slate/Long-multiplication b/Lang/Slate/Long-multiplication new file mode 120000 index 0000000000..7f3b29549c --- /dev/null +++ b/Lang/Slate/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/Slate \ No newline at end of file diff --git a/Lang/Slate/Longest-common-subsequence b/Lang/Slate/Longest-common-subsequence new file mode 120000 index 0000000000..c332739050 --- /dev/null +++ b/Lang/Slate/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/Slate \ No newline at end of file diff --git a/Lang/Slate/Loops-Do-while b/Lang/Slate/Loops-Do-while new file mode 120000 index 0000000000..1167c1b2fa --- /dev/null +++ b/Lang/Slate/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Slate \ No newline at end of file diff --git a/Lang/Slate/Loops-Downward-for b/Lang/Slate/Loops-Downward-for new file mode 120000 index 0000000000..37e4f3a0b1 --- /dev/null +++ b/Lang/Slate/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Slate \ No newline at end of file diff --git a/Lang/Slate/Loops-For b/Lang/Slate/Loops-For new file mode 120000 index 0000000000..50ab3c8419 --- /dev/null +++ b/Lang/Slate/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Slate \ No newline at end of file diff --git a/Lang/Slate/Loops-For-with-a-specified-step b/Lang/Slate/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..9c1233705e --- /dev/null +++ b/Lang/Slate/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Slate \ No newline at end of file diff --git a/Lang/Slate/Loops-Foreach b/Lang/Slate/Loops-Foreach new file mode 120000 index 0000000000..4152dffb8b --- /dev/null +++ b/Lang/Slate/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Slate \ No newline at end of file diff --git a/Lang/Slate/Loops-Infinite b/Lang/Slate/Loops-Infinite new file mode 120000 index 0000000000..22ebaa612a --- /dev/null +++ b/Lang/Slate/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Slate \ No newline at end of file diff --git a/Lang/Slate/Loops-While b/Lang/Slate/Loops-While new file mode 120000 index 0000000000..e97defa657 --- /dev/null +++ b/Lang/Slate/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Slate \ No newline at end of file diff --git a/Lang/Slate/MD5 b/Lang/Slate/MD5 new file mode 120000 index 0000000000..26e1004c78 --- /dev/null +++ b/Lang/Slate/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Slate \ No newline at end of file diff --git a/Lang/Slate/Search-a-list b/Lang/Slate/Search-a-list new file mode 120000 index 0000000000..1ee97e5209 --- /dev/null +++ b/Lang/Slate/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Slate \ No newline at end of file diff --git a/Lang/Smalltalk/Arbitrary-precision-integers-(included) b/Lang/Smalltalk/Arbitrary-precision-integers-(included) deleted file mode 120000 index 78954d80d6..0000000000 --- a/Lang/Smalltalk/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Smalltalk \ No newline at end of file diff --git a/Lang/Snobol/0DESCRIPTION b/Lang/Snobol/0DESCRIPTION new file mode 100644 index 0000000000..f66cf163bf --- /dev/null +++ b/Lang/Snobol/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/Soar/0DESCRIPTION b/Lang/Soar/0DESCRIPTION new file mode 100644 index 0000000000..68689371af --- /dev/null +++ b/Lang/Soar/0DESCRIPTION @@ -0,0 +1,5 @@ +This is the cognitive architecture created by created by John Laird, Allen Newell, and Paul Rosenbloom. + +The primary implementation is on google code: http://code.google.com/p/soar/ + +{{language}} \ No newline at end of file diff --git a/Lang/Soar/Ethiopian-multiplication b/Lang/Soar/Ethiopian-multiplication new file mode 120000 index 0000000000..6ceb968e37 --- /dev/null +++ b/Lang/Soar/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Soar \ No newline at end of file diff --git a/Lang/Squirrel/0DESCRIPTION b/Lang/Squirrel/0DESCRIPTION new file mode 100644 index 0000000000..4b8fbb74b7 --- /dev/null +++ b/Lang/Squirrel/0DESCRIPTION @@ -0,0 +1,17 @@ +{{stub}} +{{language +|exec=interpreted +|site=http://www.squirrel-lang.org/ +|strength=weak +|checking=dynamic +|parampass=both +|gc=yes +|LCT=yes +}} +{{language programming paradigm|Object-oriented}} +{{language programming paradigm|imperative}} + +'''Squirrel''' is a language designed to be embedded, and extended, having a minimal footprint. It has been featured in some [[wp:Squirrel_(programming_language)|games and applications]] + +==Citations== +* [[wp:Squirrel_(programming_language)]] \ No newline at end of file diff --git a/Lang/Squirrel/99-Bottles-of-Beer b/Lang/Squirrel/99-Bottles-of-Beer new file mode 120000 index 0000000000..8119ad34d0 --- /dev/null +++ b/Lang/Squirrel/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Squirrel \ No newline at end of file diff --git a/Lang/Squirrel/FizzBuzz b/Lang/Squirrel/FizzBuzz new file mode 120000 index 0000000000..c84af76739 --- /dev/null +++ b/Lang/Squirrel/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Squirrel \ No newline at end of file diff --git a/Lang/Standard-ML/0DESCRIPTION b/Lang/Standard-ML/0DESCRIPTION new file mode 100644 index 0000000000..44edea48d0 --- /dev/null +++ b/Lang/Standard-ML/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language +|exec=machine +|strength=strong +|checking=static +|parampass=value +|gc=yes +|express=implicit +|site=http://www.smlnj.org/ +}}{{language programming paradigm|functional}} +{{Wikipedia}} +'''Standard ML''' (SML) is a general-purpose, modular, [[functional programming]] language with [[compile-time]] [[type checking]] and type inference. It is popular among compiler writers and programming language researchers, as well as in the development of theorem provers. + +SML is a modern descendant of the [[derived from::ML]] programming language used in the LCF theorem-proving project. It is unique among widely used languages in that it has a formal specification, given as typing rules and operational semantics in The Definition of Standard ML (1990, revised and simplified as The Definition of Standard ML (Revised) in 1997). \ No newline at end of file diff --git a/Lang/Standard-ML/99-Bottles-of-Beer b/Lang/Standard-ML/99-Bottles-of-Beer new file mode 120000 index 0000000000..e1efc21ca1 --- /dev/null +++ b/Lang/Standard-ML/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Accumulator-factory b/Lang/Standard-ML/Accumulator-factory new file mode 120000 index 0000000000..c0411f0980 --- /dev/null +++ b/Lang/Standard-ML/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Ackermann-function b/Lang/Standard-ML/Ackermann-function new file mode 120000 index 0000000000..40631a2c07 --- /dev/null +++ b/Lang/Standard-ML/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Apply-a-callback-to-an-array b/Lang/Standard-ML/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..68ffda37ad --- /dev/null +++ b/Lang/Standard-ML/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Arbitrary-precision-integers-included b/Lang/Standard-ML/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..8360f335a2 --- /dev/null +++ b/Lang/Standard-ML/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Arithmetic-Complex b/Lang/Standard-ML/Arithmetic-Complex new file mode 120000 index 0000000000..17158aaf05 --- /dev/null +++ b/Lang/Standard-ML/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Arithmetic-Integer b/Lang/Standard-ML/Arithmetic-Integer new file mode 120000 index 0000000000..4a11237662 --- /dev/null +++ b/Lang/Standard-ML/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Array-concatenation b/Lang/Standard-ML/Array-concatenation new file mode 120000 index 0000000000..9a77ca89ac --- /dev/null +++ b/Lang/Standard-ML/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Averages-Arithmetic-mean b/Lang/Standard-ML/Averages-Arithmetic-mean new file mode 120000 index 0000000000..b53ff24766 --- /dev/null +++ b/Lang/Standard-ML/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Binary-search b/Lang/Standard-ML/Binary-search new file mode 120000 index 0000000000..aa3893af98 --- /dev/null +++ b/Lang/Standard-ML/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Bitwise-operations b/Lang/Standard-ML/Bitwise-operations new file mode 120000 index 0000000000..d5b7883641 --- /dev/null +++ b/Lang/Standard-ML/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Boolean-values b/Lang/Standard-ML/Boolean-values new file mode 120000 index 0000000000..7ddadcf450 --- /dev/null +++ b/Lang/Standard-ML/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Character-codes b/Lang/Standard-ML/Character-codes new file mode 120000 index 0000000000..21ab7f2a03 --- /dev/null +++ b/Lang/Standard-ML/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Character-matching b/Lang/Standard-ML/Character-matching new file mode 120000 index 0000000000..3c55279b79 --- /dev/null +++ b/Lang/Standard-ML/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Check-that-file-exists b/Lang/Standard-ML/Check-that-file-exists new file mode 120000 index 0000000000..54ccee8d03 --- /dev/null +++ b/Lang/Standard-ML/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Combinations b/Lang/Standard-ML/Combinations new file mode 120000 index 0000000000..503b9a0c6c --- /dev/null +++ b/Lang/Standard-ML/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Command-line-arguments b/Lang/Standard-ML/Command-line-arguments new file mode 120000 index 0000000000..04162b30f8 --- /dev/null +++ b/Lang/Standard-ML/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Comments b/Lang/Standard-ML/Comments new file mode 120000 index 0000000000..89851f62fc --- /dev/null +++ b/Lang/Standard-ML/Comments @@ -0,0 +1 @@ +../../Task/Comments/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Compound-data-type b/Lang/Standard-ML/Compound-data-type new file mode 120000 index 0000000000..188bcf0332 --- /dev/null +++ b/Lang/Standard-ML/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Count-occurrences-of-a-substring b/Lang/Standard-ML/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..9620d7c8f5 --- /dev/null +++ b/Lang/Standard-ML/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Create-a-file b/Lang/Standard-ML/Create-a-file new file mode 120000 index 0000000000..6c4eccb6ae --- /dev/null +++ b/Lang/Standard-ML/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Create-a-two-dimensional-array-at-runtime b/Lang/Standard-ML/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..155a65d703 --- /dev/null +++ b/Lang/Standard-ML/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Date-format b/Lang/Standard-ML/Date-format new file mode 120000 index 0000000000..0c3243e101 --- /dev/null +++ b/Lang/Standard-ML/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Delete-a-file b/Lang/Standard-ML/Delete-a-file new file mode 120000 index 0000000000..6f9def5531 --- /dev/null +++ b/Lang/Standard-ML/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Detect-division-by-zero b/Lang/Standard-ML/Detect-division-by-zero new file mode 120000 index 0000000000..50aa4af8c5 --- /dev/null +++ b/Lang/Standard-ML/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Determine-if-a-string-is-numeric b/Lang/Standard-ML/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..019f1e1c70 --- /dev/null +++ b/Lang/Standard-ML/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Dot-product b/Lang/Standard-ML/Dot-product new file mode 120000 index 0000000000..ab31470ab2 --- /dev/null +++ b/Lang/Standard-ML/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Empty-program b/Lang/Standard-ML/Empty-program new file mode 120000 index 0000000000..76e6ae2620 --- /dev/null +++ b/Lang/Standard-ML/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Enumerations b/Lang/Standard-ML/Enumerations new file mode 120000 index 0000000000..ebce5d10d1 --- /dev/null +++ b/Lang/Standard-ML/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Exceptions b/Lang/Standard-ML/Exceptions new file mode 120000 index 0000000000..f66140f1dd --- /dev/null +++ b/Lang/Standard-ML/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Execute-a-system-command b/Lang/Standard-ML/Execute-a-system-command new file mode 120000 index 0000000000..19c5db464d --- /dev/null +++ b/Lang/Standard-ML/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Exponentiation-operator b/Lang/Standard-ML/Exponentiation-operator new file mode 120000 index 0000000000..53c0766c23 --- /dev/null +++ b/Lang/Standard-ML/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Factorial b/Lang/Standard-ML/Factorial new file mode 120000 index 0000000000..eb2500a859 --- /dev/null +++ b/Lang/Standard-ML/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Fibonacci-sequence b/Lang/Standard-ML/Fibonacci-sequence new file mode 120000 index 0000000000..500cf5d82e --- /dev/null +++ b/Lang/Standard-ML/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/File-IO b/Lang/Standard-ML/File-IO new file mode 120000 index 0000000000..3f4f253fca --- /dev/null +++ b/Lang/Standard-ML/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/File-modification-time b/Lang/Standard-ML/File-modification-time new file mode 120000 index 0000000000..715682c34e --- /dev/null +++ b/Lang/Standard-ML/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/File-size b/Lang/Standard-ML/File-size new file mode 120000 index 0000000000..cf7dec42d4 --- /dev/null +++ b/Lang/Standard-ML/File-size @@ -0,0 +1 @@ +../../Task/File-size/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Filter b/Lang/Standard-ML/Filter new file mode 120000 index 0000000000..67251d6a40 --- /dev/null +++ b/Lang/Standard-ML/Filter @@ -0,0 +1 @@ +../../Task/Filter/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/First-class-functions b/Lang/Standard-ML/First-class-functions new file mode 120000 index 0000000000..721b01c969 --- /dev/null +++ b/Lang/Standard-ML/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/FizzBuzz b/Lang/Standard-ML/FizzBuzz new file mode 120000 index 0000000000..a297dedd92 --- /dev/null +++ b/Lang/Standard-ML/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Fork b/Lang/Standard-ML/Fork new file mode 120000 index 0000000000..79c8e8c4f3 --- /dev/null +++ b/Lang/Standard-ML/Fork @@ -0,0 +1 @@ +../../Task/Fork/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Formatted-numeric-output b/Lang/Standard-ML/Formatted-numeric-output new file mode 120000 index 0000000000..369d501e0e --- /dev/null +++ b/Lang/Standard-ML/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Forward-difference b/Lang/Standard-ML/Forward-difference new file mode 120000 index 0000000000..7937f08d98 --- /dev/null +++ b/Lang/Standard-ML/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Function-composition b/Lang/Standard-ML/Function-composition new file mode 120000 index 0000000000..b6c614b200 --- /dev/null +++ b/Lang/Standard-ML/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Function-definition b/Lang/Standard-ML/Function-definition new file mode 120000 index 0000000000..a6ce936330 --- /dev/null +++ b/Lang/Standard-ML/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Generic-swap b/Lang/Standard-ML/Generic-swap new file mode 120000 index 0000000000..2d81233be5 --- /dev/null +++ b/Lang/Standard-ML/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Greatest-common-divisor b/Lang/Standard-ML/Greatest-common-divisor new file mode 120000 index 0000000000..019dbbd5a2 --- /dev/null +++ b/Lang/Standard-ML/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Greatest-element-of-a-list b/Lang/Standard-ML/Greatest-element-of-a-list new file mode 120000 index 0000000000..ab77504779 --- /dev/null +++ b/Lang/Standard-ML/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Greatest-subsequential-sum b/Lang/Standard-ML/Greatest-subsequential-sum new file mode 120000 index 0000000000..3f06d2d354 --- /dev/null +++ b/Lang/Standard-ML/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Hash-from-two-arrays b/Lang/Standard-ML/Hash-from-two-arrays new file mode 120000 index 0000000000..1a7ddc9277 --- /dev/null +++ b/Lang/Standard-ML/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Hello-world-Newline-omission b/Lang/Standard-ML/Hello-world-Newline-omission new file mode 120000 index 0000000000..1283fed740 --- /dev/null +++ b/Lang/Standard-ML/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Hello-world-Standard-error b/Lang/Standard-ML/Hello-world-Standard-error new file mode 120000 index 0000000000..eaf5031b04 --- /dev/null +++ b/Lang/Standard-ML/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Hello-world-Text b/Lang/Standard-ML/Hello-world-Text new file mode 120000 index 0000000000..4657023177 --- /dev/null +++ b/Lang/Standard-ML/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Higher-order-functions b/Lang/Standard-ML/Higher-order-functions new file mode 120000 index 0000000000..d1b2841cc7 --- /dev/null +++ b/Lang/Standard-ML/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Horners-rule-for-polynomial-evaluation b/Lang/Standard-ML/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..330c7b4ae6 --- /dev/null +++ b/Lang/Standard-ML/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Hostname b/Lang/Standard-ML/Hostname new file mode 120000 index 0000000000..b4d1a0d0c6 --- /dev/null +++ b/Lang/Standard-ML/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Huffman-coding b/Lang/Standard-ML/Huffman-coding new file mode 120000 index 0000000000..5e781c4a05 --- /dev/null +++ b/Lang/Standard-ML/Huffman-coding @@ -0,0 +1 @@ +../../Task/Huffman-coding/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Increment-a-numerical-string b/Lang/Standard-ML/Increment-a-numerical-string new file mode 120000 index 0000000000..1db6c8f2a2 --- /dev/null +++ b/Lang/Standard-ML/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Infinity b/Lang/Standard-ML/Infinity new file mode 120000 index 0000000000..b1111a33ba --- /dev/null +++ b/Lang/Standard-ML/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Integer-comparison b/Lang/Standard-ML/Integer-comparison new file mode 120000 index 0000000000..dd9397b75a --- /dev/null +++ b/Lang/Standard-ML/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Interactive-programming b/Lang/Standard-ML/Interactive-programming new file mode 120000 index 0000000000..25b8c5e0a9 --- /dev/null +++ b/Lang/Standard-ML/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Jensens-Device b/Lang/Standard-ML/Jensens-Device new file mode 120000 index 0000000000..a91a9f6018 --- /dev/null +++ b/Lang/Standard-ML/Jensens-Device @@ -0,0 +1 @@ +../../Task/Jensens-Device/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Literals-Integer b/Lang/Standard-ML/Literals-Integer new file mode 120000 index 0000000000..c191873ce7 --- /dev/null +++ b/Lang/Standard-ML/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Literals-String b/Lang/Standard-ML/Literals-String new file mode 120000 index 0000000000..5885ffe592 --- /dev/null +++ b/Lang/Standard-ML/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Logical-operations b/Lang/Standard-ML/Logical-operations new file mode 120000 index 0000000000..72b54fd596 --- /dev/null +++ b/Lang/Standard-ML/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Loop-over-multiple-arrays-simultaneously b/Lang/Standard-ML/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..e26aac141e --- /dev/null +++ b/Lang/Standard-ML/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Loops-Foreach b/Lang/Standard-ML/Loops-Foreach new file mode 120000 index 0000000000..75c5cc3173 --- /dev/null +++ b/Lang/Standard-ML/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Loops-Infinite b/Lang/Standard-ML/Loops-Infinite new file mode 120000 index 0000000000..7625c961b1 --- /dev/null +++ b/Lang/Standard-ML/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Loops-While b/Lang/Standard-ML/Loops-While new file mode 120000 index 0000000000..5fc22e1dec --- /dev/null +++ b/Lang/Standard-ML/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Man-or-boy-test b/Lang/Standard-ML/Man-or-boy-test new file mode 120000 index 0000000000..d38e9441eb --- /dev/null +++ b/Lang/Standard-ML/Man-or-boy-test @@ -0,0 +1 @@ +../../Task/Man-or-boy-test/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Miller-Rabin-primality-test b/Lang/Standard-ML/Miller-Rabin-primality-test new file mode 120000 index 0000000000..ba4b002043 --- /dev/null +++ b/Lang/Standard-ML/Miller-Rabin-primality-test @@ -0,0 +1 @@ +../../Task/Miller-Rabin-primality-test/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Mutual-recursion b/Lang/Standard-ML/Mutual-recursion new file mode 120000 index 0000000000..cd89e678a5 --- /dev/null +++ b/Lang/Standard-ML/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Quine b/Lang/Standard-ML/Quine new file mode 120000 index 0000000000..58a0419a27 --- /dev/null +++ b/Lang/Standard-ML/Quine @@ -0,0 +1 @@ +../../Task/Quine/Standard-ML \ No newline at end of file diff --git a/Lang/Standard-ML/Search-a-list b/Lang/Standard-ML/Search-a-list new file mode 120000 index 0000000000..d6f13ea580 --- /dev/null +++ b/Lang/Standard-ML/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Standard-ML \ No newline at end of file diff --git a/Lang/StreamIt/0DESCRIPTION b/Lang/StreamIt/0DESCRIPTION new file mode 100644 index 0000000000..0a3670d881 --- /dev/null +++ b/Lang/StreamIt/0DESCRIPTION @@ -0,0 +1,5 @@ +{{language|StreamIt +|site=http://groups.csail.mit.edu/cag/streamit/index.shtml +}} + +StreamIt is a programming language and a compilation infrastructure, specifically engineered for modern streaming systems. It is designed to facilitate the programming of large streaming applications, as well as their efficient and effective mapping to a wide variety of target architectures, including commercial-off-the-shelf uniprocessors, multicore architectures, and clusters of workstations. \ No newline at end of file diff --git a/Lang/StreamIt/Fibonacci-sequence b/Lang/StreamIt/Fibonacci-sequence new file mode 120000 index 0000000000..03027cc3e0 --- /dev/null +++ b/Lang/StreamIt/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/StreamIt \ No newline at end of file diff --git a/Lang/Suneido/0DESCRIPTION b/Lang/Suneido/0DESCRIPTION new file mode 100644 index 0000000000..a06619c20d --- /dev/null +++ b/Lang/Suneido/0DESCRIPTION @@ -0,0 +1,15 @@ +{{language +|site=http://www.suneido.com +|express=implicit +|checking=dynamic +|gc=yes +|exec=interpreted}} +{{language programming paradigm|object-oriented}} + +

Suneido™ is a complete, integrated application platform - a system for developing and deploying applications without the frustrations of integrating multiple different products. Suneido incorporates an object-oriented programming language, client-server relational database software, and application frameworks and components. It includes the integrated development environment ([[IDE]]) used to create applications as well as the client and server required to run applications across networks. Suneido is [[open source]] - it is provided free, with complete source code.

+ +

Our mission is to provide a simple, open, lightweight, industrial strength alternative to large, complex, expensive, closed application technologies such as [[Visual Basic]], Access, FoxPro, [[Delphi]], [[Oracle]], and SQL Server.

+ +

Suneido currently runs on [[Microsoft]] [[Windows]] NT, 2000, 2003, XP, Vista, and Windows 7.

+ +— [http://www.suneido.com Suneido Home Page] \ No newline at end of file diff --git a/Lang/Suneido/99-Bottles-of-Beer b/Lang/Suneido/99-Bottles-of-Beer new file mode 120000 index 0000000000..45c8ebbf81 --- /dev/null +++ b/Lang/Suneido/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Animation b/Lang/Suneido/Animation new file mode 120000 index 0000000000..d823b1264f --- /dev/null +++ b/Lang/Suneido/Animation @@ -0,0 +1 @@ +../../Task/Animation/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Arrays b/Lang/Suneido/Arrays new file mode 120000 index 0000000000..0fb8b72ec2 --- /dev/null +++ b/Lang/Suneido/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Date-format b/Lang/Suneido/Date-format new file mode 120000 index 0000000000..7d51d8e36d --- /dev/null +++ b/Lang/Suneido/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Day-of-the-week b/Lang/Suneido/Day-of-the-week new file mode 120000 index 0000000000..eaa7be6c89 --- /dev/null +++ b/Lang/Suneido/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Empty-program b/Lang/Suneido/Empty-program new file mode 120000 index 0000000000..1efae9ed6e --- /dev/null +++ b/Lang/Suneido/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Flatten-a-list b/Lang/Suneido/Flatten-a-list new file mode 120000 index 0000000000..2f510b8e97 --- /dev/null +++ b/Lang/Suneido/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Formatted-numeric-output b/Lang/Suneido/Formatted-numeric-output new file mode 120000 index 0000000000..b325f53c51 --- /dev/null +++ b/Lang/Suneido/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Hello-world-Text b/Lang/Suneido/Hello-world-Text new file mode 120000 index 0000000000..57ca4ade0f --- /dev/null +++ b/Lang/Suneido/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Loops-Break b/Lang/Suneido/Loops-Break new file mode 120000 index 0000000000..9a7c57cc59 --- /dev/null +++ b/Lang/Suneido/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Loops-Continue b/Lang/Suneido/Loops-Continue new file mode 120000 index 0000000000..efb452c9d4 --- /dev/null +++ b/Lang/Suneido/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Loops-Do-while b/Lang/Suneido/Loops-Do-while new file mode 120000 index 0000000000..bb6b7ee92c --- /dev/null +++ b/Lang/Suneido/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Loops-For b/Lang/Suneido/Loops-For new file mode 120000 index 0000000000..c619cf0f31 --- /dev/null +++ b/Lang/Suneido/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Loops-Foreach b/Lang/Suneido/Loops-Foreach new file mode 120000 index 0000000000..a3026cf482 --- /dev/null +++ b/Lang/Suneido/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Suneido \ No newline at end of file diff --git a/Lang/Suneido/Loops-While b/Lang/Suneido/Loops-While new file mode 120000 index 0000000000..81acf55fa5 --- /dev/null +++ b/Lang/Suneido/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Suneido \ No newline at end of file diff --git a/Lang/Suneido/MD5 b/Lang/Suneido/MD5 new file mode 120000 index 0000000000..177b91ecfd --- /dev/null +++ b/Lang/Suneido/MD5 @@ -0,0 +1 @@ +../../Task/MD5/Suneido \ No newline at end of file diff --git a/Lang/SuperCollider/0DESCRIPTION b/Lang/SuperCollider/0DESCRIPTION new file mode 100644 index 0000000000..2d33371297 --- /dev/null +++ b/Lang/SuperCollider/0DESCRIPTION @@ -0,0 +1,6 @@ +{{stub}}{{language +|checking=dynamic +|exec=interpreted +|site=http://supercollider.sourceforge.net/ +|LCT=no}}{{language programming paradigm|object-oriented}} +SuperCollider is an environment and programming language for real time audio synthesis and algorithmic composition. It provides an interpreted object-oriented language which functions as a network client to a state of the art, realtime sound synthesis server. \ No newline at end of file diff --git a/Lang/SuperCollider/Apply-a-callback-to-an-array b/Lang/SuperCollider/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..9860577b2d --- /dev/null +++ b/Lang/SuperCollider/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/SuperCollider \ No newline at end of file diff --git a/Lang/SuperCollider/Classes b/Lang/SuperCollider/Classes new file mode 120000 index 0000000000..b73d6da814 --- /dev/null +++ b/Lang/SuperCollider/Classes @@ -0,0 +1 @@ +../../Task/Classes/SuperCollider \ No newline at end of file diff --git a/Lang/SuperCollider/List-comprehensions b/Lang/SuperCollider/List-comprehensions new file mode 120000 index 0000000000..cfb74efccf --- /dev/null +++ b/Lang/SuperCollider/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/SuperCollider \ No newline at end of file diff --git a/Lang/SuperCollider/Loop-over-multiple-arrays-simultaneously b/Lang/SuperCollider/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..aed1a15076 --- /dev/null +++ b/Lang/SuperCollider/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/SuperCollider \ No newline at end of file diff --git a/Lang/Superbase-BASIC/0DESCRIPTION b/Lang/Superbase-BASIC/0DESCRIPTION new file mode 100644 index 0000000000..f66cf163bf --- /dev/null +++ b/Lang/Superbase-BASIC/0DESCRIPTION @@ -0,0 +1 @@ +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/Supernova/0DESCRIPTION b/Lang/Supernova/0DESCRIPTION new file mode 100644 index 0000000000..7de4c6258f --- /dev/null +++ b/Lang/Supernova/0DESCRIPTION @@ -0,0 +1,6 @@ +{{stub}}{{language +|Supernova +|site=http://supernova.sourceforge.net/ +}} + +The Supernova Programming language is a modern scripting language which presents the concept of programming with direct Fiction Description using Clear subset of pure Human Language (Arabic or English). \ No newline at end of file diff --git a/Lang/Supernova/Hello-world-Graphical b/Lang/Supernova/Hello-world-Graphical new file mode 120000 index 0000000000..24f7317d29 --- /dev/null +++ b/Lang/Supernova/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Supernova \ No newline at end of file diff --git a/Lang/SystemVerilog/0DESCRIPTION b/Lang/SystemVerilog/0DESCRIPTION new file mode 100644 index 0000000000..f48711226e --- /dev/null +++ b/Lang/SystemVerilog/0DESCRIPTION @@ -0,0 +1,25 @@ +{{language|SystemVerilog +|site=http://www.systemverilog.org/ +}} is a language used for hardware design and verification. It is defined by IEEE standard 1800-2005, which extends the hardware description language Verilog (IEEE 1364-2001). SystemVerilog has strong support for concurrency, but though the execution model is based on a single thread that provides the illusion of concurrency via a simulation model known as two-list simulation: first all the "outputs" (of all processes) are calculated as functions of the current inputs; and then the inputs to all processes are updated from the outputs that drive them. So, for example: + + + always @(posedge clk) begin + a <= b; + b <= a; + end + + +simply swaps the two values on each rising clock edge. The result of both the the assignments are calculated on their rhs input values at the start of the simulation "delta cycle". Only after both updates are known will the assignments actually be performed. So there is a strong illusion that the two statements execute concurrently. + +SystemVerilog adds many features: + +Design Subset: + +* packed structures and unions +* enumeration types + +Verification Subset: + +* classes +* (temporal) assertions +* random sequence generation, and constrained random variables \ No newline at end of file diff --git a/Lang/SystemVerilog/Bitwise-operations b/Lang/SystemVerilog/Bitwise-operations new file mode 120000 index 0000000000..c176196d27 --- /dev/null +++ b/Lang/SystemVerilog/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/SystemVerilog \ No newline at end of file diff --git a/Lang/SystemVerilog/Constrained-random-points-on-a-circle b/Lang/SystemVerilog/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..664d5e9c69 --- /dev/null +++ b/Lang/SystemVerilog/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/SystemVerilog \ No newline at end of file diff --git a/Lang/SystemVerilog/Conways-Game-of-Life b/Lang/SystemVerilog/Conways-Game-of-Life new file mode 120000 index 0000000000..4474337596 --- /dev/null +++ b/Lang/SystemVerilog/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/SystemVerilog \ No newline at end of file diff --git a/Lang/SystemVerilog/Four-bit-adder b/Lang/SystemVerilog/Four-bit-adder new file mode 120000 index 0000000000..d523bca4ee --- /dev/null +++ b/Lang/SystemVerilog/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/SystemVerilog \ No newline at end of file diff --git a/Lang/SystemVerilog/Loops-Foreach b/Lang/SystemVerilog/Loops-Foreach new file mode 120000 index 0000000000..9efe6de5c4 --- /dev/null +++ b/Lang/SystemVerilog/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/SystemVerilog \ No newline at end of file diff --git a/Lang/SystemVerilog/Loops-Infinite b/Lang/SystemVerilog/Loops-Infinite new file mode 120000 index 0000000000..b653367974 --- /dev/null +++ b/Lang/SystemVerilog/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/SystemVerilog \ No newline at end of file diff --git a/Lang/TAL/0DESCRIPTION b/Lang/TAL/0DESCRIPTION new file mode 100644 index 0000000000..ad582b08fd --- /dev/null +++ b/Lang/TAL/0DESCRIPTION @@ -0,0 +1,6 @@ +{{stub}}{{language|TAL +|site=http://www.cs.cornell.edu/talc/ +}} + + +Typed Assembly Language (TAL) extends traditional untyped assembly languages with typing annotations, memory management primitives, and a sound set of typing rules. These typing rules guarantee the memory safety, control flow safety, and type safety of TAL programs. Moreover, the typing constructs are expressive enough to encode most source language programming features including records and structures, arrays, higher-order and polymorphic functions, exceptions, abstract data types, subtyping, and modules. Just as importantly, TAL is flexible enough to admit many low-level compiler optimizations. Consequently, TAL is an ideal target platform for type-directed compilers that want to produce verifiably safe code for use in secure mobile code applications or extensible operating system kernels. \ No newline at end of file diff --git a/Lang/TI-83-BASIC/0DESCRIPTION b/Lang/TI-83-BASIC/0DESCRIPTION new file mode 100644 index 0000000000..09126e654f --- /dev/null +++ b/Lang/TI-83-BASIC/0DESCRIPTION @@ -0,0 +1,8 @@ +{{stub}}{{language|TI-83 BASIC +|tags=ti83b}} +'''TI-83 BASIC''' or '''TI-BASIC''' is the high-level language used on TI-83 and TI-83+ calculators (aside from the assembly which is also on the calculator). TI-83 BASIC is the older brother of [[TI-89 BASIC]]. One of the main complaints with TI-83 BASIC is that there is no native function that tells time, this feature was added in TI-89 BASIC. The language itself, however, is a powerful language capable of many things; nested loops and string manipulation among others. Many students create small programs on their calculators to help them through tests and homework. One popular example is a quadratic formula program. TI-83 BASIC is not affiliated with [[BASIC]] and is not as similar to it as the name would suggest. Someone who has experience writing code in [[C]] or [[C++]] should have no trouble working with this language. + +==See Also== +* [[wp:TI-BASIC|Wikipedia: TI-BASIC]] + +[[Category:Mathematical programming languages]] \ No newline at end of file diff --git a/Lang/TI-83-BASIC/100-doors b/Lang/TI-83-BASIC/100-doors new file mode 120000 index 0000000000..75b0e897b8 --- /dev/null +++ b/Lang/TI-83-BASIC/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/99-Bottles-of-Beer b/Lang/TI-83-BASIC/99-Bottles-of-Beer new file mode 120000 index 0000000000..cb89e8fc7e --- /dev/null +++ b/Lang/TI-83-BASIC/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/A+B b/Lang/TI-83-BASIC/A+B new file mode 120000 index 0000000000..d1225c61eb --- /dev/null +++ b/Lang/TI-83-BASIC/A+B @@ -0,0 +1 @@ +../../Task/A+B/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Arithmetic-Integer b/Lang/TI-83-BASIC/Arithmetic-Integer new file mode 120000 index 0000000000..d7110ab109 --- /dev/null +++ b/Lang/TI-83-BASIC/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Arrays b/Lang/TI-83-BASIC/Arrays new file mode 120000 index 0000000000..3133ed5ab2 --- /dev/null +++ b/Lang/TI-83-BASIC/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Averages-Median b/Lang/TI-83-BASIC/Averages-Median new file mode 120000 index 0000000000..dbeb1ed872 --- /dev/null +++ b/Lang/TI-83-BASIC/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Averages-Simple-moving-average b/Lang/TI-83-BASIC/Averages-Simple-moving-average new file mode 120000 index 0000000000..52a51c235a --- /dev/null +++ b/Lang/TI-83-BASIC/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Character-codes b/Lang/TI-83-BASIC/Character-codes new file mode 120000 index 0000000000..6a735397dd --- /dev/null +++ b/Lang/TI-83-BASIC/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Comments b/Lang/TI-83-BASIC/Comments new file mode 120000 index 0000000000..5dc8a31de5 --- /dev/null +++ b/Lang/TI-83-BASIC/Comments @@ -0,0 +1 @@ +../../Task/Comments/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Conways-Game-of-Life b/Lang/TI-83-BASIC/Conways-Game-of-Life new file mode 120000 index 0000000000..bd16eb3489 --- /dev/null +++ b/Lang/TI-83-BASIC/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Day-of-the-week b/Lang/TI-83-BASIC/Day-of-the-week new file mode 120000 index 0000000000..c3b10e5e7e --- /dev/null +++ b/Lang/TI-83-BASIC/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Fibonacci-sequence b/Lang/TI-83-BASIC/Fibonacci-sequence new file mode 120000 index 0000000000..3dcfc2335b --- /dev/null +++ b/Lang/TI-83-BASIC/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/FizzBuzz b/Lang/TI-83-BASIC/FizzBuzz new file mode 120000 index 0000000000..48a9806259 --- /dev/null +++ b/Lang/TI-83-BASIC/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Increment-a-numerical-string b/Lang/TI-83-BASIC/Increment-a-numerical-string new file mode 120000 index 0000000000..7969f89565 --- /dev/null +++ b/Lang/TI-83-BASIC/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Keyboard-input-Keypress-check b/Lang/TI-83-BASIC/Keyboard-input-Keypress-check new file mode 120000 index 0000000000..3d46dc0ed3 --- /dev/null +++ b/Lang/TI-83-BASIC/Keyboard-input-Keypress-check @@ -0,0 +1 @@ +../../Task/Keyboard-input-Keypress-check/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Langtons-ant b/Lang/TI-83-BASIC/Langtons-ant new file mode 120000 index 0000000000..9853187bf9 --- /dev/null +++ b/Lang/TI-83-BASIC/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Least-common-multiple b/Lang/TI-83-BASIC/Least-common-multiple new file mode 120000 index 0000000000..57e0e9b9f4 --- /dev/null +++ b/Lang/TI-83-BASIC/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Loops-Downward-for b/Lang/TI-83-BASIC/Loops-Downward-for new file mode 120000 index 0000000000..8359c30002 --- /dev/null +++ b/Lang/TI-83-BASIC/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Loops-Infinite b/Lang/TI-83-BASIC/Loops-Infinite new file mode 120000 index 0000000000..bb588f04c3 --- /dev/null +++ b/Lang/TI-83-BASIC/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Luhn-test-of-credit-card-numbers b/Lang/TI-83-BASIC/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..c344306361 --- /dev/null +++ b/Lang/TI-83-BASIC/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Mandelbrot-set b/Lang/TI-83-BASIC/Mandelbrot-set new file mode 120000 index 0000000000..19f170d640 --- /dev/null +++ b/Lang/TI-83-BASIC/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-83-BASIC/Matrix-multiplication b/Lang/TI-83-BASIC/Matrix-multiplication new file mode 120000 index 0000000000..68f23b95c2 --- /dev/null +++ b/Lang/TI-83-BASIC/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/TI-83-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/0DESCRIPTION b/Lang/TI-89-BASIC/0DESCRIPTION new file mode 100644 index 0000000000..2bac934dbf --- /dev/null +++ b/Lang/TI-89-BASIC/0DESCRIPTION @@ -0,0 +1,12 @@ +{{language|exec=interpreted|gc=yes|parampass=value|checking=dynamic|strength=strong|safety=safe|tags=ti89b}} + +[[:Category:TI-89 BASIC|TI-89 BASIC]] is the programming language of the [[wp:TI-89 series|Texas Instruments TI-89 graphing calculator]], as well as the TI-92+ and Voyage 200 models. + +TI-89 BASIC is derived from [[derived from::TI-83 BASIC]], but has some incompatible syntax and is much more powerful. For example, it supports arbitrary variable names, user-defined functions, local subroutines, comments, and working with symbolic expressions as well as numbers. + +
+ +==See Also== +* [[wp:TI-BASIC|Wikipedia: TI-BASIC]] + +[[Category:Mathematical programming languages]] \ No newline at end of file diff --git a/Lang/TI-89-BASIC/100-doors b/Lang/TI-89-BASIC/100-doors new file mode 120000 index 0000000000..ec1691e86c --- /dev/null +++ b/Lang/TI-89-BASIC/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/99-Bottles-of-Beer b/Lang/TI-89-BASIC/99-Bottles-of-Beer new file mode 120000 index 0000000000..2707cf1558 --- /dev/null +++ b/Lang/TI-89-BASIC/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Ackermann-function b/Lang/TI-89-BASIC/Ackermann-function new file mode 120000 index 0000000000..01944f3a96 --- /dev/null +++ b/Lang/TI-89-BASIC/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Apply-a-callback-to-an-array b/Lang/TI-89-BASIC/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..301a62cf17 --- /dev/null +++ b/Lang/TI-89-BASIC/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Arithmetic-Integer b/Lang/TI-89-BASIC/Arithmetic-Integer new file mode 120000 index 0000000000..d74240ed9e --- /dev/null +++ b/Lang/TI-89-BASIC/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Averages-Arithmetic-mean b/Lang/TI-89-BASIC/Averages-Arithmetic-mean new file mode 120000 index 0000000000..85d68fdce2 --- /dev/null +++ b/Lang/TI-89-BASIC/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Averages-Median b/Lang/TI-89-BASIC/Averages-Median new file mode 120000 index 0000000000..43045f0e88 --- /dev/null +++ b/Lang/TI-89-BASIC/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Averages-Simple-moving-average b/Lang/TI-89-BASIC/Averages-Simple-moving-average new file mode 120000 index 0000000000..e91b6d4112 --- /dev/null +++ b/Lang/TI-89-BASIC/Averages-Simple-moving-average @@ -0,0 +1 @@ +../../Task/Averages-Simple-moving-average/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Bitmap-B-zier-curves-Cubic b/Lang/TI-89-BASIC/Bitmap-B-zier-curves-Cubic new file mode 120000 index 0000000000..3a9dfec5de --- /dev/null +++ b/Lang/TI-89-BASIC/Bitmap-B-zier-curves-Cubic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Cubic/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Bitmap-B-zier-curves-Quadratic b/Lang/TI-89-BASIC/Bitmap-B-zier-curves-Quadratic new file mode 120000 index 0000000000..c3ddef9a81 --- /dev/null +++ b/Lang/TI-89-BASIC/Bitmap-B-zier-curves-Quadratic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Quadratic/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Bitmap-Bresenhams-line-algorithm b/Lang/TI-89-BASIC/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..8bcc767ba1 --- /dev/null +++ b/Lang/TI-89-BASIC/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Bitwise-operations b/Lang/TI-89-BASIC/Bitwise-operations new file mode 120000 index 0000000000..a478e2b913 --- /dev/null +++ b/Lang/TI-89-BASIC/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Character-codes b/Lang/TI-89-BASIC/Character-codes new file mode 120000 index 0000000000..daa4dbc4ed --- /dev/null +++ b/Lang/TI-89-BASIC/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Color-of-a-screen-pixel b/Lang/TI-89-BASIC/Color-of-a-screen-pixel new file mode 120000 index 0000000000..75e6975360 --- /dev/null +++ b/Lang/TI-89-BASIC/Color-of-a-screen-pixel @@ -0,0 +1 @@ +../../Task/Color-of-a-screen-pixel/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Comments b/Lang/TI-89-BASIC/Comments new file mode 120000 index 0000000000..d2a9299766 --- /dev/null +++ b/Lang/TI-89-BASIC/Comments @@ -0,0 +1 @@ +../../Task/Comments/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Conways-Game-of-Life b/Lang/TI-89-BASIC/Conways-Game-of-Life new file mode 120000 index 0000000000..8133d9e29c --- /dev/null +++ b/Lang/TI-89-BASIC/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Dynamic-variable-names b/Lang/TI-89-BASIC/Dynamic-variable-names new file mode 120000 index 0000000000..c20da03a0d --- /dev/null +++ b/Lang/TI-89-BASIC/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Evaluate-binomial-coefficients b/Lang/TI-89-BASIC/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..bb6da03260 --- /dev/null +++ b/Lang/TI-89-BASIC/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Factorial b/Lang/TI-89-BASIC/Factorial new file mode 120000 index 0000000000..77dafb4c90 --- /dev/null +++ b/Lang/TI-89-BASIC/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Fibonacci-sequence b/Lang/TI-89-BASIC/Fibonacci-sequence new file mode 120000 index 0000000000..aadd1ef77f --- /dev/null +++ b/Lang/TI-89-BASIC/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/First-class-functions b/Lang/TI-89-BASIC/First-class-functions new file mode 120000 index 0000000000..9277048952 --- /dev/null +++ b/Lang/TI-89-BASIC/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Formatted-numeric-output b/Lang/TI-89-BASIC/Formatted-numeric-output new file mode 120000 index 0000000000..90572366dc --- /dev/null +++ b/Lang/TI-89-BASIC/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Function-definition b/Lang/TI-89-BASIC/Function-definition new file mode 120000 index 0000000000..95ad264b44 --- /dev/null +++ b/Lang/TI-89-BASIC/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Generic-swap b/Lang/TI-89-BASIC/Generic-swap new file mode 120000 index 0000000000..97d63671e7 --- /dev/null +++ b/Lang/TI-89-BASIC/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Hello-world-Graphical b/Lang/TI-89-BASIC/Hello-world-Graphical new file mode 120000 index 0000000000..32b67da4c2 --- /dev/null +++ b/Lang/TI-89-BASIC/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Hello-world-Text b/Lang/TI-89-BASIC/Hello-world-Text new file mode 120000 index 0000000000..d2a9550220 --- /dev/null +++ b/Lang/TI-89-BASIC/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Higher-order-functions b/Lang/TI-89-BASIC/Higher-order-functions new file mode 120000 index 0000000000..ace85cab16 --- /dev/null +++ b/Lang/TI-89-BASIC/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Host-introspection b/Lang/TI-89-BASIC/Host-introspection new file mode 120000 index 0000000000..35ac0063fa --- /dev/null +++ b/Lang/TI-89-BASIC/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Increment-a-numerical-string b/Lang/TI-89-BASIC/Increment-a-numerical-string new file mode 120000 index 0000000000..b87845f2dc --- /dev/null +++ b/Lang/TI-89-BASIC/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Infinity b/Lang/TI-89-BASIC/Infinity new file mode 120000 index 0000000000..e4b3921708 --- /dev/null +++ b/Lang/TI-89-BASIC/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Integer-comparison b/Lang/TI-89-BASIC/Integer-comparison new file mode 120000 index 0000000000..8051727416 --- /dev/null +++ b/Lang/TI-89-BASIC/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Introspection b/Lang/TI-89-BASIC/Introspection new file mode 120000 index 0000000000..eeda2f4fff --- /dev/null +++ b/Lang/TI-89-BASIC/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/List-comprehensions b/Lang/TI-89-BASIC/List-comprehensions new file mode 120000 index 0000000000..8a7f60e6c1 --- /dev/null +++ b/Lang/TI-89-BASIC/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Literals-Integer b/Lang/TI-89-BASIC/Literals-Integer new file mode 120000 index 0000000000..456c93a6cb --- /dev/null +++ b/Lang/TI-89-BASIC/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-Break b/Lang/TI-89-BASIC/Loops-Break new file mode 120000 index 0000000000..8600fd0a28 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-Continue b/Lang/TI-89-BASIC/Loops-Continue new file mode 120000 index 0000000000..5f2ea091fd --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-Downward-for b/Lang/TI-89-BASIC/Loops-Downward-for new file mode 120000 index 0000000000..2a2f6875c9 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-For b/Lang/TI-89-BASIC/Loops-For new file mode 120000 index 0000000000..5228a83e90 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-For-with-a-specified-step b/Lang/TI-89-BASIC/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..064191695b --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-Foreach b/Lang/TI-89-BASIC/Loops-Foreach new file mode 120000 index 0000000000..134cd738e4 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-Infinite b/Lang/TI-89-BASIC/Loops-Infinite new file mode 120000 index 0000000000..727f6d43b2 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-N-plus-one-half b/Lang/TI-89-BASIC/Loops-N-plus-one-half new file mode 120000 index 0000000000..7950065c97 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-Nested b/Lang/TI-89-BASIC/Loops-Nested new file mode 120000 index 0000000000..0a10ad8aa6 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Loops-While b/Lang/TI-89-BASIC/Loops-While new file mode 120000 index 0000000000..d79c599706 --- /dev/null +++ b/Lang/TI-89-BASIC/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Matrix-exponentiation-operator b/Lang/TI-89-BASIC/Matrix-exponentiation-operator new file mode 120000 index 0000000000..cde864fcfd --- /dev/null +++ b/Lang/TI-89-BASIC/Matrix-exponentiation-operator @@ -0,0 +1 @@ +../../Task/Matrix-exponentiation-operator/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Matrix-multiplication b/Lang/TI-89-BASIC/Matrix-multiplication new file mode 120000 index 0000000000..b4f8dce798 --- /dev/null +++ b/Lang/TI-89-BASIC/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TI-89-BASIC/Mutual-recursion b/Lang/TI-89-BASIC/Mutual-recursion new file mode 120000 index 0000000000..e95eea272b --- /dev/null +++ b/Lang/TI-89-BASIC/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/TI-89-BASIC \ No newline at end of file diff --git a/Lang/TIScript/0DESCRIPTION b/Lang/TIScript/0DESCRIPTION new file mode 100644 index 0000000000..387f92812f --- /dev/null +++ b/Lang/TIScript/0DESCRIPTION @@ -0,0 +1,6 @@ +{{language}}TIScript is a language that uses [[JavaScript]] as a base with some [[Python]] features added: classes and namespaces, properties, decorators, etc. TIScript has a compiler producing [[bytecode]]s and VM running that bytecodes. VM uses heap with garbage collector. + +Please read my article [http://www.codeproject.com/KB/recipes/TIScript.aspx TIScript vs JavaScript]. TIScript is hosted on [http://code.google.com/p/tiscript/ GoogleCode] + +Minimal hello-world in TIScript: +stdout.println("Hello world"); \ No newline at end of file diff --git a/Lang/TIScript/99-Bottles-of-Beer b/Lang/TIScript/99-Bottles-of-Beer new file mode 120000 index 0000000000..5489e31071 --- /dev/null +++ b/Lang/TIScript/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/TIScript \ No newline at end of file diff --git a/Lang/TIScript/Apply-a-callback-to-an-array b/Lang/TIScript/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..fa2a736688 --- /dev/null +++ b/Lang/TIScript/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/TIScript \ No newline at end of file diff --git a/Lang/TIScript/Classes b/Lang/TIScript/Classes new file mode 120000 index 0000000000..5987fa5d49 --- /dev/null +++ b/Lang/TIScript/Classes @@ -0,0 +1 @@ +../../Task/Classes/TIScript \ No newline at end of file diff --git a/Lang/TPP/0DESCRIPTION b/Lang/TPP/0DESCRIPTION new file mode 100644 index 0000000000..37a044d51b --- /dev/null +++ b/Lang/TPP/0DESCRIPTION @@ -0,0 +1,4 @@ +{{stub}}{{language|tpp +|site=http://http://www.ngolde.de/tpp.html}} + +This is the markup language used by Nico Golde's text presentation program. \ No newline at end of file diff --git a/Lang/TPP/Comments b/Lang/TPP/Comments new file mode 120000 index 0000000000..4e952b1ced --- /dev/null +++ b/Lang/TPP/Comments @@ -0,0 +1 @@ +../../Task/Comments/TPP \ No newline at end of file diff --git a/Lang/TPP/Hello-world-Text b/Lang/TPP/Hello-world-Text new file mode 120000 index 0000000000..57a6b05b7b --- /dev/null +++ b/Lang/TPP/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/TPP \ No newline at end of file diff --git a/Lang/TSE-SAL/0DESCRIPTION b/Lang/TSE-SAL/0DESCRIPTION new file mode 100644 index 0000000000..cbe6d5991c --- /dev/null +++ b/Lang/TSE-SAL/0DESCRIPTION @@ -0,0 +1,8 @@ +{{language|TSE SAL +|site=http://www.semware.com +|tags=tse sal}} +{{implementation|TSE SAL}} + +'''TSE SAL''' (SemWare Application Language) is the programming language used in The Semware Editor (TSE) text editor. + +[[wp:The_SemWare_Editor|TSE SAL on Wikipedia]] \ No newline at end of file diff --git a/Lang/TSE-SAL/100-doors b/Lang/TSE-SAL/100-doors new file mode 120000 index 0000000000..63d9ec3717 --- /dev/null +++ b/Lang/TSE-SAL/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/TSE-SAL \ No newline at end of file diff --git a/Lang/TSE-SAL/Ackermann-function b/Lang/TSE-SAL/Ackermann-function new file mode 120000 index 0000000000..e7b7b58831 --- /dev/null +++ b/Lang/TSE-SAL/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/TSE-SAL \ No newline at end of file diff --git a/Lang/TSE-SAL/Fibonacci-sequence b/Lang/TSE-SAL/Fibonacci-sequence new file mode 120000 index 0000000000..c146db8689 --- /dev/null +++ b/Lang/TSE-SAL/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/TSE-SAL \ No newline at end of file diff --git a/Lang/TSE-SAL/Find-limit-of-recursion b/Lang/TSE-SAL/Find-limit-of-recursion new file mode 120000 index 0000000000..cbec87f144 --- /dev/null +++ b/Lang/TSE-SAL/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/TSE-SAL \ No newline at end of file diff --git a/Lang/TSE-SAL/Greatest-common-divisor b/Lang/TSE-SAL/Greatest-common-divisor new file mode 120000 index 0000000000..4b87a51f7d --- /dev/null +++ b/Lang/TSE-SAL/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/TSE-SAL \ No newline at end of file diff --git a/Lang/TSE-SAL/HTTP b/Lang/TSE-SAL/HTTP new file mode 120000 index 0000000000..8751f6c5da --- /dev/null +++ b/Lang/TSE-SAL/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/TSE-SAL \ No newline at end of file diff --git a/Lang/TSE-SAL/Least-common-multiple b/Lang/TSE-SAL/Least-common-multiple new file mode 120000 index 0000000000..b54903be28 --- /dev/null +++ b/Lang/TSE-SAL/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/TSE-SAL \ No newline at end of file diff --git a/Lang/TSE-SAL/Levenshtein-distance b/Lang/TSE-SAL/Levenshtein-distance new file mode 120000 index 0000000000..80d22b875e --- /dev/null +++ b/Lang/TSE-SAL/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/TSE-SAL \ No newline at end of file diff --git a/Lang/TUSCRIPT/0DESCRIPTION b/Lang/TUSCRIPT/0DESCRIPTION new file mode 100644 index 0000000000..ce2b472d45 --- /dev/null +++ b/Lang/TUSCRIPT/0DESCRIPTION @@ -0,0 +1,34 @@ + +{{language +|exec=interpreted +|site=http://www.tustep.uni-tuebingen.de +|strength=weak +|gc=no +|parampass=both +|checking=dynamic +|untyped=yes +|safety=both +|hopl id=4130 +}} + + +TUSCRIPT is the scripting language module of TUSTEP (acronym for ''TU''ebingen ''S''ystem of ''TE''xt processing ''P''rograms). TUSTEP "is a collection of relatively independent programs, each of which offers a well-defined subset of basic operations for processing textual data. It is the task of the user to combine these basic functions in order to arrive at the solution to a given problem" [http://www.tustep.uni-tuebingen.de/tustep_ox92.html] +"Designed in cooperation with many humanities projects at the Computing Center of the University of Tübingen and first implemented more than 30 years ago, TUSTEP is constantly being improved and expanded (from 2003 with financial support by academic partner institutions) in order to facilitate solutions for new problems and to take advantage of new hardware and operating systems. It contains modules for all stages of scholarly text data processing, starting from data capture and including information retrieval, text collation, text analysis, sorting and ordering, rule-based text manipulation, and output in electronic or conventional form (including typesetting in professional quality)."[http://www.tustep.uni-tuebingen.de/tustep_eng.html]" +TUSTEP is since June 2011 [http://www.tustep.uni-tuebingen.de/lizenz.php open source software] under the revised BSD license. + +== External links == +[http://www.tustep.uni-tuebingen.de/download.php Download] + +[http://www.tustep.uni-tuebingen.de/tustep_eng.html TUSTEP-homepage] + +[http://www.tustep.uni-tuebingen.de/pdf/handbuch.pdf TUSTEP: Handbuch und Referenz] + +[http://www.itug.de/ International TUSTEP USER GROUP (ITUG)] + +[http://www.tustep-tutorial.uzh.ch/ TUSTEP Tutorial] + +[http://tustep.wikispaces.com/TUSTEP-Wiki TUSTEP Wiki] + +== Citations == +# [http://www.tustep.uni-tuebingen.de/tustep_ox92.html Wilhelm Ott: Modularity, Professionality, Integration: A Conception Revisited. Paper prepared for the ALLC-ACH 92 Conference, Oxford, 6-9 April 1992; first published in: ALLC-ACH 92, Conference Abstracts and Programme, Oxford: Christ Church 1992, p. 197-199 ] +# [http://www.tustep.uni-tuebingen.de/tustep_eng.html TUSTEP-homepage] \ No newline at end of file diff --git a/Lang/TUSCRIPT/100-doors b/Lang/TUSCRIPT/100-doors new file mode 120000 index 0000000000..87a171a882 --- /dev/null +++ b/Lang/TUSCRIPT/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/24-game b/Lang/TUSCRIPT/24-game new file mode 120000 index 0000000000..51cdd3a0aa --- /dev/null +++ b/Lang/TUSCRIPT/24-game @@ -0,0 +1 @@ +../../Task/24-game/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/99-Bottles-of-Beer b/Lang/TUSCRIPT/99-Bottles-of-Beer new file mode 120000 index 0000000000..8a36e77a7a --- /dev/null +++ b/Lang/TUSCRIPT/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/A+B b/Lang/TUSCRIPT/A+B new file mode 120000 index 0000000000..47bfa3c452 --- /dev/null +++ b/Lang/TUSCRIPT/A+B @@ -0,0 +1 @@ +../../Task/A+B/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Align-columns b/Lang/TUSCRIPT/Align-columns new file mode 120000 index 0000000000..e54c3eb2b3 --- /dev/null +++ b/Lang/TUSCRIPT/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Anagrams b/Lang/TUSCRIPT/Anagrams new file mode 120000 index 0000000000..b2e2a14087 --- /dev/null +++ b/Lang/TUSCRIPT/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Anagrams-Deranged-anagrams b/Lang/TUSCRIPT/Anagrams-Deranged-anagrams new file mode 120000 index 0000000000..04795310ef --- /dev/null +++ b/Lang/TUSCRIPT/Anagrams-Deranged-anagrams @@ -0,0 +1 @@ +../../Task/Anagrams-Deranged-anagrams/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Arithmetic-Integer b/Lang/TUSCRIPT/Arithmetic-Integer new file mode 120000 index 0000000000..9c382186bd --- /dev/null +++ b/Lang/TUSCRIPT/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Balanced-brackets b/Lang/TUSCRIPT/Balanced-brackets new file mode 120000 index 0000000000..485240bcb7 --- /dev/null +++ b/Lang/TUSCRIPT/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Bulls-and-cows b/Lang/TUSCRIPT/Bulls-and-cows new file mode 120000 index 0000000000..7146204705 --- /dev/null +++ b/Lang/TUSCRIPT/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/CSV-to-HTML-translation b/Lang/TUSCRIPT/CSV-to-HTML-translation new file mode 120000 index 0000000000..77cdd9707d --- /dev/null +++ b/Lang/TUSCRIPT/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Caesar-cipher b/Lang/TUSCRIPT/Caesar-cipher new file mode 120000 index 0000000000..ae1b4594f7 --- /dev/null +++ b/Lang/TUSCRIPT/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Character-codes b/Lang/TUSCRIPT/Character-codes new file mode 120000 index 0000000000..623ba58007 --- /dev/null +++ b/Lang/TUSCRIPT/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Character-matching b/Lang/TUSCRIPT/Character-matching new file mode 120000 index 0000000000..1097158f35 --- /dev/null +++ b/Lang/TUSCRIPT/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Check-that-file-exists b/Lang/TUSCRIPT/Check-that-file-exists new file mode 120000 index 0000000000..6e54b6c4ef --- /dev/null +++ b/Lang/TUSCRIPT/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Collections b/Lang/TUSCRIPT/Collections new file mode 120000 index 0000000000..7d95a14de4 --- /dev/null +++ b/Lang/TUSCRIPT/Collections @@ -0,0 +1 @@ +../../Task/Collections/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Comments b/Lang/TUSCRIPT/Comments new file mode 120000 index 0000000000..7ab4e61913 --- /dev/null +++ b/Lang/TUSCRIPT/Comments @@ -0,0 +1 @@ +../../Task/Comments/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Conditional-structures b/Lang/TUSCRIPT/Conditional-structures new file mode 120000 index 0000000000..0f24a0f392 --- /dev/null +++ b/Lang/TUSCRIPT/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Count-occurrences-of-a-substring b/Lang/TUSCRIPT/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..0dc53617cc --- /dev/null +++ b/Lang/TUSCRIPT/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Create-a-file b/Lang/TUSCRIPT/Create-a-file new file mode 120000 index 0000000000..78e09b62ef --- /dev/null +++ b/Lang/TUSCRIPT/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Create-a-file-on-magnetic-tape b/Lang/TUSCRIPT/Create-a-file-on-magnetic-tape new file mode 120000 index 0000000000..176d9e7a2f --- /dev/null +++ b/Lang/TUSCRIPT/Create-a-file-on-magnetic-tape @@ -0,0 +1 @@ +../../Task/Create-a-file-on-magnetic-tape/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Create-an-HTML-table b/Lang/TUSCRIPT/Create-an-HTML-table new file mode 120000 index 0000000000..299b62d202 --- /dev/null +++ b/Lang/TUSCRIPT/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Date-format b/Lang/TUSCRIPT/Date-format new file mode 120000 index 0000000000..4e92183056 --- /dev/null +++ b/Lang/TUSCRIPT/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Day-of-the-week b/Lang/TUSCRIPT/Day-of-the-week new file mode 120000 index 0000000000..fdddb6a06f --- /dev/null +++ b/Lang/TUSCRIPT/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Delete-a-file b/Lang/TUSCRIPT/Delete-a-file new file mode 120000 index 0000000000..d19b4cfe7e --- /dev/null +++ b/Lang/TUSCRIPT/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Dynamic-variable-names b/Lang/TUSCRIPT/Dynamic-variable-names new file mode 120000 index 0000000000..709c8df3a9 --- /dev/null +++ b/Lang/TUSCRIPT/Dynamic-variable-names @@ -0,0 +1 @@ +../../Task/Dynamic-variable-names/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Empty-program b/Lang/TUSCRIPT/Empty-program new file mode 120000 index 0000000000..799995adcc --- /dev/null +++ b/Lang/TUSCRIPT/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Empty-string b/Lang/TUSCRIPT/Empty-string new file mode 120000 index 0000000000..7f06bb8c6c --- /dev/null +++ b/Lang/TUSCRIPT/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Ethiopian-multiplication b/Lang/TUSCRIPT/Ethiopian-multiplication new file mode 120000 index 0000000000..f4597f1206 --- /dev/null +++ b/Lang/TUSCRIPT/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Even-or-odd b/Lang/TUSCRIPT/Even-or-odd new file mode 120000 index 0000000000..34daf085ce --- /dev/null +++ b/Lang/TUSCRIPT/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Execute-a-system-command b/Lang/TUSCRIPT/Execute-a-system-command new file mode 120000 index 0000000000..ac6d4e0beb --- /dev/null +++ b/Lang/TUSCRIPT/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Factorial b/Lang/TUSCRIPT/Factorial new file mode 120000 index 0000000000..ee303a07f3 --- /dev/null +++ b/Lang/TUSCRIPT/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Fibonacci-sequence b/Lang/TUSCRIPT/Fibonacci-sequence new file mode 120000 index 0000000000..d79a3f3854 --- /dev/null +++ b/Lang/TUSCRIPT/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/File-modification-time b/Lang/TUSCRIPT/File-modification-time new file mode 120000 index 0000000000..cd3767682c --- /dev/null +++ b/Lang/TUSCRIPT/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/File-size b/Lang/TUSCRIPT/File-size new file mode 120000 index 0000000000..227f7c70d8 --- /dev/null +++ b/Lang/TUSCRIPT/File-size @@ -0,0 +1 @@ +../../Task/File-size/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Filter b/Lang/TUSCRIPT/Filter new file mode 120000 index 0000000000..f2ecc94188 --- /dev/null +++ b/Lang/TUSCRIPT/Filter @@ -0,0 +1 @@ +../../Task/Filter/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Find-common-directory-path b/Lang/TUSCRIPT/Find-common-directory-path new file mode 120000 index 0000000000..d5a3847dec --- /dev/null +++ b/Lang/TUSCRIPT/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Five-weekends b/Lang/TUSCRIPT/Five-weekends new file mode 120000 index 0000000000..6f2b455937 --- /dev/null +++ b/Lang/TUSCRIPT/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/FizzBuzz b/Lang/TUSCRIPT/FizzBuzz new file mode 120000 index 0000000000..bfe0dc43c2 --- /dev/null +++ b/Lang/TUSCRIPT/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Fractal-tree b/Lang/TUSCRIPT/Fractal-tree new file mode 120000 index 0000000000..9ddac1c6db --- /dev/null +++ b/Lang/TUSCRIPT/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Globally-replace-text-in-several-files b/Lang/TUSCRIPT/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..ecc494b5ec --- /dev/null +++ b/Lang/TUSCRIPT/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Greatest-element-of-a-list b/Lang/TUSCRIPT/Greatest-element-of-a-list new file mode 120000 index 0000000000..1028a81d22 --- /dev/null +++ b/Lang/TUSCRIPT/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Guess-the-number b/Lang/TUSCRIPT/Guess-the-number new file mode 120000 index 0000000000..88c26f693b --- /dev/null +++ b/Lang/TUSCRIPT/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Guess-the-number-With-feedback b/Lang/TUSCRIPT/Guess-the-number-With-feedback new file mode 120000 index 0000000000..f4bd5c226d --- /dev/null +++ b/Lang/TUSCRIPT/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/HTTP b/Lang/TUSCRIPT/HTTP new file mode 120000 index 0000000000..5a7862c4ba --- /dev/null +++ b/Lang/TUSCRIPT/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/HTTPS b/Lang/TUSCRIPT/HTTPS new file mode 120000 index 0000000000..b0d54fd6e7 --- /dev/null +++ b/Lang/TUSCRIPT/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Happy-numbers b/Lang/TUSCRIPT/Happy-numbers new file mode 120000 index 0000000000..f35297149c --- /dev/null +++ b/Lang/TUSCRIPT/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Hello-world-Newline-omission b/Lang/TUSCRIPT/Hello-world-Newline-omission new file mode 120000 index 0000000000..15824221ba --- /dev/null +++ b/Lang/TUSCRIPT/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Hello-world-Standard-error b/Lang/TUSCRIPT/Hello-world-Standard-error new file mode 120000 index 0000000000..7b4de5d33b --- /dev/null +++ b/Lang/TUSCRIPT/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Hello-world-Text b/Lang/TUSCRIPT/Hello-world-Text new file mode 120000 index 0000000000..8e46dcde14 --- /dev/null +++ b/Lang/TUSCRIPT/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Holidays-related-to-Easter b/Lang/TUSCRIPT/Holidays-related-to-Easter new file mode 120000 index 0000000000..91f82d2eca --- /dev/null +++ b/Lang/TUSCRIPT/Holidays-related-to-Easter @@ -0,0 +1 @@ +../../Task/Holidays-related-to-Easter/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Hostname b/Lang/TUSCRIPT/Hostname new file mode 120000 index 0000000000..ccb8bb8835 --- /dev/null +++ b/Lang/TUSCRIPT/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Increment-a-numerical-string b/Lang/TUSCRIPT/Increment-a-numerical-string new file mode 120000 index 0000000000..cf7824bc35 --- /dev/null +++ b/Lang/TUSCRIPT/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Input-loop b/Lang/TUSCRIPT/Input-loop new file mode 120000 index 0000000000..60c40c991e --- /dev/null +++ b/Lang/TUSCRIPT/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Integer-comparison b/Lang/TUSCRIPT/Integer-comparison new file mode 120000 index 0000000000..57857fc237 --- /dev/null +++ b/Lang/TUSCRIPT/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Integer-sequence b/Lang/TUSCRIPT/Integer-sequence new file mode 120000 index 0000000000..e633709f61 --- /dev/null +++ b/Lang/TUSCRIPT/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Inverted-index b/Lang/TUSCRIPT/Inverted-index new file mode 120000 index 0000000000..2ff220506c --- /dev/null +++ b/Lang/TUSCRIPT/Inverted-index @@ -0,0 +1 @@ +../../Task/Inverted-index/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Knuth-shuffle b/Lang/TUSCRIPT/Knuth-shuffle new file mode 120000 index 0000000000..18de41f7ec --- /dev/null +++ b/Lang/TUSCRIPT/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Last-Friday-of-each-month b/Lang/TUSCRIPT/Last-Friday-of-each-month new file mode 120000 index 0000000000..10dcf4c2f5 --- /dev/null +++ b/Lang/TUSCRIPT/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Leap-year b/Lang/TUSCRIPT/Leap-year new file mode 120000 index 0000000000..923c297f1e --- /dev/null +++ b/Lang/TUSCRIPT/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Letter-frequency b/Lang/TUSCRIPT/Letter-frequency new file mode 120000 index 0000000000..192227ba91 --- /dev/null +++ b/Lang/TUSCRIPT/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Literals-String b/Lang/TUSCRIPT/Literals-String new file mode 120000 index 0000000000..c1e70a2399 --- /dev/null +++ b/Lang/TUSCRIPT/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Look-and-say-sequence b/Lang/TUSCRIPT/Look-and-say-sequence new file mode 120000 index 0000000000..ebd708af63 --- /dev/null +++ b/Lang/TUSCRIPT/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loop-over-multiple-arrays-simultaneously b/Lang/TUSCRIPT/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..82fda70282 --- /dev/null +++ b/Lang/TUSCRIPT/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-Break b/Lang/TUSCRIPT/Loops-Break new file mode 120000 index 0000000000..50aedbd568 --- /dev/null +++ b/Lang/TUSCRIPT/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-Continue b/Lang/TUSCRIPT/Loops-Continue new file mode 120000 index 0000000000..a3e78c369a --- /dev/null +++ b/Lang/TUSCRIPT/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-Do-while b/Lang/TUSCRIPT/Loops-Do-while new file mode 120000 index 0000000000..b866cccb9f --- /dev/null +++ b/Lang/TUSCRIPT/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-Downward-for b/Lang/TUSCRIPT/Loops-Downward-for new file mode 120000 index 0000000000..7accf29c34 --- /dev/null +++ b/Lang/TUSCRIPT/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-For b/Lang/TUSCRIPT/Loops-For new file mode 120000 index 0000000000..c8b5cced39 --- /dev/null +++ b/Lang/TUSCRIPT/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-For-with-a-specified-step b/Lang/TUSCRIPT/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..096fd7fdfd --- /dev/null +++ b/Lang/TUSCRIPT/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-Foreach b/Lang/TUSCRIPT/Loops-Foreach new file mode 120000 index 0000000000..5609dbb2da --- /dev/null +++ b/Lang/TUSCRIPT/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-Infinite b/Lang/TUSCRIPT/Loops-Infinite new file mode 120000 index 0000000000..b32a8e5eb1 --- /dev/null +++ b/Lang/TUSCRIPT/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-N-plus-one-half b/Lang/TUSCRIPT/Loops-N-plus-one-half new file mode 120000 index 0000000000..c2d29e834d --- /dev/null +++ b/Lang/TUSCRIPT/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-Nested b/Lang/TUSCRIPT/Loops-Nested new file mode 120000 index 0000000000..2241985f6d --- /dev/null +++ b/Lang/TUSCRIPT/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Loops-While b/Lang/TUSCRIPT/Loops-While new file mode 120000 index 0000000000..d7ea6382ca --- /dev/null +++ b/Lang/TUSCRIPT/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Luhn-test-of-credit-card-numbers b/Lang/TUSCRIPT/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..245512f716 --- /dev/null +++ b/Lang/TUSCRIPT/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Morse-code b/Lang/TUSCRIPT/Morse-code new file mode 120000 index 0000000000..0564378796 --- /dev/null +++ b/Lang/TUSCRIPT/Morse-code @@ -0,0 +1 @@ +../../Task/Morse-code/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Multiplication-tables b/Lang/TUSCRIPT/Multiplication-tables new file mode 120000 index 0000000000..db2c79ffea --- /dev/null +++ b/Lang/TUSCRIPT/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Ordered-words b/Lang/TUSCRIPT/Ordered-words new file mode 120000 index 0000000000..a9c512fa35 --- /dev/null +++ b/Lang/TUSCRIPT/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/TUSCRIPT \ No newline at end of file diff --git a/Lang/TUSCRIPT/Search-a-list b/Lang/TUSCRIPT/Search-a-list new file mode 120000 index 0000000000..f2e3528782 --- /dev/null +++ b/Lang/TUSCRIPT/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/TUSCRIPT \ No newline at end of file diff --git a/Lang/TXR/0DESCRIPTION b/Lang/TXR/0DESCRIPTION new file mode 100644 index 0000000000..a2673a167c --- /dev/null +++ b/Lang/TXR/0DESCRIPTION @@ -0,0 +1,165 @@ +{{stub}}{{language +|site=http://www.nongnu.org/txr/}} + +TXR is a new text extraction language implemented in [[C]], running on [[Linux]] and [[Cygwin]] (and possibly other [[POSIX]] platforms) as well as Windows. + +The source of a TXR query is literal text except for directives and variables preceded by the @ character. + +Computation evolves by textual pattern matching with implicit backtracking. Non-pattern matching activities are embedded into a pattern matching paradigm. For instance, the line + +
Four score and seven years ago,
+ +is a TXR directive which matches a line of that exact text, or else fails. The following is also a directive: + +@(bind foo "abc") + +which succeeds if foo has no prior binding, or already contains "abc", but fails if foo has a binding to something other than "abc". + +The success of a directive means that computation proceeds to the next directive (and, if this is a pattern match, the input position advances). Failure means that the enclosing query fails, triggering back-tracking behaviors and possibly failure of the entire query. + +==Extremely Simple Query== + +Extract first matching line from the password file. Of course, TXR matches are not restricted to single line! + +$ txr -c '@(skip) +@user:@pw:@uid:@gid:@gecos:@home:@shell' /etc/passwd +
+user="root"
+pw="x"
+uid="0"
+gid="0"
+gecos="root"
+home="/root"
+shell="/bin/bash"
+ +Now, pre-bind the user variable first to retrieve some other user. Now @(skip) kicks into action, skipping non-matching material: + +$ txr -Duser=sshd -c '@(skip) +@user:@pw:@uid:@gid:@gecos:@home:@shell' /etc/passwd +
user="sshd"
+pw="x"
+uid="114"
+gid="65534"
+gecos=""
+home="/var/run/sshd"
+shell="/usr/sbin/nologin"
+ + +==Simple Query== + +Re-implement the "free" utility on Linux, showing an overview of memory use: + +#!/usr/bin/txr -f +@(next "/proc/meminfo") +@(define num (n))@\ + @(local numtok)@{numtok /[0-9]+/}@(bind n @(int-str numtok 10))@\ +@(end) +@(gather) +MemTotal: @(num TOTAL) kB +MemFree: @(num FREE) kB +Buffers: @(num BUFS) kB +Cached: @(num CACHED) kB +SwapTotal: @(num SWTOT) kB +SwapFree: @(num SWFRE) kB +@(end) +@(bind USED @(- TOTAL FREE 10)) +@(bind RUSED @(- USED BUFS CACHED)) +@(bind RFREE @(+ FREE BUFS CACHED)) +@(bind SWUSE @(- SWTOT SWFRE)) +@(output) + TOTAL USED FREE BUFFERS CACHED +Mem: @{TOTAL -12} @{USED -12} @{FREE -12} @{BUFS -12} @{CACHED -12} ++/- buffers/cache: @{RUSED -12} @{RFREE -12} +Swap: @{SWTOT -12} @{SWUSE -12} @{SWFRE -12} +@(end) + +Sample run: + +
$ ./meminfo.txr
+               TOTAL         USED         FREE      BUFFERS       CACHED
+Mem:          769280       647752       121528       160108       286844
++/- buffers/cache:         200800       568480
+Swap:        1048568        18200      1030368
+
+ +Arithmetic is not implemented in TXR as of version 035. The above example simply continues the pattern matching across invocations of echo to borrow the shell to do math. The command + +
@(next `!echo $(( @TOTAL - @FREE ))`)
+@USED
+
+ +means, "Next, please switch to scanning the output of this echo command with some variables substituted in. Then capture entire first line of this command into the USED variable." + +== Complex Query == + +Here is a TXR query for computing the complete dependencies of a C source file (including system and compiler headers) on a typical GNU/Linux system, demonstrating features like parallel clauses, recursion and exception handling. + +@(define process_file (dir file already_visited visited_out)) +@ (local this_file next_file header_dir next_dir next_dir2 visited_out_next) +@ (bind this_file `@dir@file`) +@ (none) +@ (bind already_visited this_file) +@ (end) +@ (merge already_visited already_visited this_file) +@ (next this_file) +@ (collect) +@ (cases) +#include "@*header_dir/@next_file" +@ (bind next_dir `@dir@header_dir/`) +@ (or) +#include "@next_file" +@ (bind next_dir dir) +@ (or) +#@/ */include <@*header_dir/@next_file> +@ (bind next_dir `@sys_includes@header_dir/`) +@ (bind next_dir2 `@gcc_includes@header_dir/`) +@ (or) +#@/ */include <@next_file> +@ (bind next_dir sys_includes) +@ (bind next_dir2 gcc_includes) +@ (or) +#@/ */include_next <@*header_dir/@next_file> +@ (bind next_dir `@gcc_includes@header_dir/`) +@ (or) +#@/ */include_next <@next_file> +@ (bind next_dir gcc_includes) +@ (end) +@ (try) +@ (process_file next_dir next_file already_visited visited_out_next) +@ (merge already_visited already_visited visited_out_next) +@ (catch file_error) +@ (try) +@ (process_file next_dir2 next_file already_visited visited_out_next) +@ (merge already_visited already_visited visited_out_next) +@ (catch file_error) +@ (end) +@ (end) +@ (end) +@ (bind visited_out this_file) +@ (try) +@ (flatten visited_out_next) +@ (merge visited_out visited_out visited_out_next) +@ (catch) +@ (end) +@(end) +@(next :args) +@(cases) +@*dir/@*file.@suffix +@ (bind directory `@dir/`) +@(or) +@*file.@suffix +@ (bind directory "") +@(end) +@(next `!gcc -print-search-dirs`) +install: @gcc_install +@(bind gcc_includes `@{gcc_install}include/`) +@(bind sys_includes "/usr/include/") +@(process_file directory `@file.@suffix` nil list_out) +@(output) +@(rep) @list_out@(first)@file.o:@(end) +@(end) + +Sample run: + +
$ txr dep.txr match.c
+match.o: /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h /usr/lib/gcc/i586-redhat-linux/4.4.1/include/stddef.h /usr/include/bits/types.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h /usr/lib/gcc/i586-redhat-linux/4.4.1/include/stdarg.h /usr/include/bits/wchar.h /usr/include/wctype.h /usr/include/endian.h /usr/include/bits/endian.h /usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/bits/wchar2.h /usr/include/bits/wchar-ldbl.h /usr/include/gconv.h /usr/include/bits/stdio-lock.h /usr/include/bits/libc-lock.h /usr/include/pthread.h /usr/include/sched.h /usr/include/time.h /usr/include/bits/time.h /usr/include/bits/sched.h /usr/include/signal.h /usr/include/bits/signum.h /usr/include/bits/siginfo.h /usr/include/bits/sigaction.h /usr/include/bits/sigcontext.h /usr/include/asm/sigcontext.h /usr/include/linux/types.h /usr/include/linux/posix_types.h /usr/include/linux/stddef.h /usr/include/asm/posix_types.h /usr/include/asm/types.h /usr/include/asm-generic/int-ll64.h /usr/include/bits/sigstack.h /usr/include/sys/ucontext.h /usr/include/bits/pthreadtypes.h /usr/include/bits/sigthread.h /usr/include/bits/setjmp.h /usr/include/bits/libio-ldbl.h /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h /usr/include/getopt.h /usr/include/ctype.h /usr/include/bits/stdio.h /usr/include/bits/stdio2.h /usr/include/bits/stdio-ldbl.h /usr/include/stdlib.h /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h /usr/include/alloca.h /usr/include/bits/stdlib.h /usr/include/bits/stdlib-ldbl.h /usr/include/string.h /usr/include/bits/string.h /usr/include/bits/string2.h /usr/include/bits/string3.h /usr/include/assert.h /usr/include/errno.h /usr/include/bits/errno.h /usr/include/linux/errno.h /usr/include/asm/errno.h /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h /usr/include/dirent.h /usr/include/bits/dirent.h /usr/include/bits/posix1_lim.h /usr/include/bits/local_lim.h /usr/include/linux/limits.h /usr/include/setjmp.h config.h lib.h gc.h unwind.h regex.h /usr/include/limits.h /usr/lib/gcc/i586-redhat-linux/4.4.1/include/limits.h /usr/lib/gcc/i586-redhat-linux/4.4.1/include/syslimits.h /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h stream.h parser.h txr.h utf8.h filter.h match.h
\ No newline at end of file diff --git a/Lang/TXR/100-doors b/Lang/TXR/100-doors new file mode 120000 index 0000000000..f8101adfe3 --- /dev/null +++ b/Lang/TXR/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/TXR \ No newline at end of file diff --git a/Lang/TXR/99-Bottles-of-Beer b/Lang/TXR/99-Bottles-of-Beer new file mode 120000 index 0000000000..65b9994202 --- /dev/null +++ b/Lang/TXR/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/TXR \ No newline at end of file diff --git a/Lang/TXR/Align-columns b/Lang/TXR/Align-columns new file mode 120000 index 0000000000..3565c1cbbf --- /dev/null +++ b/Lang/TXR/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/TXR \ No newline at end of file diff --git a/Lang/TXR/Apply-a-callback-to-an-array b/Lang/TXR/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..0c912b8ab5 --- /dev/null +++ b/Lang/TXR/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/TXR \ No newline at end of file diff --git a/Lang/TXR/Arbitrary-precision-integers-included b/Lang/TXR/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..766c0db431 --- /dev/null +++ b/Lang/TXR/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/TXR \ No newline at end of file diff --git a/Lang/TXR/Arithmetic-evaluation b/Lang/TXR/Arithmetic-evaluation new file mode 120000 index 0000000000..fba657d164 --- /dev/null +++ b/Lang/TXR/Arithmetic-evaluation @@ -0,0 +1 @@ +../../Task/Arithmetic-evaluation/TXR \ No newline at end of file diff --git a/Lang/TXR/Arrays b/Lang/TXR/Arrays new file mode 120000 index 0000000000..d7c0cf456b --- /dev/null +++ b/Lang/TXR/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/TXR \ No newline at end of file diff --git a/Lang/TXR/Associative-array-Iteration b/Lang/TXR/Associative-array-Iteration new file mode 120000 index 0000000000..4491da9ab8 --- /dev/null +++ b/Lang/TXR/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/TXR \ No newline at end of file diff --git a/Lang/TXR/Balanced-brackets b/Lang/TXR/Balanced-brackets new file mode 120000 index 0000000000..7f70407b74 --- /dev/null +++ b/Lang/TXR/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/TXR \ No newline at end of file diff --git a/Lang/TXR/CSV-to-HTML-translation b/Lang/TXR/CSV-to-HTML-translation new file mode 120000 index 0000000000..7dc89c7a19 --- /dev/null +++ b/Lang/TXR/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/TXR \ No newline at end of file diff --git a/Lang/TXR/Caesar-cipher b/Lang/TXR/Caesar-cipher new file mode 120000 index 0000000000..aae2e0ea05 --- /dev/null +++ b/Lang/TXR/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/TXR \ No newline at end of file diff --git a/Lang/TXR/Character-matching b/Lang/TXR/Character-matching new file mode 120000 index 0000000000..f705e73ba6 --- /dev/null +++ b/Lang/TXR/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/TXR \ No newline at end of file diff --git a/Lang/TXR/Command-line-arguments b/Lang/TXR/Command-line-arguments new file mode 120000 index 0000000000..6ead5dc041 --- /dev/null +++ b/Lang/TXR/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/TXR \ No newline at end of file diff --git a/Lang/TXR/Comments b/Lang/TXR/Comments new file mode 120000 index 0000000000..529b49641a --- /dev/null +++ b/Lang/TXR/Comments @@ -0,0 +1 @@ +../../Task/Comments/TXR \ No newline at end of file diff --git a/Lang/TXR/Conditional-structures b/Lang/TXR/Conditional-structures new file mode 120000 index 0000000000..4f37f1a975 --- /dev/null +++ b/Lang/TXR/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/TXR \ No newline at end of file diff --git a/Lang/TXR/Count-occurrences-of-a-substring b/Lang/TXR/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..7fe94fc80f --- /dev/null +++ b/Lang/TXR/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/TXR \ No newline at end of file diff --git a/Lang/TXR/Empty-string b/Lang/TXR/Empty-string new file mode 120000 index 0000000000..31f46b4801 --- /dev/null +++ b/Lang/TXR/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/TXR \ No newline at end of file diff --git a/Lang/TXR/Exceptions b/Lang/TXR/Exceptions new file mode 120000 index 0000000000..fb10af243c --- /dev/null +++ b/Lang/TXR/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/TXR \ No newline at end of file diff --git a/Lang/TXR/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/TXR/Exceptions-Catch-an-exception-thrown-in-a-nested-call new file mode 120000 index 0000000000..9dd96a7028 --- /dev/null +++ b/Lang/TXR/Exceptions-Catch-an-exception-thrown-in-a-nested-call @@ -0,0 +1 @@ +../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/TXR \ No newline at end of file diff --git a/Lang/TXR/Flatten-a-list b/Lang/TXR/Flatten-a-list new file mode 120000 index 0000000000..280bef54a0 --- /dev/null +++ b/Lang/TXR/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/TXR \ No newline at end of file diff --git a/Lang/TXR/Function-definition b/Lang/TXR/Function-definition new file mode 120000 index 0000000000..d5c98ed1a1 --- /dev/null +++ b/Lang/TXR/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/TXR \ No newline at end of file diff --git a/Lang/TXR/Globally-replace-text-in-several-files b/Lang/TXR/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..235d387a12 --- /dev/null +++ b/Lang/TXR/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/TXR \ No newline at end of file diff --git a/Lang/TXR/Greatest-common-divisor b/Lang/TXR/Greatest-common-divisor new file mode 120000 index 0000000000..8f09102803 --- /dev/null +++ b/Lang/TXR/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/TXR \ No newline at end of file diff --git a/Lang/TXR/Hailstone-sequence b/Lang/TXR/Hailstone-sequence new file mode 120000 index 0000000000..e5e7eb4b31 --- /dev/null +++ b/Lang/TXR/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/TXR \ No newline at end of file diff --git a/Lang/TXR/Hash-from-two-arrays b/Lang/TXR/Hash-from-two-arrays new file mode 120000 index 0000000000..4844cb758d --- /dev/null +++ b/Lang/TXR/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/TXR \ No newline at end of file diff --git a/Lang/TXR/Hello-world-Newline-omission b/Lang/TXR/Hello-world-Newline-omission new file mode 120000 index 0000000000..db9837256c --- /dev/null +++ b/Lang/TXR/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/TXR \ No newline at end of file diff --git a/Lang/TXR/Here-document b/Lang/TXR/Here-document new file mode 120000 index 0000000000..9fcb52d212 --- /dev/null +++ b/Lang/TXR/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/TXR \ No newline at end of file diff --git a/Lang/TXR/Higher-order-functions b/Lang/TXR/Higher-order-functions new file mode 120000 index 0000000000..fb4b236ff1 --- /dev/null +++ b/Lang/TXR/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/TXR \ No newline at end of file diff --git a/Lang/TXR/Increment-a-numerical-string b/Lang/TXR/Increment-a-numerical-string new file mode 120000 index 0000000000..b90b5c8409 --- /dev/null +++ b/Lang/TXR/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/TXR \ No newline at end of file diff --git a/Lang/TXR/Inheritance-Single b/Lang/TXR/Inheritance-Single new file mode 120000 index 0000000000..6385661ef1 --- /dev/null +++ b/Lang/TXR/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/TXR \ No newline at end of file diff --git a/Lang/TXR/JSON b/Lang/TXR/JSON new file mode 120000 index 0000000000..7e5f108278 --- /dev/null +++ b/Lang/TXR/JSON @@ -0,0 +1 @@ +../../Task/JSON/TXR \ No newline at end of file diff --git a/Lang/TXR/Letter-frequency b/Lang/TXR/Letter-frequency new file mode 120000 index 0000000000..cb72a9786b --- /dev/null +++ b/Lang/TXR/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/TXR \ No newline at end of file diff --git a/Lang/TXR/Loop-over-multiple-arrays-simultaneously b/Lang/TXR/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..4397efffd2 --- /dev/null +++ b/Lang/TXR/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/TXR \ No newline at end of file diff --git a/Lang/TXR/Luhn-test-of-credit-card-numbers b/Lang/TXR/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..b2dd4160eb --- /dev/null +++ b/Lang/TXR/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/TXR \ No newline at end of file diff --git a/Lang/TXR/Modular-exponentiation b/Lang/TXR/Modular-exponentiation new file mode 120000 index 0000000000..52cf2d746d --- /dev/null +++ b/Lang/TXR/Modular-exponentiation @@ -0,0 +1 @@ +../../Task/Modular-exponentiation/TXR \ No newline at end of file diff --git a/Lang/TXR/Multisplit b/Lang/TXR/Multisplit new file mode 120000 index 0000000000..24e30c76f5 --- /dev/null +++ b/Lang/TXR/Multisplit @@ -0,0 +1 @@ +../../Task/Multisplit/TXR \ No newline at end of file diff --git a/Lang/TXR/Mutual-recursion b/Lang/TXR/Mutual-recursion new file mode 120000 index 0000000000..e71ba70037 --- /dev/null +++ b/Lang/TXR/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/TXR \ No newline at end of file diff --git a/Lang/TXR/Narcissist b/Lang/TXR/Narcissist new file mode 120000 index 0000000000..16cb09152b --- /dev/null +++ b/Lang/TXR/Narcissist @@ -0,0 +1 @@ +../../Task/Narcissist/TXR \ No newline at end of file diff --git a/Lang/TXR/Quine b/Lang/TXR/Quine new file mode 120000 index 0000000000..d8465990ff --- /dev/null +++ b/Lang/TXR/Quine @@ -0,0 +1 @@ +../../Task/Quine/TXR \ No newline at end of file diff --git a/Lang/Tcl/Arbitrary-precision-integers-(included) b/Lang/Tcl/Arbitrary-precision-integers-(included) deleted file mode 120000 index 5c3b5394f3..0000000000 --- a/Lang/Tcl/Arbitrary-precision-integers-(included) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Arbitrary-precision-integers-(included)/Tcl \ No newline at end of file diff --git a/Lang/Tcl/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) b/Lang/Tcl/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) deleted file mode 120000 index 0b535b33df..0000000000 --- a/Lang/Tcl/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Tcl \ No newline at end of file diff --git a/Lang/Tcl/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2) b/Lang/Tcl/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2) deleted file mode 120000 index 752393920c..0000000000 --- a/Lang/Tcl/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2) +++ /dev/null @@ -1 +0,0 @@ -../../Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/Tcl \ No newline at end of file diff --git a/Lang/TeLa/0DESCRIPTION b/Lang/TeLa/0DESCRIPTION new file mode 100644 index 0000000000..c9c484157d --- /dev/null +++ b/Lang/TeLa/0DESCRIPTION @@ -0,0 +1,11 @@ +{{stub}} +{{language +|site=http://www.ava.fmi.fi/prog/tela.html +}} +Tela. TEnsor LAnguage, (pronounced teh-lah) is a numerical computing +environment mainly targeted for numerical simulation pre- and +post-processing work. The language supports +arbitrary rank arrays, and has powerful programming capabilities including +[[Fortran 90]] style vector notation. +Two- and three- dimensional graphics is implemented by calling PlotMTV. +For 2D graphics, the SPPC interface is also available. Tela is not a [[MATLAB]] clone, although the scopes of the two programs partly overlap. Tela is both faster and more general than Matlab; however, Matlab has more functions for specific tasks such as signal processing. \ No newline at end of file diff --git a/Lang/Teco/0DESCRIPTION b/Lang/Teco/0DESCRIPTION new file mode 100644 index 0000000000..89eec5d740 --- /dev/null +++ b/Lang/Teco/0DESCRIPTION @@ -0,0 +1,4 @@ +{{stub}}{{language}} +TECO stands for Text Editor and COrrector. (Originally "Tape Editor and COrrector"). Macro language for text editing, screen handling and keyboard management. Has a reputation for being cryptic and hard to learn. (TECO programs are said to resemble line noise.) +TECO was an early, string-processing language used by the first Emacs. It made maintenance hard, and also made extensions hard to write. +The first EMACS editor was written in TECO. \ No newline at end of file diff --git a/Lang/Teco/Hello-world-Text b/Lang/Teco/Hello-world-Text new file mode 120000 index 0000000000..ee2ca63e39 --- /dev/null +++ b/Lang/Teco/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Teco \ No newline at end of file diff --git a/Lang/Thistle/0DESCRIPTION b/Lang/Thistle/0DESCRIPTION new file mode 100644 index 0000000000..2e7da24b49 --- /dev/null +++ b/Lang/Thistle/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language|Thistle +|site=http://alycesrestaurant.com/thistle/ +|hopl=no +|LCT=no +}} + +{{stub}} \ No newline at end of file diff --git a/Lang/Thyrd/0DESCRIPTION b/Lang/Thyrd/0DESCRIPTION new file mode 100644 index 0000000000..2b99bfa8a3 --- /dev/null +++ b/Lang/Thyrd/0DESCRIPTION @@ -0,0 +1,10 @@ +{{language +|checking=dynamic +|hopl=no +|site=http://thyrd.org/thyrd}} +{{language programming paradigm|functional}} +Thyrd is an experimental, reflective, visual programming language and environment. In Thyrd, both data and code are stored in cells situated in nested two-dimensional grids. The user interface animates the transition from a cell to its subordinate or superordinate grid to help keep the user oriented in the hierarchical grid structure. All operations the user can perform to edit the structure are implemented as operators in the Thyrd language, thus a Thyrd program can inspect and modify itself or other programs in the same space. + +Thyrd is a member of the [[Forth]] family of languages. Thyrd is a postfix concatenative language most similar to [[Joy]] in that it uses quotation and combinators to implement iteration and recursion. The environment provides a viewer that animates the stacks of a Thyrd program and allows the program to be stepped both forwards and backwards. + +The primary view of Thyrdspace is a 2D grid of text and icons. A view may be overlaid with a panel consisting of arbitrary widgets editing the contents of individual cells or an entire grid. A Thyrd application can be constructed in which all of the code and data are hidden behind panels and revealed only at the user's request. \ No newline at end of file diff --git a/Lang/Toka/0DESCRIPTION b/Lang/Toka/0DESCRIPTION new file mode 100644 index 0000000000..901c68efa4 --- /dev/null +++ b/Lang/Toka/0DESCRIPTION @@ -0,0 +1,8 @@ +{{language|Toka +|site=http://code.google.com/p/toka/ +|gc= yes +|LCT=no +}} +{{compiler}}Toka is a concatenative programming language with similarities to [[:Category:Forth|Forth]]. It has two accessible [[Stack|stacks]] for passing data, a dictionary which maps names to functions, an [[interpreter]], a [[compiler]] (generating threaded code), a form of [[garbage collection]], and various functions to aid in debugging and inspecting compiled code. Toka also has a set of optional libraries that extend the core language in many ways. + +Toka is distributed under an [[open source|open-source]] license. \ No newline at end of file diff --git a/Lang/Toka/Apply-a-callback-to-an-array b/Lang/Toka/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..4a3374f9d8 --- /dev/null +++ b/Lang/Toka/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Toka \ No newline at end of file diff --git a/Lang/Toka/Arithmetic-Integer b/Lang/Toka/Arithmetic-Integer new file mode 120000 index 0000000000..644618097f --- /dev/null +++ b/Lang/Toka/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Toka \ No newline at end of file diff --git a/Lang/Toka/Associative-array-Creation b/Lang/Toka/Associative-array-Creation new file mode 120000 index 0000000000..3dbfd513ab --- /dev/null +++ b/Lang/Toka/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Toka \ No newline at end of file diff --git a/Lang/Toka/Check-that-file-exists b/Lang/Toka/Check-that-file-exists new file mode 120000 index 0000000000..69a098f6ca --- /dev/null +++ b/Lang/Toka/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Toka \ No newline at end of file diff --git a/Lang/Toka/Command-line-arguments b/Lang/Toka/Command-line-arguments new file mode 120000 index 0000000000..fa27f8cf67 --- /dev/null +++ b/Lang/Toka/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Toka \ No newline at end of file diff --git a/Lang/Toka/Comments b/Lang/Toka/Comments new file mode 120000 index 0000000000..c8a8109a6c --- /dev/null +++ b/Lang/Toka/Comments @@ -0,0 +1 @@ +../../Task/Comments/Toka \ No newline at end of file diff --git a/Lang/Toka/Conditional-structures b/Lang/Toka/Conditional-structures new file mode 120000 index 0000000000..a5694cae61 --- /dev/null +++ b/Lang/Toka/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Toka \ No newline at end of file diff --git a/Lang/Toka/Create-a-file b/Lang/Toka/Create-a-file new file mode 120000 index 0000000000..8a0b5f2043 --- /dev/null +++ b/Lang/Toka/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Toka \ No newline at end of file diff --git a/Lang/Toka/Create-a-two-dimensional-array-at-runtime b/Lang/Toka/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..cb910aca3b --- /dev/null +++ b/Lang/Toka/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/Toka \ No newline at end of file diff --git a/Lang/Toka/Define-a-primitive-data-type b/Lang/Toka/Define-a-primitive-data-type new file mode 120000 index 0000000000..7dbfa84361 --- /dev/null +++ b/Lang/Toka/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Toka \ No newline at end of file diff --git a/Lang/Toka/Delete-a-file b/Lang/Toka/Delete-a-file new file mode 120000 index 0000000000..3555e4c830 --- /dev/null +++ b/Lang/Toka/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Toka \ No newline at end of file diff --git a/Lang/Toka/Determine-if-a-string-is-numeric b/Lang/Toka/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..7abeb916e0 --- /dev/null +++ b/Lang/Toka/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Toka \ No newline at end of file diff --git a/Lang/Toka/Enumerations b/Lang/Toka/Enumerations new file mode 120000 index 0000000000..9eabfd8bda --- /dev/null +++ b/Lang/Toka/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Toka \ No newline at end of file diff --git a/Lang/Toka/Execute-a-system-command b/Lang/Toka/Execute-a-system-command new file mode 120000 index 0000000000..37fc58b18f --- /dev/null +++ b/Lang/Toka/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Toka \ No newline at end of file diff --git a/Lang/Toka/File-IO b/Lang/Toka/File-IO new file mode 120000 index 0000000000..561e4f453f --- /dev/null +++ b/Lang/Toka/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Toka \ No newline at end of file diff --git a/Lang/Toka/File-size b/Lang/Toka/File-size new file mode 120000 index 0000000000..a67691f9d2 --- /dev/null +++ b/Lang/Toka/File-size @@ -0,0 +1 @@ +../../Task/File-size/Toka \ No newline at end of file diff --git a/Lang/Toka/Filter b/Lang/Toka/Filter new file mode 120000 index 0000000000..5a2f2eb793 --- /dev/null +++ b/Lang/Toka/Filter @@ -0,0 +1 @@ +../../Task/Filter/Toka \ No newline at end of file diff --git a/Lang/Toka/Fork b/Lang/Toka/Fork new file mode 120000 index 0000000000..48617dbe26 --- /dev/null +++ b/Lang/Toka/Fork @@ -0,0 +1 @@ +../../Task/Fork/Toka \ No newline at end of file diff --git a/Lang/Toka/Formatted-numeric-output b/Lang/Toka/Formatted-numeric-output new file mode 120000 index 0000000000..daf41c0bbf --- /dev/null +++ b/Lang/Toka/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Toka \ No newline at end of file diff --git a/Lang/Toka/Function-definition b/Lang/Toka/Function-definition new file mode 120000 index 0000000000..286f2a5f68 --- /dev/null +++ b/Lang/Toka/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Toka \ No newline at end of file diff --git a/Lang/Toka/Higher-order-functions b/Lang/Toka/Higher-order-functions new file mode 120000 index 0000000000..a73cf00849 --- /dev/null +++ b/Lang/Toka/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Toka \ No newline at end of file diff --git a/Lang/Toka/Hostname b/Lang/Toka/Hostname new file mode 120000 index 0000000000..1f814684b5 --- /dev/null +++ b/Lang/Toka/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Toka \ No newline at end of file diff --git a/Lang/Toka/Increment-a-numerical-string b/Lang/Toka/Increment-a-numerical-string new file mode 120000 index 0000000000..db5e5567f2 --- /dev/null +++ b/Lang/Toka/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Toka \ No newline at end of file diff --git a/Lang/Toka/Integer-comparison b/Lang/Toka/Integer-comparison new file mode 120000 index 0000000000..fa0f37132d --- /dev/null +++ b/Lang/Toka/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Toka \ No newline at end of file diff --git a/Lang/Toka/Introspection b/Lang/Toka/Introspection new file mode 120000 index 0000000000..59a37fa9ad --- /dev/null +++ b/Lang/Toka/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Toka \ No newline at end of file diff --git a/Lang/Toka/Logical-operations b/Lang/Toka/Logical-operations new file mode 120000 index 0000000000..fe9c2c7eb3 --- /dev/null +++ b/Lang/Toka/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Toka \ No newline at end of file diff --git a/Lang/TorqueScript/0DESCRIPTION b/Lang/TorqueScript/0DESCRIPTION new file mode 100644 index 0000000000..4d3d27c049 --- /dev/null +++ b/Lang/TorqueScript/0DESCRIPTION @@ -0,0 +1 @@ +{{stub}}{{language}} \ No newline at end of file diff --git a/Lang/TorqueScript/100-doors b/Lang/TorqueScript/100-doors new file mode 120000 index 0000000000..c8a417e739 --- /dev/null +++ b/Lang/TorqueScript/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/24-game b/Lang/TorqueScript/24-game new file mode 120000 index 0000000000..9ac52b8b42 --- /dev/null +++ b/Lang/TorqueScript/24-game @@ -0,0 +1 @@ +../../Task/24-game/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/99-Bottles-of-Beer b/Lang/TorqueScript/99-Bottles-of-Beer new file mode 120000 index 0000000000..3ddac73030 --- /dev/null +++ b/Lang/TorqueScript/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/A+B b/Lang/TorqueScript/A+B new file mode 120000 index 0000000000..de1447c94f --- /dev/null +++ b/Lang/TorqueScript/A+B @@ -0,0 +1 @@ +../../Task/A+B/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Apply-a-callback-to-an-array b/Lang/TorqueScript/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..91c60c96dd --- /dev/null +++ b/Lang/TorqueScript/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Arrays b/Lang/TorqueScript/Arrays new file mode 120000 index 0000000000..38cf4f810a --- /dev/null +++ b/Lang/TorqueScript/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Conditional-structures b/Lang/TorqueScript/Conditional-structures new file mode 120000 index 0000000000..6aaf8fce9a --- /dev/null +++ b/Lang/TorqueScript/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Factorial b/Lang/TorqueScript/Factorial new file mode 120000 index 0000000000..73f1ce6bab --- /dev/null +++ b/Lang/TorqueScript/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/File-size b/Lang/TorqueScript/File-size new file mode 120000 index 0000000000..78cd6d7e18 --- /dev/null +++ b/Lang/TorqueScript/File-size @@ -0,0 +1 @@ +../../Task/File-size/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Four-bit-adder b/Lang/TorqueScript/Four-bit-adder new file mode 120000 index 0000000000..f104c73958 --- /dev/null +++ b/Lang/TorqueScript/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Hello-world-Text b/Lang/TorqueScript/Hello-world-Text new file mode 120000 index 0000000000..0d272ed412 --- /dev/null +++ b/Lang/TorqueScript/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Infinity b/Lang/TorqueScript/Infinity new file mode 120000 index 0000000000..8081423c63 --- /dev/null +++ b/Lang/TorqueScript/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Loop-over-multiple-arrays-simultaneously b/Lang/TorqueScript/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..3cdd9914af --- /dev/null +++ b/Lang/TorqueScript/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Loops-Break b/Lang/TorqueScript/Loops-Break new file mode 120000 index 0000000000..26c6859c49 --- /dev/null +++ b/Lang/TorqueScript/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Loops-For b/Lang/TorqueScript/Loops-For new file mode 120000 index 0000000000..b786fce5aa --- /dev/null +++ b/Lang/TorqueScript/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Loops-Infinite b/Lang/TorqueScript/Loops-Infinite new file mode 120000 index 0000000000..931f9a4609 --- /dev/null +++ b/Lang/TorqueScript/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Loops-While b/Lang/TorqueScript/Loops-While new file mode 120000 index 0000000000..dcbf645371 --- /dev/null +++ b/Lang/TorqueScript/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/TorqueScript \ No newline at end of file diff --git a/Lang/TorqueScript/Search-a-list b/Lang/TorqueScript/Search-a-list new file mode 120000 index 0000000000..bf8ded7e7c --- /dev/null +++ b/Lang/TorqueScript/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/TorqueScript \ No newline at end of file diff --git a/Lang/Transact-SQL/0DESCRIPTION b/Lang/Transact-SQL/0DESCRIPTION new file mode 100644 index 0000000000..9bc9eed1b6 --- /dev/null +++ b/Lang/Transact-SQL/0DESCRIPTION @@ -0,0 +1 @@ +{{language|Transact-SQL}}{{implementation|SQL}}'''Transact-SQL''' ('''T-SQL''') is [[Microsoft]]'s and [[Sybase]]'s proprietary extension to [[SQL]]. \ No newline at end of file diff --git a/Lang/Transact-SQL/Hello-world-Text b/Lang/Transact-SQL/Hello-world-Text new file mode 120000 index 0000000000..88dca31c1f --- /dev/null +++ b/Lang/Transact-SQL/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Transact-SQL \ No newline at end of file diff --git a/Lang/Transact-SQL/Loops-Infinite b/Lang/Transact-SQL/Loops-Infinite new file mode 120000 index 0000000000..76a3a8086b --- /dev/null +++ b/Lang/Transact-SQL/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Transact-SQL \ No newline at end of file diff --git a/Lang/Trith/0DESCRIPTION b/Lang/Trith/0DESCRIPTION new file mode 100644 index 0000000000..1c9444bac6 --- /dev/null +++ b/Lang/Trith/0DESCRIPTION @@ -0,0 +1,22 @@ +{{language|Trith +|exec=interpreted +|site=http://trith.org/ +|gc=yes +|parampass=value +|safety=safe +|strength=strong +|compat=duck +|express=implicit +|checking=dynamic +|untyped=yes +|tags=trith +|LCT=yes}} +{{language programming paradigm|Concatenative}} +{{language programming paradigm|Functional}} +{{language programming paradigm|Dynamic}} +{{language programming paradigm|Reflective}} +'''Trith''' is an experimental stack-based, [http://concatenative.org/wiki/view/Concatenative%20language concatenative] programming language by [[User:Arto Bendiken|Arto Bendiken]]. It is dynamically typed and has a homoiconic program representation. The implementation currently consists of a virtual machine, interpreter, and compiler toolchain written in [[Ruby]] and an in-the-works runtime targeting the [[runs on vm::Java Virtual Machine|JVM]]. + +Trith programs are simply nested lists of operators and operands, with the operators identified by URIs. This means that Trith code can be straightforwardly represented externally either as S-expressions or as [http://linkeddata.org/ Linked Data] in the form of [http://en.wikipedia.org/wiki/Resource_Description_Framework RDF] triples. + +Trith is inspired and influenced by the author's experience with [[Forth]], [[Lisp]] and [[Scheme]] in general, and the concatenative languages [[Joy]], [[XY]], [[Factor]] and [[Cat]] in particular. \ No newline at end of file diff --git a/Lang/Trith/Array-concatenation b/Lang/Trith/Array-concatenation new file mode 120000 index 0000000000..af543e1dc2 --- /dev/null +++ b/Lang/Trith/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Trith \ No newline at end of file diff --git a/Lang/Trith/Averages-Arithmetic-mean b/Lang/Trith/Averages-Arithmetic-mean new file mode 120000 index 0000000000..3a515549b2 --- /dev/null +++ b/Lang/Trith/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Trith \ No newline at end of file diff --git a/Lang/Trith/Character-codes b/Lang/Trith/Character-codes new file mode 120000 index 0000000000..8fd26e51a7 --- /dev/null +++ b/Lang/Trith/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Trith \ No newline at end of file diff --git a/Lang/Trith/Conditional-structures b/Lang/Trith/Conditional-structures new file mode 120000 index 0000000000..326d1ebd17 --- /dev/null +++ b/Lang/Trith/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Trith \ No newline at end of file diff --git a/Lang/Trith/Empty-program b/Lang/Trith/Empty-program new file mode 120000 index 0000000000..a3056b4a8b --- /dev/null +++ b/Lang/Trith/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Trith \ No newline at end of file diff --git a/Lang/Trith/Flatten-a-list b/Lang/Trith/Flatten-a-list new file mode 120000 index 0000000000..d48957b6d1 --- /dev/null +++ b/Lang/Trith/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/Trith \ No newline at end of file diff --git a/Lang/Trith/Generic-swap b/Lang/Trith/Generic-swap new file mode 120000 index 0000000000..db6e1f8f45 --- /dev/null +++ b/Lang/Trith/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Trith \ No newline at end of file diff --git a/Lang/Trith/Greatest-element-of-a-list b/Lang/Trith/Greatest-element-of-a-list new file mode 120000 index 0000000000..aa2b03ae0a --- /dev/null +++ b/Lang/Trith/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Trith \ No newline at end of file diff --git a/Lang/Trith/Hello-world-Text b/Lang/Trith/Hello-world-Text new file mode 120000 index 0000000000..a72f2517d1 --- /dev/null +++ b/Lang/Trith/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Trith \ No newline at end of file diff --git a/Lang/Trith/Higher-order-functions b/Lang/Trith/Higher-order-functions new file mode 120000 index 0000000000..dc25d52f37 --- /dev/null +++ b/Lang/Trith/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Trith \ No newline at end of file diff --git a/Lang/Trith/Infinity b/Lang/Trith/Infinity new file mode 120000 index 0000000000..e0932a3d34 --- /dev/null +++ b/Lang/Trith/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Trith \ No newline at end of file diff --git a/Lang/Trith/Loops-Downward-for b/Lang/Trith/Loops-Downward-for new file mode 120000 index 0000000000..e49ba4a8b2 --- /dev/null +++ b/Lang/Trith/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Trith \ No newline at end of file diff --git a/Lang/Trith/Loops-Foreach b/Lang/Trith/Loops-Foreach new file mode 120000 index 0000000000..6c2e46c9f3 --- /dev/null +++ b/Lang/Trith/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Trith \ No newline at end of file diff --git a/Lang/Trith/Loops-Infinite b/Lang/Trith/Loops-Infinite new file mode 120000 index 0000000000..3cc7887f61 --- /dev/null +++ b/Lang/Trith/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Trith \ No newline at end of file diff --git a/Lang/Trith/Loops-While b/Lang/Trith/Loops-While new file mode 120000 index 0000000000..f5a62dae2e --- /dev/null +++ b/Lang/Trith/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Trith \ No newline at end of file diff --git a/Lang/True-BASIC/0DESCRIPTION b/Lang/True-BASIC/0DESCRIPTION new file mode 100644 index 0000000000..4d3d27c049 --- /dev/null +++ b/Lang/True-BASIC/0DESCRIPTION @@ -0,0 +1 @@ +{{stub}}{{language}} \ No newline at end of file diff --git a/Lang/Twelf/0DESCRIPTION b/Lang/Twelf/0DESCRIPTION new file mode 100644 index 0000000000..4579b2a66e --- /dev/null +++ b/Lang/Twelf/0DESCRIPTION @@ -0,0 +1,5 @@ +{{language|Twelf +|site=http://twelf.plparty.org/wiki/Main_Page +}} +Twelf is a language used to specify, implement, and prove properties of deductive systems such as programming languages and logics. Large research projects using Twelf include the TALT typed assembly language, a foundational proof-carrying-code system, and a type safety proof for Standard ML. +{{stub}} \ No newline at end of file diff --git a/Lang/UBASIC/0DESCRIPTION b/Lang/UBASIC/0DESCRIPTION new file mode 100644 index 0000000000..24309cb390 --- /dev/null +++ b/Lang/UBASIC/0DESCRIPTION @@ -0,0 +1,31 @@ +{{stub}}{{language}} + +UBASIC is a freeware BASIC interpreter written by Yuji Kida at Rikkyo University in Japan, specialized for mathematical computing. +More information and links can be found at its [[wp:UBASIC|Wikipedia article]]. + +==Sample Program== +This simple program approximates specific derivatives: + + 10 Point 6 'Sets decimal display to 28 places (0+.1^27) + 20 rf=#pi/180 'Degree -> Radian Conversion + 30 Dc=20 + 100 Q=73*rf:?Chr(2):?" F'(Q): Approximation"," Actual Value":N=1:GoSub 1000:?Using(,Dc),cos(Q):N=2:GoSub 1000:?Using(,Dc),1/Q:N=3:GoSub 1000:?Using(,Dc),#pi*Q^(#pi-1) + 999 End + 1000 '*** Print Sub *** + 1010 ?Using(,Dc),.Fp(Q);" ";:Return + 59999 End + 60000 '*** Function Assignment *** + 60100 .F(N,Q):If N=1 Then Return(sin(Q)) 'Fp=cos(Q) + 60102 If N=2 Then Return(log(Q)) 'Fp=1/Q + 60104 If N=3 Then Return(Q^#pi) 'Fp=pi*Q^(pi-1) + 60105 ?"Invalid Function Code: N must be '1' or '2' or '3'" + 60109 End + 60210 .Fp(Q):dQ=#eps^0.3:Return((.F(N,Q+0.5*dQ)-.F(N,Q-0.5*dQ))/dQ) + '' '' +'''''Run'''''ning as written gives: + + Run + 0.29237170472273672804 0.29237170472273672810 + 0.78487369196003179303 0.78487369196003179283 + 5.27771467407719816786 5.27771467407719816637 + OK \ No newline at end of file diff --git a/Lang/UC++/0DESCRIPTION b/Lang/UC++/0DESCRIPTION new file mode 100644 index 0000000000..cb38040ae3 --- /dev/null +++ b/Lang/UC++/0DESCRIPTION @@ -0,0 +1,4 @@ +{{stub}}{{language|UC++ +|site=http://www.russel.org.uk/KC++/index.html}} + +UC++ is an extension of [[C++]], incorporating in an integral way active objects, which allows the language to be used for building parallel systems. \ No newline at end of file diff --git a/Lang/UNIX-Shell/0DESCRIPTION b/Lang/UNIX-Shell/0DESCRIPTION new file mode 100644 index 0000000000..82111d1836 --- /dev/null +++ b/Lang/UNIX-Shell/0DESCRIPTION @@ -0,0 +1,25 @@ +{{language +|exec=interpreted +|tags=bash +|hopl id=568 +}}The '''UNIX Shell''' is a component of terminal-based [[UNIX]]-derived systems which offers both a command-line interface for running system commands, as well as programming interface for intelligently automating tasks which use system commands. + +=Implementation= + +There are many UNIX Shells and most of them can be categorized into two families. For purposes of the Rosetta Code, all examples are in Bourne-compatible syntax. The other family of shells, with a markedly different syntax, are ''csh'' ([[:Category:C Shell|C Shell]]) and it's ''tcsh'' (Tenex C Shell) "clone." Common Bourne compatible shells include the original [[Bourne Shell]] (''/bin/sh'' on most versions of UNIX), the GNU [[Bourne Again SHell]] (''bash'' --- which is linked to ''/bin/sh'' on many distributions of [[Linux]], making it their default shell), the [[Korn Shell]] (''ksh''), the [[Public Domain Korn SHell]] (''pdksh''), the [[Almquist SHell]] (''ash'') and the [[Debian Almquist SHell]] (''dash'') and the [[Z SHell]] (''zsh''). + + +''Main article: [[UNIX Shell Implementations]]'' + +=Language= + +While UNIX Shells vary in the programming languages they support, such languages carry a minimum set of features. Each language allows the programmer to [[Execute a System Command|execute system commands]] as though he were typing the commands himself, and each language allows for a header line which specifies which shell implementation is used to interpret the script. + +This one tells the operating system to use the [[Bourne Shell]]: + #!/bin/sh +This line tells the operating system to use the [[Bourne Again SHell]]: + #!/bin/bash +And this one tells the operating system to use the [[Korn Shell]]: + #!/bin/ksh + +Each header line consists of a hash, a bang, and the path to the [[interpreter]] binary. \ No newline at end of file diff --git a/Lang/UNIX-Shell/100-doors b/Lang/UNIX-Shell/100-doors new file mode 120000 index 0000000000..0d31ac9bce --- /dev/null +++ b/Lang/UNIX-Shell/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/99-Bottles-of-Beer b/Lang/UNIX-Shell/99-Bottles-of-Beer new file mode 120000 index 0000000000..e4c308f51c --- /dev/null +++ b/Lang/UNIX-Shell/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/A+B b/Lang/UNIX-Shell/A+B new file mode 120000 index 0000000000..d97a1ca94b --- /dev/null +++ b/Lang/UNIX-Shell/A+B @@ -0,0 +1 @@ +../../Task/A+B/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Accumulator-factory b/Lang/UNIX-Shell/Accumulator-factory new file mode 120000 index 0000000000..dcb27a45d9 --- /dev/null +++ b/Lang/UNIX-Shell/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Ackermann-function b/Lang/UNIX-Shell/Ackermann-function new file mode 120000 index 0000000000..2a78199e8d --- /dev/null +++ b/Lang/UNIX-Shell/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Active-Directory-Search-for-a-user b/Lang/UNIX-Shell/Active-Directory-Search-for-a-user new file mode 120000 index 0000000000..ac55acaadf --- /dev/null +++ b/Lang/UNIX-Shell/Active-Directory-Search-for-a-user @@ -0,0 +1 @@ +../../Task/Active-Directory-Search-for-a-user/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Align-columns b/Lang/UNIX-Shell/Align-columns new file mode 120000 index 0000000000..9adee1358b --- /dev/null +++ b/Lang/UNIX-Shell/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Anonymous-recursion b/Lang/UNIX-Shell/Anonymous-recursion new file mode 120000 index 0000000000..cf1185907b --- /dev/null +++ b/Lang/UNIX-Shell/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Apply-a-callback-to-an-array b/Lang/UNIX-Shell/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..f56dc97717 --- /dev/null +++ b/Lang/UNIX-Shell/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Arithmetic-Integer b/Lang/UNIX-Shell/Arithmetic-Integer new file mode 120000 index 0000000000..bdfc17922e --- /dev/null +++ b/Lang/UNIX-Shell/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Array-concatenation b/Lang/UNIX-Shell/Array-concatenation new file mode 120000 index 0000000000..b84172006c --- /dev/null +++ b/Lang/UNIX-Shell/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Arrays b/Lang/UNIX-Shell/Arrays new file mode 120000 index 0000000000..78f6edb06a --- /dev/null +++ b/Lang/UNIX-Shell/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Associative-array-Iteration b/Lang/UNIX-Shell/Associative-array-Iteration new file mode 120000 index 0000000000..271b280990 --- /dev/null +++ b/Lang/UNIX-Shell/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Averages-Arithmetic-mean b/Lang/UNIX-Shell/Averages-Arithmetic-mean new file mode 120000 index 0000000000..7ea7c186c0 --- /dev/null +++ b/Lang/UNIX-Shell/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Averages-Mode b/Lang/UNIX-Shell/Averages-Mode new file mode 120000 index 0000000000..6bcf4de352 --- /dev/null +++ b/Lang/UNIX-Shell/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Bitcoin-address-validation b/Lang/UNIX-Shell/Bitcoin-address-validation new file mode 120000 index 0000000000..08c5c961d8 --- /dev/null +++ b/Lang/UNIX-Shell/Bitcoin-address-validation @@ -0,0 +1 @@ +../../Task/Bitcoin-address-validation/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Boolean-values b/Lang/UNIX-Shell/Boolean-values new file mode 120000 index 0000000000..375ae4473a --- /dev/null +++ b/Lang/UNIX-Shell/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Box-the-compass b/Lang/UNIX-Shell/Box-the-compass new file mode 120000 index 0000000000..079aedc21f --- /dev/null +++ b/Lang/UNIX-Shell/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Bulls-and-cows b/Lang/UNIX-Shell/Bulls-and-cows new file mode 120000 index 0000000000..6a7a3bea2d --- /dev/null +++ b/Lang/UNIX-Shell/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Calendar b/Lang/UNIX-Shell/Calendar new file mode 120000 index 0000000000..51502a92cf --- /dev/null +++ b/Lang/UNIX-Shell/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Call-a-function b/Lang/UNIX-Shell/Call-a-function new file mode 120000 index 0000000000..d282c310cb --- /dev/null +++ b/Lang/UNIX-Shell/Call-a-function @@ -0,0 +1 @@ +../../Task/Call-a-function/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Case-sensitivity-of-identifiers b/Lang/UNIX-Shell/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..149c2bdece --- /dev/null +++ b/Lang/UNIX-Shell/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Check-that-file-exists b/Lang/UNIX-Shell/Check-that-file-exists new file mode 120000 index 0000000000..56a93b2b4a --- /dev/null +++ b/Lang/UNIX-Shell/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Combinations-with-repetitions b/Lang/UNIX-Shell/Combinations-with-repetitions new file mode 120000 index 0000000000..1264fc2473 --- /dev/null +++ b/Lang/UNIX-Shell/Combinations-with-repetitions @@ -0,0 +1 @@ +../../Task/Combinations-with-repetitions/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Command-line-arguments b/Lang/UNIX-Shell/Command-line-arguments new file mode 120000 index 0000000000..27cf9e01be --- /dev/null +++ b/Lang/UNIX-Shell/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Comments b/Lang/UNIX-Shell/Comments new file mode 120000 index 0000000000..d25c3ebd46 --- /dev/null +++ b/Lang/UNIX-Shell/Comments @@ -0,0 +1 @@ +../../Task/Comments/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Conditional-structures b/Lang/UNIX-Shell/Conditional-structures new file mode 120000 index 0000000000..76717335d4 --- /dev/null +++ b/Lang/UNIX-Shell/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Count-in-octal b/Lang/UNIX-Shell/Count-in-octal new file mode 120000 index 0000000000..b806f8679e --- /dev/null +++ b/Lang/UNIX-Shell/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Create-a-file b/Lang/UNIX-Shell/Create-a-file new file mode 120000 index 0000000000..4ef1531547 --- /dev/null +++ b/Lang/UNIX-Shell/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Create-a-file-on-magnetic-tape b/Lang/UNIX-Shell/Create-a-file-on-magnetic-tape new file mode 120000 index 0000000000..c322a18f66 --- /dev/null +++ b/Lang/UNIX-Shell/Create-a-file-on-magnetic-tape @@ -0,0 +1 @@ +../../Task/Create-a-file-on-magnetic-tape/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Date-format b/Lang/UNIX-Shell/Date-format new file mode 120000 index 0000000000..4aaeb3a684 --- /dev/null +++ b/Lang/UNIX-Shell/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Date-manipulation b/Lang/UNIX-Shell/Date-manipulation new file mode 120000 index 0000000000..0018521a6e --- /dev/null +++ b/Lang/UNIX-Shell/Date-manipulation @@ -0,0 +1 @@ +../../Task/Date-manipulation/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Day-of-the-week b/Lang/UNIX-Shell/Day-of-the-week new file mode 120000 index 0000000000..4e17fefb93 --- /dev/null +++ b/Lang/UNIX-Shell/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Deal-cards-for-FreeCell b/Lang/UNIX-Shell/Deal-cards-for-FreeCell new file mode 120000 index 0000000000..34a3d04226 --- /dev/null +++ b/Lang/UNIX-Shell/Deal-cards-for-FreeCell @@ -0,0 +1 @@ +../../Task/Deal-cards-for-FreeCell/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Delete-a-file b/Lang/UNIX-Shell/Delete-a-file new file mode 120000 index 0000000000..4024523337 --- /dev/null +++ b/Lang/UNIX-Shell/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Determine-if-only-one-instance-is-running b/Lang/UNIX-Shell/Determine-if-only-one-instance-is-running new file mode 120000 index 0000000000..51b126a9f2 --- /dev/null +++ b/Lang/UNIX-Shell/Determine-if-only-one-instance-is-running @@ -0,0 +1 @@ +../../Task/Determine-if-only-one-instance-is-running/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Dinesmans-multiple-dwelling-problem b/Lang/UNIX-Shell/Dinesmans-multiple-dwelling-problem new file mode 120000 index 0000000000..8786076b30 --- /dev/null +++ b/Lang/UNIX-Shell/Dinesmans-multiple-dwelling-problem @@ -0,0 +1 @@ +../../Task/Dinesmans-multiple-dwelling-problem/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Dutch-national-flag-problem b/Lang/UNIX-Shell/Dutch-national-flag-problem new file mode 120000 index 0000000000..a257e50c77 --- /dev/null +++ b/Lang/UNIX-Shell/Dutch-national-flag-problem @@ -0,0 +1 @@ +../../Task/Dutch-national-flag-problem/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Empty-directory b/Lang/UNIX-Shell/Empty-directory new file mode 120000 index 0000000000..db3dd9dcce --- /dev/null +++ b/Lang/UNIX-Shell/Empty-directory @@ -0,0 +1 @@ +../../Task/Empty-directory/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Empty-program b/Lang/UNIX-Shell/Empty-program new file mode 120000 index 0000000000..aa572fb3d9 --- /dev/null +++ b/Lang/UNIX-Shell/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Empty-string b/Lang/UNIX-Shell/Empty-string new file mode 120000 index 0000000000..fa953ffaf5 --- /dev/null +++ b/Lang/UNIX-Shell/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Enforced-immutability b/Lang/UNIX-Shell/Enforced-immutability new file mode 120000 index 0000000000..a4840e79b9 --- /dev/null +++ b/Lang/UNIX-Shell/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Ethiopian-multiplication b/Lang/UNIX-Shell/Ethiopian-multiplication new file mode 120000 index 0000000000..9c878e3ba1 --- /dev/null +++ b/Lang/UNIX-Shell/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Evaluate-binomial-coefficients b/Lang/UNIX-Shell/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..d3559cb85d --- /dev/null +++ b/Lang/UNIX-Shell/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Execute-a-system-command b/Lang/UNIX-Shell/Execute-a-system-command new file mode 120000 index 0000000000..3c5fcc2eac --- /dev/null +++ b/Lang/UNIX-Shell/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Extend-your-language b/Lang/UNIX-Shell/Extend-your-language new file mode 120000 index 0000000000..60e9d51a3b --- /dev/null +++ b/Lang/UNIX-Shell/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Factorial b/Lang/UNIX-Shell/Factorial new file mode 120000 index 0000000000..9bebb308e8 --- /dev/null +++ b/Lang/UNIX-Shell/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Fibonacci-sequence b/Lang/UNIX-Shell/Fibonacci-sequence new file mode 120000 index 0000000000..b290bcf44f --- /dev/null +++ b/Lang/UNIX-Shell/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/File-IO b/Lang/UNIX-Shell/File-IO new file mode 120000 index 0000000000..0bbda5fd6e --- /dev/null +++ b/Lang/UNIX-Shell/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/File-modification-time b/Lang/UNIX-Shell/File-modification-time new file mode 120000 index 0000000000..576251af62 --- /dev/null +++ b/Lang/UNIX-Shell/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/File-size b/Lang/UNIX-Shell/File-size new file mode 120000 index 0000000000..6961ac5005 --- /dev/null +++ b/Lang/UNIX-Shell/File-size @@ -0,0 +1 @@ +../../Task/File-size/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Filter b/Lang/UNIX-Shell/Filter new file mode 120000 index 0000000000..5dda26b4d5 --- /dev/null +++ b/Lang/UNIX-Shell/Filter @@ -0,0 +1 @@ +../../Task/Filter/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Find-common-directory-path b/Lang/UNIX-Shell/Find-common-directory-path new file mode 120000 index 0000000000..e3e122dfdc --- /dev/null +++ b/Lang/UNIX-Shell/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Find-limit-of-recursion b/Lang/UNIX-Shell/Find-limit-of-recursion new file mode 120000 index 0000000000..b8856e115c --- /dev/null +++ b/Lang/UNIX-Shell/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/FizzBuzz b/Lang/UNIX-Shell/FizzBuzz new file mode 120000 index 0000000000..cbf29093a4 --- /dev/null +++ b/Lang/UNIX-Shell/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Fork b/Lang/UNIX-Shell/Fork new file mode 120000 index 0000000000..758d901469 --- /dev/null +++ b/Lang/UNIX-Shell/Fork @@ -0,0 +1 @@ +../../Task/Fork/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Function-composition b/Lang/UNIX-Shell/Function-composition new file mode 120000 index 0000000000..84408a0a97 --- /dev/null +++ b/Lang/UNIX-Shell/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Function-definition b/Lang/UNIX-Shell/Function-definition new file mode 120000 index 0000000000..a203f20cf9 --- /dev/null +++ b/Lang/UNIX-Shell/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Greatest-common-divisor b/Lang/UNIX-Shell/Greatest-common-divisor new file mode 120000 index 0000000000..9ae1d6afbd --- /dev/null +++ b/Lang/UNIX-Shell/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Greatest-element-of-a-list b/Lang/UNIX-Shell/Greatest-element-of-a-list new file mode 120000 index 0000000000..65cff045ab --- /dev/null +++ b/Lang/UNIX-Shell/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Guess-the-number b/Lang/UNIX-Shell/Guess-the-number new file mode 120000 index 0000000000..bd2b60d428 --- /dev/null +++ b/Lang/UNIX-Shell/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Guess-the-number-With-feedback b/Lang/UNIX-Shell/Guess-the-number-With-feedback new file mode 120000 index 0000000000..3fbcad8291 --- /dev/null +++ b/Lang/UNIX-Shell/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/HTTP b/Lang/UNIX-Shell/HTTP new file mode 120000 index 0000000000..77596db7f3 --- /dev/null +++ b/Lang/UNIX-Shell/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/HTTPS b/Lang/UNIX-Shell/HTTPS new file mode 120000 index 0000000000..6470a04884 --- /dev/null +++ b/Lang/UNIX-Shell/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Hailstone-sequence b/Lang/UNIX-Shell/Hailstone-sequence new file mode 120000 index 0000000000..0dcb714340 --- /dev/null +++ b/Lang/UNIX-Shell/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Handle-a-signal b/Lang/UNIX-Shell/Handle-a-signal new file mode 120000 index 0000000000..4435cc4e51 --- /dev/null +++ b/Lang/UNIX-Shell/Handle-a-signal @@ -0,0 +1 @@ +../../Task/Handle-a-signal/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Happy-numbers b/Lang/UNIX-Shell/Happy-numbers new file mode 120000 index 0000000000..747444f96f --- /dev/null +++ b/Lang/UNIX-Shell/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Hello-world-Graphical b/Lang/UNIX-Shell/Hello-world-Graphical new file mode 120000 index 0000000000..f48564d477 --- /dev/null +++ b/Lang/UNIX-Shell/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Hello-world-Line-printer b/Lang/UNIX-Shell/Hello-world-Line-printer new file mode 120000 index 0000000000..6a793ed990 --- /dev/null +++ b/Lang/UNIX-Shell/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Hello-world-Newline-omission b/Lang/UNIX-Shell/Hello-world-Newline-omission new file mode 120000 index 0000000000..540a56cac1 --- /dev/null +++ b/Lang/UNIX-Shell/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Hello-world-Standard-error b/Lang/UNIX-Shell/Hello-world-Standard-error new file mode 120000 index 0000000000..622329c085 --- /dev/null +++ b/Lang/UNIX-Shell/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Hello-world-Text b/Lang/UNIX-Shell/Hello-world-Text new file mode 120000 index 0000000000..c3c4e9470a --- /dev/null +++ b/Lang/UNIX-Shell/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Here-document b/Lang/UNIX-Shell/Here-document new file mode 120000 index 0000000000..11e05a9577 --- /dev/null +++ b/Lang/UNIX-Shell/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Hostname b/Lang/UNIX-Shell/Hostname new file mode 120000 index 0000000000..938446c86e --- /dev/null +++ b/Lang/UNIX-Shell/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/I-before-E-except-after-C b/Lang/UNIX-Shell/I-before-E-except-after-C new file mode 120000 index 0000000000..7511d446c8 --- /dev/null +++ b/Lang/UNIX-Shell/I-before-E-except-after-C @@ -0,0 +1 @@ +../../Task/I-before-E-except-after-C/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Include-a-file b/Lang/UNIX-Shell/Include-a-file new file mode 120000 index 0000000000..013a4dd399 --- /dev/null +++ b/Lang/UNIX-Shell/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Increment-a-numerical-string b/Lang/UNIX-Shell/Increment-a-numerical-string new file mode 120000 index 0000000000..668e831258 --- /dev/null +++ b/Lang/UNIX-Shell/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Input-loop b/Lang/UNIX-Shell/Input-loop new file mode 120000 index 0000000000..a7a55f8383 --- /dev/null +++ b/Lang/UNIX-Shell/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Integer-comparison b/Lang/UNIX-Shell/Integer-comparison new file mode 120000 index 0000000000..cc2b073d0a --- /dev/null +++ b/Lang/UNIX-Shell/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Integer-sequence b/Lang/UNIX-Shell/Integer-sequence new file mode 120000 index 0000000000..22dd8b4513 --- /dev/null +++ b/Lang/UNIX-Shell/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Interactive-programming b/Lang/UNIX-Shell/Interactive-programming new file mode 120000 index 0000000000..1b8845ba5a --- /dev/null +++ b/Lang/UNIX-Shell/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Inverted-index b/Lang/UNIX-Shell/Inverted-index new file mode 120000 index 0000000000..d622e216f8 --- /dev/null +++ b/Lang/UNIX-Shell/Inverted-index @@ -0,0 +1 @@ +../../Task/Inverted-index/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/UNIX-Shell/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..09d8d89a75 --- /dev/null +++ b/Lang/UNIX-Shell/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Knuth-shuffle b/Lang/UNIX-Shell/Knuth-shuffle new file mode 120000 index 0000000000..0c9bb20c94 --- /dev/null +++ b/Lang/UNIX-Shell/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Last-Friday-of-each-month b/Lang/UNIX-Shell/Last-Friday-of-each-month new file mode 120000 index 0000000000..f2d29039d2 --- /dev/null +++ b/Lang/UNIX-Shell/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Leap-year b/Lang/UNIX-Shell/Leap-year new file mode 120000 index 0000000000..d532a955a7 --- /dev/null +++ b/Lang/UNIX-Shell/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Least-common-multiple b/Lang/UNIX-Shell/Least-common-multiple new file mode 120000 index 0000000000..6ac9f44c3a --- /dev/null +++ b/Lang/UNIX-Shell/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Literals-Integer b/Lang/UNIX-Shell/Literals-Integer new file mode 120000 index 0000000000..4a6010a20d --- /dev/null +++ b/Lang/UNIX-Shell/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Literals-String b/Lang/UNIX-Shell/Literals-String new file mode 120000 index 0000000000..9b1a2006e4 --- /dev/null +++ b/Lang/UNIX-Shell/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loop-over-multiple-arrays-simultaneously b/Lang/UNIX-Shell/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..987cacd3f8 --- /dev/null +++ b/Lang/UNIX-Shell/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-Break b/Lang/UNIX-Shell/Loops-Break new file mode 120000 index 0000000000..a42eadfd33 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-Continue b/Lang/UNIX-Shell/Loops-Continue new file mode 120000 index 0000000000..0852e368f1 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-Do-while b/Lang/UNIX-Shell/Loops-Do-while new file mode 120000 index 0000000000..f761b82125 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-Downward-for b/Lang/UNIX-Shell/Loops-Downward-for new file mode 120000 index 0000000000..84eb6d8e32 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-For b/Lang/UNIX-Shell/Loops-For new file mode 120000 index 0000000000..261034959b --- /dev/null +++ b/Lang/UNIX-Shell/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-For-with-a-specified-step b/Lang/UNIX-Shell/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..14b8f0144a --- /dev/null +++ b/Lang/UNIX-Shell/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-Foreach b/Lang/UNIX-Shell/Loops-Foreach new file mode 120000 index 0000000000..3b7d6410aa --- /dev/null +++ b/Lang/UNIX-Shell/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-Infinite b/Lang/UNIX-Shell/Loops-Infinite new file mode 120000 index 0000000000..1f9a8e7e11 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-N-plus-one-half b/Lang/UNIX-Shell/Loops-N-plus-one-half new file mode 120000 index 0000000000..5f888d7e34 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-Nested b/Lang/UNIX-Shell/Loops-Nested new file mode 120000 index 0000000000..3dd0676c23 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Loops-While b/Lang/UNIX-Shell/Loops-While new file mode 120000 index 0000000000..28e2dfcbb3 --- /dev/null +++ b/Lang/UNIX-Shell/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/MD5 b/Lang/UNIX-Shell/MD5 new file mode 120000 index 0000000000..520b11ca83 --- /dev/null +++ b/Lang/UNIX-Shell/MD5 @@ -0,0 +1 @@ +../../Task/MD5/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Matrix-multiplication b/Lang/UNIX-Shell/Matrix-multiplication new file mode 120000 index 0000000000..9fae7b1ca6 --- /dev/null +++ b/Lang/UNIX-Shell/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Menu b/Lang/UNIX-Shell/Menu new file mode 120000 index 0000000000..7e478ee1e9 --- /dev/null +++ b/Lang/UNIX-Shell/Menu @@ -0,0 +1 @@ +../../Task/Menu/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Middle-three-digits b/Lang/UNIX-Shell/Middle-three-digits new file mode 120000 index 0000000000..002e766c18 --- /dev/null +++ b/Lang/UNIX-Shell/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Monty-Hall-problem b/Lang/UNIX-Shell/Monty-Hall-problem new file mode 120000 index 0000000000..6039baf99d --- /dev/null +++ b/Lang/UNIX-Shell/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Mutual-recursion b/Lang/UNIX-Shell/Mutual-recursion new file mode 120000 index 0000000000..6f372fe404 --- /dev/null +++ b/Lang/UNIX-Shell/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/UNIX-Shell \ No newline at end of file diff --git a/Lang/UNIX-Shell/Quine b/Lang/UNIX-Shell/Quine new file mode 120000 index 0000000000..977c24570d --- /dev/null +++ b/Lang/UNIX-Shell/Quine @@ -0,0 +1 @@ +../../Task/Quine/UNIX-Shell \ No newline at end of file diff --git a/Lang/UScript/0DESCRIPTION b/Lang/UScript/0DESCRIPTION new file mode 100644 index 0000000000..c7f8f4b939 --- /dev/null +++ b/Lang/UScript/0DESCRIPTION @@ -0,0 +1,15 @@ +{{language|UScript + +|LCT=no +}} +{{Wikipedia|UScript}} +UnrealScript (often abbreviated to UScript) is the scripting language of the Unreal Engine and is used for authoring game code and gameplay events. + +Similar in basic design principles to Java, UnrealScript has object-oriented features and is recognizable as a member of the curly brace family. As in Java, UnrealScript does not support multiple inheritance; classes all inherit from a common Object class and are defined in individual files named after each class. Unlike Java, UnrealScript is case-insensitive, and does not have object wrappers for primitive types. Interfaces are only supported in Unreal Engine generation 3 and a few Unreal Engine 2 games. UnrealScript supports operator overloading, but not method overloading, except for optional parameters. + +The language was also designed for simple, high-level game programming. The UnrealScript interpreter was programmed by Tim Sweeney, who had also created an earlier game scripting language called ZZT-oop. + +By making the process of modifying the game easier, UnrealScript helped enable the growth of a large community of people on the Internet dedicated to modifying Unreal. This ability greatly added to the overall longevity of Unreal and provided an incentive for new development. +{{Stub}} +== See Also == +*[http://wiki.beyondunreal.com/UnrealScript UnrealScript] \ No newline at end of file diff --git a/Lang/Unicon/0DESCRIPTION b/Lang/Unicon/0DESCRIPTION new file mode 100644 index 0000000000..053e65279e --- /dev/null +++ b/Lang/Unicon/0DESCRIPTION @@ -0,0 +1,81 @@ +{{language|Unicon +|site=http://unicon.org/ +|exec=bytecode +|parampass=value +|strength=strong +|safety=safe +|express=implicit +|checking=dynamic +|gc=yes +|LCT=yes +}} +{{virtual machine}} +{{language programming paradigm|Procedural}} +{{language programming paradigm|Dynamic}} +{{language programming paradigm|Object-oriented}} +{{language programming paradigm|Logic_Programming}} +{{Language programming paradigm|Concurrent}} + +Unicon is a unification of several extended dialects of the [[derived from::Icon]] language, featuring Icon plus classes, POSIX system facilities, GDBM and ODBC-based (SQL) database access, packages, 3D graphics and more, all provided at a very high semantic level. + +In addition to Icon, Unicon draws from: +* IDOL an object-oriented Icon preprocessor +* MTIcon a multi-threading Icon. (Most recently, in version 12, improved multi-threading capabilities were added.) + +While Unicon is mostly a super-set of Icon there are some differences and incompatibilities. + +Icon itself is an evolution of the line of languages [[wp:COMIT|COMIT]], SNOBOL, [[:Category:SNOBOL4|SNOBOL4]], and SL5. + +== Introduction to Icon and Unicon == +If you want to learn more about these languages please see [[Icon%2BUnicon/Intro|An introduction to Icon and Unicon for Rosetta Code]]. + +The following are related: +* [[:Category:Icon_Programming_Library|The Icon Programming Library]] +* [[:Category:Unicon_Code_Library|The Unicon Code Library]] + +== External Links and References == +=== Home Pages === +* [http://unicon.org/ Unicon home page on Sourceforge] +* [http://www.cs.arizona.edu/icon/ The Icon home page at the University of Arizona] + +=== Books === +==== General ==== +* [http://unicon.org/book/ub.pdf Book: Programming with Unicon describing the language, the Icon Programming Library and Unicon extensions] +* [http://www.cs.arizona.edu/icon/ftp/doc/lb1up.pdf Book: The Icon Programming Language, 3rd Edition] +* [http://www.cs.arizona.edu/icon/ftp/doc/gb1up.pdf Book: Graphics Programming in Icon] +* [http://www.tools-of-computing.com/tc/CS/iconprog.pdf Book: Icon Programming Language Handbook] +* [http://www2.cs.uidaho.edu/~jeffery/icon/humanists/humanist.pdf Book: Icon Programming for Humanists] + +==== Internals ==== +* [http://unicon.sourceforge.net/book/ib.pdf The Implementation of Icon and Unicon a Compendium]] +** [http://unicon.sourceforge.net/reports.html Unicon Technical Reports and works in progress] +* [http://www.cs.arizona.edu/icon/ftp/doc/ib1up.pdf The Implementation of the Icon Programming Language] +** [http://www.cs.arizona.edu/icon/docs/ipd112.htm IPD112 Supplement to Version 8] +** [http://www.cs.arizona.edu/icon/docs/ipd239.htm IPD239 Supplement to Version 9] +** [http://www.cs.arizona.edu/icon/docs/docs.htm Icon Technical Reports (TR) and Project Documents (IDP)] + +=== Articles and Newsletters === +* [http://unicon.org/generator/ Archived issues of the Generator from 2004-2005 discussing Unicon programming] +* [http://www.cs.arizona.edu/icon/inl/inl.htm Archived issues of the Icon Newsletter from 1979-2000 discussing Icon programming] +* [http://www.cs.arizona.edu/icon/analyst/ia.htm Archived issues of the Icon Analysts from 1990-2001 discussing advanced Icon programming] + +=== Programming References === +* [http://www.cs.arizona.edu/icon/library/ipl.htm The Icon Programming Library and index] +* [https://tapestry.tucson.az.us/twiki/bin/view/Main/WebHome Unicon Discussion Web/TWiki containing various programming examples, problems, and challenges] + +=== Other === +* [[wp:Unicon_(programming_language)|Wikipedia: Unicon]] +* [[wp:Icon_%28programming_language%29|Wikipedia: Icon]] +* [http://www.mitchellsoftwareengineering.com/icon/icon.sli.pdf Presentation: Fundamentals of Icon Programming] +* [http://www.pclosmag.com/html/Issues/201101/page17.html PC Linux OS Magazine, Volume 48, Computer Languages From A to Z: Unicon] +===Related/Variants=== +* [[Jcon]] +* [[ObjectIcon]] + +== Other RosettaCode Wiki Links == +* [[:Category_talk:Unicon|The Discussion Tab for this page]] Lots of notes about things to do, help wanted, ideas, and guidance on formatting and markup +* [[Reports:Tasks_not_implemented_in_Unicon|Tasks not yet implemented]] Tasks that need to be coded +** [[Icon%2BUnicon/Analysis_of_UnimplementedTasks]] for an analysis of the groupings of these tasks (taken at a point in time) +* [[:Category:Unicon/Omit|Unimplementable tasks]] Tasks that cannot be implemented in the language +* [[:Category:Unicon_examples_needing_attention|Tasks requiring attention]] Tasks that could be improved +* [[Special:MostLinkedCategories|Most Linked Categories]] shows how many pages various languages (and other categories) have. \ No newline at end of file diff --git a/Lang/Unicon/Accumulator-factory b/Lang/Unicon/Accumulator-factory new file mode 120000 index 0000000000..edf71363f7 --- /dev/null +++ b/Lang/Unicon/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Unicon \ No newline at end of file diff --git a/Lang/Unicon/Average-loop-length b/Lang/Unicon/Average-loop-length new file mode 120000 index 0000000000..d2e9aa441a --- /dev/null +++ b/Lang/Unicon/Average-loop-length @@ -0,0 +1 @@ +../../Task/Average-loop-length/Unicon \ No newline at end of file diff --git a/Lang/Unicon/Identity-matrix b/Lang/Unicon/Identity-matrix new file mode 120000 index 0000000000..cad86066a9 --- /dev/null +++ b/Lang/Unicon/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/Unicon \ No newline at end of file diff --git a/Lang/UnixPipes/0DESCRIPTION b/Lang/UnixPipes/0DESCRIPTION new file mode 100644 index 0000000000..8a315a0473 --- /dev/null +++ b/Lang/UnixPipes/0DESCRIPTION @@ -0,0 +1,38 @@ +{{language +|hopl=no +}} +''UnixPipes is really the same language as [[:Category:UNIX Shell|UNIX Shell]].'' + +'''Unix Pipes''' is a collection of tools which doesn't use any Turing complete sublanguages. The idea of the system is to solve programming problems using only the pipelines alone. The tools are not restricted to the commonly available tools in [[UNIX]]. Any new tool is allowed as long as it is sharp enough. (i.e does one and only one thing very well). + +If a new tool is introduced, a description of the tool is required. + +Using utilities from, [http://packages.debian.org/unstable/utils/moreutils moreutils] + +'''unfold''' + +Defining unfold as the opposite of xargs, i.e take a list of arguments and send them one at a time. +The definition would be + +|cat unfold +num=$1 +while read xxx; do + for i in $xxx; do + echo $i + done |xargs -n $num echo +done + +|echo 1 2 3 4 5 6 7 8 |unfold 3 +1 2 3 +4 5 6 +7 8 + + + +== Deleted solutions == +We delete a UnixPipes solution when it is too similar to its UNIX Shell equivalent, or when it is incorrect (but the UNIX Shell solution is correct). + +# [[Hello world/Standard error]] -- Merged to UNIX Shell. +# [[Sieve of Eratosthenes]] -- Deleted for being incorrect. +# [[Sockets]] -- Merged to UNIX Shell. +# [[String case]] -- Merged to UNIX Shell. \ No newline at end of file diff --git a/Lang/UnixPipes/99-Bottles-of-Beer b/Lang/UnixPipes/99-Bottles-of-Beer new file mode 120000 index 0000000000..80b56cba90 --- /dev/null +++ b/Lang/UnixPipes/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Associative-array-Creation b/Lang/UnixPipes/Associative-array-Creation new file mode 120000 index 0000000000..ffffbce4a5 --- /dev/null +++ b/Lang/UnixPipes/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Averages-Arithmetic-mean b/Lang/UnixPipes/Averages-Arithmetic-mean new file mode 120000 index 0000000000..8bf29ff634 --- /dev/null +++ b/Lang/UnixPipes/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Binary-search b/Lang/UnixPipes/Binary-search new file mode 120000 index 0000000000..2b289d175a --- /dev/null +++ b/Lang/UnixPipes/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Concurrent-computing b/Lang/UnixPipes/Concurrent-computing new file mode 120000 index 0000000000..7033706075 --- /dev/null +++ b/Lang/UnixPipes/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Distributed-programming b/Lang/UnixPipes/Distributed-programming new file mode 120000 index 0000000000..00247b776d --- /dev/null +++ b/Lang/UnixPipes/Distributed-programming @@ -0,0 +1 @@ +../../Task/Distributed-programming/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Fibonacci-sequence b/Lang/UnixPipes/Fibonacci-sequence new file mode 120000 index 0000000000..7778252c96 --- /dev/null +++ b/Lang/UnixPipes/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Filter b/Lang/UnixPipes/Filter new file mode 120000 index 0000000000..9770730e96 --- /dev/null +++ b/Lang/UnixPipes/Filter @@ -0,0 +1 @@ +../../Task/Filter/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Fork b/Lang/UnixPipes/Fork new file mode 120000 index 0000000000..dc77d2b88a --- /dev/null +++ b/Lang/UnixPipes/Fork @@ -0,0 +1 @@ +../../Task/Fork/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Hash-from-two-arrays b/Lang/UnixPipes/Hash-from-two-arrays new file mode 120000 index 0000000000..137e317a13 --- /dev/null +++ b/Lang/UnixPipes/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Input-loop b/Lang/UnixPipes/Input-loop new file mode 120000 index 0000000000..81d2da7aa5 --- /dev/null +++ b/Lang/UnixPipes/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Loops-Continue b/Lang/UnixPipes/Loops-Continue new file mode 120000 index 0000000000..f782067e4f --- /dev/null +++ b/Lang/UnixPipes/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Loops-Downward-for b/Lang/UnixPipes/Loops-Downward-for new file mode 120000 index 0000000000..758fc2803b --- /dev/null +++ b/Lang/UnixPipes/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Loops-For b/Lang/UnixPipes/Loops-For new file mode 120000 index 0000000000..2dcebeb12e --- /dev/null +++ b/Lang/UnixPipes/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Loops-Infinite b/Lang/UnixPipes/Loops-Infinite new file mode 120000 index 0000000000..e74f3ef825 --- /dev/null +++ b/Lang/UnixPipes/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Loops-N-plus-one-half b/Lang/UnixPipes/Loops-N-plus-one-half new file mode 120000 index 0000000000..0daf05be33 --- /dev/null +++ b/Lang/UnixPipes/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Loops-While b/Lang/UnixPipes/Loops-While new file mode 120000 index 0000000000..8c8b7dab01 --- /dev/null +++ b/Lang/UnixPipes/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/UnixPipes \ No newline at end of file diff --git a/Lang/UnixPipes/Metered-concurrency b/Lang/UnixPipes/Metered-concurrency new file mode 120000 index 0000000000..4975c477bf --- /dev/null +++ b/Lang/UnixPipes/Metered-concurrency @@ -0,0 +1 @@ +../../Task/Metered-concurrency/UnixPipes \ No newline at end of file diff --git a/Lang/Unlambda/0DESCRIPTION b/Lang/Unlambda/0DESCRIPTION new file mode 100644 index 0000000000..962918460c --- /dev/null +++ b/Lang/Unlambda/0DESCRIPTION @@ -0,0 +1,10 @@ +{{language|Unlambda +|exec=interpreted +|site=http://www.madore.org/~david/programs/unlambda/ +|LCT=no +}} +{{language programming paradigm|functional}} +'''Unlambda''' is a minimal, functional, esoteric language based on combinatory logic, specifically the S and K combinators. [[provides::Capability:First class functions| ]] +==External links== +* [[eso:Unlambda|Esoteric languages wiki page]] +[[Category:Esoteric Languages]] \ No newline at end of file diff --git a/Lang/Unlambda/Hello-world-Text b/Lang/Unlambda/Hello-world-Text new file mode 120000 index 0000000000..beb445a8cc --- /dev/null +++ b/Lang/Unlambda/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Unlambda \ No newline at end of file diff --git a/Lang/Unlambda/Loops-Infinite b/Lang/Unlambda/Loops-Infinite new file mode 120000 index 0000000000..ba9f9f3194 --- /dev/null +++ b/Lang/Unlambda/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Unlambda \ No newline at end of file diff --git a/Lang/Ursala/0DESCRIPTION b/Lang/Ursala/0DESCRIPTION new file mode 100644 index 0000000000..aed2a4878f --- /dev/null +++ b/Lang/Ursala/0DESCRIPTION @@ -0,0 +1,6 @@ +{{language|Ursala +|site= http://www.basis.netii.net/ursala +|LCT=no +}} +{{language programming paradigm|Functional}} +Ursala is an interpreted functional language with some experimental features, intended mainly for text and numerical applications. \ No newline at end of file diff --git a/Lang/Ursala/100-doors b/Lang/Ursala/100-doors new file mode 120000 index 0000000000..cb06f3f1c8 --- /dev/null +++ b/Lang/Ursala/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Ursala \ No newline at end of file diff --git a/Lang/Ursala/24-game-Solve b/Lang/Ursala/24-game-Solve new file mode 120000 index 0000000000..ee5053563d --- /dev/null +++ b/Lang/Ursala/24-game-Solve @@ -0,0 +1 @@ +../../Task/24-game-Solve/Ursala \ No newline at end of file diff --git a/Lang/Ursala/99-Bottles-of-Beer b/Lang/Ursala/99-Bottles-of-Beer new file mode 120000 index 0000000000..4c1f748263 --- /dev/null +++ b/Lang/Ursala/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Ursala \ No newline at end of file diff --git a/Lang/Ursala/A+B b/Lang/Ursala/A+B new file mode 120000 index 0000000000..fa9309cfd9 --- /dev/null +++ b/Lang/Ursala/A+B @@ -0,0 +1 @@ +../../Task/A+B/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Ackermann-function b/Lang/Ursala/Ackermann-function new file mode 120000 index 0000000000..77dc0394ac --- /dev/null +++ b/Lang/Ursala/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Align-columns b/Lang/Ursala/Align-columns new file mode 120000 index 0000000000..942b77f109 --- /dev/null +++ b/Lang/Ursala/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Anagrams b/Lang/Ursala/Anagrams new file mode 120000 index 0000000000..fcc339c049 --- /dev/null +++ b/Lang/Ursala/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Anagrams-Deranged-anagrams b/Lang/Ursala/Anagrams-Deranged-anagrams new file mode 120000 index 0000000000..5365bc499f --- /dev/null +++ b/Lang/Ursala/Anagrams-Deranged-anagrams @@ -0,0 +1 @@ +../../Task/Anagrams-Deranged-anagrams/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Anonymous-recursion b/Lang/Ursala/Anonymous-recursion new file mode 120000 index 0000000000..7d605b430f --- /dev/null +++ b/Lang/Ursala/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Apply-a-callback-to-an-array b/Lang/Ursala/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..9db4b4fae2 --- /dev/null +++ b/Lang/Ursala/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Arbitrary-precision-integers-included b/Lang/Ursala/Arbitrary-precision-integers-included new file mode 120000 index 0000000000..2b3fab76dd --- /dev/null +++ b/Lang/Ursala/Arbitrary-precision-integers-included @@ -0,0 +1 @@ +../../Task/Arbitrary-precision-integers-included/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Arithmetic-Complex b/Lang/Ursala/Arithmetic-Complex new file mode 120000 index 0000000000..abf632a4c2 --- /dev/null +++ b/Lang/Ursala/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Arithmetic-evaluation b/Lang/Ursala/Arithmetic-evaluation new file mode 120000 index 0000000000..f28b0c0a91 --- /dev/null +++ b/Lang/Ursala/Arithmetic-evaluation @@ -0,0 +1 @@ +../../Task/Arithmetic-evaluation/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Averages-Arithmetic-mean b/Lang/Ursala/Averages-Arithmetic-mean new file mode 120000 index 0000000000..8c973089ca --- /dev/null +++ b/Lang/Ursala/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Averages-Median b/Lang/Ursala/Averages-Median new file mode 120000 index 0000000000..d4e3d138b9 --- /dev/null +++ b/Lang/Ursala/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Averages-Mode b/Lang/Ursala/Averages-Mode new file mode 120000 index 0000000000..41a4cb6cc8 --- /dev/null +++ b/Lang/Ursala/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Averages-Pythagorean-means b/Lang/Ursala/Averages-Pythagorean-means new file mode 120000 index 0000000000..533b08876c --- /dev/null +++ b/Lang/Ursala/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Averages-Root-mean-square b/Lang/Ursala/Averages-Root-mean-square new file mode 120000 index 0000000000..d826491dd3 --- /dev/null +++ b/Lang/Ursala/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Balanced-brackets b/Lang/Ursala/Balanced-brackets new file mode 120000 index 0000000000..c5ede1f362 --- /dev/null +++ b/Lang/Ursala/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Best-shuffle b/Lang/Ursala/Best-shuffle new file mode 120000 index 0000000000..6e811458bd --- /dev/null +++ b/Lang/Ursala/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Caesar-cipher b/Lang/Ursala/Caesar-cipher new file mode 120000 index 0000000000..2b9be66645 --- /dev/null +++ b/Lang/Ursala/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Call-a-function-in-a-shared-library b/Lang/Ursala/Call-a-function-in-a-shared-library new file mode 120000 index 0000000000..b6ceda3495 --- /dev/null +++ b/Lang/Ursala/Call-a-function-in-a-shared-library @@ -0,0 +1 @@ +../../Task/Call-a-function-in-a-shared-library/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Character-codes b/Lang/Ursala/Character-codes new file mode 120000 index 0000000000..85ab9a4993 --- /dev/null +++ b/Lang/Ursala/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Closest-pair-problem b/Lang/Ursala/Closest-pair-problem new file mode 120000 index 0000000000..66a21c7e5c --- /dev/null +++ b/Lang/Ursala/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Collections b/Lang/Ursala/Collections new file mode 120000 index 0000000000..b938752738 --- /dev/null +++ b/Lang/Ursala/Collections @@ -0,0 +1 @@ +../../Task/Collections/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Combinations b/Lang/Ursala/Combinations new file mode 120000 index 0000000000..4352837874 --- /dev/null +++ b/Lang/Ursala/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Combinations-with-repetitions b/Lang/Ursala/Combinations-with-repetitions new file mode 120000 index 0000000000..e2b8ac7811 --- /dev/null +++ b/Lang/Ursala/Combinations-with-repetitions @@ -0,0 +1 @@ +../../Task/Combinations-with-repetitions/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Command-line-arguments b/Lang/Ursala/Command-line-arguments new file mode 120000 index 0000000000..0721725d42 --- /dev/null +++ b/Lang/Ursala/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Comments b/Lang/Ursala/Comments new file mode 120000 index 0000000000..5fbd7a75cb --- /dev/null +++ b/Lang/Ursala/Comments @@ -0,0 +1 @@ +../../Task/Comments/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Compile-time-calculation b/Lang/Ursala/Compile-time-calculation new file mode 120000 index 0000000000..5c93b58ff6 --- /dev/null +++ b/Lang/Ursala/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Compound-data-type b/Lang/Ursala/Compound-data-type new file mode 120000 index 0000000000..af7184f9d6 --- /dev/null +++ b/Lang/Ursala/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Conways-Game-of-Life b/Lang/Ursala/Conways-Game-of-Life new file mode 120000 index 0000000000..81be453335 --- /dev/null +++ b/Lang/Ursala/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Date-format b/Lang/Ursala/Date-format new file mode 120000 index 0000000000..dbbbf2cf50 --- /dev/null +++ b/Lang/Ursala/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Day-of-the-week b/Lang/Ursala/Day-of-the-week new file mode 120000 index 0000000000..7fad9b97bf --- /dev/null +++ b/Lang/Ursala/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Deconvolution-1D b/Lang/Ursala/Deconvolution-1D new file mode 120000 index 0000000000..cbe913924e --- /dev/null +++ b/Lang/Ursala/Deconvolution-1D @@ -0,0 +1 @@ +../../Task/Deconvolution-1D/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Deconvolution-2D+ b/Lang/Ursala/Deconvolution-2D+ new file mode 120000 index 0000000000..1dbc7f6204 --- /dev/null +++ b/Lang/Ursala/Deconvolution-2D+ @@ -0,0 +1 @@ +../../Task/Deconvolution-2D+/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Define-a-primitive-data-type b/Lang/Ursala/Define-a-primitive-data-type new file mode 120000 index 0000000000..03f41a423a --- /dev/null +++ b/Lang/Ursala/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Dot-product b/Lang/Ursala/Dot-product new file mode 120000 index 0000000000..6498cb90fd --- /dev/null +++ b/Lang/Ursala/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Equilibrium-index b/Lang/Ursala/Equilibrium-index new file mode 120000 index 0000000000..1bce3ce633 --- /dev/null +++ b/Lang/Ursala/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Ethiopian-multiplication b/Lang/Ursala/Ethiopian-multiplication new file mode 120000 index 0000000000..2f82a70580 --- /dev/null +++ b/Lang/Ursala/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Evaluate-binomial-coefficients b/Lang/Ursala/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..381615706f --- /dev/null +++ b/Lang/Ursala/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Evolutionary-algorithm b/Lang/Ursala/Evolutionary-algorithm new file mode 120000 index 0000000000..dbed9480b9 --- /dev/null +++ b/Lang/Ursala/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Exceptions b/Lang/Ursala/Exceptions new file mode 120000 index 0000000000..ce95460754 --- /dev/null +++ b/Lang/Ursala/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/Ursala/Exceptions-Catch-an-exception-thrown-in-a-nested-call new file mode 120000 index 0000000000..b36b9c5c55 --- /dev/null +++ b/Lang/Ursala/Exceptions-Catch-an-exception-thrown-in-a-nested-call @@ -0,0 +1 @@ +../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Execute-a-system-command b/Lang/Ursala/Execute-a-system-command new file mode 120000 index 0000000000..b925b0733b --- /dev/null +++ b/Lang/Ursala/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Extend-your-language b/Lang/Ursala/Extend-your-language new file mode 120000 index 0000000000..58f435e2a3 --- /dev/null +++ b/Lang/Ursala/Extend-your-language @@ -0,0 +1 @@ +../../Task/Extend-your-language/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Factorial b/Lang/Ursala/Factorial new file mode 120000 index 0000000000..d1fa8e10b7 --- /dev/null +++ b/Lang/Ursala/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Factors-of-an-integer b/Lang/Ursala/Factors-of-an-integer new file mode 120000 index 0000000000..1518d15899 --- /dev/null +++ b/Lang/Ursala/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Fast-Fourier-transform b/Lang/Ursala/Fast-Fourier-transform new file mode 120000 index 0000000000..0c69e02f1a --- /dev/null +++ b/Lang/Ursala/Fast-Fourier-transform @@ -0,0 +1 @@ +../../Task/Fast-Fourier-transform/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Fibonacci-sequence b/Lang/Ursala/Fibonacci-sequence new file mode 120000 index 0000000000..01a82a49e7 --- /dev/null +++ b/Lang/Ursala/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Ursala \ No newline at end of file diff --git a/Lang/Ursala/File-IO b/Lang/Ursala/File-IO new file mode 120000 index 0000000000..2b92bf6303 --- /dev/null +++ b/Lang/Ursala/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Filter b/Lang/Ursala/Filter new file mode 120000 index 0000000000..ddb379eafd --- /dev/null +++ b/Lang/Ursala/Filter @@ -0,0 +1 @@ +../../Task/Filter/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Find-common-directory-path b/Lang/Ursala/Find-common-directory-path new file mode 120000 index 0000000000..cbd13ecb7e --- /dev/null +++ b/Lang/Ursala/Find-common-directory-path @@ -0,0 +1 @@ +../../Task/Find-common-directory-path/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Find-the-missing-permutation b/Lang/Ursala/Find-the-missing-permutation new file mode 120000 index 0000000000..6519e19038 --- /dev/null +++ b/Lang/Ursala/Find-the-missing-permutation @@ -0,0 +1 @@ +../../Task/Find-the-missing-permutation/Ursala \ No newline at end of file diff --git a/Lang/Ursala/First-class-functions b/Lang/Ursala/First-class-functions new file mode 120000 index 0000000000..3d0ee98aa3 --- /dev/null +++ b/Lang/Ursala/First-class-functions @@ -0,0 +1 @@ +../../Task/First-class-functions/Ursala \ No newline at end of file diff --git a/Lang/Ursala/First-class-functions-Use-numbers-analogously b/Lang/Ursala/First-class-functions-Use-numbers-analogously new file mode 120000 index 0000000000..6c556d7c82 --- /dev/null +++ b/Lang/Ursala/First-class-functions-Use-numbers-analogously @@ -0,0 +1 @@ +../../Task/First-class-functions-Use-numbers-analogously/Ursala \ No newline at end of file diff --git a/Lang/Ursala/FizzBuzz b/Lang/Ursala/FizzBuzz new file mode 120000 index 0000000000..1e01a6a665 --- /dev/null +++ b/Lang/Ursala/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Formatted-numeric-output b/Lang/Ursala/Formatted-numeric-output new file mode 120000 index 0000000000..9317fc3a7c --- /dev/null +++ b/Lang/Ursala/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Forward-difference b/Lang/Ursala/Forward-difference new file mode 120000 index 0000000000..5a15c965a6 --- /dev/null +++ b/Lang/Ursala/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Function-composition b/Lang/Ursala/Function-composition new file mode 120000 index 0000000000..904b5bb16f --- /dev/null +++ b/Lang/Ursala/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Function-definition b/Lang/Ursala/Function-definition new file mode 120000 index 0000000000..047b91a63a --- /dev/null +++ b/Lang/Ursala/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Generic-swap b/Lang/Ursala/Generic-swap new file mode 120000 index 0000000000..516a8d7e5e --- /dev/null +++ b/Lang/Ursala/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Gray-code b/Lang/Ursala/Gray-code new file mode 120000 index 0000000000..eb6dc22665 --- /dev/null +++ b/Lang/Ursala/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Greatest-common-divisor b/Lang/Ursala/Greatest-common-divisor new file mode 120000 index 0000000000..4db2e5ccbb --- /dev/null +++ b/Lang/Ursala/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Greatest-element-of-a-list b/Lang/Ursala/Greatest-element-of-a-list new file mode 120000 index 0000000000..3e3b260ada --- /dev/null +++ b/Lang/Ursala/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Greatest-subsequential-sum b/Lang/Ursala/Greatest-subsequential-sum new file mode 120000 index 0000000000..03cba249d5 --- /dev/null +++ b/Lang/Ursala/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Hailstone-sequence b/Lang/Ursala/Hailstone-sequence new file mode 120000 index 0000000000..c3b9fe2cf5 --- /dev/null +++ b/Lang/Ursala/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Hamming-numbers b/Lang/Ursala/Hamming-numbers new file mode 120000 index 0000000000..8cc40813bf --- /dev/null +++ b/Lang/Ursala/Hamming-numbers @@ -0,0 +1 @@ +../../Task/Hamming-numbers/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Happy-numbers b/Lang/Ursala/Happy-numbers new file mode 120000 index 0000000000..c90c7345cd --- /dev/null +++ b/Lang/Ursala/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Hash-from-two-arrays b/Lang/Ursala/Hash-from-two-arrays new file mode 120000 index 0000000000..5892ca71aa --- /dev/null +++ b/Lang/Ursala/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Hello-world-Text b/Lang/Ursala/Hello-world-Text new file mode 120000 index 0000000000..331e8f0f91 --- /dev/null +++ b/Lang/Ursala/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Here-document b/Lang/Ursala/Here-document new file mode 120000 index 0000000000..00b5407f3a --- /dev/null +++ b/Lang/Ursala/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Higher-order-functions b/Lang/Ursala/Higher-order-functions new file mode 120000 index 0000000000..c09892cc25 --- /dev/null +++ b/Lang/Ursala/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Hostname b/Lang/Ursala/Hostname new file mode 120000 index 0000000000..816c499dd1 --- /dev/null +++ b/Lang/Ursala/Hostname @@ -0,0 +1 @@ +../../Task/Hostname/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Huffman-coding b/Lang/Ursala/Huffman-coding new file mode 120000 index 0000000000..614ac8503b --- /dev/null +++ b/Lang/Ursala/Huffman-coding @@ -0,0 +1 @@ +../../Task/Huffman-coding/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Increment-a-numerical-string b/Lang/Ursala/Increment-a-numerical-string new file mode 120000 index 0000000000..0a1335baaa --- /dev/null +++ b/Lang/Ursala/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Infinity b/Lang/Ursala/Infinity new file mode 120000 index 0000000000..6e16ef35a7 --- /dev/null +++ b/Lang/Ursala/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Introspection b/Lang/Ursala/Introspection new file mode 120000 index 0000000000..d54cff1444 --- /dev/null +++ b/Lang/Ursala/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Kaprekar-numbers b/Lang/Ursala/Kaprekar-numbers new file mode 120000 index 0000000000..fb5878fade --- /dev/null +++ b/Lang/Ursala/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Knapsack-problem-0-1 b/Lang/Ursala/Knapsack-problem-0-1 new file mode 120000 index 0000000000..8f52823631 --- /dev/null +++ b/Lang/Ursala/Knapsack-problem-0-1 @@ -0,0 +1 @@ +../../Task/Knapsack-problem-0-1/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Knapsack-problem-Bounded b/Lang/Ursala/Knapsack-problem-Bounded new file mode 120000 index 0000000000..1fbfb9c48c --- /dev/null +++ b/Lang/Ursala/Knapsack-problem-Bounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Bounded/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Knapsack-problem-Continuous b/Lang/Ursala/Knapsack-problem-Continuous new file mode 120000 index 0000000000..2a5861a235 --- /dev/null +++ b/Lang/Ursala/Knapsack-problem-Continuous @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Continuous/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Knapsack-problem-Unbounded b/Lang/Ursala/Knapsack-problem-Unbounded new file mode 120000 index 0000000000..60ebd069f6 --- /dev/null +++ b/Lang/Ursala/Knapsack-problem-Unbounded @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Unbounded/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Knuth-shuffle b/Lang/Ursala/Knuth-shuffle new file mode 120000 index 0000000000..bf4e9bf7e5 --- /dev/null +++ b/Lang/Ursala/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Last-letter-first-letter b/Lang/Ursala/Last-letter-first-letter new file mode 120000 index 0000000000..cab3e1a0b0 --- /dev/null +++ b/Lang/Ursala/Last-letter-first-letter @@ -0,0 +1 @@ +../../Task/Last-letter-first-letter/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Literals-Integer b/Lang/Ursala/Literals-Integer new file mode 120000 index 0000000000..6a6a0d44cd --- /dev/null +++ b/Lang/Ursala/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Literals-String b/Lang/Ursala/Literals-String new file mode 120000 index 0000000000..8bc9e2d9e8 --- /dev/null +++ b/Lang/Ursala/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Long-multiplication b/Lang/Ursala/Long-multiplication new file mode 120000 index 0000000000..abb13af0fa --- /dev/null +++ b/Lang/Ursala/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Longest-common-subsequence b/Lang/Ursala/Longest-common-subsequence new file mode 120000 index 0000000000..7b200e7406 --- /dev/null +++ b/Lang/Ursala/Longest-common-subsequence @@ -0,0 +1 @@ +../../Task/Longest-common-subsequence/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Look-and-say-sequence b/Lang/Ursala/Look-and-say-sequence new file mode 120000 index 0000000000..c97f426c99 --- /dev/null +++ b/Lang/Ursala/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Loop-over-multiple-arrays-simultaneously b/Lang/Ursala/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..571dd12d90 --- /dev/null +++ b/Lang/Ursala/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Loops-While b/Lang/Ursala/Loops-While new file mode 120000 index 0000000000..bc3336d53f --- /dev/null +++ b/Lang/Ursala/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Luhn-test-of-credit-card-numbers b/Lang/Ursala/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..d0022616a2 --- /dev/null +++ b/Lang/Ursala/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Map-range b/Lang/Ursala/Map-range new file mode 120000 index 0000000000..0030b853e0 --- /dev/null +++ b/Lang/Ursala/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Matrix-exponentiation-operator b/Lang/Ursala/Matrix-exponentiation-operator new file mode 120000 index 0000000000..304aa26170 --- /dev/null +++ b/Lang/Ursala/Matrix-exponentiation-operator @@ -0,0 +1 @@ +../../Task/Matrix-exponentiation-operator/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Matrix-multiplication b/Lang/Ursala/Matrix-multiplication new file mode 120000 index 0000000000..29d1a87967 --- /dev/null +++ b/Lang/Ursala/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Matrix-transposition b/Lang/Ursala/Matrix-transposition new file mode 120000 index 0000000000..afeffdfa78 --- /dev/null +++ b/Lang/Ursala/Matrix-transposition @@ -0,0 +1 @@ +../../Task/Matrix-transposition/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Monte-Carlo-methods b/Lang/Ursala/Monte-Carlo-methods new file mode 120000 index 0000000000..8f990b0618 --- /dev/null +++ b/Lang/Ursala/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Monty-Hall-problem b/Lang/Ursala/Monty-Hall-problem new file mode 120000 index 0000000000..dc317dbfb2 --- /dev/null +++ b/Lang/Ursala/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Multiple-regression b/Lang/Ursala/Multiple-regression new file mode 120000 index 0000000000..bc2f331af3 --- /dev/null +++ b/Lang/Ursala/Multiple-regression @@ -0,0 +1 @@ +../../Task/Multiple-regression/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Multiplication-tables b/Lang/Ursala/Multiplication-tables new file mode 120000 index 0000000000..36fe2c4b9c --- /dev/null +++ b/Lang/Ursala/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Mutual-recursion b/Lang/Ursala/Mutual-recursion new file mode 120000 index 0000000000..f425e0cac2 --- /dev/null +++ b/Lang/Ursala/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Ordered-words b/Lang/Ursala/Ordered-words new file mode 120000 index 0000000000..9ae1dc5046 --- /dev/null +++ b/Lang/Ursala/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/Ursala \ No newline at end of file diff --git a/Lang/Ursala/Search-a-list b/Lang/Ursala/Search-a-list new file mode 120000 index 0000000000..3818583249 --- /dev/null +++ b/Lang/Ursala/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Ursala \ No newline at end of file diff --git a/Lang/UserRPL/0DESCRIPTION b/Lang/UserRPL/0DESCRIPTION new file mode 100644 index 0000000000..4d3d27c049 --- /dev/null +++ b/Lang/UserRPL/0DESCRIPTION @@ -0,0 +1 @@ +{{stub}}{{language}} \ No newline at end of file diff --git a/Lang/V/0DESCRIPTION b/Lang/V/0DESCRIPTION new file mode 100644 index 0000000000..dfe845d748 --- /dev/null +++ b/Lang/V/0DESCRIPTION @@ -0,0 +1,11 @@ +{{language|V +|strength=strong +|safety=safe +|checking=dynamic +|site=http://code.google.com/p/v-language/ +|LCT=yes}} +{{language programming paradigm|concatenative}} +'''V''' is a simple, stack-based (concatenative), dynamic language. It is similar to [[Joy]] and [[PostScript]]. + +==References== +* [[wp:V_(programming_language)|Wikipedia:V]] \ No newline at end of file diff --git a/Lang/V/99-Bottles-of-Beer b/Lang/V/99-Bottles-of-Beer new file mode 120000 index 0000000000..d825090f56 --- /dev/null +++ b/Lang/V/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/V \ No newline at end of file diff --git a/Lang/V/Ackermann-function b/Lang/V/Ackermann-function new file mode 120000 index 0000000000..369e9f0cce --- /dev/null +++ b/Lang/V/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/V \ No newline at end of file diff --git a/Lang/V/Apply-a-callback-to-an-array b/Lang/V/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..b57e696392 --- /dev/null +++ b/Lang/V/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/V \ No newline at end of file diff --git a/Lang/V/Averages-Arithmetic-mean b/Lang/V/Averages-Arithmetic-mean new file mode 120000 index 0000000000..ae0fd8dabf --- /dev/null +++ b/Lang/V/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/V \ No newline at end of file diff --git a/Lang/V/Collections b/Lang/V/Collections new file mode 120000 index 0000000000..57a5769f6e --- /dev/null +++ b/Lang/V/Collections @@ -0,0 +1 @@ +../../Task/Collections/V \ No newline at end of file diff --git a/Lang/V/Combinations b/Lang/V/Combinations new file mode 120000 index 0000000000..20a7bdc321 --- /dev/null +++ b/Lang/V/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/V \ No newline at end of file diff --git a/Lang/V/Command-line-arguments b/Lang/V/Command-line-arguments new file mode 120000 index 0000000000..4234867d7c --- /dev/null +++ b/Lang/V/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/V \ No newline at end of file diff --git a/Lang/V/Conditional-structures b/Lang/V/Conditional-structures new file mode 120000 index 0000000000..a5c6afb2bf --- /dev/null +++ b/Lang/V/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/V \ No newline at end of file diff --git a/Lang/V/Exceptions b/Lang/V/Exceptions new file mode 120000 index 0000000000..db2f019b00 --- /dev/null +++ b/Lang/V/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/V \ No newline at end of file diff --git a/Lang/V/Fibonacci-sequence b/Lang/V/Fibonacci-sequence new file mode 120000 index 0000000000..b82fd565d7 --- /dev/null +++ b/Lang/V/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/V \ No newline at end of file diff --git a/Lang/V/Filter b/Lang/V/Filter new file mode 120000 index 0000000000..c404a1d0f9 --- /dev/null +++ b/Lang/V/Filter @@ -0,0 +1 @@ +../../Task/Filter/V \ No newline at end of file diff --git a/Lang/V/FizzBuzz b/Lang/V/FizzBuzz new file mode 120000 index 0000000000..b156f83b1b --- /dev/null +++ b/Lang/V/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/V \ No newline at end of file diff --git a/Lang/V/Function-definition b/Lang/V/Function-definition new file mode 120000 index 0000000000..74986f0d00 --- /dev/null +++ b/Lang/V/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/V \ No newline at end of file diff --git a/Lang/V/Generic-swap b/Lang/V/Generic-swap new file mode 120000 index 0000000000..fba1077b47 --- /dev/null +++ b/Lang/V/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/V \ No newline at end of file diff --git a/Lang/V/Greatest-element-of-a-list b/Lang/V/Greatest-element-of-a-list new file mode 120000 index 0000000000..a8e5e5468b --- /dev/null +++ b/Lang/V/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/V \ No newline at end of file diff --git a/Lang/V/Hello-world-Text b/Lang/V/Hello-world-Text new file mode 120000 index 0000000000..ab6a16fcba --- /dev/null +++ b/Lang/V/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/V \ No newline at end of file diff --git a/Lang/V/Higher-order-functions b/Lang/V/Higher-order-functions new file mode 120000 index 0000000000..47887dbcea --- /dev/null +++ b/Lang/V/Higher-order-functions @@ -0,0 +1 @@ +../../Task/Higher-order-functions/V \ No newline at end of file diff --git a/Lang/V/Integer-comparison b/Lang/V/Integer-comparison new file mode 120000 index 0000000000..2e8197a2e6 --- /dev/null +++ b/Lang/V/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/V \ No newline at end of file diff --git a/Lang/V/Literals-String b/Lang/V/Literals-String new file mode 120000 index 0000000000..b9a35f8ebc --- /dev/null +++ b/Lang/V/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/V \ No newline at end of file diff --git a/Lang/V/Logical-operations b/Lang/V/Logical-operations new file mode 120000 index 0000000000..43abd63d3d --- /dev/null +++ b/Lang/V/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/V \ No newline at end of file diff --git a/Lang/V/Loops-Downward-for b/Lang/V/Loops-Downward-for new file mode 120000 index 0000000000..c520bfb204 --- /dev/null +++ b/Lang/V/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/V \ No newline at end of file diff --git a/Lang/V/Loops-Foreach b/Lang/V/Loops-Foreach new file mode 120000 index 0000000000..b840fde9ee --- /dev/null +++ b/Lang/V/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/V \ No newline at end of file diff --git a/Lang/V/Loops-Infinite b/Lang/V/Loops-Infinite new file mode 120000 index 0000000000..e5935b5899 --- /dev/null +++ b/Lang/V/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/V \ No newline at end of file diff --git a/Lang/V/Loops-N-plus-one-half b/Lang/V/Loops-N-plus-one-half new file mode 120000 index 0000000000..fe5f7b410c --- /dev/null +++ b/Lang/V/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/V \ No newline at end of file diff --git a/Lang/V/Loops-While b/Lang/V/Loops-While new file mode 120000 index 0000000000..b7bc5561b4 --- /dev/null +++ b/Lang/V/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/V \ No newline at end of file diff --git a/Lang/V/Quine b/Lang/V/Quine new file mode 120000 index 0000000000..71bfddbc56 --- /dev/null +++ b/Lang/V/Quine @@ -0,0 +1 @@ +../../Task/Quine/V \ No newline at end of file diff --git a/Lang/VB6/0DESCRIPTION b/Lang/VB6/0DESCRIPTION new file mode 100644 index 0000000000..8c64d67b72 --- /dev/null +++ b/Lang/VB6/0DESCRIPTION @@ -0,0 +1,3 @@ +#REDIRECT [[:Category:Visual_Basic]] +{{db-empty}} +{{language}}{{stub}} \ No newline at end of file diff --git a/Lang/VBA/0DESCRIPTION b/Lang/VBA/0DESCRIPTION new file mode 100644 index 0000000000..27b62c64e2 --- /dev/null +++ b/Lang/VBA/0DESCRIPTION @@ -0,0 +1,13 @@ +{{language|VBA +|exec= machine +|LCT=no +}} +{{implementation|Visual Basic}} +{{Wikipedia|Visual Basic for Applications}} +'''Visual Basic for Applications''' ('''VBA''') is an implementation of Microsoft's event-driven programming language [[:Category:Visual Basic|Visual Basic]], and associated [[IDE]], which is built into most [[wp:Microsoft Office|Microsoft Office]] applications. It was included in Office applications (apart from version 2008 for [[Mac OS X]]), other Microsoft applications such as [[wp:MapPoint|MapPoint]] and [[wp:Microsoft Visio|Visio]], and at least partially implemented in some other applications such as [[wp:AutoCAD|AutoCAD]], [[wp:WordPerfect|WordPerfect]] and [[wp:ArcGIS|ArcGIS]]. It supersedes and expands on the capabilities of earlier application-specific macro programming languages such as Word's [[wp:Microsoft Word#Macros|WordBasic]], and can be used to control many aspects of the host application, including manipulating user interface features, such as menus and toolbars, and working with custom user forms or dialog boxes. + +As its name suggests, VBA is closely related to Visual Basic and uses the Visual Basic Runtime, but can normally only run code within a host application rather than as a standalone application. It can, however, be used to control one application from another using [[wp:OLE Automation|OLE Automation]]. + +VBA has some important limitations, such as restricted support for function pointers which are used as callback functions in the [[wp:Windows API|Windows API]]. It has the ability to use (but not create) (ActiveX/COM) DLLs, and later versions add support for class modules. + +As far was Rosetta Code is concerned, Visual Basic and VBA are ''mostly'' interchangeable, with minimal editing necessary to move from one to the other. \ No newline at end of file diff --git a/Lang/VBA/99-Bottles-of-Beer b/Lang/VBA/99-Bottles-of-Beer new file mode 120000 index 0000000000..c0a74a2d47 --- /dev/null +++ b/Lang/VBA/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/VBA \ No newline at end of file diff --git a/Lang/VBA/Align-columns b/Lang/VBA/Align-columns new file mode 120000 index 0000000000..54430a36dc --- /dev/null +++ b/Lang/VBA/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/VBA \ No newline at end of file diff --git a/Lang/VBA/Balanced-brackets b/Lang/VBA/Balanced-brackets new file mode 120000 index 0000000000..eb73982f25 --- /dev/null +++ b/Lang/VBA/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/VBA \ No newline at end of file diff --git a/Lang/VBA/Binary-search b/Lang/VBA/Binary-search new file mode 120000 index 0000000000..f799cd1ffb --- /dev/null +++ b/Lang/VBA/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/VBA \ No newline at end of file diff --git a/Lang/VBA/Cholesky-decomposition b/Lang/VBA/Cholesky-decomposition new file mode 120000 index 0000000000..b6b56d76fb --- /dev/null +++ b/Lang/VBA/Cholesky-decomposition @@ -0,0 +1 @@ +../../Task/Cholesky-decomposition/VBA \ No newline at end of file diff --git a/Lang/VBA/Classes b/Lang/VBA/Classes new file mode 120000 index 0000000000..ec9318b440 --- /dev/null +++ b/Lang/VBA/Classes @@ -0,0 +1 @@ +../../Task/Classes/VBA \ No newline at end of file diff --git a/Lang/VBA/Create-an-HTML-table b/Lang/VBA/Create-an-HTML-table new file mode 120000 index 0000000000..6e9f471ece --- /dev/null +++ b/Lang/VBA/Create-an-HTML-table @@ -0,0 +1 @@ +../../Task/Create-an-HTML-table/VBA \ No newline at end of file diff --git a/Lang/VBA/Empty-string b/Lang/VBA/Empty-string new file mode 120000 index 0000000000..92101cc991 --- /dev/null +++ b/Lang/VBA/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/VBA \ No newline at end of file diff --git a/Lang/VBA/Enumerations b/Lang/VBA/Enumerations new file mode 120000 index 0000000000..a5d9a7172f --- /dev/null +++ b/Lang/VBA/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/VBA \ No newline at end of file diff --git a/Lang/VBA/Fibonacci-sequence b/Lang/VBA/Fibonacci-sequence new file mode 120000 index 0000000000..fcb4ede50f --- /dev/null +++ b/Lang/VBA/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/VBA \ No newline at end of file diff --git a/Lang/VBA/Greatest-common-divisor b/Lang/VBA/Greatest-common-divisor new file mode 120000 index 0000000000..87f2ead781 --- /dev/null +++ b/Lang/VBA/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/VBA \ No newline at end of file diff --git a/Lang/VBA/Horners-rule-for-polynomial-evaluation b/Lang/VBA/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..8e7622f97e --- /dev/null +++ b/Lang/VBA/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/VBA \ No newline at end of file diff --git a/Lang/VBA/Increment-a-numerical-string b/Lang/VBA/Increment-a-numerical-string new file mode 120000 index 0000000000..397ce116e3 --- /dev/null +++ b/Lang/VBA/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/VBA \ No newline at end of file diff --git a/Lang/VBA/Letter-frequency b/Lang/VBA/Letter-frequency new file mode 120000 index 0000000000..8ccf1587ff --- /dev/null +++ b/Lang/VBA/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/VBA \ No newline at end of file diff --git a/Lang/VBA/Look-and-say-sequence b/Lang/VBA/Look-and-say-sequence new file mode 120000 index 0000000000..b3336c2bd4 --- /dev/null +++ b/Lang/VBA/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/VBA \ No newline at end of file diff --git a/Lang/VBA/Ordered-words b/Lang/VBA/Ordered-words new file mode 120000 index 0000000000..4f563f63a2 --- /dev/null +++ b/Lang/VBA/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/VBA \ No newline at end of file diff --git a/Lang/VBScript/0DESCRIPTION b/Lang/VBScript/0DESCRIPTION new file mode 100644 index 0000000000..bbd376f7d3 --- /dev/null +++ b/Lang/VBScript/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language|VBScript +|exec=interpreted +|LCT=no +|site=http://msdn.microsoft.com/en-us/library/t0aew7h6.aspx +}} +VBScript is a programming language from [[Microsoft]] for [[Windows]] and [[wp:Active Server Pages|Active Server Pages]] (and web page scripting on the Internet, to a much lesser degree). VBScript is similar to [[Visual Basic]], and was originally based on VB, but there are many differences between the two. In general, VBScript is not able to run most non-trivial VB programs without significant changes, while ''most'' VBScript programs can be run in VB with trivial changes. +{{stub}} \ No newline at end of file diff --git a/Lang/VBScript/100-doors b/Lang/VBScript/100-doors new file mode 120000 index 0000000000..6e4af83d8e --- /dev/null +++ b/Lang/VBScript/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/VBScript \ No newline at end of file diff --git a/Lang/VBScript/99-Bottles-of-Beer b/Lang/VBScript/99-Bottles-of-Beer new file mode 120000 index 0000000000..ecb0b93135 --- /dev/null +++ b/Lang/VBScript/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/VBScript \ No newline at end of file diff --git a/Lang/VBScript/A+B b/Lang/VBScript/A+B new file mode 120000 index 0000000000..5227a03ca5 --- /dev/null +++ b/Lang/VBScript/A+B @@ -0,0 +1 @@ +../../Task/A+B/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Accumulator-factory b/Lang/VBScript/Accumulator-factory new file mode 120000 index 0000000000..31ba635c0f --- /dev/null +++ b/Lang/VBScript/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Ackermann-function b/Lang/VBScript/Ackermann-function new file mode 120000 index 0000000000..ec96f63d05 --- /dev/null +++ b/Lang/VBScript/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Active-Directory-Connect b/Lang/VBScript/Active-Directory-Connect new file mode 120000 index 0000000000..ae1f650f95 --- /dev/null +++ b/Lang/VBScript/Active-Directory-Connect @@ -0,0 +1 @@ +../../Task/Active-Directory-Connect/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Active-Directory-Search-for-a-user b/Lang/VBScript/Active-Directory-Search-for-a-user new file mode 120000 index 0000000000..5fa41cc857 --- /dev/null +++ b/Lang/VBScript/Active-Directory-Search-for-a-user @@ -0,0 +1 @@ +../../Task/Active-Directory-Search-for-a-user/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Apply-a-callback-to-an-array b/Lang/VBScript/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..c72d4d48f8 --- /dev/null +++ b/Lang/VBScript/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Arithmetic-Integer b/Lang/VBScript/Arithmetic-Integer new file mode 120000 index 0000000000..b0bbf34db1 --- /dev/null +++ b/Lang/VBScript/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Array-concatenation b/Lang/VBScript/Array-concatenation new file mode 120000 index 0000000000..b954b22844 --- /dev/null +++ b/Lang/VBScript/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Assertions b/Lang/VBScript/Assertions new file mode 120000 index 0000000000..3426ed39d8 --- /dev/null +++ b/Lang/VBScript/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Check-that-file-exists b/Lang/VBScript/Check-that-file-exists new file mode 120000 index 0000000000..ca9755c1ca --- /dev/null +++ b/Lang/VBScript/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Conditional-structures b/Lang/VBScript/Conditional-structures new file mode 120000 index 0000000000..ada474cf3f --- /dev/null +++ b/Lang/VBScript/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Delete-a-file b/Lang/VBScript/Delete-a-file new file mode 120000 index 0000000000..1bed0550e5 --- /dev/null +++ b/Lang/VBScript/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Determine-if-a-string-is-numeric b/Lang/VBScript/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..69be49a669 --- /dev/null +++ b/Lang/VBScript/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Empty-program b/Lang/VBScript/Empty-program new file mode 120000 index 0000000000..cfe578494a --- /dev/null +++ b/Lang/VBScript/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Ethiopian-multiplication b/Lang/VBScript/Ethiopian-multiplication new file mode 120000 index 0000000000..4a3b40b00f --- /dev/null +++ b/Lang/VBScript/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Factorial b/Lang/VBScript/Factorial new file mode 120000 index 0000000000..28abcb466b --- /dev/null +++ b/Lang/VBScript/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Fibonacci-sequence b/Lang/VBScript/Fibonacci-sequence new file mode 120000 index 0000000000..691162aa4e --- /dev/null +++ b/Lang/VBScript/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/VBScript \ No newline at end of file diff --git a/Lang/VBScript/File-IO b/Lang/VBScript/File-IO new file mode 120000 index 0000000000..37fb43544b --- /dev/null +++ b/Lang/VBScript/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Find-limit-of-recursion b/Lang/VBScript/Find-limit-of-recursion new file mode 120000 index 0000000000..1ec2c64389 --- /dev/null +++ b/Lang/VBScript/Find-limit-of-recursion @@ -0,0 +1 @@ +../../Task/Find-limit-of-recursion/VBScript \ No newline at end of file diff --git a/Lang/VBScript/FizzBuzz b/Lang/VBScript/FizzBuzz new file mode 120000 index 0000000000..22bbfd3efa --- /dev/null +++ b/Lang/VBScript/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Flatten-a-list b/Lang/VBScript/Flatten-a-list new file mode 120000 index 0000000000..e90343de95 --- /dev/null +++ b/Lang/VBScript/Flatten-a-list @@ -0,0 +1 @@ +../../Task/Flatten-a-list/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Function-composition b/Lang/VBScript/Function-composition new file mode 120000 index 0000000000..8f94dfbbed --- /dev/null +++ b/Lang/VBScript/Function-composition @@ -0,0 +1 @@ +../../Task/Function-composition/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Function-definition b/Lang/VBScript/Function-definition new file mode 120000 index 0000000000..91981f0b59 --- /dev/null +++ b/Lang/VBScript/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Generic-swap b/Lang/VBScript/Generic-swap new file mode 120000 index 0000000000..44f453da53 --- /dev/null +++ b/Lang/VBScript/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Guess-the-number b/Lang/VBScript/Guess-the-number new file mode 120000 index 0000000000..2b9b89bc9a --- /dev/null +++ b/Lang/VBScript/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/VBScript \ No newline at end of file diff --git a/Lang/VBScript/HTTP b/Lang/VBScript/HTTP new file mode 120000 index 0000000000..acdf895946 --- /dev/null +++ b/Lang/VBScript/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/VBScript \ No newline at end of file diff --git a/Lang/VBScript/HTTPS b/Lang/VBScript/HTTPS new file mode 120000 index 0000000000..84c1707eec --- /dev/null +++ b/Lang/VBScript/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Hash-from-two-arrays b/Lang/VBScript/Hash-from-two-arrays new file mode 120000 index 0000000000..3abdd857cd --- /dev/null +++ b/Lang/VBScript/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Hello-world-Text b/Lang/VBScript/Hello-world-Text new file mode 120000 index 0000000000..430538aaf7 --- /dev/null +++ b/Lang/VBScript/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Here-document b/Lang/VBScript/Here-document new file mode 120000 index 0000000000..d37003ba7b --- /dev/null +++ b/Lang/VBScript/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Integer-comparison b/Lang/VBScript/Integer-comparison new file mode 120000 index 0000000000..24390b0195 --- /dev/null +++ b/Lang/VBScript/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Knuth-shuffle b/Lang/VBScript/Knuth-shuffle new file mode 120000 index 0000000000..782a4e8a8c --- /dev/null +++ b/Lang/VBScript/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Look-and-say-sequence b/Lang/VBScript/Look-and-say-sequence new file mode 120000 index 0000000000..99f5a75d37 --- /dev/null +++ b/Lang/VBScript/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Loops-Break b/Lang/VBScript/Loops-Break new file mode 120000 index 0000000000..d017a4c974 --- /dev/null +++ b/Lang/VBScript/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/VBScript \ No newline at end of file diff --git a/Lang/VBScript/Loops-Foreach b/Lang/VBScript/Loops-Foreach new file mode 120000 index 0000000000..93f5f336e4 --- /dev/null +++ b/Lang/VBScript/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/VBScript \ No newline at end of file diff --git a/Lang/VHDL/0DESCRIPTION b/Lang/VHDL/0DESCRIPTION new file mode 100644 index 0000000000..c38e0294b8 --- /dev/null +++ b/Lang/VHDL/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language +|site=http://www.eda.org/vhdl-200x/ +|LCT=no +}} +{{Wikipedia}} +VHDL (VHSIC hardware description language) is a hardware description language used in electronic design automation to describe digital and mixed-signal systems such as field-programmable gate arrays and integrated circuits. VHDL is commonly used to write text models that describe a logic circuit. Such a model is processed by a synthesis program only if it is part of the logic design. A simulation program is used to test the logic design using simulation models to represent the logic circuits that interface to the design. This collection of simulation models is commonly called a testbench. +{{stub}} \ No newline at end of file diff --git a/Lang/VHDL/100-doors b/Lang/VHDL/100-doors new file mode 120000 index 0000000000..be0d402dcd --- /dev/null +++ b/Lang/VHDL/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/VHDL \ No newline at end of file diff --git a/Lang/VHDL/A+B b/Lang/VHDL/A+B new file mode 120000 index 0000000000..b48abdfd41 --- /dev/null +++ b/Lang/VHDL/A+B @@ -0,0 +1 @@ +../../Task/A+B/VHDL \ No newline at end of file diff --git a/Lang/VHDL/Comments b/Lang/VHDL/Comments new file mode 120000 index 0000000000..0c92d8c9fe --- /dev/null +++ b/Lang/VHDL/Comments @@ -0,0 +1 @@ +../../Task/Comments/VHDL \ No newline at end of file diff --git a/Lang/VHDL/Empty-program b/Lang/VHDL/Empty-program new file mode 120000 index 0000000000..48f7da2da2 --- /dev/null +++ b/Lang/VHDL/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/VHDL \ No newline at end of file diff --git a/Lang/VHDL/Four-bit-adder b/Lang/VHDL/Four-bit-adder new file mode 120000 index 0000000000..bd4e1d4ada --- /dev/null +++ b/Lang/VHDL/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/VHDL \ No newline at end of file diff --git a/Lang/VHDL/Gray-code b/Lang/VHDL/Gray-code new file mode 120000 index 0000000000..63606d9ea7 --- /dev/null +++ b/Lang/VHDL/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/VHDL \ No newline at end of file diff --git a/Lang/VHDL/Hello-world-Text b/Lang/VHDL/Hello-world-Text new file mode 120000 index 0000000000..622e7a9530 --- /dev/null +++ b/Lang/VHDL/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/VHDL \ No newline at end of file diff --git a/Lang/VHDL/Quine b/Lang/VHDL/Quine new file mode 120000 index 0000000000..bac6d4a09e --- /dev/null +++ b/Lang/VHDL/Quine @@ -0,0 +1 @@ +../../Task/Quine/VHDL \ No newline at end of file diff --git a/Lang/VRML/0DESCRIPTION b/Lang/VRML/0DESCRIPTION new file mode 100644 index 0000000000..9fb11e1246 --- /dev/null +++ b/Lang/VRML/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language}} + +Virtual Reality Modeling Language is sometimes used for representing 3D interactive vector graphics. Many 3D modelling programs export data in this format, although a newer [[X3D]] replacement has now evolved. \ No newline at end of file diff --git a/Lang/Vala/0DESCRIPTION b/Lang/Vala/0DESCRIPTION new file mode 100644 index 0000000000..d1bd8ba5ac --- /dev/null +++ b/Lang/Vala/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language +|site=http://live.gnome.org/Vala +|exec=machine +|gc=no +|safety=safe +|parampass=both +|checking=static +|compat=nominative +|express=explicit +|strength=strong +|tags=vala +|LCT=no +}} +'''Vala''' is a programming language created with the goal of bringing modern language features to [[C]], with no added runtime requirements and with little overhead, by targeting the GObject object system. It is being developed by Jürg Billeter and Raffaele Sandrini. The syntax borrows heavily from [[C#]]. Rather than being compiled directly to assembler or to another intermediate language, Vala is compiled to C which is then compiled with a platform's standard C compiler. \ No newline at end of file diff --git a/Lang/Vala/100-doors b/Lang/Vala/100-doors new file mode 120000 index 0000000000..0b78fd06cd --- /dev/null +++ b/Lang/Vala/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Vala \ No newline at end of file diff --git a/Lang/Vala/A+B b/Lang/Vala/A+B new file mode 120000 index 0000000000..0c782d1953 --- /dev/null +++ b/Lang/Vala/A+B @@ -0,0 +1 @@ +../../Task/A+B/Vala \ No newline at end of file diff --git a/Lang/Vala/Array-concatenation b/Lang/Vala/Array-concatenation new file mode 120000 index 0000000000..2b6381132c --- /dev/null +++ b/Lang/Vala/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Vala \ No newline at end of file diff --git a/Lang/Vala/Arrays b/Lang/Vala/Arrays new file mode 120000 index 0000000000..785747c247 --- /dev/null +++ b/Lang/Vala/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/Vala \ No newline at end of file diff --git a/Lang/Vala/Assertions b/Lang/Vala/Assertions new file mode 120000 index 0000000000..5e10e71c1f --- /dev/null +++ b/Lang/Vala/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Vala \ No newline at end of file diff --git a/Lang/Vala/Associative-array-Creation b/Lang/Vala/Associative-array-Creation new file mode 120000 index 0000000000..ed5f6f4e25 --- /dev/null +++ b/Lang/Vala/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/Vala \ No newline at end of file diff --git a/Lang/Vala/Associative-array-Iteration b/Lang/Vala/Associative-array-Iteration new file mode 120000 index 0000000000..45dea8f759 --- /dev/null +++ b/Lang/Vala/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/Vala \ No newline at end of file diff --git a/Lang/Vala/Averages-Arithmetic-mean b/Lang/Vala/Averages-Arithmetic-mean new file mode 120000 index 0000000000..bdbbbeb188 --- /dev/null +++ b/Lang/Vala/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Vala \ No newline at end of file diff --git a/Lang/Vala/Averages-Pythagorean-means b/Lang/Vala/Averages-Pythagorean-means new file mode 120000 index 0000000000..1a46756e7d --- /dev/null +++ b/Lang/Vala/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/Vala \ No newline at end of file diff --git a/Lang/Vala/Averages-Root-mean-square b/Lang/Vala/Averages-Root-mean-square new file mode 120000 index 0000000000..fff15b79b9 --- /dev/null +++ b/Lang/Vala/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/Vala \ No newline at end of file diff --git a/Lang/Vala/Fibonacci-sequence b/Lang/Vala/Fibonacci-sequence new file mode 120000 index 0000000000..0380b75ca0 --- /dev/null +++ b/Lang/Vala/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Vala \ No newline at end of file diff --git a/Lang/Vala/FizzBuzz b/Lang/Vala/FizzBuzz new file mode 120000 index 0000000000..ea6cac0387 --- /dev/null +++ b/Lang/Vala/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Vala \ No newline at end of file diff --git a/Lang/Vala/Guess-the-number b/Lang/Vala/Guess-the-number new file mode 120000 index 0000000000..68c72a86f2 --- /dev/null +++ b/Lang/Vala/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/Vala \ No newline at end of file diff --git a/Lang/Vala/Guess-the-number-With-feedback b/Lang/Vala/Guess-the-number-With-feedback new file mode 120000 index 0000000000..9def6d9f73 --- /dev/null +++ b/Lang/Vala/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/Vala \ No newline at end of file diff --git a/Lang/Vala/Happy-numbers b/Lang/Vala/Happy-numbers new file mode 120000 index 0000000000..16a8d312fe --- /dev/null +++ b/Lang/Vala/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Vala \ No newline at end of file diff --git a/Lang/Vala/Hash-from-two-arrays b/Lang/Vala/Hash-from-two-arrays new file mode 120000 index 0000000000..74f95b766f --- /dev/null +++ b/Lang/Vala/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Vala \ No newline at end of file diff --git a/Lang/Vala/Hello-world-Text b/Lang/Vala/Hello-world-Text new file mode 120000 index 0000000000..233b90de70 --- /dev/null +++ b/Lang/Vala/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Vala \ No newline at end of file diff --git a/Lang/Vala/Include-a-file b/Lang/Vala/Include-a-file new file mode 120000 index 0000000000..262d52eefc --- /dev/null +++ b/Lang/Vala/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/Vala \ No newline at end of file diff --git a/Lang/Vala/Input-loop b/Lang/Vala/Input-loop new file mode 120000 index 0000000000..cece3dbce8 --- /dev/null +++ b/Lang/Vala/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Vala \ No newline at end of file diff --git a/Lang/Vala/Integer-comparison b/Lang/Vala/Integer-comparison new file mode 120000 index 0000000000..43d76fadad --- /dev/null +++ b/Lang/Vala/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Vala \ No newline at end of file diff --git a/Lang/Vala/Integer-sequence b/Lang/Vala/Integer-sequence new file mode 120000 index 0000000000..32a3ea8009 --- /dev/null +++ b/Lang/Vala/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Vala \ No newline at end of file diff --git a/Lang/Vala/Least-common-multiple b/Lang/Vala/Least-common-multiple new file mode 120000 index 0000000000..653644be2d --- /dev/null +++ b/Lang/Vala/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/Vala \ No newline at end of file diff --git a/Lang/Vala/Letter-frequency b/Lang/Vala/Letter-frequency new file mode 120000 index 0000000000..7eb195125e --- /dev/null +++ b/Lang/Vala/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Vala \ No newline at end of file diff --git a/Lang/Vala/Loops-Infinite b/Lang/Vala/Loops-Infinite new file mode 120000 index 0000000000..efdd803278 --- /dev/null +++ b/Lang/Vala/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Vala \ No newline at end of file diff --git a/Lang/Vedit-macro-language/0DESCRIPTION b/Lang/Vedit-macro-language/0DESCRIPTION new file mode 100644 index 0000000000..23aba00748 --- /dev/null +++ b/Lang/Vedit-macro-language/0DESCRIPTION @@ -0,0 +1,28 @@ +{{language|Vedit macro language +|exec=interpreted +|site=http://www.vedit.com/ +|tags=vedit +|LCT=no +}} +'''Vedit''' is a commercial text editor for [[Windows]] and MS-DOS operating systems. + +Vedit was one of the first full screen editors in the market. It was first published in 1980 for CP/M operating system. +Versions for CP/M-86, OS/2, Unix and QNX were later published, but those are not available any more. +Vedit is fast and compact (it is mostly written in Assembly language). +Its notable feature is the ability to edit any file, including EBCDIC, database and binary files and huge multi-gigabyte files. + +Vedit has a [[C]]-like '''macro language'''. Unlike external scripting languages used by some editors, the macro language has full access to all functions and internals of the editor. Anything you can do with the editor can be done with macro language, too. + +The keywords in Vedit macro language usually have both long and short form. +For example the command Reg_Copy_Block can be shortened to RCB. +For readability, long keywords are preferred in the Rosetta Code examples. + +== Rosetta Code examples == +Most examples are full "applications" ready to run in Vedit. +To run an example, save the code in a file and run it with Misc ⇒ Load/Exec User macro. +Or alternatively, copy it to text register 100 and run it with Misc ⇒ Execute macro. + +Note that some examples output to current edit buffer, so you should not run the examples while you have an important documents open. + +==Citations== +* [[wp:Vedit|Wikipedia: Vedit]] \ No newline at end of file diff --git a/Lang/Vedit-macro-language/100-doors b/Lang/Vedit-macro-language/100-doors new file mode 120000 index 0000000000..13b37e2bc3 --- /dev/null +++ b/Lang/Vedit-macro-language/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Align-columns b/Lang/Vedit-macro-language/Align-columns new file mode 120000 index 0000000000..12b7c7227e --- /dev/null +++ b/Lang/Vedit-macro-language/Align-columns @@ -0,0 +1 @@ +../../Task/Align-columns/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Anagrams b/Lang/Vedit-macro-language/Anagrams new file mode 120000 index 0000000000..904eb5c8e9 --- /dev/null +++ b/Lang/Vedit-macro-language/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Arithmetic-Integer b/Lang/Vedit-macro-language/Arithmetic-Integer new file mode 120000 index 0000000000..4818782965 --- /dev/null +++ b/Lang/Vedit-macro-language/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Averages-Arithmetic-mean b/Lang/Vedit-macro-language/Averages-Arithmetic-mean new file mode 120000 index 0000000000..97a7b624ab --- /dev/null +++ b/Lang/Vedit-macro-language/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Averages-Median b/Lang/Vedit-macro-language/Averages-Median new file mode 120000 index 0000000000..77fed0f0da --- /dev/null +++ b/Lang/Vedit-macro-language/Averages-Median @@ -0,0 +1 @@ +../../Task/Averages-Median/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Averages-Mode b/Lang/Vedit-macro-language/Averages-Mode new file mode 120000 index 0000000000..ae2bf99bc6 --- /dev/null +++ b/Lang/Vedit-macro-language/Averages-Mode @@ -0,0 +1 @@ +../../Task/Averages-Mode/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Binary-search b/Lang/Vedit-macro-language/Binary-search new file mode 120000 index 0000000000..7b31fc7397 --- /dev/null +++ b/Lang/Vedit-macro-language/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Bitmap b/Lang/Vedit-macro-language/Bitmap new file mode 120000 index 0000000000..86a15aa313 --- /dev/null +++ b/Lang/Vedit-macro-language/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Bitmap-B-zier-curves-Quadratic b/Lang/Vedit-macro-language/Bitmap-B-zier-curves-Quadratic new file mode 120000 index 0000000000..71f483927c --- /dev/null +++ b/Lang/Vedit-macro-language/Bitmap-B-zier-curves-Quadratic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Quadratic/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Bitmap-Bresenhams-line-algorithm b/Lang/Vedit-macro-language/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..dd04d144d7 --- /dev/null +++ b/Lang/Vedit-macro-language/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Bitmap-Histogram b/Lang/Vedit-macro-language/Bitmap-Histogram new file mode 120000 index 0000000000..49a3293693 --- /dev/null +++ b/Lang/Vedit-macro-language/Bitmap-Histogram @@ -0,0 +1 @@ +../../Task/Bitmap-Histogram/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Bitmap-Midpoint-circle-algorithm b/Lang/Vedit-macro-language/Bitmap-Midpoint-circle-algorithm new file mode 120000 index 0000000000..002626f5a5 --- /dev/null +++ b/Lang/Vedit-macro-language/Bitmap-Midpoint-circle-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Midpoint-circle-algorithm/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Bitmap-Read-a-PPM-file b/Lang/Vedit-macro-language/Bitmap-Read-a-PPM-file new file mode 120000 index 0000000000..65c2b4ba64 --- /dev/null +++ b/Lang/Vedit-macro-language/Bitmap-Read-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Read-a-PPM-file/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Bulls-and-cows b/Lang/Vedit-macro-language/Bulls-and-cows new file mode 120000 index 0000000000..91ed777099 --- /dev/null +++ b/Lang/Vedit-macro-language/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/CSV-to-HTML-translation b/Lang/Vedit-macro-language/CSV-to-HTML-translation new file mode 120000 index 0000000000..ecb6385a8f --- /dev/null +++ b/Lang/Vedit-macro-language/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Caesar-cipher b/Lang/Vedit-macro-language/Caesar-cipher new file mode 120000 index 0000000000..a1f72150b4 --- /dev/null +++ b/Lang/Vedit-macro-language/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Calendar b/Lang/Vedit-macro-language/Calendar new file mode 120000 index 0000000000..22746bc652 --- /dev/null +++ b/Lang/Vedit-macro-language/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Calendar-for-real-programmers b/Lang/Vedit-macro-language/Calendar-for-real-programmers new file mode 120000 index 0000000000..2ae35a116f --- /dev/null +++ b/Lang/Vedit-macro-language/Calendar-for-real-programmers @@ -0,0 +1 @@ +../../Task/Calendar-for-real-programmers/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Check-that-file-exists b/Lang/Vedit-macro-language/Check-that-file-exists new file mode 120000 index 0000000000..688cd2c271 --- /dev/null +++ b/Lang/Vedit-macro-language/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Conways-Game-of-Life b/Lang/Vedit-macro-language/Conways-Game-of-Life new file mode 120000 index 0000000000..d5f84e714b --- /dev/null +++ b/Lang/Vedit-macro-language/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Create-a-file b/Lang/Vedit-macro-language/Create-a-file new file mode 120000 index 0000000000..eaa1c59887 --- /dev/null +++ b/Lang/Vedit-macro-language/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Date-format b/Lang/Vedit-macro-language/Date-format new file mode 120000 index 0000000000..4d68ab4793 --- /dev/null +++ b/Lang/Vedit-macro-language/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Day-of-the-week b/Lang/Vedit-macro-language/Day-of-the-week new file mode 120000 index 0000000000..a31cb94a85 --- /dev/null +++ b/Lang/Vedit-macro-language/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Delete-a-file b/Lang/Vedit-macro-language/Delete-a-file new file mode 120000 index 0000000000..5cfcd00d34 --- /dev/null +++ b/Lang/Vedit-macro-language/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Determine-if-a-string-is-numeric b/Lang/Vedit-macro-language/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..5783f43424 --- /dev/null +++ b/Lang/Vedit-macro-language/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Execute-a-system-command b/Lang/Vedit-macro-language/Execute-a-system-command new file mode 120000 index 0000000000..b494baeceb --- /dev/null +++ b/Lang/Vedit-macro-language/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Fibonacci-sequence b/Lang/Vedit-macro-language/Fibonacci-sequence new file mode 120000 index 0000000000..8fccd5fb19 --- /dev/null +++ b/Lang/Vedit-macro-language/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/File-IO b/Lang/Vedit-macro-language/File-IO new file mode 120000 index 0000000000..f0d25b682f --- /dev/null +++ b/Lang/Vedit-macro-language/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/File-modification-time b/Lang/Vedit-macro-language/File-modification-time new file mode 120000 index 0000000000..870692b183 --- /dev/null +++ b/Lang/Vedit-macro-language/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/File-size b/Lang/Vedit-macro-language/File-size new file mode 120000 index 0000000000..46f45c1c2d --- /dev/null +++ b/Lang/Vedit-macro-language/File-size @@ -0,0 +1 @@ +../../Task/File-size/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Formatted-numeric-output b/Lang/Vedit-macro-language/Formatted-numeric-output new file mode 120000 index 0000000000..beec12ad2c --- /dev/null +++ b/Lang/Vedit-macro-language/Formatted-numeric-output @@ -0,0 +1 @@ +../../Task/Formatted-numeric-output/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Globally-replace-text-in-several-files b/Lang/Vedit-macro-language/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..01094a681f --- /dev/null +++ b/Lang/Vedit-macro-language/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Grayscale-image b/Lang/Vedit-macro-language/Grayscale-image new file mode 120000 index 0000000000..13325f5cf2 --- /dev/null +++ b/Lang/Vedit-macro-language/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Hello-world-Graphical b/Lang/Vedit-macro-language/Hello-world-Graphical new file mode 120000 index 0000000000..cb66a7013d --- /dev/null +++ b/Lang/Vedit-macro-language/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Hello-world-Text b/Lang/Vedit-macro-language/Hello-world-Text new file mode 120000 index 0000000000..40f41c7235 --- /dev/null +++ b/Lang/Vedit-macro-language/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Increment-a-numerical-string b/Lang/Vedit-macro-language/Increment-a-numerical-string new file mode 120000 index 0000000000..4fe1d1e573 --- /dev/null +++ b/Lang/Vedit-macro-language/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Interactive-programming b/Lang/Vedit-macro-language/Interactive-programming new file mode 120000 index 0000000000..09b8be5e07 --- /dev/null +++ b/Lang/Vedit-macro-language/Interactive-programming @@ -0,0 +1 @@ +../../Task/Interactive-programming/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Josephus-problem b/Lang/Vedit-macro-language/Josephus-problem new file mode 120000 index 0000000000..69ee2ee4c1 --- /dev/null +++ b/Lang/Vedit-macro-language/Josephus-problem @@ -0,0 +1 @@ +../../Task/Josephus-problem/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Keyboard-input-Flush-the-keyboard-buffer b/Lang/Vedit-macro-language/Keyboard-input-Flush-the-keyboard-buffer new file mode 120000 index 0000000000..8349cace02 --- /dev/null +++ b/Lang/Vedit-macro-language/Keyboard-input-Flush-the-keyboard-buffer @@ -0,0 +1 @@ +../../Task/Keyboard-input-Flush-the-keyboard-buffer/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Vedit-macro-language/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..3d821403c4 --- /dev/null +++ b/Lang/Vedit-macro-language/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Keyboard-macros b/Lang/Vedit-macro-language/Keyboard-macros new file mode 120000 index 0000000000..9272dbd033 --- /dev/null +++ b/Lang/Vedit-macro-language/Keyboard-macros @@ -0,0 +1 @@ +../../Task/Keyboard-macros/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Knuth-shuffle b/Lang/Vedit-macro-language/Knuth-shuffle new file mode 120000 index 0000000000..8ad20e5237 --- /dev/null +++ b/Lang/Vedit-macro-language/Knuth-shuffle @@ -0,0 +1 @@ +../../Task/Knuth-shuffle/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Leap-year b/Lang/Vedit-macro-language/Leap-year new file mode 120000 index 0000000000..1615c2d18e --- /dev/null +++ b/Lang/Vedit-macro-language/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Letter-frequency b/Lang/Vedit-macro-language/Letter-frequency new file mode 120000 index 0000000000..ffe5cf9083 --- /dev/null +++ b/Lang/Vedit-macro-language/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Long-multiplication b/Lang/Vedit-macro-language/Long-multiplication new file mode 120000 index 0000000000..bf07b513bc --- /dev/null +++ b/Lang/Vedit-macro-language/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Look-and-say-sequence b/Lang/Vedit-macro-language/Look-and-say-sequence new file mode 120000 index 0000000000..f70a56e20c --- /dev/null +++ b/Lang/Vedit-macro-language/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-Continue b/Lang/Vedit-macro-language/Loops-Continue new file mode 120000 index 0000000000..6af7b3b0f4 --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-Do-while b/Lang/Vedit-macro-language/Loops-Do-while new file mode 120000 index 0000000000..bcae14c28f --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-Downward-for b/Lang/Vedit-macro-language/Loops-Downward-for new file mode 120000 index 0000000000..1156e947d3 --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-For b/Lang/Vedit-macro-language/Loops-For new file mode 120000 index 0000000000..09494b2b94 --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-For-with-a-specified-step b/Lang/Vedit-macro-language/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..21376b787e --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-Infinite b/Lang/Vedit-macro-language/Loops-Infinite new file mode 120000 index 0000000000..7cd774f5bd --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-N-plus-one-half b/Lang/Vedit-macro-language/Loops-N-plus-one-half new file mode 120000 index 0000000000..cb6f776204 --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Loops-While b/Lang/Vedit-macro-language/Loops-While new file mode 120000 index 0000000000..e59672d0d3 --- /dev/null +++ b/Lang/Vedit-macro-language/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Middle-three-digits b/Lang/Vedit-macro-language/Middle-three-digits new file mode 120000 index 0000000000..acc6282ad6 --- /dev/null +++ b/Lang/Vedit-macro-language/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Monty-Hall-problem b/Lang/Vedit-macro-language/Monty-Hall-problem new file mode 120000 index 0000000000..7a7137e5a5 --- /dev/null +++ b/Lang/Vedit-macro-language/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Vedit-macro-language/Ordered-words b/Lang/Vedit-macro-language/Ordered-words new file mode 120000 index 0000000000..e437dce840 --- /dev/null +++ b/Lang/Vedit-macro-language/Ordered-words @@ -0,0 +1 @@ +../../Task/Ordered-words/Vedit-macro-language \ No newline at end of file diff --git a/Lang/Verilog/0DESCRIPTION b/Lang/Verilog/0DESCRIPTION new file mode 100644 index 0000000000..0048d75f45 --- /dev/null +++ b/Lang/Verilog/0DESCRIPTION @@ -0,0 +1,7 @@ +{{language|Verilog +|LCT=no +}} +{{Wikipedia}} +In the semiconductor and electronic design industry, Verilog is a hardware description language (HDL) used to model electronic systems. Verilog HDL, not to be confused with VHDL, is most commonly used in the design, verification, and implementation of digital logic chips at the register transfer level (RTL) of abstraction. It is also used in the verification of analog and mixed-signal circuits. + +{{stub}} \ No newline at end of file diff --git a/Lang/Verilog/Comments b/Lang/Verilog/Comments new file mode 120000 index 0000000000..13230938e5 --- /dev/null +++ b/Lang/Verilog/Comments @@ -0,0 +1 @@ +../../Task/Comments/Verilog \ No newline at end of file diff --git a/Lang/Vim-Script/0DESCRIPTION b/Lang/Vim-Script/0DESCRIPTION new file mode 100644 index 0000000000..ab1fd757bc --- /dev/null +++ b/Lang/Vim-Script/0DESCRIPTION @@ -0,0 +1,10 @@ +Vim Script is the language for editing the popular [http://www.vim.org/ Vim text editor]. It is also sometimes called VimL. It is the 13th most popular language on [https://github.com/languages/VimL GitHub]. +{{unimpl_Page|Vim_Script}} + +== External Links == +* [http://www.vim.org Vim.org] - Official Site] +* [http://www.vim.org/scripts/ Vim's script repository] +* [http://vimdoc.sourceforge.net/htmldoc/usr_41.html "Write a Vim Script", intro to Vim Script in the Vim documentation] +* [http://learnvimscriptthehardway.stevelosh.com/ Learn Vimscript the Hard Way] - an online book for learning Vim Script] + +{{stub}}{{language}} \ No newline at end of file diff --git a/Lang/Vim-Script/Largest-int-from-concatenated-ints b/Lang/Vim-Script/Largest-int-from-concatenated-ints new file mode 120000 index 0000000000..6b567165f7 --- /dev/null +++ b/Lang/Vim-Script/Largest-int-from-concatenated-ints @@ -0,0 +1 @@ +../../Task/Largest-int-from-concatenated-ints/Vim-Script \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/0DESCRIPTION b/Lang/Visual-Basic-.NET/0DESCRIPTION new file mode 100644 index 0000000000..86daf78fdc --- /dev/null +++ b/Lang/Visual-Basic-.NET/0DESCRIPTION @@ -0,0 +1,18 @@ +{{language|Visual Basic .NET +|exec=bytecode +|strength=strong +|checking=static +|parampass=both +|site=http://msdn.microsoft.com/en-us/vbasic/default.aspx +|gc=yes +|LCT=yes}}[[runs on vm::common language runtime| ]]{{language programming paradigm|Object-oriented}}{{collection|Visual Studio}} +From the [http://msdn.microsoft.com/en-us/vbasic/ Visual Basic Developer Center] website: "With Visual Basic, you can create applications for Windows, the Web, mobile devices, and Office on the .NET Framework". Visual Basic .NET makes it easy to create [[Windows]] form applications quickly and efficiently. The language is [[object-oriented]] and has unique features to speed development and deployment. + +Visual Basic .NET, like C# and other .NET languages, runs on the Microsoft [[runs on vm::Common Language Runtime|Common Language Runtime]] VM. + +Not to be confused with [[:Category:Visual Basic|Visual Basic]], the original pre-.NET, implementation, which has only a passing resemblance to VB.NET. + +==See Also== +* [[wp:Visual Basic .NET|Wikipedia: Visual Basic .NET]] +* [http://msdn.microsoft.com/en-us/vbasic/ The Visual Basic Developer Center] +* [http://www.mono-project.com/VisualBasic.NET_support Mono: VisualBasic.NET support] — running VB.NET on platforms other than Windows. \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/100-doors b/Lang/Visual-Basic-.NET/100-doors new file mode 120000 index 0000000000..cffcaa9103 --- /dev/null +++ b/Lang/Visual-Basic-.NET/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/99-Bottles-of-Beer b/Lang/Visual-Basic-.NET/99-Bottles-of-Beer new file mode 120000 index 0000000000..0dbef891ac --- /dev/null +++ b/Lang/Visual-Basic-.NET/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/A+B b/Lang/Visual-Basic-.NET/A+B new file mode 120000 index 0000000000..3e835f0401 --- /dev/null +++ b/Lang/Visual-Basic-.NET/A+B @@ -0,0 +1 @@ +../../Task/A+B/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Abstract-type b/Lang/Visual-Basic-.NET/Abstract-type new file mode 120000 index 0000000000..591ec18142 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Abstract-type @@ -0,0 +1 @@ +../../Task/Abstract-type/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Active-object b/Lang/Visual-Basic-.NET/Active-object new file mode 120000 index 0000000000..7da3316cfc --- /dev/null +++ b/Lang/Visual-Basic-.NET/Active-object @@ -0,0 +1 @@ +../../Task/Active-object/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Anagrams b/Lang/Visual-Basic-.NET/Anagrams new file mode 120000 index 0000000000..24e40ecf74 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Anagrams @@ -0,0 +1 @@ +../../Task/Anagrams/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Arithmetic-Integer b/Lang/Visual-Basic-.NET/Arithmetic-Integer new file mode 120000 index 0000000000..548119c6f4 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Array-concatenation b/Lang/Visual-Basic-.NET/Array-concatenation new file mode 120000 index 0000000000..ffa5f3dc14 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Binary-search b/Lang/Visual-Basic-.NET/Binary-search new file mode 120000 index 0000000000..dc6aae8742 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Binary-search @@ -0,0 +1 @@ +../../Task/Binary-search/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Bitmap b/Lang/Visual-Basic-.NET/Bitmap new file mode 120000 index 0000000000..4ae4446103 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Bitmap-Write-a-PPM-file b/Lang/Visual-Basic-.NET/Bitmap-Write-a-PPM-file new file mode 120000 index 0000000000..65c77f99f9 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Bitmap-Write-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Write-a-PPM-file/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Bitwise-operations b/Lang/Visual-Basic-.NET/Bitwise-operations new file mode 120000 index 0000000000..5e42b7411e --- /dev/null +++ b/Lang/Visual-Basic-.NET/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Box-the-compass b/Lang/Visual-Basic-.NET/Box-the-compass new file mode 120000 index 0000000000..411bb16e8a --- /dev/null +++ b/Lang/Visual-Basic-.NET/Box-the-compass @@ -0,0 +1 @@ +../../Task/Box-the-compass/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Bulls-and-cows b/Lang/Visual-Basic-.NET/Bulls-and-cows new file mode 120000 index 0000000000..38c9825971 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Bulls-and-cows @@ -0,0 +1 @@ +../../Task/Bulls-and-cows/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Character-codes b/Lang/Visual-Basic-.NET/Character-codes new file mode 120000 index 0000000000..92a385a951 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Check-that-file-exists b/Lang/Visual-Basic-.NET/Check-that-file-exists new file mode 120000 index 0000000000..827c98c0f1 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Check-that-file-exists @@ -0,0 +1 @@ +../../Task/Check-that-file-exists/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Classes b/Lang/Visual-Basic-.NET/Classes new file mode 120000 index 0000000000..1215552e74 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Classes @@ -0,0 +1 @@ +../../Task/Classes/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Collections b/Lang/Visual-Basic-.NET/Collections new file mode 120000 index 0000000000..c73f2a178d --- /dev/null +++ b/Lang/Visual-Basic-.NET/Collections @@ -0,0 +1 @@ +../../Task/Collections/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Color-of-a-screen-pixel b/Lang/Visual-Basic-.NET/Color-of-a-screen-pixel new file mode 120000 index 0000000000..c94e3ea421 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Color-of-a-screen-pixel @@ -0,0 +1 @@ +../../Task/Color-of-a-screen-pixel/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Command-line-arguments b/Lang/Visual-Basic-.NET/Command-line-arguments new file mode 120000 index 0000000000..1286b3c4d1 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Comments b/Lang/Visual-Basic-.NET/Comments new file mode 120000 index 0000000000..f12112b81a --- /dev/null +++ b/Lang/Visual-Basic-.NET/Comments @@ -0,0 +1 @@ +../../Task/Comments/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Compound-data-type b/Lang/Visual-Basic-.NET/Compound-data-type new file mode 120000 index 0000000000..805f5c61c2 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Concurrent-computing b/Lang/Visual-Basic-.NET/Concurrent-computing new file mode 120000 index 0000000000..af842aab30 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Concurrent-computing @@ -0,0 +1 @@ +../../Task/Concurrent-computing/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Conditional-structures b/Lang/Visual-Basic-.NET/Conditional-structures new file mode 120000 index 0000000000..4eacb6e4eb --- /dev/null +++ b/Lang/Visual-Basic-.NET/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Count-in-factors b/Lang/Visual-Basic-.NET/Count-in-factors new file mode 120000 index 0000000000..70d0ca8f63 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Create-a-file b/Lang/Visual-Basic-.NET/Create-a-file new file mode 120000 index 0000000000..58370ef9e2 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Define-a-primitive-data-type b/Lang/Visual-Basic-.NET/Define-a-primitive-data-type new file mode 120000 index 0000000000..7f6be76883 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Delete-a-file b/Lang/Visual-Basic-.NET/Delete-a-file new file mode 120000 index 0000000000..0156077fcc --- /dev/null +++ b/Lang/Visual-Basic-.NET/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Determine-if-a-string-is-numeric b/Lang/Visual-Basic-.NET/Determine-if-a-string-is-numeric new file mode 120000 index 0000000000..8152818fba --- /dev/null +++ b/Lang/Visual-Basic-.NET/Determine-if-a-string-is-numeric @@ -0,0 +1 @@ +../../Task/Determine-if-a-string-is-numeric/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Dining-philosophers b/Lang/Visual-Basic-.NET/Dining-philosophers new file mode 120000 index 0000000000..535623c91f --- /dev/null +++ b/Lang/Visual-Basic-.NET/Dining-philosophers @@ -0,0 +1 @@ +../../Task/Dining-philosophers/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Doubly-linked-list-Definition b/Lang/Visual-Basic-.NET/Doubly-linked-list-Definition new file mode 120000 index 0000000000..1d9fc459a5 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Doubly-linked-list-Definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Definition/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Doubly-linked-list-Element-definition b/Lang/Visual-Basic-.NET/Doubly-linked-list-Element-definition new file mode 120000 index 0000000000..2ebea8f6e2 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Doubly-linked-list-Element-definition @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-definition/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Doubly-linked-list-Element-insertion b/Lang/Visual-Basic-.NET/Doubly-linked-list-Element-insertion new file mode 120000 index 0000000000..8caa17d1fa --- /dev/null +++ b/Lang/Visual-Basic-.NET/Doubly-linked-list-Element-insertion @@ -0,0 +1 @@ +../../Task/Doubly-linked-list-Element-insertion/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Empty-program b/Lang/Visual-Basic-.NET/Empty-program new file mode 120000 index 0000000000..ed2181827a --- /dev/null +++ b/Lang/Visual-Basic-.NET/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Enumerations b/Lang/Visual-Basic-.NET/Enumerations new file mode 120000 index 0000000000..e03c54fc26 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Exceptions b/Lang/Visual-Basic-.NET/Exceptions new file mode 120000 index 0000000000..0c03f9a997 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Fibonacci-sequence b/Lang/Visual-Basic-.NET/Fibonacci-sequence new file mode 120000 index 0000000000..2ea16324b2 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/File-IO b/Lang/Visual-Basic-.NET/File-IO new file mode 120000 index 0000000000..6fad58e731 --- /dev/null +++ b/Lang/Visual-Basic-.NET/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/File-modification-time b/Lang/Visual-Basic-.NET/File-modification-time new file mode 120000 index 0000000000..df82897418 --- /dev/null +++ b/Lang/Visual-Basic-.NET/File-modification-time @@ -0,0 +1 @@ +../../Task/File-modification-time/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/File-size b/Lang/Visual-Basic-.NET/File-size new file mode 120000 index 0000000000..8c9d20da40 --- /dev/null +++ b/Lang/Visual-Basic-.NET/File-size @@ -0,0 +1 @@ +../../Task/File-size/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/FizzBuzz b/Lang/Visual-Basic-.NET/FizzBuzz new file mode 120000 index 0000000000..ae9b27ad3f --- /dev/null +++ b/Lang/Visual-Basic-.NET/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Flow-control-structures b/Lang/Visual-Basic-.NET/Flow-control-structures new file mode 120000 index 0000000000..6011939679 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Flow-control-structures @@ -0,0 +1 @@ +../../Task/Flow-control-structures/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Forest-fire b/Lang/Visual-Basic-.NET/Forest-fire new file mode 120000 index 0000000000..e203b939b1 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Forest-fire @@ -0,0 +1 @@ +../../Task/Forest-fire/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Forward-difference b/Lang/Visual-Basic-.NET/Forward-difference new file mode 120000 index 0000000000..904ee2d063 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Forward-difference @@ -0,0 +1 @@ +../../Task/Forward-difference/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Function-definition b/Lang/Visual-Basic-.NET/Function-definition new file mode 120000 index 0000000000..220f6d0972 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Grayscale-image b/Lang/Visual-Basic-.NET/Grayscale-image new file mode 120000 index 0000000000..d319d9b760 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Grayscale-image @@ -0,0 +1 @@ +../../Task/Grayscale-image/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/HTTP b/Lang/Visual-Basic-.NET/HTTP new file mode 120000 index 0000000000..e0f7deec5d --- /dev/null +++ b/Lang/Visual-Basic-.NET/HTTP @@ -0,0 +1 @@ +../../Task/HTTP/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/HTTPS b/Lang/Visual-Basic-.NET/HTTPS new file mode 120000 index 0000000000..018d5e0dbc --- /dev/null +++ b/Lang/Visual-Basic-.NET/HTTPS @@ -0,0 +1 @@ +../../Task/HTTPS/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Hailstone-sequence b/Lang/Visual-Basic-.NET/Hailstone-sequence new file mode 120000 index 0000000000..0c2444b451 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Happy-numbers b/Lang/Visual-Basic-.NET/Happy-numbers new file mode 120000 index 0000000000..4bf40c3b53 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Hello-world-Graphical b/Lang/Visual-Basic-.NET/Hello-world-Graphical new file mode 120000 index 0000000000..a321e4abd4 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Image-noise b/Lang/Visual-Basic-.NET/Image-noise new file mode 120000 index 0000000000..881d261851 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Image-noise @@ -0,0 +1 @@ +../../Task/Image-noise/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Increment-a-numerical-string b/Lang/Visual-Basic-.NET/Increment-a-numerical-string new file mode 120000 index 0000000000..790bec6f19 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Inheritance-Single b/Lang/Visual-Basic-.NET/Inheritance-Single new file mode 120000 index 0000000000..29be60820f --- /dev/null +++ b/Lang/Visual-Basic-.NET/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Input-loop b/Lang/Visual-Basic-.NET/Input-loop new file mode 120000 index 0000000000..3a93c608d7 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Input-loop @@ -0,0 +1 @@ +../../Task/Input-loop/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Integer-comparison b/Lang/Visual-Basic-.NET/Integer-comparison new file mode 120000 index 0000000000..01c0fe20ae --- /dev/null +++ b/Lang/Visual-Basic-.NET/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Integer-sequence b/Lang/Visual-Basic-.NET/Integer-sequence new file mode 120000 index 0000000000..bab1608a68 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Levenshtein-distance b/Lang/Visual-Basic-.NET/Levenshtein-distance new file mode 120000 index 0000000000..4365f860f6 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Levenshtein-distance @@ -0,0 +1 @@ +../../Task/Levenshtein-distance/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/List-comprehensions b/Lang/Visual-Basic-.NET/List-comprehensions new file mode 120000 index 0000000000..3bfcff3afb --- /dev/null +++ b/Lang/Visual-Basic-.NET/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Literals-String b/Lang/Visual-Basic-.NET/Literals-String new file mode 120000 index 0000000000..bd9a303da8 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Logical-operations b/Lang/Visual-Basic-.NET/Logical-operations new file mode 120000 index 0000000000..083d1a550f --- /dev/null +++ b/Lang/Visual-Basic-.NET/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-Continue b/Lang/Visual-Basic-.NET/Loops-Continue new file mode 120000 index 0000000000..62ad6183ad --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-Do-while b/Lang/Visual-Basic-.NET/Loops-Do-while new file mode 120000 index 0000000000..906c4f352a --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-Downward-for b/Lang/Visual-Basic-.NET/Loops-Downward-for new file mode 120000 index 0000000000..879820337a --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-For b/Lang/Visual-Basic-.NET/Loops-For new file mode 120000 index 0000000000..7bc86b9c4f --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-Foreach b/Lang/Visual-Basic-.NET/Loops-Foreach new file mode 120000 index 0000000000..50ce52ca41 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-Infinite b/Lang/Visual-Basic-.NET/Loops-Infinite new file mode 120000 index 0000000000..76b2e843a9 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-N-plus-one-half b/Lang/Visual-Basic-.NET/Loops-N-plus-one-half new file mode 120000 index 0000000000..5fbce947ff --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Loops-While b/Lang/Visual-Basic-.NET/Loops-While new file mode 120000 index 0000000000..137d904a20 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Luhn-test-of-credit-card-numbers b/Lang/Visual-Basic-.NET/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..5c7c58071e --- /dev/null +++ b/Lang/Visual-Basic-.NET/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic-.NET/Metered-concurrency b/Lang/Visual-Basic-.NET/Metered-concurrency new file mode 120000 index 0000000000..f278e953b4 --- /dev/null +++ b/Lang/Visual-Basic-.NET/Metered-concurrency @@ -0,0 +1 @@ +../../Task/Metered-concurrency/Visual-Basic-.NET \ No newline at end of file diff --git a/Lang/Visual-Basic/0DESCRIPTION b/Lang/Visual-Basic/0DESCRIPTION new file mode 100644 index 0000000000..8c2ff0c614 --- /dev/null +++ b/Lang/Visual-Basic/0DESCRIPTION @@ -0,0 +1,24 @@ +{{language|Visual Basic +|strength=strong +|safety=safe +|compat=nominative +|checking=static +|parampass=both +|gc=yes +|LCT=yes}} +{{implementation|BASIC}}{{collection|Visual Studio}} +'''Visual Basic''' is a language developed by [[Microsoft]] to advance [[BASIC]] into the realm of [[GUI]] programming. While Microsoft ceased development of the language at version 6, a new language called [[:Category:Visual Basic .NET|Visual Basic .NET]] was developed around the [[.Net Framework]]. + +Used by Microsoft's flagship product Office, the embedded version of Visual Basic continues to be maintained. This version is known as [[:Category:VBA|Visual Basic for Applications]] and uses the same syntax as, and is mostly compatible with, Visual Basic 6. + +==Categorization== +Visual Basic can be divided into a few broad categories: VBDOS, Classic VB, and VB .Net. +*'''Visual Basic for DOS''' (or '''VBDOS''') is really part of the [[QuickBASIC]] family -- in fact, VBDOS can compile most QB programs without change, and could be considered the "missing link" between QB and "real" VB. See [[wp:Visual Basic#Timeline|this section of WP's VB page]] for a tiny bit of info. (There is a Win16 program included with VBDOS that can translate VBDOS code to VB1 code, and vice-versa. The "forms" part of VBDOS is very similar to VB1; it's ''everything else'' that needed translating.) +*'''Classic VB''' combines VB for 16-bit Windows, and pre-.Net VB for 32-bit Windows: +**'''"Early" VB''' is VB1-3. The language is essentially the same as VB4-6, but the internals are a bit different, they're 16-bit only, and they use [[wp:Visual Basic Extension|VBX]] controls instead of the later ActiveX controls. These compilers are almost certainly not in use any more, as they are for 16-bit Windows. +**'''COM VB''' is VB4-6 and [[VBA]]. They are [[:Category:Win32|Win32]] and use [[wp:Component Object Model|COM]] ([[wp:Object Linking and Embedding|OLE]], [[wp:ActiveX|ActiveX]], OCX) components (although VB4 also has a [[wp:Windows API#Versions|Win16]] version that can use VBX controls). +*'''[[:Category:Visual Basic .NET|VB.Net]]''' isn't really VB, as far as most classic VB programmers are concerned. It's got a VB-like syntax, but the differences are great enough that it's really a separate language. + +==See also== +* [http://msdn.microsoft.com/en-us/vbasic/ms788229 Microsoft's VB6 Resource Center] +* [[wp:Visual Basic|Visual Basic on Wikipedia]] \ No newline at end of file diff --git a/Lang/Visual-Basic/99-Bottles-of-Beer b/Lang/Visual-Basic/99-Bottles-of-Beer new file mode 120000 index 0000000000..de46cd0324 --- /dev/null +++ b/Lang/Visual-Basic/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Animation b/Lang/Visual-Basic/Animation new file mode 120000 index 0000000000..a52e14a80b --- /dev/null +++ b/Lang/Visual-Basic/Animation @@ -0,0 +1 @@ +../../Task/Animation/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Assertions b/Lang/Visual-Basic/Assertions new file mode 120000 index 0000000000..b8af0d5fba --- /dev/null +++ b/Lang/Visual-Basic/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Boolean-values b/Lang/Visual-Basic/Boolean-values new file mode 120000 index 0000000000..a1dbb5c025 --- /dev/null +++ b/Lang/Visual-Basic/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Command-line-arguments b/Lang/Visual-Basic/Command-line-arguments new file mode 120000 index 0000000000..87095fb152 --- /dev/null +++ b/Lang/Visual-Basic/Command-line-arguments @@ -0,0 +1 @@ +../../Task/Command-line-arguments/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Comments b/Lang/Visual-Basic/Comments new file mode 120000 index 0000000000..4100294dc3 --- /dev/null +++ b/Lang/Visual-Basic/Comments @@ -0,0 +1 @@ +../../Task/Comments/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Define-a-primitive-data-type b/Lang/Visual-Basic/Define-a-primitive-data-type new file mode 120000 index 0000000000..892dc2e9e2 --- /dev/null +++ b/Lang/Visual-Basic/Define-a-primitive-data-type @@ -0,0 +1 @@ +../../Task/Define-a-primitive-data-type/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Determine-if-only-one-instance-is-running b/Lang/Visual-Basic/Determine-if-only-one-instance-is-running new file mode 120000 index 0000000000..4101e6af05 --- /dev/null +++ b/Lang/Visual-Basic/Determine-if-only-one-instance-is-running @@ -0,0 +1 @@ +../../Task/Determine-if-only-one-instance-is-running/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Exceptions b/Lang/Visual-Basic/Exceptions new file mode 120000 index 0000000000..428d3c60f7 --- /dev/null +++ b/Lang/Visual-Basic/Exceptions @@ -0,0 +1 @@ +../../Task/Exceptions/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Execute-a-system-command b/Lang/Visual-Basic/Execute-a-system-command new file mode 120000 index 0000000000..bcac491b92 --- /dev/null +++ b/Lang/Visual-Basic/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/GUI-component-interaction b/Lang/Visual-Basic/GUI-component-interaction new file mode 120000 index 0000000000..c2dbe703be --- /dev/null +++ b/Lang/Visual-Basic/GUI-component-interaction @@ -0,0 +1 @@ +../../Task/GUI-component-interaction/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/GUI-enabling-disabling-of-controls b/Lang/Visual-Basic/GUI-enabling-disabling-of-controls new file mode 120000 index 0000000000..872abd0e53 --- /dev/null +++ b/Lang/Visual-Basic/GUI-enabling-disabling-of-controls @@ -0,0 +1 @@ +../../Task/GUI-enabling-disabling-of-controls/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Greatest-element-of-a-list b/Lang/Visual-Basic/Greatest-element-of-a-list new file mode 120000 index 0000000000..ec856e8b99 --- /dev/null +++ b/Lang/Visual-Basic/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Hash-from-two-arrays b/Lang/Visual-Basic/Hash-from-two-arrays new file mode 120000 index 0000000000..b7c149f0a4 --- /dev/null +++ b/Lang/Visual-Basic/Hash-from-two-arrays @@ -0,0 +1 @@ +../../Task/Hash-from-two-arrays/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Hello-world-Graphical b/Lang/Visual-Basic/Hello-world-Graphical new file mode 120000 index 0000000000..f1ae69d77d --- /dev/null +++ b/Lang/Visual-Basic/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Infinity b/Lang/Visual-Basic/Infinity new file mode 120000 index 0000000000..32b6532817 --- /dev/null +++ b/Lang/Visual-Basic/Infinity @@ -0,0 +1 @@ +../../Task/Infinity/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Loops-For b/Lang/Visual-Basic/Loops-For new file mode 120000 index 0000000000..4e36a09dd8 --- /dev/null +++ b/Lang/Visual-Basic/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Loops-Infinite b/Lang/Visual-Basic/Loops-Infinite new file mode 120000 index 0000000000..7987b9a93c --- /dev/null +++ b/Lang/Visual-Basic/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Basic/Mouse-position b/Lang/Visual-Basic/Mouse-position new file mode 120000 index 0000000000..804949493b --- /dev/null +++ b/Lang/Visual-Basic/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/Visual-Basic \ No newline at end of file diff --git a/Lang/Visual-Objects/0DESCRIPTION b/Lang/Visual-Objects/0DESCRIPTION new file mode 100644 index 0000000000..b96402f30a --- /dev/null +++ b/Lang/Visual-Objects/0DESCRIPTION @@ -0,0 +1,8 @@ +{{ +language|Visual Objects +|site=http://www.cavo.com/ +LST=no +}} +{{Wikipedia}} +Visual Objects is an object-oriented computer programming language that is used to create software programs that operate primarily under Windows. Although it can be used as a general-purpose programming tool, it is almost exclusively used to create database programs. +{{stub}} \ No newline at end of file diff --git a/Lang/Visual-Prolog/0DESCRIPTION b/Lang/Visual-Prolog/0DESCRIPTION new file mode 100644 index 0000000000..e81fe26b3a --- /dev/null +++ b/Lang/Visual-Prolog/0DESCRIPTION @@ -0,0 +1,20 @@ +Visual Prolog is a multi-paradigm language with origin in Prolog. + +See also +* [[wp:Visual Prolog|Visual Prolog]] in Wikipedia +* [http://www.visual-prolog.com Visual Prolog home page] +* [http://wiki.visual-prolog.com Visual Prolog wiki] + +[[Category:Programming Languages]] +[[Category:Execution method/Compiled/Machine code]] +[[Category:Garbage collection/Yes]] +[[Category:Parameter passing/By value]] +[[Category:Programming paradigm/Functional]] +[[Category:Programming paradigm/Generic]] +[[Category:Programming paradigm/Imperative]] +[[Category:Programming paradigm/Logic Programming]] +[[Category:Programming paradigm/Object-oriented]] +[[Category:Typing/Checking/Static]] +[[Category:Typing/Expression/Partially implicit]] +[[Category:Typing/Safe]] +[[Category:Typing/Strong]] \ No newline at end of file diff --git a/Lang/Visual-Prolog/Man-or-boy-test b/Lang/Visual-Prolog/Man-or-boy-test new file mode 120000 index 0000000000..e90192fd89 --- /dev/null +++ b/Lang/Visual-Prolog/Man-or-boy-test @@ -0,0 +1 @@ +../../Task/Man-or-boy-test/Visual-Prolog \ No newline at end of file diff --git a/Lang/Vorpal/0DESCRIPTION b/Lang/Vorpal/0DESCRIPTION new file mode 100644 index 0000000000..e9015d3c1e --- /dev/null +++ b/Lang/Vorpal/0DESCRIPTION @@ -0,0 +1,9 @@ +{{language|Vorpal +|exec=interpreted +|site=http://code.google.com/p/vorpalcode/ +}} + +Vorpal is a small scripting language written in C++. Its major features are as follows: +* Pervasive, prototype object system +* Small implementation in ISO C++ (< 3k lines of code) +* Concurrent, message-based programming \ No newline at end of file diff --git a/Lang/Vorpal/Apply-a-callback-to-an-array b/Lang/Vorpal/Apply-a-callback-to-an-array new file mode 120000 index 0000000000..57b819f82f --- /dev/null +++ b/Lang/Vorpal/Apply-a-callback-to-an-array @@ -0,0 +1 @@ +../../Task/Apply-a-callback-to-an-array/Vorpal \ No newline at end of file diff --git a/Lang/Vorpal/Comments b/Lang/Vorpal/Comments new file mode 120000 index 0000000000..e5d8be5b38 --- /dev/null +++ b/Lang/Vorpal/Comments @@ -0,0 +1 @@ +../../Task/Comments/Vorpal \ No newline at end of file diff --git a/Lang/Vorpal/Conditional-structures b/Lang/Vorpal/Conditional-structures new file mode 120000 index 0000000000..3a77f9d32b --- /dev/null +++ b/Lang/Vorpal/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Vorpal \ No newline at end of file diff --git a/Lang/Vorpal/Delegates b/Lang/Vorpal/Delegates new file mode 120000 index 0000000000..2b30a27d9a --- /dev/null +++ b/Lang/Vorpal/Delegates @@ -0,0 +1 @@ +../../Task/Delegates/Vorpal \ No newline at end of file diff --git a/Lang/Vorpal/Inheritance-Single b/Lang/Vorpal/Inheritance-Single new file mode 120000 index 0000000000..b09b03b76e --- /dev/null +++ b/Lang/Vorpal/Inheritance-Single @@ -0,0 +1 @@ +../../Task/Inheritance-Single/Vorpal \ No newline at end of file diff --git a/Lang/Vorpal/Loops-For-with-a-specified-step b/Lang/Vorpal/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..ca9ef63f2a --- /dev/null +++ b/Lang/Vorpal/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/Vorpal \ No newline at end of file diff --git a/Lang/Vorpal/Man-or-boy-test b/Lang/Vorpal/Man-or-boy-test new file mode 120000 index 0000000000..a81c826ba4 --- /dev/null +++ b/Lang/Vorpal/Man-or-boy-test @@ -0,0 +1 @@ +../../Task/Man-or-boy-test/Vorpal \ No newline at end of file diff --git a/Lang/Vox/0DESCRIPTION b/Lang/Vox/0DESCRIPTION new file mode 100644 index 0000000000..94c1fc3ee5 --- /dev/null +++ b/Lang/Vox/0DESCRIPTION @@ -0,0 +1,15 @@ +{{stub}} +{{language +|exec=Compiled (Bytecode) +|site=http://github.com/beelzebub/vox +|strength=weak +|checking=dynamic +|parampass=both +|gc=yes +}} +{{language programming paradigm|Object-oriented}} +{{language programming paradigm|imperative}} + +The '''Vox''' programming language is multi-purpose language, designed to be used in embedded environments, as well as for general purposes. + +Vox started out as a fork of the [[Category:Squirrel|Squirrel]] language, but has moved in a different direction ever since. While Squirrel is mostly intended to be used in embedding, Vox tries to tackle this problem by providing a larger standard library (based on [[Boost]]), extended object manipulation (borrowing many ideas from languages like [[Python]]), and an import function, that is largely borrowed from [[Lua]] (only the idea, not the code). Despite that, Vox is ''not'' compatible with Squirrel. \ No newline at end of file diff --git a/Lang/Vox/99-Bottles-of-Beer b/Lang/Vox/99-Bottles-of-Beer new file mode 120000 index 0000000000..d95745e4b1 --- /dev/null +++ b/Lang/Vox/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Vox \ No newline at end of file diff --git a/Lang/WML/0DESCRIPTION b/Lang/WML/0DESCRIPTION new file mode 100644 index 0000000000..4d9b2e4e56 --- /dev/null +++ b/Lang/WML/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language +|site=http://wiki.wesnoth.org/ReferenceWML +|tags=wml +|hopl=no +}} +''Wesnoth Markup Language'' or '''WML''' is the configuration format for its computer game, [http://www.wesnoth.org/ ''the Battle for Wesnoth'']. WML files are plain text and consist of tags; and tags can contain key-value pairs and nested tags. WML describes parts of the game, such as units (like Elvish Fighters and Orcish Grunts) that do battle, and scenarios where armies must fight. + +[http://wiki.wesnoth.org/ActionWML ActionWML] responds to events during a scenario. ActionWML qualifies WML as a scripting language. The actions include modifying units, displaying message boxes, accessing variables, using [if] and [while] control structures, and so on. + +WML also includes a few sub-languages: + +* [http://wiki.wesnoth.org/PreprocessorRef WML Preprocessor] allows macros in WML files. Macros are good for brevity, because a one-line macro might expand to a multi-line tag. Wesnoth also has many predefined macros. +* [http://wiki.wesnoth.org/FormulaAI FormulaAI] is a pure functional language. Its purpose is to customize AI of armies under computer control, but it can also do arithmetic and define functions. +* [http://wiki.wesnoth.org/LuaWML LuaWML] embeds [[:Category:Lua|Lua]] inside WML. This is also the only way to define a custom WML tag. \ No newline at end of file diff --git a/Lang/Whenever/0DESCRIPTION b/Lang/Whenever/0DESCRIPTION new file mode 100644 index 0000000000..bd632a3114 --- /dev/null +++ b/Lang/Whenever/0DESCRIPTION @@ -0,0 +1,9 @@ +{{stub}} +{{language +|site=http://www.dangermouse.net/esoteric/whenever.html +|LCT=no +|exec=interpreted +}} +Whenever is a programming language which has no sense of urgency. It does things whenever it feels like it, not in any sequence specified by the programmer. + +[[Category:Esoteric Languages]] \ No newline at end of file diff --git a/Lang/Whenever/99-Bottles-of-Beer b/Lang/Whenever/99-Bottles-of-Beer new file mode 120000 index 0000000000..7d47743918 --- /dev/null +++ b/Lang/Whenever/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Whenever \ No newline at end of file diff --git a/Lang/Whenever/Hello-world-Text b/Lang/Whenever/Hello-world-Text new file mode 120000 index 0000000000..ad1520df93 --- /dev/null +++ b/Lang/Whenever/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Whenever \ No newline at end of file diff --git a/Lang/Whitespace/0DESCRIPTION b/Lang/Whitespace/0DESCRIPTION new file mode 100644 index 0000000000..a85f14cdf9 --- /dev/null +++ b/Lang/Whitespace/0DESCRIPTION @@ -0,0 +1,8 @@ +{{language +|site=http://compsoc.dur.ac.uk/whitespace/ +|exec=interpreted +|tags=whitespace +|hopl=no +|LCT=no +}} +Whitespace is a language in which non whitespace characters are ignored; only spaces, tabs and newlines are considered syntax. \ No newline at end of file diff --git a/Lang/Whitespace/A+B b/Lang/Whitespace/A+B new file mode 120000 index 0000000000..d7b8e006a1 --- /dev/null +++ b/Lang/Whitespace/A+B @@ -0,0 +1 @@ +../../Task/A+B/Whitespace \ No newline at end of file diff --git a/Lang/Whitespace/Count-in-octal b/Lang/Whitespace/Count-in-octal new file mode 120000 index 0000000000..95d5306fb2 --- /dev/null +++ b/Lang/Whitespace/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/Whitespace \ No newline at end of file diff --git a/Lang/Whitespace/Fibonacci-sequence b/Lang/Whitespace/Fibonacci-sequence new file mode 120000 index 0000000000..da2acc5845 --- /dev/null +++ b/Lang/Whitespace/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Whitespace \ No newline at end of file diff --git a/Lang/Whitespace/FizzBuzz b/Lang/Whitespace/FizzBuzz new file mode 120000 index 0000000000..03bdfd6026 --- /dev/null +++ b/Lang/Whitespace/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Whitespace \ No newline at end of file diff --git a/Lang/Whitespace/Harshad-or-Niven-series b/Lang/Whitespace/Harshad-or-Niven-series new file mode 120000 index 0000000000..8935574cc5 --- /dev/null +++ b/Lang/Whitespace/Harshad-or-Niven-series @@ -0,0 +1 @@ +../../Task/Harshad-or-Niven-series/Whitespace \ No newline at end of file diff --git a/Lang/Whitespace/Langtons-ant b/Lang/Whitespace/Langtons-ant new file mode 120000 index 0000000000..69073e8069 --- /dev/null +++ b/Lang/Whitespace/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/Whitespace \ No newline at end of file diff --git a/Lang/Whitespace/Letter-frequency b/Lang/Whitespace/Letter-frequency new file mode 120000 index 0000000000..ace5e89845 --- /dev/null +++ b/Lang/Whitespace/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/Whitespace \ No newline at end of file diff --git a/Lang/Whitespace/Loops-While b/Lang/Whitespace/Loops-While new file mode 120000 index 0000000000..9855d3f7c0 --- /dev/null +++ b/Lang/Whitespace/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/Whitespace \ No newline at end of file diff --git a/Lang/Wrapl/0DESCRIPTION b/Lang/Wrapl/0DESCRIPTION new file mode 100644 index 0000000000..1f5ef4cd1f --- /dev/null +++ b/Lang/Wrapl/0DESCRIPTION @@ -0,0 +1,14 @@ +{{language|Wrapl +site=http://wrapl.sourceforge.net/ +|exec=interpreted +|parampass=reference +|LCT=no +}} +Wrapl is a dynamic programming language designed for various programming tasks including rapid prototyping, scripts and [[GUI]] application development. + +The key features in Wrapl include: +* [[Object-oriented]]: Every value in Wrapl is an object with a type which is known at [[run time]]. The types form a hierarchy with [[multiple inheritance]]. +* Multiple-dispatch: Method dispatch in Wrapl depends on the types and values of all of their arguments. +* Pass-by-reference: Wrapl allows variables to be passed by reference to other functions. +* Functional [[closures]]: Functions in Wrapl are first-class objects which may passed to other functions or stored in variables. Functions can both read and write variables declared in surrounding scopes. +* Goal-directed: Every expression in Wrapl can produce 0, 1, or more values. An expression which can produce more than 1 value may be resumed to produce its next value. \ No newline at end of file diff --git a/Lang/Wrapl/100-doors b/Lang/Wrapl/100-doors new file mode 120000 index 0000000000..0beee7ee47 --- /dev/null +++ b/Lang/Wrapl/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Wrapl \ No newline at end of file diff --git a/Lang/Wrapl/99-Bottles-of-Beer b/Lang/Wrapl/99-Bottles-of-Beer new file mode 120000 index 0000000000..a4f1b88b42 --- /dev/null +++ b/Lang/Wrapl/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Wrapl \ No newline at end of file diff --git a/Lang/Wrapl/Conditional-structures b/Lang/Wrapl/Conditional-structures new file mode 120000 index 0000000000..ce615cc6d1 --- /dev/null +++ b/Lang/Wrapl/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/Wrapl \ No newline at end of file diff --git a/Lang/Wrapl/Factorial b/Lang/Wrapl/Factorial new file mode 120000 index 0000000000..a757047930 --- /dev/null +++ b/Lang/Wrapl/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/Wrapl \ No newline at end of file diff --git a/Lang/Wrapl/Fibonacci-sequence b/Lang/Wrapl/Fibonacci-sequence new file mode 120000 index 0000000000..b1823e3496 --- /dev/null +++ b/Lang/Wrapl/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/Wrapl \ No newline at end of file diff --git a/Lang/Wrapl/Filter b/Lang/Wrapl/Filter new file mode 120000 index 0000000000..3a9905f171 --- /dev/null +++ b/Lang/Wrapl/Filter @@ -0,0 +1 @@ +../../Task/Filter/Wrapl \ No newline at end of file diff --git a/Lang/Wrapl/List-comprehensions b/Lang/Wrapl/List-comprehensions new file mode 120000 index 0000000000..022c3c1d7a --- /dev/null +++ b/Lang/Wrapl/List-comprehensions @@ -0,0 +1 @@ +../../Task/List-comprehensions/Wrapl \ No newline at end of file diff --git a/Lang/X10/0DESCRIPTION b/Lang/X10/0DESCRIPTION new file mode 100644 index 0000000000..785c30624b --- /dev/null +++ b/Lang/X10/0DESCRIPTION @@ -0,0 +1,5 @@ +{{stub}}{{language|X10 +|site=http://x10-lang.org/ +}} + +X10 is a programming language being developed by IBM at the Thomas J. Watson Research Center as part of the Productive, Easy-to-use, Reliable Computing System (PERCS) project funded by DARPA's High Productivity Computing Systems (HPCS) program. Its primary authors are Kemal Ebcioğlu, Vijay Saraswat, and Vivek Sarkar. \ No newline at end of file diff --git a/Lang/X86-Assembly/0DESCRIPTION b/Lang/X86-Assembly/0DESCRIPTION new file mode 100644 index 0000000000..c9b9f3b5fe --- /dev/null +++ b/Lang/X86-Assembly/0DESCRIPTION @@ -0,0 +1,3 @@ +{{stub}}{{language}}{{assembler language}} + +[[Category:Assembly]] \ No newline at end of file diff --git a/Lang/X86-Assembly/99-Bottles-of-Beer b/Lang/X86-Assembly/99-Bottles-of-Beer new file mode 120000 index 0000000000..41d51d1a5f --- /dev/null +++ b/Lang/X86-Assembly/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/A+B b/Lang/X86-Assembly/A+B new file mode 120000 index 0000000000..91fe403079 --- /dev/null +++ b/Lang/X86-Assembly/A+B @@ -0,0 +1 @@ +../../Task/A+B/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Arrays b/Lang/X86-Assembly/Arrays new file mode 120000 index 0000000000..649e36c0d3 --- /dev/null +++ b/Lang/X86-Assembly/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Calendar-for-real-programmers b/Lang/X86-Assembly/Calendar-for-real-programmers new file mode 120000 index 0000000000..7898a19dd9 --- /dev/null +++ b/Lang/X86-Assembly/Calendar-for-real-programmers @@ -0,0 +1 @@ +../../Task/Calendar-for-real-programmers/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Conditional-structures b/Lang/X86-Assembly/Conditional-structures new file mode 120000 index 0000000000..1bc3965485 --- /dev/null +++ b/Lang/X86-Assembly/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Create-a-file b/Lang/X86-Assembly/Create-a-file new file mode 120000 index 0000000000..5ed870af9e --- /dev/null +++ b/Lang/X86-Assembly/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Delete-a-file b/Lang/X86-Assembly/Delete-a-file new file mode 120000 index 0000000000..19dfb2fb8a --- /dev/null +++ b/Lang/X86-Assembly/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Empty-program b/Lang/X86-Assembly/Empty-program new file mode 120000 index 0000000000..599f18da4b --- /dev/null +++ b/Lang/X86-Assembly/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Fork b/Lang/X86-Assembly/Fork new file mode 120000 index 0000000000..1fcc852c4f --- /dev/null +++ b/Lang/X86-Assembly/Fork @@ -0,0 +1 @@ +../../Task/Fork/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Function-definition b/Lang/X86-Assembly/Function-definition new file mode 120000 index 0000000000..47d88bdae9 --- /dev/null +++ b/Lang/X86-Assembly/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Handle-a-signal b/Lang/X86-Assembly/Handle-a-signal new file mode 120000 index 0000000000..d880bfedd3 --- /dev/null +++ b/Lang/X86-Assembly/Handle-a-signal @@ -0,0 +1 @@ +../../Task/Handle-a-signal/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Haversine-formula b/Lang/X86-Assembly/Haversine-formula new file mode 120000 index 0000000000..ac1fb4d572 --- /dev/null +++ b/Lang/X86-Assembly/Haversine-formula @@ -0,0 +1 @@ +../../Task/Haversine-formula/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Hello-world-Graphical b/Lang/X86-Assembly/Hello-world-Graphical new file mode 120000 index 0000000000..38ab3a2a92 --- /dev/null +++ b/Lang/X86-Assembly/Hello-world-Graphical @@ -0,0 +1 @@ +../../Task/Hello-world-Graphical/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Hello-world-Standard-error b/Lang/X86-Assembly/Hello-world-Standard-error new file mode 120000 index 0000000000..ab2783056e --- /dev/null +++ b/Lang/X86-Assembly/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Hello-world-Text b/Lang/X86-Assembly/Hello-world-Text new file mode 120000 index 0000000000..5994aa4f9f --- /dev/null +++ b/Lang/X86-Assembly/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Loops-Infinite b/Lang/X86-Assembly/Loops-Infinite new file mode 120000 index 0000000000..201d565a67 --- /dev/null +++ b/Lang/X86-Assembly/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/X86-Assembly \ No newline at end of file diff --git a/Lang/X86-Assembly/Main-step-of-GOST-28147-89 b/Lang/X86-Assembly/Main-step-of-GOST-28147-89 new file mode 120000 index 0000000000..bdf24138ea --- /dev/null +++ b/Lang/X86-Assembly/Main-step-of-GOST-28147-89 @@ -0,0 +1 @@ +../../Task/Main-step-of-GOST-28147-89/X86-Assembly \ No newline at end of file diff --git a/Lang/XBase/0DESCRIPTION b/Lang/XBase/0DESCRIPTION new file mode 100644 index 0000000000..1f1facf0a9 --- /dev/null +++ b/Lang/XBase/0DESCRIPTION @@ -0,0 +1,23 @@ +{{stub}}{{language|XBase +|LCT=no +}} +{{Wikipedia}} +XBase is the generic term for all programming languages that derive from the original dBASE (Ashton-Tate) programming language and database formats. These are sometimes informally known as dBASE "clones". While there was a non-commercial predecessor to the Ashton-Tate product (Vulcan written by Wayne Ratliff), most clones are based on Ashton-Tate's 1986 dBASE III+ release — scripts written in the dBASE III+ dialect are most likely to run on all the clones. + +== Implementations == +* [http://www.vistasoftware.com/ Apollo database engine] for managing CA-Clipper and FoxPro from Vista Software +* Clipper, Visual Objects (Windows 32) and Vulcan.NET from [http://www.grafxsoft.com/ GrafxSoft] +* [http://dbase.com/ dBase Inc]'s dBASE +* [http://www.dbfview.com/ DBFView], DBF editor/viewer/converter +* FlagShip from [http://www.fship.com/ multisoft GmbH] +* Recital from [http://www.recital.com/ Recital Corp.] +* [http://msdn.microsoft.com/en-au/vfoxpro/default.aspx Visual FoxPro] is available from Microsoft +* [http://www.govulcan.net/portal/ Vulcan.NET] +* XBase++ from [http://www.alaska-software.com/products/xpp/xpp.shtm Alaska Software] +* xHarbour Builder from [http://www.xharbour.com/ xHarbour.com Inc.] +* [http://www.dbf2002.com/ DBF Viewer 2000] +* DBF tools from [http://astersoft.com/ Astersoft Co. Ltd.] +* [http://www.itk.ru/english/index.shtml CLIP] +* the [http://www.harbour-project.org/ Harbour Project] +* [http://www.xharbour.org/ xHarbour] +* [http://www.xailer.com Xailer] \ No newline at end of file diff --git a/Lang/XL/0DESCRIPTION b/Lang/XL/0DESCRIPTION new file mode 100644 index 0000000000..569147b871 --- /dev/null +++ b/Lang/XL/0DESCRIPTION @@ -0,0 +1,10 @@ +{{stub}}{{language|XL +|site=http://xlr.sourceforge.net/}} +XL stands for "Extensible Language". It's a programming language designed to address the challenges faced by programmers today. It addresses these challenges not by adding language features, but by making it easy and safe for any programmer to add features themselves. + +XL has no primitive types nor keywords. All useful operators and data types, like integers or addition, are defined in the standard library + +XL features programmer-reconfigurable syntax and semantics. Compiler plug-ins can be used to add new features to the language. A base set of plug-ins implements a relatively standard imperative language. Programmers can write their own plug-ins to implement application-specific notations which can then be used similarly to built-in language features. + +==See Also== +* [[wp:XL_(programming_language)|Wikipedia: XL]] \ No newline at end of file diff --git a/Lang/XL/Factorial b/Lang/XL/Factorial new file mode 120000 index 0000000000..11c26df2ce --- /dev/null +++ b/Lang/XL/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/XL \ No newline at end of file diff --git a/Lang/XL/Hello-world-Text b/Lang/XL/Hello-world-Text new file mode 120000 index 0000000000..c73bbe077c --- /dev/null +++ b/Lang/XL/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/XL \ No newline at end of file diff --git a/Lang/XPL0/0DESCRIPTION b/Lang/XPL0/0DESCRIPTION new file mode 100644 index 0000000000..39875b4f33 --- /dev/null +++ b/Lang/XPL0/0DESCRIPTION @@ -0,0 +1,31 @@ +{{language}} +'''XPL0''' is essentially a cross between Pascal and C. It looks somewhat like Pascal but works more like C. It was originally created in 1976 +by Peter J. R. Boyle, who designed it to run on a 6502 microprocessor as +an alternative to BASIC, which was the dominant language for personal +computers at the time. XPL0 is based on PL/0, an example compiler in the +book ''Algorithms + Data Structures = Programs'' by Niklaus Wirth. The first +XPL0 compiler was written in ALGOL, which was then used to create a compiler +written in XPL0's syntax. + +XPL0 has been implemented on more than a dozen processors, but it's +currently maintained for IBM-type PCs. Programs run under DOS and under versions of Windows that can still run DOS apps. Free, open-source versions of the +compilers (interpreted, assembly-code compiled, and optimizing) are +available from the official website: xpl0.org [http://www.xpl0.org/]. The 32-bit version of the compiler, XPLPX, was used for all these Rosetta Code tasks. + +Here's how the traditional Hello World program is coded: + +
+      code Text=12;
+      Text(0, "Hello World!")
+
+ +Text is a built-in routine, called an ''intrinsic'', that outputs a string +of characters. The zero (0) tells where to send the string. In this case +it is sent to the display screen; but it could just as easily be sent to +a printer, a file, or out a serial port by using a different number. + +All names must be declared before they can be used. The command word +''code'' associates the name Text to the built-in routine number 12, which +outputs strings. There are about 80 of these built-in routines that +provide capabilities such as input and output, graphics, and trig +functions. \ No newline at end of file diff --git a/Lang/XPL0/100-doors b/Lang/XPL0/100-doors new file mode 120000 index 0000000000..ccd450b1db --- /dev/null +++ b/Lang/XPL0/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/99-Bottles-of-Beer b/Lang/XPL0/99-Bottles-of-Beer new file mode 120000 index 0000000000..447554900b --- /dev/null +++ b/Lang/XPL0/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/A+B b/Lang/XPL0/A+B new file mode 120000 index 0000000000..a117e4f60a --- /dev/null +++ b/Lang/XPL0/A+B @@ -0,0 +1 @@ +../../Task/A+B/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Ackermann-function b/Lang/XPL0/Ackermann-function new file mode 120000 index 0000000000..b9fa43957e --- /dev/null +++ b/Lang/XPL0/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Address-of-a-variable b/Lang/XPL0/Address-of-a-variable new file mode 120000 index 0000000000..7c33fa53e3 --- /dev/null +++ b/Lang/XPL0/Address-of-a-variable @@ -0,0 +1 @@ +../../Task/Address-of-a-variable/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Animate-a-pendulum b/Lang/XPL0/Animate-a-pendulum new file mode 120000 index 0000000000..ec818697d8 --- /dev/null +++ b/Lang/XPL0/Animate-a-pendulum @@ -0,0 +1 @@ +../../Task/Animate-a-pendulum/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Animation b/Lang/XPL0/Animation new file mode 120000 index 0000000000..4737245475 --- /dev/null +++ b/Lang/XPL0/Animation @@ -0,0 +1 @@ +../../Task/Animation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Anonymous-recursion b/Lang/XPL0/Anonymous-recursion new file mode 120000 index 0000000000..be9e0ab665 --- /dev/null +++ b/Lang/XPL0/Anonymous-recursion @@ -0,0 +1 @@ +../../Task/Anonymous-recursion/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Arithmetic-Complex b/Lang/XPL0/Arithmetic-Complex new file mode 120000 index 0000000000..59ecadce20 --- /dev/null +++ b/Lang/XPL0/Arithmetic-Complex @@ -0,0 +1 @@ +../../Task/Arithmetic-Complex/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Arithmetic-Integer b/Lang/XPL0/Arithmetic-Integer new file mode 120000 index 0000000000..884f435b03 --- /dev/null +++ b/Lang/XPL0/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Arithmetic-geometric-mean b/Lang/XPL0/Arithmetic-geometric-mean new file mode 120000 index 0000000000..327bd5a296 --- /dev/null +++ b/Lang/XPL0/Arithmetic-geometric-mean @@ -0,0 +1 @@ +../../Task/Arithmetic-geometric-mean/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Arrays b/Lang/XPL0/Arrays new file mode 120000 index 0000000000..b4906b83d5 --- /dev/null +++ b/Lang/XPL0/Arrays @@ -0,0 +1 @@ +../../Task/Arrays/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Assertions b/Lang/XPL0/Assertions new file mode 120000 index 0000000000..d2baf326df --- /dev/null +++ b/Lang/XPL0/Assertions @@ -0,0 +1 @@ +../../Task/Assertions/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Associative-array-Creation b/Lang/XPL0/Associative-array-Creation new file mode 120000 index 0000000000..fbac7c3b59 --- /dev/null +++ b/Lang/XPL0/Associative-array-Creation @@ -0,0 +1 @@ +../../Task/Associative-array-Creation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Associative-array-Iteration b/Lang/XPL0/Associative-array-Iteration new file mode 120000 index 0000000000..d62cfdaa63 --- /dev/null +++ b/Lang/XPL0/Associative-array-Iteration @@ -0,0 +1 @@ +../../Task/Associative-array-Iteration/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Averages-Arithmetic-mean b/Lang/XPL0/Averages-Arithmetic-mean new file mode 120000 index 0000000000..6eb5072944 --- /dev/null +++ b/Lang/XPL0/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Averages-Mean-angle b/Lang/XPL0/Averages-Mean-angle new file mode 120000 index 0000000000..60bfa068c4 --- /dev/null +++ b/Lang/XPL0/Averages-Mean-angle @@ -0,0 +1 @@ +../../Task/Averages-Mean-angle/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Averages-Mean-time-of-day b/Lang/XPL0/Averages-Mean-time-of-day new file mode 120000 index 0000000000..a6825a79be --- /dev/null +++ b/Lang/XPL0/Averages-Mean-time-of-day @@ -0,0 +1 @@ +../../Task/Averages-Mean-time-of-day/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Averages-Pythagorean-means b/Lang/XPL0/Averages-Pythagorean-means new file mode 120000 index 0000000000..f813ac8bf0 --- /dev/null +++ b/Lang/XPL0/Averages-Pythagorean-means @@ -0,0 +1 @@ +../../Task/Averages-Pythagorean-means/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Averages-Root-mean-square b/Lang/XPL0/Averages-Root-mean-square new file mode 120000 index 0000000000..6f95836d4a --- /dev/null +++ b/Lang/XPL0/Averages-Root-mean-square @@ -0,0 +1 @@ +../../Task/Averages-Root-mean-square/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Balanced-brackets b/Lang/XPL0/Balanced-brackets new file mode 120000 index 0000000000..76c46e4c5c --- /dev/null +++ b/Lang/XPL0/Balanced-brackets @@ -0,0 +1 @@ +../../Task/Balanced-brackets/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Best-shuffle b/Lang/XPL0/Best-shuffle new file mode 120000 index 0000000000..288831ec62 --- /dev/null +++ b/Lang/XPL0/Best-shuffle @@ -0,0 +1 @@ +../../Task/Best-shuffle/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap b/Lang/XPL0/Bitmap new file mode 120000 index 0000000000..6aa44275ec --- /dev/null +++ b/Lang/XPL0/Bitmap @@ -0,0 +1 @@ +../../Task/Bitmap/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap-B-zier-curves-Cubic b/Lang/XPL0/Bitmap-B-zier-curves-Cubic new file mode 120000 index 0000000000..6046e990fd --- /dev/null +++ b/Lang/XPL0/Bitmap-B-zier-curves-Cubic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Cubic/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap-B-zier-curves-Quadratic b/Lang/XPL0/Bitmap-B-zier-curves-Quadratic new file mode 120000 index 0000000000..a533957624 --- /dev/null +++ b/Lang/XPL0/Bitmap-B-zier-curves-Quadratic @@ -0,0 +1 @@ +../../Task/Bitmap-B-zier-curves-Quadratic/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap-Bresenhams-line-algorithm b/Lang/XPL0/Bitmap-Bresenhams-line-algorithm new file mode 120000 index 0000000000..61b1b832ac --- /dev/null +++ b/Lang/XPL0/Bitmap-Bresenhams-line-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Bresenhams-line-algorithm/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap-Flood-fill b/Lang/XPL0/Bitmap-Flood-fill new file mode 120000 index 0000000000..7d57575c56 --- /dev/null +++ b/Lang/XPL0/Bitmap-Flood-fill @@ -0,0 +1 @@ +../../Task/Bitmap-Flood-fill/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap-Midpoint-circle-algorithm b/Lang/XPL0/Bitmap-Midpoint-circle-algorithm new file mode 120000 index 0000000000..c5055ce858 --- /dev/null +++ b/Lang/XPL0/Bitmap-Midpoint-circle-algorithm @@ -0,0 +1 @@ +../../Task/Bitmap-Midpoint-circle-algorithm/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap-Read-a-PPM-file b/Lang/XPL0/Bitmap-Read-a-PPM-file new file mode 120000 index 0000000000..0384a520c0 --- /dev/null +++ b/Lang/XPL0/Bitmap-Read-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Read-a-PPM-file/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitmap-Write-a-PPM-file b/Lang/XPL0/Bitmap-Write-a-PPM-file new file mode 120000 index 0000000000..f0ee895ea9 --- /dev/null +++ b/Lang/XPL0/Bitmap-Write-a-PPM-file @@ -0,0 +1 @@ +../../Task/Bitmap-Write-a-PPM-file/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Bitwise-operations b/Lang/XPL0/Bitwise-operations new file mode 120000 index 0000000000..a1b959b422 --- /dev/null +++ b/Lang/XPL0/Bitwise-operations @@ -0,0 +1 @@ +../../Task/Bitwise-operations/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/CRC-32 b/Lang/XPL0/CRC-32 new file mode 120000 index 0000000000..7433d00aee --- /dev/null +++ b/Lang/XPL0/CRC-32 @@ -0,0 +1 @@ +../../Task/CRC-32/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Caesar-cipher b/Lang/XPL0/Caesar-cipher new file mode 120000 index 0000000000..b12563e4b4 --- /dev/null +++ b/Lang/XPL0/Caesar-cipher @@ -0,0 +1 @@ +../../Task/Caesar-cipher/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Calendar b/Lang/XPL0/Calendar new file mode 120000 index 0000000000..b9690aceb2 --- /dev/null +++ b/Lang/XPL0/Calendar @@ -0,0 +1 @@ +../../Task/Calendar/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Character-codes b/Lang/XPL0/Character-codes new file mode 120000 index 0000000000..49c13bc087 --- /dev/null +++ b/Lang/XPL0/Character-codes @@ -0,0 +1 @@ +../../Task/Character-codes/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Character-matching b/Lang/XPL0/Character-matching new file mode 120000 index 0000000000..f68cd568c7 --- /dev/null +++ b/Lang/XPL0/Character-matching @@ -0,0 +1 @@ +../../Task/Character-matching/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Check-Machin-like-formulas b/Lang/XPL0/Check-Machin-like-formulas new file mode 120000 index 0000000000..b4953b297c --- /dev/null +++ b/Lang/XPL0/Check-Machin-like-formulas @@ -0,0 +1 @@ +../../Task/Check-Machin-like-formulas/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Closest-pair-problem b/Lang/XPL0/Closest-pair-problem new file mode 120000 index 0000000000..8ebfd41827 --- /dev/null +++ b/Lang/XPL0/Closest-pair-problem @@ -0,0 +1 @@ +../../Task/Closest-pair-problem/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Color-of-a-screen-pixel b/Lang/XPL0/Color-of-a-screen-pixel new file mode 120000 index 0000000000..21148e243d --- /dev/null +++ b/Lang/XPL0/Color-of-a-screen-pixel @@ -0,0 +1 @@ +../../Task/Color-of-a-screen-pixel/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Colour-bars-Display b/Lang/XPL0/Colour-bars-Display new file mode 120000 index 0000000000..834005495a --- /dev/null +++ b/Lang/XPL0/Colour-bars-Display @@ -0,0 +1 @@ +../../Task/Colour-bars-Display/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Colour-pinstripe-Display b/Lang/XPL0/Colour-pinstripe-Display new file mode 120000 index 0000000000..9e92f6afbc --- /dev/null +++ b/Lang/XPL0/Colour-pinstripe-Display @@ -0,0 +1 @@ +../../Task/Colour-pinstripe-Display/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Combinations b/Lang/XPL0/Combinations new file mode 120000 index 0000000000..5c0c0db1b9 --- /dev/null +++ b/Lang/XPL0/Combinations @@ -0,0 +1 @@ +../../Task/Combinations/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Combinations-with-repetitions b/Lang/XPL0/Combinations-with-repetitions new file mode 120000 index 0000000000..a6b6358137 --- /dev/null +++ b/Lang/XPL0/Combinations-with-repetitions @@ -0,0 +1 @@ +../../Task/Combinations-with-repetitions/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Comments b/Lang/XPL0/Comments new file mode 120000 index 0000000000..27445df057 --- /dev/null +++ b/Lang/XPL0/Comments @@ -0,0 +1 @@ +../../Task/Comments/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Compile-time-calculation b/Lang/XPL0/Compile-time-calculation new file mode 120000 index 0000000000..317b81b458 --- /dev/null +++ b/Lang/XPL0/Compile-time-calculation @@ -0,0 +1 @@ +../../Task/Compile-time-calculation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Constrained-random-points-on-a-circle b/Lang/XPL0/Constrained-random-points-on-a-circle new file mode 120000 index 0000000000..2d8bbcd3d4 --- /dev/null +++ b/Lang/XPL0/Constrained-random-points-on-a-circle @@ -0,0 +1 @@ +../../Task/Constrained-random-points-on-a-circle/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Continued-fraction b/Lang/XPL0/Continued-fraction new file mode 120000 index 0000000000..343b4abbb5 --- /dev/null +++ b/Lang/XPL0/Continued-fraction @@ -0,0 +1 @@ +../../Task/Continued-fraction/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Continued-fraction-Arithmetic-Construct-from-rational-number b/Lang/XPL0/Continued-fraction-Arithmetic-Construct-from-rational-number new file mode 120000 index 0000000000..ff5356cf1e --- /dev/null +++ b/Lang/XPL0/Continued-fraction-Arithmetic-Construct-from-rational-number @@ -0,0 +1 @@ +../../Task/Continued-fraction-Arithmetic-Construct-from-rational-number/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Conways-Game-of-Life b/Lang/XPL0/Conways-Game-of-Life new file mode 120000 index 0000000000..0fc2bdcad7 --- /dev/null +++ b/Lang/XPL0/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Count-in-factors b/Lang/XPL0/Count-in-factors new file mode 120000 index 0000000000..9813d6f1ac --- /dev/null +++ b/Lang/XPL0/Count-in-factors @@ -0,0 +1 @@ +../../Task/Count-in-factors/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Count-in-octal b/Lang/XPL0/Count-in-octal new file mode 120000 index 0000000000..7b36382cbc --- /dev/null +++ b/Lang/XPL0/Count-in-octal @@ -0,0 +1 @@ +../../Task/Count-in-octal/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Count-occurrences-of-a-substring b/Lang/XPL0/Count-occurrences-of-a-substring new file mode 120000 index 0000000000..f040f42e1d --- /dev/null +++ b/Lang/XPL0/Count-occurrences-of-a-substring @@ -0,0 +1 @@ +../../Task/Count-occurrences-of-a-substring/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Create-a-two-dimensional-array-at-runtime b/Lang/XPL0/Create-a-two-dimensional-array-at-runtime new file mode 120000 index 0000000000..44718ffee6 --- /dev/null +++ b/Lang/XPL0/Create-a-two-dimensional-array-at-runtime @@ -0,0 +1 @@ +../../Task/Create-a-two-dimensional-array-at-runtime/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Date-format b/Lang/XPL0/Date-format new file mode 120000 index 0000000000..c61d211f28 --- /dev/null +++ b/Lang/XPL0/Date-format @@ -0,0 +1 @@ +../../Task/Date-format/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Day-of-the-week b/Lang/XPL0/Day-of-the-week new file mode 120000 index 0000000000..2182f6a2b6 --- /dev/null +++ b/Lang/XPL0/Day-of-the-week @@ -0,0 +1 @@ +../../Task/Day-of-the-week/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Deal-cards-for-FreeCell b/Lang/XPL0/Deal-cards-for-FreeCell new file mode 120000 index 0000000000..c4327607c3 --- /dev/null +++ b/Lang/XPL0/Deal-cards-for-FreeCell @@ -0,0 +1 @@ +../../Task/Deal-cards-for-FreeCell/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Detect-division-by-zero b/Lang/XPL0/Detect-division-by-zero new file mode 120000 index 0000000000..bf2a451723 --- /dev/null +++ b/Lang/XPL0/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Digital-root b/Lang/XPL0/Digital-root new file mode 120000 index 0000000000..e6d3a9faab --- /dev/null +++ b/Lang/XPL0/Digital-root @@ -0,0 +1 @@ +../../Task/Digital-root/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Dinesmans-multiple-dwelling-problem b/Lang/XPL0/Dinesmans-multiple-dwelling-problem new file mode 120000 index 0000000000..c5d23b7bc8 --- /dev/null +++ b/Lang/XPL0/Dinesmans-multiple-dwelling-problem @@ -0,0 +1 @@ +../../Task/Dinesmans-multiple-dwelling-problem/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Dot-product b/Lang/XPL0/Dot-product new file mode 120000 index 0000000000..fe7cead228 --- /dev/null +++ b/Lang/XPL0/Dot-product @@ -0,0 +1 @@ +../../Task/Dot-product/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Draw-a-cuboid b/Lang/XPL0/Draw-a-cuboid new file mode 120000 index 0000000000..bf4ad6089f --- /dev/null +++ b/Lang/XPL0/Draw-a-cuboid @@ -0,0 +1 @@ +../../Task/Draw-a-cuboid/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Draw-a-sphere b/Lang/XPL0/Draw-a-sphere new file mode 120000 index 0000000000..ba4e0b7a19 --- /dev/null +++ b/Lang/XPL0/Draw-a-sphere @@ -0,0 +1 @@ +../../Task/Draw-a-sphere/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Empty-string b/Lang/XPL0/Empty-string new file mode 120000 index 0000000000..4b70e9c094 --- /dev/null +++ b/Lang/XPL0/Empty-string @@ -0,0 +1 @@ +../../Task/Empty-string/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Enforced-immutability b/Lang/XPL0/Enforced-immutability new file mode 120000 index 0000000000..3e40f0aa67 --- /dev/null +++ b/Lang/XPL0/Enforced-immutability @@ -0,0 +1 @@ +../../Task/Enforced-immutability/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Entropy b/Lang/XPL0/Entropy new file mode 120000 index 0000000000..6338e31e75 --- /dev/null +++ b/Lang/XPL0/Entropy @@ -0,0 +1 @@ +../../Task/Entropy/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Enumerations b/Lang/XPL0/Enumerations new file mode 120000 index 0000000000..95143ecb24 --- /dev/null +++ b/Lang/XPL0/Enumerations @@ -0,0 +1 @@ +../../Task/Enumerations/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Equilibrium-index b/Lang/XPL0/Equilibrium-index new file mode 120000 index 0000000000..85d19051d1 --- /dev/null +++ b/Lang/XPL0/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Ethiopian-multiplication b/Lang/XPL0/Ethiopian-multiplication new file mode 120000 index 0000000000..8889150095 --- /dev/null +++ b/Lang/XPL0/Ethiopian-multiplication @@ -0,0 +1 @@ +../../Task/Ethiopian-multiplication/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Euler-method b/Lang/XPL0/Euler-method new file mode 120000 index 0000000000..1446db5fe7 --- /dev/null +++ b/Lang/XPL0/Euler-method @@ -0,0 +1 @@ +../../Task/Euler-method/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Evaluate-binomial-coefficients b/Lang/XPL0/Evaluate-binomial-coefficients new file mode 120000 index 0000000000..2501a04118 --- /dev/null +++ b/Lang/XPL0/Evaluate-binomial-coefficients @@ -0,0 +1 @@ +../../Task/Evaluate-binomial-coefficients/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Even-or-odd b/Lang/XPL0/Even-or-odd new file mode 120000 index 0000000000..e1b0276e2a --- /dev/null +++ b/Lang/XPL0/Even-or-odd @@ -0,0 +1 @@ +../../Task/Even-or-odd/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Evolutionary-algorithm b/Lang/XPL0/Evolutionary-algorithm new file mode 120000 index 0000000000..5a9a307445 --- /dev/null +++ b/Lang/XPL0/Evolutionary-algorithm @@ -0,0 +1 @@ +../../Task/Evolutionary-algorithm/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Exponentiation-operator b/Lang/XPL0/Exponentiation-operator new file mode 120000 index 0000000000..37b095b6ff --- /dev/null +++ b/Lang/XPL0/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Factorial b/Lang/XPL0/Factorial new file mode 120000 index 0000000000..a5b0a4ac3c --- /dev/null +++ b/Lang/XPL0/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Factors-of-an-integer b/Lang/XPL0/Factors-of-an-integer new file mode 120000 index 0000000000..3cb6ac6681 --- /dev/null +++ b/Lang/XPL0/Factors-of-an-integer @@ -0,0 +1 @@ +../../Task/Factors-of-an-integer/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Fibonacci-n-step-number-sequences b/Lang/XPL0/Fibonacci-n-step-number-sequences new file mode 120000 index 0000000000..2c40a1faf0 --- /dev/null +++ b/Lang/XPL0/Fibonacci-n-step-number-sequences @@ -0,0 +1 @@ +../../Task/Fibonacci-n-step-number-sequences/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/File-IO b/Lang/XPL0/File-IO new file mode 120000 index 0000000000..fd7191d7a6 --- /dev/null +++ b/Lang/XPL0/File-IO @@ -0,0 +1 @@ +../../Task/File-IO/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Filter b/Lang/XPL0/Filter new file mode 120000 index 0000000000..ae5b4bfe92 --- /dev/null +++ b/Lang/XPL0/Filter @@ -0,0 +1 @@ +../../Task/Filter/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Find-the-missing-permutation b/Lang/XPL0/Find-the-missing-permutation new file mode 120000 index 0000000000..949040cb36 --- /dev/null +++ b/Lang/XPL0/Find-the-missing-permutation @@ -0,0 +1 @@ +../../Task/Find-the-missing-permutation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Five-weekends b/Lang/XPL0/Five-weekends new file mode 120000 index 0000000000..d22bee05c5 --- /dev/null +++ b/Lang/XPL0/Five-weekends @@ -0,0 +1 @@ +../../Task/Five-weekends/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/FizzBuzz b/Lang/XPL0/FizzBuzz new file mode 120000 index 0000000000..721919c3a8 --- /dev/null +++ b/Lang/XPL0/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Floyds-triangle b/Lang/XPL0/Floyds-triangle new file mode 120000 index 0000000000..df92db1aa6 --- /dev/null +++ b/Lang/XPL0/Floyds-triangle @@ -0,0 +1 @@ +../../Task/Floyds-triangle/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Four-bit-adder b/Lang/XPL0/Four-bit-adder new file mode 120000 index 0000000000..042eda009c --- /dev/null +++ b/Lang/XPL0/Four-bit-adder @@ -0,0 +1 @@ +../../Task/Four-bit-adder/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Fractal-tree b/Lang/XPL0/Fractal-tree new file mode 120000 index 0000000000..2e9fdb15ea --- /dev/null +++ b/Lang/XPL0/Fractal-tree @@ -0,0 +1 @@ +../../Task/Fractal-tree/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Function-definition b/Lang/XPL0/Function-definition new file mode 120000 index 0000000000..1e95244a2f --- /dev/null +++ b/Lang/XPL0/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Galton-box-animation b/Lang/XPL0/Galton-box-animation new file mode 120000 index 0000000000..037ba9b6f7 --- /dev/null +++ b/Lang/XPL0/Galton-box-animation @@ -0,0 +1 @@ +../../Task/Galton-box-animation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Generator-Exponential b/Lang/XPL0/Generator-Exponential new file mode 120000 index 0000000000..ea42994876 --- /dev/null +++ b/Lang/XPL0/Generator-Exponential @@ -0,0 +1 @@ +../../Task/Generator-Exponential/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Generic-swap b/Lang/XPL0/Generic-swap new file mode 120000 index 0000000000..3a60849e90 --- /dev/null +++ b/Lang/XPL0/Generic-swap @@ -0,0 +1 @@ +../../Task/Generic-swap/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Globally-replace-text-in-several-files b/Lang/XPL0/Globally-replace-text-in-several-files new file mode 120000 index 0000000000..f8c0f1f008 --- /dev/null +++ b/Lang/XPL0/Globally-replace-text-in-several-files @@ -0,0 +1 @@ +../../Task/Globally-replace-text-in-several-files/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Gray-code b/Lang/XPL0/Gray-code new file mode 120000 index 0000000000..80ba68bd6c --- /dev/null +++ b/Lang/XPL0/Gray-code @@ -0,0 +1 @@ +../../Task/Gray-code/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Greatest-common-divisor b/Lang/XPL0/Greatest-common-divisor new file mode 120000 index 0000000000..8a5568212e --- /dev/null +++ b/Lang/XPL0/Greatest-common-divisor @@ -0,0 +1 @@ +../../Task/Greatest-common-divisor/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Greatest-element-of-a-list b/Lang/XPL0/Greatest-element-of-a-list new file mode 120000 index 0000000000..43e3c52571 --- /dev/null +++ b/Lang/XPL0/Greatest-element-of-a-list @@ -0,0 +1 @@ +../../Task/Greatest-element-of-a-list/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Greatest-subsequential-sum b/Lang/XPL0/Greatest-subsequential-sum new file mode 120000 index 0000000000..bc3dad1235 --- /dev/null +++ b/Lang/XPL0/Greatest-subsequential-sum @@ -0,0 +1 @@ +../../Task/Greatest-subsequential-sum/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Greyscale-bars-Display b/Lang/XPL0/Greyscale-bars-Display new file mode 120000 index 0000000000..ed3cdc14ed --- /dev/null +++ b/Lang/XPL0/Greyscale-bars-Display @@ -0,0 +1 @@ +../../Task/Greyscale-bars-Display/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Guess-the-number b/Lang/XPL0/Guess-the-number new file mode 120000 index 0000000000..c3a04cf9de --- /dev/null +++ b/Lang/XPL0/Guess-the-number @@ -0,0 +1 @@ +../../Task/Guess-the-number/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Guess-the-number-With-feedback b/Lang/XPL0/Guess-the-number-With-feedback new file mode 120000 index 0000000000..6698cdb04e --- /dev/null +++ b/Lang/XPL0/Guess-the-number-With-feedback @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Guess-the-number-With-feedback-player b/Lang/XPL0/Guess-the-number-With-feedback-player new file mode 120000 index 0000000000..71c2072a2e --- /dev/null +++ b/Lang/XPL0/Guess-the-number-With-feedback-player @@ -0,0 +1 @@ +../../Task/Guess-the-number-With-feedback-player/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Hailstone-sequence b/Lang/XPL0/Hailstone-sequence new file mode 120000 index 0000000000..11933fb5f3 --- /dev/null +++ b/Lang/XPL0/Hailstone-sequence @@ -0,0 +1 @@ +../../Task/Hailstone-sequence/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Happy-numbers b/Lang/XPL0/Happy-numbers new file mode 120000 index 0000000000..1f980f931d --- /dev/null +++ b/Lang/XPL0/Happy-numbers @@ -0,0 +1 @@ +../../Task/Happy-numbers/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Harshad-or-Niven-series b/Lang/XPL0/Harshad-or-Niven-series new file mode 120000 index 0000000000..e772a2a816 --- /dev/null +++ b/Lang/XPL0/Harshad-or-Niven-series @@ -0,0 +1 @@ +../../Task/Harshad-or-Niven-series/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Haversine-formula b/Lang/XPL0/Haversine-formula new file mode 120000 index 0000000000..d5e782e509 --- /dev/null +++ b/Lang/XPL0/Haversine-formula @@ -0,0 +1 @@ +../../Task/Haversine-formula/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Hello-world-Line-printer b/Lang/XPL0/Hello-world-Line-printer new file mode 120000 index 0000000000..1a65581463 --- /dev/null +++ b/Lang/XPL0/Hello-world-Line-printer @@ -0,0 +1 @@ +../../Task/Hello-world-Line-printer/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Hello-world-Newline-omission b/Lang/XPL0/Hello-world-Newline-omission new file mode 120000 index 0000000000..139b4a3bbb --- /dev/null +++ b/Lang/XPL0/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Hello-world-Standard-error b/Lang/XPL0/Hello-world-Standard-error new file mode 120000 index 0000000000..1c2a8b6049 --- /dev/null +++ b/Lang/XPL0/Hello-world-Standard-error @@ -0,0 +1 @@ +../../Task/Hello-world-Standard-error/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Hello-world-Text b/Lang/XPL0/Hello-world-Text new file mode 120000 index 0000000000..d45b0c7e72 --- /dev/null +++ b/Lang/XPL0/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Here-document b/Lang/XPL0/Here-document new file mode 120000 index 0000000000..7c9e78be00 --- /dev/null +++ b/Lang/XPL0/Here-document @@ -0,0 +1 @@ +../../Task/Here-document/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Hofstadter-Q-sequence b/Lang/XPL0/Hofstadter-Q-sequence new file mode 120000 index 0000000000..d72153204a --- /dev/null +++ b/Lang/XPL0/Hofstadter-Q-sequence @@ -0,0 +1 @@ +../../Task/Hofstadter-Q-sequence/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Honeycombs b/Lang/XPL0/Honeycombs new file mode 120000 index 0000000000..0a0c9cca5d --- /dev/null +++ b/Lang/XPL0/Honeycombs @@ -0,0 +1 @@ +../../Task/Honeycombs/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Horners-rule-for-polynomial-evaluation b/Lang/XPL0/Horners-rule-for-polynomial-evaluation new file mode 120000 index 0000000000..afe4d244b3 --- /dev/null +++ b/Lang/XPL0/Horners-rule-for-polynomial-evaluation @@ -0,0 +1 @@ +../../Task/Horners-rule-for-polynomial-evaluation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Host-introspection b/Lang/XPL0/Host-introspection new file mode 120000 index 0000000000..7e9afb04b3 --- /dev/null +++ b/Lang/XPL0/Host-introspection @@ -0,0 +1 @@ +../../Task/Host-introspection/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Identity-matrix b/Lang/XPL0/Identity-matrix new file mode 120000 index 0000000000..28d7aa72b6 --- /dev/null +++ b/Lang/XPL0/Identity-matrix @@ -0,0 +1 @@ +../../Task/Identity-matrix/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Image-noise b/Lang/XPL0/Image-noise new file mode 120000 index 0000000000..9345d4d722 --- /dev/null +++ b/Lang/XPL0/Image-noise @@ -0,0 +1 @@ +../../Task/Image-noise/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Include-a-file b/Lang/XPL0/Include-a-file new file mode 120000 index 0000000000..9766cd569e --- /dev/null +++ b/Lang/XPL0/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Increment-a-numerical-string b/Lang/XPL0/Increment-a-numerical-string new file mode 120000 index 0000000000..d684e4532d --- /dev/null +++ b/Lang/XPL0/Increment-a-numerical-string @@ -0,0 +1 @@ +../../Task/Increment-a-numerical-string/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Integer-comparison b/Lang/XPL0/Integer-comparison new file mode 120000 index 0000000000..607458ca45 --- /dev/null +++ b/Lang/XPL0/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Integer-sequence b/Lang/XPL0/Integer-sequence new file mode 120000 index 0000000000..1548a21f86 --- /dev/null +++ b/Lang/XPL0/Integer-sequence @@ -0,0 +1 @@ +../../Task/Integer-sequence/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Josephus-problem b/Lang/XPL0/Josephus-problem new file mode 120000 index 0000000000..0f8162b83c --- /dev/null +++ b/Lang/XPL0/Josephus-problem @@ -0,0 +1 @@ +../../Task/Josephus-problem/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Kaprekar-numbers b/Lang/XPL0/Kaprekar-numbers new file mode 120000 index 0000000000..b4860f05f3 --- /dev/null +++ b/Lang/XPL0/Kaprekar-numbers @@ -0,0 +1 @@ +../../Task/Kaprekar-numbers/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Keyboard-input-Flush-the-keyboard-buffer b/Lang/XPL0/Keyboard-input-Flush-the-keyboard-buffer new file mode 120000 index 0000000000..a81058dc15 --- /dev/null +++ b/Lang/XPL0/Keyboard-input-Flush-the-keyboard-buffer @@ -0,0 +1 @@ +../../Task/Keyboard-input-Flush-the-keyboard-buffer/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Keyboard-input-Keypress-check b/Lang/XPL0/Keyboard-input-Keypress-check new file mode 120000 index 0000000000..beb5f38a59 --- /dev/null +++ b/Lang/XPL0/Keyboard-input-Keypress-check @@ -0,0 +1 @@ +../../Task/Keyboard-input-Keypress-check/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/XPL0/Keyboard-input-Obtain-a-Y-or-N-response new file mode 120000 index 0000000000..3de01b25ab --- /dev/null +++ b/Lang/XPL0/Keyboard-input-Obtain-a-Y-or-N-response @@ -0,0 +1 @@ +../../Task/Keyboard-input-Obtain-a-Y-or-N-response/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Knapsack-problem-0-1 b/Lang/XPL0/Knapsack-problem-0-1 new file mode 120000 index 0000000000..f28337c177 --- /dev/null +++ b/Lang/XPL0/Knapsack-problem-0-1 @@ -0,0 +1 @@ +../../Task/Knapsack-problem-0-1/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Knapsack-problem-Continuous b/Lang/XPL0/Knapsack-problem-Continuous new file mode 120000 index 0000000000..36011e504a --- /dev/null +++ b/Lang/XPL0/Knapsack-problem-Continuous @@ -0,0 +1 @@ +../../Task/Knapsack-problem-Continuous/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Knights-tour b/Lang/XPL0/Knights-tour new file mode 120000 index 0000000000..34d21d1b21 --- /dev/null +++ b/Lang/XPL0/Knights-tour @@ -0,0 +1 @@ +../../Task/Knights-tour/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Langtons-ant b/Lang/XPL0/Langtons-ant new file mode 120000 index 0000000000..213b39e526 --- /dev/null +++ b/Lang/XPL0/Langtons-ant @@ -0,0 +1 @@ +../../Task/Langtons-ant/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Last-Friday-of-each-month b/Lang/XPL0/Last-Friday-of-each-month new file mode 120000 index 0000000000..dfd3918026 --- /dev/null +++ b/Lang/XPL0/Last-Friday-of-each-month @@ -0,0 +1 @@ +../../Task/Last-Friday-of-each-month/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Leap-year b/Lang/XPL0/Leap-year new file mode 120000 index 0000000000..a1a66623c1 --- /dev/null +++ b/Lang/XPL0/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Least-common-multiple b/Lang/XPL0/Least-common-multiple new file mode 120000 index 0000000000..1124bf77e6 --- /dev/null +++ b/Lang/XPL0/Least-common-multiple @@ -0,0 +1 @@ +../../Task/Least-common-multiple/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Letter-frequency b/Lang/XPL0/Letter-frequency new file mode 120000 index 0000000000..735790bacb --- /dev/null +++ b/Lang/XPL0/Letter-frequency @@ -0,0 +1 @@ +../../Task/Letter-frequency/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Linear-congruential-generator b/Lang/XPL0/Linear-congruential-generator new file mode 120000 index 0000000000..342d39925c --- /dev/null +++ b/Lang/XPL0/Linear-congruential-generator @@ -0,0 +1 @@ +../../Task/Linear-congruential-generator/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Literals-Floating-point b/Lang/XPL0/Literals-Floating-point new file mode 120000 index 0000000000..948aa97550 --- /dev/null +++ b/Lang/XPL0/Literals-Floating-point @@ -0,0 +1 @@ +../../Task/Literals-Floating-point/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Literals-Integer b/Lang/XPL0/Literals-Integer new file mode 120000 index 0000000000..c020c15021 --- /dev/null +++ b/Lang/XPL0/Literals-Integer @@ -0,0 +1 @@ +../../Task/Literals-Integer/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Logical-operations b/Lang/XPL0/Logical-operations new file mode 120000 index 0000000000..05f8bce2d3 --- /dev/null +++ b/Lang/XPL0/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Long-multiplication b/Lang/XPL0/Long-multiplication new file mode 120000 index 0000000000..98da36dd5b --- /dev/null +++ b/Lang/XPL0/Long-multiplication @@ -0,0 +1 @@ +../../Task/Long-multiplication/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loop-over-multiple-arrays-simultaneously b/Lang/XPL0/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..0a5be4bd3f --- /dev/null +++ b/Lang/XPL0/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-Break b/Lang/XPL0/Loops-Break new file mode 120000 index 0000000000..8115097b05 --- /dev/null +++ b/Lang/XPL0/Loops-Break @@ -0,0 +1 @@ +../../Task/Loops-Break/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-Continue b/Lang/XPL0/Loops-Continue new file mode 120000 index 0000000000..e053f23a91 --- /dev/null +++ b/Lang/XPL0/Loops-Continue @@ -0,0 +1 @@ +../../Task/Loops-Continue/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-Do-while b/Lang/XPL0/Loops-Do-while new file mode 120000 index 0000000000..533714771a --- /dev/null +++ b/Lang/XPL0/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-Downward-for b/Lang/XPL0/Loops-Downward-for new file mode 120000 index 0000000000..a8019043e6 --- /dev/null +++ b/Lang/XPL0/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-For b/Lang/XPL0/Loops-For new file mode 120000 index 0000000000..96fa66481c --- /dev/null +++ b/Lang/XPL0/Loops-For @@ -0,0 +1 @@ +../../Task/Loops-For/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-For-with-a-specified-step b/Lang/XPL0/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..327b19c5db --- /dev/null +++ b/Lang/XPL0/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-Foreach b/Lang/XPL0/Loops-Foreach new file mode 120000 index 0000000000..e55e56e888 --- /dev/null +++ b/Lang/XPL0/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-Infinite b/Lang/XPL0/Loops-Infinite new file mode 120000 index 0000000000..08f5f2d5be --- /dev/null +++ b/Lang/XPL0/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-N-plus-one-half b/Lang/XPL0/Loops-N-plus-one-half new file mode 120000 index 0000000000..ff2e2bbc15 --- /dev/null +++ b/Lang/XPL0/Loops-N-plus-one-half @@ -0,0 +1 @@ +../../Task/Loops-N-plus-one-half/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-Nested b/Lang/XPL0/Loops-Nested new file mode 120000 index 0000000000..435c2d85e6 --- /dev/null +++ b/Lang/XPL0/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Loops-While b/Lang/XPL0/Loops-While new file mode 120000 index 0000000000..65f8e6068b --- /dev/null +++ b/Lang/XPL0/Loops-While @@ -0,0 +1 @@ +../../Task/Loops-While/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Mandelbrot-set b/Lang/XPL0/Mandelbrot-set new file mode 120000 index 0000000000..34fc9fd5f3 --- /dev/null +++ b/Lang/XPL0/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Map-range b/Lang/XPL0/Map-range new file mode 120000 index 0000000000..d3e31e88d2 --- /dev/null +++ b/Lang/XPL0/Map-range @@ -0,0 +1 @@ +../../Task/Map-range/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Matrix-multiplication b/Lang/XPL0/Matrix-multiplication new file mode 120000 index 0000000000..f024aee92d --- /dev/null +++ b/Lang/XPL0/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Maze-generation b/Lang/XPL0/Maze-generation new file mode 120000 index 0000000000..a03b9bd1b9 --- /dev/null +++ b/Lang/XPL0/Maze-generation @@ -0,0 +1 @@ +../../Task/Maze-generation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Memory-allocation b/Lang/XPL0/Memory-allocation new file mode 120000 index 0000000000..44225c6a7c --- /dev/null +++ b/Lang/XPL0/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Menu b/Lang/XPL0/Menu new file mode 120000 index 0000000000..21d9d08ffa --- /dev/null +++ b/Lang/XPL0/Menu @@ -0,0 +1 @@ +../../Task/Menu/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Middle-three-digits b/Lang/XPL0/Middle-three-digits new file mode 120000 index 0000000000..b52f416bf1 --- /dev/null +++ b/Lang/XPL0/Middle-three-digits @@ -0,0 +1 @@ +../../Task/Middle-three-digits/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Modular-inverse b/Lang/XPL0/Modular-inverse new file mode 120000 index 0000000000..97825626af --- /dev/null +++ b/Lang/XPL0/Modular-inverse @@ -0,0 +1 @@ +../../Task/Modular-inverse/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Monte-Carlo-methods b/Lang/XPL0/Monte-Carlo-methods new file mode 120000 index 0000000000..d4a03780a5 --- /dev/null +++ b/Lang/XPL0/Monte-Carlo-methods @@ -0,0 +1 @@ +../../Task/Monte-Carlo-methods/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Monty-Hall-problem b/Lang/XPL0/Monty-Hall-problem new file mode 120000 index 0000000000..39e8157151 --- /dev/null +++ b/Lang/XPL0/Monty-Hall-problem @@ -0,0 +1 @@ +../../Task/Monty-Hall-problem/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Morse-code b/Lang/XPL0/Morse-code new file mode 120000 index 0000000000..cf7a4fd85a --- /dev/null +++ b/Lang/XPL0/Morse-code @@ -0,0 +1 @@ +../../Task/Morse-code/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Mouse-position b/Lang/XPL0/Mouse-position new file mode 120000 index 0000000000..0f279ecc00 --- /dev/null +++ b/Lang/XPL0/Mouse-position @@ -0,0 +1 @@ +../../Task/Mouse-position/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Multifactorial b/Lang/XPL0/Multifactorial new file mode 120000 index 0000000000..eac39e7989 --- /dev/null +++ b/Lang/XPL0/Multifactorial @@ -0,0 +1 @@ +../../Task/Multifactorial/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Multiple-distinct-objects b/Lang/XPL0/Multiple-distinct-objects new file mode 120000 index 0000000000..4568ae0174 --- /dev/null +++ b/Lang/XPL0/Multiple-distinct-objects @@ -0,0 +1 @@ +../../Task/Multiple-distinct-objects/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Multiplication-tables b/Lang/XPL0/Multiplication-tables new file mode 120000 index 0000000000..f0d3beeba0 --- /dev/null +++ b/Lang/XPL0/Multiplication-tables @@ -0,0 +1 @@ +../../Task/Multiplication-tables/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Mutual-recursion b/Lang/XPL0/Mutual-recursion new file mode 120000 index 0000000000..b65ac49247 --- /dev/null +++ b/Lang/XPL0/Mutual-recursion @@ -0,0 +1 @@ +../../Task/Mutual-recursion/XPL0 \ No newline at end of file diff --git a/Lang/XPL0/Search-a-list b/Lang/XPL0/Search-a-list new file mode 120000 index 0000000000..befbcee87a --- /dev/null +++ b/Lang/XPL0/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/XPL0 \ No newline at end of file diff --git a/Lang/XProc/0DESCRIPTION b/Lang/XProc/0DESCRIPTION new file mode 100644 index 0000000000..b1f3c9371c --- /dev/null +++ b/Lang/XProc/0DESCRIPTION @@ -0,0 +1,5 @@ +{{language|XProc +|site=http://www.w3.org/TR/xproc +|LCT=no +}} +XProc is a pipeline language \ No newline at end of file diff --git a/Lang/XQuery/0DESCRIPTION b/Lang/XQuery/0DESCRIPTION new file mode 100644 index 0000000000..654454d147 --- /dev/null +++ b/Lang/XQuery/0DESCRIPTION @@ -0,0 +1,6 @@ +{{language|XQuery +|site=http://www.w3.org/XML/Query +|LCT=no +}}{{language programming paradigm|functional}}'''XQuery''', is a declarative query and transformation language for [[XML]] data specified by W3C. XQuery has similarities to [[XSLT]] like '''XPath''' for path expressions. In fact, XQuery 1.0 is a superset of XPath 2.0. + +Unlike XSLT the XQuery syntax looks similar to [[SQL]] and consists of '''FLOWR''' expressions. FLOWR stands for '''for''', '''let''', '''order by''', '''where''' and '''return'''. \ No newline at end of file diff --git a/Lang/XQuery/Comments b/Lang/XQuery/Comments new file mode 120000 index 0000000000..2fdcf6b763 --- /dev/null +++ b/Lang/XQuery/Comments @@ -0,0 +1 @@ +../../Task/Comments/XQuery \ No newline at end of file diff --git a/Lang/XQuery/Empty-program b/Lang/XQuery/Empty-program new file mode 120000 index 0000000000..d5e4b8b92d --- /dev/null +++ b/Lang/XQuery/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/XQuery \ No newline at end of file diff --git a/Lang/XQuery/Fibonacci-sequence b/Lang/XQuery/Fibonacci-sequence new file mode 120000 index 0000000000..2d2cae9b3c --- /dev/null +++ b/Lang/XQuery/Fibonacci-sequence @@ -0,0 +1 @@ +../../Task/Fibonacci-sequence/XQuery \ No newline at end of file diff --git a/Lang/XQuery/Filter b/Lang/XQuery/Filter new file mode 120000 index 0000000000..b640b98ed0 --- /dev/null +++ b/Lang/XQuery/Filter @@ -0,0 +1 @@ +../../Task/Filter/XQuery \ No newline at end of file diff --git a/Lang/XS/0DESCRIPTION b/Lang/XS/0DESCRIPTION new file mode 100644 index 0000000000..9bbdd3196d --- /dev/null +++ b/Lang/XS/0DESCRIPTION @@ -0,0 +1,5 @@ +{{stub}}{{language}} + +XS is a glue language primarily used for creating interfaces between C code and Perl scripts. XS enables subroutines written in C to be called from Perl code, as if they were written in Perl. + +The XS language may also be used for writing C++ wrappers. \ No newline at end of file diff --git a/Lang/XSLT-1.0/0DESCRIPTION b/Lang/XSLT-1.0/0DESCRIPTION new file mode 100644 index 0000000000..ec99869c30 --- /dev/null +++ b/Lang/XSLT-1.0/0DESCRIPTION @@ -0,0 +1,6 @@ +{{stub}}{{language}} + +==References== +* [http://www.w3.org/TR/xslt XSLT 1.0 Spec] +* [http://www.w3.org/TR/REC-xml-names XML Namespaces Spec] +* [http://www.w3.org/TR/xpath XPath 1.0 Spec] \ No newline at end of file diff --git a/Lang/XSLT-1.0/100-doors b/Lang/XSLT-1.0/100-doors new file mode 120000 index 0000000000..c5f8cbc70f --- /dev/null +++ b/Lang/XSLT-1.0/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/XSLT-1.0 \ No newline at end of file diff --git a/Lang/XSLT-1.0/FizzBuzz b/Lang/XSLT-1.0/FizzBuzz new file mode 120000 index 0000000000..af823b9f55 --- /dev/null +++ b/Lang/XSLT-1.0/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/XSLT-1.0 \ No newline at end of file diff --git a/Lang/XSLT-1.0/Matrix-multiplication b/Lang/XSLT-1.0/Matrix-multiplication new file mode 120000 index 0000000000..858772f799 --- /dev/null +++ b/Lang/XSLT-1.0/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/XSLT-1.0 \ No newline at end of file diff --git a/Lang/XSLT-2.0/0DESCRIPTION b/Lang/XSLT-2.0/0DESCRIPTION new file mode 100644 index 0000000000..ff818ad99c --- /dev/null +++ b/Lang/XSLT-2.0/0DESCRIPTION @@ -0,0 +1,12 @@ +{{stub}}{{language}} + +==References== +* [http://www.w3.org/TR/xslt20 XSLT 2.0 Spec] +* [http://www.w3.org/TR/xpath-datamodel XQuery and XPath Data Model] +* [http://www.w3.org/TR/xpath-functions XPath Functions] +* [http://www.w3.org/TR/xml-infoset XML InfoSet] +* [http://www.w3.org/TR/xpath20 XPath 2.0 Spec] +* [http://www.w3.org/TR/xslt-xquery-serialization XSLT 2.0 Serialization] +* [http://www.w3.org/TR/xml-names11 Namespaces in XML 1.1] +* [http://www.w3.org/TR/xmlschema-2 XML Schema Part 1: Structures] +* [http://www.w3.org/TR/xmlschema-2 XML Schema Part 2: Data types] \ No newline at end of file diff --git a/Lang/XSLT-2.0/100-doors b/Lang/XSLT-2.0/100-doors new file mode 120000 index 0000000000..b15f04f92d --- /dev/null +++ b/Lang/XSLT-2.0/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/XSLT-2.0 \ No newline at end of file diff --git a/Lang/XSLT-2.0/CSV-to-HTML-translation b/Lang/XSLT-2.0/CSV-to-HTML-translation new file mode 120000 index 0000000000..1a66b345e2 --- /dev/null +++ b/Lang/XSLT-2.0/CSV-to-HTML-translation @@ -0,0 +1 @@ +../../Task/CSV-to-HTML-translation/XSLT-2.0 \ No newline at end of file diff --git a/Lang/XSLT-2.0/FizzBuzz b/Lang/XSLT-2.0/FizzBuzz new file mode 120000 index 0000000000..8e6093bf6f --- /dev/null +++ b/Lang/XSLT-2.0/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/XSLT-2.0 \ No newline at end of file diff --git a/Lang/XSLT-2.0/Longest-string-challenge b/Lang/XSLT-2.0/Longest-string-challenge new file mode 120000 index 0000000000..4000ee4ce3 --- /dev/null +++ b/Lang/XSLT-2.0/Longest-string-challenge @@ -0,0 +1 @@ +../../Task/Longest-string-challenge/XSLT-2.0 \ No newline at end of file diff --git a/Lang/XSLT/0DESCRIPTION b/Lang/XSLT/0DESCRIPTION new file mode 100644 index 0000000000..3de1ddcd07 --- /dev/null +++ b/Lang/XSLT/0DESCRIPTION @@ -0,0 +1,8 @@ +{{language|XSLT +|site=http://www.w3.org/TR/xslt +|LCT=no +}} +'''XSLT''', which stands for '''Extensible Stylesheet Language Transformations''', is a domain specific [[functional programming|functional]] language for extracting data from and transforming [[XML]] documents. The language itself uses [[XML]] syntax. It is defined in three pieces: +# '''Extensible Stylesheet Language''' (XSL) is the base language +# '''XPath''' is the expression language used within many of the attributes to address portions of the document and manipulate values +# '''Formatting Objects''' (FO) is an extension for providing page layout and presentation, which has a similar model to PDF \ No newline at end of file diff --git a/Lang/XSLT/Arithmetic-Integer b/Lang/XSLT/Arithmetic-Integer new file mode 120000 index 0000000000..35c10541a8 --- /dev/null +++ b/Lang/XSLT/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Boolean-values b/Lang/XSLT/Boolean-values new file mode 120000 index 0000000000..549ed9e3fe --- /dev/null +++ b/Lang/XSLT/Boolean-values @@ -0,0 +1 @@ +../../Task/Boolean-values/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Comments b/Lang/XSLT/Comments new file mode 120000 index 0000000000..eaeba2d036 --- /dev/null +++ b/Lang/XSLT/Comments @@ -0,0 +1 @@ +../../Task/Comments/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Compound-data-type b/Lang/XSLT/Compound-data-type new file mode 120000 index 0000000000..345e094993 --- /dev/null +++ b/Lang/XSLT/Compound-data-type @@ -0,0 +1 @@ +../../Task/Compound-data-type/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Conditional-structures b/Lang/XSLT/Conditional-structures new file mode 120000 index 0000000000..11f9c8a00c --- /dev/null +++ b/Lang/XSLT/Conditional-structures @@ -0,0 +1 @@ +../../Task/Conditional-structures/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Empty-program b/Lang/XSLT/Empty-program new file mode 120000 index 0000000000..c35397fd07 --- /dev/null +++ b/Lang/XSLT/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Filter b/Lang/XSLT/Filter new file mode 120000 index 0000000000..9fac675dfa --- /dev/null +++ b/Lang/XSLT/Filter @@ -0,0 +1 @@ +../../Task/Filter/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Function-definition b/Lang/XSLT/Function-definition new file mode 120000 index 0000000000..1bb230ffea --- /dev/null +++ b/Lang/XSLT/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Hello-world-Text b/Lang/XSLT/Hello-world-Text new file mode 120000 index 0000000000..45c6806a87 --- /dev/null +++ b/Lang/XSLT/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Integer-comparison b/Lang/XSLT/Integer-comparison new file mode 120000 index 0000000000..19857cd913 --- /dev/null +++ b/Lang/XSLT/Integer-comparison @@ -0,0 +1 @@ +../../Task/Integer-comparison/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Literals-String b/Lang/XSLT/Literals-String new file mode 120000 index 0000000000..ee2485adf1 --- /dev/null +++ b/Lang/XSLT/Literals-String @@ -0,0 +1 @@ +../../Task/Literals-String/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Logical-operations b/Lang/XSLT/Logical-operations new file mode 120000 index 0000000000..e48748a93a --- /dev/null +++ b/Lang/XSLT/Logical-operations @@ -0,0 +1 @@ +../../Task/Logical-operations/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Loops-Foreach b/Lang/XSLT/Loops-Foreach new file mode 120000 index 0000000000..fdcb4be5cc --- /dev/null +++ b/Lang/XSLT/Loops-Foreach @@ -0,0 +1 @@ +../../Task/Loops-Foreach/XSLT \ No newline at end of file diff --git a/Lang/XSLT/Mandelbrot-set b/Lang/XSLT/Mandelbrot-set new file mode 120000 index 0000000000..3ee88e8a83 --- /dev/null +++ b/Lang/XSLT/Mandelbrot-set @@ -0,0 +1 @@ +../../Task/Mandelbrot-set/XSLT \ No newline at end of file diff --git a/Lang/XTalk/0DESCRIPTION b/Lang/XTalk/0DESCRIPTION new file mode 100644 index 0000000000..6bea22b56e --- /dev/null +++ b/Lang/XTalk/0DESCRIPTION @@ -0,0 +1,9 @@ +{{ +language|XTalk +|exec=interpreted +|LCT=no +}} +'''''x''Talk''' (pronounced "cross-talk") is the language family started by [[HyperTalk]], the scripting language of [[Apple Computer]]'s [[HyperCard]] application for [[Mac OS]] Classic operating systems. Aimed at novice programmers, it was noted for an English-like syntax. Rarely used today, its modern descendant is [[AppleScript]]. + +==External links== +* [http://www.creysoft.com/xtalk/ Open source xTalk interpreters] \ No newline at end of file diff --git a/Lang/XUL/0DESCRIPTION b/Lang/XUL/0DESCRIPTION new file mode 100644 index 0000000000..71ff6d13b5 --- /dev/null +++ b/Lang/XUL/0DESCRIPTION @@ -0,0 +1,4 @@ +{{stub}}{{language|xul +|site=https://developer.mozilla.org/En/XUL/}} + +XUL is a cross platform user interface markup language implemented as an XML dialect that allows graphical user interfaces to be written in a similar manner to web pages. XUL was developed by the Mozilla Project \ No newline at end of file diff --git a/Lang/XUL/Comments b/Lang/XUL/Comments new file mode 120000 index 0000000000..d9fbea3c8d --- /dev/null +++ b/Lang/XUL/Comments @@ -0,0 +1 @@ +../../Task/Comments/XUL \ No newline at end of file diff --git a/Lang/XUL/Empty-program b/Lang/XUL/Empty-program new file mode 120000 index 0000000000..b02079e01f --- /dev/null +++ b/Lang/XUL/Empty-program @@ -0,0 +1 @@ +../../Task/Empty-program/XUL \ No newline at end of file diff --git a/Lang/Xanadu/0DESCRIPTION b/Lang/Xanadu/0DESCRIPTION new file mode 100644 index 0000000000..b85efc68d1 --- /dev/null +++ b/Lang/Xanadu/0DESCRIPTION @@ -0,0 +1,4 @@ +{{stub}}{{language|Xanadu +|site=http://www.cs.bu.edu/~hwxi/Xanadu/Xanadu.html +}} +Xanadu is a dependently typed imperative programming language. \ No newline at end of file diff --git a/Lang/Yacas/0DESCRIPTION b/Lang/Yacas/0DESCRIPTION new file mode 100644 index 0000000000..aebceeee0e --- /dev/null +++ b/Lang/Yacas/0DESCRIPTION @@ -0,0 +1,10 @@ +{{stub}}{{language|Yacas +|exec=interpreted +|LCT=no +}} + +YACAS (Yet Another Computer Algebra System) is an easy to use, general purpose Computer Algebra System, a program for symbolic manipulation of mathematical expressions. It uses its own programming language designed for symbolic as well as arbitrary-precision numerical computations. The system has a library of scripts that implement many of the symbolic algebra operations; new algorithms can be easily added to the library. YACAS comes with extensive documentation (hundreds of pages) covering the scripting language, the functionality that is already implemented in the system, and the algorithms used. + + +== See Also == +*[[wp:Yacas|Wikipedia : Yacas]] \ No newline at end of file diff --git a/Lang/Yorick/0DESCRIPTION b/Lang/Yorick/0DESCRIPTION new file mode 100644 index 0000000000..9fabb87493 --- /dev/null +++ b/Lang/Yorick/0DESCRIPTION @@ -0,0 +1,12 @@ +{{stub}}{{language +|exec=interpreted +|site=http://yorick.sourceforge.net/ +|gc=yes +|parampass=both +|LCT=no}} + +Yorick is an interpreted programming language for scientific simulations or calculations, postprocessing or steering large simulation codes, interactive scientific graphics, and reading, writing, or translating large files of numbers. Yorick includes an interactive graphics package, and a binary file package capable of translating to and from the raw numeric formats of all modern computers. Yorick is written in [[ANSI]] [[C]] and runs on most operating systems (*nix systems, [[Windows]], [[Mac]]). + +Yorick has a compact syntax, similar to C, but with array operators. It is easily expandable through dynamic linking of C libraries, allows efficient manipulation of arbitrary size/dimension arrays, and offers extensive graphic capabilities. + +Yorick is similar in scope to languages like [[IDL]] and [[MATLAB]]. \ No newline at end of file diff --git a/Lang/Yorick/100-doors b/Lang/Yorick/100-doors new file mode 120000 index 0000000000..3c26788b5a --- /dev/null +++ b/Lang/Yorick/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/Yorick \ No newline at end of file diff --git a/Lang/Yorick/99-Bottles-of-Beer b/Lang/Yorick/99-Bottles-of-Beer new file mode 120000 index 0000000000..3f81dcab9c --- /dev/null +++ b/Lang/Yorick/99-Bottles-of-Beer @@ -0,0 +1 @@ +../../Task/99-Bottles-of-Beer/Yorick \ No newline at end of file diff --git a/Lang/Yorick/A+B b/Lang/Yorick/A+B new file mode 120000 index 0000000000..db10271ea0 --- /dev/null +++ b/Lang/Yorick/A+B @@ -0,0 +1 @@ +../../Task/A+B/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Accumulator-factory b/Lang/Yorick/Accumulator-factory new file mode 120000 index 0000000000..9672fcbdce --- /dev/null +++ b/Lang/Yorick/Accumulator-factory @@ -0,0 +1 @@ +../../Task/Accumulator-factory/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Ackermann-function b/Lang/Yorick/Ackermann-function new file mode 120000 index 0000000000..1fd109f109 --- /dev/null +++ b/Lang/Yorick/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Arithmetic-Integer b/Lang/Yorick/Arithmetic-Integer new file mode 120000 index 0000000000..3c3a81771c --- /dev/null +++ b/Lang/Yorick/Arithmetic-Integer @@ -0,0 +1 @@ +../../Task/Arithmetic-Integer/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Array-concatenation b/Lang/Yorick/Array-concatenation new file mode 120000 index 0000000000..fcb706ca11 --- /dev/null +++ b/Lang/Yorick/Array-concatenation @@ -0,0 +1 @@ +../../Task/Array-concatenation/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Averages-Arithmetic-mean b/Lang/Yorick/Averages-Arithmetic-mean new file mode 120000 index 0000000000..0a8e87d1d6 --- /dev/null +++ b/Lang/Yorick/Averages-Arithmetic-mean @@ -0,0 +1 @@ +../../Task/Averages-Arithmetic-mean/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Delete-a-file b/Lang/Yorick/Delete-a-file new file mode 120000 index 0000000000..0b164f9402 --- /dev/null +++ b/Lang/Yorick/Delete-a-file @@ -0,0 +1 @@ +../../Task/Delete-a-file/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Detect-division-by-zero b/Lang/Yorick/Detect-division-by-zero new file mode 120000 index 0000000000..55ad1291b3 --- /dev/null +++ b/Lang/Yorick/Detect-division-by-zero @@ -0,0 +1 @@ +../../Task/Detect-division-by-zero/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Equilibrium-index b/Lang/Yorick/Equilibrium-index new file mode 120000 index 0000000000..68a85e6760 --- /dev/null +++ b/Lang/Yorick/Equilibrium-index @@ -0,0 +1 @@ +../../Task/Equilibrium-index/Yorick \ No newline at end of file diff --git a/Lang/Yorick/FizzBuzz b/Lang/Yorick/FizzBuzz new file mode 120000 index 0000000000..5e0caf3217 --- /dev/null +++ b/Lang/Yorick/FizzBuzz @@ -0,0 +1 @@ +../../Task/FizzBuzz/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Function-definition b/Lang/Yorick/Function-definition new file mode 120000 index 0000000000..518f060d24 --- /dev/null +++ b/Lang/Yorick/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Hello-world-Text b/Lang/Yorick/Hello-world-Text new file mode 120000 index 0000000000..f6cebf5b42 --- /dev/null +++ b/Lang/Yorick/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Leap-year b/Lang/Yorick/Leap-year new file mode 120000 index 0000000000..94b9cc6b11 --- /dev/null +++ b/Lang/Yorick/Leap-year @@ -0,0 +1 @@ +../../Task/Leap-year/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Look-and-say-sequence b/Lang/Yorick/Look-and-say-sequence new file mode 120000 index 0000000000..244f3839b7 --- /dev/null +++ b/Lang/Yorick/Look-and-say-sequence @@ -0,0 +1 @@ +../../Task/Look-and-say-sequence/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Loops-Do-while b/Lang/Yorick/Loops-Do-while new file mode 120000 index 0000000000..2894c4ec73 --- /dev/null +++ b/Lang/Yorick/Loops-Do-while @@ -0,0 +1 @@ +../../Task/Loops-Do-while/Yorick \ No newline at end of file diff --git a/Lang/Yorick/Search-a-list b/Lang/Yorick/Search-a-list new file mode 120000 index 0000000000..75b66a2a18 --- /dev/null +++ b/Lang/Yorick/Search-a-list @@ -0,0 +1 @@ +../../Task/Search-a-list/Yorick \ No newline at end of file diff --git a/Lang/Z80-Assembly/0DESCRIPTION b/Lang/Z80-Assembly/0DESCRIPTION new file mode 100644 index 0000000000..48b44d4b1e --- /dev/null +++ b/Lang/Z80-Assembly/0DESCRIPTION @@ -0,0 +1,22 @@ +{{ +language|Z80 Assembly +|LCT=no +}} +'''Z80 Assembly''' is an assembly language for the [[wp:Zilog Z80|Zilog Z80]] processor, which was introduced in 1976 and used in 1980s home computers such as the [[wp:ZX Spectrum|Sinclair ZX Spectrum]] and the [[wp:Amstrad CPC|Amstrad CPC]] series. In the late 1990s, some TI graphing calculators (e.g. the TI-83 series) were also Z80-based. + +The Z80 is binary compatible with the earlier Intel 8080, but the assembly code is different because instead of having several different commands for loading and storing data, there is only one,LD, on the Z80. Therefore, on the assembly level, Z80 code is actually closer to 8086 code when MOV is changed to LD and the different register structure is taken into account.http://en.wikipedia.org/wiki/Z80#Z80_assembly_language + +Today, the Z80 is still widely used in embedded systems and consumer electronics. Several cross assemblers exist for the Z80, e.g. [http://savannah.nongnu.org/projects/z80asm/ z80asm]. Also, some emulators of e.g. the Amstrad CPC feature a built-in assembler. + +==References== + + + +==See also== + +*[http://www.z80.info/zaks.html ''Programming the Z80''] by Rodney Zaks, 1981 3rd ed. (PDF)—downloadable with permission of the author +*[http://www.grimware.org/doku.php/documentations/devices/z80 Z80 instruction set and opcodes] +*[http://www.produktinfo.conrad.com/datenblaetter/175000-199999/181862-da-01-en-Z_80_A_CPU.pdf Z80 product specification and data sheet] (PDF) +*[http://www.z80.info/ Z80 information site] + +[[Category:Assembly]]{{assembler language}} \ No newline at end of file diff --git a/Lang/Z80-Assembly/Hello-world-Text b/Lang/Z80-Assembly/Hello-world-Text new file mode 120000 index 0000000000..17d332f10f --- /dev/null +++ b/Lang/Z80-Assembly/Hello-world-Text @@ -0,0 +1 @@ +../../Task/Hello-world-Text/Z80-Assembly \ No newline at end of file diff --git a/Lang/Z80-Assembly/Loops-Infinite b/Lang/Z80-Assembly/Loops-Infinite new file mode 120000 index 0000000000..55d4141d3f --- /dev/null +++ b/Lang/Z80-Assembly/Loops-Infinite @@ -0,0 +1 @@ +../../Task/Loops-Infinite/Z80-Assembly \ No newline at end of file diff --git a/Lang/ZED/0DESCRIPTION b/Lang/ZED/0DESCRIPTION new file mode 100644 index 0000000000..5ff7e02f03 --- /dev/null +++ b/Lang/ZED/0DESCRIPTION @@ -0,0 +1,9 @@ +{{stub}}{{language}} + +== What is ZED? == + +ZED is a functional programming language that compiles to Racket/Scheme. + +Development of ZED is happening on GitHub: https://github.com/zelah/ZED.git + +The language page is here: http://zedlan.blogspot.com/ \ No newline at end of file diff --git a/Lang/ZED/100-doors b/Lang/ZED/100-doors new file mode 120000 index 0000000000..2d81560a37 --- /dev/null +++ b/Lang/ZED/100-doors @@ -0,0 +1 @@ +../../Task/100-doors/ZED \ No newline at end of file diff --git a/Lang/ZED/A+B b/Lang/ZED/A+B new file mode 120000 index 0000000000..43a576f010 --- /dev/null +++ b/Lang/ZED/A+B @@ -0,0 +1 @@ +../../Task/A+B/ZED \ No newline at end of file diff --git a/Lang/ZED/Ackermann-function b/Lang/ZED/Ackermann-function new file mode 120000 index 0000000000..ed003a8400 --- /dev/null +++ b/Lang/ZED/Ackermann-function @@ -0,0 +1 @@ +../../Task/Ackermann-function/ZED \ No newline at end of file diff --git a/Lang/ZPL/0DESCRIPTION b/Lang/ZPL/0DESCRIPTION new file mode 100644 index 0000000000..ba345eb2d8 --- /dev/null +++ b/Lang/ZPL/0DESCRIPTION @@ -0,0 +1,9 @@ +{{language +|express=explicit +|exec=machine +|site=http://www.cs.washington.edu/research/zpl/home/index.html +|LCT=no +}} +{{language programming paradigm|concurrent}} + +ZPL is an array programming language (like [[APL]], [[J]], and [[Glee]]) designed from first principles for fast execution on both sequential and parallel computers. It provides a convenient high-level programming medium for supercomputers and large-scale clusters with efficiency comparable to hand-coded message passing. It is the perfect alternative to using a sequential language like C or Fortran and a message passing library like MPI. It is based around a matrix, and it compiles to [[ANSI]] [[C]]. \ No newline at end of file diff --git a/Lang/ZPL/Conways-Game-of-Life b/Lang/ZPL/Conways-Game-of-Life new file mode 120000 index 0000000000..9a25ba4d03 --- /dev/null +++ b/Lang/ZPL/Conways-Game-of-Life @@ -0,0 +1 @@ +../../Task/Conways-Game-of-Life/ZPL \ No newline at end of file diff --git a/Lang/ZPL/Matrix-multiplication b/Lang/ZPL/Matrix-multiplication new file mode 120000 index 0000000000..3dd57114b7 --- /dev/null +++ b/Lang/ZPL/Matrix-multiplication @@ -0,0 +1 @@ +../../Task/Matrix-multiplication/ZPL \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/0DESCRIPTION b/Lang/ZX-Spectrum-Basic/0DESCRIPTION new file mode 100644 index 0000000000..6a276040df --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/0DESCRIPTION @@ -0,0 +1,33 @@ +{{language|ZX Spectrum Basic +|exec=interpreted +|site=http://www.worldofspectrum.org/ZXBasicManual/}} +{{implementation|BASIC}}'''ZX Spectrum Basic''' is the [[BASIC]] built into the ROM of the ZX Spectrum Computer. + +==Features== + +* Language is interpreted (but third party compiler is available). +* Line numbers are required +* Line numbers must be no longer than four digits +* No [[named locations]] +* Some [[Terminal Control]] capabilities +* Supports [[colour]] +* Support for direct display [[graphics]] +* Support for sound via the [[speaker]] +* No support for [[scope]]d variables +* No support for [[structure]]d variables +* No [[command line parameter]]s +* No support for [[environment]] +* Supports output tho the [[line printer]] via the [[lprint]] command +* No direct support for error handling, but error handling can be achieved using assembly language by changing the [[error handler]] address +* Support for streams when using [[Interface 1]], but no support for [[freefile]] +* Can read keystrokes using INKEY$ +* No support for multiple line IF conditionals +* No conditional compilation directives +* no [[hashbang]] mechanism +* Variables have to be defined before use +* The GO TO command has a space in the middle +* VAL function interprets expressions +* INPUT function can interpret expressions (unless LINE INPUT is used) + +{{language programming paradigm|procedural}} +{{language programming paradigm|imperative}} \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Call-a-function b/Lang/ZX-Spectrum-Basic/Call-a-function new file mode 120000 index 0000000000..d0cda5d992 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Call-a-function @@ -0,0 +1 @@ +../../Task/Call-a-function/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Case-sensitivity-of-identifiers b/Lang/ZX-Spectrum-Basic/Case-sensitivity-of-identifiers new file mode 120000 index 0000000000..ff83fa6711 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Case-sensitivity-of-identifiers @@ -0,0 +1 @@ +../../Task/Case-sensitivity-of-identifiers/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Create-a-file b/Lang/ZX-Spectrum-Basic/Create-a-file new file mode 120000 index 0000000000..847ba7eaa9 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Create-a-file @@ -0,0 +1 @@ +../../Task/Create-a-file/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Create-a-file-on-magnetic-tape b/Lang/ZX-Spectrum-Basic/Create-a-file-on-magnetic-tape new file mode 120000 index 0000000000..fee507f979 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Create-a-file-on-magnetic-tape @@ -0,0 +1 @@ +../../Task/Create-a-file-on-magnetic-tape/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Documentation b/Lang/ZX-Spectrum-Basic/Documentation new file mode 120000 index 0000000000..e8e7ab5ba9 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Documentation @@ -0,0 +1 @@ +../../Task/Documentation/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Execute-a-system-command b/Lang/ZX-Spectrum-Basic/Execute-a-system-command new file mode 120000 index 0000000000..90b732546f --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Execute-a-system-command @@ -0,0 +1 @@ +../../Task/Execute-a-system-command/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Exponentiation-operator b/Lang/ZX-Spectrum-Basic/Exponentiation-operator new file mode 120000 index 0000000000..837de79f76 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Exponentiation-operator @@ -0,0 +1 @@ +../../Task/Exponentiation-operator/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Factorial b/Lang/ZX-Spectrum-Basic/Factorial new file mode 120000 index 0000000000..0b29885fc6 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Factorial @@ -0,0 +1 @@ +../../Task/Factorial/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Function-definition b/Lang/ZX-Spectrum-Basic/Function-definition new file mode 120000 index 0000000000..ec5a6fe726 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Function-definition @@ -0,0 +1 @@ +../../Task/Function-definition/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Greyscale-bars-Display b/Lang/ZX-Spectrum-Basic/Greyscale-bars-Display new file mode 120000 index 0000000000..d360735976 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Greyscale-bars-Display @@ -0,0 +1 @@ +../../Task/Greyscale-bars-Display/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Hello-world-Newline-omission b/Lang/ZX-Spectrum-Basic/Hello-world-Newline-omission new file mode 120000 index 0000000000..58ed3cd312 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Hello-world-Newline-omission @@ -0,0 +1 @@ +../../Task/Hello-world-Newline-omission/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Include-a-file b/Lang/ZX-Spectrum-Basic/Include-a-file new file mode 120000 index 0000000000..a209f9a63a --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Include-a-file @@ -0,0 +1 @@ +../../Task/Include-a-file/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Introspection b/Lang/ZX-Spectrum-Basic/Introspection new file mode 120000 index 0000000000..adcbe1f376 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Introspection @@ -0,0 +1 @@ +../../Task/Introspection/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Loop-over-multiple-arrays-simultaneously b/Lang/ZX-Spectrum-Basic/Loop-over-multiple-arrays-simultaneously new file mode 120000 index 0000000000..19094deb58 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Loop-over-multiple-arrays-simultaneously @@ -0,0 +1 @@ +../../Task/Loop-over-multiple-arrays-simultaneously/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Loops-Downward-for b/Lang/ZX-Spectrum-Basic/Loops-Downward-for new file mode 120000 index 0000000000..00b924d55a --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Loops-Downward-for @@ -0,0 +1 @@ +../../Task/Loops-Downward-for/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Loops-For-with-a-specified-step b/Lang/ZX-Spectrum-Basic/Loops-For-with-a-specified-step new file mode 120000 index 0000000000..08eeb067a4 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Loops-For-with-a-specified-step @@ -0,0 +1 @@ +../../Task/Loops-For-with-a-specified-step/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Loops-Nested b/Lang/ZX-Spectrum-Basic/Loops-Nested new file mode 120000 index 0000000000..441f66ad68 --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Loops-Nested @@ -0,0 +1 @@ +../../Task/Loops-Nested/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Luhn-test-of-credit-card-numbers b/Lang/ZX-Spectrum-Basic/Luhn-test-of-credit-card-numbers new file mode 120000 index 0000000000..3a0efc341c --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Luhn-test-of-credit-card-numbers @@ -0,0 +1 @@ +../../Task/Luhn-test-of-credit-card-numbers/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/ZX-Spectrum-Basic/Memory-allocation b/Lang/ZX-Spectrum-Basic/Memory-allocation new file mode 120000 index 0000000000..3c3c821b2c --- /dev/null +++ b/Lang/ZX-Spectrum-Basic/Memory-allocation @@ -0,0 +1 @@ +../../Task/Memory-allocation/ZX-Spectrum-Basic \ No newline at end of file diff --git a/Lang/Zonnon/0DESCRIPTION b/Lang/Zonnon/0DESCRIPTION new file mode 100644 index 0000000000..8a95e192c9 --- /dev/null +++ b/Lang/Zonnon/0DESCRIPTION @@ -0,0 +1,6 @@ +{{stub}} +{{language +|site=http://www.zonnon.ethz.ch/ +|LCT=yes +}} +Zonnon is a general-purpose programming language in the [[Pascal]], [[Modula-2]] and [[Oberon]] family. It retains an emphasis on simplicity, clear syntax and separation of concerns whilst focusing on concurrency and ease of composition and expression. Unification of abstractions is at the heart of its design and this is reflected in its conceptual model based on modules, objects, definitions and implementations. Zonnon offers a new computing model based on active objects with their interaction defined by syntax controlled dialogs. It also introduces new features including operator overloading and exception handling, and is specifically designed to be platform independent. \ No newline at end of file diff --git a/Meta/Lang.yaml b/Meta/Lang.yaml index bd99307542..6ea1605157 100644 --- a/Meta/Lang.yaml +++ b/Meta/Lang.yaml @@ -115,7 +115,7 @@ ASP: path: ASP url: ASP ASP.Net: - ext: asp + ext: asp.net name: ASP.Net path: ASP.Net url: ASP.Net @@ -195,12 +195,12 @@ AppleScript: path: AppleScript url: AppleScript Applesoft BASIC: - ext: bas + ext: applesoft name: Applesoft BASIC path: Applesoft-BASIC url: Applesoft_BASIC Application Master: - ext: application + ext: '' name: Application Master path: Application-Master url: Application_Master @@ -260,7 +260,7 @@ B: path: B url: B BASIC: - ext: bas + ext: basic name: BASIC path: BASIC url: BASIC @@ -490,7 +490,7 @@ Cobra: path: Cobra url: Cobra CoffeeScript: - ext: coffee + ext: coffeescript name: CoffeeScript path: CoffeeScript url: CoffeeScript @@ -505,7 +505,7 @@ Common Lisp: path: Common-Lisp url: Common_Lisp Component Pascal: - ext: pascal + ext: component name: Component Pascal path: Component-Pascal url: Component_Pascal @@ -590,7 +590,7 @@ Dylan: path: Dylan url: Dylan Dylan.NET: - ext: net + ext: dylan.net name: Dylan.NET path: Dylan.NET url: Dylan.NET @@ -730,7 +730,7 @@ FBSL: path: FBSL url: FBSL FLORA-2: - ext: flora-2 + ext: '' name: FLORA-2 path: FLORA-2 url: FLORA-2 @@ -860,7 +860,7 @@ GUISS: path: GUISS url: GUISS GW-BASIC: - ext: bas + ext: gw-basic name: GW-BASIC path: GW-BASIC url: GW-BASIC @@ -910,7 +910,7 @@ Go: path: Go url: Go Golfscript: - ext: golf + ext: golfscript name: Golfscript path: Golfscript url: Golfscript @@ -995,7 +995,7 @@ Informix 4GL: path: Informix-4GL url: Informix_4GL Integer BASIC: - ext: bas + ext: integer name: Integer BASIC path: Integer-BASIC url: Integer_BASIC @@ -1035,7 +1035,7 @@ JCL: path: JCL url: JCL JScript.NET: - ext: net + ext: jscript.net name: JScript.NET path: JScript.NET url: JScript.NET @@ -1080,7 +1080,7 @@ Joy: path: Joy url: Joy JudoScript: - ext: judo + ext: judoscript name: JudoScript path: JudoScript url: JudoScript @@ -1105,7 +1105,7 @@ Kaya: path: Kaya url: Kaya KeyList Databasing: - ext: keylist + ext: '' name: KeyList Databasing path: KeyList-Databasing url: KeyList_Databasing @@ -1115,7 +1115,7 @@ Kite: path: Kite url: Kite KonsolScript: - ext: konso + ext: konsolscript name: KonsolScript path: KonsolScript url: KonsolScript @@ -1180,7 +1180,7 @@ Liberty BASIC: path: Liberty-BASIC url: Liberty_BASIC Lilypond: - ext: lilypond + ext: lily name: Lilypond path: Lilypond url: Lilypond @@ -1195,12 +1195,12 @@ Lisaac: path: Lisaac url: Lisaac Lisp: - ext: lisp + ext: l name: Lisp path: Lisp url: Lisp Locomotive Basic: - ext: bas + ext: locomotive name: Locomotive Basic path: Locomotive-Basic url: Locomotive_Basic @@ -1225,7 +1225,7 @@ Lotus 123 Macro Scripting: path: Lotus-123-Macro-Scripting url: Lotus_123_Macro_Scripting LotusScript: - ext: lotus + ext: lotusscript name: LotusScript path: LotusScript url: LotusScript @@ -1275,7 +1275,7 @@ MATLAB: path: MATLAB url: MATLAB MAXScript: - ext: max + ext: maxscript name: MAXScript path: MAXScript url: MAXScript @@ -1330,12 +1330,12 @@ MPIF90: path: MPIF90 url: MPIF90 MS SQL: - ext: ms + ext: sql name: MS SQL path: MS-SQL url: MS_SQL MSSQL: - ext: mssql + ext: sql name: MSSQL path: MSSQL url: MSSQL @@ -1360,12 +1360,12 @@ Maple: path: Maple url: Maple Mathematica: - ext: mathematica + ext: math name: Mathematica path: Mathematica url: Mathematica Mathprog: - ext: mathprog + ext: math name: Mathprog path: Mathprog url: Mathprog @@ -1410,12 +1410,12 @@ Modula-3: path: Modula-3 url: Modula-3 Moonscript: - ext: moon + ext: moonscript name: Moonscript path: Moonscript url: Moonscript MySQL: - ext: mysql + ext: sql name: MySQL path: MySQL url: MySQL @@ -1429,6 +1429,201 @@ Mythryl: name: Mythryl path: Mythryl url: Mythryl +N/t/roff: + ext: n + name: N/t/roff + path: N-t-roff + url: N/t/roff +NQP: + ext: nqp + name: NQP + path: NQP + url: NQP +NSIS: + ext: nsis + name: NSIS + path: NSIS + url: NSIS +Neat: + ext: neat + name: Neat + path: Neat + url: Neat +Neko: + ext: neko + name: Neko + path: Neko + url: Neko +Nemerle: + ext: nemerle + name: Nemerle + path: Nemerle + url: Nemerle +NetLogo: + ext: netlogo + name: NetLogo + path: NetLogo + url: NetLogo +NetRexx: + ext: netrexx + name: NetRexx + path: NetRexx + url: NetRexx +NewLISP: + ext: newlisp + name: NewLISP + path: NewLISP + url: NewLISP +Nial: + ext: nial + name: Nial + path: Nial + url: Nial +Nice: + ext: nice + name: Nice + path: Nice + url: Nice +Nickle: + ext: nickle + name: Nickle + path: Nickle + url: Nickle +Nimrod: + ext: nimrod + name: Nimrod + path: Nimrod + url: Nimrod +Niue: + ext: niue + name: Niue + path: Niue + url: Niue +OCaml: + ext: ocaml + name: OCaml + path: OCaml + url: OCaml +OOC: + ext: ooc + name: OOC + path: OOC + url: OOC +OOCalc: + ext: oocalc + name: OOCalc + path: OOCalc + url: OOCalc +OPL: + ext: opl + name: OPL + path: OPL + url: OPL +Oberon-2: + ext: oberon-2 + name: Oberon-2 + path: Oberon-2 + url: Oberon-2 +Objeck: + ext: objeck + name: Objeck + path: Objeck + url: Objeck +Object Pascal: + ext: object + name: Object Pascal + path: Object-Pascal + url: Object_Pascal +ObjectIcon: + ext: objecticon + name: ObjectIcon + path: ObjectIcon + url: ObjectIcon +Objective-C: + ext: m + name: Objective-C + path: Objective-C + url: Objective-C +Occam: + ext: occam + name: Occam + path: Occam + url: Occam +Octave: + ext: octave + name: Octave + path: Octave + url: Octave +Omega: + ext: omega + name: Omega + path: Omega + url: Omega +Onyx: + ext: onyx + name: Onyx + path: Onyx + url: Onyx +OoRexx: + ext: rexx + name: OoRexx + path: OoRexx + url: OoRexx +Opa: + ext: opa + name: Opa + path: Opa + url: Opa +OpenC++: + ext: opencpp + name: OpenC++ + path: OpenC++ + url: OpenC++ +OpenEdge/Progress: + ext: openedge + name: OpenEdge/Progress + path: OpenEdge-Progress + url: OpenEdge/Progress +Openscad: + ext: scad + name: Openscad + path: Openscad + url: Openscad +Order: + ext: order + name: Order + path: Order + url: Order +OxygenBasic: + ext: oxy + name: OxygenBasic + path: OxygenBasic + url: OxygenBasic +Oxygene: + ext: oxy + name: Oxygene + path: Oxygene + url: Oxygene +Oz: + ext: oz + name: Oz + path: Oz + url: Oz +PARI/GP: + ext: pari + name: PARI/GP + path: PARI-GP + url: PARI/GP +PASM: + ext: pasm + name: PASM + path: PASM + url: PASM +PDP-11 Assembly: + ext: pdp-11 + name: PDP-11 Assembly + path: PDP-11-Assembly + url: PDP-11_Assembly PHP: ext: php name: PHP @@ -1439,51 +1634,351 @@ PIR: name: PIR path: PIR url: PIR +PL/I: + ext: pli + name: PL/I + path: PL-I + url: PL/I +PL/M: + ext: plm + name: PL/M + path: PL-M + url: PL/M +PL/SQL: + ext: sql + name: PL/SQL + path: PL-SQL + url: PL/SQL +PL/pgSQL: + ext: sql + name: PL/pgSQL + path: PL-pgSQL + url: PL/pgSQL +PLUS: + ext: plus + name: PLUS + path: PLUS + url: PLUS +PLZ/SYS: + ext: plz + name: PLZ/SYS + path: PLZ-SYS + url: PLZ/SYS +POV-Ray: + ext: pov-ray + name: POV-Ray + path: POV-Ray + url: POV-Ray +PPC Assembly: + ext: ppc + name: PPC Assembly + path: PPC-Assembly + url: PPC_Assembly +PPL: + ext: ppl + name: PPL + path: PPL + url: PPL +PSQL: + ext: psql + name: PSQL + path: PSQL + url: PSQL +Pascal: + ext: pascal + name: Pascal + path: Pascal + url: Pascal +Pentium Assembly: + ext: pentium + name: Pentium Assembly + path: Pentium-Assembly + url: Pentium_Assembly Perl: ext: pl name: Perl path: Perl url: Perl +Perl 6: + ext: pl6 + name: Perl 6 + path: Perl-6 + url: Perl_6 PicoLisp: ext: l name: PicoLisp path: PicoLisp url: PicoLisp +Piet: + ext: piet + name: Piet + path: Piet + url: Piet +Pike: + ext: pike + name: Pike + path: Pike + url: Pike +PlainTeX: + ext: tex + name: PlainTeX + path: PlainTeX + url: PlainTeX +Pop11: + ext: pop11 + name: Pop11 + path: Pop11 + url: Pop11 +PostScript: + ext: ps + name: PostScript + path: PostScript + url: PostScript +PowerBASIC: + ext: powerbasic + name: PowerBASIC + path: PowerBASIC + url: PowerBASIC +PowerShell: + ext: psh + name: PowerShell + path: PowerShell + url: PowerShell +ProDOS: + ext: dos + name: ProDOS + path: ProDOS + url: ProDOS +Processing: + ext: '' + name: Processing + path: Processing + url: Processing Prolog: ext: pro name: Prolog path: Prolog url: Prolog +Protium: + ext: protium + name: Protium + path: Protium + url: Protium +Pure: + ext: pure + name: Pure + path: Pure + url: Pure +Pure Data: + ext: pure + name: Pure Data + path: Pure-Data + url: Pure_Data +PureBasic: + ext: purebasic + name: PureBasic + path: PureBasic + url: PureBasic +Purity: + ext: purity + name: Purity + path: Purity + url: Purity Python: ext: py name: Python path: Python url: Python +Q: + ext: q + name: Q + path: Q + url: Q +Qi: + ext: qi + name: Qi + path: Qi + url: Qi +Qore: + ext: qore + name: Qore + path: Qore + url: Qore +QuakeC: + ext: c + name: QuakeC + path: QuakeC + url: QuakeC +Quill: + ext: quill + name: Quill + path: Quill + url: Quill R: ext: r name: R path: R url: R +REALbasic: + ext: realbasic + name: REALbasic + path: REALbasic + url: REALbasic +REBOL: + ext: rebol + name: REBOL + path: REBOL + url: REBOL REXX: ext: rexx name: REXX path: REXX url: REXX +RLSL: + ext: rlsl + name: RLSL + path: RLSL + url: RLSL +RLaB: + ext: rlab + name: RLaB + path: RLaB + url: RLaB +RPG: + ext: rpg + name: RPG + path: RPG + url: RPG +RPL/2: + ext: rpl + name: RPL/2 + path: RPL-2 + url: RPL/2 +RTL/2: + ext: rtl + name: RTL/2 + path: RTL-2 + url: RTL/2 +RTSL: + ext: rtsl + name: RTSL + path: RTSL + url: RTSL Racket: ext: rkt name: Racket path: Racket url: Racket +RapidQ: + ext: rapidq + name: RapidQ + path: RapidQ + url: RapidQ +Rascal: + ext: rascal + name: Rascal + path: Rascal + url: Rascal +Raven: + ext: raven + name: Raven + path: Raven + url: Raven +Refal: + ext: refal + name: Refal + path: Refal + url: Refal +Retro: + ext: retro + name: Retro + path: Retro + url: Retro +Revolution: + ext: rev + name: Revolution + path: Revolution + url: Revolution +Rhope: + ext: rhope + name: Rhope + path: Rhope + url: Rhope Ruby: ext: rb name: Ruby path: Ruby url: Ruby +Run BASIC: + ext: run + name: Run BASIC + path: Run-BASIC + url: Run_BASIC +Rust: + ext: rust + name: Rust + path: Rust + url: Rust +S-lang: + ext: slang + name: S-lang + path: S-lang + url: S-lang +SAS: + ext: sas + name: SAS + path: SAS + url: SAS +SETL: + ext: setl + name: SETL + path: SETL + url: SETL +SIMPOL: + ext: simpol + name: SIMPOL + path: SIMPOL + url: SIMPOL +SMEQL: + ext: smeql + name: SMEQL + path: SMEQL + url: SMEQL +SNOBOL4: + ext: sno + name: SNOBOL4 + path: SNOBOL4 + url: SNOBOL4 SNUSP: ext: snusp name: SNUSP path: SNUSP url: SNUSP +SPARC Assembly: + ext: sparc + name: SPARC Assembly + path: SPARC-Assembly + url: SPARC_Assembly +SPARK: + ext: spark + name: SPARK + path: SPARK + url: SPARK +SQL: + ext: sql + name: SQL + path: SQL + url: SQL +Sage: + ext: sage + name: Sage + path: Sage + url: Sage +Salmon: + ext: salmon + name: Salmon + path: Salmon + url: Salmon Sather: ext: sa name: Sather @@ -1499,18 +1994,473 @@ Scheme: name: Scheme path: Scheme url: Scheme +Scilab: + ext: scilab + name: Scilab + path: Scilab + url: Scilab +Scratch: + ext: scratch + name: Scratch + path: Scratch + url: Scratch +Script Basic: + ext: script + name: Script Basic + path: Script-Basic + url: Script_Basic +Script3D: + ext: 3d + name: Script3D + path: Script3D + url: Script3D +ScriptBasic: + ext: scriptbasic + name: ScriptBasic + path: ScriptBasic + url: ScriptBasic +Sed: + ext: sed + name: Sed + path: Sed + url: Sed +Seed7: + ext: seed7 + name: Seed7 + path: Seed7 + url: Seed7 +Self: + ext: self + name: Self + path: Self + url: Self +SheerPower 4GL: + ext: 4gl + name: SheerPower 4GL + path: SheerPower-4GL + url: SheerPower_4GL +Shiny: + ext: shiny + name: Shiny + path: Shiny + url: Shiny +Simula: + ext: simula + name: Simula + path: Simula + url: Simula +Sisal: + ext: sisal + name: Sisal + path: Sisal + url: Sisal +Slate: + ext: slate + name: Slate + path: Slate + url: Slate Smalltalk: ext: st name: Smalltalk path: Smalltalk url: Smalltalk +Snobol: + ext: sno + name: Snobol + path: Snobol + url: Snobol +Soar: + ext: soar + name: Soar + path: Soar + url: Soar +Squirrel: + ext: net + name: Squirrel + path: Squirrel + url: Squirrel +Standard ML: + ext: ml + name: Standard ML + path: Standard-ML + url: Standard_ML +StreamIt: + ext: streamit + name: StreamIt + path: StreamIt + url: StreamIt +Suneido: + ext: suneido + name: Suneido + path: Suneido + url: Suneido +SuperCollider: + ext: supercollider + name: SuperCollider + path: SuperCollider + url: SuperCollider +Superbase BASIC: + ext: superbase + name: Superbase BASIC + path: Superbase-BASIC + url: Superbase_BASIC +Supernova: + ext: supernova + name: Supernova + path: Supernova + url: Supernova +SystemVerilog: + ext: v + name: SystemVerilog + path: SystemVerilog + url: SystemVerilog +TAL: + ext: tal + name: TAL + path: TAL + url: TAL +TI-83 BASIC: + ext: ti-83 + name: TI-83 BASIC + path: TI-83-BASIC + url: TI-83_BASIC +TI-89 BASIC: + ext: ti-89 + name: TI-89 BASIC + path: TI-89-BASIC + url: TI-89_BASIC +TIScript: + ext: tiscript + name: TIScript + path: TIScript + url: TIScript +TPP: + ext: tpp + name: TPP + path: TPP + url: TPP +TSE SAL: + ext: tse + name: TSE SAL + path: TSE-SAL + url: TSE_SAL +TUSCRIPT: + ext: tuscript + name: TUSCRIPT + path: TUSCRIPT + url: TUSCRIPT +TXR: + ext: txr + name: TXR + path: TXR + url: TXR Tcl: ext: tcl name: Tcl path: Tcl url: Tcl +TeLa: + ext: tela + name: TeLa + path: TeLa + url: TeLa +Teco: + ext: teco + name: Teco + path: Teco + url: Teco +Thistle: + ext: thistle + name: Thistle + path: Thistle + url: Thistle +Thyrd: + ext: thyrd + name: Thyrd + path: Thyrd + url: Thyrd +Toka: + ext: toka + name: Toka + path: Toka + url: Toka +TorqueScript: + ext: torquescript + name: TorqueScript + path: TorqueScript + url: TorqueScript +Transact-SQL: + ext: sql + name: Transact-SQL + path: Transact-SQL + url: Transact-SQL +Trith: + ext: trith + name: Trith + path: Trith + url: Trith +True BASIC: + ext: 'true' + name: True BASIC + path: True-BASIC + url: True_BASIC Turing: ext: turing name: Turing path: Turing url: Turing +Twelf: + ext: twelf + name: Twelf + path: Twelf + url: Twelf +UBASIC: + ext: ubasic + name: UBASIC + path: UBASIC + url: UBASIC +UC++: + ext: ucpp + name: UC++ + path: UC++ + url: UC++ +UNIX Shell: + ext: sh + name: UNIX Shell + path: UNIX-Shell + url: UNIX_Shell +UScript: + ext: uscript + name: UScript + path: UScript + url: UScript +Unicon: + ext: unicon + name: Unicon + path: Unicon + url: Unicon +UnixPipes: + ext: unixpipes + name: UnixPipes + path: UnixPipes + url: UnixPipes +Unlambda: + ext: unlambda + name: Unlambda + path: Unlambda + url: Unlambda +Ursala: + ext: ursala + name: Ursala + path: Ursala + url: Ursala +UserRPL: + ext: rpl + name: UserRPL + path: UserRPL + url: UserRPL +V: + ext: v + name: V + path: V + url: V +VB6: + ext: vb6 + name: VB6 + path: VB6 + url: VB6 +VBA: + ext: vba + name: VBA + path: VBA + url: VBA +VBScript: + ext: vbscript + name: VBScript + path: VBScript + url: VBScript +VHDL: + ext: vhdl + name: VHDL + path: VHDL + url: VHDL +VRML: + ext: vrml + name: VRML + path: VRML + url: VRML +Vala: + ext: vala + name: Vala + path: Vala + url: Vala +Vedit macro language: + ext: vedit + name: Vedit macro language + path: Vedit-macro-language + url: Vedit_macro_language +Verilog: + ext: v + name: Verilog + path: Verilog + url: Verilog +Vim Script: + ext: vim + name: Vim Script + path: Vim-Script + url: Vim_Script +Visual Basic: + ext: vb + name: Visual Basic + path: Visual-Basic + url: Visual_Basic +Visual Basic .NET: + ext: visual + name: Visual Basic .NET + path: Visual-Basic-.NET + url: Visual_Basic_.NET +Visual Objects: + ext: vobj + name: Visual Objects + path: Visual-Objects + url: Visual_Objects +Visual Prolog: + ext: pro + name: Visual Prolog + path: Visual-Prolog + url: Visual_Prolog +Vorpal: + ext: vorpal + name: Vorpal + path: Vorpal + url: Vorpal +Vox: + ext: vox + name: Vox + path: Vox + url: Vox +WML: + ext: wml + name: WML + path: WML + url: WML +Whenever: + ext: whenever + name: Whenever + path: Whenever + url: Whenever +Whitespace: + ext: ws + name: Whitespace + path: Whitespace + url: Whitespace +Wrapl: + ext: wrapl + name: Wrapl + path: Wrapl + url: Wrapl +X10: + ext: x10 + name: X10 + path: X10 + url: X10 +X86 Assembly: + ext: x86 + name: X86 Assembly + path: X86-Assembly + url: X86_Assembly +XBase: + ext: xbase + name: XBase + path: XBase + url: XBase +XL: + ext: xl + name: XL + path: XL + url: XL +XPL0: + ext: xpl0 + name: XPL0 + path: XPL0 + url: XPL0 +XProc: + ext: xproc + name: XProc + path: XProc + url: XProc +XQuery: + ext: xquery + name: XQuery + path: XQuery + url: XQuery +XS: + ext: xs + name: XS + path: XS + url: XS +XSLT: + ext: xslt + name: XSLT + path: XSLT + url: XSLT +XSLT 1.0: + ext: xslt + name: XSLT 1.0 + path: XSLT-1.0 + url: XSLT_1.0 +XSLT 2.0: + ext: xslt + name: XSLT 2.0 + path: XSLT-2.0 + url: XSLT_2.0 +XTalk: + ext: xtalk + name: XTalk + path: XTalk + url: XTalk +XUL: + ext: xul + name: XUL + path: XUL + url: XUL +Xanadu: + ext: xanadu + name: Xanadu + path: Xanadu + url: Xanadu +Yacas: + ext: yacas + name: Yacas + path: Yacas + url: Yacas +Yorick: + ext: yorick + name: Yorick + path: Yorick + url: Yorick +Z80 Assembly: + ext: z80 + name: Z80 Assembly + path: Z80-Assembly + url: Z80_Assembly +ZED: + ext: zed + name: ZED + path: ZED + url: ZED +ZPL: + ext: zpl + name: ZPL + path: ZPL + url: ZPL +ZX Spectrum Basic: + ext: zx + name: ZX Spectrum Basic + path: ZX-Spectrum-Basic + url: ZX_Spectrum_Basic +Zonnon: + ext: zonnon + name: Zonnon + path: Zonnon + url: Zonnon diff --git a/Task/100-doors/BASIC/100-doors-1.bas b/Task/100-doors/BASIC/100-doors-1.basic similarity index 100% rename from Task/100-doors/BASIC/100-doors-1.bas rename to Task/100-doors/BASIC/100-doors-1.basic diff --git a/Task/100-doors/BASIC/100-doors-2.bas b/Task/100-doors/BASIC/100-doors-2.basic similarity index 100% rename from Task/100-doors/BASIC/100-doors-2.bas rename to Task/100-doors/BASIC/100-doors-2.basic diff --git a/Task/100-doors/BASIC/100-doors-3.bas b/Task/100-doors/BASIC/100-doors-3.basic similarity index 100% rename from Task/100-doors/BASIC/100-doors-3.bas rename to Task/100-doors/BASIC/100-doors-3.basic diff --git a/Task/100-doors/CoffeeScript/100-doors-1.coffee b/Task/100-doors/CoffeeScript/100-doors-1.coffeescript similarity index 100% rename from Task/100-doors/CoffeeScript/100-doors-1.coffee rename to Task/100-doors/CoffeeScript/100-doors-1.coffeescript diff --git a/Task/100-doors/CoffeeScript/100-doors-2.coffee b/Task/100-doors/CoffeeScript/100-doors-2.coffeescript similarity index 100% rename from Task/100-doors/CoffeeScript/100-doors-2.coffee rename to Task/100-doors/CoffeeScript/100-doors-2.coffeescript diff --git a/Task/100-doors/CoffeeScript/100-doors-3.coffee b/Task/100-doors/CoffeeScript/100-doors-3.coffeescript similarity index 100% rename from Task/100-doors/CoffeeScript/100-doors-3.coffee rename to Task/100-doors/CoffeeScript/100-doors-3.coffeescript diff --git a/Task/100-doors/Golfscript/100-doors-1.golf b/Task/100-doors/Golfscript/100-doors-1.golfscript similarity index 100% rename from Task/100-doors/Golfscript/100-doors-1.golf rename to Task/100-doors/Golfscript/100-doors-1.golfscript diff --git a/Task/100-doors/Golfscript/100-doors-2.golf b/Task/100-doors/Golfscript/100-doors-2.golfscript similarity index 100% rename from Task/100-doors/Golfscript/100-doors-2.golf rename to Task/100-doors/Golfscript/100-doors-2.golfscript diff --git a/Task/100-doors/Golfscript/100-doors-3.golf b/Task/100-doors/Golfscript/100-doors-3.golfscript similarity index 100% rename from Task/100-doors/Golfscript/100-doors-3.golf rename to Task/100-doors/Golfscript/100-doors-3.golfscript diff --git a/Task/100-doors/MAXScript/100-doors-1.max b/Task/100-doors/MAXScript/100-doors-1.maxscript similarity index 100% rename from Task/100-doors/MAXScript/100-doors-1.max rename to Task/100-doors/MAXScript/100-doors-1.maxscript diff --git a/Task/100-doors/MAXScript/100-doors-2.max b/Task/100-doors/MAXScript/100-doors-2.maxscript similarity index 100% rename from Task/100-doors/MAXScript/100-doors-2.max rename to Task/100-doors/MAXScript/100-doors-2.maxscript diff --git a/Task/100-doors/Mathematica/100-doors-1.mathematica b/Task/100-doors/Mathematica/100-doors-1.math similarity index 100% rename from Task/100-doors/Mathematica/100-doors-1.mathematica rename to Task/100-doors/Mathematica/100-doors-1.math diff --git a/Task/100-doors/Mathematica/100-doors-2.mathematica b/Task/100-doors/Mathematica/100-doors-2.math similarity index 100% rename from Task/100-doors/Mathematica/100-doors-2.mathematica rename to Task/100-doors/Mathematica/100-doors-2.math diff --git a/Task/100-doors/Mathematica/100-doors-3.mathematica b/Task/100-doors/Mathematica/100-doors-3.math similarity index 100% rename from Task/100-doors/Mathematica/100-doors-3.mathematica rename to Task/100-doors/Mathematica/100-doors-3.math diff --git a/Task/100-doors/Mathematica/100-doors-4.mathematica b/Task/100-doors/Mathematica/100-doors-4.math similarity index 100% rename from Task/100-doors/Mathematica/100-doors-4.mathematica rename to Task/100-doors/Mathematica/100-doors-4.math diff --git a/Task/100-doors/Mathematica/100-doors-5.mathematica b/Task/100-doors/Mathematica/100-doors-5.math similarity index 100% rename from Task/100-doors/Mathematica/100-doors-5.mathematica rename to Task/100-doors/Mathematica/100-doors-5.math diff --git a/Task/100-doors/Mathematica/100-doors-6.mathematica b/Task/100-doors/Mathematica/100-doors-6.math similarity index 100% rename from Task/100-doors/Mathematica/100-doors-6.mathematica rename to Task/100-doors/Mathematica/100-doors-6.math diff --git a/Task/100-doors/NetRexx/100-doors-1.netrexx b/Task/100-doors/NetRexx/100-doors-1.netrexx new file mode 100644 index 0000000000..b70175888a --- /dev/null +++ b/Task/100-doors/NetRexx/100-doors-1.netrexx @@ -0,0 +1,20 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols binary + +True = Rexx(1 == 1) +False = Rexx(\True) + +doors = False + +loop i_ = 1 to 100 + loop j_ = 1 to 100 + if 0 = (j_ // i_) then doors[j_] = \doors[j_] + end j_ + end i_ + +loop d_ = 1 to 100 + if doors[d_] then state = 'open' + else state = 'closed' + + say 'Door Nr.' Rexx(d_).right(4) 'is' state + end d_ diff --git a/Task/100-doors/NetRexx/100-doors-2.netrexx b/Task/100-doors/NetRexx/100-doors-2.netrexx new file mode 100644 index 0000000000..6cf57a1565 --- /dev/null +++ b/Task/100-doors/NetRexx/100-doors-2.netrexx @@ -0,0 +1,18 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols binary + +True = (1 == 1) +False = \True + +doors = boolean[100] + +loop i_ = 0 to 9 + doors[(i_ + 1) * (i_ + 1) - 1] = True; + end i_ + +loop i_ = 0 to 99 + if doors[i_] then state = 'open' + else state = 'closed' + + say 'Door Nr.' Rexx(i_ + 1).right(4) 'is' state + end i_ diff --git a/Task/100-doors/NetRexx/100-doors-3.netrexx b/Task/100-doors/NetRexx/100-doors-3.netrexx new file mode 100644 index 0000000000..fb4ee13218 --- /dev/null +++ b/Task/100-doors/NetRexx/100-doors-3.netrexx @@ -0,0 +1,10 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols binary + +resultstring = '' + +loop i_ = 1 to 10 + resultstring = resultstring || 'Door Nr.' Rexx(i_ * i_).right(4) 'is open\n' + end i_ + +say resultstring diff --git a/Task/100-doors/NetRexx/100-doors-4.netrexx b/Task/100-doors/NetRexx/100-doors-4.netrexx new file mode 100644 index 0000000000..ec91139d63 --- /dev/null +++ b/Task/100-doors/NetRexx/100-doors-4.netrexx @@ -0,0 +1,5 @@ +/* NetRexx */ + +loop i = 1 to 10 + say 'Door Nr.' i * i 'is open.' + end i diff --git a/Task/100-doors/OCaml/100-doors-1.ocaml b/Task/100-doors/OCaml/100-doors-1.ocaml new file mode 100644 index 0000000000..8d38b72019 --- /dev/null +++ b/Task/100-doors/OCaml/100-doors-1.ocaml @@ -0,0 +1,19 @@ +let max_doors = 100 + +let show_doors = + Array.iteri (fun i x -> Printf.printf "Door %d is %s\n" (i+1) + (if x then "open" else "closed")) + +let flip_doors doors = + for i = 1 to max_doors do + let rec flip idx = + if idx < max_doors then begin + doors.(idx) <- not doors.(idx); + flip (idx + i) + end + in flip (i - 1) + done; + doors + +let () = + show_doors (flip_doors (Array.make max_doors false)) diff --git a/Task/100-doors/OCaml/100-doors-2.ocaml b/Task/100-doors/OCaml/100-doors-2.ocaml new file mode 100644 index 0000000000..052361adb8 --- /dev/null +++ b/Task/100-doors/OCaml/100-doors-2.ocaml @@ -0,0 +1,8 @@ +let optimised_flip_doors doors = + for i = 1 to int_of_float (sqrt (float_of_int max_doors)) do + doors.(i*i - 1) <- true + done; + doors + +let () = + show_doors (optimised_flip_doors (Array.make max_doors false)) diff --git a/Task/100-doors/Objeck/100-doors.objeck b/Task/100-doors/Objeck/100-doors.objeck new file mode 100644 index 0000000000..51d175f7df --- /dev/null +++ b/Task/100-doors/Objeck/100-doors.objeck @@ -0,0 +1,21 @@ +bundle Default { + class Doors { + function : Main(args : String[]) ~ Nil { + doors := Bool->New[100]; + + for(pass := 0; pass < 10; pass += 1;) { + doors[(pass + 1) * (pass + 1) - 1] := true; + }; + + for(i := 0; i < 100; i += 1;) { + IO.Console->GetInstance()->Print("Door #")->Print(i + 1)->Print(" is "); + if(doors[i]) { + "open."->PrintLine(); + } + else { + "closed."->PrintLine(); + }; + }; + } + } +} diff --git a/Task/100-doors/Octave/100-doors.octave b/Task/100-doors/Octave/100-doors.octave new file mode 100644 index 0000000000..01bb2f4d6c --- /dev/null +++ b/Task/100-doors/Octave/100-doors.octave @@ -0,0 +1,14 @@ +doors = false(100,1); +for i = 1:100 + for j = i:i:100 + doors(j) = !doors(j); + endfor +endfor +for i = 1:100 + if ( doors(i) ) + s = "open"; + else + s = "closed"; + endif + printf("%d %s\n", i, s); +endfor diff --git a/Task/100-doors/OpenEdge-Progress/100-doors.openedge b/Task/100-doors/OpenEdge-Progress/100-doors.openedge new file mode 100644 index 0000000000..fecfd41b78 --- /dev/null +++ b/Task/100-doors/OpenEdge-Progress/100-doors.openedge @@ -0,0 +1,21 @@ +DEFINE VARIABLE lopen AS LOGICAL NO-UNDO EXTENT 100. +DEFINE VARIABLE idoor AS INTEGER NO-UNDO. +DEFINE VARIABLE ipass AS INTEGER NO-UNDO. +DEFINE VARIABLE cresult AS CHARACTER NO-UNDO. + +DO ipass = 1 TO 100: + idoor = 0. + DO WHILE idoor <= 100: + idoor = idoor + ipass. + IF idoor <= 100 THEN + lopen[ idoor ] = NOT lopen[ idoor ]. + END. +END. + +DO idoor = 1 TO 100: + cresult = cresult + STRING( lopen[ idoor ], "1 /0 " ). + IF idoor MODULO 10 = 0 THEN + cresult = cresult + "~r":U. +END. + +MESSAGE cresult VIEW-AS ALERT-BOX. diff --git a/Task/100-doors/Oz/100-doors.oz b/Task/100-doors/Oz/100-doors.oz new file mode 100644 index 0000000000..1ed2c3d369 --- /dev/null +++ b/Task/100-doors/Oz/100-doors.oz @@ -0,0 +1,34 @@ +declare + NumDoors = 100 + NumPasses = 100 + + fun {NewDoor} closed end + + fun {Toggle Door} + case Door of closed then open + [] open then closed + end + end + + fun {Pass Doors I} + {List.mapInd Doors + fun {$ Index Door} + if Index mod I == 0 then {Toggle Door} + else Door + end + end} + end + + Doors0 = {MakeList NumDoors} + {ForAll Doors0 NewDoor} + + DoorsN = {FoldL {List.number 1 NumPasses 1} Pass Doors0} +in + %% print open doors + {List.forAllInd DoorsN + proc {$ Index Door} + if Door == open then + {System.showInfo "Door "#Index#" is open."} + end + end + } diff --git a/Task/100-doors/PARI-GP/100-doors-1.pari b/Task/100-doors/PARI-GP/100-doors-1.pari new file mode 100644 index 0000000000..5709e10997 --- /dev/null +++ b/Task/100-doors/PARI-GP/100-doors-1.pari @@ -0,0 +1,3 @@ +v=vector(d=100);/*set 100 closed doors*/ +for(i=1,d,forstep(j=i,d,i,v[j]=1-v[j])); +for(i=1,d,if(v[i],print("Door ",i," is open."))) diff --git a/Task/100-doors/PARI-GP/100-doors-2.pari b/Task/100-doors/PARI-GP/100-doors-2.pari new file mode 100644 index 0000000000..f1087ac981 --- /dev/null +++ b/Task/100-doors/PARI-GP/100-doors-2.pari @@ -0,0 +1 @@ +for(n=1,sqrt(100),print("Door ",n^2," is open.")) diff --git a/Task/100-doors/PL-I/100-doors.pli b/Task/100-doors/PL-I/100-doors.pli new file mode 100644 index 0000000000..63b822d99a --- /dev/null +++ b/Task/100-doors/PL-I/100-doors.pli @@ -0,0 +1,19 @@ +declare door(100) bit (1) aligned; +declare closed bit (1) static initial ('0'b), + open bit (1) static initial ('1'b); +declare (i, inc) fixed binary; + +door = closed; +inc = 1; +do until (inc >= 100); + do i = inc to 100 by inc; + door(i) = ^door(i); /* close door if open; open it if closed. */ + end; + inc = inc+1; +end; + +do i = 1 to 100; + put skip edit ('Door ', trim(i), ' is ') (a); + if door(i) then put edit (' open.') (a); + else put edit (' closed.') (a); +end; diff --git a/Task/100-doors/Pascal/100-doors-1.pascal b/Task/100-doors/Pascal/100-doors-1.pascal new file mode 100644 index 0000000000..4e4a915df8 --- /dev/null +++ b/Task/100-doors/Pascal/100-doors-1.pascal @@ -0,0 +1,24 @@ +Program OneHundredDoors; + +var + doors : Array[1..100] of Boolean; + i, j : Integer; + +begin + for i := 1 to 100 do + doors[i] := False; + for i := 1 to 100 do begin + j := i; + while j <= 100 do begin + doors[j] := not doors[j]; + j := j + i + end + end; + for i := 1 to 100 do begin + Write(i, ' '); + if doors[i] then + WriteLn('open') + else + WriteLn('closed'); + end +end. diff --git a/Task/100-doors/Pascal/100-doors-2.pascal b/Task/100-doors/Pascal/100-doors-2.pascal new file mode 100644 index 0000000000..294428c8ea --- /dev/null +++ b/Task/100-doors/Pascal/100-doors-2.pascal @@ -0,0 +1,24 @@ +program OneHundredDoors; + +{$APPTYPE CONSOLE} + +uses + math, sysutils; + +var + AOpendoors : String; + ACloseDoors : String; + i : Integer; + +begin + for i := 1 to 100 do + begin + if (sqrt(i) = floor(sqrt(i))) then + AOpenDoors := AOpenDoors + IntToStr(i) + ';' + else + ACloseDoors := ACloseDoors + IntToStr(i) +';'; + end; + + WriteLn('Open doors: ' + AOpenDoors); + WriteLn('Close doors: ' + ACloseDoors); +end. diff --git a/Task/100-doors/Perl-6/100-doors-1.pl6 b/Task/100-doors/Perl-6/100-doors-1.pl6 new file mode 100644 index 0000000000..39431637ce --- /dev/null +++ b/Task/100-doors/Perl-6/100-doors-1.pl6 @@ -0,0 +1,5 @@ +my @doors = False xx 101; + +($_ = !$_ for @doors[0, * + $_ ...^ * > 100]) for 1..100; + +say "Door $_ is ", [ @doors[$_] ] for 1..100; diff --git a/Task/100-doors/Perl-6/100-doors-2.pl6 b/Task/100-doors/Perl-6/100-doors-2.pl6 new file mode 100644 index 0000000000..4e9f931152 --- /dev/null +++ b/Task/100-doors/Perl-6/100-doors-2.pl6 @@ -0,0 +1 @@ +say "Door $_ is open" for map {$^n ** 2}, 1..10; diff --git a/Task/100-doors/Perl-6/100-doors-3.pl6 b/Task/100-doors/Perl-6/100-doors-3.pl6 new file mode 100644 index 0000000000..b0b47a8762 --- /dev/null +++ b/Task/100-doors/Perl-6/100-doors-3.pl6 @@ -0,0 +1 @@ + say "Door $_ is open" for 1..10 X** 2; diff --git a/Task/100-doors/Perl-6/100-doors-4.pl6 b/Task/100-doors/Perl-6/100-doors-4.pl6 new file mode 100644 index 0000000000..820f5459cd --- /dev/null +++ b/Task/100-doors/Perl-6/100-doors-4.pl6 @@ -0,0 +1 @@ +say "Door $_ is ", [.sqrt == .sqrt.floor] for 1..100; diff --git a/Task/100-doors/Pike/100-doors-1.pike b/Task/100-doors/Pike/100-doors-1.pike new file mode 100644 index 0000000000..835483990c --- /dev/null +++ b/Task/100-doors/Pike/100-doors-1.pike @@ -0,0 +1,8 @@ +array onehundreddoors() +{ + array doors = allocate(100); + foreach(doors; int i;) + for(int j=i; j<100; j+=i+1) + doors[j] = !doors[j]; + return doors; +} diff --git a/Task/100-doors/Pike/100-doors-2.pike b/Task/100-doors/Pike/100-doors-2.pike new file mode 100644 index 0000000000..bd8cb9e4ff --- /dev/null +++ b/Task/100-doors/Pike/100-doors-2.pike @@ -0,0 +1,4 @@ +array doors = map(enumerate(100,1,1), lambda(int x) + { + return sqrt((float)x)%1 == 0.0; + }); diff --git a/Task/100-doors/Pike/100-doors-3.pike b/Task/100-doors/Pike/100-doors-3.pike new file mode 100644 index 0000000000..f261993927 --- /dev/null +++ b/Task/100-doors/Pike/100-doors-3.pike @@ -0,0 +1 @@ +write("%{%d %d %d %d %d %d %d %d %d %d\n%}\n", doors/10) diff --git a/Task/100-doors/Pop11/100-doors-1.pop11 b/Task/100-doors/Pop11/100-doors-1.pop11 new file mode 100644 index 0000000000..aabf912696 --- /dev/null +++ b/Task/100-doors/Pop11/100-doors-1.pop11 @@ -0,0 +1,12 @@ +lvars i; +lvars doors = {% for i from 1 to 100 do false endfor %}; +for i from 1 to 100 do + for j from i by i to 100 do + not(doors(j)) -> doors(j); + endfor; +endfor; +;;; Print state +for i from 1 to 100 do + printf('Door ' >< i >< ' is ' >< + if doors(i) then 'open' else 'closed' endif, '%s\n'); +endfor; diff --git a/Task/100-doors/Pop11/100-doors-2.pop11 b/Task/100-doors/Pop11/100-doors-2.pop11 new file mode 100644 index 0000000000..843689cc3a --- /dev/null +++ b/Task/100-doors/Pop11/100-doors-2.pop11 @@ -0,0 +1,4 @@ +for i to 100 do + lvars root = sqrt(i); + i; if root = round(root) then ' open' ><; else ' closed' ><; endif; => +endfor; diff --git a/Task/100-doors/PostScript/100-doors-1.ps b/Task/100-doors/PostScript/100-doors-1.ps new file mode 100644 index 0000000000..47fd165a3d --- /dev/null +++ b/Task/100-doors/PostScript/100-doors-1.ps @@ -0,0 +1,6 @@ +/doors [ 100 { false } repeat ] def + +1 1 100 { dup 1 sub exch 99 { + dup doors exch get not doors 3 1 roll put +} for } for +doors pstack diff --git a/Task/100-doors/PostScript/100-doors-2.ps b/Task/100-doors/PostScript/100-doors-2.ps new file mode 100644 index 0000000000..60f7a5c05c --- /dev/null +++ b/Task/100-doors/PostScript/100-doors-2.ps @@ -0,0 +1 @@ +[true false false true false false false false true false ...<90 doors later>... true] diff --git a/Task/100-doors/PowerShell/100-doors-1.psh b/Task/100-doors/PowerShell/100-doors-1.psh new file mode 100644 index 0000000000..816268d1b7 --- /dev/null +++ b/Task/100-doors/PowerShell/100-doors-1.psh @@ -0,0 +1,14 @@ +$doors = @(0..99) +for($i=0; $i -lt 100; $i++) { + $doors[$i] = 0 # start with all doors closed +} +for($i=0; $i -lt 100; $i++) { + $step = $i + 1 + for($j=$i; $j -lt 100; $j = $j + $step) { + $doors[$j] = $doors[$j] -bxor 1 + } +} +foreach($doornum in 1..100) { + if($doors[($doornum-1)] -eq $true) {"$doornum open"} + else {"$doornum closed"} +} diff --git a/Task/100-doors/PowerShell/100-doors-2.psh b/Task/100-doors/PowerShell/100-doors-2.psh new file mode 100644 index 0000000000..acc1a5f397 --- /dev/null +++ b/Task/100-doors/PowerShell/100-doors-2.psh @@ -0,0 +1,2 @@ +$doors = 1..100 | ForEach-Object {0} +1..100 | ForEach-Object { $a=$_;1..100 | Where-Object { -not ( $_ % $a ) } | ForEach-Object { $doors[$_-1] = $doors[$_-1] -bxor 1 }; if ( $doors[$a-1] ) { "door opened" } else { "door closed" } } diff --git a/Task/100-doors/PowerShell/100-doors-3.psh b/Task/100-doors/PowerShell/100-doors-3.psh new file mode 100644 index 0000000000..c7903f1a70 --- /dev/null +++ b/Task/100-doors/PowerShell/100-doors-3.psh @@ -0,0 +1,3 @@ +$doors = 1..100 | ForEach-Object {0} +$visited = 1..100 +1..100 | ForEach-Object { $a=$_;$visited[0..([math]::floor(100/$a)-1)] | Where-Object { -not ( $_ % $a ) } | ForEach-Object { $doors[$_-1] = $doors[$_-1] -bxor 1;$visited[$_/$a-1]+=($_/$a) }; if ( $doors[$a-1] ) { "door opened" } else { "door closed" } } diff --git a/Task/100-doors/ProDOS/100-doors.dos b/Task/100-doors/ProDOS/100-doors.dos new file mode 100644 index 0000000000..ff2c2b3dbb --- /dev/null +++ b/Task/100-doors/ProDOS/100-doors.dos @@ -0,0 +1,13 @@ +enableextensions +enabledelayedexpansion +editvar /newvar /value=0 /title=closed +editvar /newvar /value=1 /title=open +editvar /newvar /range=1-100 /increment=1 /from=2 +editvar /newvar /value=2 /title=next +:doors +for /alloccurrences (!next!-!102!) do editvar /modify /value=-open- +editvar /modify /value=-next-=+1 +if -next- /hasvalue=100 goto :cont else goto :doors +:cont +printline !1!-!102! +stoptask diff --git a/Task/100-doors/PureBasic/100-doors-1.purebasic b/Task/100-doors/PureBasic/100-doors-1.purebasic new file mode 100644 index 0000000000..41185524b6 --- /dev/null +++ b/Task/100-doors/PureBasic/100-doors-1.purebasic @@ -0,0 +1,18 @@ +Dim doors.i(100) + +For x = 1 To 100 + y = x + While y <= 100 + doors(y) = 1 - doors(y) + y + x + Wend +Next + +OpenConsole() +PrintN("Following Doors are open:") +For x = 1 To 100 + If doors(x) + Print(Str(x) + ", ") + EndIf +Next +Input() diff --git a/Task/100-doors/PureBasic/100-doors-2.purebasic b/Task/100-doors/PureBasic/100-doors-2.purebasic new file mode 100644 index 0000000000..909dc839c1 --- /dev/null +++ b/Task/100-doors/PureBasic/100-doors-2.purebasic @@ -0,0 +1,9 @@ +OpenConsole() +PrintN("Following Doors are open:") +For i = 1 To 100 + root.f = Sqr(i) + If root = Int(root) + Print (Str(i) + ", ") + EndIf +Next +Input() diff --git a/Task/100-doors/Q/100-doors-1.q b/Task/100-doors/Q/100-doors-1.q new file mode 100644 index 0000000000..7c26ae5dac --- /dev/null +++ b/Task/100-doors/Q/100-doors-1.q @@ -0,0 +1 @@ +`closed`open mod[;2]count each 1 _ group raze where each 0=t mod\:/:t:til 101 diff --git a/Task/100-doors/Q/100-doors-2.q b/Task/100-doors/Q/100-doors-2.q new file mode 100644 index 0000000000..ab05fb278a --- /dev/null +++ b/Task/100-doors/Q/100-doors-2.q @@ -0,0 +1 @@ +`closed`open (1+til 100) in `int$xexp[;2] 1+til 10 diff --git a/Task/100-doors/REALbasic/100-doors.realbasic b/Task/100-doors/REALbasic/100-doors.realbasic new file mode 100644 index 0000000000..a74b71738a --- /dev/null +++ b/Task/100-doors/REALbasic/100-doors.realbasic @@ -0,0 +1,7 @@ +'True=Open; False=Closed + Dim doors(100) As Boolean 'Booleans default to false + For j As Integer = 1 To 100 + For i As Integer = 1 to 100 + If i Mod j = 0 Then doors(i) = Not doors(i) + Next + Next diff --git a/Task/100-doors/REBOL/100-doors-1.rebol b/Task/100-doors/REBOL/100-doors-1.rebol new file mode 100644 index 0000000000..aa422858bd --- /dev/null +++ b/Task/100-doors/REBOL/100-doors-1.rebol @@ -0,0 +1,5 @@ +doors: array/initial 100 'closed +repeat i 100 [ + door: at doors i + forskip door i [change door either 'open = first door ['closed] ['open]] +] diff --git a/Task/100-doors/REBOL/100-doors-2.rebol b/Task/100-doors/REBOL/100-doors-2.rebol new file mode 100644 index 0000000000..73f1f448f3 --- /dev/null +++ b/Task/100-doors/REBOL/100-doors-2.rebol @@ -0,0 +1,2 @@ +doors: array/initial 100 'closed +repeat i 10 [doors/(i * i): 'open] diff --git a/Task/100-doors/Retro/100-doors.retro b/Task/100-doors/Retro/100-doors.retro new file mode 100644 index 0000000000..a3c29ee33f --- /dev/null +++ b/Task/100-doors/Retro/100-doors.retro @@ -0,0 +1,3 @@ +: squared ( n-n ) dup * ; +: doors ( n- ) [ 1 repeat 2over squared > 0; drop dup squared putn space 1+ again ] do 2drop ; +100 doors diff --git a/Task/100-doors/Run-BASIC/100-doors.run b/Task/100-doors/Run-BASIC/100-doors.run new file mode 100644 index 0000000000..28a07e76f7 --- /dev/null +++ b/Task/100-doors/Run-BASIC/100-doors.run @@ -0,0 +1,8 @@ +dim doors(100) +print "Open doors "; +for i = 1 to 100 + for door = i to 100 step i + doors(door) = (doors(door) <> 1) + if i = door and doors(door) = 1 then print i;" "; + next door +next i diff --git a/Task/100-doors/Rust/100-doors.rust b/Task/100-doors/Rust/100-doors.rust new file mode 100644 index 0000000000..714291be07 --- /dev/null +++ b/Task/100-doors/Rust/100-doors.rust @@ -0,0 +1,15 @@ +fn main() { + let mut door_open = [false, ..100]; + + for uint::range(1, 101) |pass| { + for uint::range(1, 101) |door| { + if door % pass == 0 { + door_open[door - 1] = !door_open[door - 1] + } + }; + } + for door_open.eachi |i, state| { + io::println(fmt!("Door %u is %s.", i + 1, + if *state { "open" } else { "closed" })); + } +} diff --git a/Task/100-doors/S-lang/100-doors.slang b/Task/100-doors/S-lang/100-doors.slang new file mode 100644 index 0000000000..81e048d6fa --- /dev/null +++ b/Task/100-doors/S-lang/100-doors.slang @@ -0,0 +1,21 @@ +variable door, + isOpen = Char_Type [101], + pass; + +for (door = 1; door <= 100; door++) { + isOpen[door] = 0; +} + +for (pass = 1; pass <= 100; pass++) { + for (door = pass; door <= 100; door += pass) { + isOpen[door] = not isOpen[door]; + } +} + +for (door = 1; door <= 100; door++) { + if (isOpen[door]) { + print("Door " + string(door) + ":open"); + } else { + print("Door " + string(door) + ":close"); + } +} diff --git a/Task/100-doors/SAS/100-doors.sas b/Task/100-doors/SAS/100-doors.sas new file mode 100644 index 0000000000..76b4e7e88f --- /dev/null +++ b/Task/100-doors/SAS/100-doors.sas @@ -0,0 +1,14 @@ +data _null_; + open=1; + close=0; + array Door{100}; + do Pass = 1 to 100; + do Current = Pass to 100 by Pass; + if Door{Current} ne open + then Door{Current} = open; + else Door{Current} = close; + end; + end; + NumberOfOpenDoors = sum(of Door{*}); + put "Number of Open Doors: " NumberOfOpenDoors; +run; diff --git a/Task/100-doors/SETL/100-doors-1.setl b/Task/100-doors/SETL/100-doors-1.setl new file mode 100644 index 0000000000..a91348aca6 --- /dev/null +++ b/Task/100-doors/SETL/100-doors-1.setl @@ -0,0 +1,18 @@ +program hundred_doors; + +const toggle := {['open', 'closed'], ['closed', 'open']}; + +doorStates := ['closed'] * 100; + +(for interval in [1..100]) + doorStates := [if i mod interval = 0 then + toggle(prevState) else + prevState end: + prevState = doorStates(i)]; +end; + +(for finalState = doorStates(i)) + print('door', i, 'is', finalState); +end; + +end program; diff --git a/Task/100-doors/SETL/100-doors-2.setl b/Task/100-doors/SETL/100-doors-2.setl new file mode 100644 index 0000000000..a65c56504c --- /dev/null +++ b/Task/100-doors/SETL/100-doors-2.setl @@ -0,0 +1,9 @@ +program hundred_doors; + +doorStates := (+/ [['closed'] * oddNum with 'open': oddNum in [1,3..17]]); + +(for finalState = doorStates(i)) + print('door', i, 'is', finalState); +end; + +end program; diff --git a/Task/100-doors/SNOBOL4/100-doors-1.sno b/Task/100-doors/SNOBOL4/100-doors-1.sno new file mode 100644 index 0000000000..7bedc4b298 --- /dev/null +++ b/Task/100-doors/SNOBOL4/100-doors-1.sno @@ -0,0 +1,20 @@ + DEFINE('PASS(A,I),O') :(PASS.END) +PASS O = 0 +PASS.LOOP O = O + I + EQ(A,1) :S(PASS.1)F(PASS.0) +PASS.0 A = 1 :S(PASS.LOOP)F(RETURN) +PASS.1 A = 0 :S(PASS.LOOP)F(RETURN) +PASS.END + +MAIN D = ARRAY(100,0) + I = 0 + +MAIN.LOOP I = LE(I,100) I + 1 :F(OUTPUT) + PASS(D,I) :(MAIN.LOOP) + +OUTPUT I = 1 ; OPEN = 'Opened doors are: ' +OUTPUT.LOOP OPEN = OPEN EQ(D,1) " " I + I = LE(I,100) I + 1 :S(OUTPUT.LOOP)F(OUTPUT.WRITE) +OUTPUT.WRITE OUTPUT = OPEN + +END diff --git a/Task/100-doors/SNOBOL4/100-doors-2.sno b/Task/100-doors/SNOBOL4/100-doors-2.sno new file mode 100644 index 0000000000..d493369e0b --- /dev/null +++ b/Task/100-doors/SNOBOL4/100-doors-2.sno @@ -0,0 +1,12 @@ +MAIN D = ARRAY(100,0) + I = 1 + +MAIN.LOOP LE(I, 10) :F(OUTPUT) + D = 1 + I = I + 1 :(MAIN.LOOP) + +OUTPUT I = 1 ; O = 'Opened doors are: ' +OUTPUT.LOOP O = O EQ(D,1) " " I + I = LE(I,100) I + 1 :S(OUTPUT.LOOP)F(OUTPUT.WRITE) +OUTPUT.WRITE OUTPUT = O +END diff --git a/Task/100-doors/Salmon/100-doors-1.salmon b/Task/100-doors/Salmon/100-doors-1.salmon new file mode 100644 index 0000000000..d4402a8fdb --- /dev/null +++ b/Task/100-doors/Salmon/100-doors-1.salmon @@ -0,0 +1,7 @@ +variable open := <<(* --> false)>>; +for (pass; 1; pass <= 100) + for (door_num; pass; door_num <= 100; pass) + open[door_num] := !(open[door_num]);;; +iterate (door_num; [1...100]) + print("Door ", door_num, " is ", + (open[door_num] ? "open.\n" : "closed.\n"));; diff --git a/Task/100-doors/Salmon/100-doors-2.salmon b/Task/100-doors/Salmon/100-doors-2.salmon new file mode 100644 index 0000000000..ee0860265c --- /dev/null +++ b/Task/100-doors/Salmon/100-doors-2.salmon @@ -0,0 +1 @@ +iterate (x; [1...10]) { iterate (y; [(x-1)*(x-1)+1...x*x-1]) { print("Door ", y, " is closed.\n"); }; print("Door ", x*x, " is open.\n"); }; diff --git a/Task/100-doors/Salmon/100-doors-3.salmon b/Task/100-doors/Salmon/100-doors-3.salmon new file mode 100644 index 0000000000..503cf23fc4 --- /dev/null +++ b/Task/100-doors/Salmon/100-doors-3.salmon @@ -0,0 +1 @@ +variable y:=1;for(x;1;x<101)"Door "~sprint(x)~" is "~(x==y*y?{++y;return"open";}:"closed")!; diff --git a/Task/100-doors/Seed7/100-doors-1.seed7 b/Task/100-doors/Seed7/100-doors-1.seed7 new file mode 100644 index 0000000000..bb649e6e0e --- /dev/null +++ b/Task/100-doors/Seed7/100-doors-1.seed7 @@ -0,0 +1,23 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var array boolean: doorOpen is 100 times FALSE; + var integer: pass is 0; + var integer: index is 0; + var array[boolean] string: closedOrOpen is [boolean] ("closed", "open"); + begin + for pass range 1 to 100 do + for key index range doorOpen do + if index rem pass = 0 then + doorOpen[index] := not doorOpen[index]; + end if; + end for; + end for; + for key index range doorOpen do + write(index lpad 3 <& " is " <& closedOrOpen[doorOpen[index]] rpad 7); + if index rem 5 = 0 then + writeln; + end if; + end for; + end func; diff --git a/Task/100-doors/Seed7/100-doors-2.seed7 b/Task/100-doors/Seed7/100-doors-2.seed7 new file mode 100644 index 0000000000..86f7876d0d --- /dev/null +++ b/Task/100-doors/Seed7/100-doors-2.seed7 @@ -0,0 +1,16 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: index is 0; + var integer: number is 0; + var array[boolean] string: closedOrOpen is [boolean] ("closed", "open"); + begin + for index range 1 to 100 do + number := sqrt(index); + write(index lpad 3 <& " is " <& closedOrOpen[number**2 = index] rpad 7); + if index rem 5 = 0 then + writeln; + end if; + end for; + end func; diff --git a/Task/100-doors/Slate/100-doors-1.slate b/Task/100-doors/Slate/100-doors-1.slate new file mode 100644 index 0000000000..27b049922f --- /dev/null +++ b/Task/100-doors/Slate/100-doors-1.slate @@ -0,0 +1,9 @@ +define: #a -> (Array newSize: 100). +a infect: [| :_ | False]. + +a keysDo: [| :pass | + pass to: a indexLast by: pass do: [| :door | + a at: door infect: #not `er]]. + +a keysAndValuesDo: [| :door :isOpen | + inform: 'door #' ; door ; ' is ' ; (isOpen ifTrue: ['open'] ifFalse: ['closed'])]. diff --git a/Task/100-doors/Slate/100-doors-2.slate b/Task/100-doors/Slate/100-doors-2.slate new file mode 100644 index 0000000000..5d6746b854 --- /dev/null +++ b/Task/100-doors/Slate/100-doors-2.slate @@ -0,0 +1,6 @@ +define: #a -> (Array newSize: 100). +a infect: [| :_ | False]. + +0 below: 10 do: [| :door | a at: door squared put: True]. +a keysAndValuesDo: [| :door :isOpen | + inform: 'door #' ; door ; ' is ' ; (isOpen ifTrue: ['open'] ifFalse: ['closed'])]. diff --git a/Task/100-doors/TI-83-BASIC/100-doors-1.ti-83 b/Task/100-doors/TI-83-BASIC/100-doors-1.ti-83 new file mode 100644 index 0000000000..6baddcf0be --- /dev/null +++ b/Task/100-doors/TI-83-BASIC/100-doors-1.ti-83 @@ -0,0 +1,16 @@ +PROGRAM:DOORS100 +:ClrHome +:Disp "SETTING UP LIST" +:Disp "PLEASE WAIT..." +:For(I,1,100,1) +:0→L1(I) +:End +:ClrHome +:Disp "Pass" +:For(I,1,100,1) +:For(J,I,100,I) +:Output(2,1,I) +:not(L1(J))→L1(J) +:End +:End +:ClrHome diff --git a/Task/100-doors/TI-83-BASIC/100-doors-2.ti-83 b/Task/100-doors/TI-83-BASIC/100-doors-2.ti-83 new file mode 100644 index 0000000000..9de3419c64 --- /dev/null +++ b/Task/100-doors/TI-83-BASIC/100-doors-2.ti-83 @@ -0,0 +1,4 @@ +PROGRAM:DOORSOPT +:For(I,1,100,1) +:not(fPart(√(I)))→L1(I) +:End diff --git a/Task/100-doors/TI-89-BASIC/100-doors.ti-89 b/Task/100-doors/TI-89-BASIC/100-doors.ti-89 new file mode 100644 index 0000000000..2198b934fa --- /dev/null +++ b/Task/100-doors/TI-89-BASIC/100-doors.ti-89 @@ -0,0 +1,16 @@ +Define doors(fast) = Func + Local doors,i,j + seq(false,x,1,100) → doors + If fast Then + For i,1,10,1 + true → doors[i^2] + EndFor + Else + For i,1,100,1 + For j,i,100,i + not doors[j] → doors[j] + EndFor + EndFor + EndIf + Return doors +EndFunc diff --git a/Task/100-doors/TSE-SAL/100-doors.tse b/Task/100-doors/TSE-SAL/100-doors.tse new file mode 100644 index 0000000000..53f554fd9d --- /dev/null +++ b/Task/100-doors/TSE-SAL/100-doors.tse @@ -0,0 +1,85 @@ +// library: math: get: task: door: open: close100 1.0.0.0.11 (filenamemacro=getmaocl.s) [] [] [kn, ri, mo, 31-12-2012 22:03:16] +PROC PROCMathGetTaskDoorOpenClose( INTEGER doorMaxI, INTEGER passMaxI ) + // e.g. PROC Main() + // e.g. PROCMathGetTaskDoorOpenClose( 100, 100 ) + // e.g. END + // e.g. + // e.g. Main() + // + // === + // + // The output will be: + // + // door 1 is open + // door 4 is open + // door 9 is open + // door 16 is open + // door 25 is open + // door 36 is open + // door 49 is open + // door 64 is open + // door 81 is open + // door 100 is open + // all other doors are closed + // + // === + // + INTEGER passMinI = 1 + INTEGER passI = 0 + // + INTEGER doorminI = 1 + INTEGER doorI = 0 + // + STRING s[255] = "" + // + INTEGER bufferI = 0 + // + PushPosition() + bufferI = CreateTempBuffer() + PopPosition() + // + FOR doorI = doorMinI TO doorMaxI + // + SetGlobalInt( Format( "doorsI", doorI ), 0 ) + // + ENDFOR + // + FOR passI = passMinI TO passMaxI + // + doorI = passI - passI + // + REPEAT + // + doorI = doorI + passI + // + SetGlobalInt( Format( "doorsI", doorI ), NOT( GetGlobalInt( Format( "doorsI", doorI ) ) ) ) + // + UNTIL ( doorI >= doorMaxI ) + // + ENDFOR + // + FOR doorI = doorMinI TO doorMaxI + // + IF ( GetGlobalInt( Format( "doorsI", doorI ) ) > 0 ) + // + s = "open" + // + AddLine( Format( "door", " ", doorI, " ", "is", " ", s ), bufferI ) + // + ELSE + // + s = "closed" + // + ENDIF + // + ENDFOR + // + AddLine( "all other doors are closed", bufferI ) + // + GotoBufferId( bufferI ) + // +END + +PROC Main() + PROCMathGetTaskDoorOpenClose( 100, 100 ) +END diff --git a/Task/100-doors/TUSCRIPT/100-doors.tuscript b/Task/100-doors/TUSCRIPT/100-doors.tuscript new file mode 100644 index 0000000000..befcfeaa56 --- /dev/null +++ b/Task/100-doors/TUSCRIPT/100-doors.tuscript @@ -0,0 +1,24 @@ +$$ MODE TUSCRIPT +DICT doors create +COMPILE +LOOP door=1,100 + LOOP pass=1,100 + SET go=MOD (door,pass) + DICT doors lookup door,num,cnt,status + IF (num==0) THEN + SET status="open" + DICT doors add door,num,cnt,status + ELSE + IF (go==0) THEN + IF (status=="closed") THEN + SET status="open" + ELSE + SET status="closed" + ENDIF + DICT doors update door,num,cnt,status + ENDIF + ENDIF + ENDLOOP +ENDLOOP +ENDCOMPILE +DICT doors unload door,num,cnt,status diff --git a/Task/100-doors/TXR/100-doors.txr b/Task/100-doors/TXR/100-doors.txr new file mode 100644 index 0000000000..e199818920 --- /dev/null +++ b/Task/100-doors/TXR/100-doors.txr @@ -0,0 +1,9 @@ +@(do (defun 100-doors () + (let ((doors (vector 100))) + (each ((i (range 0 99))) + (for ((j i)) ((< j 100)) ((inc j (+ i 1))) + (flip [doors j]))) + doors)) + (each ((counter (range 1)) + (door (list-vector (100-doors)))) + (format t "door ~a is ~a\n" counter (if door "open" "closed")))) diff --git a/Task/100-doors/TorqueScript/100-doors.torquescript b/Task/100-doors/TorqueScript/100-doors.torquescript new file mode 100644 index 0000000000..5bbf977207 --- /dev/null +++ b/Task/100-doors/TorqueScript/100-doors.torquescript @@ -0,0 +1,5 @@ +for(%steps = 1; %a <= 100; %a++) + for(%current = %steps; %current <= 100; %current += %steps) + %door[%current] = !%door[%current]; +for(%a = 1; %a <= 100; %a++) + echo("Door #" @ %a @ " is" SPC %door[%current] ? "Open" : "Closed" @ "."); diff --git a/Task/100-doors/UNIX-Shell/100-doors-1.sh b/Task/100-doors/UNIX-Shell/100-doors-1.sh new file mode 100644 index 0000000000..b35dffbabf --- /dev/null +++ b/Task/100-doors/UNIX-Shell/100-doors-1.sh @@ -0,0 +1,22 @@ +#! /bin/bash + +declare -a doors +for((i=1; i <= 100; i++)); do + doors[$i]=0 +done + +for((i=1; i <= 100; i++)); do + for((j=i; j <= 100; j += i)); do + echo $i $j + doors[$j]=$(( doors[j] ^ 1 )) + done +done + +for((i=1; i <= 100; i++)); do + if [[ ${doors[$i]} -eq 0 ]]; then + op="closed" + else + op="open" + fi + echo $i $op +done diff --git a/Task/100-doors/UNIX-Shell/100-doors-2.sh b/Task/100-doors/UNIX-Shell/100-doors-2.sh new file mode 100644 index 0000000000..7413f7836f --- /dev/null +++ b/Task/100-doors/UNIX-Shell/100-doors-2.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +for i in {1..100}; do + door[$i*$i]=1 + [ -z ${door[$i]} ] && echo "$i closed" || echo "$i open" +done diff --git a/Task/100-doors/Ursala/100-doors-1.ursala b/Task/100-doors/Ursala/100-doors-1.ursala new file mode 100644 index 0000000000..cb7f600144 --- /dev/null +++ b/Task/100-doors/Ursala/100-doors-1.ursala @@ -0,0 +1,10 @@ +#import std +#import nat + +doors = 0!* iota 100 + +pass("n","d") = remainder\"n"?l(~&r,not ~&r)* num "d" + +#cast %nL + +main = ~&rFlS num pass=>doors nrange(100,1) diff --git a/Task/100-doors/Ursala/100-doors-2.ursala b/Task/100-doors/Ursala/100-doors-2.ursala new file mode 100644 index 0000000000..fb54482f09 --- /dev/null +++ b/Task/100-doors/Ursala/100-doors-2.ursala @@ -0,0 +1,5 @@ +#import nat + +#cast %nL + +main = product*tiiXS iota10 diff --git a/Task/100-doors/VBScript/100-doors.vbscript b/Task/100-doors/VBScript/100-doors.vbscript new file mode 100644 index 0000000000..b0ccc343de --- /dev/null +++ b/Task/100-doors/VBScript/100-doors.vbscript @@ -0,0 +1,21 @@ +Dim doorIsOpen(100), pass, currentDoor, text + +For currentDoor = 0 To 99 + doorIsOpen(currentDoor) = False +Next + +For pass = 0 To 99 + For currentDoor = pass To 99 Step pass + 1 + doorIsOpen(currentDoor) = Not doorIsOpen(currentDoor) + Next +Next + +For currentDoor = 0 To 99 + text = "Door #" & currentDoor + 1 & " is " + If doorIsOpen(currentDoor) Then + text = text & "open." + Else + text = text & "closed." + End If + WScript.Echo(text) +Next diff --git a/Task/100-doors/VHDL/100-doors-1.vhdl b/Task/100-doors/VHDL/100-doors-1.vhdl new file mode 100644 index 0000000000..605574c224 --- /dev/null +++ b/Task/100-doors/VHDL/100-doors-1.vhdl @@ -0,0 +1,28 @@ +library IEEE; +use IEEE.STD_LOGIC_1164.ALL; + +entity DOORS is + port (CLK: in std_logic; OUTPUT: out std_logic_vector(1 to 100)); +end DOORS; + +architecture Behavioral of DOORS is +begin + process (CLK) + variable TEMP: std_logic_vector(1 to 100); + begin + --setup closed doors + TEMP := (others => '0'); + + --looping through + for i in 1 to TEMP'length loop + for j in i to TEMP'length loop + if (j mod i) = 0 then + TEMP(j) := not TEMP(j); + end if; + end loop; + end loop; + + --assign output + OUTPUT <= TEMP; + end process; +end Behavioral; diff --git a/Task/100-doors/VHDL/100-doors-2.vhdl b/Task/100-doors/VHDL/100-doors-2.vhdl new file mode 100644 index 0000000000..d63de9a7ac --- /dev/null +++ b/Task/100-doors/VHDL/100-doors-2.vhdl @@ -0,0 +1,34 @@ +LIBRARY ieee; +USE ieee.std_logic_1164.all; + + +entity doors is + port ( + clk : in std_logic; + reset : in std_logic; + door : buffer std_logic_vector(1 to 100) + ); +end entity doors; + + +architecture rtl of doors is + signal step : integer range 1 to 101; + signal addr : integer range 1 to 201; +begin + proc_step: process(clk, reset) + begin + if reset = '1' then + step <= 1; + addr <= 1; + door <= (others => '0'); + elsif rising_edge(clk) then + if addr <= 100 then + door(addr) <= not door(addr); + addr <= addr + step; + elsif step <= 100 then + addr <= step + 1; + step <= step + 1; + end if; + end if; + end process; +end; diff --git a/Task/100-doors/Vala/100-doors-1.vala b/Task/100-doors/Vala/100-doors-1.vala new file mode 100644 index 0000000000..01665bc52e --- /dev/null +++ b/Task/100-doors/Vala/100-doors-1.vala @@ -0,0 +1,10 @@ +int main() { + bool doors_open[101]; + for(int i = 1; i < doors_open.length; i++) { + for(int j = 1; i*j < doors_open.length; j++) { + doors_open[i*j] = !doors_open[i*j]; + } + stdout.printf("%d: %s\n", i, (doors_open[i] ? "open" : "closed")); + } + return 0; +} diff --git a/Task/100-doors/Vala/100-doors-2.vala b/Task/100-doors/Vala/100-doors-2.vala new file mode 100644 index 0000000000..d0204003f4 --- /dev/null +++ b/Task/100-doors/Vala/100-doors-2.vala @@ -0,0 +1,8 @@ +int main() { + int i = 1; + while(i*i <= 100) { + stdout.printf("${i*i} open\n"); + i++; + } + return 0; +} diff --git a/Task/100-doors/Vedit-macro-language/100-doors-1.vedit b/Task/100-doors/Vedit-macro-language/100-doors-1.vedit new file mode 100644 index 0000000000..795a1ed492 --- /dev/null +++ b/Task/100-doors/Vedit-macro-language/100-doors-1.vedit @@ -0,0 +1,8 @@ +Buf_Switch(Buf_Free) +Ins_Char('-', COUNT, 100) // All doors closed +for (#1 = 1; #1 <= 100; #1++) { + for (#2 = #1; #2 <= 100; #2 += #1) { + Goto_Col(#2) + Ins_Char((Cur_Char^0x62), OVERWRITE) // Toggle between '-' and 'O' + } +} diff --git a/Task/100-doors/Vedit-macro-language/100-doors-2.vedit b/Task/100-doors/Vedit-macro-language/100-doors-2.vedit new file mode 100644 index 0000000000..70e4d0e560 --- /dev/null +++ b/Task/100-doors/Vedit-macro-language/100-doors-2.vedit @@ -0,0 +1,6 @@ +Buf_Switch(Buf_Free) +Ins_Char('-', COUNT, 100) +for (#1=1; #1 <= 10; #1++) { + Goto_Col(#1*#1) + Ins_Char('O', OVERWRITE) +} diff --git a/Task/100-doors/Visual-Basic-.NET/100-doors-1.visual b/Task/100-doors/Visual-Basic-.NET/100-doors-1.visual new file mode 100644 index 0000000000..6aeb5ab24f --- /dev/null +++ b/Task/100-doors/Visual-Basic-.NET/100-doors-1.visual @@ -0,0 +1,19 @@ +Module Module1 + + Sub Main() + Dim doors(100) As Boolean 'Door 1 is at index 0 + + For pass = 1 To 100 + For door = pass - 1 To 99 Step pass + doors(door) = Not doors(door) + Next + Next + + For door = 0 To 99 + Console.WriteLine("Door # " & (door + 1) & " is " & If(doors(door), "Open", "Closed")) + Next + + Console.ReadLine() + End Sub + +End Module diff --git a/Task/100-doors/Visual-Basic-.NET/100-doors-2.visual b/Task/100-doors/Visual-Basic-.NET/100-doors-2.visual new file mode 100644 index 0000000000..35fa0d2199 --- /dev/null +++ b/Task/100-doors/Visual-Basic-.NET/100-doors-2.visual @@ -0,0 +1,17 @@ +Module Module1 + + Sub Main() + Dim doors(100) As Boolean 'Door 1 is at index 0 + + For i = 1 To 10 + doors(i ^ 2 - 1) = True + Next + + For door = 0 To 99 + Console.WriteLine("Door # " & (door + 1) & " is " & If(doors(door), "Open", "Closed")) + Next + + Console.ReadLine() + End Sub + +End Module diff --git a/Task/100-doors/Wrapl/100-doors-1.wrapl b/Task/100-doors/Wrapl/100-doors-1.wrapl new file mode 100644 index 0000000000..e4b83714c2 --- /dev/null +++ b/Task/100-doors/Wrapl/100-doors-1.wrapl @@ -0,0 +1,15 @@ +MOD Doors; + +IMP Agg.Table; +IMP Std.String; +IMP IO.Terminal USE Out; + +VAR door <- {}; EVERY door[1:to(100), "closed"]; + +DEF toggle(num) door[num] <- door[num] = "open" => "closed" // "open"; + +EVERY WITH pass <- 1:to(100), num <- pass:to(100, pass) DO toggle(num); + +Out:write('Doors {door @ String.T}.'); + +END Doors. diff --git a/Task/100-doors/Wrapl/100-doors-2.wrapl b/Task/100-doors/Wrapl/100-doors-2.wrapl new file mode 100644 index 0000000000..3370e57146 --- /dev/null +++ b/Task/100-doors/Wrapl/100-doors-2.wrapl @@ -0,0 +1,11 @@ +MOD Doors; + +IMP IO.Terminal USE Out; + +DEF open <- ALL 1:to(100) ^ 2 \ $ <= 100; +DEF closed <- ALL 1:to(100) \ NOT $ IN open; + +Out:write('Doors {open} are open.\n'); +Out:write('Doors {closed} are closed.\n'); + +END Doors. diff --git a/Task/100-doors/XPL0/100-doors.xpl0 b/Task/100-doors/XPL0/100-doors.xpl0 new file mode 100644 index 0000000000..d47a55a856 --- /dev/null +++ b/Task/100-doors/XPL0/100-doors.xpl0 @@ -0,0 +1,37 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +int Door(100); \You have 100 doors in a row +define Open, Closed; +int D, Pass, Step; + +[for D:= 0 to 100-1 do \that are all initially closed + Door(D):= Closed; + +Step:= 1; \The first time through, you visit every door +for Pass:= 1 to 100 do \You make 100 passes by the doors + [D:= Step-1; + repeat \if the door is closed, you open it; if it is open, you close it + if Door(D)=Closed then Door(D):= Open else Door(D):= Closed; + D:= D+Step; + until D>=100; + Step:= Step+1; \The second time you only visit every 2nd door + ]; \The third time, every 3rd door + \until you only visit the 100th door +\What state are the doors in after the last pass? +Text(0, "Open: "); \Which are open? +for D:= 0 to 100-1 do + if Door(D)=Open then [IntOut(0, D+1); ChOut(0,^ )]; +CrLf(0); + +Text(0, "Closed: "); \Which are closed? +for D:= 0 to 100-1 do + if Door(D)=Closed then [IntOut(0, D+1); ChOut(0,^ )]; +CrLf(0); + +\Optimized: The only doors that remain open are those that are perfect squares +Text(0, "Open: "); +D:= 1; +repeat IntOut(0, D*D); ChOut(0,^ ); + D:= D+1; +until D*D>100; +CrLf(0); +] diff --git a/Task/100-doors/XSLT-1.0/100-doors-1.xslt b/Task/100-doors/XSLT-1.0/100-doors-1.xslt new file mode 100644 index 0000000000..83d2a251d4 --- /dev/null +++ b/Task/100-doors/XSLT-1.0/100-doors-1.xslt @@ -0,0 +1,8 @@ + + closed + closed + closed + closed + ... etc ... + closed + diff --git a/Task/100-doors/XSLT-1.0/100-doors-2.xslt b/Task/100-doors/XSLT-1.0/100-doors-2.xslt new file mode 100644 index 0000000000..3722236537 --- /dev/null +++ b/Task/100-doors/XSLT-1.0/100-doors-2.xslt @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + ! + + + + + + + open + + + closed + + + + + + diff --git a/Task/100-doors/XSLT-2.0/100-doors.xslt b/Task/100-doors/XSLT-2.0/100-doors.xslt new file mode 100644 index 0000000000..208da08211 --- /dev/null +++ b/Task/100-doors/XSLT-2.0/100-doors.xslt @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/Task/100-doors/Yorick/100-doors-1.yorick b/Task/100-doors/Yorick/100-doors-1.yorick new file mode 100644 index 0000000000..be4a17644e --- /dev/null +++ b/Task/100-doors/Yorick/100-doors-1.yorick @@ -0,0 +1,5 @@ +doors = array(0, 100); +for(i = 1; i <= 100; i++) + for(j = i; j <= 100; j += i) + doors(j) ~= 1; +print, where(doors); diff --git a/Task/100-doors/Yorick/100-doors-2.yorick b/Task/100-doors/Yorick/100-doors-2.yorick new file mode 100644 index 0000000000..d84e8eefa8 --- /dev/null +++ b/Task/100-doors/Yorick/100-doors-2.yorick @@ -0,0 +1,4 @@ +doors = array(0, 100); +for(i = 1; i <= 100; i++) + doors(i::i) ~= 1; +print, where(doors); diff --git a/Task/100-doors/Yorick/100-doors-3.yorick b/Task/100-doors/Yorick/100-doors-3.yorick new file mode 100644 index 0000000000..b365877177 --- /dev/null +++ b/Task/100-doors/Yorick/100-doors-3.yorick @@ -0,0 +1 @@ +print, indgen(1:long(sqrt(100)))^2 diff --git a/Task/100-doors/ZED/100-doors.zed b/Task/100-doors/ZED/100-doors.zed new file mode 100644 index 0000000000..7c564757da --- /dev/null +++ b/Task/100-doors/ZED/100-doors.zed @@ -0,0 +1,54 @@ +("100doors") +100doors +(always) +(message) (first) 100 (100passes) (doors) + +(doors) +an infinite list of closed doors +(always) +(c) "'closed" (doors) + +(100passes) doors +[open closed closed closed ...] +(always) +(100passes1) 1 doors + +(100passes1) count doors +101 [open closed closed open ...] +(>) count 100 +doors + +(100passes1) count doors +3 [open closed open closed ...] +(always) +(100passes1) (add1) count + (flip-and-count) count doors + +(flip-and-count) frequency doors +3 [open closed open closed ...] +(always) +(flip-and-count1) frequency frequency doors + +(flip-and-count1) frequency count doors +3 1 [open closed open closed ...] +(=) count 1 +(c) (flip-door-state) (1) doors + (flip-and-count) frequency (!) doors + +(flip-and-count1) frequency count doors +3 3 [open closed open closed ...] +(always) +(c) (1) doors + (flip-and-count1) frequency + (sub1) count + (!) doors + +(flip-door-state) state +'closed +(=) state "'closed" +"'open" + +(flip-door-state) state +'open +(=) state "'open" +"'closed" diff --git a/Task/24-game-Solve/CoffeeScript/24-game-solve-1.coffee b/Task/24-game-Solve/CoffeeScript/24-game-solve-1.coffeescript similarity index 100% rename from Task/24-game-Solve/CoffeeScript/24-game-solve-1.coffee rename to Task/24-game-Solve/CoffeeScript/24-game-solve-1.coffeescript diff --git a/Task/24-game-Solve/CoffeeScript/24-game-solve-2.coffee b/Task/24-game-Solve/CoffeeScript/24-game-solve-2.coffeescript similarity index 100% rename from Task/24-game-Solve/CoffeeScript/24-game-solve-2.coffee rename to Task/24-game-Solve/CoffeeScript/24-game-solve-2.coffeescript diff --git a/Task/24-game-Solve/Mathematica/24-game-solve-1.mathematica b/Task/24-game-Solve/Mathematica/24-game-solve-1.math similarity index 100% rename from Task/24-game-Solve/Mathematica/24-game-solve-1.mathematica rename to Task/24-game-Solve/Mathematica/24-game-solve-1.math diff --git a/Task/24-game-Solve/Mathematica/24-game-solve-2.mathematica b/Task/24-game-Solve/Mathematica/24-game-solve-2.math similarity index 100% rename from Task/24-game-Solve/Mathematica/24-game-solve-2.mathematica rename to Task/24-game-Solve/Mathematica/24-game-solve-2.math diff --git a/Task/24-game-Solve/OCaml/24-game-solve.ocaml b/Task/24-game-Solve/OCaml/24-game-solve.ocaml new file mode 100644 index 0000000000..16f1177229 --- /dev/null +++ b/Task/24-game-Solve/OCaml/24-game-solve.ocaml @@ -0,0 +1,70 @@ +type expression = + | Const of float + | Sum of expression * expression (* e1 + e2 *) + | Diff of expression * expression (* e1 - e2 *) + | Prod of expression * expression (* e1 * e2 *) + | Quot of expression * expression (* e1 / e2 *) + +let rec eval = function + | Const c -> c + | Sum (f, g) -> eval f +. eval g + | Diff(f, g) -> eval f -. eval g + | Prod(f, g) -> eval f *. eval g + | Quot(f, g) -> eval f /. eval g + +let print_expr expr = + let open_paren prec op_prec = + if prec > op_prec then print_string "(" in + let close_paren prec op_prec = + if prec > op_prec then print_string ")" in + let rec print prec = function (* prec is the current precedence *) + | Const c -> Printf.printf "%g" c + | Sum(f, g) -> + open_paren prec 0; + print 0 f; print_string " + "; print 0 g; + close_paren prec 0 + | Diff(f, g) -> + open_paren prec 0; + print 0 f; print_string " - "; print 1 g; + close_paren prec 0 + | Prod(f, g) -> + open_paren prec 2; + print 2 f; print_string " * "; print 2 g; + close_paren prec 2 + | Quot(f, g) -> + open_paren prec 2; + print 2 f; print_string " / "; print 3 g; + close_paren prec 2 + in + print 0 expr + +let rec insert v = function + | [] -> [[v]] + | x::xs as li -> (v::li) :: (List.map (fun y -> x::y) (insert v xs)) + +let permutations li = + List.fold_right (fun x z -> List.concat (List.map (insert x) z)) li [[]] + +let rec comp expr = function + | x::xs -> + comp (Sum (expr, x)) xs; + comp (Diff(expr, x)) xs; + comp (Prod(expr, x)) xs; + comp (Quot(expr, x)) xs; + | [] -> + if (eval expr) = 24.0 + then (print_expr expr; print_newline()) +;; + +let () = + Random.self_init(); + let digits = Array.init 4 (fun _ -> 1 + Random.int 9) in + print_string "Input digits: "; + Array.iter (Printf.printf " %d") digits; print_newline(); + let digits = Array.to_list(Array.map float_of_int digits) in + let digits = List.map (fun v -> Const v) digits in + let all = permutations digits in + List.iter (function + | x::xs -> comp x xs + | [] -> assert false + ) all diff --git a/Task/24-game-Solve/Perl-6/24-game-solve.pl6 b/Task/24-game-Solve/Perl-6/24-game-solve.pl6 new file mode 100644 index 0000000000..8d828c5511 --- /dev/null +++ b/Task/24-game-Solve/Perl-6/24-game-solve.pl6 @@ -0,0 +1,61 @@ +my @digits; +my $amount = 4; + +# Get $amount digits from the user, +# ask for more if they don't supply enough +while @digits.elems < $amount { + @digits ,= (prompt "Enter {$amount - @digits} digits from 1 to 9, " + ~ '(repeats allowed): ').comb(/<[1..9]>/); +} +# Throw away any extras +@digits = @digits[^$amount]; + +# Generate combinations of operators +my @op = <+ - * />; +my @ops = map {my $a = $_; map {my $b = $_; map {[$a,$b,$_]}, @op}, @op}, @op; + +# Enough sprintf formats to cover most precedence orderings +my @formats = ( + '%d %s %d %s %d %s %d', + '(%d %s %d) %s %d %s %d', + '(%d %s %d %s %d) %s %d', + '((%d %s %d) %s %d) %s %d', + '(%d %s %d) %s (%d %s %d)', + '%d %s (%d %s %d %s %d)', + '%d %s (%d %s (%d %s %d))', +); + +# Brute force test the different permutations +for unique permutations @digits -> @p { + for @ops -> @o { + for @formats -> $format { + my $string = sprintf $format, @p[0], @o[0], + @p[1], @o[1], @p[2], @o[2], @p[3]; + my $result = try { eval($string) }; + say "$string = 24" and last if $result and $result == 24; + } + } +} + +# Perl 6 translation of Fischer-Krause ordered permutation algorithm +sub permutations (@array) { + my @index = ^@array; + my $last = @index[*-1]; + my (@permutations, $rev, $fwd); + loop { + push @permutations, [@array[@index]]; + $rev = $last; + --$rev while $rev and @index[$rev-1] > @index[$rev]; + return @permutations unless $rev; + $fwd = $rev; + push @index, @index.splice($rev).reverse; + ++$fwd while @index[$rev-1] > @index[$fwd]; + @index[$rev-1,$fwd] = @index[$fwd,$rev-1]; + } +} + +# Only return unique sub-arrays +sub unique (@array) { + my %h = map { $_.Str => $_ }, @array; + %h.values; +} diff --git a/Task/24-game-Solve/ProDOS/24-game-solve-1.dos b/Task/24-game-Solve/ProDOS/24-game-solve-1.dos new file mode 100644 index 0000000000..4da948715f --- /dev/null +++ b/Task/24-game-Solve/ProDOS/24-game-solve-1.dos @@ -0,0 +1,35 @@ +editvar /modify -random- = <10 +:a +editvar /newvar /withothervar /value=-random- /title=1 +editvar /newvar /withothervar /value=-random- /title=2 +editvar /newvar /withothervar /value=-random- /title=3 +editvar /newvar /withothervar /value=-random- /title=4 +printline These are your four digits: -1- -2- -3- -4- +printline Use an algorithm to make the number 24. +editvar /newvar /value=a /userinput=1 /title=Algorithm: +do -a- +if -a- /hasvalue 24 printline Your algorithm worked! & goto :b ( +) else printline Your algorithm did not work. +editvar /newvar /value=b /userinput=1 /title=Do you want to see how you could have done it? +if -b- /hasvalue y goto :c else goto :b +:b +editvar /newvar /value=c /userinput=1 /title=Do you want to play again? +if -c- /hasvalue y goto :a else exitcurrentprogram +:c +editvar /newvar /value=do -1- + -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- - -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- / -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- * -2- + -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- + -2- - -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- + -2- / -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- + -2- * -3- + -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- + -2- + -3- - -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- + -2- + -3- / -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- + -2- + -3- * -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- - -2- - -3- - -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- / -2- / -3- / -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +editvar /newvar /value=do -1- * -2- * -3- * -4- /title=c & do -c- >d & if -d- /hasvalue 24 goto :solve +:solve +printline you could have done it by doing -c- +stoptask +goto :b diff --git a/Task/24-game-Solve/ProDOS/24-game-solve-2.dos b/Task/24-game-Solve/ProDOS/24-game-solve-2.dos new file mode 100644 index 0000000000..69d8b8a977 --- /dev/null +++ b/Task/24-game-Solve/ProDOS/24-game-solve-2.dos @@ -0,0 +1,11 @@ +These are your four digits: 1 4 5 2 +Use an algorithm to make the number 24. +Algorithm: 4 + 2 - 5 + 1 +Your algorithm did not work. +Do you want to play again? y + +These are your four digits: 1 8 9 6 +Use an algorithm to make the number 24. +Algorithm: 1 + 8 + 9 + 6 +Your algorithm worked! +Do you want to play again? n diff --git a/Task/24-game-Solve/Ursala/24-game-solve-1.ursala b/Task/24-game-Solve/Ursala/24-game-solve-1.ursala new file mode 100644 index 0000000000..32e5531b3c --- /dev/null +++ b/Task/24-game-Solve/Ursala/24-game-solve-1.ursala @@ -0,0 +1,11 @@ +#import std +#import nat +#import rat + +tree_shapes = "n". (@vLPiYo //eql iota "n")*~ (rep"n" ~&iiiK0NlrNCCVSPTs) {0^:<>} +with_leaves = ^|DrlDrlK34SPSL/permutations ~& +with_roots = ^DrlDrlK35dlPvVoPSPSL\~&r @lrhvdNCBvLPTo2DlS @hiNCSPtCx ~&K0=> +value = *^ ~&v?\(@d ~&\1) ^|H\~&hthPX '+-*/'-$ +format = *^ ~&v?\-+~&h,%zP@d+- ^H/mat@d *v ~&t?\~& :/`(+ --')' + +game"n" "d" = format* value==("n",1)*~ with_roots/'+-*/' with_leaves/"d"*-1 tree_shapes length "d" diff --git a/Task/24-game-Solve/Ursala/24-game-solve-2.ursala b/Task/24-game-Solve/Ursala/24-game-solve-2.ursala new file mode 100644 index 0000000000..9ac807cdf3 --- /dev/null +++ b/Task/24-game-Solve/Ursala/24-game-solve-2.ursala @@ -0,0 +1,3 @@ +#show+ + +test_games = mat` * pad` *K7 pad0 game24* <<2,3,8,9>,<5,7,4,1>,<5,6,7,8>> diff --git a/Task/24-game/CoffeeScript/24-game.coffee b/Task/24-game/CoffeeScript/24-game.coffeescript similarity index 100% rename from Task/24-game/CoffeeScript/24-game.coffee rename to Task/24-game/CoffeeScript/24-game.coffeescript diff --git a/Task/24-game/Locomotive-Basic/24-game.bas b/Task/24-game/Locomotive-Basic/24-game.locomotive similarity index 100% rename from Task/24-game/Locomotive-Basic/24-game.bas rename to Task/24-game/Locomotive-Basic/24-game.locomotive diff --git a/Task/24-game/Mathematica/24-game.mathematica b/Task/24-game/Mathematica/24-game.math similarity index 100% rename from Task/24-game/Mathematica/24-game.mathematica rename to Task/24-game/Mathematica/24-game.math diff --git a/Task/24-game/OCaml/24-game.ocaml b/Task/24-game/OCaml/24-game.ocaml new file mode 100644 index 0000000000..ff0ac7c95d --- /dev/null +++ b/Task/24-game/OCaml/24-game.ocaml @@ -0,0 +1,90 @@ +type expression = + | Const of float + | Sum of expression * expression (* e1 + e2 *) + | Diff of expression * expression (* e1 - e2 *) + | Prod of expression * expression (* e1 * e2 *) + | Quot of expression * expression (* e1 / e2 *) + +let rec eval = function + | Const c -> c + | Sum (f, g) -> eval f +. eval g + | Diff(f, g) -> eval f -. eval g + | Prod(f, g) -> eval f *. eval g + | Quot(f, g) -> eval f /. eval g + +let rec extract acc = function + | Const c -> (c::acc) + | Sum (f, g) -> (extract acc f) @ (extract [] g) + | Diff(f, g) -> (extract acc f) @ (extract [] g) + | Prod(f, g) -> (extract acc f) @ (extract [] g) + | Quot(f, g) -> (extract acc f) @ (extract [] g) + +open Genlex + +let lexer = make_lexer ["("; ")"; "+"; "-"; "*"; "/"] + +let rec parse_expr = parser + [< e1 = parse_mult; e = parse_more_adds e1 >] -> e + and parse_more_adds e1 = parser + [< 'Kwd "+"; e2 = parse_mult; e = parse_more_adds (Sum(e1, e2)) >] -> e + | [< 'Kwd "-"; e2 = parse_mult; e = parse_more_adds (Diff(e1, e2)) >] -> e + | [< >] -> e1 + and parse_mult = parser + [< e1 = parse_simple; e = parse_more_mults e1 >] -> e + and parse_more_mults e1 = parser + [< 'Kwd "*"; e2 = parse_simple; e = parse_more_mults (Prod(e1, e2)) >] -> e + | [< 'Kwd "/"; e2 = parse_simple; e = parse_more_mults (Quot(e1, e2)) >] -> e + | [< >] -> e1 + and parse_simple = parser + | [< 'Int i >] -> Const(float i) + | [< 'Float f >] -> Const f + | [< 'Kwd "("; e = parse_expr; 'Kwd ")" >] -> e + + +let parse_expression = parser [< e = parse_expr; _ = Stream.empty >] -> e + +let read_expression s = parse_expression(lexer(Stream.of_string s)) + + +let () = + Random.self_init(); + print_endline " + The 24 Game + + Given any four digits in the range 1 to 9, which may have repetitions, + Using just the +, -, *, and / operators; and the possible use of + brackets, (), show how to make an answer of 24. + + An answer of 'q' will quit the game. + An answer of '!' will generate a new set of four digits. + Otherwise you are repeatedly asked for an expression until it evaluates to 24 + + Note: you cannot form multiple digit numbers from the supplied digits, + so an answer of 12+12 when given 1, 2, 2, and 1 would not be allowed.\n"; + + let sort = List.sort compare in + let digits = ref [] in + let digit_set () = + let ar = Array.init 4 (fun _ -> 1 + Random.int 9) in + digits := Array.to_list(Array.map float_of_int ar); + print_string "The four digits: "; + List.iter (Printf.printf " %g") !digits; + print_newline(); + in + + digit_set(); + while true do + print_string "Expression: "; + let str = read_line() in + if str = "q" then exit 0; + if str = "!" then digit_set() + else begin + let expr = read_expression str in + let res = eval expr in + Printf.printf " = %g\n%!" res; + if res = 24. + && (sort !digits) = (sort (extract [] expr)) + then (print_endline "Congratulations!"; digit_set()) + else print_endline "Try again" + end + done diff --git a/Task/24-game/OpenEdge-Progress/24-game.openedge b/Task/24-game/OpenEdge-Progress/24-game.openedge new file mode 100644 index 0000000000..c05dc0a785 --- /dev/null +++ b/Task/24-game/OpenEdge-Progress/24-game.openedge @@ -0,0 +1,67 @@ +DEFINE TEMP-TABLE tt NO-UNDO FIELD ii AS INTEGER. + +DEFINE VARIABLE p_deanswer AS DECIMAL NO-UNDO. +DEFINE VARIABLE idigits AS INTEGER NO-UNDO EXTENT 4. +DEFINE VARIABLE ii AS INTEGER NO-UNDO. +DEFINE VARIABLE Digits AS CHARACTER NO-UNDO FORMAT "x(7)". +DEFINE VARIABLE Answer AS CHARACTER NO-UNDO FORMAT "x(7)". +DEFINE VARIABLE cexpression AS CHARACTER NO-UNDO. +DEFINE VARIABLE cmessage AS CHARACTER NO-UNDO. +DEFINE VARIABLE cchar AS CHARACTER NO-UNDO. + +FUNCTION calculate RETURNS LOGICAL ( + i_de AS DECIMAL +): + p_deanswer = i_de. +END FUNCTION. + +/* generate problem */ +DO ii = 1 TO 4: + ASSIGN + idigits [ii] = RANDOM( 1, 9 ). + Digits = Digits + STRING( idigits [ii] ) + " " + . +END. + +/* ui */ +DISPLAY Digits. +UPDATE Answer. + +/* check valid input */ +DO ii = 1 TO 7: + cchar = SUBSTRING( Answer, ii, 1 ). + IF cchar > "" THEN DO: + IF ii MODULO 2 = 1 THEN DO: + IF LOOKUP( cchar, Digits, " " ) = 0 THEN + cmessage = cmessage + SUBSTITUTE( "Invalid digit: &1.~r", cchar ). + ELSE + ENTRY( LOOKUP( cchar, Digits, " " ), Digits, " " ) = "". + END. + ELSE DO: + IF LOOKUP( cchar, "+,-,/,*" ) = 0 THEN + cmessage = cmessage + SUBSTITUTE( "&1 is not a valid operator.~r", cchar ). + END. + END. +END. +IF TRIM( Digits ) > "" THEN + cmessage = cmessage + SUBSTITUTE( "You did not use digits: &1":U, TRIM( Digits ) ). + +IF cmessage = "" THEN DO: + /* expressions need spacing */ + DO ii = 1 TO 7: + cexpression = cexpression + SUBSTRING( Answer, ii, 1 ) + " ". + END. + /* use dynamic query to parse expression */ + TEMP-TABLE tt:DEFAULT-BUFFER-HANDLE:FIND-FIRST( + SUBSTITUTE( + "WHERE NOT DYNAMIC-FUNCTION( 'calculate', DECIMAL( &1 ) )", + cexpression + ) + ) NO-ERROR. + IF p_deanswer <> 24 THEN + cmessage = cmessage + SUBSTITUTE( "The expression evaluates to &1.", p_deanswer ). + ELSE + cmessage = "Solved!". +END. + +MESSAGE cmessage VIEW-AS ALERT-BOX. diff --git a/Task/24-game/PARI-GP/24-game.pari b/Task/24-game/PARI-GP/24-game.pari new file mode 100644 index 0000000000..5e0eb5042c --- /dev/null +++ b/Task/24-game/PARI-GP/24-game.pari @@ -0,0 +1,45 @@ +game()={ + my(v=vecsort(vector(4,i,random(8)+1))); + print("Form 24 using */+-() and: "v); + while(1, + my(ans=input); + if (!valid(s,v), next); + trap(, + print("Arithmetic error"); + next + , + if(eval(s)==24, break, print("Bad sum")) + ) + ); + print("You win!") +}; +valid(s,v)={ + my(op=vecsort(Vec("+-*/()")),u=[]); + s=Vec(s); + for(i=1,#s, + if(setsearch(op,s[i]),next); + trap(, + print("Invalid character "s[i]); + return(0) + , + if(setsearch(v,eval(s[i])), + u=concat(u,eval(s[i])) + , + print(s[i]" not allowed"); + return(0) + ) + ) + ); + for(i=2,#s, + if(!setsearch(op,s[i])&!setsearch(op,s[i-1]), + print("Concatenating digits is not allowed!"); + return(0) + ) + ); + if(vecsort(u)!=v, + print("Invalid digits"); + 0 + , + 1 + ) +}; diff --git a/Task/24-game/PL-I/24-game.pli b/Task/24-game/PL-I/24-game.pli new file mode 100644 index 0000000000..b4d35530ef --- /dev/null +++ b/Task/24-game/PL-I/24-game.pli @@ -0,0 +1,136 @@ +/* Plays the game of 24. */ + +TWENTYFOUR: procedure options (main); /* 14 August 2010 */ + +CTP: procedure (E) returns (character(50) varying); + declare E character (*) varying; + declare OUT character (length(E)) varying; + declare S character (length(E)) varying controlled; + declare c character (1); + declare i fixed binary; + +/* This procedure converts an arithmetic expression to Reverse Polish Form. */ +/* A push-down pop-up stack is used for operators. */ +priority: procedure (a) returns (fixed decimal (1)); + declare a character (1); + declare ops character (10) initial ('#+-*/') varying static; + declare pri(6) fixed decimal (1) initial (1,2,2,3,3,4) static; + declare i fixed binary; + + i = index(ops,a); + return (pri(i)); +end priority; + + allocate S; S = '#'; out = ''; + do i = 1 to length(E); + c = substr(E, i, 1); + if index('+-*/', c) > 0 then + do; + /* Copy any higher priority operators on the stack to the output. */ + do while ( priority(c) <= priority((S)) ); + out = out || S; + free S; + end; + /* Copy the input character to the stack. */ + allocate S; S = c; + end; + + if index('123456789', c) > 0 then + out = out || c; + end; + do while (allocation(S) > 1); + out = out || s; + free S; + end; + return (out); +end CTP; + +/* Given a push-down pop-up stack, and an expresion in */ +/* Reverse Polish notation, evaluate the expression. */ +EVAL: procedure (E) returns (fixed decimal(15)); + declare E character (*) varying; + declare S fixed decimal (15) controlled; + declare (a, b) fixed decimal (15); + declare c character (1); + declare p fixed binary; + declare (empty_stack, invalid_expression) condition; + + on condition (empty_stack) begin; + put skip list ('Your expression is not valid.'); + stop; + end; + on condition (invalid_expression) begin; + put skip list ('Your expression is not valid.'); + stop; + end; + + do p = 1 to length(E); + c = substr(E, p, 1); + if index('123456789', c) > 0 then + do; allocate S; S = c; end; + else + do; + if allocation(S) = 0 then signal condition (empty_stack); + b = S; free S; + if allocation(S) = 0 then signal condition (empty_stack); + a = S; + select (c); + when ('+') S = a + b; + when ('-') S = a - b; + when ('*') S = a * b; + when ('/') S = a / b; + when ('^') S = a ** b; + otherwise signal condition (invalid_expression); + end; + end; + end; + if allocation(S) ^= 1 then signal condition (invalid_expression); + return (S); +END eval; + +/* Check that the player has used every digit and no others. */ +VALIDATE: procedure (E); + declare E character (*) varying; + declare E2 character (length(E)), (i, j) fixed binary; + declare digits(9) character (1) static initial + ('1', '2', '3', '4', '5', '6', '7', '8', '9'); + + E2 = translate(E, ' ', '+-*/' ); + do i = 1 to 4; + j = index(E2, digits(k(i))); + if j > 0 then + substr(E2, j, 1) = ' '; + else + do; put skip list ('You must use the digits supplied.'); stop; end; + end; + if E2 ^= '' then + do; put skip list ('You must use every digit supplied, and no others.'); stop; end; +end VALIDATE; + + declare E character (40) varying; + declare k(4) fixed decimal; + declare (time, random) builtin; + declare V fixed decimal (15); + + k = random(TIME); + k = 9*random() + 1; + put skip edit ('Here are four integers:', k) (a); + put skip list ('With these integers, make up an arithmetic expression' || + ' that evaluates to 24.'); + put skip list ('You can use any of the operators +, -, *, and /'); + put skip list ('E.g., Given the integers 1, 3, 7, and 6,' || + ' the expression 6*3+7-1 evaluates to 24.'); + + put skip list ('Please type an arithmetic expression :'); + get edit (E) (L) COPY; + + CALL VALIDATE (E); /* Check that the player has used every digit and no others. */ + + E = CTP(E); + V = EVAL (E); + if V = 24 then + put skip list ('Congratulations: the expression evaluates to 24.'); + else + put skip edit ('The result is ', trim(V), ' which is not correct') (a); + +end TWENTYFOUR; diff --git a/Task/24-game/Perl-6/24-game.pl6 b/Task/24-game/Perl-6/24-game.pl6 new file mode 100644 index 0000000000..60ecc4cd8c --- /dev/null +++ b/Task/24-game/Perl-6/24-game.pl6 @@ -0,0 +1,38 @@ +grammar Exp24 { + token TOP { ^ $ } + token exp { [ ]* } + token term { '(' ')' | \d } + token op { '+' | '-' | '*' | '/' } +} + +my @digits = roll 4, 1..9; # to a gamer, that's a "4d9" roll +say "Here's your digits: {@digits}"; + +while my $exp = prompt "\n24-Exp? " { + unless is-valid($exp, @digits) { + say "Sorry, your expression is not valid!"; + next; + } + + my $value = eval $exp; + say "$exp = $value"; + if $value == 24 { + say "You win!"; + last; + } + say "Sorry, your expression doesn't evaluate to 24!"; +} + +sub is-valid($exp, @digits) { + unless ?Exp24.parse($exp) { + say "Expression doesn't match rules!"; + return False; + } + + unless $exp.comb(/\d/).sort.join == @digits.sort.join { + say "Expression must contain digits {@digits} only!"; + return False; + } + + return True; +} diff --git a/Task/24-game/PowerShell/24-game.psh b/Task/24-game/PowerShell/24-game.psh new file mode 100644 index 0000000000..3f0793a90f --- /dev/null +++ b/Task/24-game/PowerShell/24-game.psh @@ -0,0 +1,109 @@ +CLS + +Function isNumeric ($x) +{ + $x2 = 0 + $isNum = [System.Int32]::TryParse($x,[ref]$x2) +Return $isNum +} + +$NumberOne = Random -Maximum 10 -Minimum 1 +$NumberTwo = Random -Maximum 10 -Minimum 1 +$NumberThree = Random -Maximum 10 -Minimum 1 +$NumberFour = Random -Maximum 10 -Minimum 1 +$NumberArray = @() +$NumberArray += $NumberOne +$NumberArray += $NumberTwo +$NumberArray += $NumberThree +$NumberArray += $NumberFour + +Write-Host "Welcome to the 24 game!`n`nHere are your numbers: $NumberOne,$NumberTwo,$NumberThree and $NumberFour.`nUse division, multiplication, subtraction and addition to get 24 as a result with these 4 numbers.`n" + +Do +{ +$Wrong = 0 +$EndResult = $null +$TempChar = $null +$TempChar2 = $null +$Count = $null + $Result = Read-Host + Foreach($Char in $Result.ToCharArray()) + { + Switch($Char) + { + $NumberOne + { + } + $NumberTwo + { + } + $NumberThree + { + } + $NumberFour + { + } + "+" + { + } + "-" + { + } + "*" + { + } + "/" + { + } + "(" + { + } + ")" + { + } + " " + { + } + Default + { + $Wrong = 1 + } + } + } + If($Wrong -eq 1) + { + Write-Warning "Wrong input! Please use only the given numbers." + } + Foreach($Char in $Result.ToCharArray()) + { + If((IsNumeric $TempChar) -AND (IsNumeric $Char)) + { + Write-Warning "Wrong input! Combining two or more numbers together is not allowed!" + } + $TempChar = $Char + } + Foreach($Char in $Result.ToCharArray()) + { + If(IsNumeric $Char) + { + $Count++ + } + } + If($Count -eq 4) + { + $EndResult = Invoke-Expression $Result + If($EndResult -eq 24) + { + Write-Host "`nYou've won the game!" + } + Else + { + Write-Host "`n$EndResult is not 24! Too bad." + } + } + Else + { + Write-Warning "Wrong input! You did not supply four numbers." + } +} +While($EndResult -ne 24) diff --git a/Task/24-game/ProDOS/24-game.dos b/Task/24-game/ProDOS/24-game.dos new file mode 100644 index 0000000000..97badfc72a --- /dev/null +++ b/Task/24-game/ProDOS/24-game.dos @@ -0,0 +1,11 @@ +:a +editvar /modify -random- = <10 +printline These are your four digits: -random- -random- -random- -random- +printline Use an algorithm to make the number 24. +editvar /newvar /value=a /userinput=1 /title=Algorithm: +do -a- +if -a- /hasvalue 24 printline Your algorithm worked! & goto :b ( +) else printline Your algorithm did not work. +:b +editvar /newvar /value=b /userinput=1 /title=Do you want to play again? +if -b- /hasvalue y goto :a else exitcurrentprogram diff --git a/Task/24-game/PureBasic/24-game.purebasic b/Task/24-game/PureBasic/24-game.purebasic new file mode 100644 index 0000000000..56431b8574 --- /dev/null +++ b/Task/24-game/PureBasic/24-game.purebasic @@ -0,0 +1,160 @@ +#digitCount = 4 +Global Dim digits(#digitCount - 1) ;holds random digits + +Procedure showDigits() + Print(#CRLF$ + "These are your four digits: ") + Protected i + For i = 0 To #digitCount - 1 + Print(Str(digits(i))) + If i < (#digitCount - 1) + Print(", ") + Else + PrintN("") + EndIf + Next + Print("24 = ") +EndProcedure + +Procedure playAgain() + Protected answer.s + Repeat + Print("Play again (y/n)? ") + answer = LCase(Left(Trim(Input()), 1)) + Select answer + Case "n" + ProcedureReturn #False + Case "y" + ProcedureReturn #True + Default + PrintN("") + Continue + EndSelect + ForEver +EndProcedure + +Procedure allDigitsUsed() + Protected i + For i = 0 To #digitCount - 1 + If digits(i) <> 0 + ProcedureReturn #False + EndIf + Next + ProcedureReturn #True +EndProcedure + +Procedure isValidDigit(d) + For i = 0 To #digitCount - 1 + If digits(i) = d + digits(i) = 0 + ProcedureReturn #True + EndIf + Next + ProcedureReturn #False +EndProcedure + +Procedure doOperation(List op.c(), List operand.f()) + Protected x.f, y.f, op.c + op = op(): DeleteElement(op()) + If op = '(' + ProcedureReturn #False ;end of sub-expression + EndIf + + y = operand(): DeleteElement(operand()) + x = operand() + Select op + Case '+' + x + y + Case '-' + x - y + Case '*' + x * y + Case '/' + x / y + EndSelect + operand() = x + ProcedureReturn #True ;operation completed +EndProcedure + +;returns error if present and the expression results in *result\f +Procedure.s parseExpression(expr.s, *result.Float) + NewList op.c() + NewList operand.f() + expr = ReplaceString(expr, " ", "") ;remove spaces + + If Len(expr) = 0: *result\f = 0: ProcedureReturn "": EndIf ;no expression, return zero + + Protected *ech.Character = @expr, lastWasDigit, lastWasOper, parenCheck, c.c + While *ech\c + c = *ech\c + Select c + Case '*', '/', '-', '+' + If Not lastWasDigit: ProcedureReturn "Improper syntax, need a digit between operators.": EndIf + If ListSize(op()) And (FindString("*/", Chr(op()), 1) Or (FindString("+-", Chr(op()), 1) And FindString("+-", Chr(c), 1))) + doOperation(op(), operand()) + EndIf + AddElement(op()): op() = c + lastWasOper = #True: lastWasDigit = #False + Case '(' + If lastWasDigit: ProcedureReturn "Improper syntax, need an operator before left paren.": EndIf + AddElement(op()): op() = c + parenCheck + 1: lastWasOper = #False + Case ')' + parenCheck - 1: If parenCheck < 0: ProcedureReturn "Improper syntax, missing a left paren.": EndIf + If Not lastWasDigit: ProcedureReturn "Improper syntax, missing a digit before right paren.": EndIf + Repeat: Until Not doOperation(op(),operand()) + lastWasDigit = #True + Case '1' To '9' + If lastWasDigit: ProcedureReturn "Improper syntax, need an operator between digits.": EndIf + AddElement(operand()): operand() = c - '0' + If Not isValidDigit(operand()): ProcedureReturn "'" + Chr(c) + "' is not a valid digit.": EndIf + lastWasDigit = #True: lastWasOper = #False + Default + ProcedureReturn "'" + Chr(c) + "' is not allowed in the expression." + EndSelect + *ech + SizeOf(Character) + Wend + + If parenCheck <> 0 Or lastWasOper: ProcedureReturn "Improper syntax, missing a right paren or digit.": EndIf + Repeat + If Not ListSize(op()): Break: EndIf + Until Not doOperation(op(),operand()) + *result\f = operand() + ProcedureReturn "" ;no error +EndProcedure + +Define success, failure, result.f, error.s, i +If OpenConsole() + PrintN("The 24 Game" + #CRLF$) + PrintN("Given four digits and using just the +, -, *, and / operators; and the") + PrintN("possible use of brackets, (), enter an expression that equates to 24.") + Repeat + For i = 0 To #digitCount - 1 + digits(i) = 1 + Random(8) + Next + + showDigits() + error = parseExpression(Input(), @result) + If error = "" + If Not allDigitsUsed() + PrintN( "Wrong! (you didn't use all digits)"): failure + 1 + ElseIf result = 24.0 + PrintN("Correct!"): success + 1 + Else + Print("Wrong! (you got ") + If result <> Int(result) + PrintN(StrF(result, 2) + ")") + Else + PrintN(Str(result) + ")") + EndIf + failure + 1 + EndIf + Else + PrintN(error): failure + 1 + EndIf + Until Not playAgain() + + PrintN("success:" + Str(success) + " failure:" + Str(failure) + " total:" + Str(success + failure)) + + Print(#CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/24-game/TUSCRIPT/24-game.tuscript b/Task/24-game/TUSCRIPT/24-game.tuscript new file mode 100644 index 0000000000..866338be69 --- /dev/null +++ b/Task/24-game/TUSCRIPT/24-game.tuscript @@ -0,0 +1,73 @@ +$$ MODE TUSCRIPT +BUILD X_TABLE blanks = ":': :" + +SECTION game +operators="*'/'+'-'(')",numbers="" + +LOOP n=1,4 +number=RANDOM_NUMBERS (1,9,1) +numbers=APPEND(numbers,number) +ENDLOOP + +SET allowed=APPEND (numbers,operators) +SET allowed=MIXED_SORT (allowed) +SET allowed=REDUCE (allowed) +BUILD S_TABLE ALLOWED =* +DATA '{allowed}' + +SET checksum=DIGIT_SORT (numbers) + +printnumbers=EXCHANGE (numbers,blanks) +printoperat=EXCHANGE (operators,blanks) + +PRINT "Your numbers ", printnumbers +PRINT "Use only these operators ", printoperat +PRINT "Enter an expression that equates to 24" +PRINT "Enter 'l' for new numbers" +PRINT "Your 4 digits: ",printnumbers + +DO play +ENDSECTION + +SECTION check_expr + SET pos = VERIFY (expr,allowed) + IF (pos!=0) THEN + PRINT "wrong entry on position ",pos + DO play + STOP + ELSE + SET yourdigits = STRINGS (expr,":>/:") + SET yourchecksum = DIGIT_SORT (yourdigits) + IF (checksum!=yourchecksum) THEN + PRINT/ERROR "wrong digits" + DO play + STOP + ELSE + CONTINUE + ENDIF + ENDIF +ENDSECTION + +SECTION play +LOOP n=1,3 +ASK "Expression {n}": expr="" +IF (expr=="l") THEN +RELEASE S_TABLE allowed +PRINT "Your new numbers" +DO game +ELSEIF (expr!="") THEN +DO check_expr +sum={expr} + IF (sum!=24) THEN + PRINT/ERROR expr," not equates 24 but ",sum + CYCLE + ELSE + PRINT "BINGO ", expr," equates ", sum + STOP + ENDIF +ELSE + CYCLE +ENDIF +ENDLOOP +ENDSECTION +DO game diff --git a/Task/24-game/TorqueScript/24-game.torquescript b/Task/24-game/TorqueScript/24-game.torquescript new file mode 100644 index 0000000000..b7f0431ae5 --- /dev/null +++ b/Task/24-game/TorqueScript/24-game.torquescript @@ -0,0 +1,167 @@ +function startTwentyFourGame() +{ + if($numbers !$= "") + { + echo("Ending current 24 game..."); + endTwentyFourGame(); + } + + echo("Welcome to the 24 game!"); + echo("Generating 4 numbers..."); + for(%a = 0; %a < 4; %a++) + $numbers = setWord($numbers, %a, getRandom(0, 9)); + + echo("Numbers generated! Here are your numbers:"); + echo($numbers); + echo("Use try24Equation( equation ); to try and guess the equation."); + + $TwentyFourGame = 1; +} + +function endTwentyFourGame() +{ + if(!$TwentyFourGame) + { + echo("No 24 game is active!"); + return false; + } + + echo("Ending the 24 game."); + $numbers = ""; + $TwentyFourGame = 0; +} + +function try24Equation(%equ) +{ + if(!$TwentyFourGame) + { + echo("No 24 game is active!"); + return false; + } + %numbers = "0123456789"; + %operators = "+-*x/()"; + %tempchars = $numbers; + %other = strReplace(%tempchars, " ", ""); + + //Check it and make sure it has all the stuff + %equ = strReplace(%equ, " ", ""); + %length = strLen(%equ); + + for(%a = 0; %a < %Length; %a++) + { + %Char = getSubStr(%equ, %a, 1); + if(%a+1 != %Length) + %Next = getSubStr(%equ, %a+1, 1); + else + %Next = " "; + + if(strPos(%numbers @ %operators, %char) < 0) + { + echo("The equation you entered is invalid! Try again."); + return false; + } + if(strPos(%tempchars, %char) < 0 && strPos(%operators, %char) < 0) + { + echo("The equation you entered uses a number you were not given! Try again."); + return false; + } + else if(strPos(%numbers, %next) >= 0 && strPos(%numbers, %char) >= 0) + { + echo("No numbers above 9 please! Try again."); + echo(%next SPC %char SPC %a); + return false; + } + else if(strPos(%operators, %char) > 0) + continue; + + %pos = 2*strPos(%other, %char); + if(%pos < 0) + return "ERROROMG"; + + //Remove it from the allowed numbers + %tempchars = removeWord(%tempchars, %pos/2); + %other = getSubStr(%other, 0, %pos) @ getSubStr(%other, %pos+1, strLen(%other)); + } + + %result = doEquation(%equ); + + if(%result != 24) + { + echo("Your equation resulted to" SPC %result @ ", not 24! Try again."); + return false; + } + + for(%a = 0; %a < 4; %a++) + $numbers = setWord($numbers, %a, getRandom(0, 9)); + + echo("Great job!" SPC %equ SPC "Does result to 24! Here's another set for you:"); + echo($numbers); +} + +//Evaluates an equation without using eval. +function doEquation(%equ) +{ //Validate the input + %equ = strReplace(%equ, " ", "");%equ = strReplace(%equ, "*", "x"); + %equ = strReplace(%equ, "+", " + ");%equ = strReplace(%equ, "x", " x "); + %equ = strReplace(%equ, "/", " / ");%equ = strReplace(%equ, "-", " - "); + + //Parenthesis' + while(strPos(%equ, "(") > -1 && strPos(%equ, ")") > 0) + { + %start = strPos(%equ, "("); + %end = %start; + %level = 1; + while(%level != 0 && %end != strLen(%equ)) + { + %end++; + if(getsubStr(%equ, %end, 1) $= "(") %level++; + if(getsubStr(%equ, %end, 1) $= ")") %level--; + } + if(%level != 0) + return "ERROR"; + %inbrackets = getsubStr(%equ, %start+1, %end - strLen(getsubStr(%equ, 0, %start + 1))); + %leftofbrackets = getsubStr(%equ, 0, %start); + %rightofbrackets = getsubStr(%equ, %end + 1, strLen(%equ) - %end); + %equ = %leftofbrackets @ doEquation(%inbrackets) @ %rightofbrackets; + } + + if(strPos(%equ, "ERROR") >= 0) + return "ERROR"; + + //Multiplication/Division loop + for(%a = 0; %a < getWordCount(%equ); %a++) + { + if(getWord(%equ, %a) $= "x" || getWord(%equ, %a) $= "/" && %a != 0) + { + %f = getWord(%equ, %a - 1); + %l = getWord(%equ, %a + 1); + %o = getWord(%equ, %a); + switch$(%o) + { + case "x": %a--; + %equ = removeWord(removeWord(setWord(%equ, %a+1, %f * %l), %a+2), %a); + case "/": %a--; + %equ = removeWord(removeWord(setWord(%equ, %a+1, %f / %l), %a+2), %a); + } + } + } + + //Addition/Subraction loop + for(%a = 0; %a < getWordCount(%equ); %a++) + { + if(getWord(%equ, %a) $= "+" || getWord(%equ, %a) $= "-" && %a != 0) + { + %f = getWord(%equ, %a - 1); + %l = getWord(%equ, %a + 1); + %o = getWord(%equ, %a); + switch$(%o) + { + case "+": %a--; + %equ = removeWord(removeWord(setWord(%equ, %a+1, %f + %l), %a+2), %a); + case "-": %a--; + %equ = removeWord(removeWord(setWord(%equ, %a+1, %f - %l), %a+2), %a); + } + } + } + return %equ; +} diff --git a/Task/99-Bottles-of-Beer/Applesoft-BASIC/99-bottles-of-beer.bas b/Task/99-Bottles-of-Beer/Applesoft-BASIC/99-bottles-of-beer.applesoft similarity index 100% rename from Task/99-Bottles-of-Beer/Applesoft-BASIC/99-bottles-of-beer.bas rename to Task/99-Bottles-of-Beer/Applesoft-BASIC/99-bottles-of-beer.applesoft diff --git a/Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-1.bas b/Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-1.basic similarity index 100% rename from Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-1.bas rename to Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-1.basic diff --git a/Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-2.bas b/Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-2.basic similarity index 100% rename from Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-2.bas rename to Task/99-Bottles-of-Beer/BASIC/99-bottles-of-beer-2.basic diff --git a/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-1.coffee b/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-1.coffeescript similarity index 100% rename from Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-1.coffee rename to Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-1.coffeescript diff --git a/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-2.coffee b/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-2.coffeescript similarity index 100% rename from Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-2.coffee rename to Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-2.coffeescript diff --git a/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-3.coffee b/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-3.coffeescript similarity index 100% rename from Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-3.coffee rename to Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-3.coffeescript diff --git a/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-4.coffee b/Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-4.coffeescript similarity index 100% rename from Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-4.coffee rename to Task/99-Bottles-of-Beer/CoffeeScript/99-bottles-of-beer-4.coffeescript diff --git a/Task/99-Bottles-of-Beer/Golfscript/99-bottles-of-beer.golf b/Task/99-Bottles-of-Beer/Golfscript/99-bottles-of-beer.golfscript similarity index 100% rename from Task/99-Bottles-of-Beer/Golfscript/99-bottles-of-beer.golf rename to Task/99-Bottles-of-Beer/Golfscript/99-bottles-of-beer.golfscript diff --git a/Task/99-Bottles-of-Beer/Integer-BASIC/99-bottles-of-beer.bas b/Task/99-Bottles-of-Beer/Integer-BASIC/99-bottles-of-beer.integer similarity index 100% rename from Task/99-Bottles-of-Beer/Integer-BASIC/99-bottles-of-beer.bas rename to Task/99-Bottles-of-Beer/Integer-BASIC/99-bottles-of-beer.integer diff --git a/Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-1.max b/Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-1.maxscript similarity index 100% rename from Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-1.max rename to Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-1.maxscript diff --git a/Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-2.max b/Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-2.maxscript similarity index 100% rename from Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-2.max rename to Task/99-Bottles-of-Beer/MAXScript/99-bottles-of-beer-2.maxscript diff --git a/Task/99-Bottles-of-Beer/Mathematica/99-bottles-of-beer.mathematica b/Task/99-Bottles-of-Beer/Mathematica/99-bottles-of-beer.math similarity index 100% rename from Task/99-Bottles-of-Beer/Mathematica/99-bottles-of-beer.mathematica rename to Task/99-Bottles-of-Beer/Mathematica/99-bottles-of-beer.math diff --git a/Task/99-Bottles-of-Beer/Nemerle/99-bottles-of-beer.nemerle b/Task/99-Bottles-of-Beer/Nemerle/99-bottles-of-beer.nemerle new file mode 100644 index 0000000000..9924eb5429 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Nemerle/99-bottles-of-beer.nemerle @@ -0,0 +1,24 @@ +using System; +using System.Console; + +module Bottles +{ + Sing(x : int, bev = "beer", surface = "wall") : void + { + match(x) + { + |0 => WriteLine($"No more bottles of $bev on the $surface, no more bottles of $bev"); + WriteLine($"Go to the store and get some more $bev, 99 bottles of $bev on the $surface") + |1 => WriteLine($"One bottle of $bev on the $surface, one bottle of $bev"); + WriteLine($"Take it down, pass it around, no more bottles of $bev on the $surface") + |_ => WriteLine($"$x bottles of $bev on the $surface, $x bottles of $bev"); + WriteLine($"Take one down and pass it around, $(x-1) bottles of $bev on the $surface") + } + } + + Main() : void + { + foreach (i in [99, 98 .. 0]) + Sing(i) + } +} diff --git a/Task/99-Bottles-of-Beer/NetRexx/99-bottles-of-beer.netrexx b/Task/99-Bottles-of-Beer/NetRexx/99-bottles-of-beer.netrexx new file mode 100644 index 0000000000..7321802e5d --- /dev/null +++ b/Task/99-Bottles-of-Beer/NetRexx/99-bottles-of-beer.netrexx @@ -0,0 +1,19 @@ +beer = "bottles of beer on the wall" +removeOne = "Take one down, pass it arround," +say 99 beer"," +say 99 beer.subword(1,3)"," +loop i = 98 to 2 by -1 + say removeOne + say i beer"." + say + say i beer"," + say i beer.subword(1,3)"," +end +lastCall = "bottle" beer.delword(1,1) +say removeOne +say i lastCall"." +say +say i lastCall"," +say i lastCall.subword(1,3)"," +say removeOne +say "No more" beer diff --git a/Task/99-Bottles-of-Beer/NewLISP/99-bottles-of-beer.newlisp b/Task/99-Bottles-of-Beer/NewLISP/99-bottles-of-beer.newlisp new file mode 100644 index 0000000000..040b39b0b4 --- /dev/null +++ b/Task/99-Bottles-of-Beer/NewLISP/99-bottles-of-beer.newlisp @@ -0,0 +1,12 @@ +(for (n 99 1) +(println n " bottles of beer on the wall," n " bottles of beer. Take one down, pass it around. ") +(println (- n 1) "bottles of beer on the wall!")) + +;;recursive +;;also shows list afterword +(define (rec bottles) + (if (!= 0 bottles) (print "/n" bottles " bottles of beer on the wall" bottles " bottles of beer. +\nTake one down, pass it around, " (- bottles 1) +" bottles of beer on the wall" (rec ( - bottles 1))))(list bottles)) + +(rec 99) diff --git a/Task/99-Bottles-of-Beer/Nial/99-bottles-of-beer.nial b/Task/99-Bottles-of-Beer/Nial/99-bottles-of-beer.nial new file mode 100644 index 0000000000..9e34fdcc87 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Nial/99-bottles-of-beer.nial @@ -0,0 +1,13 @@ +line is fork [ + 0=, 'No more bottles of beer' first, + 1=, 'One bottle of beer' first, + link [string,' bottles of beer' first] +] + +verse is link [ + line, ' on the wall, ' first,line, + '. Take it down and pass it around, ' first, + line (-1+),'on the wall. ' first +] + +bottles is iterate (write verse) reverse count diff --git a/Task/99-Bottles-of-Beer/Nimrod/99-bottles-of-beer.nimrod b/Task/99-Bottles-of-Beer/Nimrod/99-bottles-of-beer.nimrod new file mode 100644 index 0000000000..c7c4ad6527 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Nimrod/99-bottles-of-beer.nimrod @@ -0,0 +1,17 @@ +proc GetBottleNumber(n: int): string = + var bs: string + if n == 0: + bs = "No more bottles" + elif n == 1: + bs = "1 bottle" + else: + bs = $n & " bottles" + return bs & " of beer" + +for bn in countdown(99, 1): + var cur = GetBottleNumber(bn) + echo(cur, " on the wall, ", cur, ".") + echo("Take one down and pass it around, ", GetBottleNumber(bn-1), " on the wall.\n") + +echo "No more bottles of beer on the wall, no more bottles of beer." +echo "Go to the store and buy some more, 99 bottles of beer on the wall." diff --git a/Task/99-Bottles-of-Beer/OCaml/99-bottles-of-beer-1.ocaml b/Task/99-Bottles-of-Beer/OCaml/99-bottles-of-beer-1.ocaml new file mode 100644 index 0000000000..94881f4bbe --- /dev/null +++ b/Task/99-Bottles-of-Beer/OCaml/99-bottles-of-beer-1.ocaml @@ -0,0 +1,6 @@ +for n = 99 downto 1 do + Printf.printf "%d bottles of beer on the wall\n" n; + Printf.printf "%d bottles of beer\n" n; + Printf.printf "Take one down, pass it around\n"; + Printf.printf "%d bottles of beer on the wall\n\n" (pred n); +done diff --git a/Task/99-Bottles-of-Beer/OCaml/99-bottles-of-beer-2.ocaml b/Task/99-Bottles-of-Beer/OCaml/99-bottles-of-beer-2.ocaml new file mode 100644 index 0000000000..213291e123 --- /dev/null +++ b/Task/99-Bottles-of-Beer/OCaml/99-bottles-of-beer-2.ocaml @@ -0,0 +1,25 @@ +let verse n = + let + line2 = function + | 0 -> "No more bottles of beer" + | 1 -> "1 bottle of beer" + | n -> string_of_int n ^ " bottles of beer" + in + let + line1or4 y = line2 y ^ " on the wall" + in + let + line3 = function + | 1 -> "Take it down, pass it around" + | _ -> "Take one down, pass it around" + in + line1or4 n ^ "\n" ^ + line2 n ^ "\n" ^ + line3 n ^ "\n" ^ + line1or4 (n-1) ^ "\n";; + +let rec beer n = + print_endline (verse n); + if n > 1 then beer (n-1);; + +beer 99;; diff --git a/Task/99-Bottles-of-Beer/Oberon-2/99-bottles-of-beer.oberon-2 b/Task/99-Bottles-of-Beer/Oberon-2/99-bottles-of-beer.oberon-2 new file mode 100644 index 0000000000..9099146804 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Oberon-2/99-bottles-of-beer.oberon-2 @@ -0,0 +1,24 @@ +MODULE b99; + +IMPORT Out; + +VAR nr : INTEGER; + +BEGIN + nr := 99; + REPEAT + Out.Int (nr, 4); + Out.String (" bottles of beer on the wall"); + Out.Ln; + Out.Int (nr, 4); + Out.String (" bottles of beer"); + Out.Ln; + Out.String ("Take one down, pass it around"); + Out.Ln; + DEC (nr); + Out.Int (nr, 4); + Out.String (" bottles of beer on the wall"); + Out.Ln; + Out.Ln + UNTIL nr = 0 +END b99. diff --git a/Task/99-Bottles-of-Beer/Objective-C/99-bottles-of-beer.m b/Task/99-Bottles-of-Beer/Objective-C/99-bottles-of-beer.m new file mode 100644 index 0000000000..45536ae6b8 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Objective-C/99-bottles-of-beer.m @@ -0,0 +1,17 @@ +#import + +int main() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + int bottles = 99; + do + { + NSLog(@"%i bottles of beer on the wall\n", bottles); + NSLog(@"%i bottles of beer\n", bottles); + NSLog(@"Take one down, pass it around\n"); + NSLog(@"%i bottles of beer on the wall\n\n", --bottles); + } while (bottles > 0); + + [pool drain]; + return 0; +} diff --git a/Task/99-Bottles-of-Beer/Octave/99-bottles-of-beer.octave b/Task/99-Bottles-of-Beer/Octave/99-bottles-of-beer.octave new file mode 100644 index 0000000000..03a39fcb8c --- /dev/null +++ b/Task/99-Bottles-of-Beer/Octave/99-bottles-of-beer.octave @@ -0,0 +1,23 @@ +function bottles(n) + bottle = "bottle"; + ofbeer = "of beer"; + wall = "on the wall"; + for i = n:-1:0 + if ( i == 1 ) + s = ""; + else + s = "s"; + endif + for j = 0:1 + w = wall; + if ( j == 1 ) + w = ""; + endif + printf("%d %s%s %s %s\n",\ + i, bottle, s, ofbeer, w); + endfor + printf("Take one down, pass it around\n"); + endfor +endfunction + +bottles(99); diff --git a/Task/99-Bottles-of-Beer/OpenEdge-Progress/99-bottles-of-beer.openedge b/Task/99-Bottles-of-Beer/OpenEdge-Progress/99-bottles-of-beer.openedge new file mode 100644 index 0000000000..4f042327cf --- /dev/null +++ b/Task/99-Bottles-of-Beer/OpenEdge-Progress/99-bottles-of-beer.openedge @@ -0,0 +1,33 @@ +DEFINE VARIABLE amountofbottles AS INTEGER NO-UNDO INITIAL 99. +&GLOBAL-DEFINE bbm bottles of beer +&GLOBAL-DEFINE bbs bottle of beer +&GLOBAL-DEFINE otw on the wall +&GLOBAL-DEFINE tow Take one down and pass it around, +&GLOBAL-DEFINE gts Go to the store and buy some more, +FUNCTION drinkBottle RETURNS INTEGER PRIVATE (INPUT bc AS INTEGER) FORWARD. + +OUTPUT TO OUTPUT.txt. +drinkBottle(amountofbottles). +OUTPUT CLOSE. + +FUNCTION drinkBottle RETURNS INTEGER. + IF bc >= 0 THEN DO: + CASE bc: + WHEN 2 THEN + PUT UNFORMATTED bc " {&bbm} {&otw}, " bc " {&bbm}" SKIP + "{&tow} " bc - 1 " {&bbs} {&otw}" SKIP. + WHEN 1 THEN + PUT UNFORMATTED bc " {&bbs} {&otw}, " bc " {&bbs}" SKIP + "{&tow} no more {&bbm} {&otw}" SKIP. + WHEN 0 THEN + PUT UNFORMATTED "no more" " {&bbm} {&otw}, no more {&bbm}" SKIP + "{>s} " amountofbottles " {&bbm} {&otw}" SKIP. + OTHERWISE + PUT UNFORMATTED bc " {&bbm} {&otw}, " bc " {&bbm}" SKIP + "{&tow} " bc - 1 " {&bbm} {&otw}" SKIP. + END CASE. + drinkBottle(bc - 1). + RETURN bc. + END. + RETURN 0. +END FUNCTION. diff --git a/Task/99-Bottles-of-Beer/Order/99-bottles-of-beer-1.order b/Task/99-Bottles-of-Beer/Order/99-bottles-of-beer-1.order new file mode 100644 index 0000000000..2eafda9229 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Order/99-bottles-of-beer-1.order @@ -0,0 +1,17 @@ +#include "order/interpreter.h" + +ORDER_PP +(8let((8B, 8fn(8N, + 8cond((8greater(8N, 1), + 8separate(8N, 8quote(bottles))) + (8equal(8N, 1), + 8quote(1 bottle)) + (8else, + 8quote(no more bottles))))), + 8for_each_in_range + (8fn(8N, + 8print(8ap(8B, 8N) (of beer on the wall,) 8space + 8ap(8B, 8N) (of beer,) 8space + (take one down, pass it around,) 8space + 8ap(8B, 8dec(8N)) (of beer on the wall.))), + 100, 1))) diff --git a/Task/99-Bottles-of-Beer/Order/99-bottles-of-beer-2.order b/Task/99-Bottles-of-Beer/Order/99-bottles-of-beer-2.order new file mode 100644 index 0000000000..0ec7f2587b --- /dev/null +++ b/Task/99-Bottles-of-Beer/Order/99-bottles-of-beer-2.order @@ -0,0 +1,24 @@ +#include "order/interpreter.h" + +#define GEN_phrase(N_bottles, N_minus_1_bottles) \ + N_bottles of beer on the wall, \ + N_bottles of beer, take one down, pass it around, \ + N_minus_1_bottles of beer on the wall. + +#define ORDER_PP_DEF_8bottles \ +ORDER_PP_FN(8fn(8N, \ + 8cond((8greater(8N, 1), \ + 8separate(8N, 8quote(bottles))) \ + (8equal(8N, 1), \ + 8quote(1 bottle)) \ + (8else, \ + 8quote(no more bottles))))) + +ORDER_PP(8for_each_in_range + (8fn(8N, + 8emit(8quote(GEN_phrase), + 8tuple(8bottles(8N), + 8bottles(8dec(8N))))), + 100, 1)) + +#undef GEN_phrase diff --git a/Task/99-Bottles-of-Beer/Oz/99-bottles-of-beer-1.oz b/Task/99-Bottles-of-Beer/Oz/99-bottles-of-beer-1.oz new file mode 100644 index 0000000000..c67b879517 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Oz/99-bottles-of-beer-1.oz @@ -0,0 +1,25 @@ +declare + %% describe the possible solutions of the beer 'puzzle' + proc {BeerDescription Solution} + N = {FD.int 1#99} %% N is an integer in [1, 99] + in + %% distribute starting with highest value + {FD.distribute generic(value:max) [N]} + + Solution = + {Bottles N}#" of beer on the wall\n"# + {Bottles N}#" bottles of beer\n"# + "Take one down, pass it around\n"# + {Bottles N-1}#" of beer on the wall\n" + end + + %% pluralization + proc {Bottles N Txt} + cond N = 1 then Txt ="1 bottle" + else Txt = N#" bottles" + end + end +in + %% show all solutions to the 'puzzle' + {ForAll {SearchAll BeerDescription} + System.showInfo} diff --git a/Task/99-Bottles-of-Beer/Oz/99-bottles-of-beer-2.oz b/Task/99-Bottles-of-Beer/Oz/99-bottles-of-beer-2.oz new file mode 100644 index 0000000000..31fa912174 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Oz/99-bottles-of-beer-2.oz @@ -0,0 +1,14 @@ +declare + fun {Bottles N} + if N == 1 then "1 bottle" + else N#" bottles" + end + end +in + for I in 99..1;~1 do + {System.showInfo + {Bottles I}#" of beer on the wall\n"# + {Bottles I}#" bottles of beer\n"# + "Take one down, pass it around\n"# + {Bottles I-1}#" of beer on the wall\n"} + end diff --git a/Task/99-Bottles-of-Beer/PARI-GP/99-bottles-of-beer.pari b/Task/99-Bottles-of-Beer/PARI-GP/99-bottles-of-beer.pari new file mode 100644 index 0000000000..b9f09b16d4 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PARI-GP/99-bottles-of-beer.pari @@ -0,0 +1,8 @@ +forstep(n=99,3,-1, + print(n" bottles of beer on the wall"); + print(n" bottles of beer"); + print("Take one down, pass it around"); + print(n-1," bottles of beer on the wall\n") +); +print("2 bottles of beer on the wall\n2 bottles of beer\nTake one down, pass it around\n1 bottle of beer on the wall\n"); +print("1 bottle of beer on the wall\n1 bottle of beer\nTake one down, pass it around\nNo more bottles of beer on the wall") diff --git a/Task/99-Bottles-of-Beer/Pascal/99-bottles-of-beer.pascal b/Task/99-Bottles-of-Beer/Pascal/99-bottles-of-beer.pascal new file mode 100644 index 0000000000..bcb5d4cdb3 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Pascal/99-bottles-of-beer.pascal @@ -0,0 +1,21 @@ +procedure BottlesOfBeer; +var + i: Integer; +begin + for i := 99 downto 1 do + begin + if i = 1 then + begin + WriteLn('1 bottle of beer on the wall'); + WriteLn('1 bottle of beer'); + WriteLn('Take one down, pass it around'); + WriteLn('No more bottles of beer on the wall'); + Exit; + end; + WriteLn(Format('%d bottles of beer on the wall', [i])); + WriteLn(Format('%d bottles of beer', [i])); + WriteLn('Take one down, pass it around'); + WriteLn(Format('%d bottles of beer on the wall', [Pred(i)])); + WriteLn(''); + end; +end; diff --git a/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-1.pl6 b/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-1.pl6 new file mode 100644 index 0000000000..6661f5fcad --- /dev/null +++ b/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-1.pl6 @@ -0,0 +1,13 @@ +my $b = 99; + +sub b($b) { + "$b bottle{'s'.substr($b == 1)} of beer"; +} + +repeat while --$b { + .say for "&b($b) on the wall", + b($b), + 'Take one down, pass it around', + "&b($b-1) on the wall", + ''; +} diff --git a/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-2.pl6 b/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-2.pl6 new file mode 100644 index 0000000000..443b15a573 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-2.pl6 @@ -0,0 +1,19 @@ +#= Sings a verse about a certian number of beers, possibly on a wall. +sub sing( + Int $number, #= Number of bottles of beer. + Bool $has_wall = False #= Mention that the beers are on a wall? +) { + my $quantity = $number == 0 ?? "No more" !! $number; + my $plural = $number == 1 ?? "" !! "s"; + my $wall = $has_wall ?? " on the wall" !! ""; + return "{$quantity} bottle{$plural} of beer{$wall}" +} + +for 99...1 -> $bottles { + .say for + sing($bottles, True), + sing($bottles), + "Take one down, pass it around", + sing($bottles-1, True), + ""; +} diff --git a/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-3.pl6 b/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-3.pl6 new file mode 100644 index 0000000000..61d6168c78 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Perl-6/99-bottles-of-beer-3.pl6 @@ -0,0 +1,13 @@ +my @quantities = (99 ... 1), 'No more', 99; +my @bottles = 'bottles' xx 98, 'bottle', 'bottles' xx 2; +my @actions = 'Take one down, pass it around' xx 99, + 'Go to the store, buy some more'; + +for @quantities Z @bottles Z @actions Z + @quantities[1 .. *] Z @bottles[1 .. *] + -> $a, $b, $c, $d, $e { + say "$a $b of beer on the wall"; + say "$a $b of beer"; + say $c; + say "$d $e of beer on the wall\n"; +} diff --git a/Task/99-Bottles-of-Beer/Pike/99-bottles-of-beer-1.pike b/Task/99-Bottles-of-Beer/Pike/99-bottles-of-beer-1.pike new file mode 100644 index 0000000000..c11e67eb40 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Pike/99-bottles-of-beer-1.pike @@ -0,0 +1,8 @@ +int main(){ + for(int i = 99; i > 0; i--){ + write(i + " bottles of beer on the wall, " + i + " bottles of beer.\n"); + write("Take one down and pass it around, " + (i-1) + " bottles of beer on the wall.\n\n"); + } + write("No more bottles of beer on the wall, no more bottles of beer.\n"); + write("Go to the store and buy some more, 99 bottles of beer on the wall.\n"); +} diff --git a/Task/99-Bottles-of-Beer/Pike/99-bottles-of-beer-2.pike b/Task/99-Bottles-of-Beer/Pike/99-bottles-of-beer-2.pike new file mode 100644 index 0000000000..bff17c3793 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Pike/99-bottles-of-beer-2.pike @@ -0,0 +1,24 @@ +// disclaimer: i prefer gingerale + +void main() +{ + array numbers = ({ "no more", "one", "two", "three", "four", "five", "six", "seven", + "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", + "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" }); + array decades = ({ "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", + "ninety" }); + + foreach (decades;; string decade) + { + numbers += decade+(({ "" }) + numbers[1..9])[*]; + } + numbers = reverse(numbers); + + array bottles = ((numbers[*]+" bottles of ale on the wall, ")[*] + + (numbers[*]+" bottles of ale.\n")[*]); + + bottles[-2] = replace(bottles[-2], "one bottles", "one bottle"); + + string song = bottles * "take one down, pass it around,\n"; + write(song); +} diff --git a/Task/99-Bottles-of-Beer/PlainTeX/99-bottles-of-beer.tex b/Task/99-Bottles-of-Beer/PlainTeX/99-bottles-of-beer.tex new file mode 100644 index 0000000000..f2cf2aab6b --- /dev/null +++ b/Task/99-Bottles-of-Beer/PlainTeX/99-bottles-of-beer.tex @@ -0,0 +1,23 @@ +\def\ifbeer{\ifnum\number\bottles} +\def\beers{ + \par\ifbeer>0 \the\bottles~\else No more \fi + bottle\ifbeer=1\else s\fi~of beer% +} + +\def\take #1 down,{ + \par\advance\bottles by -#1 + Take #1 down, pass it around,\par +} + +\long\def\verse{ + \beers~on the wall, \beers. + \take 1 down, % curious TeX \def syntax + \beers~on the wall. + \bigskip +} + +\newcount\bottles\bottles99 +\loop\verse + \ifnum\number\bottles>0\repeat + +\bye diff --git a/Task/99-Bottles-of-Beer/Pop11/99-bottles-of-beer.pop11 b/Task/99-Bottles-of-Beer/Pop11/99-bottles-of-beer.pop11 new file mode 100644 index 0000000000..6eb3f24740 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Pop11/99-bottles-of-beer.pop11 @@ -0,0 +1,11 @@ +define bootles(n); + while n > 0 do + printf(n, '%p bottles of beer on the wall\n'); + printf(n, '%p bottles of beer\n'); + printf('Take one down, pass it around\n'); + n - 1 -> n; + printf(n, '%p bottles of beer on the wall\n'); + endwhile; +enddefine; + +bootles(99); diff --git a/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-1.psh b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-1.psh new file mode 100644 index 0000000000..645f527544 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-1.psh @@ -0,0 +1,7 @@ +for($n=99; $n -gt 0; $n--) { + "$n bottles of beer on the wall" + "$n bottles of beer" + "Take one down, pass it around" + [string]($n-1) + " bottles of beer on the wall" + "" +} diff --git a/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-2.psh b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-2.psh new file mode 100644 index 0000000000..4e1af6aa09 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-2.psh @@ -0,0 +1,8 @@ +[int]$i = 99; +for($i=99; $i -gt 0; $i--) { + write-host $i " bottles of beer on the wall"; + write-host $i " bottles of beer"; + write-host "Take one down, pass it around" + write-host ($i-1) " bottles of beer on the wall" + write-host "" +} diff --git a/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-3.psh b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-3.psh new file mode 100644 index 0000000000..fc1e3107e4 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-3.psh @@ -0,0 +1,4 @@ +$n=99 +do { + "{0} bottles of beer on the wall`n{0} bottles of beer`nTake one down, pass it around`n{1} bottles of beer on the wall`n" -f $n, --$n +} while ($n -gt 0) diff --git a/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-4.psh b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-4.psh new file mode 100644 index 0000000000..95e2390b59 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-4.psh @@ -0,0 +1,4 @@ +$n=99 +do { + "{0} bottles of beer on the wall`n{0} bottles of beer`nTake one down, pass it around`n{1} bottles of beer on the wall`n" -f $n, --$n +} until ($n -eq 0) diff --git a/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-5.psh b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-5.psh new file mode 100644 index 0000000000..0f25d69385 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-5.psh @@ -0,0 +1,3 @@ +$s = "{0} bottles of beer on the wall`n{0} bottles of beer`nTake one down, pass it around`n{1} bottles of beer on the wall`n" +$n=99 +do { $s -f $n, --$n } while ($n -gt 0) diff --git a/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-6.psh b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-6.psh new file mode 100644 index 0000000000..8eaaa70185 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PowerShell/99-bottles-of-beer-6.psh @@ -0,0 +1,4 @@ +99..1 | ForEach-Object { + $s=$( if( $_ -ne 1 ) { 's' } else { '' } ) + $s2=$( if( $_ -ne 2 ) { 's' } else { '' } ) + "$_ bottle$s of beer on the wall`n$_ bottle$s of beer`nTake one down`npass it around`n$( $_ - 1 ) bottle$s2 of beer on the wall`n"} diff --git a/Task/99-Bottles-of-Beer/ProDOS/99-bottles-of-beer.dos b/Task/99-Bottles-of-Beer/ProDOS/99-bottles-of-beer.dos new file mode 100644 index 0000000000..2e923239d6 --- /dev/null +++ b/Task/99-Bottles-of-Beer/ProDOS/99-bottles-of-beer.dos @@ -0,0 +1,16 @@ +editvar /newvar /value=a=99 +:a +printline -a- bottles of beer on the wall +printline -a- bottles of beer +printline Take one down, pass it round +editvar /newvar /value=a=-a-1 +if -a- /hasvalue 1 goto :1 +printline -a- bottles of beer on the wall. +goto :a +:1 +printline 1 bottle of beer on the wall +printline 1 bottle of beer +printline take it down, pass it round +printline no bottles of beer on the wall. +editvar /newvar /value=b /userinput=1 /title=Keep drinking? +if -b- /hasvalue yes goto :a else exitprogram diff --git a/Task/99-Bottles-of-Beer/PureBasic/99-bottles-of-beer-1.purebasic b/Task/99-Bottles-of-Beer/PureBasic/99-bottles-of-beer-1.purebasic new file mode 100644 index 0000000000..b1c205e835 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PureBasic/99-bottles-of-beer-1.purebasic @@ -0,0 +1,13 @@ +If OpenConsole() + Define Bottles=99 + While Bottles + PrintN(Str(Bottles)+" bottles of beer on the wall") + PrintN(Str(Bottles)+" bottles of beer") + PrintN("Take one down, pass it around") + Bottles-1 + PrintN(Str(Bottles)+" bottles of beer on the wall"+#CRLF$) + Wend + + PrintN(#CRLF$+#CRLF$+"Press ENTER to exit"):Input() + CloseConsole() +EndIf diff --git a/Task/99-Bottles-of-Beer/PureBasic/99-bottles-of-beer-2.purebasic b/Task/99-Bottles-of-Beer/PureBasic/99-bottles-of-beer-2.purebasic new file mode 100644 index 0000000000..3e437bb017 --- /dev/null +++ b/Task/99-Bottles-of-Beer/PureBasic/99-bottles-of-beer-2.purebasic @@ -0,0 +1,59 @@ +Prototype Wall_Action(*Self, Number.i) + +Structure WallClass + Inventory.i + AddBottle.Wall_Action + DrinkAndSing.Wall_Action +EndStructure + +Procedure.s _B(n, Short=#False) + Select n + Case 0 : result$="No more bottles " + Case 1 : result$=Str(n)+" bottle of beer" + Default: result$=Str(n)+" bottles of beer" + EndSelect + If Not Short: result$+" on the wall": EndIf + ProcedureReturn result$+#CRLF$ +EndProcedure + +Procedure PrintBottles(*Self.WallClass, n) + Bottles$=" bottles of beer " + Bottle$ =" bottle of beer " + txt$ = _B(*Self\Inventory) + txt$ + _B(*Self\Inventory, #True) + txt$ + "Take one down, pass it around"+#CRLF$ + *Self\AddBottle(*Self, -1) + txt$ + _B(*self\Inventory) + PrintN(txt$) + ProcedureReturn *Self\Inventory +EndProcedure + +Procedure AddBottle(*Self.WallClass, n) + i=*Self\Inventory+n + If i>=0 + *Self\Inventory=i + EndIf +EndProcedure + +Procedure InitClass() + *class.WallClass=AllocateMemory(SizeOf(WallClass)) + If *class + InitializeStructure(*class, WallClass) + With *class + \AddBottle =@AddBottle() + \DrinkAndSing =@PrintBottles() + EndWith + EndIf + ProcedureReturn *class +EndProcedure + +If OpenConsole() + *MyWall.WallClass=InitClass() + If *MyWall + *MyWall\AddBottle(*MyWall, 99) + While *MyWall\DrinkAndSing(*MyWall, #True): Wend + ; + PrintN(#CRLF$+#CRLF$+"Press ENTER to exit"):Input() + CloseConsole() + EndIf +EndIf diff --git a/Task/99-Bottles-of-Beer/Qore/99-bottles-of-beer-1.qore b/Task/99-Bottles-of-Beer/Qore/99-bottles-of-beer-1.qore new file mode 100644 index 0000000000..d641df7b4a --- /dev/null +++ b/Task/99-Bottles-of-Beer/Qore/99-bottles-of-beer-1.qore @@ -0,0 +1,10 @@ +#!/usr/bin/env qore + +%enable-all-warnings + +for (my $i = 99; $i > 0; $i--) { + printf("%d bottles of beer on the wall\n", $i); + printf("%d bottles of beer\n", $i); + printf("take one down, pass it around\n"); + printf("%d bottles of beer on the wall\n", $i); +} diff --git a/Task/99-Bottles-of-Beer/Qore/99-bottles-of-beer-2.qore b/Task/99-Bottles-of-Beer/Qore/99-bottles-of-beer-2.qore new file mode 100644 index 0000000000..b4e5f08c45 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Qore/99-bottles-of-beer-2.qore @@ -0,0 +1,28 @@ +#!/usr/bin/env qore + +%enable-all-warnings +%require-types + +# global variables (truly shared among threads) must be declared with "our" keyword +%require-our + +our Counter $count(); + +sub t() { + on_exit { + $count.dec(); + } + my int $i = gettid()-1; + printf("%d bottles of beer on the wall\n", $i); + printf("%d bottles of beer\n", $i); + printf("take one down, pass it around\n"); + printf("%d bottles of beer on the wall\n", $i); +} + +#-- following run by main thread +for (my int $i = 99; $i > 0; $i--) { + $count.inc(); + background t(); +} + +$count.waitForZero(); diff --git a/Task/99-Bottles-of-Beer/Quill/99-bottles-of-beer.quill b/Task/99-Bottles-of-Beer/Quill/99-bottles-of-beer.quill new file mode 100644 index 0000000000..e9eb9b8401 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Quill/99-bottles-of-beer.quill @@ -0,0 +1,15 @@ +bottles := void(int count) { + (count > 0) if { + new_count := count - 1; + ( + count, " bottles of beer on the wall", nl, + count, " bottles of beer", nl, + "Take one down, pass it around", nl, + new_count, " bottles of beer on the wall" + ) print; + new_count bottles + } else { + "No more bottles of beer on the wall!" print + } +}; +99 bottles diff --git a/Task/99-Bottles-of-Beer/REALbasic/99-bottles-of-beer.realbasic b/Task/99-Bottles-of-Beer/REALbasic/99-bottles-of-beer.realbasic new file mode 100644 index 0000000000..97a23b973b --- /dev/null +++ b/Task/99-Bottles-of-Beer/REALbasic/99-bottles-of-beer.realbasic @@ -0,0 +1,8 @@ +dim bottles as Integer = 99 +While bottles > 0 + Print(str(bottles) + " bottles of beer on the wall") + Print(str(bottles) + " bottles of beer") + Print("Take one down, pass it around") + bottles = bottles - 1 + Print(str(bottles) + " bottles of beer on the wall") +Wend diff --git a/Task/99-Bottles-of-Beer/REBOL/99-bottles-of-beer.rebol b/Task/99-Bottles-of-Beer/REBOL/99-bottles-of-beer.rebol new file mode 100644 index 0000000000..d2825dbf2c --- /dev/null +++ b/Task/99-Bottles-of-Beer/REBOL/99-bottles-of-beer.rebol @@ -0,0 +1,21 @@ +rebol [ + Title: "99 Bottles of Beer" + Author: oofoe + Date: 2009-12-11 + URL: http://rosettacode.org/wiki/99_Bottles_of_Beer +] + +; The 'bottles' function maintains correct grammar. + +bottles: func [n /local b][ + b: either 1 = n ["bottle"]["bottles"] + if 0 = n [n: "no"] + reform [n b] +] + +for n 99 1 -1 [print [ + bottles n "of beer on the wall" crlf + bottles n "of beer" crlf + "Take one down, pass it around" crlf + bottles n - 1 "of beer on the wall" crlf +]] diff --git a/Task/99-Bottles-of-Beer/RPL-2/99-bottles-of-beer-1.rpl b/Task/99-Bottles-of-Beer/RPL-2/99-bottles-of-beer-1.rpl new file mode 100644 index 0000000000..28972368c2 --- /dev/null +++ b/Task/99-Bottles-of-Beer/RPL-2/99-bottles-of-beer-1.rpl @@ -0,0 +1,22 @@ +BEER +<< + 99 do + dup ->str PLURAL " on the wall," + disp + dup ->str PLURAL "." + disp + "Take one down, pass it around," disp + 1 - + if dup then + dup ->str + else + "No more" + end + PLURAL " on the wall." + disp + "" disp + until dup 0 == end + drop +>> + +PLURAL +<< + " bottle" + over if 1 <> then "s" + end " of beer" + +>> diff --git a/Task/99-Bottles-of-Beer/RPL-2/99-bottles-of-beer-2.rpl b/Task/99-Bottles-of-Beer/RPL-2/99-bottles-of-beer-2.rpl new file mode 100644 index 0000000000..77f92496c3 --- /dev/null +++ b/Task/99-Bottles-of-Beer/RPL-2/99-bottles-of-beer-2.rpl @@ -0,0 +1,43 @@ +BOTTLES +<< + // Child process is started. + 100 'RECURSIVE' detach + -> PROC + << + do PROC recv until end drop2 + + do + // Parent waits for datas sent by child. + do PROC recv until end + list-> drop dup " on the wall," + disp "." + disp + "Take one down, pass it around," disp + + if dup 1 same not then + do PROC recv until end list-> drop + else + 1 "No more bottles of beer" + end + " on the wall." + disp drop "" disp + until + 1 same + end + + // Parent waits for Child's death. + PROC wfproc + >> +>> + +RECURSIVE +<< + while + dup + repeat + 1 - dup dup ->str + if over 1 > then " bottles " else " bottle " end + + "of beer" + 2 ->list dup + // Child send datas to parent process. + send send + // Recursive function is caught. + RECURSIVE + end +>> diff --git a/Task/99-Bottles-of-Beer/Rascal/99-bottles-of-beer.rascal b/Task/99-Bottles-of-Beer/Rascal/99-bottles-of-beer.rascal new file mode 100644 index 0000000000..ce71f3d191 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Rascal/99-bottles-of-beer.rascal @@ -0,0 +1,16 @@ +module demo::basic::Bottles + +import IO; + +str bottles(0) = "no more bottles"; +str bottles(1) = "1 bottle"; +default str bottles(int n) = " bottles"; + +public void sing(){ + for(n <- [99 .. 1]){ + println(" of beer on the wall, of beer."); + println("Take one down, pass it around, of beer on the wall.\n"); + } + println("No more bottles of beer on the wall, no more bottles of beer."); + println("Go to the store and buy some more, 99 bottles of beer on the wall."); +} diff --git a/Task/99-Bottles-of-Beer/Retro/99-bottles-of-beer.retro b/Task/99-Bottles-of-Beer/Retro/99-bottles-of-beer.retro new file mode 100644 index 0000000000..da53f38f4a --- /dev/null +++ b/Task/99-Bottles-of-Beer/Retro/99-bottles-of-beer.retro @@ -0,0 +1,16 @@ +[ dup "%d bottles" puts ] +[ "1 bottle" puts ] +[ "no more bottles" puts ] +create bottles , , , + +: .bottles dup 2 ^math'min bottles + @ do ; +: .beer .bottles " of beer" puts ; +: .wall .beer " on the wall" puts ; +: .take "Take one down, pass it around" puts ; +: .verse .wall cr .beer cr + 1- .take cr .wall cr ; +: ?dup dup 0; ; +: verses [ cr .verse dup 0 <> ] while drop ; + +99 verses +bye diff --git a/Task/99-Bottles-of-Beer/Run-BASIC/99-bottles-of-beer.run b/Task/99-Bottles-of-Beer/Run-BASIC/99-bottles-of-beer.run new file mode 100644 index 0000000000..fdbfabe74e --- /dev/null +++ b/Task/99-Bottles-of-Beer/Run-BASIC/99-bottles-of-beer.run @@ -0,0 +1,12 @@ +b$ = " bottles" +for bottles = 99 To 1 Step -1 + If (bottles = 1) then b$ = " bottle" + print bottles;b$;" of beer on the wall, " + print bottles ;b$;" of beer" + print "Take one down, pass it around, " + if bottles = 1 then + print "No bottles of beer on the wall" + else + print bottles - 1;b$;" of beer on the wall.";chr$(10) + end if +next bottles diff --git a/Task/99-Bottles-of-Beer/SNOBOL4/99-bottles-of-beer-1.sno b/Task/99-Bottles-of-Beer/SNOBOL4/99-bottles-of-beer-1.sno new file mode 100644 index 0000000000..654112f6a1 --- /dev/null +++ b/Task/99-Bottles-of-Beer/SNOBOL4/99-bottles-of-beer-1.sno @@ -0,0 +1,8 @@ + x = 99 +again output = X " bottles of beer on the wall" + output = X " bottles of beer" ?eq(X,0) :s(zero) + output = "Take one down, pass it around" + output = (X = gt(x,0) X - 1) " bottle of beer on the wall..." :s(again) +zero output = "Go to store, get some more" + output = "99 bottles of beer on the wall" +end diff --git a/Task/99-Bottles-of-Beer/SNOBOL4/99-bottles-of-beer-2.sno b/Task/99-Bottles-of-Beer/SNOBOL4/99-bottles-of-beer-2.sno new file mode 100644 index 0000000000..c0898ec060 --- /dev/null +++ b/Task/99-Bottles-of-Beer/SNOBOL4/99-bottles-of-beer-2.sno @@ -0,0 +1,17 @@ + define('bottles(x)') + nl = char(13) char(10) ;* Win/DOS, change as needed + s2 = ' of beer'; s3 = ' on the wall' + s4 = 'Take one down, pass it around' + s5 = 'Go to the store, get some more' :(bottles_end) +bottles s1 = (s1 = ' Bottle') ne(x,1) 's' + output = nl x s1 s2 s3 nl x s1 s2 + x = gt(x,0) x - 1 :f(done) + s1 = (s1 = ' Bottle') ne(x,1) 's' + output = s4 nl x s1 s2 s3 :(return) +done output = s5 nl 99 s1 s2 s3 :(return) +bottles_end + +* # Test and display, only 2 bottles! + n = 2 +loop bottles(n); n = gt(n,0) n - 1 :s(loop) +end diff --git a/Task/99-Bottles-of-Beer/SQL/99-bottles-of-beer.sql b/Task/99-Bottles-of-Beer/SQL/99-bottles-of-beer.sql new file mode 100644 index 0000000000..f191022cf4 --- /dev/null +++ b/Task/99-Bottles-of-Beer/SQL/99-bottles-of-beer.sql @@ -0,0 +1,29 @@ +DELIMITER $$ +DROP PROCEDURE IF EXISTS bottles_$$ +CREATE pROCEDURE `bottles_`(inout bottle_count int, inout song text) +BEGIN +declare bottles_text varchar(30); + + +IF bottle_count > 0 THEN + + + if bottle_count != 1 then + set bottles_text := ' bottles of beer '; + else set bottles_text = ' bottle of beer '; + end if; + + SELECT concat(song, bottle_count, bottles_text, ' \n') INTO song; + SELECT concat(song, bottle_count, bottles_text, 'on the wall\n') INTO song; + SELECT concat(song, 'Take one down, pass it around\n') into song; + SELECT concat(song, bottle_count -1 , bottles_text, 'on the wall\n\n') INTO song; + set bottle_count := bottle_count -1; + CALL bottles_( bottle_count, song); + END IF; +END$$ + +set @bottles=99; +set max_sp_recursion_depth=@bottles; +set @song=''; +call bottles_( @bottles, @song); +select @song; diff --git a/Task/99-Bottles-of-Beer/Seed7/99-bottles-of-beer.seed7 b/Task/99-Bottles-of-Beer/Seed7/99-bottles-of-beer.seed7 new file mode 100644 index 0000000000..4d520f05d9 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Seed7/99-bottles-of-beer.seed7 @@ -0,0 +1,19 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: number is 0; + begin + for number range 99 downto 2 do + write( number <& " bottles of beer on the wall, "); + writeln( number <& " bottles of beer."); + write( "Take one down and pass it around, "); + writeln( pred(number) <& " bottles of beer on the wall."); + writeln; + end for; + writeln("1 bottle of beer on the wall, 1 bottle of beer."); + writeln("Take one down and pass it around, no more bottles of beer on the wall."); + writeln; + writeln("No more bottles of beer on the wall, no more bottles of beer."); + writeln("Go to the store and buy some more, 99 bottles of beer on the wall.") + end func; diff --git a/Task/99-Bottles-of-Beer/Shiny/99-bottles-of-beer.shiny b/Task/99-Bottles-of-Beer/Shiny/99-bottles-of-beer.shiny new file mode 100644 index 0000000000..e923165ed9 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Shiny/99-bottles-of-beer.shiny @@ -0,0 +1,14 @@ +for 99 i:99-a + s: if i > 1 's' end + + if i > 0 and i < 99 switch + if i = 6 say "A six-pack on the wall!\n" break + if i = 24 say "A carton on the wall!\n" break + say "$i bottle$s of beer on the wall!\n" + ends + + say "$i bottle$s of beer on the wall," + say "$i bottle$s of beer!" + say "Take one down, pass it around!" +end +say "Aww...no more bottles of beer on the wall... it must be your shout :)" diff --git a/Task/99-Bottles-of-Beer/Slate/99-bottles-of-beer.slate b/Task/99-Bottles-of-Beer/Slate/99-bottles-of-beer.slate new file mode 100644 index 0000000000..a39e5ee1a8 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Slate/99-bottles-of-beer.slate @@ -0,0 +1,15 @@ +n@(Integer traits) bottleVerse +[| nprinted | + nprinted: n printString ; ' bottle' ; (n > 1 ifTrue: ['s'] ifFalse: ['']) ; ' of beer'. + inform: nprinted ; ' on the wall.'. + inform: nprinted. + inform: 'Take one down, pass it around.'. + inform: nprinted ; ' on the wall.'. +]. + +x@(Integer traits) bottles +[ + x downTo: 0 do: #bottleVerse `er +]. + +99 bottles. diff --git a/Task/99-Bottles-of-Beer/Squirrel/99-bottles-of-beer.net b/Task/99-Bottles-of-Beer/Squirrel/99-bottles-of-beer.net new file mode 100644 index 0000000000..99eb490266 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Squirrel/99-bottles-of-beer.net @@ -0,0 +1,15 @@ +function rec(bottles) +{ + if (bottles > 0) + { + print(bottles+" bottles of beer on the wall\n") + print(bottles+" bottles of beer\n"); + print("Take one down, pass it around\n"); + print(--bottles+" bottles of beer on the wall\n\n") + return rec(bottles); + } + print("No more bottles of beer on the wall, no more bottles of beer\n"); + print("Go to the store and get some more beer, 99 bottles of beer on the wall\n"); +} + +rec(99); diff --git a/Task/99-Bottles-of-Beer/Standard-ML/99-bottles-of-beer.ml b/Task/99-Bottles-of-Beer/Standard-ML/99-bottles-of-beer.ml new file mode 100644 index 0000000000..aebc852fa3 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Standard-ML/99-bottles-of-beer.ml @@ -0,0 +1,7 @@ +fun bottles 0 = () + | bottles x = ( print (Int.toString x ^ " bottles of beer on the wall\n"); + print (Int.toString x ^ " bottles of beer\n"); + print "Take one down, pass it around\n"; + print (Int.toString (x-1) ^ " bottles of beer on the wall\n"); + bottles (x-1) + ) diff --git a/Task/99-Bottles-of-Beer/Suneido/99-bottles-of-beer.suneido b/Task/99-Bottles-of-Beer/Suneido/99-bottles-of-beer.suneido new file mode 100644 index 0000000000..d110a365f7 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Suneido/99-bottles-of-beer.suneido @@ -0,0 +1,12 @@ +i = 99 +while (i > 0) + { + Print(i $ ' bottles of beer on the wall') + Print(i $ ' bottles of beer') + Print('Take one down, pass it around') + --i + if i is 0 + Print('Ahh poo, we are out of beer\n') + else + Print(i $ ' bottles of beer on the wall\n') + } diff --git a/Task/99-Bottles-of-Beer/TI-83-BASIC/99-bottles-of-beer.ti-83 b/Task/99-Bottles-of-Beer/TI-83-BASIC/99-bottles-of-beer.ti-83 new file mode 100644 index 0000000000..cca30e2823 --- /dev/null +++ b/Task/99-Bottles-of-Beer/TI-83-BASIC/99-bottles-of-beer.ti-83 @@ -0,0 +1,13 @@ +PROGRAM:BEER +:For(I,99,1,-1) +:Disp I +:Disp "BOTTLES OF BEER" +:Disp "ON THE WALL," +:Disp I +:Pause "BOTTLES OF BEER," +:Disp "TAKE ONE DOWN," +:Disp "PASS IT AROUND," +:Disp I-1 +:Disp "BOTTLES OF BEER" +:Disp "ON THE WALL." +:End diff --git a/Task/99-Bottles-of-Beer/TI-89-BASIC/99-bottles-of-beer.ti-89 b/Task/99-Bottles-of-Beer/TI-89-BASIC/99-bottles-of-beer.ti-89 new file mode 100644 index 0000000000..be967a6f9c --- /dev/null +++ b/Task/99-Bottles-of-Beer/TI-89-BASIC/99-bottles-of-beer.ti-89 @@ -0,0 +1,47 @@ +Prgm + Local i,plural,clockWas,t,k,wait + "s" → plural + 0 → k + isClkOn() → clockWas + + Define wait() = Prgm + EndPrgm + + ClockOn + + For i,99,0,–1 + Disp "" + Disp string(i) & " bottle" & plural & " of beer on the" + Disp "wall, " & string(i) & " bottle" & plural & " of beer." + + getTime()[3]→t + While getTime()[3] = t and k = 0 : getKey() → k : EndWhile + If k ≠ 0 Then : Exit : EndIf + + Disp "Take one down, pass it" + Disp "around." + + getTime()[3]→t + While getTime()[3] = t and k = 0 : getKey() → k : EndWhile + If k ≠ 0 Then : Exit : EndIf + + If i - 1 = 1 Then + "" → plural + EndIf + If i > 1 Then + Disp string(i-1) & " bottle" & plural & " of beer on the" + Disp "wall." + Else + Disp "No more bottles of beer on" + Disp "the wall." + EndIf + + getTime()[3]→t + While abs(getTime()[3] - t)<2 and k = 0 : getKey() → k : EndWhile + If k ≠ 0 Then : Exit : EndIf + + EndFor + If not clockWas Then + ClockOff + ENdIf +EndPrgm diff --git a/Task/99-Bottles-of-Beer/TIScript/99-bottles-of-beer.tiscript b/Task/99-Bottles-of-Beer/TIScript/99-bottles-of-beer.tiscript new file mode 100644 index 0000000000..643af04c35 --- /dev/null +++ b/Task/99-Bottles-of-Beer/TIScript/99-bottles-of-beer.tiscript @@ -0,0 +1,8 @@ +var beer = 99; +while (beer > 0) +{ + stdout.printf( "%d bottles of beer on the wall\n", beer); + stdout.printf( "%d bottles of beer\n", beer); + stdout.println( "Take one down, pass it around" ); + stdout.printf( "%d bottles of beer on the wall\n", --beer ); +} diff --git a/Task/99-Bottles-of-Beer/TUSCRIPT/99-bottles-of-beer.tuscript b/Task/99-Bottles-of-Beer/TUSCRIPT/99-bottles-of-beer.tuscript new file mode 100644 index 0000000000..0b57e90a61 --- /dev/null +++ b/Task/99-Bottles-of-Beer/TUSCRIPT/99-bottles-of-beer.tuscript @@ -0,0 +1,15 @@ +$$ MODE TUSCRIPT +LOOP bottle=1,100 +SET bottlenr=100-bottle +IF (bottlenr==0) THEN +PRINT "no bottle of beer on the wall" +EXIT +ELSEIF (bottlenr==1) THEN +PRINT bottlenr, " bottle of beer on the wall" +PRINT bottlenr, " bottle of beer" +ELSE +PRINT bottlenr, " bottles of beer on the wall" +PRINT bottlenr, " bottles of beer" +ENDIF +PRINT "Take one down, pass it around" +ENDLOOP diff --git a/Task/99-Bottles-of-Beer/TXR/99-bottles-of-beer-1.txr b/Task/99-Bottles-of-Beer/TXR/99-bottles-of-beer-1.txr new file mode 100644 index 0000000000..fd89671b3c --- /dev/null +++ b/Task/99-Bottles-of-Beer/TXR/99-bottles-of-beer-1.txr @@ -0,0 +1,32 @@ +@(next :list @(mapcar* (fun tostring) (range 99 -1 -1))) +@(collect) +@number +@ (trailer) +@number_less_1 +@ (cases) +@ (bind number "1") +@ (output) +1 bottle of beer one the wall +1 bottle of beer +@ (end) +@ (or) +@ (output) +@number bottles of beer one the wall +@number bottles of beer +@ (end) +@ (end) +@ (cases) +@ (bind number "0") +@ (output) +Go to the store and get some more, +99 bottles of beer on the wall! + +@ (end) +@ (or) +@ (output) +Take one down and pass it around +@number_less_1 bottles of beer on the wall + +@ (end) +@ (end) +@(end) diff --git a/Task/99-Bottles-of-Beer/TXR/99-bottles-of-beer-2.txr b/Task/99-Bottles-of-Beer/TXR/99-bottles-of-beer-2.txr new file mode 100644 index 0000000000..aa2098c81e --- /dev/null +++ b/Task/99-Bottles-of-Beer/TXR/99-bottles-of-beer-2.txr @@ -0,0 +1 @@ +@(next :list @(mapcar* (fun tostring) (repeat (range 99 0 -1)))) diff --git a/Task/99-Bottles-of-Beer/TorqueScript/99-bottles-of-beer.torquescript b/Task/99-Bottles-of-Beer/TorqueScript/99-bottles-of-beer.torquescript new file mode 100644 index 0000000000..7b99e410a5 --- /dev/null +++ b/Task/99-Bottles-of-Beer/TorqueScript/99-bottles-of-beer.torquescript @@ -0,0 +1,7 @@ +for(%i = 99; %i >= 0; %i--) +{ + %n = %i - 1; + echo(%i SPC (%n == 1 ? "bottle" : "bottles") SPC "of beer on the wall ~"); + echo("Take one down, pass it around,"); + echo(%n SPC (%i == 1 ? "bottle" : "bottles") SPC "of beer on the wall."); +} diff --git a/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-1.sh b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-1.sh new file mode 100644 index 0000000000..3e44f9aaa1 --- /dev/null +++ b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-1.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +i=99 s=s + +while [ $i -gt 0 ]; do + echo "$i bottle$s of beer on the wall" + echo "$i bottle$s of beer +Take one down, pass it around" + # POSIX allows for $(( i - 1 )) but some older Unices didn't have that + i=`expr $i - 1` + [ $i -eq 1 ] && s= || s=s + echo "$i bottle$s of beer on the wall +" +done diff --git a/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-2.sh b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-2.sh new file mode 100644 index 0000000000..a2d3635e6a --- /dev/null +++ b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-2.sh @@ -0,0 +1,22 @@ +bottles() { + beer=$1 + [ $((beer)) -gt 0 ] && echo -n $beer || echo -n "No more" + echo -n " bottle" + [ $((beer)) -ne 1 ] && echo -n "s" + echo -n " of beer" +} + +for ((i=99;i>=0;i--)); do + ((remaining=i)) + echo "$(bottles $remaining) on the wall" + echo "$(bottles $remaining)" + if [ $((remaining)) -eq 0 ]; then + echo "Go to the store and buy some more" + ((remaining+=99)) + else + echo "Take one down, pass it around" + ((remaining--)) + fi + echo "$(bottles $remaining) on the wall" + echo +done diff --git a/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-3.sh b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-3.sh new file mode 100644 index 0000000000..efc12cb2d5 --- /dev/null +++ b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-3.sh @@ -0,0 +1,15 @@ +@ i=99 +set s=s +while ($i > 0) + echo "$i bottle$s of beer on the wall" + echo "$i bottle$s of beer" + echo "Take one down, pass it around" + @ i = $i - 1 + if ($i == 1) then + set s= + else + set s=s + endif + echo "$i bottle$s of beer on the wall" + echo "" +end diff --git a/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-4.sh b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-4.sh new file mode 100644 index 0000000000..e481629d4e --- /dev/null +++ b/Task/99-Bottles-of-Beer/UNIX-Shell/99-bottles-of-beer-4.sh @@ -0,0 +1,11 @@ +i = 99 +s = s +while {test $i -gt 0} { + echo $i bottle$s of beer on the wall + echo $i bottle$s of beer + echo Take one down, pass it around + i = `{expr $i - 1} + if {test $i -eq 1} {s = ''} {s = s} + echo $i bottle$s of beer on the wall + echo +} diff --git a/Task/99-Bottles-of-Beer/UnixPipes/99-bottles-of-beer.unixpipes b/Task/99-Bottles-of-Beer/UnixPipes/99-bottles-of-beer.unixpipes new file mode 100644 index 0000000000..6e1783b4b0 --- /dev/null +++ b/Task/99-Bottles-of-Beer/UnixPipes/99-bottles-of-beer.unixpipes @@ -0,0 +1,15 @@ +# Unix Pipes, avoiding all the turing complete sub programs like sed, awk,dc etc. +mkdir 99 || exit 1 +trap "rm -rf 99" 1 2 3 4 5 6 7 8 + +(cd 99 + mkfifo p.b1 p.b2 p.verse1 p.wall p.take + yes "on the wall" > p.wall & + yes "Take one down and pass it around, " > p.take & + (yes "bottles of beer" | nl -s\ | head -n 99 | tac | head -n 98 ; + echo "One bottle of beer"; + echo "No more bottles of beer") | tee p.b1 p.b2 | + paste -d"\ " - p.wall p.b1 p.take | head -n 99 > p.verse1 & + cat p.b2 | tail -99 | paste -d"\ " p.verse1 - p.wall | head -n 99 +) +rm -rf 99 diff --git a/Task/99-Bottles-of-Beer/Ursala/99-bottles-of-beer.ursala b/Task/99-Bottles-of-Beer/Ursala/99-bottles-of-beer.ursala new file mode 100644 index 0000000000..e610d7fd54 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Ursala/99-bottles-of-beer.ursala @@ -0,0 +1,27 @@ +#import nat + +# each function takes a natural number to a block of text + +quantity = # forms the plural as needed + +~&iNC+ --' of beer'+ ~&?( + 1?=/'1 bottle'! --' bottles'+ ~&h+ %nP, + 'no more bottles'!) + +verse = + +^(successor,~&); ("s","n"). -[ + -[quantity "s"]- on the wall, -[quantity "s"]-, + Take one down and pass it around, -[quantity "n"]- on the wall.]- + +refrain "n" = + +-[ + No more bottles of beer on the wall, -[quantity 0]-. + Go to the store and buy some more, -[quantity "n"]- on the wall.]- + +whole_song "n" = ~&ittt2BSSL (verse*x iota "n")-- + +#show+ + +main = whole_song 99 diff --git a/Task/99-Bottles-of-Beer/V/99-bottles-of-beer.v b/Task/99-Bottles-of-Beer/V/99-bottles-of-beer.v new file mode 100644 index 0000000000..f620fe2da9 --- /dev/null +++ b/Task/99-Bottles-of-Beer/V/99-bottles-of-beer.v @@ -0,0 +1,12 @@ +[bottles + [newline '' puts]. + [beer + [0 =] ['No more bottles of beer' put] if + [1 =] ['One bottle of beer' put] if + [1 >] [dup put ' bottles of beer' put] if]. + [0 =] [newline] + [beer ' on the wall, ' put beer newline + 'Take one down and pass it around, ' put pred beer ' on the wall' puts newline] + tailrec]. + +99 bottles diff --git a/Task/99-Bottles-of-Beer/VBA/99-bottles-of-beer.vba b/Task/99-Bottles-of-Beer/VBA/99-bottles-of-beer.vba new file mode 100644 index 0000000000..687958411a --- /dev/null +++ b/Task/99-Bottles-of-Beer/VBA/99-bottles-of-beer.vba @@ -0,0 +1,22 @@ +Public Function countbottles(n As Integer, liquid As String) As String + countbottles = IIf(n > 1, Format$(n), IIf(n = 0, "no more", "one")) & " bottle" & IIf(n = 1, "", "s") & " of " & liquid +End Function + +Public Sub drink(fullbottles As Integer, Optional liquid As String = "beer") +Static emptybottles As Integer + + Debug.Print countbottles(fullbottles, liquid) & " on the wall" + Debug.Print countbottles(fullbottles, liquid) + + If fullbottles > 0 Then + Debug.Print "take " & IIf(fullbottles > 1, "one", "it") & " down, pass it around" + Debug.Print countbottles(fullbottles - 1, liquid) & " on the wall" + Debug.Print + emptybottles = emptybottles + 1 + drink fullbottles - 1, liquid + Else + Debug.Print "go to the store and buy some more" + Debug.Print countbottles(emptybottles, liquid) & " on the wall" + End If + +End Sub diff --git a/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-1.vbscript b/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-1.vbscript new file mode 100644 index 0000000000..cb388bce53 --- /dev/null +++ b/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-1.vbscript @@ -0,0 +1,37 @@ +sub song( numBottles ) + dim i + for i = numBottles to 0 step -1 + if i > 0 then + wscript.echo pluralBottles(i) & " of beer on the wall" + wscript.echo pluralBottles(i) & " of beer" + if i = 1 then + wscript.echo "take it down" + else + wscript.echo "take one down" + end if + wscript.echo "and pass it round" + wscript.echo pluralBottles(i-1) & " of beer on the wall" + wscript.echo + else + wscript.echo "no more bottles of beer on the wall" + wscript.echo "no more bottles of beer" + wscript.echo "go to the store" + wscript.echo "and buy some more" + wscript.echo pluralBottles(numBottles) & " of beer on the wall" + wscript.echo + end if + next +end sub + +function pluralBottles( n ) + select case n + case 1 + pluralBottles = "one bottle" + case 0 + pluralBottles = "no more bottles" + case else + pluralBottles = n & " bottles" + end select +end function + +song 3 diff --git a/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-2.vbscript b/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-2.vbscript new file mode 100644 index 0000000000..6d6436a1dc --- /dev/null +++ b/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-2.vbscript @@ -0,0 +1,23 @@ +3 bottles of beer on the wall +3 bottles of beer +take one down +and pass it round +2 bottles of beer on the wall + +2 bottles of beer on the wall +2 bottles of beer +take one down +and pass it round +one bottle of beer on the wall + +one bottle of beer on the wall +one bottle of beer +take it down +and pass it round +no more bottles of beer on the wall + +no more bottles of beer on the wall +no more bottles of beer +go to the store +and buy some more +3 bottles of beer on the wall diff --git a/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-3.vbscript b/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-3.vbscript new file mode 100644 index 0000000000..0ab6d268fe --- /dev/null +++ b/Task/99-Bottles-of-Beer/VBScript/99-bottles-of-beer-3.vbscript @@ -0,0 +1,58 @@ +function pluralBottles( n ) + select case n + case 1 + pluralBottles = "one bottle" + case 0 + pluralBottles = "no more bottles" + case else + pluralBottles = n & " bottles" + end select +end function + +function eef( b, r1, r2 ) + if b then + eef = r1 + else + eef = r2 + end if +end function + +Function evalEmbedded(sInput, sP1) + dim oRe, oMatch, oMatches + dim sExpr, sResult + Set oRe = New RegExp + 'Look for expressions as enclosed in braces + oRe.Pattern = "{(.+?)}" + sResult = sInput + do + Set oMatches = oRe.Execute(sResult) + if oMatches.count = 0 then exit do + for each oMatch in oMatches + '~ wscript.echo oMatch.Value + for j = 0 to omatch.submatches.count - 1 + sExpr = omatch.submatches(j) + sResult = Replace( sResult, "{" & sExpr & "}", eval(sExpr) ) + next + next + loop + evalEmbedded = sResult +End Function + +sub sing( numBottles ) + dim i + for i = numBottles to 0 step -1 + if i = 0 then + wscript.echo evalEmbedded("no more bottles of beer on the wall" & vbNewline & _ + "no more bottles of beer" & vbNewline & _ + "go to the store and buy some more" & vbNewline & _ + "{pluralBottles(sP1)} of beer on the wall" & vbNewline, numBottles) + else + wscript.echo evalEmbedded("{pluralBottles(sP1)} of beer on the wall" & vbNewline & _ + "{pluralBottles(sP1)} of beer" & vbNewline & _ + "take {eef(sP1=1,""it"",""one"")} down and pass it round" & vbNewline & _ + "{pluralBottles(sP1-1)} of beer on the wall" & vbNewline, i) + end if + next +end sub + +sing 3 diff --git a/Task/99-Bottles-of-Beer/Visual-Basic-.NET/99-bottles-of-beer.visual b/Task/99-Bottles-of-Beer/Visual-Basic-.NET/99-bottles-of-beer.visual new file mode 100644 index 0000000000..e1b3ae76fe --- /dev/null +++ b/Task/99-Bottles-of-Beer/Visual-Basic-.NET/99-bottles-of-beer.visual @@ -0,0 +1,20 @@ +Module Module1 + Sub Main() + Dim Bottles As Integer + For Bottles = 99 To 0 Step -1 + If Bottles = 0 Then + Console.WriteLine("No more bottles of beer on the wall, no more bottles of beer.") + Console.WriteLine("Go to the store and buy some more, 99 bottles of beer on the wall.") + Console.ReadLine() + ElseIf Bottles = 1 Then + Console.WriteLine(Bottles & " bottle of beer on the wall, " & Bottles & " bottle of beer.") + Console.WriteLine("Take one down and pass it around, no more bottles of beer on the wall.") + Console.ReadLine() + Else + Console.WriteLine(Bottles & " bottles of beer on the wall, " & Bottles & " bottles of beer.") + Console.WriteLine("Take one down and pass it around, " & (Bottles - 1) & " bottles of beer on the wall.") + Console.ReadLine() + End If + Next + End Sub +End Module diff --git a/Task/99-Bottles-of-Beer/Visual-Basic/99-bottles-of-beer.vb b/Task/99-Bottles-of-Beer/Visual-Basic/99-bottles-of-beer.vb new file mode 100644 index 0000000000..65e32dce45 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Visual-Basic/99-bottles-of-beer.vb @@ -0,0 +1,33 @@ +Sub Main() + Const bottlesofbeer As String = " bottles of beer" + Const onthewall As String = " on the wall" + Const takeonedown As String = "Take one down, pass it around" + Const onebeer As String = "1 bottle of beer" + + Dim bottles As Long + + For bottles = 99 To 3 Step -1 + Debug.Print CStr(bottles) & bottlesofbeer & onthewall + Debug.Print CStr(bottles) & bottlesofbeer + Debug.Print takeonedown + Debug.Print CStr(bottles - 1) & bottlesofbeer & onthewall + Debug.Print + Next + + Debug.Print "2" & bottlesofbeer & onthewall + Debug.Print "2" & bottlesofbeer + Debug.Print takeonedown + Debug.Print onebeer & onthewall + Debug.Print + + Debug.Print onebeer & onthewall + Debug.Print onebeer + Debug.Print takeonedown + Debug.Print "No more" & bottlesofbeer & onthewall + Debug.Print + + Debug.Print "No" & bottlesofbeer & onthewall + Debug.Print "No" & bottlesofbeer + Debug.Print "Go to the store, buy some more" + Debug.Print "99" & bottlesofbeer & onthewall +End Sub diff --git a/Task/99-Bottles-of-Beer/Vox/99-bottles-of-beer.vox b/Task/99-Bottles-of-Beer/Vox/99-bottles-of-beer.vox new file mode 100644 index 0000000000..7bb2a5897d --- /dev/null +++ b/Task/99-Bottles-of-Beer/Vox/99-bottles-of-beer.vox @@ -0,0 +1,13 @@ +// translated from + +local beer; +while((beer = typeof beer == "null" ? 99 : beer) > 0) + println( + beer + " bottle" + + (beer != 1 ? "s" : "") + + " of beer on the wall\n" + beer + " bottle" + + (beer != 1 ? "s" : "") + + " of beer\nTake one down, pass it around\n" + + (--beer) + " bottle" + + (beer != 1 ? "s" : "") + " of beer on the wall\n" + ); diff --git a/Task/99-Bottles-of-Beer/Whenever/99-bottles-of-beer.whenever b/Task/99-Bottles-of-Beer/Whenever/99-bottles-of-beer.whenever new file mode 100644 index 0000000000..279781eb11 --- /dev/null +++ b/Task/99-Bottles-of-Beer/Whenever/99-bottles-of-beer.whenever @@ -0,0 +1,4 @@ +1 defer (4 || N(1)-?[1-9]\d{0,2}|0|-?1000)\s+(?-?[1-9]\d{0,2}|0|-?1000)\s*$').Match(Console.ReadLine()); + if m.Success then + begin + gc := m.Groups; + Console.WriteLine("{0} + {1} = {2}", gc['a'].Value, gc['b'].Value, Integer.Parse(gc['a'].Value) + Integer.Parse(gc['b'].Value)); + end + else Console.WriteLine("Invalid Input"); +end; + +end. diff --git a/Task/A+B/Oz/a+b.oz b/Task/A+B/Oz/a+b.oz new file mode 100644 index 0000000000..5e286d9291 --- /dev/null +++ b/Task/A+B/Oz/a+b.oz @@ -0,0 +1,10 @@ +declare + class TextFile from Open.file Open.text end + + StdIn = {New TextFile init(name:stdin)} + + fun {ReadInt} + {String.toInt {StdIn getS($)}} + end +in + {Show {ReadInt}+{ReadInt}} diff --git a/Task/A+B/PARI-GP/a+b-1.pari b/Task/A+B/PARI-GP/a+b-1.pari new file mode 100644 index 0000000000..f0ca7b20b7 --- /dev/null +++ b/Task/A+B/PARI-GP/a+b-1.pari @@ -0,0 +1 @@ +input()+input() diff --git a/Task/A+B/PARI-GP/a+b-2.pari b/Task/A+B/PARI-GP/a+b-2.pari new file mode 100644 index 0000000000..9946ea9193 --- /dev/null +++ b/Task/A+B/PARI-GP/a+b-2.pari @@ -0,0 +1 @@ +read("file1")+read("file2") diff --git a/Task/A+B/PL-I/a+b.pli b/Task/A+B/PL-I/a+b.pli new file mode 100644 index 0000000000..f0e2a2b805 --- /dev/null +++ b/Task/A+B/PL-I/a+b.pli @@ -0,0 +1,2 @@ +get (a, b); +put (a+b); diff --git a/Task/A+B/Pascal/a+b-1.pascal b/Task/A+B/Pascal/a+b-1.pascal new file mode 100644 index 0000000000..871f24cb2c --- /dev/null +++ b/Task/A+B/Pascal/a+b-1.pascal @@ -0,0 +1,6 @@ +var + a, b: integer; +begin + readln(a, b); + writeln(a + b); +end. diff --git a/Task/A+B/Pascal/a+b-2.pascal b/Task/A+B/Pascal/a+b-2.pascal new file mode 100644 index 0000000000..b86911da5f --- /dev/null +++ b/Task/A+B/Pascal/a+b-2.pascal @@ -0,0 +1,10 @@ +var + a, b: integer; +begin + reset(input, 'input.txt'); + rewrite(output, 'output.txt'); + readln(a, b); + writeln(a + b); + close(input); + close(output); +end. diff --git a/Task/A+B/Perl-6/a+b.pl6 b/Task/A+B/Perl-6/a+b.pl6 new file mode 100644 index 0000000000..7217cd2042 --- /dev/null +++ b/Task/A+B/Perl-6/a+b.pl6 @@ -0,0 +1 @@ +say [+] .words for lines diff --git a/Task/A+B/Piet/a+b.piet b/Task/A+B/Piet/a+b.piet new file mode 100644 index 0000000000..ed13ea7bdf --- /dev/null +++ b/Task/A+B/Piet/a+b.piet @@ -0,0 +1,4 @@ +in(num) +in(num) +add +out(num) diff --git a/Task/A+B/Pike/a+b.pike b/Task/A+B/Pike/a+b.pike new file mode 100644 index 0000000000..55f4b6f373 --- /dev/null +++ b/Task/A+B/Pike/a+b.pike @@ -0,0 +1,3 @@ +string line = Stdio.stdin->gets(); +sscanf(line, "%d %d", int a, int b); +write(a+b +"\n"); diff --git a/Task/A+B/PostScript/a+b.ps b/Task/A+B/PostScript/a+b.ps new file mode 100644 index 0000000000..04231cdb66 --- /dev/null +++ b/Task/A+B/PostScript/a+b.ps @@ -0,0 +1,7 @@ +(%stdin) (r) file % get stdin +dup +token pop % read A +exch +token pop % read B +add += diff --git a/Task/A+B/PowerShell/a+b-1.psh b/Task/A+B/PowerShell/a+b-1.psh new file mode 100644 index 0000000000..71016e0aaa --- /dev/null +++ b/Task/A+B/PowerShell/a+b-1.psh @@ -0,0 +1,2 @@ +$a,$b = -split "$input" +[int]$a + [int]$b diff --git a/Task/A+B/PowerShell/a+b-2.psh b/Task/A+B/PowerShell/a+b-2.psh new file mode 100644 index 0000000000..52eff18595 --- /dev/null +++ b/Task/A+B/PowerShell/a+b-2.psh @@ -0,0 +1,2 @@ +$a,$b = -split (Read-Host) +[int]$a + [int]$b diff --git a/Task/A+B/ProDOS/a+b-1.dos b/Task/A+B/ProDOS/a+b-1.dos new file mode 100644 index 0000000000..de19b924ac --- /dev/null +++ b/Task/A+B/ProDOS/a+b-1.dos @@ -0,0 +1,5 @@ +editvar /newvar /value=a /title=Enter an integer: +editvar /newvar /value=b /title=Enter another integer: +editvar /newvar /value=c +do add -a-,-b-=-c- +printline -c- diff --git a/Task/A+B/ProDOS/a+b-2.dos b/Task/A+B/ProDOS/a+b-2.dos new file mode 100644 index 0000000000..7550b1db8c --- /dev/null +++ b/Task/A+B/ProDOS/a+b-2.dos @@ -0,0 +1,4 @@ +editvar /newvar /value=a /title=Enter an integer: +editvar /newvar /value=b /title=Enter another integer: +editvar /newvar /value=c=-a-+-b- +printline -c- diff --git a/Task/A+B/Pure/a+b.pure b/Task/A+B/Pure/a+b.pure new file mode 100644 index 0000000000..653c0ecc66 --- /dev/null +++ b/Task/A+B/Pure/a+b.pure @@ -0,0 +1,2 @@ +using system; +printf "%d\n" (x+y) when x,y = scanf "%d %d" end; diff --git a/Task/A+B/PureBasic/a+b-1.purebasic b/Task/A+B/PureBasic/a+b-1.purebasic new file mode 100644 index 0000000000..a84d8c6d03 --- /dev/null +++ b/Task/A+B/PureBasic/a+b-1.purebasic @@ -0,0 +1,4 @@ +x$=Input() +a=Val(StringField(x$,1," ")) +b=Val(StringField(x$,2," ")) +PrintN(str(a+b)) diff --git a/Task/A+B/PureBasic/a+b-2.purebasic b/Task/A+B/PureBasic/a+b-2.purebasic new file mode 100644 index 0000000000..4076c43ef0 --- /dev/null +++ b/Task/A+B/PureBasic/a+b-2.purebasic @@ -0,0 +1,10 @@ +If ReadFile(0,"in.txt") + x$=ReadString(0) + a=Val(StringField(x$,1," ")) + b=Val(StringField(x$,2," ")) + If OpenFile(1,"out.txt") + WriteString(1,str(a+b)) + CloseFile(1) + EndIf + CloseFile(0) +EndIf diff --git a/Task/A+B/REBOL/a+b.rebol b/Task/A+B/REBOL/a+b.rebol new file mode 100644 index 0000000000..003613d500 --- /dev/null +++ b/Task/A+B/REBOL/a+b.rebol @@ -0,0 +1 @@ +forever [x: load input print x/1 + x/2] diff --git a/Task/A+B/Retro/a+b-1.retro b/Task/A+B/Retro/a+b-1.retro new file mode 100644 index 0000000000..2a9a5b9a82 --- /dev/null +++ b/Task/A+B/Retro/a+b-1.retro @@ -0,0 +1 @@ +: try ( "-n ) getToken toNumber getToken toNumber + putn ; diff --git a/Task/A+B/Retro/a+b-2.retro b/Task/A+B/Retro/a+b-2.retro new file mode 100644 index 0000000000..9c8fc3156e --- /dev/null +++ b/Task/A+B/Retro/a+b-2.retro @@ -0,0 +1 @@ +try 1 2 diff --git a/Task/A+B/Run-BASIC/a+b.run b/Task/A+B/Run-BASIC/a+b.run new file mode 100644 index 0000000000..097ba81d92 --- /dev/null +++ b/Task/A+B/Run-BASIC/a+b.run @@ -0,0 +1,2 @@ +input, x$ +print val(word$(x$,1)) + val(word$(x$,2)) diff --git a/Task/A+B/SNOBOL4/a+b-1.sno b/Task/A+B/SNOBOL4/a+b-1.sno new file mode 100644 index 0000000000..a60d2ce5f3 --- /dev/null +++ b/Task/A+B/SNOBOL4/a+b-1.sno @@ -0,0 +1,3 @@ + input break(" ") . a " " rem . b + output = a + b +end diff --git a/Task/A+B/SNOBOL4/a+b-2.sno b/Task/A+B/SNOBOL4/a+b-2.sno new file mode 100644 index 0000000000..762e298fe7 --- /dev/null +++ b/Task/A+B/SNOBOL4/a+b-2.sno @@ -0,0 +1,4 @@ + nums = "0123456789" + input span(nums) . a break(nums) span(nums) . b + output = a + b +end diff --git a/Task/A+B/SPARK/a+b.spark b/Task/A+B/SPARK/a+b.spark new file mode 100644 index 0000000000..bbb0588e86 --- /dev/null +++ b/Task/A+B/SPARK/a+b.spark @@ -0,0 +1,44 @@ +-- By Jacob Sparre Andersen +-- Validates with SPARK GPL 2010's Examiner/Simplifier + +with SPARK_IO; --# inherit SPARK_IO; + +--# main_program; +procedure A_Plus_B +--# global in out SPARK_IO.Inputs, SPARK_IO.Outputs; +--# derives SPARK_IO.Inputs from SPARK_IO.Inputs & +--# SPARK_IO.Outputs from SPARK_IO.Inputs, SPARK_IO.Outputs; +is + subtype Small_Integers is Integer range -1_000 .. +1_000; + A, B : Integer; + A_OK, B_OK : Boolean; +begin + SPARK_IO.Get_Integer + (File => SPARK_IO.Standard_Input, + Item => A, + Width => 0, + Read => A_OK); + + A_OK := A_OK and A in Small_Integers; + + SPARK_IO.Get_Integer + (File => SPARK_IO.Standard_Input, + Item => B, + Width => 0, + Read => B_OK); + + B_OK := B_OK and B in Small_Integers; + + if A_OK and B_OK then + SPARK_IO.Put_Integer + (File => SPARK_IO.Standard_Output, + Item => A + B, + Width => 4, + Base => 10); + else + SPARK_IO.Put_Line + (File => SPARK_IO.Standard_Output, + Item => "Input data does not match specification.", + Stop => 0); + end if; +end A_Plus_B; diff --git a/Task/A+B/SQL/a+b-1.sql b/Task/A+B/SQL/a+b-1.sql new file mode 100644 index 0000000000..b2306e8198 --- /dev/null +++ b/Task/A+B/SQL/a+b-1.sql @@ -0,0 +1 @@ +select A+B diff --git a/Task/A+B/SQL/a+b-2.sql b/Task/A+B/SQL/a+b-2.sql new file mode 100644 index 0000000000..40e5248136 --- /dev/null +++ b/Task/A+B/SQL/a+b-2.sql @@ -0,0 +1 @@ +select 2+3 diff --git a/Task/A+B/Seed7/a+b.seed7 b/Task/A+B/Seed7/a+b.seed7 new file mode 100644 index 0000000000..e02a95d013 --- /dev/null +++ b/Task/A+B/Seed7/a+b.seed7 @@ -0,0 +1,11 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: a is 0; + var integer: b is 0; + begin + read(a); + read(b); + writeln(a + b); + end func; diff --git a/Task/A+B/Shiny/a+b.shiny b/Task/A+B/Shiny/a+b.shiny new file mode 100644 index 0000000000..1ee0249b8a --- /dev/null +++ b/Task/A+B/Shiny/a+b.shiny @@ -0,0 +1,3 @@ +if (io.line 'stdin').match ~(\d+)\s+(\d+)~ + say "$a $b %(a+b)d" +end diff --git a/Task/A+B/TI-83-BASIC/a+b-1.ti-83 b/Task/A+B/TI-83-BASIC/a+b-1.ti-83 new file mode 100644 index 0000000000..4e418b8727 --- /dev/null +++ b/Task/A+B/TI-83-BASIC/a+b-1.ti-83 @@ -0,0 +1,2 @@ +:Prompt A,B +:Disp A+B diff --git a/Task/A+B/TI-83-BASIC/a+b-2.ti-83 b/Task/A+B/TI-83-BASIC/a+b-2.ti-83 new file mode 100644 index 0000000000..19afdba68b --- /dev/null +++ b/Task/A+B/TI-83-BASIC/a+b-2.ti-83 @@ -0,0 +1,2 @@ +:aplusb(a,b) +:a+b diff --git a/Task/A+B/TUSCRIPT/a+b.tuscript b/Task/A+B/TUSCRIPT/a+b.tuscript new file mode 100644 index 0000000000..00dc79df7b --- /dev/null +++ b/Task/A+B/TUSCRIPT/a+b.tuscript @@ -0,0 +1,5 @@ +$$ MODE TUSCRIPT +SET input="1 2" +SET input=SPLIT(input,": :") +SET input=JOIN (input) +SET output=SUM(input) diff --git a/Task/A+B/TorqueScript/a+b.torquescript b/Task/A+B/TorqueScript/a+b.torquescript new file mode 100644 index 0000000000..a9ce7a9718 --- /dev/null +++ b/Task/A+B/TorqueScript/a+b.torquescript @@ -0,0 +1,4 @@ +Function aPlusB(%input) +{ + return getWord(%input, 0) + getWord(%input, 1); +} diff --git a/Task/A+B/UNIX-Shell/a+b-1.sh b/Task/A+B/UNIX-Shell/a+b-1.sh new file mode 100644 index 0000000000..0c50bd4b21 --- /dev/null +++ b/Task/A+B/UNIX-Shell/a+b-1.sh @@ -0,0 +1,3 @@ +#!/bin/sh +read a b || exit +echo `expr "$a" + "$b"` diff --git a/Task/A+B/UNIX-Shell/a+b-2.sh b/Task/A+B/UNIX-Shell/a+b-2.sh new file mode 100644 index 0000000000..3b0c271f61 --- /dev/null +++ b/Task/A+B/UNIX-Shell/a+b-2.sh @@ -0,0 +1,3 @@ +#!/bin/bash +read a b || exit +echo $(( a + b )) diff --git a/Task/A+B/UNIX-Shell/a+b-3.sh b/Task/A+B/UNIX-Shell/a+b-3.sh new file mode 100644 index 0000000000..15e26e176d --- /dev/null +++ b/Task/A+B/UNIX-Shell/a+b-3.sh @@ -0,0 +1,2 @@ +echo 2 3 | ksh a+b.sh +5 diff --git a/Task/A+B/UNIX-Shell/a+b-4.sh b/Task/A+B/UNIX-Shell/a+b-4.sh new file mode 100644 index 0000000000..2d4eec33d9 --- /dev/null +++ b/Task/A+B/UNIX-Shell/a+b-4.sh @@ -0,0 +1,4 @@ +set line=$< +set input=($line) +@ sum = $input[1] + $input[2] +echo $sum diff --git a/Task/A+B/Ursala/a+b-1.ursala b/Task/A+B/Ursala/a+b-1.ursala new file mode 100644 index 0000000000..2955b03d85 --- /dev/null +++ b/Task/A+B/Ursala/a+b-1.ursala @@ -0,0 +1,6 @@ +#import std +#import int + +#executable& + +main = %zP+ sum:-0+ %zp*FiNCS+ sep` @L diff --git a/Task/A+B/Ursala/a+b-2.ursala b/Task/A+B/Ursala/a+b-2.ursala new file mode 100644 index 0000000000..66a438efc4 --- /dev/null +++ b/Task/A+B/Ursala/a+b-2.ursala @@ -0,0 +1,6 @@ +#import std +#import int + +#executable -[parameterized]- + +main = ~command.files.&h; <.contents:= %zP+ sum:-0+ %zp*FiNCS+ sep` @L+ ~contents> diff --git a/Task/A+B/Ursala/a+b-3.ursala b/Task/A+B/Ursala/a+b-3.ursala new file mode 100644 index 0000000000..eda9ffeb15 --- /dev/null +++ b/Task/A+B/Ursala/a+b-3.ursala @@ -0,0 +1,10 @@ +#import std +#import int + +#executable -[parameterized]- + +main = + +~command.files.&h; ~&iNC+ file$[ + contents: %zP+ sum:-0+ %zp*FiNCS+ sep` @L+ ~contents, + path: ~path; ^|C\~& ~=`.-~; ^|T/~& '.out'!] diff --git a/Task/A+B/VBScript/a+b.vbscript b/Task/A+B/VBScript/a+b.vbscript new file mode 100644 index 0000000000..08f40b34e4 --- /dev/null +++ b/Task/A+B/VBScript/a+b.vbscript @@ -0,0 +1,37 @@ +Option Explicit +Dim a, b +Select Case WScript.Arguments.Count + Case 0 'No arguments, prompt for them. + WScript.Echo "Enter values for a and b" + a = WScript.Stdin.ReadLine + if Instr(a, " ") > 0 then 'If two variables were passed + b = Split(a)(1) + a = Split(a)(0) + else + WScript.Echo "Enter value for b" + b = WScript.Stdin.ReadLine + end if + Case 1 'One argument, assume it's an input file, e.g. "in.txt" + Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject") + With FSO.OpenTextFile(WScript.Arguments(0), 1) + a = .ReadLine + b = Split(a)(1) + a = Split(a)(0) + .Close + End With + Case 2 'Two arguments, assume they are values + a = WScript.Arguments(0) + b = WScript.Arguments(1) +End Select +'At this point, a and b are strings as entered, make them numbers +a = CInt(a) +b = CInt(b) + +'Write the sum +Wscript.Echo a + b +if 1 = WScript.Arguments.Count then + With FSO.CreateTextFile("out.txt") + .WriteLine a + b + .Close + End With +end if diff --git a/Task/A+B/VHDL/a+b.vhdl b/Task/A+B/VHDL/a+b.vhdl new file mode 100644 index 0000000000..5eea2b5c05 --- /dev/null +++ b/Task/A+B/VHDL/a+b.vhdl @@ -0,0 +1,23 @@ +LIBRARY std; +USE std.TEXTIO.all; + + +entity test is +end entity test; + + +architecture beh of test is +begin + process + variable line_in, line_out : line; + variable a,b : integer; + begin + readline(INPUT, line_in); + read(line_in, a); + read(line_in, b); + + write(line_out, a+b); + writeline(OUTPUT, line_out); + wait; -- needed to stop the execution + end process; +end architecture beh; diff --git a/Task/A+B/Vala/a+b.vala b/Task/A+B/Vala/a+b.vala new file mode 100644 index 0000000000..5669b1a2d2 --- /dev/null +++ b/Task/A+B/Vala/a+b.vala @@ -0,0 +1,6 @@ +stdout.printf("Please enter int value for A\n"); +int a = int.parse(stdin.read_line()); +stdout.printf("Please enter int value for B\n"); +int b = int.parse(stdin.read_line()); + +stdout.printf("A+B = %d\n", a+b); diff --git a/Task/A+B/Visual-Basic-.NET/a+b.visual b/Task/A+B/Visual-Basic-.NET/a+b.visual new file mode 100644 index 0000000000..f714a4ee25 --- /dev/null +++ b/Task/A+B/Visual-Basic-.NET/a+b.visual @@ -0,0 +1,10 @@ +Module Module1 + + Sub Main() + Dim s() As String = Nothing + + s = Console.ReadLine().Split(" "c) + Console.WriteLine(CInt(s(0)) + CInt(s(1))) + End Sub + +End Module diff --git a/Task/Empty-program/CoffeeScript/empty-program.coffee b/Task/A+B/Whitespace/a+b.ws similarity index 100% rename from Task/Empty-program/CoffeeScript/empty-program.coffee rename to Task/A+B/Whitespace/a+b.ws diff --git a/Task/A+B/X86-Assembly/a+b.x86 b/Task/A+B/X86-Assembly/a+b.x86 new file mode 100644 index 0000000000..d5b2c85378 --- /dev/null +++ b/Task/A+B/X86-Assembly/a+b.x86 @@ -0,0 +1,60 @@ +section .text + global _start + + _print: + mov ebx, 1 + mov eax, 4 + int 0x80 + ret + + _get_input: + mov edx, 4 + mov ebx, 0 + mov eax, 3 + int 0x80 + ret + + _start: + mov edx, in_val_len + mov ecx, in_val_msg + call _print + mov ecx, a + call _get_input + ;make 'a' an actual number rather than a char. + sub dword [a], 0x30 + mov edx, in_val_len + mov ecx, in_val_msg + call _print + mov ecx, b + call _get_input + ;calc real number for 'b' + sub dword [b], 0x30 + mov eax, dword [a] + mov ebx, dword [b] + add eax, ebx + ;get the character for our sum. + add eax, 0x30 + mov dword [sum], eax + mov edx, out_val_len + mov ecx, out_val_msg + call _print + mov [sum+1], dword 0xa + mov edx, 4 + mov ecx, sum + call _print + push 0x1 + mov eax, 1 + push eax + int 0x80 + ret + +section .data +in_val_msg db "Please input an integer:",0 +in_val_len equ $-in_val_msg +out_val_msg db "The sum of a+b is: ",0 +out_val_len equ $-out_val_msg + +section .bss +a resd 1 +b resd 1 +sum resd 1 diff --git a/Task/A+B/XPL0/a+b.xpl0 b/Task/A+B/XPL0/a+b.xpl0 new file mode 100644 index 0000000000..7ecdb6ace5 --- /dev/null +++ b/Task/A+B/XPL0/a+b.xpl0 @@ -0,0 +1,7 @@ +include c:\cxpl\codes; +int A, B; +[A:= IntIn(0); + B:= IntIn(0); + IntOut(0, A+B); + CrLf(0); +] diff --git a/Task/A+B/Yorick/a+b.yorick b/Task/A+B/Yorick/a+b.yorick new file mode 100644 index 0000000000..277c4168a3 --- /dev/null +++ b/Task/A+B/Yorick/a+b.yorick @@ -0,0 +1,3 @@ +a = b = 0; +read, a, b; +write, a + b; diff --git a/Task/A+B/ZED/a+b.zed b/Task/A+B/ZED/a+b.zed new file mode 100644 index 0000000000..0e80569b99 --- /dev/null +++ b/Task/A+B/ZED/a+b.zed @@ -0,0 +1,5 @@ +("A+B") +A+B +(always) +(+) (read) (default-input-port) + (read) (default-input-port) diff --git a/Task/Abstract-type/NetRexx/abstract-type.netrexx b/Task/Abstract-type/NetRexx/abstract-type.netrexx new file mode 100644 index 0000000000..f9badd6873 --- /dev/null +++ b/Task/Abstract-type/NetRexx/abstract-type.netrexx @@ -0,0 +1,72 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols binary + +-- ----------------------------------------------------------------------------- +class RCAbstractType public final + +method main(args = String[]) public constant + + say ' Testing' RCAbstractType.class.getSimpleName + say ' Creating an object of type:' Concrete.class.getSimpleName + conk = Concrete() + say 'getClassName:'.right(20) conk.getClassName + say 'getIfaceName:'.right(20) conk.getIfaceName + say 'mustImplement:'.right(20) conk.mustImplement + say 'canOverride1:'.right(20) conk.canOverride1 + say 'canOverride2:'.right(20) conk.canOverride2 + say 'callOverridden2:'.right(20) conk.callOverridden2 + + return + +-- ----------------------------------------------------------------------------- +class RCAbstractType.Iface interface + +ifaceName = RCAbstractType.Iface.class.getSimpleName + +method getIfaceName() public returns String +method canOverride1() public returns String +method canOverride2() public returns String + +-- ----------------------------------------------------------------------------- +class RCAbstractType.Abstraction abstract implements RCAbstractType.Iface + +properties inheritable + className = String + +method Abstraction() public + setClassName(this.getClass.getSimpleName) + return + +method mustImplement() public abstract returns String + +method getClassName() public returns String + return className + +method setClassName(nm = String) public + className = nm + return + +method getIfaceName() public returns String + return RCAbstractType.Iface.ifaceName + +method canOverride1() public returns String + return 'In' RCAbstractType.Abstraction.class.getSimpleName'.canOverride1' + +method canOverride2() public returns String + return 'In' RCAbstractType.Abstraction.class.getSimpleName'.canOverride2' + +-- ----------------------------------------------------------------------------- +class RCAbstractType.Concrete extends RCAbstractType.Abstraction + +method Concrete() public + super() + return + +method mustImplement() public returns String + return 'In' RCAbstractType.Concrete.class.getSimpleName'.mustImplement' + +method canOverride2() public returns String + return 'In' RCAbstractType.Concrete.class.getSimpleName'.canOverride2' + +method callOverridden2() public returns String + return super.canOverride2 diff --git a/Task/Abstract-type/NewLISP/abstract-type.newlisp b/Task/Abstract-type/NewLISP/abstract-type.newlisp new file mode 100644 index 0000000000..45af548b75 --- /dev/null +++ b/Task/Abstract-type/NewLISP/abstract-type.newlisp @@ -0,0 +1,46 @@ +; file: abstract.lsp +; url: http://rosettacode.org/wiki/Abstract_type +; author: oofoe 2012-01-28 + +; Abstract Shape Class + +(new Class 'Shape) ; Derive new class. + +(define (Shape:Shape ; Shape constructor. + (pen "X")) ; Default value. + (list (context) ; Assemble data packet. + (list 'pen pen) + (list 'size (args)))) + +(define (Shape:line x) ; Print out row with 'pen' character. + (dotimes (i x) + (print (lookup 'pen (self)))) + (println)) + +(define (Shape:draw)) ; Placeholder, does nothing. + +; Derived Objects + +(new Shape 'Box) + +(define (Box:draw) ; Override base draw method. + (let ((s (lookup 'size (self)))) + (dotimes (i (s 0)) (:line (self) (s 0))))) + +(new Shape 'Rectangle) + +(define (Rectangle:draw) + (let ((size (lookup 'size (self)))) + (dotimes (i (size 1)) (:line (self) (size 0))))) + +; Demonstration + +(:draw (Shape)) ; Nothing happens. + +(println "A box:") +(:draw (Box "O" 5)) ; Create Box object and call draw method. + +(println "\nA rectangle:") +(:draw (Rectangle "R" 32 4)) + +(exit) diff --git a/Task/Abstract-type/OCaml/abstract-type-1.ocaml b/Task/Abstract-type/OCaml/abstract-type-1.ocaml new file mode 100644 index 0000000000..625984c78f --- /dev/null +++ b/Task/Abstract-type/OCaml/abstract-type-1.ocaml @@ -0,0 +1,4 @@ +class virtual foo = + object + method virtual bar : int + end diff --git a/Task/Abstract-type/OCaml/abstract-type-2.ocaml b/Task/Abstract-type/OCaml/abstract-type-2.ocaml new file mode 100644 index 0000000000..63c57c4e0c --- /dev/null +++ b/Task/Abstract-type/OCaml/abstract-type-2.ocaml @@ -0,0 +1 @@ +type t diff --git a/Task/Abstract-type/OCaml/abstract-type-3.ocaml b/Task/Abstract-type/OCaml/abstract-type-3.ocaml new file mode 100644 index 0000000000..4f2bb238a5 --- /dev/null +++ b/Task/Abstract-type/OCaml/abstract-type-3.ocaml @@ -0,0 +1,5 @@ +module Foo : sig + type t +end = struct + type t = int * int +end diff --git a/Task/Abstract-type/OCaml/abstract-type-4.ocaml b/Task/Abstract-type/OCaml/abstract-type-4.ocaml new file mode 100644 index 0000000000..5732291e06 --- /dev/null +++ b/Task/Abstract-type/OCaml/abstract-type-4.ocaml @@ -0,0 +1,5 @@ +type u +type v +type 'a t +type ut = u t +type vt = v t diff --git a/Task/Abstract-type/Objeck/abstract-type.objeck b/Task/Abstract-type/Objeck/abstract-type.objeck new file mode 100644 index 0000000000..f26924df79 --- /dev/null +++ b/Task/Abstract-type/Objeck/abstract-type.objeck @@ -0,0 +1,7 @@ +class ClassA { + method : virtual : public : MethodA() ~ Int; + + method : public : MethodA() ~ Int { + return 0; + } +} diff --git a/Task/Abstract-type/Oz/abstract-type.oz b/Task/Abstract-type/Oz/abstract-type.oz new file mode 100644 index 0000000000..ebfa6b5c29 --- /dev/null +++ b/Task/Abstract-type/Oz/abstract-type.oz @@ -0,0 +1,23 @@ +declare + class BaseQueue + attr + contents:nil + + meth init + raise notImplemented(self init) end + end + + meth enqueue(Item) + raise notImplemented(self enqueue) end + end + + meth dequeue(?Item) + raise notImplemented(self dequeue) end + end + + meth printContents + {ForAll @contents Show} + end + end + + Queue = {New BaseQueue init} %% throws diff --git a/Task/Abstract-type/Perl-6/abstract-type.pl6 b/Task/Abstract-type/Perl-6/abstract-type.pl6 new file mode 100644 index 0000000000..40f2593b09 --- /dev/null +++ b/Task/Abstract-type/Perl-6/abstract-type.pl6 @@ -0,0 +1,23 @@ +use v6; + +role A { + # must be filled in by the class it is composed into + method abstract() { ... }; + + # can be overridden in the class, but that's not mandatory + method concrete() { say '# 42' }; +} + +class SomeClass does A { + method abstract() { + say "# made concrete in class" + } +} + +my $obj = SomeClass.new; +$obj.abstract(); +$obj.concrete(); + +# output: +# made concrete in class +# 42 diff --git a/Task/Abstract-type/REBOL/abstract-type.rebol b/Task/Abstract-type/REBOL/abstract-type.rebol new file mode 100644 index 0000000000..c5dabc81ea --- /dev/null +++ b/Task/Abstract-type/REBOL/abstract-type.rebol @@ -0,0 +1,46 @@ +REBOL [ + Title: "Abstract Type" + Author: oofoe + Date: 2009-12-05 + URL: http://rosettacode.org/wiki/Abstract_type +] + +; The "shape" class is an abstract class -- it defines the "pen" +; property and "line" method, but "size" and "draw" are undefined and +; unimplemented. + +shape: make object! [ + pen: "X" + size: none + + line: func [count][loop count [prin self/pen] prin crlf] + draw: does [none] +] + +; The "box" class inherits from "shape" and provides the missing +; information for drawing boxes. + +box: make shape [ + size: 10 + draw: does [loop self/size [line self/size]] +] + +; "rectangle" also inherits from "shape", but handles the +; implementation very differently. + +rectangle: make shape [ + size: 20x10 + draw: does [loop self/size/y [line self/size/x]] +] + +; Unlike some languages discussed, REBOL has absolutely no qualms +; about instantiating an "abstract" class -- that's how I created the +; derived classes of "rectangle" and "box", after all. + +s: make shape [] s/draw ; Nothing happens. + +print "A box:" +b: make box [pen: "O" size: 5] b/draw + +print [crlf "A rectangle:"] +r: make rectangle [size: 32x5] r/draw diff --git a/Task/Abstract-type/Visual-Basic-.NET/abstract-type-1.visual b/Task/Abstract-type/Visual-Basic-.NET/abstract-type-1.visual new file mode 100644 index 0000000000..cf86452ba1 --- /dev/null +++ b/Task/Abstract-type/Visual-Basic-.NET/abstract-type-1.visual @@ -0,0 +1,17 @@ +MustInherit Class Base + + Protected Sub New() + + End Sub + + Public Sub StandardMethod() + 'code + End Sub + + Public Overridable Sub Method_Can_Be_Replaced() + 'code + End Sub + + Public MustOverride Sub Method_Must_Be_Replaced() + +End Class diff --git a/Task/Abstract-type/Visual-Basic-.NET/abstract-type-2.visual b/Task/Abstract-type/Visual-Basic-.NET/abstract-type-2.visual new file mode 100644 index 0000000000..0b0995d4c6 --- /dev/null +++ b/Task/Abstract-type/Visual-Basic-.NET/abstract-type-2.visual @@ -0,0 +1,3 @@ +Interface IBase + Sub Method_Must_Be_Implemented() +End Interface diff --git a/Task/Accumulator-factory/CoffeeScript/accumulator-factory.coffee b/Task/Accumulator-factory/CoffeeScript/accumulator-factory.coffeescript similarity index 100% rename from Task/Accumulator-factory/CoffeeScript/accumulator-factory.coffee rename to Task/Accumulator-factory/CoffeeScript/accumulator-factory.coffeescript diff --git a/Task/Accumulator-factory/Mathematica/accumulator-factory.mathematica b/Task/Accumulator-factory/Mathematica/accumulator-factory.math similarity index 100% rename from Task/Accumulator-factory/Mathematica/accumulator-factory.mathematica rename to Task/Accumulator-factory/Mathematica/accumulator-factory.math diff --git a/Task/Accumulator-factory/OCaml/accumulator-factory.ocaml b/Task/Accumulator-factory/OCaml/accumulator-factory.ocaml new file mode 100644 index 0000000000..126b21bf1d --- /dev/null +++ b/Task/Accumulator-factory/OCaml/accumulator-factory.ocaml @@ -0,0 +1,12 @@ +let accumulator sum0 = + let sum = ref sum0 in + fun n -> + sum := !sum +. n; + !sum;; + +let _ = + let x = accumulator 1.0 in + ignore (x 5.0); + let _ = accumulator 3.0 in + Printf.printf "%g\n" (x 2.3) +;; diff --git a/Task/Accumulator-factory/Objeck/accumulator-factory.objeck b/Task/Accumulator-factory/Objeck/accumulator-factory.objeck new file mode 100644 index 0000000000..b634b52ec5 --- /dev/null +++ b/Task/Accumulator-factory/Objeck/accumulator-factory.objeck @@ -0,0 +1,20 @@ +bundle Default { + class Accumulator { + @sum : Float; + + New(sum : Float) { + @sum := sum; + } + + method : public : Call(n : Float) ~ Float { + @sum += n; + return @sum; + } + + function : Main(args : String[]) ~ Nil { + x := Accumulator->New(1.0); + x->Call(5.0 ); + x->Call(2.3)->PrintLine(); + } + } +} diff --git a/Task/Accumulator-factory/Objective-C/accumulator-factory.m b/Task/Accumulator-factory/Objective-C/accumulator-factory.m new file mode 100644 index 0000000000..e8565caff2 --- /dev/null +++ b/Task/Accumulator-factory/Objective-C/accumulator-factory.m @@ -0,0 +1,23 @@ +#import + +typedef double (^Accumulator)(double); + +Accumulator accumulator_factory(double initial) { + __block double sum = initial; + Accumulator acc = ^(double n){ + return sum += n; + }; + return [[acc copy] autorelease]; +} + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + Accumulator x = accumulator_factory(1); + x(5); + accumulator_factory(3); + NSLog(@"%f", x(2.3)); + + [pool drain]; + return 0; +} diff --git a/Task/Accumulator-factory/Octave/accumulator-factory.octave b/Task/Accumulator-factory/Octave/accumulator-factory.octave new file mode 100644 index 0000000000..99829bb587 --- /dev/null +++ b/Task/Accumulator-factory/Octave/accumulator-factory.octave @@ -0,0 +1,11 @@ +# not a function file: +1; +function fun = foo(init) + currentSum = init; + fun = @(add) currentSum = currentSum + add; currentSum; +endfunction + +x = foo(1); +x(5); +foo(3); +disp(x(2.3)); diff --git a/Task/Accumulator-factory/Oz/accumulator-factory.oz b/Task/Accumulator-factory/Oz/accumulator-factory.oz new file mode 100644 index 0000000000..24ff4cdea2 --- /dev/null +++ b/Task/Accumulator-factory/Oz/accumulator-factory.oz @@ -0,0 +1,28 @@ +declare + fun {Acc Init} + State = {NewCell Init} + in + fun {$ X} + OldState + in + {Exchange State OldState} = {Sum OldState X} + end + end + + fun {Sum A B} + if {All [A B] Int.is} then A+B + else {ToFloat A}+{ToFloat B} + end + end + + fun {ToFloat X} + if {Float.is X} then X + elseif {Int.is X} then {Int.toFloat X} + end + end + + X = {Acc 1} +in + {X 5 _} + {Acc 3 _} + {Show {X 2.3}} diff --git a/Task/Accumulator-factory/Perl-6/accumulator-factory-1.pl6 b/Task/Accumulator-factory/Perl-6/accumulator-factory-1.pl6 new file mode 100644 index 0000000000..804e68b023 --- /dev/null +++ b/Task/Accumulator-factory/Perl-6/accumulator-factory-1.pl6 @@ -0,0 +1 @@ +sub accum ($n is copy) { sub { $n += $^x } } diff --git a/Task/Accumulator-factory/Perl-6/accumulator-factory-2.pl6 b/Task/Accumulator-factory/Perl-6/accumulator-factory-2.pl6 new file mode 100644 index 0000000000..171e8322d9 --- /dev/null +++ b/Task/Accumulator-factory/Perl-6/accumulator-factory-2.pl6 @@ -0,0 +1,3 @@ +my $a = accum 5; +$a(4.5); +say $a(.5); # Prints "10". diff --git a/Task/Accumulator-factory/Perl-6/accumulator-factory-3.pl6 b/Task/Accumulator-factory/Perl-6/accumulator-factory-3.pl6 new file mode 100644 index 0000000000..8c9e92605a --- /dev/null +++ b/Task/Accumulator-factory/Perl-6/accumulator-factory-3.pl6 @@ -0,0 +1,2 @@ +my &b = accum 5; +say b 3; # Prints "8". diff --git a/Task/Accumulator-factory/PostScript/accumulator-factory.ps b/Task/Accumulator-factory/PostScript/accumulator-factory.ps new file mode 100644 index 0000000000..afdb55f4c0 --- /dev/null +++ b/Task/Accumulator-factory/PostScript/accumulator-factory.ps @@ -0,0 +1,17 @@ +/mk-acc { % accumulator generator + {0 add 0 0 2 index put} + 7 array copy + dup 0 4 -1 roll put + dup dup 2 exch put + cvx +} def + +% Examples (= is a printing command in PostScript): +/a 1 mk-acc def % create accumulator #1, name it a +5 a = % add 5 to 1, print it +10 mk-acc % create accumulator #2, leave it anonymous on the stack +2.71 a = % add 2.71 to 6, print it +dup 3.14 exch exec = % add 3.14 to 10, print it +dup 100 exch exec = % add 100 to 13.14, print it +12 a = % add 12 to 8.71, print it + % accumulator #2 is still available on the stack diff --git a/Task/Accumulator-factory/REBOL/accumulator-factory.rebol b/Task/Accumulator-factory/REBOL/accumulator-factory.rebol new file mode 100644 index 0000000000..35b5392daf --- /dev/null +++ b/Task/Accumulator-factory/REBOL/accumulator-factory.rebol @@ -0,0 +1,8 @@ +make-acc-gen: func [start-val] [ + use [state] [ + state: start-val + func [value] [ + state: state + value + ] + ] +] diff --git a/Task/Accumulator-factory/Retro/accumulator-factory.retro b/Task/Accumulator-factory/Retro/accumulator-factory.retro new file mode 100644 index 0000000000..dd1c385b83 --- /dev/null +++ b/Task/Accumulator-factory/Retro/accumulator-factory.retro @@ -0,0 +1,11 @@ + : acc here swap , [ &+! &@ bi ] curry ; + + ( create an accumulator function ) + 1 acc + + ( and give it a name ) + constant x + + ( add values to it and display the results ) + 5 x do putn + 2 x do putn diff --git a/Task/Accumulator-factory/Standard-ML/accumulator-factory.ml b/Task/Accumulator-factory/Standard-ML/accumulator-factory.ml new file mode 100644 index 0000000000..9569398df7 --- /dev/null +++ b/Task/Accumulator-factory/Standard-ML/accumulator-factory.ml @@ -0,0 +1,15 @@ +fun accumulator (sum0:real) : real -> real = let + val sum = ref sum0 + in + fn n => ( + sum := !sum + n; + !sum) + end; + +let + val x = accumulator 1.0 + val _ = x 5.0 + val _ = accumulator 3.0 +in + print (Real.toString (x 2.3) ^ "\n") +end; diff --git a/Task/Accumulator-factory/UNIX-Shell/accumulator-factory-1.sh b/Task/Accumulator-factory/UNIX-Shell/accumulator-factory-1.sh new file mode 100644 index 0000000000..a0de8bab0f --- /dev/null +++ b/Task/Accumulator-factory/UNIX-Shell/accumulator-factory-1.sh @@ -0,0 +1,18 @@ +#!/bin/sh +accumulator() { + # Define a global function named $1 + # with a global variable named ${1}_sum. + eval "${1}_sum=\$2" + eval "$1() { + ${1}_sum=\$(echo \"(\$${1}_sum) + (\$2)\" | bc) + eval \"\$1=\\\$${1}_sum\" # Provide the current sum. + }" +} + +accumulator x 1 +x r 5 +accumulator y 3 +x r 2.3 +echo $r +y r -3000 +echo $r diff --git a/Task/Accumulator-factory/UNIX-Shell/accumulator-factory-2.sh b/Task/Accumulator-factory/UNIX-Shell/accumulator-factory-2.sh new file mode 100644 index 0000000000..ad313979b6 --- /dev/null +++ b/Task/Accumulator-factory/UNIX-Shell/accumulator-factory-2.sh @@ -0,0 +1,12 @@ +fn accumulator n { + result @ i { + n = `{echo $n + $i | bc} + result $n + } +} + +fn-x = <={accumulator 1} +x 5 +fn-y = <={accumulator 3} +echo <={x 2.3} +echo <={y -3000} diff --git a/Task/Accumulator-factory/Unicon/accumulator-factory.unicon b/Task/Accumulator-factory/Unicon/accumulator-factory.unicon new file mode 100644 index 0000000000..3d84b24a62 --- /dev/null +++ b/Task/Accumulator-factory/Unicon/accumulator-factory.unicon @@ -0,0 +1,17 @@ +procedure main() + a := genAcc(3) + b := genAcc(5) + + write(" " ,center("a",5), " ", center("b", 5)) + write("genAcc: ", right(a(4),5), " ", right(b(4), 5)) + write("genAcc: ", right(a(2),5), " ", right(b(3),5)) + write("genAcc: ", right(a(4.5),5)," ", right(b(1.3),5)) +end + +procedure genAcc(n) # The generator factory + return makeProc { while i := (n@&source)[1] do n +:= i } +end + +procedure makeProc(A) # A Programmer-Defined Control Operation + return (@A[1],A[1]) +end diff --git a/Task/Accumulator-factory/VBScript/accumulator-factory-1.vbscript b/Task/Accumulator-factory/VBScript/accumulator-factory-1.vbscript new file mode 100644 index 0000000000..0973ec6443 --- /dev/null +++ b/Task/Accumulator-factory/VBScript/accumulator-factory-1.vbscript @@ -0,0 +1,10 @@ +class accumulator + dim A + public default function acc(x) + A = A + x + acc = A + end function + public property get accum + accum = A + end property +end class diff --git a/Task/Accumulator-factory/VBScript/accumulator-factory-2.vbscript b/Task/Accumulator-factory/VBScript/accumulator-factory-2.vbscript new file mode 100644 index 0000000000..c61351aaad --- /dev/null +++ b/Task/Accumulator-factory/VBScript/accumulator-factory-2.vbscript @@ -0,0 +1,8 @@ +dim a +set a = new accumulator +x = a( 1 ) +a 5 +dim b +set b = new accumulator +b 3 +wscript.echo a(2.3) diff --git a/Task/Accumulator-factory/Yorick/accumulator-factory.yorick b/Task/Accumulator-factory/Yorick/accumulator-factory.yorick new file mode 100644 index 0000000000..e6c9e26237 --- /dev/null +++ b/Task/Accumulator-factory/Yorick/accumulator-factory.yorick @@ -0,0 +1,6 @@ +func accum(data, n) { + if(!is_obj(data)) + return closure(accum, save(total=data)); + save, data, total=data.total + n; + return data.total; +} diff --git a/Task/Ackermann-function/BASIC/ackermann-function.bas b/Task/Ackermann-function/BASIC/ackermann-function.basic similarity index 100% rename from Task/Ackermann-function/BASIC/ackermann-function.bas rename to Task/Ackermann-function/BASIC/ackermann-function.basic diff --git a/Task/Ackermann-function/CoffeeScript/ackermann-function.coffee b/Task/Ackermann-function/CoffeeScript/ackermann-function.coffeescript similarity index 100% rename from Task/Ackermann-function/CoffeeScript/ackermann-function.coffee rename to Task/Ackermann-function/CoffeeScript/ackermann-function.coffeescript diff --git a/Task/Ackermann-function/Golfscript/ackermann-function.golf b/Task/Ackermann-function/Golfscript/ackermann-function.golfscript similarity index 100% rename from Task/Ackermann-function/Golfscript/ackermann-function.golf rename to Task/Ackermann-function/Golfscript/ackermann-function.golfscript diff --git a/Task/Ackermann-function/MAXScript/ackermann-function.max b/Task/Ackermann-function/MAXScript/ackermann-function.maxscript similarity index 100% rename from Task/Ackermann-function/MAXScript/ackermann-function.max rename to Task/Ackermann-function/MAXScript/ackermann-function.maxscript diff --git a/Task/Ackermann-function/Mathematica/ackermann-function-1.mathematica b/Task/Ackermann-function/Mathematica/ackermann-function-1.math similarity index 100% rename from Task/Ackermann-function/Mathematica/ackermann-function-1.mathematica rename to Task/Ackermann-function/Mathematica/ackermann-function-1.math diff --git a/Task/Ackermann-function/Mathematica/ackermann-function-2.mathematica b/Task/Ackermann-function/Mathematica/ackermann-function-2.math similarity index 100% rename from Task/Ackermann-function/Mathematica/ackermann-function-2.mathematica rename to Task/Ackermann-function/Mathematica/ackermann-function-2.math diff --git a/Task/Ackermann-function/Mathematica/ackermann-function-3.mathematica b/Task/Ackermann-function/Mathematica/ackermann-function-3.math similarity index 100% rename from Task/Ackermann-function/Mathematica/ackermann-function-3.mathematica rename to Task/Ackermann-function/Mathematica/ackermann-function-3.math diff --git a/Task/Ackermann-function/Mathematica/ackermann-function-4.mathematica b/Task/Ackermann-function/Mathematica/ackermann-function-4.math similarity index 100% rename from Task/Ackermann-function/Mathematica/ackermann-function-4.mathematica rename to Task/Ackermann-function/Mathematica/ackermann-function-4.math diff --git a/Task/Ackermann-function/Mathematica/ackermann-function-5.mathematica b/Task/Ackermann-function/Mathematica/ackermann-function-5.math similarity index 100% rename from Task/Ackermann-function/Mathematica/ackermann-function-5.mathematica rename to Task/Ackermann-function/Mathematica/ackermann-function-5.math diff --git a/Task/Ackermann-function/Mathematica/ackermann-function-6.mathematica b/Task/Ackermann-function/Mathematica/ackermann-function-6.math similarity index 100% rename from Task/Ackermann-function/Mathematica/ackermann-function-6.mathematica rename to Task/Ackermann-function/Mathematica/ackermann-function-6.math diff --git a/Task/Ackermann-function/NetRexx/ackermann-function.netrexx b/Task/Ackermann-function/NetRexx/ackermann-function.netrexx new file mode 100644 index 0000000000..d9f3756518 --- /dev/null +++ b/Task/Ackermann-function/NetRexx/ackermann-function.netrexx @@ -0,0 +1,24 @@ +/* NetRexx */ +options replace format comments java crossref symbols binary + +numeric digits 66 + +parse arg j_ k_ . +if j_ = '' | j_ = '.' | \j_.datatype('w') then j_ = 3 +if k_ = '' | k_ = '.' | \k_.datatype('w') then k_ = 5 + +loop m_ = 0 to j_ + say + loop n_ = 0 to k_ + say 'ackermann('m_','n_') =' ackermann(m_, n_).right(5) + end n_ + end m_ +return + +method ackermann(m, n) public static + select + when m = 0 then rval = n + 1 + when n = 0 then rval = ackermann(m - 1, 1) + otherwise rval = ackermann(m - 1, ackermann(m, n - 1)) + end + return rval diff --git a/Task/Ackermann-function/Nial/ackermann-function.nial b/Task/Ackermann-function/Nial/ackermann-function.nial new file mode 100644 index 0000000000..5f21ef6f6e --- /dev/null +++ b/Task/Ackermann-function/Nial/ackermann-function.nial @@ -0,0 +1,5 @@ +ack is fork [ + = [0 first, first], +[last, 1 first], + = [0 first, last], ack [ -[first, 1 first], 1 first], + ack[ -[first,1 first], ack[first, -[last,1 first]]] +] diff --git a/Task/Ackermann-function/Nimrod/ackermann-function.nimrod b/Task/Ackermann-function/Nimrod/ackermann-function.nimrod new file mode 100644 index 0000000000..a9bf77abe2 --- /dev/null +++ b/Task/Ackermann-function/Nimrod/ackermann-function.nimrod @@ -0,0 +1,7 @@ +proc Ackermann(m, n: int64): int64 = + if m == 0: + result = n + 1 + elif n == 0: + result = Ackermann(m - 1, 1) + else: + result = Ackermann(m - 1, Ackermann(m, n - 1)) diff --git a/Task/Ackermann-function/OCaml/ackermann-function-1.ocaml b/Task/Ackermann-function/OCaml/ackermann-function-1.ocaml new file mode 100644 index 0000000000..4fef632e1e --- /dev/null +++ b/Task/Ackermann-function/OCaml/ackermann-function-1.ocaml @@ -0,0 +1,4 @@ +let rec a m n = + if m=0 then (n+1) else + if n=0 then (a (m-1) 1) else + (a (m-1) (a m (n-1))) diff --git a/Task/Ackermann-function/OCaml/ackermann-function-2.ocaml b/Task/Ackermann-function/OCaml/ackermann-function-2.ocaml new file mode 100644 index 0000000000..bc83dfef45 --- /dev/null +++ b/Task/Ackermann-function/OCaml/ackermann-function-2.ocaml @@ -0,0 +1,4 @@ +let rec a = function + | 0, n -> (n+1) + | m, 0 -> a(m-1, 1) + | m, n -> a(m-1, a(m, n-1)) diff --git a/Task/Ackermann-function/OCaml/ackermann-function-3.ocaml b/Task/Ackermann-function/OCaml/ackermann-function-3.ocaml new file mode 100644 index 0000000000..66cd2557ea --- /dev/null +++ b/Task/Ackermann-function/OCaml/ackermann-function-3.ocaml @@ -0,0 +1,8 @@ +let h = Hashtbl.create 4001 + +let a m n = + try Hashtbl.find h (m, n) + with Not_found -> + let res = a (m, n) in + Hashtbl.add h (m, n) res; + (res) diff --git a/Task/Ackermann-function/OCaml/ackermann-function-4.ocaml b/Task/Ackermann-function/OCaml/ackermann-function-4.ocaml new file mode 100644 index 0000000000..cb01d79d04 --- /dev/null +++ b/Task/Ackermann-function/OCaml/ackermann-function-4.ocaml @@ -0,0 +1,7 @@ +let a m n = + for _m = 0 to m do + for _n = 0 to n do + ignore(a _m _n); + done; + done; + (a m n) diff --git a/Task/Ackermann-function/OCaml/ackermann-function-5.ocaml b/Task/Ackermann-function/OCaml/ackermann-function-5.ocaml new file mode 100644 index 0000000000..7073f4bba0 --- /dev/null +++ b/Task/Ackermann-function/OCaml/ackermann-function-5.ocaml @@ -0,0 +1,11 @@ +open Big_int +let one = unit_big_int +let zero = zero_big_int +let succ = succ_big_int +let pred = pred_big_int +let eq = eq_big_int + +let rec a m n = + if eq m zero then (succ n) else + if eq n zero then (a (pred m) one) else + (a (pred m) (a m (pred n))) diff --git a/Task/Ackermann-function/OCaml/ackermann-function-6.ocaml b/Task/Ackermann-function/OCaml/ackermann-function-6.ocaml new file mode 100644 index 0000000000..ee50ce6b32 --- /dev/null +++ b/Task/Ackermann-function/OCaml/ackermann-function-6.ocaml @@ -0,0 +1,30 @@ +let rec find_option h v = + try Some(Hashtbl.find h v) + with Not_found -> None + +let rec a bounds caller todo m n = + match m, n with + | 0, n -> + let r = (n+1) in + ( match todo with + | [] -> r + | (m,n)::todo -> + List.iter (fun k -> + if not(Hashtbl.mem bounds k) + then Hashtbl.add bounds k r) caller; + a bounds [] todo m n ) + + | m, 0 -> + a bounds caller todo (m-1) 1 + + | m, n -> + match find_option bounds (m, n-1) with + | Some a_rec -> + let caller = (m,n)::caller in + a bounds caller todo (m-1) a_rec + | None -> + let todo = (m,n)::todo + and caller = [(m, n-1)] in + a bounds caller todo m (n-1) + +let a = a (Hashtbl.create 42 (* arbitrary *) ) [] [] ;; diff --git a/Task/Ackermann-function/OCaml/ackermann-function-7.ocaml b/Task/Ackermann-function/OCaml/ackermann-function-7.ocaml new file mode 100644 index 0000000000..714247aab1 --- /dev/null +++ b/Task/Ackermann-function/OCaml/ackermann-function-7.ocaml @@ -0,0 +1,79 @@ +open Big_int +let one = unit_big_int +let zero = zero_big_int +let succ = succ_big_int +let pred = pred_big_int +let add = add_big_int +let sub = sub_big_int +let eq = eq_big_int +let three = succ(succ one) +let power = power_int_positive_big_int + +let eq2 (a1,a2) (b1,b2) = + (eq a1 b1) && (eq a2 b2) + +module H = Hashtbl.Make + (struct + type t = Big_int.big_int * Big_int.big_int + let equal = eq2 + let hash (x,y) = Hashtbl.hash + (Big_int.string_of_big_int x ^ "," ^ + Big_int.string_of_big_int y) + (* probably not a very good hash function *) + end) + +let rec find_option h v = + try Some (H.find h v) + with Not_found -> None + +let rec a bounds caller todo m n = + let may_tail r = + let k = (m,n) in + match todo with + | [] -> r + | (m,n)::todo -> + List.iter (fun k -> + if not (H.mem bounds k) + then H.add bounds k r) (k::caller); + a bounds [] todo m n + in + match m, n with + | m, n when eq m zero -> + let r = (succ n) in + may_tail r + + | m, n when eq n zero -> + let caller = (m,n)::caller in + a bounds caller todo (pred m) one + + | m, n when eq m three -> + let r = sub (power 2 (add n three)) three in + may_tail r + + | m, n -> + match find_option bounds (m, pred n) with + | Some a_rec -> + let caller = (m,n)::caller in + a bounds caller todo (pred m) a_rec + | None -> + let todo = (m,n)::todo in + let caller = [(m, pred n)] in + a bounds caller todo m (pred n) + +let a = a (H.create 42 (* arbitrary *)) [] [] ;; + +let () = + let m, n = + try + big_int_of_string Sys.argv.(1), + big_int_of_string Sys.argv.(2) + with _ -> + Printf.eprintf "usage: %s \n" Sys.argv.(0); + exit 1 + in + let r = a m n in + Printf.printf "(a %s %s) = %s\n" + (string_of_big_int m) + (string_of_big_int n) + (string_of_big_int r); +;; diff --git a/Task/Ackermann-function/Oberon-2/ackermann-function.oberon-2 b/Task/Ackermann-function/Oberon-2/ackermann-function.oberon-2 new file mode 100644 index 0000000000..acd28a6df5 --- /dev/null +++ b/Task/Ackermann-function/Oberon-2/ackermann-function.oberon-2 @@ -0,0 +1,26 @@ +MODULE ackerman; + +IMPORT Out; + +VAR m, n : INTEGER; + +PROCEDURE Ackerman (x, y : INTEGER) : INTEGER; + +BEGIN + IF x = 0 THEN RETURN y + 1 + ELSIF y = 0 THEN RETURN Ackerman (x - 1 , 1) + ELSE + RETURN Ackerman (x - 1 , Ackerman (x , y - 1)) + END +END Ackerman; + +BEGIN + FOR m := 0 TO 3 DO + FOR n := 0 TO 6 DO + Out.Int (Ackerman (m, n), 10); + Out.Char (9X) + END; + Out.Ln + END; + Out.Ln +END ackerman. diff --git a/Task/Ackermann-function/Octave/ackermann-function.octave b/Task/Ackermann-function/Octave/ackermann-function.octave new file mode 100644 index 0000000000..b70cfa6234 --- /dev/null +++ b/Task/Ackermann-function/Octave/ackermann-function.octave @@ -0,0 +1,13 @@ +function r = ackerman(m, n) + if ( m == 0 ) + r = n + 1; + elseif ( n == 0 ) + r = ackerman(m-1, 1); + else + r = ackerman(m-1, ackerman(m, n-1)); + endif +endfunction + +for i = 0:3 + disp(ackerman(i, 4)); +endfor diff --git a/Task/Ackermann-function/Order/ackermann-function.order b/Task/Ackermann-function/Order/ackermann-function.order new file mode 100644 index 0000000000..e50e19e64c --- /dev/null +++ b/Task/Ackermann-function/Order/ackermann-function.order @@ -0,0 +1,9 @@ +#include + +#define ORDER_PP_DEF_8ack ORDER_PP_FN( \ +8fn(8X, 8Y, \ + 8cond((8is_0(8X), 8inc(8Y)) \ + (8is_0(8Y), 8ack(8dec(8X), 1)) \ + (8else, 8ack(8dec(8X), 8ack(8X, 8dec(8Y))))))) + +ORDER_PP(8to_lit(8ack(3, 4))) // 125 diff --git a/Task/Ackermann-function/Oz/ackermann-function.oz b/Task/Ackermann-function/Oz/ackermann-function.oz new file mode 100644 index 0000000000..fa84c41eb5 --- /dev/null +++ b/Task/Ackermann-function/Oz/ackermann-function.oz @@ -0,0 +1,12 @@ +declare + + fun {Ack M N} + if M == 0 then N+1 + elseif N == 0 then {Ack M-1 1} + else {Ack M-1 {Ack M N-1}} + end + end + +in + + {Show {Ack 3 7}} diff --git a/Task/Ackermann-function/PARI-GP/ackermann-function.pari b/Task/Ackermann-function/PARI-GP/ackermann-function.pari new file mode 100644 index 0000000000..bf95c276f5 --- /dev/null +++ b/Task/Ackermann-function/PARI-GP/ackermann-function.pari @@ -0,0 +1,11 @@ +A(m,n)={ + if(m, + if(n, + A(m-1, A(m,n-1)) + , + A(m-1,1) + ) + , + n+1 + ) +}; diff --git a/Task/Ackermann-function/PL-I/ackermann-function.pli b/Task/Ackermann-function/PL-I/ackermann-function.pli new file mode 100644 index 0000000000..477c75d34d --- /dev/null +++ b/Task/Ackermann-function/PL-I/ackermann-function.pli @@ -0,0 +1,7 @@ +Ackerman: procedure (m, n) returns (fixed (30)) recursive; + declare (m, n) fixed (30); + if m = 0 then return (n+1); + else if m > 0 & n = 0 then return (Ackerman(m-1, 1)); + else if m > 0 & n > 0 then return (Ackerman(m-1, Ackerman(m, n-1))); + return (0); +end Ackerman; diff --git a/Task/Ackermann-function/Pascal/ackermann-function.pascal b/Task/Ackermann-function/Pascal/ackermann-function.pascal new file mode 100644 index 0000000000..6ab6e286d2 --- /dev/null +++ b/Task/Ackermann-function/Pascal/ackermann-function.pascal @@ -0,0 +1,20 @@ +Program Ackerman; + +function ackermann(m, n: Integer) : Integer; +begin + if m = 0 then + ackermann := n+1 + else if n = 0 then + ackermann := ackermann(m-1, 1) + else + ackermann := ackermann(m-1, ackermann(m, n-1)); +end; + +var + m, n : Integer; + +begin + for n := 0 to 6 do + for m := 0 to 3 do + WriteLn('A(', m, ',', n, ') = ', ackermann(m,n)); +end. diff --git a/Task/Ackermann-function/Perl-6/ackermann-function-1.pl6 b/Task/Ackermann-function/Perl-6/ackermann-function-1.pl6 new file mode 100644 index 0000000000..e6ffcc85f3 --- /dev/null +++ b/Task/Ackermann-function/Perl-6/ackermann-function-1.pl6 @@ -0,0 +1,7 @@ +sub A(Int $m, Int $n) { + + $m == 0 ?? $n + 1 !! + $n == 0 ?? A($m - 1, 1 ) !! + A($m - 1, A($m, $n - 1)); + +} diff --git a/Task/Ackermann-function/Perl-6/ackermann-function-2.pl6 b/Task/Ackermann-function/Perl-6/ackermann-function-2.pl6 new file mode 100644 index 0000000000..f359bd8939 --- /dev/null +++ b/Task/Ackermann-function/Perl-6/ackermann-function-2.pl6 @@ -0,0 +1,3 @@ +multi sub A(0, Int $n) { $n + 1 } +multi sub A(Int $m, 0 ) { A($m - 1, 1) } +multi sub A(Int $m, Int $n) { A($m - 1, A($m, $n - 1)) } diff --git a/Task/Ackermann-function/Perl-6/ackermann-function-3.pl6 b/Task/Ackermann-function/Perl-6/ackermann-function-3.pl6 new file mode 100644 index 0000000000..15b6c179f2 --- /dev/null +++ b/Task/Ackermann-function/Perl-6/ackermann-function-3.pl6 @@ -0,0 +1,9 @@ +proto A(Int \𝑚, Int \𝑛) { (state @)[𝑚][𝑛] //= {*} } + +multi A(0, Int \𝑛) { 𝑛 + 1 } +multi A(1, Int \𝑛) { 𝑛 + 2 } +multi A(2, Int \𝑛) { 3 + 2 * 𝑛 } +multi A(3, Int \𝑛) { 5 + 8 * (2 ** 𝑛 - 1) } + +multi A(Int \𝑚, 0 ) { A(𝑚 - 1, 1) } +multi A(Int \𝑚, Int \𝑛) { A(𝑚 - 1, A(𝑚, 𝑛 - 1)) } diff --git a/Task/Ackermann-function/Perl-6/ackermann-function-4.pl6 b/Task/Ackermann-function/Perl-6/ackermann-function-4.pl6 new file mode 100644 index 0000000000..806216bd64 --- /dev/null +++ b/Task/Ackermann-function/Perl-6/ackermann-function-4.pl6 @@ -0,0 +1,2 @@ +say A(4,1); +say .chars, " digits starting with ", .substr(0,50), "..." given A(4,2); diff --git a/Task/Ackermann-function/Pike/ackermann-function.pike b/Task/Ackermann-function/Pike/ackermann-function.pike new file mode 100644 index 0000000000..86bf439868 --- /dev/null +++ b/Task/Ackermann-function/Pike/ackermann-function.pike @@ -0,0 +1,13 @@ +int main(){ + write(ackermann(3,4) + "\n"); +} + +int ackermann(int m, int n){ + if(m == 0){ + return n + 1; + } else if(n == 0){ + return ackermann(m-1, 1); + } else { + return ackermann(m-1, ackermann(m, n-1)); + } +} diff --git a/Task/Ackermann-function/PostScript/ackermann-function-1.ps b/Task/Ackermann-function/PostScript/ackermann-function-1.ps new file mode 100644 index 0000000000..20dc9e0a5b --- /dev/null +++ b/Task/Ackermann-function/PostScript/ackermann-function-1.ps @@ -0,0 +1,14 @@ +/ackermann{ +/n exch def +/m exch def %PostScript takes arguments in the reverse order as specified in the function definition +m 0 eq{ +n 1 add +}if +m 0 gt n 0 eq and +{ +m 1 sub 1 ackermann +}if +m 0 gt n 0 gt and{ +m 1 sub m n 1 sub ackermann ackermann +}if +}def diff --git a/Task/Ackermann-function/PostScript/ackermann-function-2.ps b/Task/Ackermann-function/PostScript/ackermann-function-2.ps new file mode 100644 index 0000000000..91d03bdb0f --- /dev/null +++ b/Task/Ackermann-function/PostScript/ackermann-function-2.ps @@ -0,0 +1,8 @@ +/A { +[/.m /.n] let +{ + {.m 0 eq} {.n succ} is? + {.m 0 gt .n 0 eq and} {.m pred 1 A} is? + {.m 0 gt .n 0 gt and} {.m pred .m .n pred A A} is? +} cond +end}. diff --git a/Task/Ackermann-function/PowerBASIC/ackermann-function.powerbasic b/Task/Ackermann-function/PowerBASIC/ackermann-function.powerbasic new file mode 100644 index 0000000000..b6bea5c80a --- /dev/null +++ b/Task/Ackermann-function/PowerBASIC/ackermann-function.powerbasic @@ -0,0 +1,18 @@ +FUNCTION PBMAIN () AS LONG + DIM m AS QUAD, n AS QUAD + + m = ABS(VAL(INPUTBOX$("Enter a whole number."))) + n = ABS(VAL(INPUTBOX$("Enter another whole number."))) + + MSGBOX STR$(Ackermann(m, n)) +END FUNCTION + +FUNCTION Ackermann (m AS QUAD, n AS QUAD) AS QUAD + IF 0 = m THEN + FUNCTION = n + 1 + ELSEIF 0 = n THEN + FUNCTION = Ackermann(m - 1, 1) + ELSE ' m > 0; n > 0 + FUNCTION = Ackermann(m - 1, Ackermann(m, n - 1)) + END IF +END FUNCTION diff --git a/Task/Ackermann-function/PowerShell/ackermann-function-1.psh b/Task/Ackermann-function/PowerShell/ackermann-function-1.psh new file mode 100644 index 0000000000..f9d21e4e7f --- /dev/null +++ b/Task/Ackermann-function/PowerShell/ackermann-function-1.psh @@ -0,0 +1,11 @@ +function ackermann ([long] $m, [long] $n) { + if ($m -eq 0) { + return $n + 1 + } + + if ($n -eq 0) { + return (ackermann ($m - 1) 1) + } + + return (ackermann ($m - 1) (ackermann $m ($n - 1))) +} diff --git a/Task/Ackermann-function/PowerShell/ackermann-function-2.psh b/Task/Ackermann-function/PowerShell/ackermann-function-2.psh new file mode 100644 index 0000000000..a8ef2f8842 --- /dev/null +++ b/Task/Ackermann-function/PowerShell/ackermann-function-2.psh @@ -0,0 +1,6 @@ +foreach ($m in 0..3) { + foreach ($n in 0..6) { + Write-Host -NoNewline ("{0,5}" -f (ackermann $m $n)) + } + Write-Host +} diff --git a/Task/Ackermann-function/Pure/ackermann-function.pure b/Task/Ackermann-function/Pure/ackermann-function.pure new file mode 100644 index 0000000000..fd3cd945f8 --- /dev/null +++ b/Task/Ackermann-function/Pure/ackermann-function.pure @@ -0,0 +1,3 @@ +A 0 n = n+1; +A m 0 = A (m-1) 1 if m > 0; +A m n = A (m-1) (A m (n-1)) if m > 0 && n > 0; diff --git a/Task/Ackermann-function/PureBasic/ackermann-function.purebasic b/Task/Ackermann-function/PureBasic/ackermann-function.purebasic new file mode 100644 index 0000000000..b2431e3a9e --- /dev/null +++ b/Task/Ackermann-function/PureBasic/ackermann-function.purebasic @@ -0,0 +1,11 @@ +Procedure.q Ackermann(m, n) + If m = 0 + ProcedureReturn n + 1 + ElseIf n = 0 + ProcedureReturn Ackermann(m - 1, 1) + Else + ProcedureReturn Ackermann(m - 1, Ackermann(m, n - 1)) + EndIf +EndProcedure + +Debug Ackermann(3,4) diff --git a/Task/Ackermann-function/Purity/ackermann-function.purity b/Task/Ackermann-function/Purity/ackermann-function.purity new file mode 100644 index 0000000000..a1bf9396c6 --- /dev/null +++ b/Task/Ackermann-function/Purity/ackermann-function.purity @@ -0,0 +1,2 @@ +data Iter = f => FoldNat +data Ackermann = FoldNat diff --git a/Task/Ackermann-function/Run-BASIC/ackermann-function.run b/Task/Ackermann-function/Run-BASIC/ackermann-function.run new file mode 100644 index 0000000000..7d958974f8 --- /dev/null +++ b/Task/Ackermann-function/Run-BASIC/ackermann-function.run @@ -0,0 +1,9 @@ +print ackermann(1, 2) + +function ackermann(m, n) + if (m < 0) or (n < 0) then goto [exitFunction] + if (m = 0) then ackermann = (n + 1) + if (m > 0) and (n = 0) then ackermann = ackermann((m - 1), 1) + if (m > 0) and (n > 0) then ackermann = ackermann((m - 1), ackermann(m, (n - 1))) +[exitFunction] +end function diff --git a/Task/Ackermann-function/SETL/ackermann-function.setl b/Task/Ackermann-function/SETL/ackermann-function.setl new file mode 100644 index 0000000000..f498c76df7 --- /dev/null +++ b/Task/Ackermann-function/SETL/ackermann-function.setl @@ -0,0 +1,11 @@ +program ackermann; + +(for m in [0..3]) + print(+/ [rpad('' + ack(m, n), 4): n in [0..6]]); +end; + +proc ack(m, n); + return {[0,n+1]}(m) ? ack(m-1, {[0,1]}(n) ? ack(m, n-1)); +end proc; + +end program; diff --git a/Task/Ackermann-function/SNOBOL4/ackermann-function.sno b/Task/Ackermann-function/SNOBOL4/ackermann-function.sno new file mode 100644 index 0000000000..178d1c09ce --- /dev/null +++ b/Task/Ackermann-function/SNOBOL4/ackermann-function.sno @@ -0,0 +1,12 @@ +define('ack(m,n)') :(ack_end) +ack ack = eq(m,0) n + 1 :s(return) + ack = eq(n,0) ack(m - 1,1) :s(return) + ack = ack(m - 1,ack(m,n - 1)) :(return) +ack_end + +* # Test and display ack(0,0) .. ack(3,6) +L1 str = str ack(m,n) ' ' + n = lt(n,6) n + 1 :s(L1) + output = str; str = '' + n = 0; m = lt(m,3) m + 1 :s(L1) +end diff --git a/Task/Ackermann-function/Seed7/ackermann-function.seed7 b/Task/Ackermann-function/Seed7/ackermann-function.seed7 new file mode 100644 index 0000000000..66008419e6 --- /dev/null +++ b/Task/Ackermann-function/Seed7/ackermann-function.seed7 @@ -0,0 +1,12 @@ +const func integer: ackermann (in integer: m, in integer: n) is func + result + var integer: result is 0; + begin + if m = 0 then + result := succ(n); + elsif n = 0 then + result := ackermann(pred(m), 1); + else + result := ackermann(pred(m), ackermann(m, pred(n))); + end if; + end func; diff --git a/Task/Ackermann-function/Slate/ackermann-function.slate b/Task/Ackermann-function/Slate/ackermann-function.slate new file mode 100644 index 0000000000..9b12036a4b --- /dev/null +++ b/Task/Ackermann-function/Slate/ackermann-function.slate @@ -0,0 +1,9 @@ +m@(Integer traits) ackermann: n@(Integer traits) +[ + m isZero + ifTrue: [n + 1] + ifFalse: + [n isZero + ifTrue: [m - 1 ackermann: n] + ifFalse: [m - 1 ackermann: (m ackermann: n - 1)]] +]. diff --git a/Task/Ackermann-function/Standard-ML/ackermann-function.ml b/Task/Ackermann-function/Standard-ML/ackermann-function.ml new file mode 100644 index 0000000000..fcba56a8cc --- /dev/null +++ b/Task/Ackermann-function/Standard-ML/ackermann-function.ml @@ -0,0 +1,3 @@ +fun a (0, n) = n+1 + | a (m, 0) = a (m-1, 1) + | a (m, n) = a (m-1, a (m, n-1)) diff --git a/Task/Ackermann-function/TI-89-BASIC/ackermann-function.ti-89 b/Task/Ackermann-function/TI-89-BASIC/ackermann-function.ti-89 new file mode 100644 index 0000000000..4fcc746f2c --- /dev/null +++ b/Task/Ackermann-function/TI-89-BASIC/ackermann-function.ti-89 @@ -0,0 +1 @@ +Define A(m,n) = when(m=0, n+1, when(n=0, A(m-1,1), A(m-1, A(m, n-1)))) diff --git a/Task/Ackermann-function/TSE-SAL/ackermann-function.tse b/Task/Ackermann-function/TSE-SAL/ackermann-function.tse new file mode 100644 index 0000000000..57969a9710 --- /dev/null +++ b/Task/Ackermann-function/TSE-SAL/ackermann-function.tse @@ -0,0 +1,18 @@ +// library: math: get: ackermann: recursive 1.0.0.0.5 (filenamemacro=getmaare.s) [kn, ri, tu, 27-12-2011 14:46:59] +INTEGER PROC FNMathGetAckermannRecursiveI( INTEGER mI, INTEGER nI ) + IF ( mI == 0 ) + RETURN( nI + 1 ) + ENDIF + IF ( nI == 0 ) + RETURN( FNMathGetAckermannRecursiveI( mI - 1, 1 ) ) + ENDIF + RETURN( FNMathGetAckermannRecursiveI( mI - 1, FNMathGetAckermannRecursiveI( mI, nI - 1 ) ) ) +END + +PROC Main() +STRING s1[255] = "2" +STRING s2[255] = "3" +IF ( NOT ( Ask( "math: get: ackermann: recursive: m = ", s1, _EDIT_HISTORY_ ) ) AND ( Length( s1 ) > 0 ) ) RETURN() ENDIF +IF ( NOT ( Ask( "math: get: ackermann: recursive: n = ", s2, _EDIT_HISTORY_ ) ) AND ( Length( s2 ) > 0 ) ) RETURN() ENDIF + Message( FNMathGetAckermannRecursiveI( Val( s1 ), Val( s2 ) ) ) // gives e.g. 9 +END diff --git a/Task/Ackermann-function/UNIX-Shell/ackermann-function-1.sh b/Task/Ackermann-function/UNIX-Shell/ackermann-function-1.sh new file mode 100644 index 0000000000..7b68d5d130 --- /dev/null +++ b/Task/Ackermann-function/UNIX-Shell/ackermann-function-1.sh @@ -0,0 +1,11 @@ +ack() { + local m=$1 + local n=$2 + if [ $m -eq 0 ]; then + echo -n $((n+1)) + elif [ $n -eq 0 ]; then + ack $((m-1)) 1 + else + ack $((m-1)) $(ack $m $((n-1))) + fi +} diff --git a/Task/Ackermann-function/UNIX-Shell/ackermann-function-2.sh b/Task/Ackermann-function/UNIX-Shell/ackermann-function-2.sh new file mode 100644 index 0000000000..ac1a30e8b8 --- /dev/null +++ b/Task/Ackermann-function/UNIX-Shell/ackermann-function-2.sh @@ -0,0 +1,7 @@ +for ((m=0;m<=3;m++)); do + for ((n=0;n<=6;n++)); do + ack $m $n + echo -n " " + done + echo +done diff --git a/Task/Ackermann-function/Ursala/ackermann-function-1.ursala b/Task/Ackermann-function/Ursala/ackermann-function-1.ursala new file mode 100644 index 0000000000..203184c69d --- /dev/null +++ b/Task/Ackermann-function/Ursala/ackermann-function-1.ursala @@ -0,0 +1,8 @@ +#import std +#import nat + +ackermann = + +~&al^?\successor@ar ~&ar?( + ^R/~&f ^/predecessor@al ^|R/~& ^|/~& predecessor, + ^|R/~& ~&\1+ predecessor@l) diff --git a/Task/Ackermann-function/Ursala/ackermann-function-2.ursala b/Task/Ackermann-function/Ursala/ackermann-function-2.ursala new file mode 100644 index 0000000000..4b1f50e6ab --- /dev/null +++ b/Task/Ackermann-function/Ursala/ackermann-function-2.ursala @@ -0,0 +1,3 @@ +#cast %nLL + +test = block7 ackermann*K0 iota~~/4 7 diff --git a/Task/Ackermann-function/V/ackermann-function-1.v b/Task/Ackermann-function/V/ackermann-function-1.v new file mode 100644 index 0000000000..857a314087 --- /dev/null +++ b/Task/Ackermann-function/V/ackermann-function-1.v @@ -0,0 +1,5 @@ +[ack + [ [pop zero?] [popd succ] + [zero?] [pop pred 1 ack] + [true] [[dup pred swap] dip pred ack ack ] + ] when]. diff --git a/Task/Ackermann-function/V/ackermann-function-2.v b/Task/Ackermann-function/V/ackermann-function-2.v new file mode 100644 index 0000000000..938e5cc9c2 --- /dev/null +++ b/Task/Ackermann-function/V/ackermann-function-2.v @@ -0,0 +1,5 @@ +[ack + [ [pop zero?] [ [m n : [n succ]] view i] + [zero?] [ [m n : [m pred 1 ack]] view i] + [true] [ [m n : [m pred m n pred ack ack]] view i] + ] when]. diff --git a/Task/Ackermann-function/VBScript/ackermann-function-1.vbscript b/Task/Ackermann-function/VBScript/ackermann-function-1.vbscript new file mode 100644 index 0000000000..a9a32ec1ee --- /dev/null +++ b/Task/Ackermann-function/VBScript/ackermann-function-1.vbscript @@ -0,0 +1,20 @@ +option explicit +'~ dim depth +function ack(m, n) + '~ wscript.stdout.write depth & " " + if m = 0 then + '~ depth = depth + 1 + ack = n + 1 + '~ depth = depth - 1 + elseif m > 0 and n = 0 then + '~ depth = depth + 1 + ack = ack(m - 1, 1) + '~ depth = depth - 1 + '~ elseif m > 0 and n > 0 then + else + '~ depth = depth + 1 + ack = ack(m - 1, ack(m, n - 1)) + '~ depth = depth - 1 + end if + +end function diff --git a/Task/Ackermann-function/VBScript/ackermann-function-2.vbscript b/Task/Ackermann-function/VBScript/ackermann-function-2.vbscript new file mode 100644 index 0000000000..3d186bb0ed --- /dev/null +++ b/Task/Ackermann-function/VBScript/ackermann-function-2.vbscript @@ -0,0 +1,5 @@ +wscript.echo ack( 1, 10 ) +'~ depth = 0 +wscript.echo ack( 2, 1 ) +'~ depth = 0 +wscript.echo ack( 4, 4 ) diff --git a/Task/Ackermann-function/XPL0/ackermann-function.xpl0 b/Task/Ackermann-function/XPL0/ackermann-function.xpl0 new file mode 100644 index 0000000000..735e9f0b54 --- /dev/null +++ b/Task/Ackermann-function/XPL0/ackermann-function.xpl0 @@ -0,0 +1,16 @@ +include c:\cxpl\codes; + +func Ackermann(M, N); +int M, N; +[if M=0 then return N+1; + if N=0 then return Ackermann(M-1, 1); +return Ackermann(M-1, Ackermann(M, N-1)); +]; \Ackermann + +int M, N; +[for M:= 0 to 3 do + [for N:= 0 to 7 do + [IntOut(0, Ackermann(M, N)); ChOut(0,9\tab\)]; + CrLf(0); + ]; +] diff --git a/Task/Ackermann-function/Yorick/ackermann-function-1.yorick b/Task/Ackermann-function/Yorick/ackermann-function-1.yorick new file mode 100644 index 0000000000..5d4d4b9b35 --- /dev/null +++ b/Task/Ackermann-function/Yorick/ackermann-function-1.yorick @@ -0,0 +1,8 @@ +func ack(m, n) { + if(m == 0) + return n + 1; + else if(n == 0) + return ack(m - 1, 1); + else + return ack(m - 1, ack(m, n - 1)); +} diff --git a/Task/Ackermann-function/Yorick/ackermann-function-2.yorick b/Task/Ackermann-function/Yorick/ackermann-function-2.yorick new file mode 100644 index 0000000000..d340e42626 --- /dev/null +++ b/Task/Ackermann-function/Yorick/ackermann-function-2.yorick @@ -0,0 +1,5 @@ +for(m = 0; m <= 3; m++) { + for(n = 0; n <= 6; n++) + write, format="%d ", ack(m, n); + write, ""; +} diff --git a/Task/Ackermann-function/ZED/ackermann-function.zed b/Task/Ackermann-function/ZED/ackermann-function.zed new file mode 100644 index 0000000000..eb8990588c --- /dev/null +++ b/Task/Ackermann-function/ZED/ackermann-function.zed @@ -0,0 +1,14 @@ +("ackermann") m n +0 3 +(zero?) m +(add1) n + +("ackermann") m n +2 0 +(and) (positive?) m (zero?) n +("ackermann") (sub1) m 1 + +("ackermann") m n +2 3 +(and) (positive?) m (positive?) n +("ackermann") (sub1) m ("ackermann") m (sub1) n diff --git a/Task/Active-Directory-Connect/NetRexx/active-directory-connect-1.netrexx b/Task/Active-Directory-Connect/NetRexx/active-directory-connect-1.netrexx new file mode 100644 index 0000000000..d94c2e632d --- /dev/null +++ b/Task/Active-Directory-Connect/NetRexx/active-directory-connect-1.netrexx @@ -0,0 +1,43 @@ +/* NetRexx */ +options replace format comments java crossref symbols binary + +import org.apache.directory.ldap.client.api.LdapConnection +import org.apache.directory.ldap.client.api.LdapNetworkConnection +import org.apache.directory.shared.ldap.model.exception.LdapException +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +class RDirectoryLDAP public + + properties constant + log_ = LoggerFactory.getLogger(RDirectoryLDAP.class) + + properties private static + connection = LdapConnection null + + method main(args = String[]) public static + ldapHostName = String "localhost" + ldapPort = int 10389 + + if log_.isInfoEnabled() then log_.info("LDAP Connection to" ldapHostName "on port" ldapPort) + connection = LdapNetworkConnection(ldapHostName, ldapPort) + + do + if log_.isTraceEnabled() then log_.trace("LDAP bind") + connection.bind() + + if log_.isTraceEnabled() then log_.trace("LDAP unbind") + connection.unBind() + catch lex = LdapException + log_.error("LDAP Error", Throwable lex) + catch iox = IOException + log_.error("I/O Error", Throwable iox) + finally + do + if connection \= null then connection.close() + catch iox = IOException + log_.error("I/O Error on connection.close()", Throwable iox) + end + end + + return diff --git a/Task/Active-Directory-Connect/NetRexx/active-directory-connect-2.netrexx b/Task/Active-Directory-Connect/NetRexx/active-directory-connect-2.netrexx new file mode 100644 index 0000000000..3ec88e94d3 --- /dev/null +++ b/Task/Active-Directory-Connect/NetRexx/active-directory-connect-2.netrexx @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Task/Active-Directory-Connect/Run-BASIC/active-directory-connect.run b/Task/Active-Directory-Connect/Run-BASIC/active-directory-connect.run new file mode 100644 index 0000000000..3f449c35e5 --- /dev/null +++ b/Task/Active-Directory-Connect/Run-BASIC/active-directory-connect.run @@ -0,0 +1 @@ +print shell$("dir") ' shell out to the os and print it diff --git a/Task/Active-Directory-Connect/VBScript/active-directory-connect.vbscript b/Task/Active-Directory-Connect/VBScript/active-directory-connect.vbscript new file mode 100644 index 0000000000..20a4d6788c --- /dev/null +++ b/Task/Active-Directory-Connect/VBScript/active-directory-connect.vbscript @@ -0,0 +1,4 @@ +Set objConn = CreateObject("ADODB.Connection") +Set objCmd = CreateObject("ADODB.Command") +objConn.Provider = "ADsDSOObject" +objConn.Open diff --git a/Task/Active-Directory-Search-for-a-user/NetRexx/active-directory-search-for-a-user.netrexx b/Task/Active-Directory-Search-for-a-user/NetRexx/active-directory-search-for-a-user.netrexx new file mode 100644 index 0000000000..243fb93f87 --- /dev/null +++ b/Task/Active-Directory-Search-for-a-user/NetRexx/active-directory-search-for-a-user.netrexx @@ -0,0 +1,119 @@ +/* NetRexx */ +options replace format comments java crossref symbols binary + +import org.apache.directory.ldap.client.api.LdapConnection +import org.apache.directory.ldap.client.api.LdapNetworkConnection +import org.apache.directory.shared.ldap.model.cursor.EntryCursor +import org.apache.directory.shared.ldap.model.entry.Entry +import org.apache.directory.shared.ldap.model.exception.LdapException +import org.apache.directory.shared.ldap.model.message.SearchScope +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +class RDirectorySearchLDAP public + + properties constant + log_ = LoggerFactory.getLogger(RDirectorySearchLDAP.class) + + properties private constant + ldapHostName = String 'localhost' + ldapPort = int 11389 + ldapDnStr = String 'uid=admin,ou=system' + ldapCreds = String '********' + + isTrue = boolean (1 == 1) + isFalse = boolean (1 \== 1) + + properties private static + connection = LdapConnection + + method main(args = String[]) public static + + connected = isFalse + do + connected = setUp() + if connected then do + search('*mil*') + end + + finally + if connected then do + tearDown() + end + end + + return + + method search(uid = String '*') static returns boolean + + state = isTrue + cursor = EntryCursor + baseDn = 'ou=users,o=mojo' + filter = '(&(objectClass=person)(&(uid=' || uid || ')))' + scope = SearchScope.SUBTREE + attributes = String[] [String 'dn', 'cn', 'sn', 'uid'] + do + if log_.isTraceEnabled() then log_.trace('LDAP search') + if log_.isInfoEnabled() then do + log_.info('Begin search') + log_.info(' search base distinguished name:' baseDn) + log_.info(' search filter:' filter) + log_.info(' search attributes:' Arrays.asList(attributes)) + end + cursor = connection.search(baseDn, filter, scope, attributes) + loop ksearch = 1 while cursor.next() + ev = cursor.get() + if log_.isInfoEnabled() then log_.info('Search cursor entry count:' ksearch) + if log_.isInfoEnabled() then log_.info(ev.toString()) + end ksearch + catch lex = LdapException + state = isFalse + log_.error('LDAP Error in cursor loop: Iteration' ksearch, Throwable lex) + catch ex = Exception + state = isFalse + log_.error('I/O Error in cursor loop: Iteration' ksearch, Throwable ex) + end + + return state + + method setUp() static returns boolean + + state = isFalse + do + if log_.isInfoEnabled() then log_.info('LDAP Connection to' ldapHostName 'on port' ldapPort) + connection = LdapNetworkConnection(ldapHostName, ldapPort) + + if log_.isTraceEnabled() then log_.trace('LDAP bind') + connection.bind(ldapDnStr, ldapCreds) + + state = isTrue + catch lex = LdapException + state = isFalse + log_.error('LDAP Error', Throwable lex) + catch iox = IOException + state = isFalse + log_.error('I/O Error', Throwable iox) + end + + return state + + method tearDown() static returns boolean + + state = isFalse + do + if log_.isTraceEnabled() then log_.trace('LDAP unbind') + connection.unBind() + state = isTrue + catch lex = LdapException + state = isFalse + log_.error('LDAP Error', Throwable lex) + finally + do + connection.close() + catch iox = IOException + state = isFalse + log_.error('I/O Error on connection.close()', Throwable iox) + end + end + + return state diff --git a/Task/Active-Directory-Search-for-a-user/Run-BASIC/active-directory-search-for-a-user.run b/Task/Active-Directory-Search-for-a-user/Run-BASIC/active-directory-search-for-a-user.run new file mode 100644 index 0000000000..29ddaa2cc2 --- /dev/null +++ b/Task/Active-Directory-Search-for-a-user/Run-BASIC/active-directory-search-for-a-user.run @@ -0,0 +1,107 @@ +' --------------------------------------------- +' Directory maintenance +' --------------------------------------------- +cr$ = chr$(13) +dirOf$ = "c:\*.*" ' get directory of + +' ------------------------------------------- +' Shell out directory +' ------------------------------------------- + +[dirShell] +cls +html "
" +loc$ = strRep$(dirOf$,"*.*","") +x$ = shell$("dir ";dirOf$) + +i = 1 +while word$(x$,i,cr$) <> "" + a$ = word$(x$,i,cr$) + if trim$(a$) = "" then goto [next] + if left$(a$,1) = " " then goto [next] + if left$(a$,1) = cr$ then goto [next] + type$ = mid$(a$,26,3) + size$ = mid$(a$,30,9) + size$ = strRep$(size$,",","") + size = val(size$) + if type$ <> "DIR" and size = 0 then goto [next] + name$ = mid$(a$,40) + a$ = strRep$(a$,"<","[") + a$ = strRep$(a$,">","]") + html left$(a$,39) + link #ddir,name$, [doDir] + #ddir setkey(type$;"|";loc$;name$) + html "
" + goto [next1] + [next] + print a$ + [next1] + i = i + 1 +wend +wait +[doDir] +type$ = word$(EventKey$,1,"|") +name$ = word$(EventKey$,2,"|") + +if type$ = "DIR" then + dirOf$ = name$;"\*.*" + goto [dirShell] +end if + +html "" +wait + +[delete] + kill name$ + goto [dirShell] + +[view] +nname$ = strRep$(name$,"\","/") +print "File:";nname$ +nname$ = mid$(nname$,3) +html "" +print "" + +wait + +[upload] +print "Upload File:";name$ +files #f, name$ +if #f HASANSWER() = 0 then + print "File: ";name$;" not found" +end if + +' ------------------------------------- +' load data to directory +' ------------------------------------- +OPEN name$ FOR binary AS #f +filedata$ = input$(#f, LOF(#f)) +CLOSE #f +print filedata$ +wait + +f$ = photoDir$;uploadId$ +OPEN f$ FOR binary AS #f +PRINT #f, filedata$ +CLOSE #f +wait + +' -------------------------------- +' string replace rep str with +' -------------------------------- +FUNCTION strRep$(strRep$,rep$,with$) +ln = len(rep$) +k = instr(strRep$,rep$) +while k + strRep$ = left$(strRep$,k - 1) + with$ + mid$(strRep$,k + ln) + k = instr(strRep$,rep$) +WEND +END FUNCTION +end diff --git a/Task/Active-Directory-Search-for-a-user/UNIX-Shell/active-directory-search-for-a-user.sh b/Task/Active-Directory-Search-for-a-user/UNIX-Shell/active-directory-search-for-a-user.sh new file mode 100644 index 0000000000..deb44d8804 --- /dev/null +++ b/Task/Active-Directory-Search-for-a-user/UNIX-Shell/active-directory-search-for-a-user.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +LDAP_HOST="localhost" +LDAP_PORT=11389 +LDAP_DN_STR="uid=admin,ou=system" +LDAP_CREDS="********" +LDAP_BASE_DN="ou=users,o=mojo" +LDAP_SCOPE="sub" +LDAP_FILTER="(&(objectClass=person)(&(uid=*mil*)))" +LDAP_ATTRIBUTES="dn cn sn uid" + +ldapsearch \ + -s base \ + -h $LDAP_HOST \ + -p $LDAP_PORT \ + -LLL \ + -x \ + -v \ + -s $LDAP_SCOPE \ + -D $LDAP_DN_STR \ + -w $LDAP_CREDS \ + -b $LDAP_BASE_DN \ + $LDAP_FILTER \ + $LDAP_ATTRIBUTES diff --git a/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-1.vbscript b/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-1.vbscript new file mode 100644 index 0000000000..7dc75eaa5c --- /dev/null +++ b/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-1.vbscript @@ -0,0 +1,7 @@ +strUsername = "TestUser" +strQuery = ";"_ + & "(&(objectclass=*)(samaccountname=" & strUsername & "));distinguishedname;subtree" +objCmd.ActiveConnection = objConn +objCmd.Properties("Page Size")=100 +objCmd.CommandText = strQuery +Set objRS = objCmd.Execute diff --git a/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-2.vbscript b/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-2.vbscript new file mode 100644 index 0000000000..8a3b362d41 --- /dev/null +++ b/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-2.vbscript @@ -0,0 +1,3 @@ +If objRS.RecordCount = 1 Then + WScript.Echo objRS.Fields("DistinguishedName") +End If diff --git a/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-3.vbscript b/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-3.vbscript new file mode 100644 index 0000000000..6619fc8fa9 --- /dev/null +++ b/Task/Active-Directory-Search-for-a-user/VBScript/active-directory-search-for-a-user-3.vbscript @@ -0,0 +1,5 @@ +If objRS.RecordCount > 0 Then + For Each objUser in ObjRS + WScript.Echo objRS.Fields("DistinguishedName") + Next +End If diff --git a/Task/Active-object/Mathematica/active-object.mathematica b/Task/Active-object/Mathematica/active-object.math similarity index 100% rename from Task/Active-object/Mathematica/active-object.mathematica rename to Task/Active-object/Mathematica/active-object.math diff --git a/Task/Active-object/OxygenBasic/active-object.oxy b/Task/Active-object/OxygenBasic/active-object.oxy new file mode 100644 index 0000000000..34f2d5f3d9 --- /dev/null +++ b/Task/Active-object/OxygenBasic/active-object.oxy @@ -0,0 +1,172 @@ +double MainTime + +'=============== +class RingMaster +'=============== +' +indexbase 1 +sys List[512] 'limit of 512 objects per ringmaster +sys max,acts +' +method Register(sys meth,obj) as sys + sys i + for i=1 to max step 2 + if list[i]=0 then exit for 'vacant slot + next + if i>=max then max+=2 + List[i]<=meth,obj + return i 'token for deregistration etc +end method +' +method Deregister(sys *i) + if i then List[i]<=0,0 : i=0 +end method +' +method Clear() + max=0 +end method +' +method Act() 'called by the timer + sys i,q + for i=1 to max step 2 + q=List[i] + if q then + call q List[i+1] 'anon object + end if + next + acts++ +end method +' +end class + + +'================= +class ActiveObject +'================= +' +double s,freq,t1,t2,v1,v2 +sys nfun,acts,RingToken +RingMaster *Master +' +method fun0() as double +end method +' +method fun1() as double + return sin(2*pi()*freq*MainTime) +end method +' +method func() as double + select case nfun + case 0 : return fun0() + case 1 : return fun1() + end select + 'error? +end method +' +method TimeBasedDuties() + t1=t2 + v1=v2 + t2=MainTime + v2=func + s=s+(v2+v1)*(t2-t1)*0.5 'add slice to integral + acts++ +end method +' +method RegisterWith(RingMaster*r) + @Master=@r + if @Master then + RingToken=Master.register @TimeBasedDuties,@this + end if +end method +' +method Deregister() + if @Master then + Master.Deregister RingToken 'this is set to null + end if +end method +' +method Output() as double + return s +end method +' +method Input(double fr=0,fun=0) + if fr then freq=fr + nfun=fun +end method + +method ClearIntegral() + s=0 +end method +' +end class + + +'SETUP TIMING SYSTEM +'=================== + +extern library "kernel32.dll" +declare QueryPerformanceCounter (quad*c) +declare QueryPerformanceFrequency(quad*f) +declare Sleep(sys milliseconds) +end extern +' +quad scount,tcount,freq +QueryPerformanceFrequency freq +double tscale=1/freq +double t1,t2 +QueryPerformanceCounter scount + +macro PrecisionTime(time) + QueryPerformanceCounter tcount + time=(tcount-scount)*tscale +end macro + + +'==== +'TEST +'==== + +double integral +double tevent1,tevent2 +RingMaster Rudolpho +ActiveObject A +' +A.RegisterWith Rudolpho +A.input (fr=0.5, fun=1) 'start with the freqency function (1) +' +'SET EVENT TIMES +'=============== + +tEvent1=2.0 'seconds +tEvent2=2.5 'seconds +' +PrecisionTime t1 'mark initial time +MainTime=t1 +' +' +'EVENT LOOP +'========== +' +do + PrecisionTime t2 + MainTime=t2 + if t2-t1>=0.020 'seconds interval + Rudolpho.Act 'service all active objects + t1=t2 + end if + ' + if tEvent1>=0 and MainTime>=tEvent1 + A.input (fun=0) 'switch to null function (0) + tEvent1=-1 'disable this event from happening again + end if + if MainTime>=tEvent2 + integral=A.output() + exit do 'end of session + end if + ' + sleep 5 'hand control to OS for a while +end do + +print str(integral,4) + +Rudolpho.clear diff --git a/Task/Active-object/Oz/active-object.oz b/Task/Active-object/Oz/active-object.oz new file mode 100644 index 0000000000..ef9280c53a --- /dev/null +++ b/Task/Active-object/Oz/active-object.oz @@ -0,0 +1,60 @@ +declare + fun {Const X} + fun {$ _} X end + end + + fun {Now} + {Int.toFloat {Property.get 'time.total'}} / 1000.0 + end + + class Integrator from Time.repeat + attr + k:{Const 0.0} + s:0.0 + t1 k_t1 + t2 k_t2 + + meth init(SampleIntervalMS) + t1 := {Now} + k_t1 := {@k @t1} + {self setRepAll(action:Update + delay:SampleIntervalMS)} + thread + {self go} + end + end + + meth input(K) + k := K + end + + meth output($) + @s + end + + meth Update + t2 := {Now} + k_t2 := {@k @t2} + s := @s + (@k_t1 + @k_t2) * (@t2 - @t1) / 2.0 + t1 := @t2 + k_t1 := @k_t2 + end + end + + Pi = 3.14159265 + F = 0.5 + + I = {New Integrator init(10)} +in + {I input(fun {$ T} + {Sin 2.0 * Pi * F * T} + end)} + + {Delay 2000} %% ms + + {I input({Const 0.0})} + + {Delay 500} %% ms + + {Show {I output($)}} + {I stop} diff --git a/Task/Active-object/PureBasic/active-object.purebasic b/Task/Active-object/PureBasic/active-object.purebasic new file mode 100644 index 0000000000..93d5d307f2 --- /dev/null +++ b/Task/Active-object/PureBasic/active-object.purebasic @@ -0,0 +1,72 @@ +Prototype.d ValueFunction(f.d, t.d) + +Class IntegralClass + Time0.i + Mutex.i + S.d + Freq.d + Thread.i + Quit.i + *func.ValueFunction + + Protect Method Sampler() + Repeat + Delay(1) + If This\func And This\Mutex + LockMutex(This\Mutex) + This\S + This\func(This\Freq, ElapsedMilliseconds()-This\Time0) + UnlockMutex(This\Mutex) + EndIf + Until This\Quit + EndMethod + + BeginPublic + Method Input(*func.ValueFunction) + LockMutex(This\Mutex) + This\func = *func + UnlockMutex(This\Mutex) + EndMethod + + Method.d Output() + Protected Result.d + LockMutex(This\Mutex) + Result = This\S + UnlockMutex(This\Mutex) + MethodReturn Result + EndMethod + + Method Init(F.d, *f) + This\Freq = F + This\func = *f + This\Mutex = CreateMutex() + This\Time0 = ElapsedMilliseconds() + This\Thread = CreateThread(This\Sampler, This) + ThreadPriority(This\Thread, 10) + EndMethod + + Method Release() + This\Quit = #True + WaitThread(This\Thread) + EndMethod + EndPublic + +EndClass + +;- Procedures for generating values +Procedure.d n(f.d, t.d) + ; Returns nothing +EndProcedure + +Procedure.d f(f.d, t.d) + ; Returns the function of this task + ProcedureReturn Sin(2*#PI*f*t) +EndProcedure + +;- Test Code +*a.IntegralClass = NewObject.IntegralClass(0.5, @n()) ; Create the AO +*a\Input(@f()) ; Start sampling function f() +Delay(2000) ; Delay 2 sec +*a\Input(@n()) ; Change to sampling 'nothing' +Delay( 500) ; Wait 1/2 sec +MessageRequester("Info", StrD(*a\Output())) ; Present the result +*a= FreeObject diff --git a/Task/Active-object/Visual-Basic-.NET/active-object.visual b/Task/Active-object/Visual-Basic-.NET/active-object.visual new file mode 100644 index 0000000000..e93cc032ac --- /dev/null +++ b/Task/Active-object/Visual-Basic-.NET/active-object.visual @@ -0,0 +1,74 @@ +Module Module1 + + Sub Main() + Using active As New Integrator + active.Operation = Function(t As Double) Math.Sin(2 * Math.PI * 0.5 * t) + Threading.Thread.Sleep(TimeSpan.FromSeconds(2)) + Console.WriteLine(active.Value) + active.Operation = Function(t As Double) 0 + Threading.Thread.Sleep(TimeSpan.FromSeconds(0.5)) + Console.WriteLine(active.Value) + End Using + Console.ReadLine() + End Sub + +End Module + +Class Integrator + Implements IDisposable + + Private m_Operation As Func(Of Double, Double) + Private m_Disposed As Boolean + Private m_SyncRoot As New Object + Private m_Value As Double + + Public Sub New() + m_Operation = Function(void) 0.0 + Dim t As New Threading.Thread(AddressOf MainLoop) + t.Start() + End Sub + + Private Sub MainLoop() + Dim epoch = Now + Dim t0 = 0.0 + Do + SyncLock m_SyncRoot + Dim t1 = (Now - epoch).TotalSeconds + m_Value = m_Value + (Operation(t1) + Operation(t0)) * (t1 - t0) / 2 + t0 = t1 + End SyncLock + Threading.Thread.Sleep(10) + Loop Until m_Disposed + End Sub + + Public Property Operation() As Func(Of Double, Double) + Get + SyncLock m_SyncRoot + Return m_Operation + End SyncLock + End Get + Set(ByVal value As Func(Of Double, Double)) + SyncLock m_SyncRoot + m_Operation = value + End SyncLock + End Set + End Property + + Public ReadOnly Property Value() As Double + Get + SyncLock m_SyncRoot + Return m_Value + End SyncLock + End Get + End Property + + Protected Overridable Sub Dispose(ByVal disposing As Boolean) + m_Disposed = True + End Sub + + Public Sub Dispose() Implements IDisposable.Dispose + Dispose(True) + GC.SuppressFinalize(Me) + End Sub + +End Class diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/CoffeeScript/add-a-variable-to-a-class-instance-at-runtime.coffee b/Task/Add-a-variable-to-a-class-instance-at-runtime/CoffeeScript/add-a-variable-to-a-class-instance-at-runtime.coffeescript similarity index 100% rename from Task/Add-a-variable-to-a-class-instance-at-runtime/CoffeeScript/add-a-variable-to-a-class-instance-at-runtime.coffee rename to Task/Add-a-variable-to-a-class-instance-at-runtime/CoffeeScript/add-a-variable-to-a-class-instance-at-runtime.coffeescript diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/Mathematica/add-a-variable-to-a-class-instance-at-runtime.mathematica b/Task/Add-a-variable-to-a-class-instance-at-runtime/Mathematica/add-a-variable-to-a-class-instance-at-runtime.math similarity index 100% rename from Task/Add-a-variable-to-a-class-instance-at-runtime/Mathematica/add-a-variable-to-a-class-instance-at-runtime.mathematica rename to Task/Add-a-variable-to-a-class-instance-at-runtime/Mathematica/add-a-variable-to-a-class-instance-at-runtime.math diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/Objective-C/add-a-variable-to-a-class-instance-at-runtime-1.m b/Task/Add-a-variable-to-a-class-instance-at-runtime/Objective-C/add-a-variable-to-a-class-instance-at-runtime-1.m new file mode 100644 index 0000000000..60994f82fe --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/Objective-C/add-a-variable-to-a-class-instance-at-runtime-1.m @@ -0,0 +1,21 @@ +#import +#import + +char fooKey; + +int main (int argc, const char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + id e = [[NSObject alloc] init]; + + // set + objc_setAssociatedObject(e, &fooKey, [NSNumber numberWithInt:1], OBJC_ASSOCIATION_RETAIN); + + // get + NSNumber *associatedObject = objc_getAssociatedObject(e, &fooKey); + NSLog(@"associatedObject: %@", associatedObject); + + [e release]; + [pool drain]; + return 0; +} diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/Objective-C/add-a-variable-to-a-class-instance-at-runtime-2.m b/Task/Add-a-variable-to-a-class-instance-at-runtime/Objective-C/add-a-variable-to-a-class-instance-at-runtime-2.m new file mode 100644 index 0000000000..fee7b3789e --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/Objective-C/add-a-variable-to-a-class-instance-at-runtime-2.m @@ -0,0 +1,19 @@ +#import +#import + +int main (int argc, const char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + id e = [[NSObject alloc] init]; + + // set + objc_setAssociatedObject(e, @selector(foo), [NSNumber numberWithInt:1], OBJC_ASSOCIATION_RETAIN); + + // get + NSNumber *associatedObject = objc_getAssociatedObject(e, @selector(foo)); + NSLog(@"associatedObject: %@", associatedObject); + + [e release]; + [pool drain]; + return 0; +} diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/Octave/add-a-variable-to-a-class-instance-at-runtime.octave b/Task/Add-a-variable-to-a-class-instance-at-runtime/Octave/add-a-variable-to-a-class-instance-at-runtime.octave new file mode 100644 index 0000000000..a02a9c238c --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/Octave/add-a-variable-to-a-class-instance-at-runtime.octave @@ -0,0 +1,3 @@ +% Given struct "test" +test.b=1; +test = setfield (test, "c", 3); diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/OxygenBasic/add-a-variable-to-a-class-instance-at-runtime.oxy b/Task/Add-a-variable-to-a-class-instance-at-runtime/OxygenBasic/add-a-variable-to-a-class-instance-at-runtime.oxy new file mode 100644 index 0000000000..2debaf34f8 --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/OxygenBasic/add-a-variable-to-a-class-instance-at-runtime.oxy @@ -0,0 +1,70 @@ +'================= +class fleximembers +'================= + +indexbase 0 +bstring buf, *varl +sys dp,en + +method addVar(string name,dat) + sys le=len buf + if dp+16>le then + buf+=nuls 0x100 : le+=0x100 : + end if + @varl=?buf + varl[en]=name + varl[en+1]=dat + dp+=2*sizeof sys + en+=2 'next slot +end method + +method find(string name) as sys + sys i + for i=0 to (string name) + { + return variables[name]; + } + + void `->=(string name, mixed value) + { + variables[name] = value; + } + + array _indices() + { + return indices(variables); + } +} + +object csv = CSV(); +csv->greeting = "hello world"; +csv->count = 1; +csv->lang = "Pike"; + +indices(csv); +Result: ({ /* 3 elements */ + "lang", + "count", + "greeting" + }) diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/Pop11/add-a-variable-to-a-class-instance-at-runtime.pop11 b/Task/Add-a-variable-to-a-class-instance-at-runtime/Pop11/add-a-variable-to-a-class-instance-at-runtime.pop11 new file mode 100644 index 0000000000..b48c3a6a95 --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/Pop11/add-a-variable-to-a-class-instance-at-runtime.pop11 @@ -0,0 +1,28 @@ +lib objectclass; + +define :class foo; +enddefine; + +define define_named_method(method, class); + lvars method_str = method >< ''; + lvars class_str = class >< ''; + lvars method_hash_str = 'hash_' >< length(class_str) >< '_' + >< class_str >< '_' >< length(method_str) + >< '_' >< method_str; + lvars method_hash = consword(method_hash_str); + pop11_compile([ + lvars ^method_hash = newassoc([]); + define :method ^method(self : ^class); + ^method_hash(self); + enddefine; + define :method updaterof ^method(val, self : ^class); + val -> ^method_hash(self); + enddefine; + ]); +enddefine; + +define_named_method("met1", "foo"); +lvars bar = consfoo(); +met1(bar) => ;;; default value -- false +"baz" -> met1(bar); +met1(bar) => ;;; new value diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/PowerShell/add-a-variable-to-a-class-instance-at-runtime.psh b/Task/Add-a-variable-to-a-class-instance-at-runtime/PowerShell/add-a-variable-to-a-class-instance-at-runtime.psh new file mode 100644 index 0000000000..0e1f1589a8 --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/PowerShell/add-a-variable-to-a-class-instance-at-runtime.psh @@ -0,0 +1,5 @@ +$x = 42 ` + | Add-Member -PassThru ` + NoteProperty ` + Title ` + "The answer to the question about life, the universe and everything" diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/REBOL/add-a-variable-to-a-class-instance-at-runtime.rebol b/Task/Add-a-variable-to-a-class-instance-at-runtime/REBOL/add-a-variable-to-a-class-instance-at-runtime.rebol new file mode 100644 index 0000000000..af63b13b99 --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/REBOL/add-a-variable-to-a-class-instance-at-runtime.rebol @@ -0,0 +1,50 @@ +REBOL [ + Title: "Add Variables to Class at Runtime" + Author: oofoe + Date: 2009-12-04 + URL: http://rosettacode.org/wiki/Adding_variables_to_a_class_instance_at_runtime +] + +; As I understand it, a REBOL object can only ever have whatever +; properties it was born with. However, this is somewhat offset by the +; fact that every instance can serve as a prototype for a new object +; that also has the new parameter you want to add. + +; Here I create an empty instance of the base object (x), then add the +; new instance variable while creating a new object prototyped from +; x. I assign the new object to x, et voila', a dynamically added +; variable. + +x: make object! [] ; Empty object. + +x: make x [ + newvar: "forty-two" ; New property. +] + +print "Empty object modifed with 'newvar' property:" +probe x + +; A slightly more interesting example: + +starfighter: make object! [ + model: "unknown" + pilot: none +] +x-wing: make starfighter [ + model: "Incom T-65 X-wing" +] + +squadron: reduce [ + make x-wing [pilot: "Luke Skywalker"] + make x-wing [pilot: "Wedge Antilles"] + make starfighter [ + model: "Slayn & Korpil B-wing" + pilot: "General Salm" + ] +] + +; Adding new property here. +squadron/1: make squadron/1 [deathstar-removal-expert: yes] + +print [crlf "Fighter squadron:"] +foreach pilot squadron [probe pilot] diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/Slate/add-a-variable-to-a-class-instance-at-runtime.slate b/Task/Add-a-variable-to-a-class-instance-at-runtime/Slate/add-a-variable-to-a-class-instance-at-runtime.slate new file mode 100644 index 0000000000..9dcb0e1d44 --- /dev/null +++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/Slate/add-a-variable-to-a-class-instance-at-runtime.slate @@ -0,0 +1,3 @@ +define: #Empty -> Cloneable clone. +define: #e -> Empty clone. +e addSlotNamed: #foo valued: 1. diff --git a/Task/Address-of-a-variable/BASIC/address-of-a-variable.bas b/Task/Address-of-a-variable/BASIC/address-of-a-variable.basic similarity index 100% rename from Task/Address-of-a-variable/BASIC/address-of-a-variable.bas rename to Task/Address-of-a-variable/BASIC/address-of-a-variable.basic diff --git a/Task/Address-of-a-variable/NewLISP/address-of-a-variable.newlisp b/Task/Address-of-a-variable/NewLISP/address-of-a-variable.newlisp new file mode 100644 index 0000000000..f9b36acfbd --- /dev/null +++ b/Task/Address-of-a-variable/NewLISP/address-of-a-variable.newlisp @@ -0,0 +1,2 @@ +(set 'a '(1 2 3)) +(address a) diff --git a/Task/Address-of-a-variable/PARI-GP/address-of-a-variable.pari b/Task/Address-of-a-variable/PARI-GP/address-of-a-variable.pari new file mode 100644 index 0000000000..29050075d0 --- /dev/null +++ b/Task/Address-of-a-variable/PARI-GP/address-of-a-variable.pari @@ -0,0 +1 @@ +issquare(n, &m) diff --git a/Task/Address-of-a-variable/PL-I/address-of-a-variable.pli b/Task/Address-of-a-variable/PL-I/address-of-a-variable.pli new file mode 100644 index 0000000000..c346686e30 --- /dev/null +++ b/Task/Address-of-a-variable/PL-I/address-of-a-variable.pli @@ -0,0 +1,3 @@ +declare p pointer; +k = addr(b); /* Obtain address of variable, stored in integer variable k */ +p = addr(q); /* assigns address to pointer variable p. */ diff --git a/Task/Address-of-a-variable/Perl-6/address-of-a-variable.pl6 b/Task/Address-of-a-variable/Perl-6/address-of-a-variable.pl6 new file mode 100644 index 0000000000..31927677c1 --- /dev/null +++ b/Task/Address-of-a-variable/Perl-6/address-of-a-variable.pl6 @@ -0,0 +1 @@ +my $x; say $x.WHERE; diff --git a/Task/Address-of-a-variable/PowerBASIC/address-of-a-variable.powerbasic b/Task/Address-of-a-variable/PowerBASIC/address-of-a-variable.powerbasic new file mode 100644 index 0000000000..5a498c99a9 --- /dev/null +++ b/Task/Address-of-a-variable/PowerBASIC/address-of-a-variable.powerbasic @@ -0,0 +1,18 @@ +'get a variable's address: +DIM x AS INTEGER, y AS LONG +y = VARPTR(x) + +'can't set the address of a single variable, but can access memory locations +DIM z AS INTEGER +z = PEEK(INTEGER, y) + +'or can do it one byte at a time +DIM zz(1) AS BYTE +zz(0) = PEEK(BYTE, y) +zz(1) = PEEK(BYTE, y + 1) +'(MAK creates an INTEGER, LONG, or QUAD out of the next smaller type) +z = MAK(INTEGER, zz(0), zz(1)) + +'*can* set the address of an array +DIM zzz(1) AS BYTE AT y +'zzz(0) = low byte of x, zzz(1) = high byte of x diff --git a/Task/Address-of-a-variable/PureBasic/address-of-a-variable-1.purebasic b/Task/Address-of-a-variable/PureBasic/address-of-a-variable-1.purebasic new file mode 100644 index 0000000000..55ac2477b3 --- /dev/null +++ b/Task/Address-of-a-variable/PureBasic/address-of-a-variable-1.purebasic @@ -0,0 +1,2 @@ +a.i = 5 +MessageRequester("Address",Str(@a)) diff --git a/Task/Address-of-a-variable/PureBasic/address-of-a-variable-2.purebasic b/Task/Address-of-a-variable/PureBasic/address-of-a-variable-2.purebasic new file mode 100644 index 0000000000..2f327a8bd9 --- /dev/null +++ b/Task/Address-of-a-variable/PureBasic/address-of-a-variable-2.purebasic @@ -0,0 +1,7 @@ +a.i = 5 +*b.Integer = @a ;set *b equal to the address of variable a +*c.Integer = $A100 ;set *c to point at memory location $A100 (in hex) + + +MessageRequester("Address",Str(*b)) ;display the address being pointed at by *b +MessageRequester("Value",Str(*b\i)) ;de-reference the pointer *b to display the data being pointed at diff --git a/Task/Address-of-a-variable/Retro/address-of-a-variable-1.retro b/Task/Address-of-a-variable/Retro/address-of-a-variable-1.retro new file mode 100644 index 0000000000..bca5b9c95e --- /dev/null +++ b/Task/Address-of-a-variable/Retro/address-of-a-variable-1.retro @@ -0,0 +1,2 @@ +variable a +&a diff --git a/Task/Address-of-a-variable/Retro/address-of-a-variable-2.retro b/Task/Address-of-a-variable/Retro/address-of-a-variable-2.retro new file mode 100644 index 0000000000..6765643040 --- /dev/null +++ b/Task/Address-of-a-variable/Retro/address-of-a-variable-2.retro @@ -0,0 +1,2 @@ +variable b +100 @last !d->xt diff --git a/Task/Address-of-a-variable/Retro/address-of-a-variable-3.retro b/Task/Address-of-a-variable/Retro/address-of-a-variable-3.retro new file mode 100644 index 0000000000..d68d53b890 --- /dev/null +++ b/Task/Address-of-a-variable/Retro/address-of-a-variable-3.retro @@ -0,0 +1,2 @@ +needs bad' +^bad'pool @ diff --git a/Task/Address-of-a-variable/Retro/address-of-a-variable-4.retro b/Task/Address-of-a-variable/Retro/address-of-a-variable-4.retro new file mode 100644 index 0000000000..adfa652a62 --- /dev/null +++ b/Task/Address-of-a-variable/Retro/address-of-a-variable-4.retro @@ -0,0 +1 @@ +100 ^bad'pool ! diff --git a/Task/Address-of-a-variable/XPL0/address-of-a-variable.xpl0 b/Task/Address-of-a-variable/XPL0/address-of-a-variable.xpl0 new file mode 100644 index 0000000000..de4903c4f3 --- /dev/null +++ b/Task/Address-of-a-variable/XPL0/address-of-a-variable.xpl0 @@ -0,0 +1,7 @@ +include c:\cxpl\codes; +int A, B; +[B:= addr A; +HexOut(0, B); CrLf(0); +B(0):= $1234ABCD; +HexOut(0, A); CrLf(0); +] diff --git a/Task/Align-columns/CoffeeScript/align-columns-1.coffee b/Task/Align-columns/CoffeeScript/align-columns-1.coffeescript similarity index 100% rename from Task/Align-columns/CoffeeScript/align-columns-1.coffee rename to Task/Align-columns/CoffeeScript/align-columns-1.coffeescript diff --git a/Task/Align-columns/CoffeeScript/align-columns-2.coffee b/Task/Align-columns/CoffeeScript/align-columns-2.coffeescript similarity index 100% rename from Task/Align-columns/CoffeeScript/align-columns-2.coffee rename to Task/Align-columns/CoffeeScript/align-columns-2.coffeescript diff --git a/Task/Align-columns/Mathematica/align-columns.mathematica b/Task/Align-columns/Mathematica/align-columns.math similarity index 100% rename from Task/Align-columns/Mathematica/align-columns.mathematica rename to Task/Align-columns/Mathematica/align-columns.math diff --git a/Task/Align-columns/OCaml/align-columns.ocaml b/Task/Align-columns/OCaml/align-columns.ocaml new file mode 100644 index 0000000000..9a4e3d817e --- /dev/null +++ b/Task/Align-columns/OCaml/align-columns.ocaml @@ -0,0 +1,54 @@ +#load "str.cma" +open Str + +let input = "\ +Given$a$text$file$of$many$lines,$where$fields$within$a$line$ +are$delineated$by$a$single$'dollar'$character,$write$a$program +that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$ +column$are$separated$by$at$least$one$space. +Further,$allow$for$each$word$in$a$column$to$be$either$left$ +justified,$right$justified,$or$center$justified$within$its$column." + +let () = + let lines = split (regexp_string "\n") input in + let fields_l = List.map (split (regexp_string "$")) lines in + let fields_l = List.map Array.of_list fields_l in + let n = (* number of columns *) + List.fold_left + (fun n fields -> max n (Array.length fields)) + 0 fields_l + in + let pads = Array.make n 0 in + List.iter ( + (* calculate the max padding for each column *) + Array.iteri + (fun i word -> pads.(i) <- max pads.(i) (String.length word)) + ) fields_l; + + let print f = + List.iter (fun fields -> + Array.iteri (fun i word -> + f word (pads.(i) - (String.length word)) + ) fields; + print_newline() + ) fields_l; + in + + (* left column-aligned output *) + print (fun word pad -> + let spaces = String.make pad ' ' in + Printf.printf "%s%s " word spaces); + + (* right column-aligned output *) + print (fun word pad -> + let spaces = String.make pad ' ' in + Printf.printf "%s%s " spaces word); + + (* center column-aligned output *) + print (fun word pad -> + let pad1 = pad / 2 in + let pad2 = pad - pad1 in + let sp1 = String.make pad1 ' ' in + let sp2 = String.make pad2 ' ' in + Printf.printf "%s%s%s " sp1 word sp2); +;; diff --git a/Task/Align-columns/OpenEdge-Progress/align-columns.openedge b/Task/Align-columns/OpenEdge-Progress/align-columns.openedge new file mode 100644 index 0000000000..a82d99c060 --- /dev/null +++ b/Task/Align-columns/OpenEdge-Progress/align-columns.openedge @@ -0,0 +1,60 @@ +FUNCTION alignColumns RETURNS CHAR ( + i_c AS CHAR, + i_calign AS CHAR +): + + DEF VAR ipass AS INT. + DEF VAR iline AS INT. + DEF VAR icol AS INT. + DEF VAR iwidth AS INT EXTENT. + DEF VAR cword AS CHAR. + DEF VAR cspace AS CHAR. + DEF VAR cresult AS CHAR. + + EXTENT( iwidth ) = NUM-ENTRIES( ENTRY( 1, i_c, "~n" ), "$" ). + + DO ipass = 0 TO 1: + DO iline = 1 TO NUM-ENTRIES( i_c, "~n" ): + DO icol = 1 TO NUM-ENTRIES( ENTRY( iline, i_c, "~n" ), "$" ): + cword = ENTRY( icol, ENTRY( iline, i_c, "~n" ), "$" ). + IF ipass = 0 THEN + iwidth = MAXIMUM( LENGTH( cword ), iwidth[ icol ] ). + ELSE DO: + cspace = FILL( " ", iwidth[ icol ] - LENGTH( cword ) ). + CASE i_calign: + WHEN "left" THEN cresult = cresult + cword + cspace. + WHEN "right" THEN cresult = cresult + cspace + cword. + WHEN "center" THEN DO: + cword = FILL( " ", INTEGER( LENGTH( cspace ) / 2 ) ) + cword. + cresult = cresult + cword + FILL( " ", iwidth[icol] - LENGTH( cword ) ). + END. + END CASE. /* i_calign */ + cresult = cresult + " ". + END. + END. /* DO icol = 1 TO ... */ + IF ipass = 1 THEN + cresult = cresult + "~n". + END. /* DO iline = 1 TO ... */ + END. /* DO ipass = 0 TO 1 */ + + RETURN cresult. + +END FUNCTION. + +DEF VAR cc AS CHAR. + +cc = SUBSTITUTE( + "&1~n&2~n&3~n&4~n&5~n&6", + "Given$a$text$file$of$many$lines,$where$fields$within$a$line$", + "are$delineated$by$a$single$'dollar'$character,$write$a$program", + "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$", + "column$are$separated$by$at$least$one$space.", + "Further,$allow$for$each$word$in$a$column$to$be$either$left$", + "justified,$right$justified,$or$center$justified$within$its$column." + ). + +MESSAGE + alignColumns( cc, "left" ) SKIP + alignColumns( cc, "right" ) SKIP + alignColumns( cc, "center" ) +VIEW-AS ALERT-BOX. diff --git a/Task/Align-columns/Oz/align-columns.oz b/Task/Align-columns/Oz/align-columns.oz new file mode 100644 index 0000000000..943a40289f --- /dev/null +++ b/Task/Align-columns/Oz/align-columns.oz @@ -0,0 +1,75 @@ +declare + %% Lines: list of strings + %% Alignment: function like fun {Left Txt ExtraSpace} ... end + %% Returns: list of aligned (virtual) strings + fun {Align Lines Alignment} + ParsedLines = {Map Lines ParseLine} + NumColumns = {Maximum {Map ParsedLines Record.width}} + %% maps column index to column width: + WidthOfColumn = {Record.map {TupleRange NumColumns} + fun {$ ColumnIndex} + fun {LengthOfThisColumn ParsedLine} + {Length {CondSelect ParsedLine ColumnIndex nil}} + end + in + {Maximum {Map ParsedLines LengthOfThisColumn}} + end} + in + {Map ParsedLines + fun {$ Columns} + {Record.mapInd Columns + fun {$ ColumnIndex ColumnText} + Extra = WidthOfColumn.ColumnIndex - {Length ColumnText} + in + {Alignment ColumnText Extra}#" " + end} + end} + end + + %% A parsed line is a tuple of columns. + %% "a$b$c" -> '#'(1:"a" 2:"b" 3:"c") + fun {ParseLine Line} + {List.toTuple '#' {String.tokens Line &$}} + end + + %% possible alignments: + + fun {Left Txt Extra} + Txt#{Spaces Extra} + end + + fun {Right Txt Extra} + {Spaces Extra}#Txt + end + + fun {Center Txt Extra} + Half = Extra div 2 + in + {Spaces Half}#Txt#{Spaces Half + Extra mod 2} + end + + %% helpers: + + %% 3 -> unit(1 2 3) + fun {TupleRange Max} + {List.toTuple unit {List.number 1 Max 1}} + end + + fun {Maximum X|Xr} + {FoldL Xr Value.max X} + end + + fun {Spaces N} + case N of 0 then nil + else & |{Spaces N-1} + end + end + + Lines = ["Given$a$text$file$of$many$lines,$where$fields$within$a$line$" + "are$delineated$by$a$single$'dollar'$character,$write$a$program" + "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$" + "column$are$separated$by$at$least$one$space." + "Further,$allow$for$each$word$in$a$column$to$be$either$left$" + "justified,$right$justified,$or$center$justified$within$its$column."] +in + {ForAll {Align Lines Left} System.showInfo} diff --git a/Task/Align-columns/PL-I/align-columns.pli b/Task/Align-columns/PL-I/align-columns.pli new file mode 100644 index 0000000000..675d91a415 --- /dev/null +++ b/Task/Align-columns/PL-I/align-columns.pli @@ -0,0 +1,37 @@ +declare text character (300) varying; +declare word character (20) varying; +declare justification character (1); +declare k fixed binary; +declare input file, output file output; + +open file (input) title ( '/CENTER.DAT,type(text),recsize(1000)' ); +open file (output) title ( '/OUT.TXT,type(text),recsize(1000)' ); +on endfile (input) stop; + +display ('Specify whether justification is left, centered, or right'); +display ('Reply with a single letter: L, C, or R'); +get edit (justification) (A(1)); + +do forever; + get file (input) edit (text) (L); + put skip list (text); + text = trim(text, '$', '$'); + do until (k = 0); + k = index(text, '$'); + if k = 0 then /* last word in line */ + word = text; + else + do; + word = substr(text, 1, k-1); + text = substr(text, k); + text = trim(text, '$'); + end; + select (justification); + when ('C', 'c') word = center(word, maxlength(word)); + when ('R', 'r') word = right (word, maxlength(word)); + otherwise ; /* The default is left adjusted. */ + end; + put file (output) edit (word) (a(maxlength(word))); + end; + put file (output) skip; +end; diff --git a/Task/Align-columns/Perl-6/align-columns-1.pl6 b/Task/Align-columns/Perl-6/align-columns-1.pl6 new file mode 100644 index 0000000000..7dd3a61118 --- /dev/null +++ b/Task/Align-columns/Perl-6/align-columns-1.pl6 @@ -0,0 +1,38 @@ +###to be called with perl6 columnaligner.pl (left, center , right ) +###with left as default +my $fh = open "example.txt" , :r or die "Can't read text file!\n" ; +my @filelines = $fh.lines ; +close $fh ; +my @maxcolwidths ; #array of the longest words per column +#########fill the array with values##################### +for @filelines -> $line { + my @words = $line.split( "\$" ) ; + for 0..@words.elems - 1 -> $i { + if @maxcolwidths[ $i ] { + if @words[ $i ].chars > @maxcolwidths[$i] { + @maxcolwidths[ $i ] = @words[ $i ].chars ; + } + } + else { + @maxcolwidths.push( @words[ $i ].chars ) ; + } + } +} +my $justification = @*ARGS[ 0 ] || "left" ; +##print lines , $gap holds the number of spaces, 1 to be added +##to allow for space preceding or following longest word +for @filelines -> $line { + my @words = $line.split( "\$" ) ; + for 0 ..^ @words -> $i { + my $gap = @maxcolwidths[$i] - @words[$i].chars + 1 ; + if $justification eq "left" { + print @words[ $i ] ~ " " x $gap ; + } elsif $justification eq "right" { + print " " x $gap ~ @words[$i] ; + } elsif $justification eq "center" { + $gap = ( @maxcolwidths[ $i ] + 2 - @words[$i].chars ) div 2 ; + print " " x $gap ~ @words[$i] ~ " " x $gap ; + } + } + say ''; #for the newline +} diff --git a/Task/Align-columns/Perl-6/align-columns-2.pl6 b/Task/Align-columns/Perl-6/align-columns-2.pl6 new file mode 100644 index 0000000000..5604b2a43d --- /dev/null +++ b/Task/Align-columns/Perl-6/align-columns-2.pl6 @@ -0,0 +1,15 @@ +my @lines = slurp("example.txt").lines; +my @widths; + +for @lines { for .split('$').kv { @widths[$^key] max= $^word.chars; } } +for @lines { say .split('$').kv.map: { (align @widths[$^key], $^word) ~ " "; } } + +sub align($column_width, $word, $aligment = @*ARGS[0]) { + my $lr = $column_width - $word.chars; + my $c = $lr / 2; + given ($aligment) { + when "center" { " " x $c.ceiling ~ $word ~ " " x $c.floor } + when "right" { " " x $lr ~ $word } + default { $word ~ " " x $lr } + } +} diff --git a/Task/Align-columns/PureBasic/align-columns.purebasic b/Task/Align-columns/PureBasic/align-columns.purebasic new file mode 100644 index 0000000000..33c2b6ce62 --- /dev/null +++ b/Task/Align-columns/PureBasic/align-columns.purebasic @@ -0,0 +1,75 @@ +Declare max(a,b) + +If OpenConsole() + Define a, i, x, y, maxlen + Dim txt.s(0) + Restore lines ; Get address of the first data block + Read.i a + ReDim txt(a) + For i=0 To a ; Read the raw data lines + Read.s txt(i) + txt(i)=Trim(txt(i),"$") ; Remove any bad '$' that may be useless in the end... + x=max(CountString(txt(i),"$"),x) + Next + y=a + Dim matrix.s(x,y) ; Set up a nice matrix to work with, each word cleanly separated + For x=0 To ArraySize(matrix(),1) + For y=0 To ArraySize(matrix(),2) + matrix(x,y)=StringField(txt(y),x+1,"$") + maxlen=max(maxlen,Len(matrix(x,y))) + Next + Next + If maxlen%2 + maxlen+1 ; Just to make sure that 'centered' output looks nice.... + EndIf + + PrintN(#CRLF$+"---- Right ----") + For y=0 To ArraySize(matrix(),2) + For x=0 To ArraySize(matrix(),1) + Print(RSet(matrix(x,y),maxlen+1)) + Next + PrintN("") + Next + + PrintN(#CRLF$+"---- Left ----") + For y=0 To ArraySize(matrix(),2) + For x=0 To ArraySize(matrix(),1) + Print(LSet(matrix(x,y),maxlen+1)) + Next + PrintN("") + Next + + PrintN(#CRLF$+"---- Center ----") + For y=0 To ArraySize(matrix(),2) + For x=0 To ArraySize(matrix(),1) + a=maxlen-Len(matrix(x,y)) + Print(LSet(RSet(matrix(x,y),maxlen-a/2),maxlen)) + Next + PrintN("") + Next + + PrintN(#CRLF$+#CRLF$+"Press ENTER to quit."): Input() + CloseConsole() +EndIf + + +Procedure max(x,y) + If x>=y + ProcedureReturn x + Else + ProcedureReturn y + EndIf +EndProcedure + + +DataSection +lines: + Data.i 5 ; e.g. 6-1 since first line is equal to 'zero'. +text: + Data.s "Given$a$text$file$of$many$lines,$where$fields$within$a$line$" + Data.s "are$delineated$by$a$single$'dollar'$character,$write$a$program" + Data.s "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$" + Data.s "column$are$separated$by$at$least$one$space." + Data.s "Further,$allow$for$each$word$in$a$column$oo$be$either$left$" + Data.s "justified,$right$justified,$or$center$justified$within$its$column." +EndDataSection diff --git a/Task/Align-columns/REBOL/align-columns.rebol b/Task/Align-columns/REBOL/align-columns.rebol new file mode 100644 index 0000000000..66225e00ca --- /dev/null +++ b/Task/Align-columns/REBOL/align-columns.rebol @@ -0,0 +1,59 @@ +REBOL [ + Title: "Align Columns" + Author: oofoe + Date: 2010-09-29 + URL: http://rosettacode.org/wiki/Align_columns +] + +specimen: {Given$a$text$file$of$many$lines,$where$fields$within$a$line$ +are$delineated$by$a$single$'dollar'$character,$write$a$program +that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$ +column$are$separated$by$at$least$one$space. +Further,$allow$for$each$word$in$a$column$to$be$either$left$ +justified,$right$justified,$or$center$justified$within$its$column.} + +; Parse specimen into data grid. + +data: copy [] +foreach line parse specimen to-string lf [ ; Break into lines. + append/only data parse line "$" ; Break into columns. +] + +; Compute independent widths for each column. + +widths: copy [] insert/dup widths 0 length? data/1 +foreach line data [ + forall line [ + i: index? line + widths/:i: max widths/:i length? line/1 + ] +] + +pad: func [n /local x][x: copy "" insert/dup x " " n x] + +; These formatting functions are passed as arguments to entable. + +right: func [n s][rejoin [pad n - length? s s]] + +left: func [n s][rejoin [s pad n - length? s]] + +centre: func [n s /local h][ + h: round/down (n - length? s) / 2 + rejoin [pad h s pad n - h - length? s] +] + +; Display data as table. + +entable: func [data format] [ + foreach line data [ + forall line [ + prin rejoin [format pick widths index? line line/1 " "] + ] + print "" + ] +] + +; Format data table. + +foreach i [left centre right] [ + print ["^/Align" i "...^/"] entable data get i] diff --git a/Task/Align-columns/Run-BASIC/align-columns.run b/Task/Align-columns/Run-BASIC/align-columns.run new file mode 100644 index 0000000000..997721ef90 --- /dev/null +++ b/Task/Align-columns/Run-BASIC/align-columns.run @@ -0,0 +1,39 @@ +theString$ = "Given$a$text$file$of$many$lines,$where$fields$within$a$line$" _ ++ "are$delineated$by$a$single$'dollar'$character,$write$a$program" _ ++ "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$"_ ++ "column$are$separated$by$at$least$one$space." _ ++ "Further,$allow$for$each$word$in$a$column$to$be$either$left$" _ ++ "justified,$right$justified,$or$center$justified$within$its$column." + +x = shoTable(theString$,"left",6) +x = shoTable(theString$,"right",6) +x = shoTable(theString$,"center",6) +end + +FUNCTION shoTable(theString$,align$,across) +print "------------ align:";align$;" -- across:";across;" ------------" +dim siz(across) +b$ = " " +while word$(theString$,i+1,"$") <> "" + siz(i mod across) = max(siz(i mod across),len(word$(theString$,i + 1,"$"))) + i = i + 1 +wend +for i = 0 to across - 1 + siz(i) = siz(i) + 1 + if siz(i) and 1 then siz(i) = siz(i) + 1 +next i + +i = 0 +a$ = word$(theString$,i+1,"$") +while a$ <> "" + s = siz(i mod across) - len(a$) + if align$ = "right" then a$ = left$(b$,s);a$ + if align$ = "left" then a$ = a$;left$(b$,s) + if align$ = "center" then a$ = left$(b$,int(s / 2));a$;left$(b$,int(s / 2) + (s and 1)) + print "|";a$; + i = i + 1 + if i mod across = 0 then print "|" + a$ = word$(theString$,i+1,"$") +wend +print +end function diff --git a/Task/Align-columns/Seed7/align-columns.seed7 b/Task/Align-columns/Seed7/align-columns.seed7 new file mode 100644 index 0000000000..add6e9b8b9 --- /dev/null +++ b/Task/Align-columns/Seed7/align-columns.seed7 @@ -0,0 +1,52 @@ +$ include "seed7_05.s7i"; + +const array string: inputLines is [] ( + "Given$a$text$file$of$many$lines,$where$fields$within$a$line$", + "are$delineated$by$a$single$'dollar'$character,$write$a$program", + "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$", + "column$are$separated$by$at$least$one$space.", + "Further,$allow$for$each$word$in$a$column$to$be$either$left$", + "justified,$right$justified,$or$center$justified$within$its$column."); + +const func array integer: computeColumnWidths (in array string: inputLines) is func + result + var array integer: columnWidths is 0 times 0; + local + var string: line is ""; + var array string: lineFields is 0 times ""; + var integer: index is 0; + begin + for line range inputLines do + lineFields := split(line, "$"); + if length(lineFields) > length(columnWidths) then + columnWidths &:= (length(lineFields) - length(columnWidths)) times 0; + end if; + for index range 1 to length(lineFields) do + if length(lineFields[index]) > columnWidths[index] then + columnWidths[index] := length(lineFields[index]); + end if; + end for; + end for; + end func; + +const func string: center (in string: stri, in integer: length) is + return ("" lpad (length - length(stri)) div 2 <& stri) rpad length; + +const proc: main is func + local + var array integer: columnWidths is 0 times 0; + var string: line is ""; + var array string: lineFields is 0 times ""; + var integer: index is 0; + begin + columnWidths := computeColumnWidths(inputLines); + for line range inputLines do + lineFields := split(line, "$"); + for index range 1 to length(lineFields) do + # write(lineFields[index] rpad columnWidths[index] <& " "); # Left justify + # write(lineFields[index] lpad columnWidths[index] <& " "); # Right justify + write(center(lineFields[index], columnWidths[index]) <& " "); + end for; + writeln; + end for; + end func; diff --git a/Task/Align-columns/Shiny/align-columns.shiny b/Task/Align-columns/Shiny/align-columns.shiny new file mode 100644 index 0000000000..162d301fbe --- /dev/null +++ b/Task/Align-columns/Shiny/align-columns.shiny @@ -0,0 +1,39 @@ +text: 'Given$a$text$file$of$many$lines,$where$fields$within$a$line$ +are$delineated$by$a$single$\'dollar\'$character,$write$a$program +that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$ +column$are$separated$by$at$least$one$space. +Further,$allow$for$each$word$in$a$column$to$be$either$left$ +justified,$right$justified,$or$center$justified$within$its$column.' + +align: action text; position; + + # split text into 2D array of lines and words + lines : { for text.split ~\$?\r?\n~ { for a.split '$' a end } end } + + # calculate max required width for each column + widths: { for lines for a here[b]: a.length.max here[b]? ends } + + spaces: action out ("%%%ds" in).format '' end + + # formatting functions + left: action word; width; + pad: width-word.length + print "%s%s " word spaces pad + end + right: action word; width; + pad: width-word.length + print "%s%s " spaces pad word + end + center: action word; width; + pad: (width-word.length)/2 + print "%s%s%s " spaces pad.floor word spaces pad.ceil + end + + if position.match ~^(left|center|right)$~ for lines + for a local[position] a widths[b] end say '' + ends say '' +end + +align text 'left' +align text 'center' +align text 'right' diff --git a/Task/Align-columns/TUSCRIPT/align-columns.tuscript b/Task/Align-columns/TUSCRIPT/align-columns.tuscript new file mode 100644 index 0000000000..b22236f941 --- /dev/null +++ b/Task/Align-columns/TUSCRIPT/align-columns.tuscript @@ -0,0 +1,22 @@ +$$ MODE TUSCRIPT +MODE DATA +$$ SET exampletext=* +Given$a$text$file$of$many$lines,$where$fields$within$a$line$ +are$delineated$by$a$single$'dollar'$character,$write$a$program +that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$ +column$are$separated$by$at$least$one$space. +Further,$allow$for$each$word$in$a$column$to$be$either$left$ +justified,$right$justified,$or$center$justified$within$its$column. +$$ MODE TUSCRIPT +SET nix=SPLIT (exampletext,":$:",c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12) +LOOP l1=1,12 +SET colum=CONCAT ("c",l1) +SET newcolum=CONCAT ("new",l1) +SET @newcolum="", length=MAX LENGTH (@colum), space=length+2 + LOOP n,l2=@colum + SET newcell=CENTER (l2,space) + SET @newcolum=APPEND (@newcolum,"~",newcell) + ENDLOOP + SET @newcolum=SPLIT (@newcolum,":~:") +ENDLOOP +SET exampletext=JOIN(new1,"$",new2,new3,new4,new5,new6,new7,new8,new9,new10,new11,new12) diff --git a/Task/Align-columns/TXR/align-columns.txr b/Task/Align-columns/TXR/align-columns.txr new file mode 100644 index 0000000000..d6b5d0e906 --- /dev/null +++ b/Task/Align-columns/TXR/align-columns.txr @@ -0,0 +1,30 @@ +@(collect) +@ (coll)@{item /[^$]+/}@(end) +@(end) +@; nc = number of columns +@; pi = padded items (data with row lengths equalized with empty strings) +@; cw = vector of max column widths +@; ce = center padding +@(bind nc @(apply (fun max) (mapcar (fun length) item))) +@(bind pi @(mapcar (lambda (row) + (append row (repeat '("") (- nc (length row))))) + item)) +@(bind cw @(vector-list + (mapcar (lambda (column) + (apply (fun max) (mapcar (fun length) column))) + ;; matrix transpose trick cols become rows: + (apply (fun mapcar) (cons (fun list) pi))))) +@(bind ns "") +@(output) +@ (repeat) +@ (rep :counter i)@{pi @[cw i]} @(end) +@ (end) +@ (repeat) +@ (rep :counter i)@{pi @(- [cw i])} @(end) +@ (end) +@ (repeat) +@ (rep :counter i)@\ + @{ns @(trunc (- [cw i] (length pi)) 2)}@\ + @{pi @(- [cw i] (trunc (- [cw i] (length pi)) 2))} @(end) +@ (end) +@(end) diff --git a/Task/Align-columns/UNIX-Shell/align-columns-1.sh b/Task/Align-columns/UNIX-Shell/align-columns-1.sh new file mode 100644 index 0000000000..465658bd66 --- /dev/null +++ b/Task/Align-columns/UNIX-Shell/align-columns-1.sh @@ -0,0 +1,37 @@ +cat < just-nocenter.sh +#!/bin/sh + +td() { +cat <<'EOF' +Given$a$text$file$of$many$lines,$where$fields$within$a$line$ +are$delineated$by$a$single$'dollar'$character,$write$a$program +that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$ +column$are$separated$by$at$least$one$space. +Further,$allow$for$each$word$in$a$column$to$be$either$left$ +justified,$right$justified,$or$center$justified$within$its$column. +EOF +} + +rows=$( td | wc -l ) + +# get the number of fields +fields=$(td | rs -c'$' -g1 -h | awk '{print $2}') + +# get the max of the value widths +cwidth=$(td | rs -c'$' -g1 -w1 2>/dev/null | awk 'BEGIN{w=0}{if(length>w){w=length}}END{print w}') + +# compute the minimum line width for the columns +lwidth=$(( (1 + cwidth) * fields )) + +# left adjusted columns +td | rs -c'$' -g1 -zn -w$lwidth + +echo "" + +# right adjusted columns +td | rs -c'$' -g1 -znj -w$lwidth + +echo "" + +exit +EOF_OUTER diff --git a/Task/Align-columns/UNIX-Shell/align-columns-2.sh b/Task/Align-columns/UNIX-Shell/align-columns-2.sh new file mode 100644 index 0000000000..beb3f1ce26 --- /dev/null +++ b/Task/Align-columns/UNIX-Shell/align-columns-2.sh @@ -0,0 +1,14 @@ +$ ./just-nocenter.sh +Given a text file of many lines, where fields within a line +are delineated by a single 'dollar' character, write a program +that aligns each column of fields by ensuring that words in each +column are separated by at least one space. +Further, allow for each word in a column to be either left +justified, right justified, or center justified within its column. + + Given a text file of many lines, where fields within a line + are delineated by a single 'dollar' character, write a program + that aligns each column of fields by ensuring that words in each + column are separated by at least one space. + Further, allow for each word in a column to be either left +justified, right justified, or center justified within its column. diff --git a/Task/Align-columns/Ursala/align-columns.ursala b/Task/Align-columns/Ursala/align-columns.ursala new file mode 100644 index 0000000000..5e0c60c5c5 --- /dev/null +++ b/Task/Align-columns/Ursala/align-columns.ursala @@ -0,0 +1,20 @@ +#import std + +text = + +-[Given$a$text$file$of$many$lines,$where$fields$within$a$line$ +are$delineated$by$a$single$'dollar'$character,$write$a$program +that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$ +column$are$separated$by$at$least$one$space. +Further,$allow$for$each$word$in$a$column$to$be$either$left$ +justified,$right$justified,$or$center$justified$within$its$column.]- + +pad = sep`$*; @FS ~&rSSSK7+ (zipp` ^*D\~& leql$^)*rSSK7+ zipp0^*D/leql$^ ~& + +just_left = mat` *+ pad +just_right = mat` *+ pad; ==` ~-rlT** +just_center = mat` *+ pad; ==` ~-rK30PlrK31PTT** + +#show+ + +main = mat0 <.just_left,just_center,just_right> text diff --git a/Task/Align-columns/VBA/align-columns.vba b/Task/Align-columns/VBA/align-columns.vba new file mode 100644 index 0000000000..6eec9a34d2 --- /dev/null +++ b/Task/Align-columns/VBA/align-columns.vba @@ -0,0 +1,65 @@ +Public Sub TestSplit(Optional align As String = "left", Optional spacing As Integer = 1) + Dim word() As String + Dim colwidth() As Integer + Dim ncols As Integer + Dim lines(6) As String + Dim nlines As Integer + + 'check arguments + If Not (align = "left" Or align = "right" Or align = "center") Then + MsgBox "TestSplit: wrong argument 'align': " & align + Exit Sub + End If + If spacing < 0 Then + MsgBox "TestSplit: wrong argument: 'spacing' cannot be negative." + Exit Sub + End If + + ' Sample Input (should be from a file) + nlines = 6 + lines(1) = "Given$a$text$file$of$many$lines,$where$fields$within$a$line$" + lines(2) = "are$delineated$by$a$single$'dollar'$character,$write$a$program" + lines(3) = "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$" + lines(4) = "column$are$separated$by$at$least$one$space." + lines(5) = "Further,$allow$for$each$word$in$a$column$to$be$either$left$" + lines(6) = "justified,$right$justified,$or$center$justified$within$its$column." + + 'first pass: count columns and column widths + 'the words are not kept in memory + ncols = -1 + For l = 1 To nlines + word = Split(RTrim(lines(l)), "$") + If UBound(word) > ncols Then + ncols = UBound(word) + ReDim Preserve colwidth(ncols) + End If + For i = 0 To UBound(word) + If Len(word(i)) > colwidth(i) Then colwidth(i) = Len(word(i)) + Next i + Next l + + 'discard possibly empty columns at the right + '(this assumes there is at least one non-empty column) + While colwidth(ncols) = 0 + ncols = ncols - 1 + Wend + + 'second pass: print in columns + For l = 1 To nlines + word = Split(RTrim(lines(l)), "$") + For i = 0 To UBound(word) + a = word(i) + w = colwidth(i) + If align = "left" Then + Debug.Print a + String$(w - Len(a), " "); + ElseIf align = "right" Then + Debug.Print String$(w - Len(a), " ") + a; + ElseIf align = "center" Then + d = Int((w - Len(a)) / 2) + Debug.Print String$(d, " ") + a + String$(w - (d + Len(a)), " "); + End If + If i < ncols Then Debug.Print Spc(spacing); + Next i + Debug.Print + Next l +End Sub diff --git a/Task/Align-columns/Vedit-macro-language/align-columns.vedit b/Task/Align-columns/Vedit-macro-language/align-columns.vedit new file mode 100644 index 0000000000..a3014c9fc5 --- /dev/null +++ b/Task/Align-columns/Vedit-macro-language/align-columns.vedit @@ -0,0 +1,40 @@ +RS(10, "$") // Field separator +#11 = 1 // Align: 1 = left, 2 = center, 3 = right + +// Reset column widths. Max 50 columns +for (#1=40; #1<90; #1++) { #@1 = 0 } + +// Find max width of each column +BOF +Repeat(ALL) { + for (#1=40; #1<90; #1++) { + Match(@10, ADVANCE) // skip field separator if any + #2 = Cur_Pos + Search("|{|@(10),|N}", NOERR) // field separator or end of line + #3 = Cur_Pos - #2 // width of text + if (#3 > #@1) { #@1 = #3 } + if (At_EOL) { Break } + } + Line(1, ERRBREAK) +} + +// Convert lines +BOF +Repeat(ALL) { + for (#1=40; #1<90; #1++) { + #2 = Cur_Pos + Search("|{|@(10),|N}", NOERR) + if (At_EOL==0) { Del_Char(Chars_Matched) } + #3 = #@1 - Cur_Pos + #2 // number of spaces to insert + #4 = 0 + if (#11 == 2) { #4 = #3/2; #3 -= #4 } // Center + if (#11 == 3) { #4 = #3; #3 = 0 } // Right justify + Set_Marker(1, Cur_Pos) + Goto_Pos(#2) + Ins_Char(' ', COUNT, #4) // add spaces before the word + Goto_Pos(Marker(1)) + Ins_Char(' ', COUNT, #3+1) // add spaces after the word + if (At_EOL) { Break } + } + Line(1, ERRBREAK) +} diff --git a/Task/Anagrams-Deranged-anagrams/CoffeeScript/anagrams-deranged-anagrams.coffee b/Task/Anagrams-Deranged-anagrams/CoffeeScript/anagrams-deranged-anagrams.coffeescript similarity index 100% rename from Task/Anagrams-Deranged-anagrams/CoffeeScript/anagrams-deranged-anagrams.coffee rename to Task/Anagrams-Deranged-anagrams/CoffeeScript/anagrams-deranged-anagrams.coffeescript diff --git a/Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams.mathematica b/Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams.math similarity index 100% rename from Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams.mathematica rename to Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams.math diff --git a/Task/Anagrams-Deranged-anagrams/OCaml/anagrams-deranged-anagrams.ocaml b/Task/Anagrams-Deranged-anagrams/OCaml/anagrams-deranged-anagrams.ocaml new file mode 100644 index 0000000000..92781c35ac --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/OCaml/anagrams-deranged-anagrams.ocaml @@ -0,0 +1,65 @@ +let sort_chars s = + let r = String.copy s in + for i = 0 to (String.length r) - 2 do + for j = i + 1 to (String.length r) - 1 do + if r.[i] > r.[j] then begin + let tmp = r.[i] in + r.[i] <- r.[j]; + r.[j] <- tmp; + end + done + done; + (r) + +let deranged (s1, s2) = + let len1 = String.length s1 + and len2 = String.length s2 in + if len1 <> len2 then false else + try + for i = 0 to pred len1 do + if s1.[i] = s2.[i] then raise Exit + done; + true + with Exit -> false + +let pairs_of_list lst = + let rec aux acc = function + | [] -> acc + | x::xs -> + aux (List.fold_left (fun acc y -> (x,y)::acc) acc xs) xs + in + aux [] lst + +let () = + let h = Hashtbl.create 3571 in + let ic = open_in "unixdict.txt" in + try while true do + let word = input_line ic in + let key = sort_chars word in + let l = + try Hashtbl.find h key + with Not_found -> [] + in + Hashtbl.add h key (word::l); + done with End_of_file -> + close_in ic; + let lst = + Hashtbl.fold (fun _ lw acc -> + if List.length lw < 2 then acc else lw::acc) h [] + in + let lst = + List.fold_left (fun acc anagrams -> + let pairs = pairs_of_list anagrams in + (List.filter deranged pairs) @ acc + ) [] lst + in + let res, _ = + List.fold_left (fun (res, n) (w1, w2) -> + let len = String.length w1 in + match Pervasives.compare len n with + | 0 -> ((w1, w2)::res, n) + | 1 -> ([w1, w2], len) + | _ -> (res, n) + ) ([], 0) lst + in + List.iter (fun (w1, w2) -> Printf.printf "%s, %s\n" w1 w2) res diff --git a/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams-1.pl6 b/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams-1.pl6 new file mode 100644 index 0000000000..461126470c --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams-1.pl6 @@ -0,0 +1 @@ +grep '^[ie]' unixdict.txt > dict.ie diff --git a/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams-2.pl6 b/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams-2.pl6 new file mode 100644 index 0000000000..73ae78c462 --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams-2.pl6 @@ -0,0 +1,12 @@ +my %anagram = slurp('dict.ie').words.map({[.comb]}).classify({ .sort.join }); + +for %anagram.values.sort({ -@($_[0]) }) -> @aset { + for 0 ..^ @aset.end -> $i { + for $i ^.. @aset.end -> $j { + if none( @aset[$i].list Zeq @aset[$j].list ) { + say "{@aset[$i].join} {@aset[$j].join}"; + exit; + } + } + } +} diff --git a/Task/Anagrams-Deranged-anagrams/PureBasic/anagrams-deranged-anagrams.purebasic b/Task/Anagrams-Deranged-anagrams/PureBasic/anagrams-deranged-anagrams.purebasic new file mode 100644 index 0000000000..7d1b14b93a --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/PureBasic/anagrams-deranged-anagrams.purebasic @@ -0,0 +1,135 @@ +Structure anagram + word.s + letters.s +EndStructure + +Structure wordList + List words.anagram() +EndStructure + +#True = 1 +#False = 0 + +Procedure.s sortLetters(*word.Character, wordLength) + ;returns a string with the letters of a word sorted + Protected Dim letters.c(wordLength) + Protected *letAdr = @letters() + CopyMemoryString(*word, @*letAdr) + SortArray(letters(), #PB_Sort_Ascending, 0, wordLength - 1) + ProcedureReturn PeekS(@letters(), wordLength) +EndProcedure + +;Compare a list of anagrams for derangement. +Procedure isDeranged(List anagram.s()) + ;If a pair of deranged anagrams is found return #True + ;and and modify the list to include the pair of deranged anagrams. + Protected i, length, word.s, *ptrAnagram, isDeranged + Protected NewList deranged.s() + FirstElement(anagram()) + length = Len(anagram()) + Repeat + word = anagram() + *ptrAnagram = @anagram() + + While NextElement(anagram()) + isDeranged = #True + For i = 1 To length + If Mid(word, i, 1) = Mid(anagram(), i, 1) + isDeranged = #False + Break ;exit for/next + EndIf + Next + + If isDeranged + AddElement(deranged()) + deranged() = anagram() + AddElement(deranged()) + deranged() = word + CopyList(deranged(), anagram()) + ProcedureReturn #True ;deranged anagram found + EndIf + Wend + ChangeCurrentElement(anagram(), *ptrAnagram) + Until Not NextElement(anagram()) + + ProcedureReturn #False ;deranged anagram not found +EndProcedure + +If OpenConsole() + ;word file is assumed to be in the same directory + If Not ReadFile(0,"unixdict.txt"): End: EndIf + + Define maxWordSize = 0, word.s, length + Dim wordlists.wordList(maxWordSize) + + ;Read word file and create separate lists of anagrams and their original + ;words by length. + While Not Eof(0) + word = ReadString(0) + length = Len(word) + If length > maxWordSize + maxWordSize = length + Redim wordlists.wordList(maxWordSize) + EndIf + AddElement(wordlists(length)\words()) + wordlists(length)\words()\word = word + wordlists(length)\words()\letters = sortLetters(@word, length) + Wend + CloseFile(0) + + Define offset = OffsetOf(anagram\letters), option = #PB_Sort_Ascending + Define sortType = #PB_Sort_String + Define letters.s, foundDeranged + NewList anagram.s() + ;start search from largest to smallest + For length = maxWordSize To 2 Step -1 + + If FirstElement(wordlists(length)\words()) ;only examine lists with words + ;sort words to place anagrams next to each other + SortStructuredList(wordlists(length)\words(), option, offset, sortType) + + With wordlists(length)\words() + letters = \letters + AddElement(anagram()): anagram() = \word + + ;Compose sets of anagrams and check for derangement with remaining + ;words in current list. + While NextElement(wordlists(length)\words()) + ;Check for end of a set of anagrams? + If letters <> \letters + + ;if more than one word in a set of anagrams check for derangement + If ListSize(anagram()) > 1 + If isDeranged(anagram()) + foundDeranged = #True ;found deranged anagrams, stop processing + Break 2 ;exit while/wend and for/next + EndIf + EndIf + + letters = \letters ;setup for next set of anagrams + ClearList(anagram()) + EndIf + + AddElement(anagram()): anagram() = \word + Wend + EndWith + + EndIf + + ClearList(anagram()) + Next + + ;report results + If foundDeranged + Print("Largest 'Deranged' anagrams found are of length ") + PrintN(Str(length) + ":" + #CRLF$) + ForEach anagram() + PrintN(" " + anagram()) + Next + Else + PrintN("No 'Deranged' anagrams were found." + #CRLF$) + EndIf + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Anagrams-Deranged-anagrams/Run-BASIC/anagrams-deranged-anagrams.run b/Task/Anagrams-Deranged-anagrams/Run-BASIC/anagrams-deranged-anagrams.run new file mode 100644 index 0000000000..a7ea34789e --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/Run-BASIC/anagrams-deranged-anagrams.run @@ -0,0 +1,47 @@ +a$ = httpGet$("http://www.puzzlers.org/pub/wordlists/unixdict.txt") +dim theWord$(30000) +dim ssWord$(30000) + +c10$ = chr$(10) +i = 1 +while instr(a$,c10$,i) <> 0 + j = instr(a$,c10$,i) + ln = j - i + again = 1 + sWord$ = mid$(a$,i,j-i) + n = n + 1 + theWord$(n) = sWord$ + + while again = 1 + again = 0 + for kk = 1 to len(sWord$) - 1 + if mid$(sWord$,kk,1) > mid$(sWord$,kk +1,1) then + sWord$ = left$(sWord$,kk-1);mid$(sWord$,kk+1,1);mid$(sWord$,kk,1);mid$(sWord$,kk+2) + again = 1 + end if + next kk + wend + ssWord$(n) = sWord$ + i = j + 1 +wend + +for i = 1 to n + if len(theWord$(i)) > maxLen then + for j = 1 to n + if ssWord$(i) = ssWord$(j) and i <> j then + cnt = 0 + for k = 1 to len(theWord$(i)) + if mid$(theWord$(i),k,1) = mid$(theWord$(j),k,1) then cnt = cnt + 1 + next k + if cnt = 0 then + maxLen = len(theWord$(i)) + maxPtrI = i + maxPtrJ = j + end if + end if + next j + end if +next i + +print maxLen;" ";theWord$(maxPtrI);" => ";theWord$(maxPtrJ) +end diff --git a/Task/Anagrams-Deranged-anagrams/TUSCRIPT/anagrams-deranged-anagrams.tuscript b/Task/Anagrams-Deranged-anagrams/TUSCRIPT/anagrams-deranged-anagrams.tuscript new file mode 100644 index 0000000000..fcfcdfdd38 --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/TUSCRIPT/anagrams-deranged-anagrams.tuscript @@ -0,0 +1,45 @@ +$$ MODE TUSCRIPT,{} +requestdata = REQUEST ("http://www.puzzlers.org/pub/wordlists/unixdict.txt") + +DICT anagramm CREATE 99999 + +COMPILE + LOOP word=requestdata + -> ? : any character + charsInWord=STRINGS (word," ? ") + charString =ALPHA_SORT (charsInWord) + + DICT anagramm LOOKUP charString,num,freq,wordalt,wlalt + IF (num==0) THEN + WL=SIZE (charString) + DICT anagramm APPEND/QUIET/COUNT charString,num,freq,word,wl;" " + ELSE + DICT anagramm APPEND/QUIET/COUNT charString,num,freq,word,"";" " + ENDIF + ENDLOOP + +DICT anagramm UNLOAD charString,all,freq,anagrams,wl + +index =DIGIT_INDEX (wl) +reverseIndex =REVERSE (index) +wl =INDEX_SORT (wl,reverseIndex) +freq =INDEX_SORT (freq,reverseIndex) +anagrams =INDEX_SORT (anagrams,reverseIndex) +charString =INDEX_SORT (charString,reverseIndex) + +LOOP fr=freq,a=anagrams,w=wl + IF (fr==1) cycle + asplit=SPLIT (a,": :") + a1=SELECT (asplit,1,arest) + a1split=STRINGS (a1," ? ") + LOOP r=arest + rsplit=STRINGS (r," ? ") + LOOP v1=a1split,v2=rsplit + IF (v1==v2) EXIT,EXIT + ENDLOOP + PRINT "Largest deranged anagram (length: ",w,"):" + PRINT a + STOP + ENDLOOP +ENDLOOP +ENDCOMPILE diff --git a/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-1.ursala b/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-1.ursala new file mode 100644 index 0000000000..1f91abcf0d --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-1.ursala @@ -0,0 +1,9 @@ +#import std + +anagrams = |=tK33lrDSL2SL ~=&& ==+ ~~ -<& + +deranged = filter not zip; any == + +#cast %sW + +main = leql$^&l deranged anagrams unixdict_dot_txt diff --git a/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-2.ursala b/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-2.ursala new file mode 100644 index 0000000000..382d1283a5 --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-2.ursala @@ -0,0 +1 @@ +anagrams = @NSiXSlK2rSS *= ^(-<&,~&)*; |=rSStFtK33lrDSL2SL ~=@br&& ==@bl diff --git a/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-3.ursala b/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-3.ursala new file mode 100644 index 0000000000..d5a6cf06f1 --- /dev/null +++ b/Task/Anagrams-Deranged-anagrams/Ursala/anagrams-deranged-anagrams-3.ursala @@ -0,0 +1,11 @@ +#import std + +longest_deranged_anagram = + +@NSiXSlK2rSS leql-l ^\~&rt @rh -+ + ~&a^& ~&plrEkZ?ah/~&ah ~&fatPR, + ^(-<&,~&)*; |=rSStFtK33lrDSL2SL ~=@br&& ==@bl+- + +#cast %sW + +main = longest_deranged_anagram unixdict_dot_txt diff --git a/Task/Anagrams/CoffeeScript/anagrams-1.coffee b/Task/Anagrams/CoffeeScript/anagrams-1.coffeescript similarity index 100% rename from Task/Anagrams/CoffeeScript/anagrams-1.coffee rename to Task/Anagrams/CoffeeScript/anagrams-1.coffeescript diff --git a/Task/Anagrams/CoffeeScript/anagrams-2.coffee b/Task/Anagrams/CoffeeScript/anagrams-2.coffeescript similarity index 100% rename from Task/Anagrams/CoffeeScript/anagrams-2.coffee rename to Task/Anagrams/CoffeeScript/anagrams-2.coffeescript diff --git a/Task/Anagrams/Mathematica/anagrams-1.mathematica b/Task/Anagrams/Mathematica/anagrams-1.math similarity index 100% rename from Task/Anagrams/Mathematica/anagrams-1.mathematica rename to Task/Anagrams/Mathematica/anagrams-1.math diff --git a/Task/Anagrams/Mathematica/anagrams-2.mathematica b/Task/Anagrams/Mathematica/anagrams-2.math similarity index 100% rename from Task/Anagrams/Mathematica/anagrams-2.mathematica rename to Task/Anagrams/Mathematica/anagrams-2.math diff --git a/Task/Anagrams/Mathematica/anagrams-3.mathematica b/Task/Anagrams/Mathematica/anagrams-3.math similarity index 100% rename from Task/Anagrams/Mathematica/anagrams-3.mathematica rename to Task/Anagrams/Mathematica/anagrams-3.math diff --git a/Task/Anagrams/Mathematica/anagrams-4.mathematica b/Task/Anagrams/Mathematica/anagrams-4.math similarity index 100% rename from Task/Anagrams/Mathematica/anagrams-4.mathematica rename to Task/Anagrams/Mathematica/anagrams-4.math diff --git a/Task/Anagrams/OCaml/anagrams.ocaml b/Task/Anagrams/OCaml/anagrams.ocaml new file mode 100644 index 0000000000..8275d822b2 --- /dev/null +++ b/Task/Anagrams/OCaml/anagrams.ocaml @@ -0,0 +1,34 @@ +let explode str = + let l = ref [] in + let len = String.length str in + for i = len - 1 downto 0 do + l := str.[i] :: !l + done; + (!l) + +let implode li = + let len = List.length li in + let s = String.create len in + let i = ref 0 in + List.iter (fun c -> s.[!i] <- c; incr i) li; + (s) + +let () = + let h = Hashtbl.create 3571 in + let ic = open_in "unixdict.txt" in + try while true do + let w = input_line ic in + let k = implode(List.sort compare (explode w)) in + let l = + try Hashtbl.find h k + with Not_found -> [] + in + Hashtbl.add h k (w::l); + done with End_of_file -> (); + let n = Hashtbl.fold (fun _ lw n -> max n (List.length lw)) h 0 in + Hashtbl.iter (fun _ lw -> + if List.length lw >= n then + ( List.iter (Printf.printf " %s") lw; + print_newline()) + ) h; +;; diff --git a/Task/Anagrams/Oberon-2/anagrams.oberon-2 b/Task/Anagrams/Oberon-2/anagrams.oberon-2 new file mode 100644 index 0000000000..e0b678b664 --- /dev/null +++ b/Task/Anagrams/Oberon-2/anagrams.oberon-2 @@ -0,0 +1,156 @@ +MODULE Anagrams; +IMPORT Files,Out,In,Strings; +CONST + MAXPOOLSZ = 1024; + +TYPE + String = ARRAY 80 OF CHAR; + + Node = POINTER TO NodeDesc; + NodeDesc = RECORD; + count: INTEGER; + word: String; + desc: Node; + next: Node; + END; + + Pool = POINTER TO PoolDesc; + PoolDesc = RECORD + capacity,max: INTEGER; + words: POINTER TO ARRAY OF Node; + END; + + PROCEDURE InitNode(n: Node); + BEGIN + n^.count := 0; + n^.word := ""; + n^.desc := NIL; + n^.next := NIL; + END InitNode; + + PROCEDURE Index(s: ARRAY OF CHAR;cap: INTEGER): INTEGER; + VAR + i,sum: INTEGER; + BEGIN + sum := 0; + FOR i := 0 TO Strings.Length(s) DO + INC(sum,ORD(s[i])) + END; + RETURN sum MOD cap + END Index; + + PROCEDURE ISort(VAR s: ARRAY OF CHAR); + VAR + i, j: INTEGER; + t: CHAR; + BEGIN + FOR i := 0 TO Strings.Length(s) - 1 DO + j := i; + t := s[j]; + WHILE (j > 0) & (s[j -1] > t) DO + s[j] := s[j - 1]; + DEC(j) + END; + s[j] := t + END + END ISort; + + PROCEDURE SameLetters(x,y: ARRAY OF CHAR): BOOLEAN; + BEGIN + ISort(x);ISort(y); + RETURN (Strings.Compare(x,y) = 0) + END SameLetters; + + PROCEDURE InitPool(p:Pool); + BEGIN + InitPoolWith(p,MAXPOOLSZ); + END InitPool; + + PROCEDURE InitPoolWith(p:Pool;cap: INTEGER); + VAR + i: INTEGER; + BEGIN + p^.capacity := cap; + p^.max := 0; + NEW(p^.words,cap); + i := 0; + WHILE i < p^.capacity DO + p^.words^[i] := NIL; + INC(i); + END; + END InitPoolWith; + + PROCEDURE (p: Pool) Add(w: ARRAY OF CHAR); + VAR + idx: INTEGER; + iter,n: Node; + BEGIN + idx := Index(w,p^.capacity); + iter := p^.words^[idx]; + NEW(n);InitNode(n);COPY(w,n^.word); + WHILE(iter # NIL) DO + IF SameLetters(w,iter^.word) THEN + INC(iter^.count); + IF iter^.count > p^.max THEN p^.max := iter^.count END; + n^.desc := iter^.desc; + iter^.desc := n; + RETURN + END; + iter := iter^.next + END; + ASSERT(iter = NIL); + n^.next := p^.words^[idx];p^.words^[idx] := n + END Add; + + PROCEDURE ShowAnagrams(l: Node); + VAR + iter: Node; + BEGIN + iter := l; + WHILE iter # NIL DO + Out.String(iter^.word);Out.String(" "); + iter := iter^.desc + END; + Out.Ln + END ShowAnagrams; + + PROCEDURE (p: Pool) ShowMax(); + VAR + i: INTEGER; + iter: Node; + BEGIN + FOR i := 0 TO LEN(p^.words^) - 1 DO + IF p^.words^[i] # NIL THEN + iter := p^.words^[i]; + WHILE iter # NIL DO + IF iter^.count = p^.max THEN + ShowAnagrams(iter); + END; + iter := iter^.next + END + END + END + END ShowMax; + + PROCEDURE DoProcess(fnm: ARRAY OF CHAR); + VAR + stdinBck,istream: Files.File; + line: String; + p: Pool; + BEGIN + istream := Files.Open(fnm,"r"); + stdinBck := Files.stdin; + Files.stdin := istream; + NEW(p);InitPool(p); + WHILE In.Done DO + In.Line(line); + p.Add(line); + END; + Files.stdin := stdinBck; + Files.Close(istream); + p^.ShowMax(); + END DoProcess; + +BEGIN + DoProcess("unixdict.txt"); +END Anagrams. diff --git a/Task/Anagrams/Oz/anagrams.oz b/Task/Anagrams/Oz/anagrams.oz new file mode 100644 index 0000000000..d8f23ff0e2 --- /dev/null +++ b/Task/Anagrams/Oz/anagrams.oz @@ -0,0 +1,29 @@ +declare + %% Helper function + fun {ReadLines Filename} + File = {New class $ from Open.file Open.text end init(name:Filename)} + in + for collect:C break:B do + case {File getS($)} of false then {File close} {B} + [] Line then {C Line} + end + end + end + + %% Groups anagrams by using a mutable dictionary + %% with sorted words as keys + WordDict = {Dictionary.new} + for Word in {ReadLines "unixdict.txt"} do + Keyword = {String.toAtom {Sort Word Value.'<'}} + in + WordDict.Keyword := Word|{CondSelect WordDict Keyword nil} + end + Sets = {Dictionary.items WordDict} + + %% Filter such that only the largest sets remain + MaxSetSize = {FoldL {Map Sets Length} Max 0} + LargestSets = {Filter Sets fun {$ S} {Length S} == MaxSetSize end} +in + %% Display result (make sure strings are shown as string, not as number lists) + {Inspector.object configureEntry(widgetShowStrings true)} + {Inspect LargestSets} diff --git a/Task/Anagrams/PL-I/anagrams.pli b/Task/Anagrams/PL-I/anagrams.pli new file mode 100644 index 0000000000..38a5bcc076 --- /dev/null +++ b/Task/Anagrams/PL-I/anagrams.pli @@ -0,0 +1,67 @@ +/* Search a list of words, finding those having the same letters. */ + +word_test: proc options (main); + declare words (50000) character (20) varying, + frequency (50000) fixed binary; + declare word character (20) varying; + declare (i, k, wp, most) fixed binary (31); + + on endfile (sysin) go to done; + + words = ''; frequency = 0; + wp = 0; + do forever; + get edit (word) (L); + call search_word_list (word); + end; + +done: + put skip list ('There are ' || wp || ' words'); + most = 0; + /* Determine the word(s) having the greatest number of anagrams. */ + do i = 1 to wp; + if most < frequency(i) then most = frequency(i); + end; + put skip edit ('The following word(s) have ', trim(most), ' anagrams:') (a); + put skip; + do i = 1 to wp; + if most = frequency(i) then put edit (words(i)) (x(1), a); + end; + +search_word_list: procedure (word) options (reorder); + declare word character (*) varying; + declare i fixed binary (31); + + do i = 1 to wp; + if length(words(i)) = length(word) then + if is_anagram(word, words(i)) then + do; + frequency(i) = frequency(i) + 1; + return; + end; + end; + /* The word does not exist in the list, so add it. */ + if wp >= hbound(words,1) then return; + wp = wp + 1; + words(wp) = word; + frequency(wp) = 1; + return; +end search_word_list; + +/* Returns true if the words are anagrams, otherwise returns false. */ +is_anagram: procedure (word1, word2) returns (bit(1)) options (reorder); + declare (word1, word2) character (*) varying; + declare tword character (20) varying, c character (1); + declare (i, j) fixed binary; + + tword = word2; + do i = 1 to length(word1); + c = substr(word1, i, 1); + j = index(tword, c); + if j = 0 then return ('0'b); + substr(tword, j, 1) = ' '; + end; + return ('1'b); +end is_anagram; + +end word_test; diff --git a/Task/Anagrams/Pascal/anagrams.pascal b/Task/Anagrams/Pascal/anagrams.pascal new file mode 100644 index 0000000000..21c8cf9d94 --- /dev/null +++ b/Task/Anagrams/Pascal/anagrams.pascal @@ -0,0 +1,88 @@ +Program Anagrams; + +// assumes a local file + +uses + classes, math; + +var + i, j, k, maxCount: integer; + sortedString: string; + WordList: TStringList; + SortedWordList: TStringList; + AnagramList: array of TStringlist; + +begin + WordList := TStringList.Create; + WordList.LoadFromFile('unixdict.txt'); + for i := 0 to WordList.Count - 1 do + begin + setLength(sortedString,Length(WordList.Strings[i])); + sortedString[1] := WordList.Strings[i][1]; + + // sorted assign + j := 2; + while j <= Length(WordList.Strings[i]) do + begin + k := j - 1; + while (WordList.Strings[i][j] < sortedString[k]) and (k > 0) do + begin + sortedString[k+1] := sortedString[k]; + k := k - 1; + end; + sortedString[k+1] := WordList.Strings[i][j]; + j := j + 1; + end; + + // create the stringlists of the sorted letters and + // the list of the original words + if not assigned(SortedWordList) then + begin + SortedWordList := TStringList.Create; + SortedWordList.append(sortedString); + setlength(AnagramList,1); + AnagramList[0] := TStringList.Create; + AnagramList[0].append(WordList.Strings[i]); + end + else + begin + j := 0; + while sortedString <> SortedWordList.Strings[j] do + begin + inc(j); + if j = (SortedWordList.Count) then + begin + SortedWordList.append(sortedString); + setlength(AnagramList,length(AnagramList) + 1); + AnagramList[j] := TStringList.Create; + break; + end; + end; + AnagramList[j].append(WordList.Strings[i]); + end; + end; + + maxCount := 1; + for i := 0 to length(AnagramList) - 1 do + maxCount := max(maxCount, AnagramList[i].Count); + + // create output + writeln('The largest sets of words have ', maxCount, ' members:'); + for i := 0 to length(AnagramList) - 1 do + begin + if AnagramList[i].Count = maxCount then + begin + write('"', SortedWordList.strings[i], '": '); + for j := 0 to AnagramList[i].Count - 2 do + write(AnagramList[i].strings[j], ', '); + writeln(AnagramList[i].strings[AnagramList[i].Count - 1]); + end; + end; + + // Cleanup + WordList.Destroy; + SortedWordList.Destroy; + for i := 0 to length(AnagramList) - 1 do + AnagramList[i].Destroy; + +end. diff --git a/Task/Anagrams/Perl-6/anagrams-1.pl6 b/Task/Anagrams/Perl-6/anagrams-1.pl6 new file mode 100644 index 0000000000..a28f27a597 --- /dev/null +++ b/Task/Anagrams/Perl-6/anagrams-1.pl6 @@ -0,0 +1,5 @@ +my %anagram = slurp('unixdict.txt').words.classify( { .comb.sort.join } ); + +my $max = [max] map { +@($_) }, %anagram.values; + +%anagram.values.grep( { +@($_) >= $max } )».join(' ')».say; diff --git a/Task/Anagrams/Perl-6/anagrams-2.pl6 b/Task/Anagrams/Perl-6/anagrams-2.pl6 new file mode 100644 index 0000000000..cb8217b77b --- /dev/null +++ b/Task/Anagrams/Perl-6/anagrams-2.pl6 @@ -0,0 +1,9 @@ +slurp('unixdict.txt')\ +.words\ +.classify( *.comb.sort.join )\ +.classify( +*.value )\ +.sort( -*.key )[0]\ +.value\ +.values\ +».value\ +».say diff --git a/Task/Anagrams/PowerShell/anagrams.psh b/Task/Anagrams/PowerShell/anagrams.psh new file mode 100644 index 0000000000..ecfca585de --- /dev/null +++ b/Task/Anagrams/PowerShell/anagrams.psh @@ -0,0 +1,13 @@ +$c = New-Object Net.WebClient +$words = -split ($c.DownloadString('http://www.puzzlers.org/pub/wordlists/unixdict.txt')) +$top_anagrams = $words ` + | ForEach-Object { + $_ | Add-Member -PassThru NoteProperty Characters ` + (-join (([char[]] $_) | Sort-Object)) + } ` + | Group-Object Characters ` + | Group-Object Count ` + | Sort-Object Count ` + | Select-Object -First 1 + +$top_anagrams.Group | ForEach-Object { $_.Group -join ', ' } diff --git a/Task/Anagrams/PureBasic/anagrams.purebasic b/Task/Anagrams/PureBasic/anagrams.purebasic new file mode 100644 index 0000000000..f54fa5f679 --- /dev/null +++ b/Task/Anagrams/PureBasic/anagrams.purebasic @@ -0,0 +1,61 @@ +InitNetwork() ; +OpenConsole() + +Procedure.s sortWord(word$) + len.i = Len(word$) + Dim CharArray.s (len) + + For n = 1 To len ; Transfering each single character + CharArray(n) = Mid(word$, n, 1) ; of the word into an array. + Next + + SortArray(CharArray(),#PB_Sort_NoCase ) ; Sorting the array. + + word$ ="" + For n = 1 To len ; Writing back each single + word$ + CharArray(n) ; character of the array. + Next + + ProcedureReturn word$ +EndProcedure + + +tmpdir$ = GetTemporaryDirectory() +filename$ = tmpdir$ + "unixdict.txt" +Structure ana + isana.l + anas.s +EndStructure + +NewMap anaMap.ana() + +If ReceiveHTTPFile("http://www.puzzlers.org/pub/wordlists/unixdict.txt", filename$) + If ReadFile(1, filename$) + Repeat + word$ = (ReadString(1)) ; Reading a word from a file. + key$ = (sortWord(word$)) ; Sorting the word and storing in key$. + + If FindMapElement(anaMap(), key$) ; Looking up if a word already had the same key$. + + ; if yes + anaMap()\anas = anaMap()\anas+ ", " + word$ ; adding the word + anaMap()\isana + 1 + Else + ; if no + anaMap(key$)\anas = word$ ; applying a new record + anaMap()\isana + 1 + EndIf + Until Eof(1) + CloseFile(1) + DeleteFile(filename$) + + ;----- output ----- + ForEach anaMap() + If anaMap()\isana >= 4 ; only emit what had 4 or more hits. + PrintN(anaMap()\anas) + EndIf + Next + + PrintN("Press any key"): Repeat: Until Inkey() <> "" + EndIf +EndIf diff --git a/Task/Anagrams/Rascal/anagrams-1.rascal b/Task/Anagrams/Rascal/anagrams-1.rascal new file mode 100644 index 0000000000..f35ca15b24 --- /dev/null +++ b/Task/Anagrams/Rascal/anagrams-1.rascal @@ -0,0 +1,11 @@ +import Prelude; + +list[str] OrderedRep(str word){ + return sort([word[i] | i <- [0..size(word)-1]]); +} +public list[set[str]] anagram(){ + allwords = readFileLines(|http://www.puzzlers.org/pub/wordlists/unixdict.txt|); + AnagramMap = invert((word : OrderedRep(word) | word <- allwords)); + longest = max([size(group) | group <- range(AnagramMap)]); + return [AnagramMap[rep]| rep <- AnagramMap, size(AnagramMap[rep]) == longest]; +} diff --git a/Task/Anagrams/Rascal/anagrams-2.rascal b/Task/Anagrams/Rascal/anagrams-2.rascal new file mode 100644 index 0000000000..16e7936f52 --- /dev/null +++ b/Task/Anagrams/Rascal/anagrams-2.rascal @@ -0,0 +1,8 @@ +value: [ + {"glean","galen","lange","angle","angel"}, + {"glare","lager","regal","large","alger"}, + {"carte","trace","crate","caret","cater"}, + {"lane","lena","lean","elan","neal"}, + {"able","bale","abel","bela","elba"}, + {"levi","live","vile","evil","veil"} +] diff --git a/Task/Anagrams/Revolution/anagrams.rev b/Task/Anagrams/Revolution/anagrams.rev new file mode 100644 index 0000000000..21e3f0e6d9 --- /dev/null +++ b/Task/Anagrams/Revolution/anagrams.rev @@ -0,0 +1,34 @@ +on mouseUp + repeat for each word W in url "http://www.puzzlers.org/pub/wordlists/unixdict.txt" + put W & comma after A[sortChars(W)] + end repeat + put 0 into winningLength + repeat for each element E in A + get the number of items in E + if it < winningLength then next repeat + if it > winningLength then + put it into winningLength + put empty into winningList + end if + put (char 1 to -2 of E) & cr after winningList + end repeat + put winningList +end mouseUp + +function sortChars X + get charsToItems(X) + sort items of it + return itemsToChars(it) +end sortChars + +function charsToItems X + repeat for each char C in X + put C & comma after R + end repeat + return char 1 to -2 of R +end charsToItems + +function itemsToChars X + replace comma with empty in X + return X +end itemsToChars diff --git a/Task/Anagrams/Run-BASIC/anagrams.run b/Task/Anagrams/Run-BASIC/anagrams.run new file mode 100644 index 0000000000..ce5e72ff58 --- /dev/null +++ b/Task/Anagrams/Run-BASIC/anagrams.run @@ -0,0 +1,67 @@ +a$ = httpGet$("http://www.puzzlers.org/pub/wordlists/unixdict.txt") ' get the words from this web + +sqliteconnect #mem, ":memory:" ' create in memory DB +#mem execute("CREATE TABLE words(theWord,sortWord)") + +ii = 1 +while ii + jj = instr(a$,chr$(10),ii + 1) + if jj > 0 then + theWord$ = mid$(a$,ii, jj - ii) ' get each word + + if instr(theWord$,"'") <> 0 then theWord$ = dblQuote$(theWord$) ' eclipse the single quote + sortWord$ = theWord$ + ' ------------------------------------ + ' Sort word using the ol bubble sort + ' ------------------------------------ + j = 1 + while j + j = 0 + for i = 1 to len(sortWord$) - 1 + if mid$(sortWord$,i,1) > mid$(sortWord$,i + 1,1) then + sortWord$ = left$(sortWord$,i - 1) + mid$(sortWord$,i + 1,1) + mid$(sortWord$,i,1) + mid$(sortWord$,i + 2) + j = 1 + end if + next i + wend + ' ---------------------------- + ' place in memory sql table + ' ---------------------------- + #mem execute("INSERT INTO words VALUES('";theWord$;"','";sortWord$;"')") + end if + ii = jj + 1 +wend + +' ----------------------------------------------------------- +' Select matched words in word order and print in html table +' ----------------------------------------------------------- +html "" +mem$ = "SELECT words.theWord, +matchWords.theWord as mWord +FROM words +JOIN words as matchWords +ON matchWords.sortWord = words.sortWord +AND matchWOrds.theWord <> words.theWord +ORDER BY words.theWord" +#mem execute(mem$) +WHILE #mem hasanswer() + #row = #mem #nextrow() + theWord$ = #row theWord$() + mWord$ = #row mWord$() + html "" +WEND +html "
";theWord$;"";mWord$;"
" +end + +' ----------------------------------------- +' Convert single quotes to double quotes +' ----------------------------------------- +FUNCTION dblQuote$(str$) +i = 1 +qq$ = "" +while (word$(str$,i,"'")) <> "" + dblQuote$ = dblQuote$;qq$;word$(str$,i,"'") + qq$ = "''" + i = i + 1 +WEND +END FUNCTION diff --git a/Task/Anagrams/SETL/anagrams.setl b/Task/Anagrams/SETL/anagrams.setl new file mode 100644 index 0000000000..56f36de697 --- /dev/null +++ b/Task/Anagrams/SETL/anagrams.setl @@ -0,0 +1,40 @@ +h := open('unixdict.txt', "r"); +anagrams := {}; +while not eof(h) loop + geta(h, word); + if word = om or word = "" then + continue; + end if; + sorted := insertion_sort(word); + anagrams{sorted} with:= word; +end loop; + +max_size := 0; +max_words := {}; +for words = anagrams{sorted} loop + size := #words; + if size > max_size then + max_size := size; + max_words := {words}; + elseif size = max_size then + max_words with:= words; + end if; +end loop; + +for w in max_words loop + print(w); +end loop; + +-- GNU SETL has no built-in sort() +procedure insertion_sort(A); + for i in [2..#A] loop + v := A(i); + j := i-1; + while j >= 1 and A(j) > v loop + A(j+1) := A(j); + j := j - 1; + end loop; + A(j+1) := v; + end loop; + return A; +end procedure; diff --git a/Task/Anagrams/SNOBOL4/anagrams.sno b/Task/Anagrams/SNOBOL4/anagrams.sno new file mode 100644 index 0000000000..83142ae790 --- /dev/null +++ b/Task/Anagrams/SNOBOL4/anagrams.sno @@ -0,0 +1,23 @@ +* # Sort letters of word + define('sortw(str)a,i,j') :(sortw_end) +sortw a = array(size(str)) +sw1 i = i + 1; str len(1) . a = :s(sw1) + a = sort(a) +sw2 j = j + 1; sortw = sortw a :s(sw2)f(return) +sortw_end + +* # Count words in string + define('countw(str)') :(countw_end) +countw str break(' ') span(' ') = :f(return) + countw = countw + 1 :(countw) +countw_end + + ana = table() +L1 wrd = input :f(L2) ;* unixdict.txt from stdin + sw = sortw(wrd); ana = ana wrd ' ' + cw = countw(ana); max = gt(cw,max) cw + i = i + 1; terminal = eq(remdr(i,1000),0) wrd :(L1) +L2 kv = convert(ana,'array') +L3 j = j + 1; key = kv; val = kv :f(end) + output = eq(countw(val),max) key ': ' val :(L3) +end diff --git a/Task/Anagrams/TUSCRIPT/anagrams.tuscript b/Task/Anagrams/TUSCRIPT/anagrams.tuscript new file mode 100644 index 0000000000..37eeb987ec --- /dev/null +++ b/Task/Anagrams/TUSCRIPT/anagrams.tuscript @@ -0,0 +1,28 @@ +$$ MODE TUSCRIPT,{} +requestdata = REQUEST ("http://www.puzzlers.org/pub/wordlists/unixdict.txt") + +DICT anagramm CREATE 99999 + +COMPILE + LOOP word=requestdata + -> ? : any character + charsInWord=STRINGS (word," ? ") + charString =ALPHA_SORT (charsInWord) + DICT anagramm APPEND/QUIET/COUNT charString,num,freq,word;" " + ENDLOOP + +DICT anagramm UNLOAD charString,all,freq,anagrams + +index =DIGIT_INDEX (freq) +reverseIndex =REVERSE (index) +freq =INDEX_SORT (freq,reverseIndex) +anagrams =INDEX_SORT (anagrams,reverseIndex) +charString =INDEX_SORT (charString,reverseIndex) + +mostWords=SELECT (freq,1), adjust=MAX_LENGTH (charString) + LOOP cs=charString, f=freq, a=anagrams + IF (f #2) { // new larger size of group + Reg_Set(12, @11) // replace word list + #2 = #1 + } + Reg_Copy_Block(10, BOL_Pos, CP+1) + Reg_Copy_Block(11, CP, EOL_Pos) // first word of new group + #1 = 1 + } +} + +Buf_Quit(OK) // close word list file +Buf_Switch(Buf_Free) // output results in a new edit buffer +Reg_Ins(12) // display all groups of longest anagram words +Return + +//////////////////////////////////////////////////////////////////// +// +// Sort characters in current line using Insertion sort +// +:SORT_LETTERS: +GP(EOL_pos) #9 = Cur_Col-1 +for (#1 = 2; #1 <= #9; #1++) { + Goto_Col(#1) #8 = Cur_Char + #2 = #1 + while (#2 > 1) { + #7 = Cur_Char(-1) + if (#7 <= #8) { break } + Ins_Char(#7, OVERWRITE) + #2-- + Goto_Col(#2) + } + Ins_Char(#8, OVERWRITE) +} +return diff --git a/Task/Anagrams/Visual-Basic-.NET/anagrams.visual b/Task/Anagrams/Visual-Basic-.NET/anagrams.visual new file mode 100644 index 0000000000..e19870a060 --- /dev/null +++ b/Task/Anagrams/Visual-Basic-.NET/anagrams.visual @@ -0,0 +1,64 @@ +Imports System.IO +Imports System.Collections.ObjectModel + +Module Module1 + + Dim sWords As New Dictionary(Of String, Collection(Of String)) + + Sub Main() + + Dim oStream As StreamReader = Nothing + Dim sLines() As String = Nothing + Dim sSorted As String = Nothing + Dim iHighCount As Integer = 0 + Dim iMaxKeyLength As Integer = 0 + Dim sOutput As String = "" + + oStream = New StreamReader("unixdict.txt") + sLines = oStream.ReadToEnd.Split(New String() {vbCrLf}, StringSplitOptions.RemoveEmptyEntries) + oStream.Close() + + For i As Integer = 0 To sLines.GetUpperBound(0) + sSorted = SortCharacters(sLines(i)) + + If Not sWords.ContainsKey(sSorted) Then sWords.Add(sSorted, New Collection(Of String)) + + sWords(sSorted).Add(sLines(i)) + + If sWords(sSorted).Count > iHighCount Then + iHighCount = sWords(sSorted).Count + + If sSorted.Length > iMaxKeyLength Then iMaxKeyLength = sSorted.Length + End If + Next + + For Each sKey As String In sWords.Keys + If sWords(sKey).Count = iHighCount Then + sOutput &= "[" & sKey.ToUpper & "]" & Space(iMaxKeyLength - sKey.Length + 1) & String.Join(", ", sWords(sKey).ToArray()) & vbCrLf + End If + Next + + Console.WriteLine(sOutput) + Console.ReadKey() + + End Sub + + Private Function SortCharacters(ByVal s As String) As String + + Dim sReturn() As Char = s.ToCharArray() + Dim sTemp As Char = Nothing + + For i As Integer = 0 To sReturn.GetUpperBound(0) - 1 + If (sReturn(i + 1)) < (sReturn(i)) Then + sTemp = sReturn(i) + sReturn(i) = sReturn(i + 1) + sReturn(i + 1) = sTemp + i = -1 + End If + Next + + Return CStr(sReturn) + + End Function + +End Module diff --git a/Task/Animate-a-pendulum/Mathematica/animate-a-pendulum.mathematica b/Task/Animate-a-pendulum/Mathematica/animate-a-pendulum.math similarity index 100% rename from Task/Animate-a-pendulum/Mathematica/animate-a-pendulum.mathematica rename to Task/Animate-a-pendulum/Mathematica/animate-a-pendulum.math diff --git a/Task/Animate-a-pendulum/Oz/animate-a-pendulum.oz b/Task/Animate-a-pendulum/Oz/animate-a-pendulum.oz new file mode 100644 index 0000000000..30573d5953 --- /dev/null +++ b/Task/Animate-a-pendulum/Oz/animate-a-pendulum.oz @@ -0,0 +1,81 @@ +declare + [QTk] = {Link ['x-oz://system/wp/QTk.ozf']} + + Pi = 3.14159265 + + class PendulumModel + feat + K + attr + angle + velocity + + meth init(length:L <= 1.0 %% meters + gravity:G <= 9.81 %% m/s² + initialAngle:A <= Pi/2.) %% radians + self.K = ~G / L + angle := A + velocity := 0.0 + end + + meth nextAngle(deltaT:DeltaTMS %% milliseconds + ?Angle) %% radians + DeltaT = {Int.toFloat DeltaTMS} / 1000.0 %% seconds + Acceleration = self.K * {Sin @angle} + in + velocity := @velocity + Acceleration * DeltaT + angle := @angle + @velocity * DeltaT + Angle = @angle + end + end + + %% Animates a pendulum on a given canvas. + class PendulumAnimation from Time.repeat + feat + Pend + Rod + Bob + home:pos(x:160 y:50) + length:140.0 + delay + + meth init(Pendulum Canvas delay:Delay <= 25) %% milliseconds + self.Pend = Pendulum + self.delay = Delay + %% plate and pivot + {Canvas create(line 0 self.home.y 320 self.home.y width:2 fill:grey50)} + {Canvas create(oval 155 self.home.y-5 165 self.home.y+5 fill:grey50 outline:black)} + %% the pendulum itself + self.Rod = {Canvas create(line 1 1 1 1 width:3 fill:black handle:$)} + self.Bob = {Canvas create(oval 1 1 2 2 fill:yellow outline:black handle:$)} + %% + {self setRepAll(action:Animate delay:Delay)} + end + + meth Animate + Theta = {self.Pend nextAngle(deltaT:self.delay $)} + %% calculate x and y from angle + X = self.home.x + {Float.toInt self.length * {Sin Theta}} + Y = self.home.y + {Float.toInt self.length * {Cos Theta}} + in + %% update canvas + try + {self.Rod setCoords(self.home.x self.home.y X Y)} + {self.Bob setCoords(X-15 Y-15 X+15 Y+15)} + catch system(tk(alreadyClosed ...) ...) then skip end + end + end + + Pendulum = {New PendulumModel init} + + Canvas + GUI = td(title:"Pendulum" + canvas(width:320 height:210 handle:?Canvas) + action:proc {$} {Animation stop} {Window close} end + ) + Window = {QTk.build GUI} + + Animation = {New PendulumAnimation init(Pendulum Canvas)} +in + {Window show} + {Animation go} diff --git a/Task/Animate-a-pendulum/PureBasic/animate-a-pendulum.purebasic b/Task/Animate-a-pendulum/PureBasic/animate-a-pendulum.purebasic new file mode 100644 index 0000000000..694d725cf8 --- /dev/null +++ b/Task/Animate-a-pendulum/PureBasic/animate-a-pendulum.purebasic @@ -0,0 +1,107 @@ +Procedure handleError(x, msg.s) + If Not x + MessageRequester("Error", msg) + End + EndIf +EndProcedure + +#ScreenW = 320 +#ScreenH = 210 +handleError(OpenWindow(0, 0, 0, #ScreenW, #ScreenH, "Animated Pendulum", #PB_Window_SystemMenu), "Can't open window.") +handleError(InitSprite(), "Can't setup sprite display.") +handleError(OpenWindowedScreen(WindowID(0), 0, 0, #ScreenW, #ScreenH, 0, 0, 0), "Can't open screen.") + +Enumeration ;sprites + #bob_spr + #ceiling_spr + #pivot_spr +EndEnumeration + +TransparentSpriteColor(#PB_Default, RGB(255, 0, 255)) +CreateSprite(#bob_spr, 32, 32) +StartDrawing(SpriteOutput(#bob_spr)) + Box(0, 0, 32, 32, RGB(255, 0, 255)) + Circle(16, 16, 15, RGB(253, 252, 3)) + DrawingMode(#PB_2DDrawing_Outlined) + Circle(16, 16, 15, RGB(0, 0, 0)) +StopDrawing() + +CreateSprite(#pivot_spr, 10, 10) +StartDrawing(SpriteOutput(#pivot_spr)) + Box(0, 0, 10, 10, RGB(255, 0, 255)) + Circle(5, 5, 4, RGB(125, 125, 125)) + DrawingMode(#PB_2DDrawing_Outlined) + Circle(5, 5, 4, RGB(0,0 , 0)) +StopDrawing() + +CreateSprite(#ceiling_spr,#ScreenW,2) +StartDrawing(SpriteOutput(#ceiling_spr)) + Box(0,0,SpriteWidth(#ceiling_spr), SpriteHeight(#ceiling_spr), RGB(126, 126, 126)) +StopDrawing() + +Structure pendulum + length.d ; meters + constant.d ; -g/l + gravity.d ; m/s² + angle.d ; radians + velocity.d ; m/s +EndStructure + +Procedure initPendulum(*pendulum.pendulum, length.d = 1.0, gravity.d = 9.81, initialAngle.d = #PI / 2) + With *pendulum + \length = length + \gravity = gravity + \angle = initialAngle + \constant = -gravity / length + \velocity = 0.0 + EndWith +EndProcedure + + +Procedure updatePendulum(*pendulum.pendulum, deltaTime.d) + deltaTime = deltaTime / 1000.0 ;ms + Protected acceleration.d = *pendulum\constant * Sin(*pendulum\angle) + *pendulum\velocity + acceleration * deltaTime + *pendulum\angle + *pendulum\velocity * deltaTime +EndProcedure + +Procedure drawBackground() + ClearScreen(RGB(190,190,190)) + ;draw ceiling + DisplaySprite(#ceiling_spr, 0, 47) + ;draw pivot + DisplayTransparentSprite(#pivot_spr, 154,43) ;origin in upper-left +EndProcedure + +Procedure drawPendulum(*pendulum.pendulum) + ;draw rod + Protected x = *pendulum\length * 140 * Sin(*pendulum\angle) ;scale = 1 m/140 pixels + Protected y = *pendulum\length * 140 * Cos(*pendulum\angle) + StartDrawing(ScreenOutput()) + LineXY(154 + 5,43 + 5, 154 + 5 + x, 43 + 5 + y) ;draw from pivot-center to bob-center, adjusting for origins + StopDrawing() + + ;draw bob + DisplayTransparentSprite(#bob_spr, 154 + 5 - 16 + x, 43 + 5 - 16 + y) ;adj for origin in upper-left +EndProcedure + +Define pendulum.pendulum, event +initPendulum(pendulum) +drawPendulum(pendulum) + +AddWindowTimer(0, 1, 50) +Repeat + event = WindowEvent() + Select event + Case #pb_event_timer + drawBackground() + Select EventTimer() + Case 1 + updatePendulum(pendulum, 50) + drawPendulum(pendulum) + EndSelect + FlipBuffers() + Case #PB_Event_CloseWindow + Break + EndSelect +ForEver diff --git a/Task/Animate-a-pendulum/RLaB/animate-a-pendulum.rlab b/Task/Animate-a-pendulum/RLaB/animate-a-pendulum.rlab new file mode 100644 index 0000000000..9ae044bab9 --- /dev/null +++ b/Task/Animate-a-pendulum/RLaB/animate-a-pendulum.rlab @@ -0,0 +1,59 @@ +// +// example: solve ODE for pendulum +// + +// we first define the first derivative function for the solver +dudt = function(t, u, p) +{ + // t-> time + // u->[theta, dtheta/dt ] + // p-> g/L, parameter + rval = zeros(2,1); + rval[1] = u[2]; + rval[2] = -p[1] * sin(u[1]); + return rval; +}; + +// now we solve the problem +// physical parameters +L = 5; // (m), the length of the arm of the pendulum +p = mks.g / L; // RLaB has a built-in list 'mks' which contains large number of physical constants and conversion factors +T0 = 2*const.pi*sqrt(L/mks.g); // approximate period of the pendulum + +// initial conditions +theta0 = 30; // degrees, initial angle of deflection of pendulum +u0 = [theta0*const.pi/180, 0]; // RLaB has a built-in list 'const' of mathematical constants. + +// times at which we want solution +t = [0:4:1/64] * T0; // solve for 4 approximate periods with at time points spaced at T0/64 + +// prepare ODEIV solver +optsode = <<>>; +optsode.eabs = 1e-6; // relative error for step size +optsode.erel = 1e-6; // absolute error for step size +optsode.delta_t = 1e-6; // maximum dt that code is allowed +optsode.stdout = stderr(); // open the text console and in it print the results of each step of calculation +optsode.imethod = 5; // use method No. 5 from the odeiv toolkit, Runge-Kutta 8th order Prince-Dormand method +//optsode.phase_space = 0; // the solver returns [t, u1(t), u2(t)] which is default behavior +optsode.phase_space = 1; // the solver returns [t, u1(t), u2(t), d(u1)/dt(t), d(u2)/dt] + +// solver do my bidding +y = odeiv(dudt, p, t, u0, optsode); + +// Make an animation. We choose to use 'pgplot' rather then 'gnuplot' interface because the former is +// faster and thus less cache-demanding, while the latter can be very cache-demanding (it may slow your +// linux system quite down if one sends lots of plots for gnuplot to plot). +plwins (1); // we will use one pgplot-window + +plwin(1); // plot to pgplot-window No. 1; necessary if using more than one pgplot window +plimits (-L,L, -1.25*L, 0.25*L); +xlabel ("x-coordinate"); +ylabel ("z-coordinate"); +plegend ("Arm"); +for (i in 1:y.nr) +{ + // plot a line between the pivot point at (0,0) and the current position of the pendulum + arm_line = [0,0; L*sin(y[i;2]), -L*cos(y[i;2])]; // this is because theta is between the arm and the z-coordinate + plot (arm_line); + sleep (0.1); // sleep 0.1 seconds between plots +} diff --git a/Task/Animate-a-pendulum/XPL0/animate-a-pendulum.xpl0 b/Task/Animate-a-pendulum/XPL0/animate-a-pendulum.xpl0 new file mode 100644 index 0000000000..3078017b42 --- /dev/null +++ b/Task/Animate-a-pendulum/XPL0/animate-a-pendulum.xpl0 @@ -0,0 +1,36 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations + +proc Ball(X0, Y0, R, C); \Draw a filled circle +int X0, Y0, R, C; \center coordinates, radius, color +int X, Y; +for Y:= -R to R do + for X:= -R to R do + if X*X + Y*Y <= R*R then Point(X+X0, Y+Y0, C); + + +def L = 2.0, \pendulum arm length (meters) + G = 9.81, \acceleration due to gravity (meters/second^2) + Pi = 3.14, + DT = 1.0/72.0; \delta time = screen refresh rate (seconds) +def X0=640/2, Y0=480/2; \anchor point = center coordinate +real S, V, A, T; \arc length, velocity, acceleration, theta angle +int X, Y; \ball coordinates + +[SetVid($101); \set 640x480x8 graphic display mode +T:= Pi*0.75; V:= 0.0; \starting angle and velocity +S:= T*L; +repeat A:= -G*Sin(T); + V:= V + A*DT; + S:= S + V*DT; + T:= S/L; + X:= X0 + fix(L*100.0*Sin(T)); \100 scales to fit screen + Y:= Y0 + fix(L*100.0*Cos(T)); + Move(X0, Y0); Line(X, Y, 7); \draw pendulum + Ball(X, Y, 10, $E\yellow\); + while port($3DA) & $08 do []; \wait for vertical retrace to go away + repeat until port($3DA) & $08; \wait for vertical retrace signal + Move(X0, Y0); Line(X, Y, 0); \erase pendulum + Ball(X, Y, 10, 0\black\); +until KeyHit; \keystroke terminates program +SetVid(3); \restore normal text screen +] diff --git a/Task/Animation/Mathematica/animation.mathematica b/Task/Animation/Mathematica/animation.math similarity index 100% rename from Task/Animation/Mathematica/animation.mathematica rename to Task/Animation/Mathematica/animation.math diff --git a/Task/Animation/Oz/animation.oz b/Task/Animation/Oz/animation.oz new file mode 100644 index 0000000000..14c16b9f36 --- /dev/null +++ b/Task/Animation/Oz/animation.oz @@ -0,0 +1,60 @@ +functor +import + Application + QTk at 'x-oz://system/wp/QTk.ozf' +define + proc {Start} + Label + Window = {CreateWindow ?Label} + Animation = {New LabelAnimation init(Label delay:125)} + in + {Window show} + {Animation go} + end + + fun {CreateWindow ?Label} + Courier = {QTk.newFont font(family:courier size:14)} + GUI = td( + title:"Basic Animation" + label(text:"Hello World! " handle:Label font:Courier) + action:proc {$} {Application.exit 0} end + ) + in + {QTk.build GUI} + end + + class LabelAnimation from Time.repeat + attr + activeShifter:ShiftRight + otherShifter:ShiftLeft + feat + label + + meth init(Label delay:Delay<=100) + self.label = Label + {self setRepAll(action:Animate delay:Delay)} + {Label bind(event:"" action:self#Revert)} + end + + meth Animate + OldText = {self.label get(text:$)} + NewText = {@activeShifter OldText} + in + {self.label set(text:NewText)} + end + + meth Revert + otherShifter := (activeShifter := @otherShifter) + end + end + + fun {ShiftRight Xs} + {List.last Xs}|{List.take Xs {Length Xs}-1} + end + + fun {ShiftLeft Xs} + {Append Xs.2 [Xs.1]} + end + + {Start} +end diff --git a/Task/Animation/PureBasic/animation.purebasic b/Task/Animation/PureBasic/animation.purebasic new file mode 100644 index 0000000000..f8b9753d70 --- /dev/null +++ b/Task/Animation/PureBasic/animation.purebasic @@ -0,0 +1,30 @@ +OpenWindow(0,0,0,500,100,"Hello World!",#PB_Window_ScreenCentered|#PB_Window_SystemMenu) + +text$ = "Hello World! " +direction = 1 + +LoadFont(0,"",60) +ButtonGadget(0,2,2,496,96,text$) : SetGadgetFont(0,FontID(0)) + +Repeat + event = WaitWindowEvent(50) + Select event + Case #PB_Event_Gadget + If EventGadget() = 0 + direction*-1 + EndIf + Case #PB_Event_CloseWindow + End + EndSelect + + If ElapsedMilliseconds()-tick > 400 + offset+direction + If offset > Len(text$)-1 + offset = 0 + ElseIf offset < 0 + offset = Len(text$)-1 + EndIf + SetGadgetText(0,Mid(text$,offset+1)+Left(text$,offset)) + tick = ElapsedMilliseconds() + EndIf +ForEver diff --git a/Task/Animation/REBOL/animation.rebol b/Task/Animation/REBOL/animation.rebol new file mode 100644 index 0000000000..c4c7196413 --- /dev/null +++ b/Task/Animation/REBOL/animation.rebol @@ -0,0 +1,45 @@ +REBOL [ + Title: "Basic Animation" + Author: oofoe + Date: 2009-12-06 + URL: http://rosettacode.org/wiki/Basic_Animation +] + +message: "Hello World! " how: 1 + +roll: func [ + "Shifts a text string right or left by one character." + text [string!] "Text to shift." + direction [integer!] "Direction to shift -- right: 1, left: -1." + /local h t +][ + either direction > 0 [ + h: last text t: copy/part text ((length? text) - 1) + ][ + h: copy skip text 1 t: text/1 + ] + rejoin [h t] +] + +; This next bit specifies the GUI panel. The window will have a +; gradient backdrop, over which will be composited the text, in a +; monospaced font with a drop-shadow. A timer (the 'rate' bit) is set +; to update 24 times per second. The 'engage' function in the 'feel' +; block listens for events on the text face. Time events update the +; animation and mouse-down change the animation's direction. + +view layout [ + backdrop effect [gradient 0x1 coal black] + + vh1 as-is message ; 'as-is' prevents text trimming. + font [name: font-fixed] + rate 24 + feel [ + engage: func [f a e] [ + case [ + 'time = a [set-face f message: roll message how] ; Animate. + 'down = a [how: how * -1] ; Change direction. + ] + ] + ] +] diff --git a/Task/Animation/Suneido/animation.suneido b/Task/Animation/Suneido/animation.suneido new file mode 100644 index 0000000000..d071ace84c --- /dev/null +++ b/Task/Animation/Suneido/animation.suneido @@ -0,0 +1,36 @@ +Window(Controller + { + Xmin: 50 + Ymin: 50 + New() + { + super(.layout()) + .txt = .FindControl('text') + .moveTimer = SetTimer(NULL, 0, 600, .moveTimerFunc) + } + direction: -1 + moveTimer: false + layout() + { + return #(Vert (Static 'Hello World! ', size: 12, weight: 600, + notify:, name: 'text')) + } + moveTimerFunc(@unused) + { + str = .txt.Get() + .txt.Set(str.Substr(1 * .direction) $ str.Substr(0, (1 * .direction))) + } + Static_Click() + { + .direction = .direction * -1 + } + Destroy() + { + if .moveTimer isnt false + { + KillTimer(NULL, .moveTimer) + ClearCallback(.moveTimerFunc) + } + super.Destroy() + } + }) diff --git a/Task/Animation/Visual-Basic/animation.vb b/Task/Animation/Visual-Basic/animation.vb new file mode 100644 index 0000000000..554174f228 --- /dev/null +++ b/Task/Animation/Visual-Basic/animation.vb @@ -0,0 +1,31 @@ +VERSION 5.00 +Begin VB.Form Form1 + Begin VB.Timer Timer1 + Interval = 250 + End + Begin VB.Label Label1 + AutoSize = -1 'True + Caption = "Hello World! " + End +End +Attribute VB_Name = "Form1" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +'Everything above this line is hidden when in the IDE. + +Private goRight As Boolean + +Private Sub Label1_Click() + goRight = Not goRight +End Sub + +Private Sub Timer1_Timer() + If goRight Then + x = Mid(Label1.Caption, 2) & Left(Label1.Caption, 1) + Else + x = Right(Label1.Caption, 1) & Left(Label1.Caption, Len(Label1.Caption) - 1) + End If + Label1.Caption = x +End Sub diff --git a/Task/Animation/XPL0/animation.xpl0 b/Task/Animation/XPL0/animation.xpl0 new file mode 100644 index 0000000000..368e8ddd87 --- /dev/null +++ b/Task/Animation/XPL0/animation.xpl0 @@ -0,0 +1,23 @@ +include c:\cxpl\codes; +int CpuReg, Dir, I, J; +char Str; +string 0; \use zero-terminated strings, instead of MSb set +[CpuReg:= GetReg; \provides access to 8086 CPU registers +\ 0123456789012 +Str:= "Hello World! "; +Clear; +Dir:= -1; \make string initially scroll to the right +I:= 0; \index to start of displayed portion of string +repeat Cursor(0, 0); \set cursor position to upper-left corner + for J:= 0 to 12 do + [ChOut(0, Str(I)); I:= I+1; if I>12 then I:= 0]; + Sound(0, 2, 1); \delay about 1/9 second + I:= I+Dir; \step starting position of displayed string + if I<0 then I:=12; \wraparound + if I>12 then I:= 0; + CpuReg:= GetReg; \get mouse button press information + CpuReg(0):= 5; CpuReg(1):= 0; + SoftInt($33); \reverse direction if left button was pressed + if CpuReg(1) then Dir:= -Dir; +until KeyHit; \any keystroke terminates program +] diff --git a/Task/Anonymous-recursion/CoffeeScript/anonymous-recursion.coffee b/Task/Anonymous-recursion/CoffeeScript/anonymous-recursion.coffeescript similarity index 100% rename from Task/Anonymous-recursion/CoffeeScript/anonymous-recursion.coffee rename to Task/Anonymous-recursion/CoffeeScript/anonymous-recursion.coffeescript diff --git a/Task/Anonymous-recursion/Mathematica/anonymous-recursion-1.mathematica b/Task/Anonymous-recursion/Mathematica/anonymous-recursion-1.math similarity index 100% rename from Task/Anonymous-recursion/Mathematica/anonymous-recursion-1.mathematica rename to Task/Anonymous-recursion/Mathematica/anonymous-recursion-1.math diff --git a/Task/Anonymous-recursion/Mathematica/anonymous-recursion-2.mathematica b/Task/Anonymous-recursion/Mathematica/anonymous-recursion-2.math similarity index 100% rename from Task/Anonymous-recursion/Mathematica/anonymous-recursion-2.mathematica rename to Task/Anonymous-recursion/Mathematica/anonymous-recursion-2.math diff --git a/Task/Anonymous-recursion/Nemerle/anonymous-recursion.nemerle b/Task/Anonymous-recursion/Nemerle/anonymous-recursion.nemerle new file mode 100644 index 0000000000..4d380d47dc --- /dev/null +++ b/Task/Anonymous-recursion/Nemerle/anonymous-recursion.nemerle @@ -0,0 +1,30 @@ +using System; +using System.Console; + +module Fib +{ + Fib(n : long) : long + { + def fib(m : long) + { + |0 => 1 + |1 => 1 + |_ => fib(m - 1) + fib(m - 2) + } + + match(n) + { + |n when (n < 0) => throw ArgumentException("Fib() not defined on negative numbers") + |_ => fib(n) + } + } + + Main() : void + { + foreach (i in [-2 .. 10]) + { + try {WriteLine("{0}", Fib(i));} + catch {|e is ArgumentException => WriteLine(e.Message)} + } + } +} diff --git a/Task/Anonymous-recursion/OCaml/anonymous-recursion-1.ocaml b/Task/Anonymous-recursion/OCaml/anonymous-recursion-1.ocaml new file mode 100644 index 0000000000..8f2a862ba6 --- /dev/null +++ b/Task/Anonymous-recursion/OCaml/anonymous-recursion-1.ocaml @@ -0,0 +1,10 @@ +let fib n = + let rec real = function + 0 -> 1 + | 1 -> 1 + | n -> real (n-1) + real (n-2) + in + if n < 0 then + None + else + Some (real n) diff --git a/Task/Anonymous-recursion/OCaml/anonymous-recursion-2.ocaml b/Task/Anonymous-recursion/OCaml/anonymous-recursion-2.ocaml new file mode 100644 index 0000000000..e0f6b8e2c9 --- /dev/null +++ b/Task/Anonymous-recursion/OCaml/anonymous-recursion-2.ocaml @@ -0,0 +1,7 @@ +let rec fix f x = f (fix f) x + +let fib n = + if n < 0 then + None + else + Some (fix (fun f -> fun n -> if n <= 1 then 1 else f (n-1) + f (n-2)) n) diff --git a/Task/Anonymous-recursion/Objective-C/anonymous-recursion-1.m b/Task/Anonymous-recursion/Objective-C/anonymous-recursion-1.m new file mode 100644 index 0000000000..6baabe1cf4 --- /dev/null +++ b/Task/Anonymous-recursion/Objective-C/anonymous-recursion-1.m @@ -0,0 +1,33 @@ +#import + +@interface AnonymousRecursion : NSObject { } +- (NSNumber *)fibonacci:(NSNumber *)n; +@end + +@implementation AnonymousRecursion +- (NSNumber *)fibonacci:(NSNumber *)n { + int i = [n intValue]; + if (i < 0) + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason:@"fibonacci: no negative numbers" + userInfo:nil]; + int result; + if (i < 2) + result = 1; + else + result = [[self performSelector:_cmd withObject:[NSNumber numberWithInt:i-1]] intValue] + + [[self performSelector:_cmd withObject:[NSNumber numberWithInt:i-2]] intValue]; + return [NSNumber numberWithInt:result]; +} +@end + +int main (int argc, const char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + AnonymousRecursion *dummy = [[AnonymousRecursion alloc] init]; + NSLog(@"%@", [dummy fibonacci:[NSNumber numberWithInt:8]]); + [dummy release]; + + [pool release]; + return 0; +} diff --git a/Task/Anonymous-recursion/Objective-C/anonymous-recursion-2.m b/Task/Anonymous-recursion/Objective-C/anonymous-recursion-2.m new file mode 100644 index 0000000000..bfb0d63868 --- /dev/null +++ b/Task/Anonymous-recursion/Objective-C/anonymous-recursion-2.m @@ -0,0 +1,25 @@ +#import + +int fib(int n) { + if (n < 0) + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason:@"fib: no negative numbers" + userInfo:nil]; + __block int (^f)(int); + f = ^(int n) { + if (n < 2) + return 1; + else + return f(n-1) + f(n-2); + }; + return f(n); +} + +int main (int argc, const char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSLog(@"%d", fib(8)); + + [pool release]; + return 0; +} diff --git a/Task/Anonymous-recursion/OxygenBasic/anonymous-recursion.oxy b/Task/Anonymous-recursion/OxygenBasic/anonymous-recursion.oxy new file mode 100644 index 0000000000..f4472ef8ae --- /dev/null +++ b/Task/Anonymous-recursion/OxygenBasic/anonymous-recursion.oxy @@ -0,0 +1,9 @@ +function fiboRatio() as double + function fibo( double i, j ) as double + if j > 2e12 then return j / i + return fibo j, i + j + end function + return fibo 1, 1 +end function + +print fiboRatio diff --git a/Task/Anonymous-recursion/Perl-6/anonymous-recursion-1.pl6 b/Task/Anonymous-recursion/Perl-6/anonymous-recursion-1.pl6 new file mode 100644 index 0000000000..ac504552e0 --- /dev/null +++ b/Task/Anonymous-recursion/Perl-6/anonymous-recursion-1.pl6 @@ -0,0 +1,10 @@ +sub fib($n) { + die "Naughty fib" if $n < 0; + return { + $_ < 2 + ?? $_ + !! &?BLOCK($_-1) + &?BLOCK($_-2); + }($n); +} + +say fib(10); diff --git a/Task/Anonymous-recursion/Perl-6/anonymous-recursion-2.pl6 b/Task/Anonymous-recursion/Perl-6/anonymous-recursion-2.pl6 new file mode 100644 index 0000000000..858b296d9c --- /dev/null +++ b/Task/Anonymous-recursion/Perl-6/anonymous-recursion-2.pl6 @@ -0,0 +1,2 @@ +constant @fib = 0, 1, *+* ... *; +say @fib[10]; diff --git a/Task/Anonymous-recursion/PostScript/anonymous-recursion.ps b/Task/Anonymous-recursion/PostScript/anonymous-recursion.ps new file mode 100644 index 0000000000..f49e8e7d7d --- /dev/null +++ b/Task/Anonymous-recursion/PostScript/anonymous-recursion.ps @@ -0,0 +1,23 @@ +% primitive recursion +/pfact { + {1} {*} primrec}. + +%linear recursion +/lfact { + {dup 0 eq} + {pop 1} + {dup pred} + {*} + linrec}. + +% general recursion +/gfact { + {0 eq} + {succ} + {dup pred} + {i *} + genrec}. + +% binary recursion +/fib { + {2 lt} {} {pred dup pred} {+} binrec}. diff --git a/Task/Anonymous-recursion/Qi/anonymous-recursion.qi b/Task/Anonymous-recursion/Qi/anonymous-recursion.qi new file mode 100644 index 0000000000..71d0b27c7d --- /dev/null +++ b/Task/Anonymous-recursion/Qi/anonymous-recursion.qi @@ -0,0 +1,7 @@ +(define fib + N -> (let A (/. A N + (if (< N 2) + N + (+ (A A (- N 2)) + (A A (- N 1))))) + (A A N))) diff --git a/Task/Anonymous-recursion/UNIX-Shell/anonymous-recursion-1.sh b/Task/Anonymous-recursion/UNIX-Shell/anonymous-recursion-1.sh new file mode 100644 index 0000000000..21ea9e19cc --- /dev/null +++ b/Task/Anonymous-recursion/UNIX-Shell/anonymous-recursion-1.sh @@ -0,0 +1,17 @@ +fib() { + if test 0 -gt "$1"; then + echo "fib: fib of negative" 1>&2 + return 1 + else + ( + fib2() { + if test 2 -gt "$1"; then + echo "$1" + else + echo $(( $(fib2 $(($1 - 1)) ) + $(fib2 $(($1 - 2)) ) )) + fi + } + fib2 "$1" + ) + fi +} diff --git a/Task/Anonymous-recursion/UNIX-Shell/anonymous-recursion-2.sh b/Task/Anonymous-recursion/UNIX-Shell/anonymous-recursion-2.sh new file mode 100644 index 0000000000..9921ddaa57 --- /dev/null +++ b/Task/Anonymous-recursion/UNIX-Shell/anonymous-recursion-2.sh @@ -0,0 +1,18 @@ +$ for i in -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12; do +> fib $i +> done +fib: fib of negative +fib: fib of negative +0 +1 +1 +2 +3 +5 +8 +13 +21 +34 +55 +89 +144 diff --git a/Task/Anonymous-recursion/Ursala/anonymous-recursion.ursala b/Task/Anonymous-recursion/Ursala/anonymous-recursion.ursala new file mode 100644 index 0000000000..b63866de03 --- /dev/null +++ b/Task/Anonymous-recursion/Ursala/anonymous-recursion.ursala @@ -0,0 +1,13 @@ +#import nat + +fib = + +~&izZB?( # test the sign bit of the argument + <'fib of negative'>!%, # throw an exception if it's negative + {0,1}^? (map (fn (x) (* x x)) '(1 2 3 4)) +(1 4 9 16) diff --git a/Task/Apply-a-callback-to-an-array/Nial/apply-a-callback-to-an-array.nial b/Task/Apply-a-callback-to-an-array/Nial/apply-a-callback-to-an-array.nial new file mode 100644 index 0000000000..68e5e7947b --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Nial/apply-a-callback-to-an-array.nial @@ -0,0 +1,2 @@ +each (* [first, first] ) 1 2 3 4 +=1 4 9 16 diff --git a/Task/Apply-a-callback-to-an-array/Nimrod/apply-a-callback-to-an-array.nimrod b/Task/Apply-a-callback-to-an-array/Nimrod/apply-a-callback-to-an-array.nimrod new file mode 100644 index 0000000000..5a04ac5570 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Nimrod/apply-a-callback-to-an-array.nimrod @@ -0,0 +1,2 @@ +var arr = [1,2,3,4] +arr.map proc(some: var int) = echo(some, " squared = ", some*some) diff --git a/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-1.ocaml b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-1.ocaml new file mode 100644 index 0000000000..de87a326a3 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-1.ocaml @@ -0,0 +1 @@ +Array.map diff --git a/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-2.ocaml b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-2.ocaml new file mode 100644 index 0000000000..9944abc462 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-2.ocaml @@ -0,0 +1,3 @@ +let square x = x * x;; +let values = Array.init 10 ((+) 1);; +Array.map square values;; diff --git a/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-3.ocaml b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-3.ocaml new file mode 100644 index 0000000000..329e8e9309 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-3.ocaml @@ -0,0 +1,2 @@ +let values = [1;2;3;4;5;6;7;8;9;10];; +List.map square values;; diff --git a/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-4.ocaml b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-4.ocaml new file mode 100644 index 0000000000..a556861bf7 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-4.ocaml @@ -0,0 +1 @@ +Array.iter (fun x -> Printf.printf "%d" x) [|1; 2; 3; 4; 5|];; diff --git a/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-5.ocaml b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-5.ocaml new file mode 100644 index 0000000000..bae3c8fc64 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-5.ocaml @@ -0,0 +1 @@ +List.iter (fun x -> Printf.printf "%d" x) [1; 2; 3; 4; 5];; diff --git a/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-6.ocaml b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-6.ocaml new file mode 100644 index 0000000000..5d8ae93541 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-6.ocaml @@ -0,0 +1 @@ +Array.iter (Printf.printf "%d") [|1; 2; 3; 4; 5|];; diff --git a/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-7.ocaml b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-7.ocaml new file mode 100644 index 0000000000..363faf8d60 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/OCaml/apply-a-callback-to-an-array-7.ocaml @@ -0,0 +1 @@ +List.iter (Printf.printf "%d") [1; 2; 3; 4; 5];; diff --git a/Task/Apply-a-callback-to-an-array/Objeck/apply-a-callback-to-an-array.objeck b/Task/Apply-a-callback-to-an-array/Objeck/apply-a-callback-to-an-array.objeck new file mode 100644 index 0000000000..222b4954e7 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Objeck/apply-a-callback-to-an-array.objeck @@ -0,0 +1,21 @@ +use Structure; + +bundle Default { + class Test { + function : Main(args : String[]) ~ Nil { + Run(); + } + + function : native : Run() ~ Nil { + values := IntVector->New([1, 2, 3, 4, 5]); + squares := values->Apply(Square(Int) ~ Int); + each(i : squares) { + squares->Get(i)->PrintLine(); + }; + } + + function : Square(value : Int) ~ Int { + return value * value; + } + } +} diff --git a/Task/Apply-a-callback-to-an-array/Octave/apply-a-callback-to-an-array.octave b/Task/Apply-a-callback-to-an-array/Octave/apply-a-callback-to-an-array.octave new file mode 100644 index 0000000000..21ba2d7262 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Octave/apply-a-callback-to-an-array.octave @@ -0,0 +1,7 @@ +function e = f(x, y) + e = x^2 + exp(-1/(y+1)); +endfunction + +% f([2,3], [1,4]) gives and error, but +arrayfun(@f, [2, 3], [1,4]) +% works diff --git a/Task/Apply-a-callback-to-an-array/Order/apply-a-callback-to-an-array.order b/Task/Apply-a-callback-to-an-array/Order/apply-a-callback-to-an-array.order new file mode 100644 index 0000000000..c3dbd181d7 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Order/apply-a-callback-to-an-array.order @@ -0,0 +1,10 @@ +#include + +ORDER_PP( 8tuple_map(8fn(8X, 8times(8X, 8X)), 8tuple(1, 2, 3, 4, 5)) ) +// -> (1,4,9,16,25) + +ORDER_PP( 8seq_map(8fn(8X, 8times(8X, 8X)), 8seq(1, 2, 3, 4, 5)) ) +// -> (1)(4)(9)(16)(25) + +ORDER_PP( 8seq_for_each(8fn(8X, 8print(8X 8comma)), 8seq(1, 2, 3, 4, 5)) ) +// prints 1,2,3,4,5, and returns 8nil diff --git a/Task/Apply-a-callback-to-an-array/Oz/apply-a-callback-to-an-array.oz b/Task/Apply-a-callback-to-an-array/Oz/apply-a-callback-to-an-array.oz new file mode 100644 index 0000000000..e0d8f41c4c --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Oz/apply-a-callback-to-an-array.oz @@ -0,0 +1,13 @@ +declare + fun{Square A} + A*A + end + + Lst = [1 2 3 4 5] + + %% apply a PROCEDURE to every element + {ForAll Lst Show} + + %% apply a FUNCTION to every element + Result = {Map Lst Square} + {Show Result} diff --git a/Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array.pari b/Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array.pari new file mode 100644 index 0000000000..193fad6399 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array.pari @@ -0,0 +1,2 @@ +callback(n)=n+n; +apply(callback, [1,2,3,4,5]) diff --git a/Task/Apply-a-callback-to-an-array/PL-SQL/apply-a-callback-to-an-array.sql b/Task/Apply-a-callback-to-an-array/PL-SQL/apply-a-callback-to-an-array.sql new file mode 100644 index 0000000000..f3d4fca5be --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PL-SQL/apply-a-callback-to-an-array.sql @@ -0,0 +1,76 @@ +-- Let's create a generic class with one method to be used as an interface: +create or replace +TYPE callback AS OBJECT ( + -- A class needs at least one member even though we don't use it + -- There's no generic OBJECT type, so let's call it NUMBER + dummy NUMBER, + -- Here's our function, and since PL/SQL doesn't have generics, + -- let's use type NUMBER for our params + MEMBER FUNCTION exec(n number) RETURN number +) NOT FINAL not instantiable; +/ + +-- Now let's inherit from that, defining a class with one method. We'll have ours square a number. +-- We can pass this class into any function that takes type callback: +CREATE OR REPLACE TYPE CB_SQUARE under callback ( + OVERRIDING MEMBER FUNCTION exec(n NUMBER) RETURN NUMBER +) +/ +CREATE OR REPLACE +TYPE BODY CB_SQUARE AS + OVERRIDING MEMBER FUNCTION exec(n NUMBER) RETURN NUMBER IS + BEGIN + RETURN n * n; + END exec; +END; +/ + +-- And a package to hold our test +CREATE OR REPLACE +PACKAGE PKG_CALLBACK AS + myCallback cb_square; + TYPE intTable IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; + ints intTable; + i PLS_INTEGER; + + procedure test_callback; +END PKG_CALLBACK; +/ + +CREATE OR REPLACE PACKAGE BODY PKG_CALLBACK AS + -- Our generic mapping function that takes a "method" and a collection + -- Note that it takes the generic callback type + -- that doesn't know anything about squaring + procedure do_callback(myCallback IN callback, ints IN OUT intTable) IS + i PLS_INTEGER; + myInt NUMBER; + begin + for i in 1 .. ints.count loop + myInt := ints(i); + -- PL/SQL call's the child's method + ints(i) := myCallback.exec(myInt); + END LOOP; + end do_callback; + + procedure test_callback IS + BEGIN + myCallback := cb_square(null); + FOR i IN 1..5 LOOP + ints(i) := i; + END LOOP; + + do_callback(myCallback, ints); + + i := ints.FIRST; + WHILE i IS NOT NULL LOOP + DBMS_OUTPUT.put_line(ints(i)); + i := ints.next(i); + END LOOP; + END test_callback; +END PKG_CALLBACK; +/ + +BEGIN + PKG_CALLBACK.TEST_CALLBACK(); +END; +/ diff --git a/Task/Apply-a-callback-to-an-array/Perl-6/apply-a-callback-to-an-array.pl6 b/Task/Apply-a-callback-to-an-array/Perl-6/apply-a-callback-to-an-array.pl6 new file mode 100644 index 0000000000..04acf94dc4 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Perl-6/apply-a-callback-to-an-array.pl6 @@ -0,0 +1,16 @@ +my $function = { 2 * $^x + 3 }; +my @array = 1 .. 5; + +# via map function +.say for map $function, @array; + +# via map method +.say for @array.map($function); + +# via for loop +for @array { + say $function($_); +} + +# via the "hyper" metaoperator and method indirection +say @array».$function; diff --git a/Task/Apply-a-callback-to-an-array/Pike/apply-a-callback-to-an-array.pike b/Task/Apply-a-callback-to-an-array/Pike/apply-a-callback-to-an-array.pike new file mode 100644 index 0000000000..80a4ebaa31 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Pike/apply-a-callback-to-an-array.pike @@ -0,0 +1,8 @@ +int cube(int n) +{ + return n*n*n; +} + +array(int) a = ({ 1,2,3,4,5 }); +array(int) b = cube(a[*]); // automap operator +array(int) c = map(a, cube); // conventional map function diff --git a/Task/Apply-a-callback-to-an-array/Pop11/apply-a-callback-to-an-array.pop11 b/Task/Apply-a-callback-to-an-array/Pop11/apply-a-callback-to-an-array.pop11 new file mode 100644 index 0000000000..23009993c0 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Pop11/apply-a-callback-to-an-array.pop11 @@ -0,0 +1,10 @@ +;;; Define a procedure +define proc(x); + printf(x*x, '%p,'); +enddefine; + +;;; Create array +lvars ar = { 1 2 3 4 5}; + +;;; Apply procedure to array +appdata(ar, proc); diff --git a/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-1.ps b/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-1.ps new file mode 100644 index 0000000000..8388c6e48b --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-1.ps @@ -0,0 +1 @@ +[1 2 3 4 5] { dup mul = } forall diff --git a/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-2.ps b/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-2.ps new file mode 100644 index 0000000000..87ee6fab44 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-2.ps @@ -0,0 +1 @@ +[ [1 2 3 4 5] { dup mul } forall ] diff --git a/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-3.ps b/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-3.ps new file mode 100644 index 0000000000..714fee3557 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PostScript/apply-a-callback-to-an-array-3.ps @@ -0,0 +1 @@ +[1 2 3 4 5] {dup *} map diff --git a/Task/Apply-a-callback-to-an-array/PowerShell/apply-a-callback-to-an-array-1.psh b/Task/Apply-a-callback-to-an-array/PowerShell/apply-a-callback-to-an-array-1.psh new file mode 100644 index 0000000000..86ee892761 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PowerShell/apply-a-callback-to-an-array-1.psh @@ -0,0 +1 @@ +1..5 | ForEach-Object { $_ * $_ } diff --git a/Task/Apply-a-callback-to-an-array/PowerShell/apply-a-callback-to-an-array-2.psh b/Task/Apply-a-callback-to-an-array/PowerShell/apply-a-callback-to-an-array-2.psh new file mode 100644 index 0000000000..ceb27afe59 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PowerShell/apply-a-callback-to-an-array-2.psh @@ -0,0 +1,3 @@ +function map ([array] $a, [scriptblock] $s) { + $a | ForEach-Object $s +} diff --git a/Task/Apply-a-callback-to-an-array/PureBasic/apply-a-callback-to-an-array.purebasic b/Task/Apply-a-callback-to-an-array/PureBasic/apply-a-callback-to-an-array.purebasic new file mode 100644 index 0000000000..b09078d4ab --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/PureBasic/apply-a-callback-to-an-array.purebasic @@ -0,0 +1,14 @@ +Procedure Cube(Array param.i(1)) + Protected n.i + For n = 0 To ArraySize(param()) + Debug Str(param(n)) + "^3 = " + Str(param(n) * param(n) * param(n)) + Next +EndProcedure + +Dim AnArray.i(4) + +For n = 0 To ArraySize(AnArray()) + AnArray(n) = Random(99) +Next + +Cube(AnArray()) diff --git a/Task/Apply-a-callback-to-an-array/REBOL/apply-a-callback-to-an-array.rebol b/Task/Apply-a-callback-to-an-array/REBOL/apply-a-callback-to-an-array.rebol new file mode 100644 index 0000000000..23ffc3d668 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/REBOL/apply-a-callback-to-an-array.rebol @@ -0,0 +1,28 @@ +REBOL [ + Title: "Array Callback" + Date: 2010-01-04 + Author: oofoe + URL: http://rosettacode.org/wiki/Apply_a_callback_to_an_Array +] + +map: func [ + "Apply a function across an array." + f [native! function!] "Function to apply to each element of array." + a [block!] "Array to process." + /local x +][x: copy [] forall a [append x do [f a/1]] x] + +square: func [x][x * x] + +; Tests: + +assert: func [code][print [either do code [" ok"]["FAIL"] mold code]] + +print "Simple loop, modify in place:" +assert [[1 100 81] = (a: [1 10 9] forall a [a/1: square a/1] a)] + +print [crlf "Functional style with 'map':"] +assert [[4 16 36] = map :square [2 4 6]] + +print [crlf "Applying native function with 'map':"] +assert [[2 4 6] = map :square-root [4 16 36]] diff --git a/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-1.rlab b/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-1.rlab new file mode 100644 index 0000000000..ecbc6e90eb --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-1.rlab @@ -0,0 +1,6 @@ +>> x = rand(2,4) + 0.707213207 0.275298961 0.396757763 0.232312312 + 0.215619868 0.207078017 0.565700032 0.666090571 +>> sin(x) + 0.649717845 0.271834652 0.386430003 0.230228332 + 0.213952984 0.205601224 0.536006923 0.617916954 diff --git a/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-2.rlab b/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-2.rlab new file mode 100644 index 0000000000..844b023c0b --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-2.rlab @@ -0,0 +1,9 @@ +x = rand(2,4); +y = zeros(2,4); +for (i in 1:2) +{ + for (j in 1:4) + { + y[i;j] = sin( x[i;j] ); + } +} diff --git a/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-3.rlab b/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-3.rlab new file mode 100644 index 0000000000..b855f3d277 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/RLaB/apply-a-callback-to-an-array-3.rlab @@ -0,0 +1,11 @@ +x = <<>>; +for (i in 1:9) +{ + x.[i] = rand(); +} + +y = <<>>; +for (i in members(x)) +{ + y.[i] = sin( x.[i] ); +} diff --git a/Task/Apply-a-callback-to-an-array/Raven/apply-a-callback-to-an-array-1.raven b/Task/Apply-a-callback-to-an-array/Raven/apply-a-callback-to-an-array-1.raven new file mode 100644 index 0000000000..d510b29e89 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Raven/apply-a-callback-to-an-array-1.raven @@ -0,0 +1,2 @@ +# To print the squared elements +[1 2 3 4 5] each dup * print diff --git a/Task/Apply-a-callback-to-an-array/Raven/apply-a-callback-to-an-array-2.raven b/Task/Apply-a-callback-to-an-array/Raven/apply-a-callback-to-an-array-2.raven new file mode 100644 index 0000000000..bfb9b4a368 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Raven/apply-a-callback-to-an-array-2.raven @@ -0,0 +1,4 @@ +# To obtain a new array +group [1 2 3 4 5] each + dup * +list diff --git a/Task/Apply-a-callback-to-an-array/Retro/apply-a-callback-to-an-array-1.retro b/Task/Apply-a-callback-to-an-array/Retro/apply-a-callback-to-an-array-1.retro new file mode 100644 index 0000000000..e9f06ddfae --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Retro/apply-a-callback-to-an-array-1.retro @@ -0,0 +1 @@ +[ 1 2 3 4 5 ] ^array'fromQuote [ 10 * ] ^array'map ^array'display diff --git a/Task/Apply-a-callback-to-an-array/Retro/apply-a-callback-to-an-array-2.retro b/Task/Apply-a-callback-to-an-array/Retro/apply-a-callback-to-an-array-2.retro new file mode 100644 index 0000000000..29d1be5b14 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Retro/apply-a-callback-to-an-array-2.retro @@ -0,0 +1 @@ +[ "Hello" "World" "Foo" ] ^array'fromQuote [ "%s " puts ] ^array'apply diff --git a/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-1.salmon b/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-1.salmon new file mode 100644 index 0000000000..dda206bf5a --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-1.salmon @@ -0,0 +1,7 @@ +function apply(list, ageless to_apply) + (comprehend(x; list) (to_apply(x))); + +function square(x) (x*x); + +iterate(x; apply([0...9], square)) + x!; diff --git a/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-2.salmon b/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-2.salmon new file mode 100644 index 0000000000..e226972faf --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-2.salmon @@ -0,0 +1,9 @@ +include "short.salm"; + +fun apply(list, ageless to_apply) + (comp(x; list) (to_apply(x))); + +fun square(x) (x*x); + +iter(x; apply([0...9], square)) + x!; diff --git a/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-3.salmon b/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-3.salmon new file mode 100644 index 0000000000..ccb0efe0f3 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Salmon/apply-a-callback-to-an-array-3.salmon @@ -0,0 +1,7 @@ +function apply(list, to_apply) + (comprehend(x; list) (to_apply(x))); + +function square(x) (x*x); + +iterate(x; apply([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], square)) + x!; diff --git a/Task/Apply-a-callback-to-an-array/Slate/apply-a-callback-to-an-array.slate b/Task/Apply-a-callback-to-an-array/Slate/apply-a-callback-to-an-array.slate new file mode 100644 index 0000000000..f82f55941c --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Slate/apply-a-callback-to-an-array.slate @@ -0,0 +1 @@ +#( 1 2 3 4 5 ) collect: [| :n | n * n]. diff --git a/Task/Apply-a-callback-to-an-array/Standard-ML/apply-a-callback-to-an-array-1.ml b/Task/Apply-a-callback-to-an-array/Standard-ML/apply-a-callback-to-an-array-1.ml new file mode 100644 index 0000000000..10c40dcc03 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Standard-ML/apply-a-callback-to-an-array-1.ml @@ -0,0 +1 @@ +map f l diff --git a/Task/Apply-a-callback-to-an-array/Standard-ML/apply-a-callback-to-an-array-2.ml b/Task/Apply-a-callback-to-an-array/Standard-ML/apply-a-callback-to-an-array-2.ml new file mode 100644 index 0000000000..c22efc515a --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Standard-ML/apply-a-callback-to-an-array-2.ml @@ -0,0 +1 @@ +map (fn x=>x+1) [1,2,3];; (* [2,3,4] *) diff --git a/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-1.supercollider b/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-1.supercollider new file mode 100644 index 0000000000..1e21782702 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-1.supercollider @@ -0,0 +1 @@ +[1, 2, 3].squared; // returns [1, 4, 9] diff --git a/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-2.supercollider b/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-2.supercollider new file mode 100644 index 0000000000..af02876123 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-2.supercollider @@ -0,0 +1 @@ +[1, 2, 3].collect({ arg x; x*x }); diff --git a/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-3.supercollider b/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-3.supercollider new file mode 100644 index 0000000000..d15215a55f --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/SuperCollider/apply-a-callback-to-an-array-3.supercollider @@ -0,0 +1,9 @@ +var square = { + arg x; + x*x; +}; +var map = { + arg fn, xs; + all {: fn.value(x), x <- xs }; +}; +map.value(square,[1,2,3]); diff --git a/Task/Apply-a-callback-to-an-array/TI-89-BASIC/apply-a-callback-to-an-array.ti-89 b/Task/Apply-a-callback-to-an-array/TI-89-BASIC/apply-a-callback-to-an-array.ti-89 new file mode 100644 index 0000000000..a013055f8a --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TI-89-BASIC/apply-a-callback-to-an-array.ti-89 @@ -0,0 +1,17 @@ +© For no return value +Define foreach(fe_cname,fe_list) = Prgm + Local fe_i + For fe_i,1,dim(fe_list) + #fe_cname(fe_list[fe_i]) + EndFor +EndPrgm + +© For a list of results +Define map(map_cnam,map_list) = seq(#map_cnam(map_list[map_i]),map_i,1,dim(map_list)) + +Define callback(elem) = Prgm + Disp elem +EndPrgm + +foreach("callback", {1,2,3,4,5}) +Disp map("√", {1,2,3,4,5}) diff --git a/Task/Apply-a-callback-to-an-array/TIScript/apply-a-callback-to-an-array-1.tiscript b/Task/Apply-a-callback-to-an-array/TIScript/apply-a-callback-to-an-array-1.tiscript new file mode 100644 index 0000000000..941158a237 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TIScript/apply-a-callback-to-an-array-1.tiscript @@ -0,0 +1,2 @@ +var a = [1, 2, 3, 4, 5]; +a.map(function(v) { return v * v; }) diff --git a/Task/Apply-a-callback-to-an-array/TIScript/apply-a-callback-to-an-array-2.tiscript b/Task/Apply-a-callback-to-an-array/TIScript/apply-a-callback-to-an-array-2.tiscript new file mode 100644 index 0000000000..dd26f42b5f --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TIScript/apply-a-callback-to-an-array-2.tiscript @@ -0,0 +1,2 @@ +var a = [1, 2, 3, 4, 5]; +a.map( :v: v*v ); diff --git a/Task/Apply-a-callback-to-an-array/TXR/apply-a-callback-to-an-array.txr b/Task/Apply-a-callback-to-an-array/TXR/apply-a-callback-to-an-array.txr new file mode 100644 index 0000000000..e30a7db78d --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TXR/apply-a-callback-to-an-array.txr @@ -0,0 +1,7 @@ +@(do + (defun mapvec (vec fun) + (each ((i (range 0 (- (length vec) 1)))) + [fun [vec i]])) + + (mapvec #(1 2 3 4 5 6 7 8 9 10) + (lambda (x) (format t "~a\n" x)))) diff --git a/Task/Apply-a-callback-to-an-array/Toka/apply-a-callback-to-an-array.toka b/Task/Apply-a-callback-to-an-array/Toka/apply-a-callback-to-an-array.toka new file mode 100644 index 0000000000..6cc0577b70 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Toka/apply-a-callback-to-an-array.toka @@ -0,0 +1,17 @@ +( array count function -- ) +{ + value| array fn | + [ i array ] is I + [ to fn swap to array 0 swap [ I array.get :stack fn invoke I array.put ] countedLoop ] +} is map-array + +( Build an array ) +5 cells is-array a +10 0 a array.put +11 1 a array.put +12 2 a array.put +13 3 a array.put +14 4 a array.put + +( Add 1 to each item in the array ) +a 5 [ 1 + ] map-array diff --git a/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-1.torquescript b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-1.torquescript new file mode 100644 index 0000000000..056c57aff6 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-1.torquescript @@ -0,0 +1,8 @@ +function map(%array,%arrayCount,%function) +{ + for(%i=0;%i<%arrayCount;%i++) + { + eval("%a = "@%array@"["@%i@"];"); + eval(""@%function@"("@%a@");"); + } +} diff --git a/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-2.torquescript b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-2.torquescript new file mode 100644 index 0000000000..3e55da0415 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-2.torquescript @@ -0,0 +1,3 @@ +$array[0] = "Hello."; +$array[1] = "Hi."; +$array[2] = "How are you?"; diff --git a/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-3.torquescript b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-3.torquescript new file mode 100644 index 0000000000..e391aefb4a --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-3.torquescript @@ -0,0 +1 @@ +map("$array",3,"echo"); diff --git a/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-4.torquescript b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-4.torquescript new file mode 100644 index 0000000000..ec94562398 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/TorqueScript/apply-a-callback-to-an-array-4.torquescript @@ -0,0 +1,5 @@ +=> Hello. + +=> Hi. + +=> How are you? diff --git a/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-1.sh b/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-1.sh new file mode 100644 index 0000000000..b5205cfec4 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-1.sh @@ -0,0 +1,7 @@ +map() { + map_command=$1 + shift + for i do "$map_command" "$i"; done +} +list=1:2:3 +(IFS=:; map echo $list) diff --git a/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-2.sh b/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-2.sh new file mode 100644 index 0000000000..47d2c05906 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-2.sh @@ -0,0 +1,7 @@ +map() { + typeset command=$1 + shift + for i do "$command" "$i"; done +} +set -A ary 1 2 3 +map print "${ary[@]}" diff --git a/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-3.sh b/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-3.sh new file mode 100644 index 0000000000..c216896426 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/UNIX-Shell/apply-a-callback-to-an-array-3.sh @@ -0,0 +1,3 @@ +map(){for i ($*[2,-1]) $1 $i} +a=(1 2 3) +map print $a diff --git a/Task/Apply-a-callback-to-an-array/Ursala/apply-a-callback-to-an-array.ursala b/Task/Apply-a-callback-to-an-array/Ursala/apply-a-callback-to-an-array.ursala new file mode 100644 index 0000000000..4275410a89 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Ursala/apply-a-callback-to-an-array.ursala @@ -0,0 +1,5 @@ +#import nat + +#cast %nL + +demo = successor* <325,32,67,1,3,7,315> diff --git a/Task/Apply-a-callback-to-an-array/V/apply-a-callback-to-an-array.v b/Task/Apply-a-callback-to-an-array/V/apply-a-callback-to-an-array.v new file mode 100644 index 0000000000..92543ec154 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/V/apply-a-callback-to-an-array.v @@ -0,0 +1 @@ +[1 2 3 4] [dup *] map diff --git a/Task/Apply-a-callback-to-an-array/VBScript/apply-a-callback-to-an-array-1.vbscript b/Task/Apply-a-callback-to-an-array/VBScript/apply-a-callback-to-an-array-1.vbscript new file mode 100644 index 0000000000..6738d7f40e --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/VBScript/apply-a-callback-to-an-array-1.vbscript @@ -0,0 +1,16 @@ +class callback + dim sRule + + public property let rule( x ) + sRule = x + end property + + public default function applyTo(a) + dim p1 + for i = lbound( a ) to ubound( a ) + p1 = a( i ) + a( i ) = eval( sRule ) + next + applyTo = a + end function +end class diff --git a/Task/Apply-a-callback-to-an-array/VBScript/apply-a-callback-to-an-array-2.vbscript b/Task/Apply-a-callback-to-an-array/VBScript/apply-a-callback-to-an-array-2.vbscript new file mode 100644 index 0000000000..00043062ce --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/VBScript/apply-a-callback-to-an-array-2.vbscript @@ -0,0 +1,13 @@ +dim a1 +dim cb +set cb = new callback + +cb.rule = "ucase(p1)" +a1 = split("my dog has fleas", " " ) +cb.applyTo a1 +wscript.echo join( a1, " " ) + +cb.rule = "p1 ^ p1" +a1 = array(1,2,3,4,5,6,7,8,9,10) +cb.applyto a1 +wscript.echo join( a1, ", " ) diff --git a/Task/Apply-a-callback-to-an-array/Vorpal/apply-a-callback-to-an-array-1.vorpal b/Task/Apply-a-callback-to-an-array/Vorpal/apply-a-callback-to-an-array-1.vorpal new file mode 100644 index 0000000000..2f2a199066 --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Vorpal/apply-a-callback-to-an-array-1.vorpal @@ -0,0 +1 @@ +A.map(F) diff --git a/Task/Apply-a-callback-to-an-array/Vorpal/apply-a-callback-to-an-array-2.vorpal b/Task/Apply-a-callback-to-an-array/Vorpal/apply-a-callback-to-an-array-2.vorpal new file mode 100644 index 0000000000..0ee3dacf6c --- /dev/null +++ b/Task/Apply-a-callback-to-an-array/Vorpal/apply-a-callback-to-an-array-2.vorpal @@ -0,0 +1 @@ +A.map(F, x, y) diff --git a/Task/Arbitrary-precision-integers-(included)/0DESCRIPTION b/Task/Arbitrary-precision-integers-(included)/0DESCRIPTION deleted file mode 100644 index 917612b3f6..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/0DESCRIPTION +++ /dev/null @@ -1,11 +0,0 @@ -Using the in-built capabilities of your language, calculate the integer value of: - -::5^{4^{3^2}} - -* Confirm that the first and last twenty digits of the answer are: 62060698786608744707...92256259918212890625 -* Find and show the number of decimal digits in the answer. - -C.F. [[Long multiplication]] - -Note:
  • Do not submit an ''implementation'' of [[wp:arbitrary precision arithmetic|arbitrary precision arithmetic]]. The intention is to show the capabilities of the language as supplied. If a language has a [[Talk:Arbitrary-precision integers (included)#Use of external libraries|single, overwhelming, library]] of varied modules that is endorsed by its home site – such as [[CPAN]] for Perl or [[Boost]] for C++ – then that ''may'' be used instead. -
  • Strictly speaking, this should not be solved by fixed-precision numeric libraries where the precision has to be manually set to a large value; although if this is the '''only''' recourse then it may be used with a note explaining that the precision must be set manually to a large enough value.
diff --git a/Task/Arbitrary-precision-integers-(included)/1META.yaml b/Task/Arbitrary-precision-integers-(included)/1META.yaml deleted file mode 100644 index a34a05e951..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/1META.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -note: Arbitrary precision diff --git a/Task/Arbitrary-precision-integers-(included)/ACL2/arbitrary-precision-integers-(included).acl2 b/Task/Arbitrary-precision-integers-(included)/ACL2/arbitrary-precision-integers-(included).acl2 deleted file mode 100644 index b337fa9520..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/ACL2/arbitrary-precision-integers-(included).acl2 +++ /dev/null @@ -1,19 +0,0 @@ -(in-package "ACL2") - -(include-book "arithmetic-3/floor-mod/floor-mod" :dir :system) - -(set-print-length 0 state) - -(defun arbitrary-precision () - (declare (xargs :mode :program)) - (let* ((x (expt 5 (expt 4 (expt 3 2)))) - (s (mv-let (col str) - (fmt1-to-string "~xx" - (list (cons #\x x)) - 0) - (declare (ignore col)) - str))) - (cw "~s0 ... ~x1 (~x2 digits)~%" - (subseq s 1 21) - (mod x (expt 10 20)) - (1- (length s))))) diff --git a/Task/Arbitrary-precision-integers-(included)/Ada/arbitrary-precision-integers-(included).ada b/Task/Arbitrary-precision-integers-(included)/Ada/arbitrary-precision-integers-(included).ada deleted file mode 100644 index 838bfb5fec..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Ada/arbitrary-precision-integers-(included).ada +++ /dev/null @@ -1,16 +0,0 @@ -with Ada.Text_IO; use Ada.Text_IO; -with GNATCOLL.GMP; use GNATCOLL.GMP; -with GNATCOLL.GMP.Integers; use GNATCOLL.GMP.Integers; -procedure ArbitraryInt is - type stracc is access String; - BigInt : Big_Integer; - len : Natural; - str : stracc; -begin - Set (BigInt, 5); - Raise_To_N (BigInt, Unsigned_Long (4**(3**2))); - str := new String'(Image (BigInt)); - len := str'Length; - Put_Line ("Size is:"& Natural'Image (len)); - Put_Line (str (1 .. 20) & "....." & str (len - 19 .. len)); -end ArbitraryInt; diff --git a/Task/Arbitrary-precision-integers-(included)/Alore/arbitrary-precision-integers-(included).alore b/Task/Arbitrary-precision-integers-(included)/Alore/arbitrary-precision-integers-(included).alore deleted file mode 100644 index ff113918e1..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Alore/arbitrary-precision-integers-(included).alore +++ /dev/null @@ -1,9 +0,0 @@ -def Main() - var len as Int - var result as Str - result = Str(5**4**3**2) - len = result.length() - Print(len) - Print(result[:20]) - Print(result[len-20:]) -end diff --git a/Task/Arbitrary-precision-integers-(included)/Bracmat/arbitrary-precision-integers-(included).bracmat b/Task/Arbitrary-precision-integers-(included)/Bracmat/arbitrary-precision-integers-(included).bracmat deleted file mode 100644 index 0cf1eaa821..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Bracmat/arbitrary-precision-integers-(included).bracmat +++ /dev/null @@ -1,4 +0,0 @@ -{?} @(5^4^3^2:?first [20 ? [-21 ?last [?length)&str$(!first "..." !last "\nlength " !length) -{!} 62060698786608744707...92256259918212890625 -length 183231 - S 2,46 sec diff --git a/Task/Arbitrary-precision-integers-(included)/C-sharp/arbitrary-precision-integers-(included).cs b/Task/Arbitrary-precision-integers-(included)/C-sharp/arbitrary-precision-integers-(included).cs deleted file mode 100644 index a16bcb2aed..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/C-sharp/arbitrary-precision-integers-(included).cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Diagnostics; -using System.Linq; -using System.Numerics; - -static class Program { - static void Main() { - BigInteger n = BigInteger.Pow(5, (int)BigInteger.Pow(4, (int)BigInteger.Pow(3, 2))); - string result = n.ToString(); - - Debug.Assert(result.Length == 183231); - Debug.Assert(result.StartsWith("62060698786608744707")); - Debug.Assert(result.EndsWith("92256259918212890625")); - - Console.WriteLine("n = 5^4^3^2"); - Console.WriteLine("n = {0}...{1}", - result.Substring(0, 20), - result.Substring(result.Length - 20, 20) - ); - - Console.WriteLine("n digits = {0}", result.Length); - } -} diff --git a/Task/Arbitrary-precision-integers-(included)/C/arbitrary-precision-integers-(included)-1.c b/Task/Arbitrary-precision-integers-(included)/C/arbitrary-precision-integers-(included)-1.c deleted file mode 100644 index 9473b610d5..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/C/arbitrary-precision-integers-(included)-1.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#include - -int main() -{ - mpz_t a; - mpz_init_set_ui(a, 5); - mpz_pow_ui(a, a, 1 << 18); /* 2**18 == 4**9 */ - - int len = mpz_sizeinbase(a, 10); - printf("GMP says size is: %d\n", len); - - /* because GMP may report size 1 too big; see doc */ - char *s = mpz_get_str(0, 10, a); - printf("size really is %d\n", len = strlen(s)); - printf("Digits: %.20s...%s\n", s, s + len - 20); - - // free(s); /* we could, but we won't. we are exiting anyway */ - return 0; -} diff --git a/Task/Arbitrary-precision-integers-(included)/C/arbitrary-precision-integers-(included)-2.c b/Task/Arbitrary-precision-integers-(included)/C/arbitrary-precision-integers-(included)-2.c deleted file mode 100644 index 64af6a5d8d..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/C/arbitrary-precision-integers-(included)-2.c +++ /dev/null @@ -1,65 +0,0 @@ -/* 5432.c */ - -#include /* BN_*() */ -#include /* ERR_*() */ -#include /* exit() */ -#include /* fprintf() */ -#include /* strlen() */ - -void -fail(const char *message) -{ - fprintf(stderr, "%s: error 0x%08lx\n", ERR_get_error()); - exit(1); -} - -int -main() -{ - BIGNUM two, three, four, five; - BIGNUM answer; - BN_CTX *context; - size_t length; - char *string; - - context = BN_CTX_new(); - if (context == NULL) - fail("BN_CTX_new"); - - /* answer = 5 ** 4 ** 3 ** 2 */ - BN_init(&two); - BN_init(&three); - BN_init(&four); - BN_init(&five); - if (BN_set_word(&two, 2) == 0 || - BN_set_word(&three, 3) == 0 || - BN_set_word(&four, 4) == 0 || - BN_set_word(&five, 5) == 0) - fail("BN_set_word"); - BN_init(&answer); - if (BN_exp(&answer, &three, &two, context) == 0 || - BN_exp(&answer, &four, &answer, context) == 0 || - BN_exp(&answer, &five, &answer, context) == 0) - fail("BN_exp"); - - /* string = decimal answer */ - string = BN_bn2dec(&answer); - if (string == NULL) - fail("BN_bn2dec"); - - length = strlen(string); - printf(" First 20 digits: %.20s\n", string); - if (length >= 20) - printf(" Last 20 digits: %.20s\n", string + length - 20); - printf("Number of digits: %zd\n", length); - - OPENSSL_free(string); - BN_free(&answer); - BN_free(&five); - BN_free(&four); - BN_free(&three); - BN_free(&two); - BN_CTX_free(context); - - return 0; -} diff --git a/Task/Arbitrary-precision-integers-(included)/Clojure/arbitrary-precision-integers-(included)-1.clj b/Task/Arbitrary-precision-integers-(included)/Clojure/arbitrary-precision-integers-(included)-1.clj deleted file mode 100644 index fb911a500b..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Clojure/arbitrary-precision-integers-(included)-1.clj +++ /dev/null @@ -1,12 +0,0 @@ -(defn exp [n k] (reduce * (repeat k n))) - -(def big (->> 2 (exp 3) (exp 4) (exp 5))) -(def sbig (str big)) - -(assert (= "62060698786608744707" (.substring sbig 0 20))) -(assert (= "92256259918212890625" (.substring sbig (- (count sbig) 20)))) -(println (count sbig) "digits") - -(println (str (.substring sbig 0 20) ".." - (.substring sbig (- (count sbig) 20))) - (str "(" (count sbig) " digits)")) diff --git a/Task/Arbitrary-precision-integers-(included)/Clojure/arbitrary-precision-integers-(included)-2.clj b/Task/Arbitrary-precision-integers-(included)/Clojure/arbitrary-precision-integers-(included)-2.clj deleted file mode 100644 index 70c00fc896..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Clojure/arbitrary-precision-integers-(included)-2.clj +++ /dev/null @@ -1,5 +0,0 @@ -(defn exp [n k] - (cond - (zero? (mod k 2)) (recur (* n n) (/ k 2)) - (zero? (mod k 3)) (recur (* n n n) (/ k 3)) - :else (reduce * (repeat k n)))) diff --git a/Task/Arbitrary-precision-integers-(included)/Common-Lisp/arbitrary-precision-integers-(included).lisp b/Task/Arbitrary-precision-integers-(included)/Common-Lisp/arbitrary-precision-integers-(included).lisp deleted file mode 100644 index 9d75c9feba..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Common-Lisp/arbitrary-precision-integers-(included).lisp +++ /dev/null @@ -1,3 +0,0 @@ -(let ((s (format () "~s" (expt 5 (expt 4 (expt 3 2)))))) - (format t "~a...~a, length ~a" (subseq s 0 20) - (subseq s (- (length s) 20)) (length s))) diff --git a/Task/Arbitrary-precision-integers-(included)/D/arbitrary-precision-integers-(included).d b/Task/Arbitrary-precision-integers-(included)/D/arbitrary-precision-integers-(included).d deleted file mode 100644 index 3206a0fc59..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/D/arbitrary-precision-integers-(included).d +++ /dev/null @@ -1,6 +0,0 @@ -import std.stdio, std.bigint, std.conv; - -void main() { - auto s = text(BigInt(5) ^^ 4 ^^ 3 ^^ 2); - writefln("5^4^3^2 = %s..%s (%d digits)", s[0..20], s[$-20..$], s.length); -} diff --git a/Task/Arbitrary-precision-integers-(included)/E/arbitrary-precision-integers-(included).e b/Task/Arbitrary-precision-integers-(included)/E/arbitrary-precision-integers-(included).e deleted file mode 100644 index 45384c7657..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/E/arbitrary-precision-integers-(included).e +++ /dev/null @@ -1,10 +0,0 @@ -? def value := 5**(4**(3**2)); null -? def decimal := value.toString(10); null -? decimal(0, 20) -# value: "62060698786608744707" - -? decimal(decimal.size() - 20) -# value: "92256259918212890625" - -? decimal.size() -# value: 183231 diff --git a/Task/Arbitrary-precision-integers-(included)/Emacs-Lisp/arbitrary-precision-integers-(included).l b/Task/Arbitrary-precision-integers-(included)/Emacs-Lisp/arbitrary-precision-integers-(included).l deleted file mode 100644 index 1d6a049d06..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Emacs-Lisp/arbitrary-precision-integers-(included).l +++ /dev/null @@ -1,9 +0,0 @@ -(let* ((answer (calc-eval "5**4**3**2")) - (length (length answer))) - (message "%s has %d digits" - (if (> length 40) - (format "%s...%s" - (substring answer 0 20) - (substring answer (- length 20) length)) - answer) - length)) diff --git a/Task/Arbitrary-precision-integers-(included)/Erlang/arbitrary-precision-integers-(included).erl b/Task/Arbitrary-precision-integers-(included)/Erlang/arbitrary-precision-integers-(included).erl deleted file mode 100644 index 706332b1bd..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Erlang/arbitrary-precision-integers-(included).erl +++ /dev/null @@ -1,20 +0,0 @@ --module(arbitrary). --compile([export_all]). - -pow(B,E) when E > 0 -> - pow(B,E,1). - -pow(_,0,_) -> 0; -pow(B,1,Acc) -> Acc * B; -pow(B,P,Acc) when P rem 2 == 0 -> - pow(B*B,P div 2, Acc); -pow(B,P,Acc) -> - pow(B,P-1,Acc*B). - -test() -> - I = pow(5,pow(4,pow(3,2))), - [S] = io_lib:format("~b",[I]), - L = length(S), - Prefix = lists:sublist(S,20), - Suffix = lists:sublist(S,L-19,20), - io:format("Length: ~b~nPrefix:~s~nSuffix:~s~n",[L,Prefix,Suffix]). diff --git a/Task/Arbitrary-precision-integers-(included)/Go/arbitrary-precision-integers-(included).go b/Task/Arbitrary-precision-integers-(included)/Go/arbitrary-precision-integers-(included).go deleted file mode 100644 index 91527a94ce..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Go/arbitrary-precision-integers-(included).go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "fmt" - "math/big" -) - -func main() { - answer := big.NewInt(42) - answer.Exp(big.NewInt(5), answer.Exp(big.NewInt(4), - answer.Exp(big.NewInt(3), big.NewInt(2), nil), nil), nil) - answer_string := answer.String() - length := len(answer_string) - fmt.Printf("has %d digits: %s ... %s\n", - length, - answer_string[0:20], - answer_string[length-20:]) -} diff --git a/Task/Arbitrary-precision-integers-(included)/Haskell/arbitrary-precision-integers-(included).hs b/Task/Arbitrary-precision-integers-(included)/Haskell/arbitrary-precision-integers-(included).hs deleted file mode 100644 index e5f6738b4d..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Haskell/arbitrary-precision-integers-(included).hs +++ /dev/null @@ -1,4 +0,0 @@ -main = do - let y = show ( 5^4^3^2 ) - let l = length y - putStrLn ("5**4**3**2 = " ++ take 20 y ++ "..." ++ drop (l-20) y ++ " and has " ++ show l ++ " digits") diff --git a/Task/Arbitrary-precision-integers-(included)/Java/arbitrary-precision-integers-(included).java b/Task/Arbitrary-precision-integers-(included)/Java/arbitrary-precision-integers-(included).java deleted file mode 100644 index 6d9f1d5c70..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Java/arbitrary-precision-integers-(included).java +++ /dev/null @@ -1,11 +0,0 @@ -import java.math.BigInteger; - -class Program { - public static void main(String[] args) { - BigInteger x = BigInteger.valueOf(5).pow(BigInteger.valueOf(4).pow(BigInteger.valueOf(3).pow(2).intValue()).intValue()); - String y = x.toString(); - int l = y.length(); - System.out.printf("5**4**3**2 = %s...%s and has %d digits\n", - y.substring(0,20), y.substring(l-20), l); - } -} diff --git a/Task/Arbitrary-precision-integers-(included)/MATLAB/arbitrary-precision-integers-(included).m b/Task/Arbitrary-precision-integers-(included)/MATLAB/arbitrary-precision-integers-(included).m deleted file mode 100644 index 4dec511994..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/MATLAB/arbitrary-precision-integers-(included).m +++ /dev/null @@ -1,13 +0,0 @@ ->> answer = vpi(5)^(vpi(4)^(vpi(3)^vpi(2))); ->> numDigits = order(answer) + 1 - -numDigits = - - 183231 - ->> [sprintf('%d',leadingdigit(answer,20)) '...' sprintf('%d',trailingdigit(answer,20))] -%First and Last 20 Digits - -ans = - -62060698786608744707...92256259918212890625 diff --git a/Task/Arbitrary-precision-integers-(included)/PHP/arbitrary-precision-integers-(included).php b/Task/Arbitrary-precision-integers-(included)/PHP/arbitrary-precision-integers-(included).php deleted file mode 100644 index 5b9940bd32..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/PHP/arbitrary-precision-integers-(included).php +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-1.pl b/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-1.pl deleted file mode 100644 index 16f8bb144f..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-1.pl +++ /dev/null @@ -1,4 +0,0 @@ -use Math::BigInt; -my $x = Math::BigInt->new('5') ** Math::BigInt->new('4') ** Math::BigInt->new('3') ** Math::BigInt->new('2'); -my $y = "$x"; -printf("5**4**3**2 = %s...%s and has %i digits\n", substr($y,0,20), substr($y,-20), length($y)); diff --git a/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-2.pl b/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-2.pl deleted file mode 100644 index 0ac8cb28d6..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-2.pl +++ /dev/null @@ -1,4 +0,0 @@ -use bigint; -my $x = 5**4**3**2; -my $y = "$x"; -printf("5**4**3**2 = %s...%s and has %i digits\n", substr($y,0,20), substr($y,-20), length($y)); diff --git a/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-3.pl b/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-3.pl deleted file mode 100644 index 2a2c2692b8..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Perl/arbitrary-precision-integers-(included)-3.pl +++ /dev/null @@ -1,3 +0,0 @@ -$ time perl transparent-bigint.pl -5**4**3**2 = 62060698786608744707...92256259918212890625 and has 183231 digits - 1m4.28s real 1m4.30s user 0m0.00s system diff --git a/Task/Arbitrary-precision-integers-(included)/PicoLisp/arbitrary-precision-integers-(included).l b/Task/Arbitrary-precision-integers-(included)/PicoLisp/arbitrary-precision-integers-(included).l deleted file mode 100644 index f8d0095c14..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/PicoLisp/arbitrary-precision-integers-(included).l +++ /dev/null @@ -1,3 +0,0 @@ -(let L (chop (** 5 (** 4 (** 3 2)))) - (prinl (head 20 L) "..." (tail 20 L)) - (length L) ) diff --git a/Task/Arbitrary-precision-integers-(included)/Python/arbitrary-precision-integers-(included).py b/Task/Arbitrary-precision-integers-(included)/Python/arbitrary-precision-integers-(included).py deleted file mode 100644 index 9c73f44c8e..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Python/arbitrary-precision-integers-(included).py +++ /dev/null @@ -1,3 +0,0 @@ ->>> y = str( 5**4**3**2 ) ->>> print ("5**4**3**2 = %s...%s and has %i digits" % (y[:20], y[-20:], len(y))) -5**4**3**2 = 62060698786608744707...92256259918212890625 and has 183231 digits diff --git a/Task/Arbitrary-precision-integers-(included)/R/arbitrary-precision-integers-(included).r b/Task/Arbitrary-precision-integers-(included)/R/arbitrary-precision-integers-(included).r deleted file mode 100644 index 7c3443d92f..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/R/arbitrary-precision-integers-(included).r +++ /dev/null @@ -1,6 +0,0 @@ -library(gmp) -large=pow.bigz(5,pow.bigz(4,pow.bigz(3,2))) -largestr=as.character(large) -cat("first 20 digits:",substr(largestr,1,20),"\n", - "last 20 digits:",substr(largestr,nchar(largestr)-19,nchar(largestr)),"\n", - "number of digits: ",nchar(largestr),"\n") diff --git a/Task/Arbitrary-precision-integers-(included)/REXX/arbitrary-precision-integers-(included)-1.rexx b/Task/Arbitrary-precision-integers-(included)/REXX/arbitrary-precision-integers-(included)-1.rexx deleted file mode 100644 index c708819f2c..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/REXX/arbitrary-precision-integers-(included)-1.rexx +++ /dev/null @@ -1,12 +0,0 @@ -/*REXX program to calculate and demonstrate arbitrary precision numbers.*/ -numeric digits 200000 -check = 62060698786608744707...92256259918212890625 - n = 5 ** (4 ** (3 ** 2)) /*calc. multiple exponentations. */ -sampl = left(n, 20)'...'right(n, 20) -say ' check:' check -say 'sample:' sampl -say 'digits:' length(n) -say -if check==sampl then say 'passed!' - else say 'failed!' - /*stick a fork in it, we're done.*/ diff --git a/Task/Arbitrary-precision-integers-(included)/REXX/arbitrary-precision-integers-(included)-2.rexx b/Task/Arbitrary-precision-integers-(included)/REXX/arbitrary-precision-integers-(included)-2.rexx deleted file mode 100644 index 4753dbe0da..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/REXX/arbitrary-precision-integers-(included)-2.rexx +++ /dev/null @@ -1,21 +0,0 @@ -/*REXX program to calculate and demonstrate arbitrary precision numbers.*/ -numeric digits 5 /*set to low precision for speed.*/ -check = 62060698786608744707...92256259918212890625 - - n=5** (4** (3** 2)) /*calc. multiple exponentations. */ - -parse var n 'E' pow . /*POW might be null, so N is OK.*/ - -if pow\=='' then do /*general case: POW might be < 0*/ - numeric digits abs(pow)+9 /*recalc. with more digits.*/ - n=5** (4** (3** 2)) /*calc. multiple exponentations. */ - end - -sampl = left(n, 20)'...'right(n, 20) -say ' check:' check -say 'sample:' sampl -say 'digits:' length(n) -say -if check==sampl then say 'passed!' - else say 'failed!' - /*stick a fork in it, we're done.*/ diff --git a/Task/Arbitrary-precision-integers-(included)/Racket/arbitrary-precision-integers-(included).rkt b/Task/Arbitrary-precision-integers-(included)/Racket/arbitrary-precision-integers-(included).rkt deleted file mode 100644 index f9150a2615..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Racket/arbitrary-precision-integers-(included).rkt +++ /dev/null @@ -1,9 +0,0 @@ -#lang racket - -(define answer (number->string (foldr expt 1 '(5 4 3 2)))) -(define len (string-length answer)) - -(printf "Got ~a digits~n" len) -(printf "~a ... ~a~n" - (substring answer 0 20) - (substring answer (- len 20) len)) diff --git a/Task/Arbitrary-precision-integers-(included)/Ruby/arbitrary-precision-integers-(included).rb b/Task/Arbitrary-precision-integers-(included)/Ruby/arbitrary-precision-integers-(included).rb deleted file mode 100644 index ff50bf1764..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Ruby/arbitrary-precision-integers-(included).rb +++ /dev/null @@ -1,2 +0,0 @@ -irb(main):001:0> y = ( 5**4**3**2 ).to_s; puts "5**4**3**2 = #{y[0..19]}...#{y[-20..-1]} and has #{y.length} digits" -5**4**3**2 = 62060698786608744707...92256259918212890625 and has 183231 digits diff --git a/Task/Arbitrary-precision-integers-(included)/Sather/arbitrary-precision-integers-(included).sa b/Task/Arbitrary-precision-integers-(included)/Sather/arbitrary-precision-integers-(included).sa deleted file mode 100644 index 9b96acc2ed..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Sather/arbitrary-precision-integers-(included).sa +++ /dev/null @@ -1,22 +0,0 @@ -class MAIN is - main is - r:INTI; - p1 ::= "62060698786608744707"; - p2 ::= "92256259918212890625"; - - -- computing 5^(4^(3^2)), it could be written - -- also e.g. (5.inti)^((4.inti)^((3.inti)^(2.inti))) - r := (3.pow(2)).inti; - r := (4.inti).pow(r); - r := (5.inti).pow(r); - - sr ::= r.str; -- string rappr. of the number - if sr.head(p1.size) = p1 - and sr.tail(p2.size) = p2 then - #OUT + "result is ok..\n"; - else - #OUT + "oops\n"; - end; - #OUT + "# of digits: " + sr.size + "\n"; - end; -end; diff --git a/Task/Arbitrary-precision-integers-(included)/Scala/arbitrary-precision-integers-(included).scala b/Task/Arbitrary-precision-integers-(included)/Scala/arbitrary-precision-integers-(included).scala deleted file mode 100644 index 5c23ab93a4..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Scala/arbitrary-precision-integers-(included).scala +++ /dev/null @@ -1,21 +0,0 @@ -scala> BigInt(5) modPow (BigInt(4) pow (BigInt(3) pow 2).toInt, BigInt(10) pow 20) -res21: scala.math.BigInt = 92256259918212890625 - -scala> (BigInt(5) pow (BigInt(4) pow (BigInt(3) pow 2).toInt).toInt).toString -res22: String = 6206069878660874470748320557284679309194219265199117173177383244 -78446890420544620839553285931321349485035253770303663683982841794590287939217907 -89641300156281305613064874236198955114921296922487632406742326659692228562195387 -46210423235340883954495598715281862895110697243759768434501295076608139350684049 -01191160699929926568099301259938271975526587719565309995276438998093283175080241 -55833224724855977970015112594128926594587205662421861723789001208275184293399910 -13912158886504596553858675842231519094813553261073608575593794241686443569888058 -92732524316323249492420512640962691673104618378381545202638771401061171968052873 -21414945463925055899307933774904078819911387324217976311238875802878310483037255 -33789567769926391314746986316354035923183981697660495275234703657750678459919... -scala> res22 take 20 -res23: String = 62060698786608744707 - -scala> res22 length -res24: Int = 183231 - -scala> diff --git a/Task/Arbitrary-precision-integers-(included)/Scheme/arbitrary-precision-integers-(included).ss b/Task/Arbitrary-precision-integers-(included)/Scheme/arbitrary-precision-integers-(included).ss deleted file mode 100644 index eb4a9716cb..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Scheme/arbitrary-precision-integers-(included).ss +++ /dev/null @@ -1,5 +0,0 @@ -(define x (expt 5 (expt 4 (expt 3 2)))) -(define y (number->string x)) -(define l (string-length y)) -(display (string-append "5**4**3**2 = " (substring y 0 20) "..." (substring y (- l 20) l) " and has " (number->string l) " digits")) -(newline) diff --git a/Task/Arbitrary-precision-integers-(included)/Smalltalk/arbitrary-precision-integers-(included)-1.st b/Task/Arbitrary-precision-integers-(included)/Smalltalk/arbitrary-precision-integers-(included)-1.st deleted file mode 100644 index bc43ca6f12..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Smalltalk/arbitrary-precision-integers-(included)-1.st +++ /dev/null @@ -1,5 +0,0 @@ -|num| -num := (5 raisedTo: (4 raisedTo: (3 raisedTo: 2))) asString. -Transcript - show: (num first: 20), '...', (num last: 20); cr; - show: 'digits: ', num size asString. diff --git a/Task/Arbitrary-precision-integers-(included)/Smalltalk/arbitrary-precision-integers-(included)-2.st b/Task/Arbitrary-precision-integers-(included)/Smalltalk/arbitrary-precision-integers-(included)-2.st deleted file mode 100644 index 0174b99ebf..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Smalltalk/arbitrary-precision-integers-(included)-2.st +++ /dev/null @@ -1,7 +0,0 @@ -|num numstr| -num := (2 to: 5) fold: [:exp :base| base raisedTo: exp]. -numstr := num asString. -'<1s>...<2s> digits:<3p>' - expandMacrosWith: (numstr first: 20) - with: (numstr last: 20) - with: numstr size. diff --git a/Task/Arbitrary-precision-integers-(included)/Tcl/arbitrary-precision-integers-(included).tcl b/Task/Arbitrary-precision-integers-(included)/Tcl/arbitrary-precision-integers-(included).tcl deleted file mode 100644 index 71fdc22752..0000000000 --- a/Task/Arbitrary-precision-integers-(included)/Tcl/arbitrary-precision-integers-(included).tcl +++ /dev/null @@ -1,7 +0,0 @@ -set bigValue [expr {5**4**3**2}] -puts "5**4**3**2 has [string length $bigValue] digits" -if {[string match "62060698786608744707*92256259918212890625" $bigValue]} { - puts "Value starts with 62060698786608744707, ends with 92256259918212890625" -} else { - puts "Value does not match 62060698786608744707...92256259918212890625" -} diff --git a/Task/Arbitrary-precision-integers-included/Golfscript/arbitrary-precision-integers-included.golf b/Task/Arbitrary-precision-integers-included/Golfscript/arbitrary-precision-integers-included.golfscript similarity index 100% rename from Task/Arbitrary-precision-integers-included/Golfscript/arbitrary-precision-integers-included.golf rename to Task/Arbitrary-precision-integers-included/Golfscript/arbitrary-precision-integers-included.golfscript diff --git a/Task/Arbitrary-precision-integers-included/Mathematica/arbitrary-precision-integers-included.mathematica b/Task/Arbitrary-precision-integers-included/Mathematica/arbitrary-precision-integers-included.math similarity index 100% rename from Task/Arbitrary-precision-integers-included/Mathematica/arbitrary-precision-integers-included.mathematica rename to Task/Arbitrary-precision-integers-included/Mathematica/arbitrary-precision-integers-included.math diff --git a/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-1.netrexx b/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-1.netrexx new file mode 100644 index 0000000000..7c17955365 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-1.netrexx @@ -0,0 +1,34 @@ +/* NetRexx */ + +options replace format comments java crossref savelog symbols + +import java.math.BigInteger + +numeric digits 30 -- needed to report the run-time + +nanoFactor = 10 ** 9 + +t1 = System.nanoTime +x = BigInteger.valueOf(5) +x = x.pow(BigInteger.valueOf(4).pow(BigInteger.valueOf(3).pow(2).intValue()).intValue()) +n = Rexx(x.toString) +t2 = System.nanoTime +td = t2 - t1 +say "Run time in seconds:" td / nanoFactor +say + +check = "62060698786608744707...92256259918212890625" +sample = n.left(20)"..."n.right(20) + +say "Expected result:" check +say " Actual result:" sample +say " digits:" n.length +say + +if check = sample +then + say "Result confirmed" +else + say "Result does not satisfy test" + +return diff --git a/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-2.netrexx b/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-2.netrexx new file mode 100644 index 0000000000..a2f70a70c0 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-2.netrexx @@ -0,0 +1,34 @@ +/* NetRexx */ + +options replace format comments java crossref savelog symbols + +import java.math.BigDecimal + +numeric digits 30 -- needed to report the run-time + +nanoFactor = 10 ** 9 + +t1 = System.nanoTime +x = BigDecimal.valueOf(5) +x = x.pow(BigDecimal.valueOf(4).pow(BigDecimal.valueOf(3).pow(2).intValue()).intValue()) +n = Rexx(x.toString) +t2 = System.nanoTime +td = t2 - t1 +say "Run time in seconds:" td / nanoFactor +say + +check = "62060698786608744707...92256259918212890625" +sample = n.left(20)"..."n.right(20) + +say "Expected result:" check +say " Actual result:" sample +say " digits:" n.length +say + +if check = sample +then + say "Result confirmed" +else + say "Result does not satisfy test" + +return diff --git a/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-3.netrexx b/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-3.netrexx new file mode 100644 index 0000000000..b85809e464 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/NetRexx/arbitrary-precision-integers-included-3.netrexx @@ -0,0 +1,30 @@ +/* NetRexx */ + +options replace format comments java crossref savelog symbols + +/* precision must be set manually */ + +numeric digits 190000 + +nanoFactor = 10 ** 9 + +t1 = System.nanoTime +n = 5 ** (4 ** (3 ** 2)) +t2 = System.nanoTime +td = t2 - t1 +say "Run time in seconds:" td / nanoFactor +say + +check = "62060698786608744707...92256259918212890625" +sample = n.left(20)"..."n.right(20) + +say "Expected result:" check +say " Actual result:" sample +say " digits:" n.length +say + +if check = sample +then + say "Result confirmed" +else + say "Result does not satisfy test" diff --git a/Task/Arbitrary-precision-integers-included/OCaml/arbitrary-precision-integers-included-1.ocaml b/Task/Arbitrary-precision-integers-included/OCaml/arbitrary-precision-integers-included-1.ocaml new file mode 100644 index 0000000000..45120a3fe2 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/OCaml/arbitrary-precision-integers-included-1.ocaml @@ -0,0 +1,11 @@ +open Num +open Str +open String + +let () = + let answer = (Int 5) **/ (Int 4) **/ (Int 3) **/ (Int 2) in + let answer_string = string_of_num answer in + Printf.printf "has %d digits: %s ... %s\n" + (length answer_string) + (first_chars answer_string 20) + (last_chars answer_string 20) diff --git a/Task/Arbitrary-precision-integers-included/OCaml/arbitrary-precision-integers-included-2.ocaml b/Task/Arbitrary-precision-integers-included/OCaml/arbitrary-precision-integers-included-2.ocaml new file mode 100644 index 0000000000..464c981d96 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/OCaml/arbitrary-precision-integers-included-2.ocaml @@ -0,0 +1,5 @@ +let () = + let answer = Num.(5**4**3**2) in + let s = Num.(to_string answer) in + Printf.printf "has %d digits: %s ... %s\n" + (String.length s) (Str.first_chars s 20) (Str.last_chars s 20) diff --git a/Task/Arbitrary-precision-integers-included/Oz/arbitrary-precision-integers-included.oz b/Task/Arbitrary-precision-integers-included/Oz/arbitrary-precision-integers-included.oz new file mode 100644 index 0000000000..e2519335d5 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Oz/arbitrary-precision-integers-included.oz @@ -0,0 +1,8 @@ +declare + Pow5432 = {Pow 5 {Pow 4 {Pow 3 2}}} + S = {Int.toString Pow5432} + Len = {Length S} +in + {System.showInfo + {List.take S 20}#"..."# + {List.drop S Len-20}#" ("#Len#" Digits)"} diff --git a/Task/Arbitrary-precision-integers-included/PARI-GP/arbitrary-precision-integers-included.pari b/Task/Arbitrary-precision-integers-included/PARI-GP/arbitrary-precision-integers-included.pari new file mode 100644 index 0000000000..34b40afba0 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/PARI-GP/arbitrary-precision-integers-included.pari @@ -0,0 +1,7 @@ +digits(x)={ + my(s=sizedigit(x)-1); + if(x<10^s,s,s+1) +}; + +N=5^(4^(3^2)); +[precision(N*1.,20), Mod(N,10^20), digits(N)] diff --git a/Task/Arbitrary-precision-integers-included/Pascal/arbitrary-precision-integers-included.pascal b/Task/Arbitrary-precision-integers-included/Pascal/arbitrary-precision-integers-included.pascal new file mode 100644 index 0000000000..5f37d5ef5a --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Pascal/arbitrary-precision-integers-included.pascal @@ -0,0 +1,26 @@ +program GMP_Demo; + +uses + math, gmp; + +var + a: mpz_t; + out: pchar; + len: longint; + i: longint; + +begin + mpz_init_set_ui(a, 5); + mpz_pow_ui(a, a, 4 ** (3 ** 2)); + len := mpz_sizeinbase(a, 10); + writeln('GMP says size is: ', len); + out := mpz_get_str(NIL, 10, a); + writeln('Actual size is: ', length(out)); + write('Digits: '); + for i := 0 to 19 do + write(out[i]); + write ('...'); + for i := len - 20 to len do + write(out[i]); + writeln; +end. diff --git a/Task/Arbitrary-precision-integers-included/Perl-6/arbitrary-precision-integers-included.pl6 b/Task/Arbitrary-precision-integers-included/Perl-6/arbitrary-precision-integers-included.pl6 new file mode 100644 index 0000000000..cd32369c09 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Perl-6/arbitrary-precision-integers-included.pl6 @@ -0,0 +1,3 @@ +given ~[**] 5, 4, 3, 2 { + say "5**4**3**2 = {.substr: 0,20}...{.substr: *-20} and has {.chars} digits"; +} diff --git a/Task/Arbitrary-precision-integers-included/Pike/arbitrary-precision-integers-included.pike b/Task/Arbitrary-precision-integers-included/Pike/arbitrary-precision-integers-included.pike new file mode 100644 index 0000000000..50144942e3 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Pike/arbitrary-precision-integers-included.pike @@ -0,0 +1,7 @@ +> string res = (string)pow(5,pow(4,pow(3,2))); +> res[..19] == "62060698786608744707"; +Result: 1 +> res[<19..] == "92256259918212890625"; +Result: 1 +> sizeof(result); +Result: 183231 diff --git a/Task/Arbitrary-precision-integers-included/PureBasic/arbitrary-precision-integers-included.purebasic b/Task/Arbitrary-precision-integers-included/PureBasic/arbitrary-precision-integers-included.purebasic new file mode 100644 index 0000000000..9cb40b831c --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/PureBasic/arbitrary-precision-integers-included.purebasic @@ -0,0 +1,21 @@ +IncludeFile "Decimal.pbi" + +;- Declare the variables that will be used +Define.Decimal *a +Define n, L$, R$, out$, digits.s + +;- 4^3^2 is withing 32 bit range, so normal procedures can be used +n=Pow(4,Pow(3,2)) + +;- 5^n is larger then 31^2, so the same library call as in the "Long multiplication" task is used +*a=PowerDecimal(IntegerToDecimal(5),IntegerToDecimal(n)) + +;- Convert the large number into a string & present the results +out$=DecimalToString(*a) +L$ = Left(out$,20) +R$ = Right(out$,20) +digits=Str(Len(out$)) +out$="First 20 & last 20 chars of 5^4^3^2 are;"+#CRLF$+L$+#CRLF$+R$+#CRLF$ +out$+"and the result is "+digits+" digits long." + +MessageRequester("Arbitrary-precision integers, PureBasic",out$) diff --git a/Task/Arbitrary-precision-integers-included/Run-BASIC/arbitrary-precision-integers-included.run b/Task/Arbitrary-precision-integers-included/Run-BASIC/arbitrary-precision-integers-included.run new file mode 100644 index 0000000000..fd5569c52c --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Run-BASIC/arbitrary-precision-integers-included.run @@ -0,0 +1,3 @@ +x$ = str$( 5^(4^(3^2))) +print "Length:";len( x$) +print left$( x$, 20); "......"; right$( x$, 20) diff --git a/Task/Arbitrary-precision-integers-included/SIMPOL/arbitrary-precision-integers-included.simpol b/Task/Arbitrary-precision-integers-included/SIMPOL/arbitrary-precision-integers-included.simpol new file mode 100644 index 0000000000..0715bfd075 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/SIMPOL/arbitrary-precision-integers-included.simpol @@ -0,0 +1,21 @@ +constant FIRST20 "62060698786608744707" +constant LAST20 "92256259918212890625" + +function main() + integer i + string s, s2 + + i = .ipower(5, .ipower(4, .ipower(3, 2))) + s2 = .tostr(i, 10) + if .lstr(s2, 20) == FIRST20 and .rstr(s2, 20) == LAST20 + s = "Success! The integer matches both the first 20 and the last 20 digits. There are " + .tostr(.len(s2), 10) + " digits in the result.{d}{a}" + else + s = "" + if .lstr(s2, 20) != FIRST20 + s = "Failure! The first 20 digits are: " + .lstr(s2, 20) + " but they should be: " + FIRST20 + "{d}{a}" + end if + if .rstr(s2, 20) != LAST20 + s = s + "Failure! The first 20 digits are: " + .lstr(s2, 20) + " but they should be: " + LAST20 + "{d}{a}" + end if + end if +end function s diff --git a/Task/Arbitrary-precision-integers-included/Seed7/arbitrary-precision-integers-included.seed7 b/Task/Arbitrary-precision-integers-included/Seed7/arbitrary-precision-integers-included.seed7 new file mode 100644 index 0000000000..435f5063b9 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Seed7/arbitrary-precision-integers-included.seed7 @@ -0,0 +1,12 @@ +$ include "seed7_05.s7i"; + include "bigint.s7i"; + +const proc: main is func + local + var bigInteger: fiveToThePowerOf262144 is 5_ ** 4 ** 3 ** 2; + var string: numberAsString is str(fiveToThePowerOf262144); + begin + writeln("5**4**3**2 = " <& numberAsString[..20] <& + "..." <& numberAsString[length(numberAsString) - 19 ..]); + writeln("decimal digits: " <& length(numberAsString)); + end func; diff --git a/Task/Arbitrary-precision-integers-included/Standard-ML/arbitrary-precision-integers-included.ml b/Task/Arbitrary-precision-integers-included/Standard-ML/arbitrary-precision-integers-included.ml new file mode 100644 index 0000000000..4990d095a6 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Standard-ML/arbitrary-precision-integers-included.ml @@ -0,0 +1,9 @@ +let + val answer = IntInf.pow (5, IntInf.toInt (IntInf.pow (4, IntInf.toInt (IntInf.pow (3, 2))))) + val s = IntInf.toString answer + val len = size s +in + print ("has " ^ Int.toString len ^ " digits: " ^ + substring (s, 0, 20) ^ " ... " ^ + substring (s, len-20, 20) ^ "\n") +end; diff --git a/Task/Arbitrary-precision-integers-included/TXR/arbitrary-precision-integers-included.txr b/Task/Arbitrary-precision-integers-included/TXR/arbitrary-precision-integers-included.txr new file mode 100644 index 0000000000..c9c6a4df26 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/TXR/arbitrary-precision-integers-included.txr @@ -0,0 +1,11 @@ +@(bind (f20 l20 ndig) + @(let* ((num (expt 5 4 3 2)) + (str (format nil "~s" num)) + (len (length str))) + '(,(sub-str str 0 20) ,(sub-str str (- len 20) len) ,len))) +@(bind f20 "62060698786608744707") +@(bind l20 "92256259918212890625") +@(output) +@f20...@l20 +ndigits=@ndig +@(end) diff --git a/Task/Arbitrary-precision-integers-included/Ursala/arbitrary-precision-integers-included.ursala b/Task/Arbitrary-precision-integers-included/Ursala/arbitrary-precision-integers-included.ursala new file mode 100644 index 0000000000..50011201e4 --- /dev/null +++ b/Task/Arbitrary-precision-integers-included/Ursala/arbitrary-precision-integers-included.ursala @@ -0,0 +1,7 @@ +#import std +#import nat +#import bcd + +#show+ + +main = <.@ixtPX take/$20; ^|T/~& '...'--@x,'length: '--@h+ %nP+ length@t>@h %vP power=> <5_,4_,3_,2_> diff --git a/Task/Arena-storage-pool/Mathematica/arena-storage-pool.mathematica b/Task/Arena-storage-pool/Mathematica/arena-storage-pool.math similarity index 100% rename from Task/Arena-storage-pool/Mathematica/arena-storage-pool.mathematica rename to Task/Arena-storage-pool/Mathematica/arena-storage-pool.math diff --git a/Task/Arena-storage-pool/OxygenBasic/arena-storage-pool.oxy b/Task/Arena-storage-pool/OxygenBasic/arena-storage-pool.oxy new file mode 100644 index 0000000000..d7f3d2048a --- /dev/null +++ b/Task/Arena-storage-pool/OxygenBasic/arena-storage-pool.oxy @@ -0,0 +1,31 @@ +'============== +Class ArenaPool +'============== + +string buf +sys pb,ii + +method Setup(sys n) as sys {buf=nuls n : pb=strptr buf : ii=0 : return pb} +method Alloc(sys n) as sys {method=pb+ii : ii+=n} +method Empty() {buf="" : pb=0 : ii=0} + +end class + +macro Create(type,name,qty,pool) + type name[qty] at (pool##.alloc qty * sizeof type) +end macro + +'==== +'DEMO +'==== + +ArenaPool pool : pool.setup 1000 * sizeof int + +Create int,i,100,pool +Create int,j,100,pool + +j[51] <= 1,2,3,4,5 + +print j[51] j[52] j[53] j[54] j[55] 'result 15 + +pool.empty diff --git a/Task/Arena-storage-pool/PARI-GP/arena-storage-pool.pari b/Task/Arena-storage-pool/PARI-GP/arena-storage-pool.pari new file mode 100644 index 0000000000..289365e7ae --- /dev/null +++ b/Task/Arena-storage-pool/PARI-GP/arena-storage-pool.pari @@ -0,0 +1,3 @@ +pari_init(1<<20, 0); // Initialize PARI with a stack size of 1 MB. +GEN four = addii(gen_2, gen_2); // On the stack +GEN persist = gclone(four); // On the heap diff --git a/Task/Arena-storage-pool/Pascal/arena-storage-pool-1.pascal b/Task/Arena-storage-pool/Pascal/arena-storage-pool-1.pascal new file mode 100644 index 0000000000..8cf0e70f94 --- /dev/null +++ b/Task/Arena-storage-pool/Pascal/arena-storage-pool-1.pascal @@ -0,0 +1 @@ +procedure New (var P: Pointer); diff --git a/Task/Arena-storage-pool/Pascal/arena-storage-pool-2.pascal b/Task/Arena-storage-pool/Pascal/arena-storage-pool-2.pascal new file mode 100644 index 0000000000..d923f43451 --- /dev/null +++ b/Task/Arena-storage-pool/Pascal/arena-storage-pool-2.pascal @@ -0,0 +1,33 @@ +Program Example16; +{ Program to demonstrate the Dispose and New functions. } +Type + SS = String[20]; + AnObj = Object + I : integer; + Constructor Init; + Destructor Done; + end; + +Var + P : ^SS; + T : ^AnObj; + +Constructor Anobj.Init; +begin + Writeln ( ' Initializing an instance of AnObj! ' ); +end; + +Destructor AnObj.Done; +begin + Writeln ( ' Destroying an instance of AnObj! ' ) ; +end; + +begin + New ( P ); + P^ := 'Hello, World!'; + Dispose ( P ); +{ P is undefined from here on! } + New ( T, Init ); + T^.i := 0; + Dispose ( T, Done ); +end . diff --git a/Task/Arithmetic-Complex/BASIC/arithmetic-complex.bas b/Task/Arithmetic-Complex/BASIC/arithmetic-complex.basic similarity index 100% rename from Task/Arithmetic-Complex/BASIC/arithmetic-complex.bas rename to Task/Arithmetic-Complex/BASIC/arithmetic-complex.basic diff --git a/Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-1.coffee b/Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-1.coffeescript similarity index 100% rename from Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-1.coffee rename to Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-1.coffeescript diff --git a/Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-2.coffee b/Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-2.coffeescript similarity index 100% rename from Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-2.coffee rename to Task/Arithmetic-Complex/CoffeeScript/arithmetic-complex-2.coffeescript diff --git a/Task/Arithmetic-Complex/Mathematica/arithmetic-complex-1.mathematica b/Task/Arithmetic-Complex/Mathematica/arithmetic-complex-1.math similarity index 100% rename from Task/Arithmetic-Complex/Mathematica/arithmetic-complex-1.mathematica rename to Task/Arithmetic-Complex/Mathematica/arithmetic-complex-1.math diff --git a/Task/Arithmetic-Complex/Mathematica/arithmetic-complex-2.mathematica b/Task/Arithmetic-Complex/Mathematica/arithmetic-complex-2.math similarity index 100% rename from Task/Arithmetic-Complex/Mathematica/arithmetic-complex-2.mathematica rename to Task/Arithmetic-Complex/Mathematica/arithmetic-complex-2.math diff --git a/Task/Arithmetic-Complex/OCaml/arithmetic-complex-1.ocaml b/Task/Arithmetic-Complex/OCaml/arithmetic-complex-1.ocaml new file mode 100644 index 0000000000..be9582e608 --- /dev/null +++ b/Task/Arithmetic-Complex/OCaml/arithmetic-complex-1.ocaml @@ -0,0 +1,13 @@ +open Complex + +let print_complex z = + Printf.printf "%f + %f i\n" z.re z.im + +let () = + let a = { re = 1.0; im = 1.0 } + and b = { re = 3.14159; im = 1.25 } in + print_complex (add a b); + print_complex (mul a b); + print_complex (inv a); + print_complex (neg a); + print_complex (conj a) diff --git a/Task/Arithmetic-Complex/OCaml/arithmetic-complex-2.ocaml b/Task/Arithmetic-Complex/OCaml/arithmetic-complex-2.ocaml new file mode 100644 index 0000000000..01a1895c34 --- /dev/null +++ b/Task/Arithmetic-Complex/OCaml/arithmetic-complex-2.ocaml @@ -0,0 +1,14 @@ +let () = + Complex.( + let print txt z = Printf.printf "%s = %s\n" txt (to_string z) in + let a = 1 + I + and b = 3 + 7I in + print "a + b" (a + b); + print "a - b" (a - b); + print "a * b" (a * b); + print "a / b" (a / b); + print "-a" (- a); + print "conj a" (conj a); + print "a^b" (a**b); + Printf.printf "norm a = %g\n" (float(abs a)); + ) diff --git a/Task/Arithmetic-Complex/Octave/arithmetic-complex.octave b/Task/Arithmetic-Complex/Octave/arithmetic-complex.octave new file mode 100644 index 0000000000..e51483f355 --- /dev/null +++ b/Task/Arithmetic-Complex/Octave/arithmetic-complex.octave @@ -0,0 +1,14 @@ +z1 = 1.5 + 3i; +z2 = 1.5 + 1.5i; +disp(z1 + z2); % 3.0 + 4.5i +disp(z1 - z2); % 0.0 + 1.5i +disp(z1 * z2); % -2.25 + 6.75i +disp(z1 / z2); % 1.5 + 0.5i +disp(-z1); % -1.5 - 3i +disp(z1'); % 1.5 - 3i +disp(abs(z1)); % 3.3541 = sqrt(z1*z1') +disp(z1 ^ z2); % -1.10248 - 0.38306i +disp( exp(z1) ); % -4.43684 + 0.63246i +disp( imag(z1) ); % 3 +disp( real(z2) ); % 1.5 +%... diff --git a/Task/Arithmetic-Complex/OxygenBasic/arithmetic-complex.oxy b/Task/Arithmetic-Complex/OxygenBasic/arithmetic-complex.oxy new file mode 100644 index 0000000000..e77e67bc95 --- /dev/null +++ b/Task/Arithmetic-Complex/OxygenBasic/arithmetic-complex.oxy @@ -0,0 +1,132 @@ +'COMPLEX OPERATIONS +'================= + +type tcomplex double x,y + +class Complex +'============ + + has tcomplex + static sys i,pp + static tcomplex accum[32] + +def operands + tcomplex*a,*b + @a=@accum+i + if pp then + @b=@a+sizeof accum + pp=0 + else + @b=@this + end if +end def + +method "load"() + operands + a.x=b.x + a.y=b.y +end method + +method "push"() + i+=sizeof accum +end method + +method "pop"() + pp=1 + i-=sizeof accum +end method + +method "="() + operands + b.x=a.x + b.y=a.y +end method + +method "+"() + operands + a.x+=b.x + a.y+=b.y +end method + +method "-"() + operands + a.x-=b.x + a.y-=b.y +end method + +method "*"() + operands + double d + d=a.x + a.x = a.x * b.x - a.y * b.y + a.y = a.y * b.x + d * b.y +end method + +method "/"() + operands + double d,v + v=1/(b.x * b.x + b.y * b.y) + d=a.x + a.x = (a.x * b.x + a.y * b.y) * v + a.y = (a.y * b.x - d * b.y) * v +end method + +method power(double n) + operands + 'Using DeMoivre theorem + double r,an,mg + r = hypot(b.x,b.y) + mg = r^n + if b.x=0 then + ay=.5*pi + if b.y<0 then ay=-ay + else + an = atan(b.y,b.x) + end if + an *= n + a.x = mg * cos(an) + a.y = mg * sin(an) +end method + +method show() as string + return str(x,14) ", " str(y,14) +end method + +end class + +'#recordof complexop + +'==== +'TEST +'==== + +complex z1,z2,z3,z4,z5 + +'ENTER VALUES + +z1 <= 0, 0 +z2 <= 2, 1 +z3 <= -2, 1 +z4 <= 2, 4 +z5 <= 1, 1 + +'EVALUATE COMPLEX EXPRESSIONS + +z1 = z2 * z3 +print "Z1 = "+z1.show 'RESULT -5.0, 0 + +z1 = z3+(z2.power(2)) +print "Z1 = "+z1.show 'RESULT 1.0, 5.0 + + +z1 = z5/z4 +print "Z1 = "+z1.show 'RESULT 0.3, 0.1 + +z1 = z5/z1 +print "Z1 = "+z1.show 'RESULT 2.0, 4.0 + +z1 = z2/z4 +print "Z1 = "+z1.show 'RESULT -0.4, -0.3 + +z1 = z1*z4 +print "Z1 = "+z1.show 'RESULT 2.0, 1.0 diff --git a/Task/Arithmetic-Complex/PARI-GP/arithmetic-complex.pari b/Task/Arithmetic-Complex/PARI-GP/arithmetic-complex.pari new file mode 100644 index 0000000000..6a850bf453 --- /dev/null +++ b/Task/Arithmetic-Complex/PARI-GP/arithmetic-complex.pari @@ -0,0 +1,4 @@ +add(a,b)=a+b; +mult(a,b)=a*b; +neg(a)=-a; +inv(a)=1/a; diff --git a/Task/Arithmetic-Complex/PL-I/arithmetic-complex.pli b/Task/Arithmetic-Complex/PL-I/arithmetic-complex.pli new file mode 100644 index 0000000000..571097cd67 --- /dev/null +++ b/Task/Arithmetic-Complex/PL-I/arithmetic-complex.pli @@ -0,0 +1,21 @@ +/* PL/I complex numbers may be integer or floating-point. */ +/* In this example, the variables are floating-pint. */ +/* For integer variables, change 'float' to 'fixed binary' */ + +declare (a, b) complex float; +a = 2+5i; +b = 7-6i; + +put skip list (a+b); +put skip list (a - b); +put skip list (a*b); +put skip list (a/b); +put skip list (a**b); +put skip list (1/a); +put skip list (conjg(a)); /* gives the conjugate of 'a'. */ + +/* Functions exist for extracting the real and imaginary parts */ +/* of a complex number. */ + +/* As well, trigonometric functions may be used with complex */ +/* numbers, such as SIN, COS, TAN, ATAN, and so on. */ diff --git a/Task/Arithmetic-Complex/Pascal/arithmetic-complex-1.pascal b/Task/Arithmetic-Complex/Pascal/arithmetic-complex-1.pascal new file mode 100644 index 0000000000..0391d6ef89 --- /dev/null +++ b/Task/Arithmetic-Complex/Pascal/arithmetic-complex-1.pascal @@ -0,0 +1,68 @@ +program showcomplex(output); + +type + complex = record + re,im: real + end; + +var + z1, z2, zr: complex; + +procedure set(var result: complex; re, im: real); + begin + result.re := re; + result.im := im + end; + +procedure print(a: complex); + begin + write('(', a.re , ',', a.im, ')') + end; + +procedure add(var result: complex; a, b: complex); + begin + result.re := a.re + b.re; + result.im := a.im + b.im; + end; + +procedure neg(var result: complex; a: complex); + begin + result.re := -a.re; + result.im := -a.im + end; + +procedure mult(var result: complex; a, b: complex); + begin + result.re := a.re*b.re - a.im*b.im; + result.im := a.re*b.im + a.im*b.re + end; + +procedure inv(var result: complex; a: complex); + var + anorm: real; + begin + anorm := a.re*a.re + a.im*a.im; + result.re := a.re/anorm; + result.im := -a.im/anorm + end; + +begin + set(z1, 3, 4); + set(z2, 5, 6); + + neg(zr, z1); + print(zr); { prints (-3,-4) } + writeln; + + add(zr, z1, z2); + print(zr); { prints (8,10) } + writeln; + + inv(zr, z1); + print(zr); { prints (0.12,-0.16) } + writeln; + + mul(zr, z1, z2); + print(zr); { prints (-9,38) } + writeln +end. diff --git a/Task/Arithmetic-Complex/Pascal/arithmetic-complex-2.pascal b/Task/Arithmetic-Complex/Pascal/arithmetic-complex-2.pascal new file mode 100644 index 0000000000..8ab1808899 --- /dev/null +++ b/Task/Arithmetic-Complex/Pascal/arithmetic-complex-2.pascal @@ -0,0 +1,28 @@ +Program ComplexDemo; + +uses + ucomplex; + +var + a, b, absum, abprod, aneg, ainv, acong: complex; + +function complex(const re, im: real): ucomplex.complex; overload; + begin + complex.re := re; + complex.im := im; + end; + +begin + a := complex(5, 3); + b := complex(0.5, 6.0); + absum := a + b; + writeln ('(5 + i3) + (0.5 + i6.0): ', absum.re:3:1, ' + i', absum.im:3:1); + abprod := a * b; + writeln ('(5 + i3) * (0.5 + i6.0): ', abprod.re:5:1, ' + i', abprod.im:4:1); + aneg := -a; + writeln ('-(5 + i3): ', aneg.re:3:1, ' + i', aneg.im:3:1); + ainv := 1.0 / a; + writeln ('1/(5 + i3): ', ainv.re:3:1, ' + i', ainv.im:3:1); + acong := cong(a); + writeln ('conj(5 + i3): ', acong.re:3:1, ' + i', acong.im:3:1); +end. diff --git a/Task/Arithmetic-Complex/Perl-6/arithmetic-complex.pl6 b/Task/Arithmetic-Complex/Perl-6/arithmetic-complex.pl6 new file mode 100644 index 0000000000..8e4c6155cc --- /dev/null +++ b/Task/Arithmetic-Complex/Perl-6/arithmetic-complex.pl6 @@ -0,0 +1,5 @@ +my $a = 1 + i; +my $b = pi + 1.25i; + +.say for $a + $b, $a * $b, -$a, 1 / $a, $a.conj; +.say for $a.abs, $a.sqrt, $a.re, $a.im; diff --git a/Task/Arithmetic-Complex/Pop11/arithmetic-complex.pop11 b/Task/Arithmetic-Complex/Pop11/arithmetic-complex.pop11 new file mode 100644 index 0000000000..698b280947 --- /dev/null +++ b/Task/Arithmetic-Complex/Pop11/arithmetic-complex.pop11 @@ -0,0 +1,19 @@ +lvars a = 1.0 +: 1.0, b = 2.0 +: 5.0 ; +a+b => +a*b => +1/a => +a-b => +a-a => +a/b => +a/a => + +;;; The same, but using exact values +1 +: 1 -> a; +2 +: 5 -> b; +a+b => +a*b => +1/a => +a-b => +a-a => +a/b => +a/a => diff --git a/Task/Arithmetic-Complex/PostScript/arithmetic-complex.ps b/Task/Arithmetic-Complex/PostScript/arithmetic-complex.ps new file mode 100644 index 0000000000..dfb918099b --- /dev/null +++ b/Task/Arithmetic-Complex/PostScript/arithmetic-complex.ps @@ -0,0 +1,47 @@ +%Adding two complex numbers +/addcomp{ +/x exch def +/y exch def +/z [0 0] def +z 0 x 0 get y 0 get add put +z 1 x 1 get y 1 get add put +z pstack +}def + +%Subtracting one complex number from another +/subcomp{ +/x exch def +/y exch def +/z [0 0] def +z 0 x 0 get y 0 get sub put +z 1 x 1 get y 1 get sub put +z pstack +}def + +%Multiplying two complex numbers +/mulcomp{ +/x exch def +/y exch def +/z [0 0] def +z 0 x 0 get y 0 get mul x 1 get y 1 get mul sub put +z 1 x 1 get y 0 get mul x 0 get y 1 get mul add put +z pstack +}def + +%Negating a complex number +/negcomp{ +/x exch def +/z [0 0] def +z 0 x 0 get neg put +z 1 x 1 get neg put +z pstack +}def + +%Inverting a complex number +/invcomp{ +/x exch def +/z [0 0] def +z 0 x 0 get x 0 get 2 exp x 1 get 2 exp add div put +z 0 x 1 get neg x 0 get 2 exp x 1 get 2 exp add div put +z pstack +}def diff --git a/Task/Arithmetic-Complex/PureBasic/arithmetic-complex.purebasic b/Task/Arithmetic-Complex/PureBasic/arithmetic-complex.purebasic new file mode 100644 index 0000000000..5bc3b9d3e5 --- /dev/null +++ b/Task/Arithmetic-Complex/PureBasic/arithmetic-complex.purebasic @@ -0,0 +1,65 @@ +Structure Complex + real.d + imag.d +EndStructure + +Procedure Add_Complex(*A.Complex, *B.Complex) + Protected *R.Complex=AllocateMemory(SizeOf(Complex)) + If *R + *R\real=*A\real+*B\real + *R\imag=*A\imag+*B\imag + EndIf + ProcedureReturn *R +EndProcedure + +Procedure Inv_Complex(*A.Complex) + Protected *R.Complex=AllocateMemory(SizeOf(Complex)), denom.d + If *R + denom = *A\real * *A\real + *A\imag * *A\imag + *R\real= *A\real / denom + *R\imag=-*A\imag / denom + EndIf + ProcedureReturn *R +EndProcedure + +Procedure Mul_Complex(*A.Complex, *B.Complex) + Protected *R.Complex=AllocateMemory(SizeOf(Complex)) + If *R + *R\real=*A\real * *B\real - *A\imag * *B\imag + *R\imag=*A\real * *B\imag + *A\imag * *B\real + EndIf + ProcedureReturn *R +EndProcedure + +Procedure Neg_Complex(*A.Complex) + Protected *R.Complex=AllocateMemory(SizeOf(Complex)) + If *R + *R\real=-*A\real + *R\imag=-*A\imag + EndIf + ProcedureReturn *R +EndProcedure + +Procedure ShowAndFree(Header$, *Complex.Complex) + If *Complex + Protected.d i=*Complex\imag, r=*Complex\real + Print(LSet(Header$,7)) + Print("= "+StrD(r,3)) + If i>=0: Print(" + ") + Else: Print(" - ") + EndIf + PrintN(StrD(Abs(i),3)+"i") + FreeMemory(*Complex) + EndIf +EndProcedure + +If OpenConsole() + Define.Complex a, b, *c + a\real=1.0: a\imag=1.0 + b\real=#PI: b\imag=1.2 + *c=Add_Complex(a,b): ShowAndFree("a+b", *c) + *c=Mul_Complex(a,b): ShowAndFree("a*b", *c) + *c=Inv_Complex(a): ShowAndFree("Inv(a)", *c) + *c=Neg_Complex(a): ShowAndFree("-a", *c) + Print(#CRLF$+"Press ENTER to exit"):Input() +EndIf diff --git a/Task/Arithmetic-Complex/RLaB/arithmetic-complex.rlab b/Task/Arithmetic-Complex/RLaB/arithmetic-complex.rlab new file mode 100644 index 0000000000..69152588c8 --- /dev/null +++ b/Task/Arithmetic-Complex/RLaB/arithmetic-complex.rlab @@ -0,0 +1,8 @@ +>> x = sqrt(-1) + 0 + 1i +>> y = 10 + 5i + 10 + 5i +>> z = 5*x-y + -10 + 0i +>> isreal(z) + 1 diff --git a/Task/Arithmetic-Complex/SNOBOL4/arithmetic-complex.sno b/Task/Arithmetic-Complex/SNOBOL4/arithmetic-complex.sno new file mode 100644 index 0000000000..cb2dcafab9 --- /dev/null +++ b/Task/Arithmetic-Complex/SNOBOL4/arithmetic-complex.sno @@ -0,0 +1,40 @@ +* # Define complex datatype + data('complex(r,i)') + +* # Addition + define('addx(x1,x2)a,b,c,d') :(addx_end) +addx a = r(x1); b = i(x1); c = r(x2); d = i(x2) + addx = complex(a + c, b + d) :(return) +addx_end + +* # Multiplication + define('multx(x1,x2)a,b,c,d') :(multx_end) +multx a = r(x1); b = i(x1); c = r(x2); d = i(x2) + multx = complex(a * c - b * d, b * c + a * d) :(return) +multx_end + +* # Negation + define('negx(x)') :(negx_end) +negx negx = complex(-r(x), -i(x)) :(return) +negx_end + +* # Inverse + define('invx(x)d') :(invx_end) +invx d = (r(x) * r(x)) + (i(x) * i(x)) + invx = complex(1.0 * r(x) / d, 1.0 * -i(x) / d) :(return) +invx_end + +* # Print compex number: a+bi / a-bi + define('printx(x)sign') :(printx_end) +printx sign = ge(i(x),0) '+' + printx = r(x) sign i(x) 'i' :(return) +printx_end + +* # Test and display + a = complex(1,1) + b = complex(3.14159, 1.2) + output = printx( addx(a,b) ) + output = printx( multx(a,b) ) + output = printx( negx(a) ) ', ' printx( negx(b) ) + output = printx( invx(a) ) ', ' printx( invx(b) ) +end diff --git a/Task/Arithmetic-Complex/Seed7/arithmetic-complex.seed7 b/Task/Arithmetic-Complex/Seed7/arithmetic-complex.seed7 new file mode 100644 index 0000000000..1b000670f6 --- /dev/null +++ b/Task/Arithmetic-Complex/Seed7/arithmetic-complex.seed7 @@ -0,0 +1,20 @@ +$ include "seed7_05.s7i"; + include "float.s7i"; + include "complex.s7i"; + +const proc: main is func + local + var complex: a is complex(1.0, 1.0); + var complex: b is complex(3.14159, 1.2); + begin + writeln("a=" <& a digits 5); + writeln("b=" <& b digits 5); + # addition + writeln("a+b=" <& a + b digits 5); + # multiplication + writeln("a*b=" <& a * b digits 5); + # inversion + writeln("1/a=" <& complex(1.0) / a digits 5); + # negation + writeln("-a=" <& -a digits 5); + end func; diff --git a/Task/Arithmetic-Complex/Slate/arithmetic-complex.slate b/Task/Arithmetic-Complex/Slate/arithmetic-complex.slate new file mode 100644 index 0000000000..baf0e3de8b --- /dev/null +++ b/Task/Arithmetic-Complex/Slate/arithmetic-complex.slate @@ -0,0 +1,11 @@ +[| a b | + a: 1 + 1 i. + b: Pi + 1.2 i. + print: a + b. + print: a * b. + print: a / b. + print: a reciprocal. + print: a conjugated. + print: a abs. + print: a negated. +]. diff --git a/Task/Arithmetic-Complex/Standard-ML/arithmetic-complex.ml b/Task/Arithmetic-Complex/Standard-ML/arithmetic-complex.ml new file mode 100644 index 0000000000..55b4b3eade --- /dev/null +++ b/Task/Arithmetic-Complex/Standard-ML/arithmetic-complex.ml @@ -0,0 +1,43 @@ +(* Signature for complex numbers *) +signature COMPLEX = sig + type num + + val complex : real * real -> num + + val negative : num -> num + val plus : num -> num -> num + val minus : num -> num -> num + val times : num -> num -> num + val invert : num -> num + val print_number : num -> unit +end; + +(* Actual implementation *) +structure Complex :> COMPLEX = struct + type num = real * real + + fun complex (a, b) = (a, b) + + fun negative (a, b) = (Real.~a, Real.~b) + fun plus (a1, b1) (a2, b2) = (Real.+ (a1, a2), Real.+(b1, b2)) + fun minus i1 i2 = plus i1 (negative i2) + fun times (a1, b1) (a2, b2)= (Real.*(a1, a2) - Real.*(b1, b2), Real.*(a1, b2) + Real.*(a2, b1)) + fun invert (a, b) = + let + val denom = a * a + b * b + in + (a / denom, ~b / denom) + end + + fun print_number (a, b) = + print (Real.toString(a) ^ " + " ^ Real.toString(b) ^ "i\n") +end; + +val i1 = Complex.complex(1.0,2.0); (* 1 + 2i *) +val i2 = Complex.complex(3.0,4.0); (* 3 + 4i *) + +Complex.print_number(Complex.negative(i1)); (* -1 - 2i *) +Complex.print_number(Complex.plus i1 i2); (* 4 + 6i *) +Complex.print_number(Complex.minus i2 i1); (* 2 + 2i *) +Complex.print_number(Complex.times i1 i2); (* -5 + 10i *) +Complex.print_number(Complex.invert i1); (* 1/5 - 2i/5 *) diff --git a/Task/Arithmetic-Complex/Ursala/arithmetic-complex.ursala b/Task/Arithmetic-Complex/Ursala/arithmetic-complex.ursala new file mode 100644 index 0000000000..d712f37063 --- /dev/null +++ b/Task/Arithmetic-Complex/Ursala/arithmetic-complex.ursala @@ -0,0 +1,12 @@ +u = 3.785e+00-1.969e+00i +v = 9.545e-01-3.305e+00j + +#cast %jL + +examples = + +< + complex..add (u,v), + complex..mul (u,v), + complex..sub (0.,u), + complex..div (1.,v)> diff --git a/Task/Arithmetic-Complex/XPL0/arithmetic-complex.xpl0 b/Task/Arithmetic-Complex/XPL0/arithmetic-complex.xpl0 new file mode 100644 index 0000000000..f0a071dc40 --- /dev/null +++ b/Task/Arithmetic-Complex/XPL0/arithmetic-complex.xpl0 @@ -0,0 +1,57 @@ +include c:\cxpl\codes; + +func real CAdd(A, B, C); \Return complex sum of two complex numbers +real A, B, C; +[C(0):= A(0) + B(0); + C(1):= A(1) + B(1); +return C; +]; + +func real CMul(A, B, C); \Return complex product of two complex numbers +real A, B, C; +[C(0):= A(0)*B(0) - A(1)*B(1); + C(1):= A(1)*B(0) + A(0)*B(1); +return C; +]; + +func real CNeg(A, C); \Return negative of a complex number +real A, C; +[C(0):= -A(0); + C(1):= -A(1); +return C; +]; + +func real CInv(A, C); \Return inversion (reciprical) of complex number +real A, C; +real D; +[D:= sq(A(0)) + sq(A(1)); +C(0):= A(0)/D; +C(1):=-A(1)/D; +return C; +]; + +func real Conj(A, C); \Return conjugate of a complex number +real A, C; +[C(0):= A(0); + C(1):=-A(1); +return C; +]; + +proc COut(D, A); \Output a complex number to specified device +int D; real A; +[RlOut(D, A(0)); + Text(D, if A(1)>=0.0 then " +" else " -"); + RlOut(D, abs(A(1))); +ChOut(D, ^i); +]; + +real U, V, W(2); +[Format(2,2); +U:= [1.0, 1.0]; +V:= [3.14, 1.2]; +COut(0, CAdd(U,V,W)); CrLf(0); +COut(0, CMul(U,V,W)); CrLf(0); +COut(0, CNeg(U,W)); CrLf(0); +COut(0, CInv(U,W)); CrLf(0); +COut(0, Conj(U,W)); CrLf(0); +] diff --git a/Task/Arithmetic-Integer/BASIC/arithmetic-integer.bas b/Task/Arithmetic-Integer/BASIC/arithmetic-integer.basic similarity index 100% rename from Task/Arithmetic-Integer/BASIC/arithmetic-integer.bas rename to Task/Arithmetic-Integer/BASIC/arithmetic-integer.basic diff --git a/Task/Arithmetic-Integer/MAXScript/arithmetic-integer.max b/Task/Arithmetic-Integer/MAXScript/arithmetic-integer.maxscript similarity index 100% rename from Task/Arithmetic-Integer/MAXScript/arithmetic-integer.max rename to Task/Arithmetic-Integer/MAXScript/arithmetic-integer.maxscript diff --git a/Task/Arithmetic-Integer/Mathematica/arithmetic-integer.mathematica b/Task/Arithmetic-Integer/Mathematica/arithmetic-integer.math similarity index 100% rename from Task/Arithmetic-Integer/Mathematica/arithmetic-integer.mathematica rename to Task/Arithmetic-Integer/Mathematica/arithmetic-integer.math diff --git a/Task/Arithmetic-Integer/NSIS/arithmetic-integer.nsis b/Task/Arithmetic-Integer/NSIS/arithmetic-integer.nsis new file mode 100644 index 0000000000..2dd70ce306 --- /dev/null +++ b/Task/Arithmetic-Integer/NSIS/arithmetic-integer.nsis @@ -0,0 +1,24 @@ +Function Arithmetic + Push $0 + Push $1 + Push $2 + StrCpy $0 21 + StrCpy $1 -2 + + IntOp $2 $0 + $1 + DetailPrint "$0 + $1 = $2" + IntOp $2 $0 - $1 + DetailPrint "$0 - $1 = $2" + IntOp $2 $0 * $1 + DetailPrint "$0 * $1 = $2" + IntOp $2 $0 / $1 + DetailPrint "$0 / $1 = $2" + DetailPrint "Rounding is toward negative infinity" + IntOp $2 $0 % $1 + DetailPrint "$0 % $1 = $2" + DetailPrint "Sign of remainder matches the first number" + + Pop $2 + Pop $1 + Pop $0 +FunctionEnd diff --git a/Task/Arithmetic-Integer/Nemerle/arithmetic-integer.nemerle b/Task/Arithmetic-Integer/Nemerle/arithmetic-integer.nemerle new file mode 100644 index 0000000000..e8404bda7f --- /dev/null +++ b/Task/Arithmetic-Integer/Nemerle/arithmetic-integer.nemerle @@ -0,0 +1,17 @@ +using System; + +class Program +{ + static Main(args : array[string]) : void + { + def a = Convert.ToInt32(args[0]); + def b = Convert.ToInt32(args[1]); + + Console.WriteLine("{0} + {1} = {2}", a, b, a + b); + Console.WriteLine("{0} - {1} = {2}", a, b, a - b); + Console.WriteLine("{0} * {1} = {2}", a, b, a * b); + Console.WriteLine("{0} / {1} = {2}", a, b, a / b); // truncates towards 0 + Console.WriteLine("{0} % {1} = {2}", a, b, a % b); // matches sign of first operand + Console.WriteLine("{0} ** {1} = {2}", a, b, a ** b); + } +} diff --git a/Task/Arithmetic-Integer/NetRexx/arithmetic-integer.netrexx b/Task/Arithmetic-Integer/NetRexx/arithmetic-integer.netrexx new file mode 100644 index 0000000000..62a72145e2 --- /dev/null +++ b/Task/Arithmetic-Integer/NetRexx/arithmetic-integer.netrexx @@ -0,0 +1,13 @@ +/* NetRexx */ + +options replace format comments java crossref savelog symbols binary + +say "enter 2 integer values separated by blanks" +parse ask a b +say a "+" b "=" a + b +say a "-" b "=" a - b +say a "*" b "=" a * b +say a "/" b "=" a % b "remaining" a // b "(sign from first operand)" +say a "^" b "=" a ** b + +return diff --git a/Task/Arithmetic-Integer/NewLISP/arithmetic-integer.newlisp b/Task/Arithmetic-Integer/NewLISP/arithmetic-integer.newlisp new file mode 100644 index 0000000000..3e12937691 --- /dev/null +++ b/Task/Arithmetic-Integer/NewLISP/arithmetic-integer.newlisp @@ -0,0 +1,24 @@ +; integer.lsp +; oofoe 2012-01-17 + +(define (aski msg) (print msg) (int (read-line))) +(setq x (aski "Please type in an integer and press [enter]: ")) +(setq y (aski "Please type in another integer : ")) + +; Note that +, -, *, / and % are all integer operations. +(println) +(println "Sum: " (+ x y)) +(println "Difference: " (- x y)) +(println "Product: " (* x y)) +(println "Integer quotient (rounds to 0): " (/ x y)) +(println "Remainder: " (setq r (% x y))) + +(println "Remainder sign matches: " + (cond ((= (sgn r) (sgn x) (sgn y)) "both") + ((= (sgn r) (sgn x)) "first") + ((= (sgn r) (sgn y)) "second"))) + +(println) +(println "Exponentiation: " (pow x y)) + +(exit) ; NewLisp normally goes to listener after running script. diff --git a/Task/Arithmetic-Integer/OCaml/arithmetic-integer.ocaml b/Task/Arithmetic-Integer/OCaml/arithmetic-integer.ocaml new file mode 100644 index 0000000000..146a4493e9 --- /dev/null +++ b/Task/Arithmetic-Integer/OCaml/arithmetic-integer.ocaml @@ -0,0 +1,9 @@ +let _ = + let a = read_int () + and b = read_int () in + + Printf.printf "a + b = %d\n" (a + b); + Printf.printf "a - b = %d\n" (a - b); + Printf.printf "a * b = %d\n" (a * b); + Printf.printf "a / b = %d\n" (a / b); (* truncates towards 0 *) + Printf.printf "a mod b = %d\n" (a mod b) (* same sign as first operand *) diff --git a/Task/Arithmetic-Integer/Objeck/arithmetic-integer.objeck b/Task/Arithmetic-Integer/Objeck/arithmetic-integer.objeck new file mode 100644 index 0000000000..ff6f65564f --- /dev/null +++ b/Task/Arithmetic-Integer/Objeck/arithmetic-integer.objeck @@ -0,0 +1,17 @@ +bundle Default { + class Arithmetic { + function : Main(args : System.String[]) ~ Nil { + DoArithmetic(); + } + + function : native : DoArithmetic() ~ Nil { + a := IO.Console->GetInstance()->ReadString()->ToInt(); + b := IO.Console->GetInstance()->ReadString()->ToInt(); + + IO.Console->GetInstance()->Print("a+b = ")->PrintLine(a+b); + IO.Console->GetInstance()->Print("a-b = ")->PrintLine(a-b); + IO.Console->GetInstance()->Print("a*b = ")->PrintLine(a*b); + IO.Console->GetInstance()->Print("a/b = ")->PrintLine(a/b); + } + } +} diff --git a/Task/Arithmetic-Integer/Openscad/arithmetic-integer.scad b/Task/Arithmetic-Integer/Openscad/arithmetic-integer.scad new file mode 100644 index 0000000000..852ed2b171 --- /dev/null +++ b/Task/Arithmetic-Integer/Openscad/arithmetic-integer.scad @@ -0,0 +1,5 @@ +echo (a+b); /* Sum */ +echo (a-b); /* Difference */ +echo (a*b); /* Product */ +echo (a/b); /* Quotient */ +echo (a%b); /* Modulus */ diff --git a/Task/Arithmetic-Integer/Oz/arithmetic-integer.oz b/Task/Arithmetic-Integer/Oz/arithmetic-integer.oz new file mode 100644 index 0000000000..5ae561b712 --- /dev/null +++ b/Task/Arithmetic-Integer/Oz/arithmetic-integer.oz @@ -0,0 +1,19 @@ +declare + StdIn = {New class $ from Open.file Open.text end init(name:stdin)} + + fun {ReadInt} + {String.toInt {StdIn getS($)}} + end + + A = {ReadInt} + B = {ReadInt} +in + {ForAll + ["A+B = "#A+B + "A-B = "#A-B + "A*B = "#A*B + "A/B = "#A div B %% truncates towards 0 + "remainder "#A mod B %% has the same sign as A + "A^B = "#{Pow A B} + ] + System.showInfo} diff --git a/Task/Arithmetic-Integer/PARI-GP/arithmetic-integer.pari b/Task/Arithmetic-Integer/PARI-GP/arithmetic-integer.pari new file mode 100644 index 0000000000..560b81ca7b --- /dev/null +++ b/Task/Arithmetic-Integer/PARI-GP/arithmetic-integer.pari @@ -0,0 +1,8 @@ +arith(a,b)={ + print(a+b); + print(a-b); + print(a*b); + print(a\b); + print(a%b); + print(a^b); +}; diff --git a/Task/Arithmetic-Integer/PL-I/arithmetic-integer.pli b/Task/Arithmetic-Integer/PL-I/arithmetic-integer.pli new file mode 100644 index 0000000000..a16da3f1dd --- /dev/null +++ b/Task/Arithmetic-Integer/PL-I/arithmetic-integer.pli @@ -0,0 +1,7 @@ +get list (a, b); +put skip list (a+b); +put skip list (a-b); +put skip list (a*b); +put skip list (trunc(a/b)); /* truncates towards zero. */ +put skip list (mod(a, b)); /* Remainder is always positive. */ +put skip list (rem(a, b)); /* Sign can be negative. */ diff --git a/Task/Arithmetic-Integer/Pascal/arithmetic-integer.pascal b/Task/Arithmetic-Integer/Pascal/arithmetic-integer.pascal new file mode 100644 index 0000000000..400e4bfae1 --- /dev/null +++ b/Task/Arithmetic-Integer/Pascal/arithmetic-integer.pascal @@ -0,0 +1,12 @@ +program arithmetic(input, output) + +var + a, b: integer; + +begin + readln(a, b); + writeln('a+b = ', a+b); + writeln('a-b = ', a-b); + writeln('a*b = ', a*b); + writeln('a/b = ', a div b, ', remainder ', a mod b); +end. diff --git a/Task/Arithmetic-Integer/Perl-6/arithmetic-integer.pl6 b/Task/Arithmetic-Integer/Perl-6/arithmetic-integer.pl6 new file mode 100644 index 0000000000..b01650c1ef --- /dev/null +++ b/Task/Arithmetic-Integer/Perl-6/arithmetic-integer.pl6 @@ -0,0 +1,9 @@ +my Int $a = floor $*IN.get; +my Int $b = floor $*IN.get; + +say 'sum: ', $a + $b; +say 'difference: ', $a - $b; +say 'product: ', $a * $b; +say 'integer quotient: ', $a div $b; +say 'remainder: ', $a % $b; +say 'exponentiation: ', $a**$b; diff --git a/Task/Arithmetic-Integer/Pop11/arithmetic-integer.pop11 b/Task/Arithmetic-Integer/Pop11/arithmetic-integer.pop11 new file mode 100644 index 0000000000..5bbeb3fa21 --- /dev/null +++ b/Task/Arithmetic-Integer/Pop11/arithmetic-integer.pop11 @@ -0,0 +1,11 @@ +;;; Setup token reader +vars itemrep; +incharitem(charin) -> itemrep; +;;; read the numbers +lvars a = itemrep(), b = itemrep(); +;;; Print results +printf(a + b, 'a + b = %p\n'); +printf(a - b, 'a - b = %p\n'); +printf(a * b, 'a * b = %p\n'); +printf(a div b, 'a div b = %p\n'); +printf(a mod b, 'a mod b = %p\n'); diff --git a/Task/Arithmetic-Integer/PostScript/arithmetic-integer.ps b/Task/Arithmetic-Integer/PostScript/arithmetic-integer.ps new file mode 100644 index 0000000000..81e1adce5b --- /dev/null +++ b/Task/Arithmetic-Integer/PostScript/arithmetic-integer.ps @@ -0,0 +1,10 @@ +/arithInteger { + /x exch def + /y exch def + x y add = + x y sub = + x y mul = + x y idiv = + x y mod = + x y exp = +} def diff --git a/Task/Arithmetic-Integer/PowerShell/arithmetic-integer-1.psh b/Task/Arithmetic-Integer/PowerShell/arithmetic-integer-1.psh new file mode 100644 index 0000000000..b818c6efc6 --- /dev/null +++ b/Task/Arithmetic-Integer/PowerShell/arithmetic-integer-1.psh @@ -0,0 +1,9 @@ +$a = [int] (Read-Host First Number) +$b = [int] (Read-Host Second Number) + +Write-Host "Sum: $($a + $b)" +Write-Host "Difference: $($a - $b)" +Write-Host "Product: $($a * $b)" +Write-Host "Quotient: $($a / $b)" +Write-Host "Quotient, round to even: $([Math]::Round($a / $b))" +Write-Host "Remainder, sign follows first: $($a % $b)" diff --git a/Task/Arithmetic-Integer/PowerShell/arithmetic-integer-2.psh b/Task/Arithmetic-Integer/PowerShell/arithmetic-integer-2.psh new file mode 100644 index 0000000000..a8be0abacc --- /dev/null +++ b/Task/Arithmetic-Integer/PowerShell/arithmetic-integer-2.psh @@ -0,0 +1 @@ +[Math]::Pow($a, $b) diff --git a/Task/Arithmetic-Integer/ProDOS/arithmetic-integer-1.dos b/Task/Arithmetic-Integer/ProDOS/arithmetic-integer-1.dos new file mode 100644 index 0000000000..fff822d53f --- /dev/null +++ b/Task/Arithmetic-Integer/ProDOS/arithmetic-integer-1.dos @@ -0,0 +1,19 @@ +IGNORELINE Note: This example includes the math module. +include arithmeticmodule +:a +editvar /newvar /value=a /title=Enter first integer: +editvar /newvar /value=b /title=Enter second integer: +editvar /newvar /value=c +do add -a-,-b-=-c- +printline -c- +do subtract a,b +printline -c- +do multiply a,b +printline -c- +do divide a,b +printline -c- +do modulus a,b +printline -c- +editvar /newvar /value=d /title=Do you want to calculate more numbers? +if -d- /hasvalue yes goto :a else goto :end +:end diff --git a/Task/Arithmetic-Integer/ProDOS/arithmetic-integer-2.dos b/Task/Arithmetic-Integer/ProDOS/arithmetic-integer-2.dos new file mode 100644 index 0000000000..f5f50f7ab7 --- /dev/null +++ b/Task/Arithmetic-Integer/ProDOS/arithmetic-integer-2.dos @@ -0,0 +1,15 @@ +IGNORELINE Note: This example does not use the math module. +:a +editvar /newvar /value=a /title=Enter first integer: +editvar /newvar /value=b /title=Enter second integer: +editvar /newvar /value=-a-+-b-=-c- +printline -c- +editvar /newvar /value=a*b=c +printline -c- +editvar /newvar /value=a/b=c +printline -c- +editvar /newvar /value=a %% b=c +printline -c- +editvar /newvar /value=d /title=Do you want to calculate more numbers? +if -d- /hasvalue yes goto :a else goto :end +:end diff --git a/Task/Arithmetic-Integer/PureBasic/arithmetic-integer.purebasic b/Task/Arithmetic-Integer/PureBasic/arithmetic-integer.purebasic new file mode 100644 index 0000000000..318770ca47 --- /dev/null +++ b/Task/Arithmetic-Integer/PureBasic/arithmetic-integer.purebasic @@ -0,0 +1,17 @@ +OpenConsole() + +Define a, b + +Print("Number 1: "): a = Val(Input()) +Print("Number 2: "): b = Val(Input()) + +PrintN("Sum: " + Str(a + b)) +PrintN("Difference: " + Str(a - b)) +PrintN("Product: " + Str(a * b)) +PrintN("Quotient: " + Str(a / b)) ; Integer division (rounding mode=truncate) +PrintN("Remainder: " + Str(a % b)) +PrintN("Power: " + Str(Pow(a, b))) + +Input() + +CloseConsole() diff --git a/Task/Arithmetic-Integer/REBOL/arithmetic-integer.rebol b/Task/Arithmetic-Integer/REBOL/arithmetic-integer.rebol new file mode 100644 index 0000000000..7d18c9e6bb --- /dev/null +++ b/Task/Arithmetic-Integer/REBOL/arithmetic-integer.rebol @@ -0,0 +1,53 @@ +REBOL [ + Title: "Integer" + Author: oofoe + Date: 2010-09-29 + URL: http://rosettacode.org/wiki/Arithmetic/Integer +] + +x: to-integer ask "Please type in an integer, and press [enter]: " +y: to-integer ask "Please enter another integer: " +print "" + +print ["Sum:" x + y] +print ["Difference:" x - y] +print ["Product:" x * y] + +print ["Integer quotient (coercion) :" to-integer x / y] +print ["Integer quotient (away from zero) :" round x / y] +print ["Integer quotient (halves round towards even digits) :" round/even x / y] +print ["Integer quotient (halves round towards zero) :" round/half-down x / y] +print ["Integer quotient (round in negative direction) :" round/floor x / y] +print ["Integer quotient (round in positive direction) :" round/ceiling x / y] +print ["Integer quotient (halves round in positive direction):" round/half-ceiling x / y] + +print ["Remainder:" r: x // y] + +; REBOL evaluates infix expressions from left to right. There are no +; precedence rules -- whatever is first gets evaluated. Therefore when +; performing this comparison, I put parens around the first term +; ("sign? a") of the expression so that the value of /a/ isn't +; compared to the sign of /b/. To make up for it, notice that I don't +; have to use a specific return keyword. The final value in the +; function is returned automatically. + +match?: func [a b][(sign? a) = sign? b] + +result: copy [] +if match? r x [append result "first"] +if match? r y [append result "second"] + +; You can evaluate arbitrary expressions in the middle of a print, so +; I use a "switch" to provide a more readable result based on the +; length of the /results/ list. + +print [ + "Remainder sign matches:" + switch length? result [ + 0 ["neither"] + 1 [result/1] + 2 ["both"] + ] +] + +print ["Exponentiation:" x ** y] diff --git a/Task/Arithmetic-Integer/Raven/arithmetic-integer.raven b/Task/Arithmetic-Integer/Raven/arithmetic-integer.raven new file mode 100644 index 0000000000..d833fe3257 --- /dev/null +++ b/Task/Arithmetic-Integer/Raven/arithmetic-integer.raven @@ -0,0 +1,8 @@ +' Number 1: ' print expect 0 prefer as x +' Number 2: ' print expect 0 prefer as y + +x y + " sum: %d\n" print +x y - "difference: %d\n" print +x y * " product: %d\n" print +x y / " quotient: %d\n" print +x y % " remainder: %d\n" print diff --git a/Task/Arithmetic-Integer/Retro/arithmetic-integer.retro b/Task/Arithmetic-Integer/Retro/arithmetic-integer.retro new file mode 100644 index 0000000000..73d78c3282 --- /dev/null +++ b/Task/Arithmetic-Integer/Retro/arithmetic-integer.retro @@ -0,0 +1,8 @@ +: arithmetic ( ab- ) + over "\na = %d" puts + dup "\nb = %d" puts + 2over + "\na + b = %d" puts + 2over - "\na - b = %d" puts + 2over * "\na * b = %d" puts + /mod "\na / b = %d" puts + "\na mod b = %d\n" puts ; diff --git a/Task/Arithmetic-Integer/Run-BASIC/arithmetic-integer.run b/Task/Arithmetic-Integer/Run-BASIC/arithmetic-integer.run new file mode 100644 index 0000000000..11137f00b8 --- /dev/null +++ b/Task/Arithmetic-Integer/Run-BASIC/arithmetic-integer.run @@ -0,0 +1,9 @@ +input "1st integer: "; i1 +input "2nd integer: "; i2 + +print " Sum"; i1 + i2 +print " Diff"; i1 - i2 +print " Product"; i1 * i2 +if i2 <>0 then print " Quotent "; int( i1 / i2); else print "Cannot divide by zero." +print "Remainder"; i1 MOD i2 +print "1st raised to power of 2nd"; i1 ^ i2 diff --git a/Task/Arithmetic-Integer/SNOBOL4/arithmetic-integer.sno b/Task/Arithmetic-Integer/SNOBOL4/arithmetic-integer.sno new file mode 100644 index 0000000000..6b27a57e2a --- /dev/null +++ b/Task/Arithmetic-Integer/SNOBOL4/arithmetic-integer.sno @@ -0,0 +1,10 @@ + output = "Enter first integer:" + first = input + output = "Enter second integer:" + second = input + output = "sum = " first + second + output = "diff = " first - second + output = "prod = " first * second + output = "quot = " (qout = first / second) + output = "rem = " first - (qout * second) +end diff --git a/Task/Arithmetic-Integer/Seed7/arithmetic-integer.seed7 b/Task/Arithmetic-Integer/Seed7/arithmetic-integer.seed7 new file mode 100644 index 0000000000..cdf10d15a6 --- /dev/null +++ b/Task/Arithmetic-Integer/Seed7/arithmetic-integer.seed7 @@ -0,0 +1,20 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: a is 0; + var integer: b is 0; + begin + write("a = "); + readln(a); + write("b = "); + readln(b); + + writeln("a + b = " <& a + b); + writeln("a - b = " <& a - b); + writeln("a * b = " <& a * b); + writeln("a div b = " <& a div b); # Rounds towards zero + writeln("a rem b = " <& a rem b); # Sign of the first operand + writeln("a mdiv b = " <& a mdiv b); # Rounds towards negative infinity + writeln("a mod b = " <& a mod b); # Sign of the second operand + end func; diff --git a/Task/Arithmetic-Integer/Slate/arithmetic-integer.slate b/Task/Arithmetic-Integer/Slate/arithmetic-integer.slate new file mode 100644 index 0000000000..c5def3c463 --- /dev/null +++ b/Task/Arithmetic-Integer/Slate/arithmetic-integer.slate @@ -0,0 +1,9 @@ +[| :a :b | +inform: (a + b) printString. +inform: (a - b) printString. +inform: (a * b) printString. +inform: (a / b) printString. +inform: (a // b) printString. +inform: (a \\ b) printString. + +] applyTo: {Integer readFrom: (query: 'Enter a: '). Integer readFrom: (query: 'Enter b: ')}. diff --git a/Task/Arithmetic-Integer/Standard-ML/arithmetic-integer.ml b/Task/Arithmetic-Integer/Standard-ML/arithmetic-integer.ml new file mode 100644 index 0000000000..f52f77ed1e --- /dev/null +++ b/Task/Arithmetic-Integer/Standard-ML/arithmetic-integer.ml @@ -0,0 +1,13 @@ +val () = let + val a = valOf (Int.fromString (valOf (TextIO.inputLine TextIO.stdIn))) + val b = valOf (Int.fromString (valOf (TextIO.inputLine TextIO.stdIn))) +in + print ("a + b = " ^ Int.toString (a + b) ^ "\n"); + print ("a - b = " ^ Int.toString (a - b) ^ "\n"); + print ("a * b = " ^ Int.toString (a * b) ^ "\n"); + print ("a div b = " ^ Int.toString (a div b) ^ "\n"); (* truncates towards negative infinity *) + print ("a mod b = " ^ Int.toString (a mod b) ^ "\n"); (* same sign as second operand *) + print ("a quot b = " ^ Int.toString (Int.quot (a, b)) ^ "\n");(* truncates towards 0 *) + print ("a rem b = " ^ Int.toString (Int.rem (a, b)) ^ "\n"); (* same sign as first operand *) + print ("~a = " ^ Int.toString (~a) ^ "\n") (* unary negation, unusual notation compared to other languages *) +end diff --git a/Task/Arithmetic-Integer/TI-83-BASIC/arithmetic-integer.ti-83 b/Task/Arithmetic-Integer/TI-83-BASIC/arithmetic-integer.ti-83 new file mode 100644 index 0000000000..5a0a0a9640 --- /dev/null +++ b/Task/Arithmetic-Integer/TI-83-BASIC/arithmetic-integer.ti-83 @@ -0,0 +1,11 @@ +Prompt A,B +Disp "SUM" +Pause A+B +Disp "DIFFERENCE" +Pause A-B +Disp "PRODUCT" +Pause AB +Disp "INTEGER QUOTIENT" +Pause int(A/B) +Disp "REMAINDER" +Pause A-B*int(A/B) diff --git a/Task/Arithmetic-Integer/TI-89-BASIC/arithmetic-integer.ti-89 b/Task/Arithmetic-Integer/TI-89-BASIC/arithmetic-integer.ti-89 new file mode 100644 index 0000000000..f7519d0e27 --- /dev/null +++ b/Task/Arithmetic-Integer/TI-89-BASIC/arithmetic-integer.ti-89 @@ -0,0 +1,7 @@ +Local a, b +Prompt a, b +Disp "Sum: " & string(a + b) +Disp "Difference: " & string(a - b) +Disp "Product: " & string(a * b) +Disp "Integer quotient: " & string(intDiv(a, b)) +Disp "Remainder: " & string(remain(a, b)) diff --git a/Task/Arithmetic-Integer/TUSCRIPT/arithmetic-integer.tuscript b/Task/Arithmetic-Integer/TUSCRIPT/arithmetic-integer.tuscript new file mode 100644 index 0000000000..a456999549 --- /dev/null +++ b/Task/Arithmetic-Integer/TUSCRIPT/arithmetic-integer.tuscript @@ -0,0 +1,8 @@ +$$ MODE TUSCRIPT +a=5 +b=3 +c=a+b +c=a-b +c=a*b +c=a/b +c=a%b diff --git a/Task/Arithmetic-Integer/Toka/arithmetic-integer.toka b/Task/Arithmetic-Integer/Toka/arithmetic-integer.toka new file mode 100644 index 0000000000..0aa1514d3c --- /dev/null +++ b/Task/Arithmetic-Integer/Toka/arithmetic-integer.toka @@ -0,0 +1,6 @@ +[ ( a b -- ) + 2dup ." a+b = " + . cr + 2dup ." a-b = " - . cr + 2dup ." a*b = " * . cr + 2dup ." a/b = " / . ." remainder " mod . cr +] is mathops diff --git a/Task/Arithmetic-Integer/UNIX-Shell/arithmetic-integer-1.sh b/Task/Arithmetic-Integer/UNIX-Shell/arithmetic-integer-1.sh new file mode 100644 index 0000000000..b04104f832 --- /dev/null +++ b/Task/Arithmetic-Integer/UNIX-Shell/arithmetic-integer-1.sh @@ -0,0 +1,7 @@ +#!/bin/sh +read a; read b; +echo "a+b = " `expr $a + $b` +echo "a-b = " `expr $a - $b` +echo "a*b = " `expr $a \* $b` +echo "a/b = " `expr $a / $b` # truncates towards 0 +echo "a mod b = " `expr $a % $b` # same sign as first operand diff --git a/Task/Arithmetic-Integer/UNIX-Shell/arithmetic-integer-2.sh b/Task/Arithmetic-Integer/UNIX-Shell/arithmetic-integer-2.sh new file mode 100644 index 0000000000..9e9e0746fe --- /dev/null +++ b/Task/Arithmetic-Integer/UNIX-Shell/arithmetic-integer-2.sh @@ -0,0 +1,7 @@ +#!/bin/sh +read a; read b; +echo "a+b = $((a+b))" +echo "a-b = $((a-b))" +echo "a*b = $((a*b))" +echo "a/b = $((a/b))" # truncates towards 0 +echo "a mod b = $((a%b))" # same sign as first operand diff --git a/Task/Arithmetic-Integer/VBScript/arithmetic-integer-1.vbscript b/Task/Arithmetic-Integer/VBScript/arithmetic-integer-1.vbscript new file mode 100644 index 0000000000..c1e33618a9 --- /dev/null +++ b/Task/Arithmetic-Integer/VBScript/arithmetic-integer-1.vbscript @@ -0,0 +1,17 @@ +option explicit +dim a, b +wscript.stdout.write "A? " +a = wscript.stdin.readline +wscript.stdout.write "B? " +b = wscript.stdin.readline + +a = int( a ) +b = int( b ) + +wscript.echo "a + b=", a + b +wscript.echo "a - b=", a - b +wscript.echo "a * b=", a * b +wscript.echo "a / b=", a / b +wscript.echo "a \ b=", a \ b +wscript.echo "a mod b=", a mod b +wscript.echo "a ^ b=", a ^ b diff --git a/Task/Arithmetic-Integer/VBScript/arithmetic-integer-2.vbscript b/Task/Arithmetic-Integer/VBScript/arithmetic-integer-2.vbscript new file mode 100644 index 0000000000..b63e309e2a --- /dev/null +++ b/Task/Arithmetic-Integer/VBScript/arithmetic-integer-2.vbscript @@ -0,0 +1,14 @@ +option explicit +dim a, b +wscript.stdout.write "A? " +a = wscript.stdin.readline +wscript.stdout.write "B? " +b = wscript.stdin.readline + +a = int( a ) +b = int( b ) + +dim op +for each op in split("+ - * / \ mod ^", " ") + wscript.echo "a",op,"b=",eval( "a " & op & " b") +next diff --git a/Task/Arithmetic-Integer/Vedit-macro-language/arithmetic-integer.vedit b/Task/Arithmetic-Integer/Vedit-macro-language/arithmetic-integer.vedit new file mode 100644 index 0000000000..224f0e64c4 --- /dev/null +++ b/Task/Arithmetic-Integer/Vedit-macro-language/arithmetic-integer.vedit @@ -0,0 +1,7 @@ +#1 = Get_Num("Give number a: ") +#2 = Get_Num("Give number b: ") +Message("a + b = ") Num_Type(#1 + #2) +Message("a - b = ") Num_Type(#1 - #2) +Message("a * b = ") Num_Type(#1 * #2) +Message("a / b = ") Num_Type(#1 / #2) +Message("a % b = ") Num_Type(#1 % #2) diff --git a/Task/Arithmetic-Integer/Visual-Basic-.NET/arithmetic-integer.visual b/Task/Arithmetic-Integer/Visual-Basic-.NET/arithmetic-integer.visual new file mode 100644 index 0000000000..f61301ef26 --- /dev/null +++ b/Task/Arithmetic-Integer/Visual-Basic-.NET/arithmetic-integer.visual @@ -0,0 +1,14 @@ +Imports System.Console +Module Module1 + Sub Main + Dim a = CInt(ReadLine) + Dim b = CInt(ReadLine) + WriteLine("Sum " & a + b) + WriteLine("Difference " & a - b) + WriteLine("Product " & a - b) + WriteLine("Quotient " & a / b) + WriteLine("Integer Quotient " & a \ b) + WriteLine("Remainder " & a Mod b) + WriteLine("Exponent " & a ^ b) + End Sub +End Module diff --git a/Task/Arithmetic-Integer/XPL0/arithmetic-integer.xpl0 b/Task/Arithmetic-Integer/XPL0/arithmetic-integer.xpl0 new file mode 100644 index 0000000000..b82cf9929e --- /dev/null +++ b/Task/Arithmetic-Integer/XPL0/arithmetic-integer.xpl0 @@ -0,0 +1,10 @@ +include c:\cxpl\codes; +int A, B; +[A:= IntIn(0); + B:= IntIn(0); +IntOut(0, A+B); CrLf(0); +IntOut(0, A-B); CrLf(0); +IntOut(0, A*B); CrLf(0); +IntOut(0, A/B); CrLf(0); \truncates toward zero +IntOut(0, rem(0)); CrLf(0); \remainder's sign matches first operand (A) +] diff --git a/Task/Arithmetic-Integer/XSLT/arithmetic-integer.xslt b/Task/Arithmetic-Integer/XSLT/arithmetic-integer.xslt new file mode 100644 index 0000000000..efdfbb2fda --- /dev/null +++ b/Task/Arithmetic-Integer/XSLT/arithmetic-integer.xslt @@ -0,0 +1,9 @@ + + 5 + 2 + a + b = + a - b = + a * b = + a / b = + a mod b = + diff --git a/Task/Arithmetic-Integer/Yorick/arithmetic-integer.yorick b/Task/Arithmetic-Integer/Yorick/arithmetic-integer.yorick new file mode 100644 index 0000000000..8b57e89c3b --- /dev/null +++ b/Task/Arithmetic-Integer/Yorick/arithmetic-integer.yorick @@ -0,0 +1,8 @@ +x = y = 0; +read, x, y; +write, "x + y =", x + y; +write, "x - y =", x - y; +write, "x * y =", x * y; +write, "x / y =", x / y; // rounds toward zero +write, "x % y =", x % y; // remainder; matches sign of first operand when operands' signs differ +write, "x ^ y =", x ^ y; // exponentiation diff --git a/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-1.mathematica b/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-1.math similarity index 100% rename from Task/Arithmetic-Rational/Mathematica/arithmetic-rational-1.mathematica rename to Task/Arithmetic-Rational/Mathematica/arithmetic-rational-1.math diff --git a/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-2.mathematica b/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-2.math similarity index 100% rename from Task/Arithmetic-Rational/Mathematica/arithmetic-rational-2.mathematica rename to Task/Arithmetic-Rational/Mathematica/arithmetic-rational-2.math diff --git a/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-3.mathematica b/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-3.math similarity index 100% rename from Task/Arithmetic-Rational/Mathematica/arithmetic-rational-3.mathematica rename to Task/Arithmetic-Rational/Mathematica/arithmetic-rational-3.math diff --git a/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-4.mathematica b/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-4.math similarity index 100% rename from Task/Arithmetic-Rational/Mathematica/arithmetic-rational-4.mathematica rename to Task/Arithmetic-Rational/Mathematica/arithmetic-rational-4.math diff --git a/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-5.mathematica b/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-5.math similarity index 100% rename from Task/Arithmetic-Rational/Mathematica/arithmetic-rational-5.mathematica rename to Task/Arithmetic-Rational/Mathematica/arithmetic-rational-5.math diff --git a/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-6.mathematica b/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-6.math similarity index 100% rename from Task/Arithmetic-Rational/Mathematica/arithmetic-rational-6.mathematica rename to Task/Arithmetic-Rational/Mathematica/arithmetic-rational-6.math diff --git a/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-7.mathematica b/Task/Arithmetic-Rational/Mathematica/arithmetic-rational-7.math similarity index 100% rename from Task/Arithmetic-Rational/Mathematica/arithmetic-rational-7.mathematica rename to Task/Arithmetic-Rational/Mathematica/arithmetic-rational-7.math diff --git a/Task/Arithmetic-Rational/OCaml/arithmetic-rational-1.ocaml b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-1.ocaml new file mode 100644 index 0000000000..097a7ca9c1 --- /dev/null +++ b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-1.ocaml @@ -0,0 +1,14 @@ +#load "nums.cma";; +open Num;; + +for candidate = 2 to 1 lsl 19 do + let sum = ref (num_of_int 1 // num_of_int candidate) in + for factor = 2 to truncate (sqrt (float candidate)) do + if candidate mod factor = 0 then + sum := !sum +/ num_of_int 1 // num_of_int factor + +/ num_of_int 1 // num_of_int (candidate / factor) + done; + if is_integer_num !sum then + Printf.printf "Sum of recipr. factors of %d = %d exactly %s\n%!" + candidate (int_of_num !sum) (if int_of_num !sum = 1 then "perfect!" else "") +done;; diff --git a/Task/Arithmetic-Rational/OCaml/arithmetic-rational-2.ocaml b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-2.ocaml new file mode 100644 index 0000000000..778970fee3 --- /dev/null +++ b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-2.ocaml @@ -0,0 +1,11 @@ +let () = + for candidate = 2 to 1 lsl 19 do + let sum = ref Num.(1 / of_int candidate) in + for factor = 2 to truncate (sqrt (float candidate)) do + if candidate mod factor = 0 then + sum := Num.(!sum + 1 / of_int factor + of_int factor / of_int candidate) + done; + if Num.is_integer_num !sum then + Printf.printf "Sum of recipr. factors of %d = %d exactly %s\n%!" + candidate Num.(to_int !sum) (if Num.(!sum = 1) then "perfect!" else "") + done diff --git a/Task/Arithmetic-Rational/PARI-GP/arithmetic-rational.pari b/Task/Arithmetic-Rational/PARI-GP/arithmetic-rational.pari new file mode 100644 index 0000000000..0a2d1b4ca0 --- /dev/null +++ b/Task/Arithmetic-Rational/PARI-GP/arithmetic-rational.pari @@ -0,0 +1,5 @@ +for(n=2,1<<19, + s=0; + fordiv(n,d,s+=1/d); + if(s==2,print(n)) +) diff --git a/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-1.pl6 b/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-1.pl6 new file mode 100644 index 0000000000..de7b6ee512 --- /dev/null +++ b/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-1.pl6 @@ -0,0 +1,11 @@ +for 2..2**19 -> $candidate { + my $sum = 1 / $candidate; + for 2 .. ceiling(sqrt($candidate)) -> $factor { + if $candidate %% $factor { + $sum += 1 / $factor + 1 / ($candidate / $factor); + } + } + if $sum.denominator == 1 { + say "Sum of reciprocal factors of $candidate = $sum exactly", ($sum == 1 ?? ", perfect!" !! "."); + } +} diff --git a/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-2.pl6 b/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-2.pl6 new file mode 100644 index 0000000000..52cbd4b6da --- /dev/null +++ b/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-2.pl6 @@ -0,0 +1 @@ +for 1.0, 1.1, 1.2 ... 10 { .say } diff --git a/Task/Arithmetic-Rational/Slate/arithmetic-rational.slate b/Task/Arithmetic-Rational/Slate/arithmetic-rational.slate new file mode 100644 index 0000000000..c0e3a25c7f --- /dev/null +++ b/Task/Arithmetic-Rational/Slate/arithmetic-rational.slate @@ -0,0 +1,4 @@ +54 / 7. +20 reciprocal. +(5 / 6) reciprocal. +(5 / 6) as: Float. diff --git a/Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-1.mathematica b/Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-1.math similarity index 100% rename from Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-1.mathematica rename to Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-1.math diff --git a/Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-2.mathematica b/Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-2.math similarity index 100% rename from Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-2.mathematica rename to Task/Arithmetic-evaluation/Mathematica/arithmetic-evaluation-2.math diff --git a/Task/Arithmetic-evaluation/OCaml/arithmetic-evaluation-1.ocaml b/Task/Arithmetic-evaluation/OCaml/arithmetic-evaluation-1.ocaml new file mode 100644 index 0000000000..ffff7dbe7a --- /dev/null +++ b/Task/Arithmetic-evaluation/OCaml/arithmetic-evaluation-1.ocaml @@ -0,0 +1,39 @@ +type expression = + | Const of float + | Sum of expression * expression (* e1 + e2 *) + | Diff of expression * expression (* e1 - e2 *) + | Prod of expression * expression (* e1 * e2 *) + | Quot of expression * expression (* e1 / e2 *) + +let rec eval = function + | Const c -> c + | Sum (f, g) -> eval f +. eval g + | Diff(f, g) -> eval f -. eval g + | Prod(f, g) -> eval f *. eval g + | Quot(f, g) -> eval f /. eval g + +open Genlex + +let lexer = make_lexer ["("; ")"; "+"; "-"; "*"; "/"] + +let rec parse_expr = parser + [< e1 = parse_mult; e = parse_more_adds e1 >] -> e + and parse_more_adds e1 = parser + [< 'Kwd "+"; e2 = parse_mult; e = parse_more_adds (Sum(e1, e2)) >] -> e + | [< 'Kwd "-"; e2 = parse_mult; e = parse_more_adds (Diff(e1, e2)) >] -> e + | [< >] -> e1 + and parse_mult = parser + [< e1 = parse_simple; e = parse_more_mults e1 >] -> e + and parse_more_mults e1 = parser + [< 'Kwd "*"; e2 = parse_simple; e = parse_more_mults (Prod(e1, e2)) >] -> e + | [< 'Kwd "/"; e2 = parse_simple; e = parse_more_mults (Quot(e1, e2)) >] -> e + | [< >] -> e1 + and parse_simple = parser + | [< 'Int i >] -> Const(float i) + | [< 'Float f >] -> Const f + | [< 'Kwd "("; e = parse_expr; 'Kwd ")" >] -> e + + +let parse_expression = parser [< e = parse_expr; _ = Stream.empty >] -> e + +let read_expression s = parse_expression(lexer(Stream.of_string s)) diff --git a/Task/Arithmetic-evaluation/OCaml/arithmetic-evaluation-2.ocaml b/Task/Arithmetic-evaluation/OCaml/arithmetic-evaluation-2.ocaml new file mode 100644 index 0000000000..372ef0e5da --- /dev/null +++ b/Task/Arithmetic-evaluation/OCaml/arithmetic-evaluation-2.ocaml @@ -0,0 +1,9 @@ +let () = + while true do + print_string "Expression: "; + let str = read_line() in + if str = "q" then exit 0; + let expr = read_expression str in + let res = eval expr in + Printf.printf " = %g\n%!" res; + done diff --git a/Task/Arithmetic-evaluation/Oz/arithmetic-evaluation.oz b/Task/Arithmetic-evaluation/Oz/arithmetic-evaluation.oz new file mode 100644 index 0000000000..0c27f5b27e --- /dev/null +++ b/Task/Arithmetic-evaluation/Oz/arithmetic-evaluation.oz @@ -0,0 +1,88 @@ +declare + + fun {Expr X0 ?X} + choice + [L _ R] = {Do [Term &+ Expr] X0 ?X} in add(L R) + [] [L _ R] = {Do [Term &- Expr] X0 ?X} in sub(L R) + [] {Term X0 X} + end + end + + fun {Term X0 ?X} + choice + [L _ R] = {Do [Factor &* Term] X0 ?X} in mul(L R) + [] [L _ R] = {Do [Factor &/ Term] X0 ?X} in 'div'(L R) + [] {Factor X0 X} + end + end + + fun {Factor X0 ?X} + choice {Parens Expr X0 X} + [] {Number X0 X} + end + end + + fun {Number X0 X} + Ds = {Many1 Digit X0 X} + in + num(Ds) + end + + fun {Digit X0 ?X} + D|!X = X0 + in + D = choice &0 [] &1 [] &2 [] &3 [] &4 [] &5 [] &6 [] &7 [] &8 [] &9 end + end + + fun {Many1 Rule X0 ?X} + choice [{Rule X0 X}] + [] X1 in {Rule X0 X1}|{Many1 Rule X1 X} + end + end + + fun {Parens Rule X0 ?X} + [_ R _] = {Do [&( Rule &)] X0 X} + in + R + end + + fun {Do Rules X0 ?X} + Res#Xn = {FoldL Rules + fun {$ Res#Xi Rule} + if {Char.is Rule} then + !Rule|X2 = Xi + in + (Rule|Res) # X2 + elseif {Procedure.is Rule} then + X2 in + ({Rule Xi X2}|Res) # X2 + end + end + nil#X0} + in + X = Xn + {Reverse Res} + end + + %% Returns a singleton list if an AST was found or nil otherwise. + fun {Parse S} + {SearchOne fun {$} {Expr S nil} end} + end + + fun {Eval X} + case X of + num(Ds) then {String.toInt Ds} + [] add(L R) then {Eval L} + {Eval R} + [] sub(L R) then {Eval L} - {Eval R} + [] mul(L R) then {Eval L} * {Eval R} + [] 'div'(L R) then {Eval L} div {Eval R} + end + end + + [AST] = {Parse "((11+15)*15)*2-(3)*4*1"} + +in + + {Inspector.configure widgetShowStrings true} + {Inspect AST} + {Inspect {Eval AST}} diff --git a/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-1.pl6 b/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-1.pl6 new file mode 100644 index 0000000000..8671ee7321 --- /dev/null +++ b/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-1.pl6 @@ -0,0 +1,37 @@ +sub ev (Str $s --> Num) { + + grammar expr { + token TOP { ^ $ } + token sum { (('+' || '-') )* } + token product { (('*' || '/') )* } + token factor { ? [ || ] } + token unary_minus { '-' } + token parens { '(' ')' } + token literal { \d+ ['.' \d+]? || '.' \d+ } + } + + my sub minus ($b) { $b ?? -1 !! +1 } + + my sub sum ($x) { + [+] product($x), map + { minus($^y[0] eq '-') * product $^y }, + |($x[0] or []) + } + + my sub product ($x) { + [*] factor($x), map + { factor($^y) ** minus($^y[0] eq '/') }, + |($x[0] or []) + } + + my sub factor ($x) { + minus($x) * ($x + ?? sum $x + !! $x) + } + + expr.parse([~] split /\s+/, $s); + $/ or fail 'No parse.'; + sum $/; + +} diff --git a/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-2.pl6 b/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-2.pl6 new file mode 100644 index 0000000000..f9e7c84934 --- /dev/null +++ b/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-2.pl6 @@ -0,0 +1,4 @@ +say ev '5'; # 5 +say ev '1 + 2 - 3 * 4 / 5'; # 0.6 +say ev '1 + 5*3.4 - .5 -4 / -2 * (3+4) -6'; # 25.5 +say ev '((11+15)*15)* 2 + (3) * -4 *1'; # 768 diff --git a/Task/Arithmetic-evaluation/Pop11/arithmetic-evaluation.pop11 b/Task/Arithmetic-evaluation/Pop11/arithmetic-evaluation.pop11 new file mode 100644 index 0000000000..f95f7aa26f --- /dev/null +++ b/Task/Arithmetic-evaluation/Pop11/arithmetic-evaluation.pop11 @@ -0,0 +1,149 @@ +/* Scanner routines */ +/* Uncomment the following to parse data from standard input + +vars itemrep; +incharitem(charin) -> itemrep; + +*/ + +;;; Current symbol +vars sym; + +define get_sym(); + itemrep() -> sym; +enddefine; + +define expect(x); + lvars x; + if x /= sym then + printf(x, 'Error, expected %p\n'); + mishap(sym, 1, 'Example parser error'); + endif; + get_sym(); +enddefine; + +lconstant res_list = [( ) + * ]; + +lconstant reserved = newproperty( + maplist(res_list, procedure(x); [^x ^(true)]; endprocedure), + 20, false, "perm"); + +/* + Parser for arithmetic expressions +*/ +/* +expr: term + | expr "+" term + | expr "-" term + ; +*/ + +define do_expr() -> result; + lvars result = do_term(), op; + while sym = "+" or sym = "-" do + sym -> op; + get_sym(); + [^op ^result ^(do_term())] -> result; + endwhile; +enddefine; + +/* +term: factor + | term "*" factor + | term "/" factor + ; +*/ + +define do_term() -> result; + lvars result = do_factor(), op; + while sym = "*" or sym = "/" do + sym -> op; + get_sym(); + [^op ^result ^(do_factor())] -> result; + endwhile; +enddefine; + +/* +factor: word + | constant + | "(" expr ")" + ; +*/ + +define do_factor() -> result; + if sym = "(" then + get_sym(); + do_expr() -> result; + expect(")"); + elseif isinteger(sym) or isbiginteger(sym) then + sym -> result; + get_sym(); + else + if reserved(sym) then + printf(sym, 'unexpected symbol %p\n'); + mishap(sym, 1, 'Example parser syntax error'); + endif; + sym -> result; + get_sym(); + endif; +enddefine; + +/* Expression evaluator, returns false on error (currently only + division by 0 */ + +define arith_eval(expr); + lvars op, arg1, arg2; + if not(expr) then + return(expr); + endif; + if isinteger(expr) or isbiginteger(expr) then + return(expr); + endif; + expr(1) -> op; + arith_eval(expr(2)) -> arg1; + arith_eval(expr(3)) -> arg2; + if not(arg1) or not(arg2) then + return(false); + endif; + if op = "+" then + return(arg1 + arg2); + elseif op = "-" then + return(arg1 - arg2); + elseif op = "*" then + return(arg1 * arg2); + elseif op = "/" then + if arg2 = 0 then + return(false); + else + return(arg1 div arg2); + endif; + else + printf('Internal error\n'); + return(false); + endif; +enddefine; + +/* Given list, create item repeater. Input list is stored in a + closure are traversed when new item is requested. */ + +define listitemrep(lst); + procedure(); + lvars item; + if lst = [] then + termin; + else + front(lst) -> item; + back(lst) -> lst; + item; + endif; + endprocedure; +enddefine; + +/* Initialise scanner */ + +listitemrep([(3 + 50) * 7 - 100 / 10]) -> itemrep; + +get_sym(); + +;;; Test it +arith_eval(do_expr()) => diff --git a/Task/Arithmetic-evaluation/TXR/arithmetic-evaluation.txr b/Task/Arithmetic-evaluation/TXR/arithmetic-evaluation.txr new file mode 100644 index 0000000000..9bb6455f2d --- /dev/null +++ b/Task/Arithmetic-evaluation/TXR/arithmetic-evaluation.txr @@ -0,0 +1,53 @@ +@(next :args) +@(define space)@/ */@(end) +@(define mulop (nod))@\ + @(local op)@\ + @(space)@\ + @(cases)@\ + @{op /[*]/}@(bind nod @(intern op *user-package*))@\ + @(or)@\ + @{op /\//}@(bind (nod) @(list 'trunc))@\ + @(end)@\ + @(space)@\ +@(end) +@(define addop (nod))@\ + @(local op)@(space)@{op /[+\-]/}@(space)@\ + @(bind nod @(intern op *user-package*))@\ +@(end) +@(define number (nod))@\ + @(local n)@(space)@{n /[0-9]+/}@(space)@\ + @(bind nod @(int-str n 10))@\ +@(end) +@(define factor (nod))@(cases)(@(expr nod))@(or)@(number nod)@(end)@(end) +@(define term (nod))@\ + @(local op nod1 nod2)@\ + @(cases)@\ + @(factor nod1)@\ + @(cases)@(mulop op)@(term nod2)@(bind nod (op nod1 nod2))@\ + @(or)@(bind nod nod1)@\ + @(end)@\ + @(or)@\ + @(addop op)@(factor nod1)@\ + @(bind nod (op nod1))@\ + @(end)@\ +@(end) +@(define expr (nod))@\ + @(local op nod1 nod2)@\ + @(term nod1)@\ + @(cases)@(addop op)@(expr nod2)@(bind nod (op nod1 nod2))@\ + @(or)@(bind nod nod1)@\ + @(end)@\ +@(end) +@(cases) +@ {source (expr e)} +@ (output) +source: @source +AST: @(format nil "~s" e) +value: @(eval e nil) +@ (end) +@(or) +@ (maybe)@(expr e)@(end)@bad +@ (output) +erroneous suffix "@bad" +@ (end) +@(end) diff --git a/Task/Arithmetic-evaluation/Ursala/arithmetic-evaluation-1.ursala b/Task/Arithmetic-evaluation/Ursala/arithmetic-evaluation-1.ursala new file mode 100644 index 0000000000..b1f785f7d8 --- /dev/null +++ b/Task/Arithmetic-evaluation/Ursala/arithmetic-evaluation-1.ursala @@ -0,0 +1,18 @@ +#import std +#import nat +#import flo + +lex = ~=' '*~F+ rlc both -=digits # separate into tokens + +parse = # build a tree + +--<';'>; @iNX ~&l->rh ^/~< cases~&lhh\~&lhPNVrC { + '*/': ^|C/~&hNV associate '*/', + '+-': ^|C/~&hNV associate '*/+-', + ');': @r ~&htitBPC+ associate '*/+-'} + +associate "ops" = ~&tihdh2B-="ops"-> ~&thd2tth2hNCCVttt2C + +traverse = *^ ~&v?\%ep ^H\~&vhthPX '+-*/'-$@dh + +evaluate = traverse+ parse+ lex diff --git a/Task/Arithmetic-evaluation/Ursala/arithmetic-evaluation-2.ursala b/Task/Arithmetic-evaluation/Ursala/arithmetic-evaluation-2.ursala new file mode 100644 index 0000000000..e9056ee560 --- /dev/null +++ b/Task/Arithmetic-evaluation/Ursala/arithmetic-evaluation-2.ursala @@ -0,0 +1,17 @@ +#cast %eL + +test = evaluate*t + +-[ +1+1 +4/5 +2-1 +3*7 +3+4+5 +9-2-4 +7/3/2 +4+2*3 +5*2-1 +5-3*2 +(1+1)*(2+3) +(2-4)/(3+5*(8-1))]- diff --git a/Task/Arithmetic-geometric-mean/Mathematica/arithmetic-geometric-mean.mathematica b/Task/Arithmetic-geometric-mean/Mathematica/arithmetic-geometric-mean.math similarity index 100% rename from Task/Arithmetic-geometric-mean/Mathematica/arithmetic-geometric-mean.mathematica rename to Task/Arithmetic-geometric-mean/Mathematica/arithmetic-geometric-mean.math diff --git a/Task/Arithmetic-geometric-mean/NetRexx/arithmetic-geometric-mean.netrexx b/Task/Arithmetic-geometric-mean/NetRexx/arithmetic-geometric-mean.netrexx new file mode 100644 index 0000000000..6193c7f039 --- /dev/null +++ b/Task/Arithmetic-geometric-mean/NetRexx/arithmetic-geometric-mean.netrexx @@ -0,0 +1,24 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +numeric digits 18 +parse arg a_ g_ . +if a_ = '' | a_ = '.' then a0 = 1 + else a0 = a_ +if g_ = '' | g_ = '.' then g0 = 1 / Math.sqrt(2) + else g0 = g_ + +say agm(a0, g0) + +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method agm(a0, g0) public static returns Rexx + a1 = a0 + g1 = g0 + loop while (a1 - g1).abs() >= Math.pow(10, -14) + temp = (a1 + g1) / 2 + g1 = Math.sqrt(a1 * g1) + a1 = temp + end + return a1 + 0 diff --git a/Task/Arithmetic-geometric-mean/OCaml/arithmetic-geometric-mean.ocaml b/Task/Arithmetic-geometric-mean/OCaml/arithmetic-geometric-mean.ocaml new file mode 100644 index 0000000000..971dd0813b --- /dev/null +++ b/Task/Arithmetic-geometric-mean/OCaml/arithmetic-geometric-mean.ocaml @@ -0,0 +1,5 @@ +let rec agm a g tol = + if tol > abs_float (a -. g) then a else + agm (0.5*.(a+.g)) (sqrt (a*.g)) tol + +let _ = Printf.printf "%.16f\n" (agm 1.0 (sqrt 0.5) 1e-15) diff --git a/Task/Arithmetic-geometric-mean/PARI-GP/arithmetic-geometric-mean-1.pari b/Task/Arithmetic-geometric-mean/PARI-GP/arithmetic-geometric-mean-1.pari new file mode 100644 index 0000000000..bf4d7f3735 --- /dev/null +++ b/Task/Arithmetic-geometric-mean/PARI-GP/arithmetic-geometric-mean-1.pari @@ -0,0 +1 @@ +agm(1,1/sqrt(2)) diff --git a/Task/Arithmetic-geometric-mean/PARI-GP/arithmetic-geometric-mean-2.pari b/Task/Arithmetic-geometric-mean/PARI-GP/arithmetic-geometric-mean-2.pari new file mode 100644 index 0000000000..92b197b73d --- /dev/null +++ b/Task/Arithmetic-geometric-mean/PARI-GP/arithmetic-geometric-mean-2.pari @@ -0,0 +1 @@ +agm2(x,y)=if(x==y,x,agm2((x+y)/2,sqrt(x*y)) diff --git a/Task/Arithmetic-geometric-mean/PL-I/arithmetic-geometric-mean.pli b/Task/Arithmetic-geometric-mean/PL-I/arithmetic-geometric-mean.pli new file mode 100644 index 0000000000..c92eabcf3a --- /dev/null +++ b/Task/Arithmetic-geometric-mean/PL-I/arithmetic-geometric-mean.pli @@ -0,0 +1,13 @@ +arithmetic_geometric_mean: /* 31 August 2012 */ + procedure options (main); + declare (a, g, t) float (18); + + a = 1; g = 1/sqrt(2.0q0); + put skip list ('The arithmetic-geometric mean of ' || a || ' and ' || g || ':'); + do until (abs(a-g) < 1e-15*a); + t = (a + g)/2; g = sqrt(a*g); + a = t; + put skip data (a, g); + end; + put skip list ('The result is:', a); +end arithmetic_geometric_mean; diff --git a/Task/Arithmetic-geometric-mean/Pascal/arithmetic-geometric-mean.pascal b/Task/Arithmetic-geometric-mean/Pascal/arithmetic-geometric-mean.pascal new file mode 100644 index 0000000000..cc5d084886 --- /dev/null +++ b/Task/Arithmetic-geometric-mean/Pascal/arithmetic-geometric-mean.pascal @@ -0,0 +1,35 @@ +Program ArithmeticGeometricMean; + +uses + gmp; + +procedure agm (in1, in2: mpf_t; var out1, out2: mpf_t); +begin + mpf_add (out1, in1, in2); + mpf_div_ui (out1, out1, 2); + mpf_mul (out2, in1, in2); + mpf_sqrt (out2, out2); +end; + +const + nl = chr(13)+chr(10); +var + x0, y0, resA, resB: mpf_t; + i: integer; +begin + mpf_set_default_prec (65568); + + mpf_init_set_ui (y0, 1); + mpf_init_set_d (x0, 0.5); + mpf_sqrt (x0, x0); + mpf_init (resA); + mpf_init (resB); + + for i := 0 to 6 do + begin + agm(x0, y0, resA, resB); + agm(resA, resB, x0, y0); + end; + mp_printf ('%.20000Ff'+nl, @x0); + mp_printf ('%.20000Ff'+nl+nl, @y0); +end. diff --git a/Task/Arithmetic-geometric-mean/Perl-6/arithmetic-geometric-mean.pl6 b/Task/Arithmetic-geometric-mean/Perl-6/arithmetic-geometric-mean.pl6 new file mode 100644 index 0000000000..a3e9b4cf9c --- /dev/null +++ b/Task/Arithmetic-geometric-mean/Perl-6/arithmetic-geometric-mean.pl6 @@ -0,0 +1,11 @@ +sub agm ($a, $g) { + sub iter ($old) { + my $new := [ 0.5 * [+](@$old), sqrt [*](@$old) ]; + last if $new ~~ $old; + $new; + } + + ([$a,$g], &iter ... 0)[*-1][0]; +} + +say agm 1, 1/sqrt 2; diff --git a/Task/Arithmetic-geometric-mean/PureBasic/arithmetic-geometric-mean.purebasic b/Task/Arithmetic-geometric-mean/PureBasic/arithmetic-geometric-mean.purebasic new file mode 100644 index 0000000000..622da6d00e --- /dev/null +++ b/Task/Arithmetic-geometric-mean/PureBasic/arithmetic-geometric-mean.purebasic @@ -0,0 +1,15 @@ +Procedure.d AGM(a.d, g.d, ErrLim.d=1e-15) + Protected.d ta=a+1, tg + While ta <> a + ta=a: tg=g + a=(ta+tg)*0.5 + g=Sqr(ta*tg) + Wend + ProcedureReturn a +EndProcedure + +If OpenConsole() + PrintN(StrD(AGM(1, 1/Sqr(2)), 16)) + Input() + CloseConsole() +EndIf diff --git a/Task/Arithmetic-geometric-mean/Run-BASIC/arithmetic-geometric-mean.run b/Task/Arithmetic-geometric-mean/Run-BASIC/arithmetic-geometric-mean.run new file mode 100644 index 0000000000..8cc39fe31c --- /dev/null +++ b/Task/Arithmetic-geometric-mean/Run-BASIC/arithmetic-geometric-mean.run @@ -0,0 +1,13 @@ +print agm(1, 1/sqr(2)) +print agm(1,1/2^.5) +print using("#.############################",agm(1, 1/sqr(2))) + +function agm(agm,g) + while agm + an = (agm + g)/2 + gn = sqr(agm*g) + if abs(agm-g) <= abs(an-gn) then exit while + agm = an + g = gn + wend +end function diff --git a/Task/Arithmetic-geometric-mean/XPL0/arithmetic-geometric-mean.xpl0 b/Task/Arithmetic-geometric-mean/XPL0/arithmetic-geometric-mean.xpl0 new file mode 100644 index 0000000000..b3c47c64a4 --- /dev/null +++ b/Task/Arithmetic-geometric-mean/XPL0/arithmetic-geometric-mean.xpl0 @@ -0,0 +1,10 @@ +include c:\cxpl\codesi; +real A, A1, G; +[Format(0, 16); +A:= 1.0; G:= 1.0/sqrt(2.0); +repeat A1:= (A+G)/2.0; + G:= sqrt(A*G); + A:= A1; + RlOut(0, A); RlOut(0, G); RlOut(0, A-G); CrLf(0); +until A=G; +] diff --git a/Task/Array-concatenation/CoffeeScript/array-concatenation.coffee b/Task/Array-concatenation/CoffeeScript/array-concatenation.coffeescript similarity index 100% rename from Task/Array-concatenation/CoffeeScript/array-concatenation.coffee rename to Task/Array-concatenation/CoffeeScript/array-concatenation.coffeescript diff --git a/Task/Array-concatenation/Mathematica/array-concatenation.mathematica b/Task/Array-concatenation/Mathematica/array-concatenation.math similarity index 100% rename from Task/Array-concatenation/Mathematica/array-concatenation.mathematica rename to Task/Array-concatenation/Mathematica/array-concatenation.math diff --git a/Task/Array-concatenation/Nemerle/array-concatenation.nemerle b/Task/Array-concatenation/Nemerle/array-concatenation.nemerle new file mode 100644 index 0000000000..82b4c98496 --- /dev/null +++ b/Task/Array-concatenation/Nemerle/array-concatenation.nemerle @@ -0,0 +1,12 @@ +using System.Console; +using Nemerle.Collections; + +module ArrayCat +{ + Main() : void + { + def arr1 = array[1, 2, 3]; def arr2 = array[4, 5, 6]; + def arr12 = arr1.Append(arr2); // <---- + foreach (i in arr12) Write($"$i "); + } +} diff --git a/Task/Array-concatenation/NetRexx/array-concatenation.netrexx b/Task/Array-concatenation/NetRexx/array-concatenation.netrexx new file mode 100644 index 0000000000..d2a8c76859 --- /dev/null +++ b/Task/Array-concatenation/NetRexx/array-concatenation.netrexx @@ -0,0 +1,28 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols nobinary + +cymru = [ 'Ogof Ffynnon Ddu', 'Ogof Draenen' ] + +dlm = '-'.copies(40) + +say dlm +loop c_ = 0 to cymru.length - 1 + say c_ cymru[c_] + end c_ + +yorks = [ 'Malham Tarn Pot', 'Greygill Hole' ] + +say dlm +loop y_ = 0 to yorks.length - 1 + say y_ yorks[y_] + end y_ + +merge = ArrayList() +merge.addAll(Arrays.asList(cymru)) +merge.addAll(Arrays.asList(yorks)) + +say dlm +merged = merge.toArray() +loop m_ = 0 to merged.length - 1 + say m_ merged[m_] + end m_ diff --git a/Task/Array-concatenation/NewLISP/array-concatenation.newlisp b/Task/Array-concatenation/NewLISP/array-concatenation.newlisp new file mode 100644 index 0000000000..e4f1055235 --- /dev/null +++ b/Task/Array-concatenation/NewLISP/array-concatenation.newlisp @@ -0,0 +1,16 @@ +; file: arraycon.lsp +; url: http://rosettacode.org/wiki/Array_concatenation +; author: oofoe 2012-01-28 + +(println "Append lists: " (append '(3 a 5 3) (sequence 1 9))) + +(println "Multi append: " + (append '(this is) + '(a test) + '(of the emergency) + (sequence 3 1))) + +(println "Append arrays: " + (append '((x 56) (b 99)) '((z 34) (c 23) (r 88)))) + +(exit) diff --git a/Task/Array-concatenation/OCaml/array-concatenation-1.ocaml b/Task/Array-concatenation/OCaml/array-concatenation-1.ocaml new file mode 100644 index 0000000000..a59e976701 --- /dev/null +++ b/Task/Array-concatenation/OCaml/array-concatenation-1.ocaml @@ -0,0 +1,6 @@ +# let list1 = [1; 2; 3];; +val list1 : int list = [1; 2; 3] +# let list2 = [4; 5; 6];; +val list2 : int list = [4; 5; 6] +# let list1and2 = list1 @ list2;; +val list1and2 : int list = [1; 2; 3; 4; 5; 6] diff --git a/Task/Array-concatenation/OCaml/array-concatenation-2.ocaml b/Task/Array-concatenation/OCaml/array-concatenation-2.ocaml new file mode 100644 index 0000000000..759ca83909 --- /dev/null +++ b/Task/Array-concatenation/OCaml/array-concatenation-2.ocaml @@ -0,0 +1,6 @@ +# let array1 = [|1; 2; 3|];; +val array1 : int array = [|1; 2; 3|] +# let array2 = [|4; 5; 6|];; +val array2 : int array = [|4; 5; 6|] +# let array1and2 = Array.append array1 array2;; +val array1and2 : int array = [|1; 2; 3; 4; 5; 6|] diff --git a/Task/Array-concatenation/Objeck/array-concatenation.objeck b/Task/Array-concatenation/Objeck/array-concatenation.objeck new file mode 100644 index 0000000000..8788ff5057 --- /dev/null +++ b/Task/Array-concatenation/Objeck/array-concatenation.objeck @@ -0,0 +1,31 @@ +bundle Default { + class Arithmetic { + function : Main(args : String[]) ~ Nil { + array1 := [3, 5, 7]; + array2 := [2, 4, 6]; + + array3 := Copy(array1, array2); + each(i : array3) { + array3[i]->PrintLine(); + }; + } + + function : native : Copy(array1 : Int[], array2 : Int[]) ~ Int[] { + max := array1->Size() + array2->Size(); + array3 := Int->New[max]; + + i := 0; + for(i := i; i < array1->Size(); i += 1;) { + array3[i] := array1[i]; + }; + + j := 0; + for(i := i; i < max; i += 1;) { + array3[i] := array2[j]; + j += 1; + }; + + return array3; + } + } +} diff --git a/Task/Array-concatenation/Objective-C/array-concatenation-1.m b/Task/Array-concatenation/Objective-C/array-concatenation-1.m new file mode 100644 index 0000000000..0ad02bc3ea --- /dev/null +++ b/Task/Array-concatenation/Objective-C/array-concatenation-1.m @@ -0,0 +1,7 @@ +NSArray *arr1 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1], + [NSNumber numberWithInt:2], + [NSNumber numberWithInt:3], nil]; +NSArray *arr2 = [NSArray arrayWithObjects:[NSNumber numberWithInt:4], + [NSNumber numberWithInt:5], + [NSNumber numberWithInt:6], nil]; +NSArray *arr3 = [arr1 arrayByAddingObjectsFromArray:arr2]; diff --git a/Task/Array-concatenation/Objective-C/array-concatenation-2.m b/Task/Array-concatenation/Objective-C/array-concatenation-2.m new file mode 100644 index 0000000000..5598a036c7 --- /dev/null +++ b/Task/Array-concatenation/Objective-C/array-concatenation-2.m @@ -0,0 +1,8 @@ +NSArray *arr1 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1], + [NSNumber numberWithInt:2], + [NSNumber numberWithInt:3], nil]; +NSArray *arr2 = [NSArray arrayWithObjects:[NSNumber numberWithInt:4], + [NSNumber numberWithInt:5], + [NSNumber numberWithInt:6], nil]; +NSMutableArray *arr3 = [NSMutableArray arrayWithArray:arr1]; +[arr3 addObjectsFromArray:arr2]; diff --git a/Task/Array-concatenation/Order/array-concatenation.order b/Task/Array-concatenation/Order/array-concatenation.order new file mode 100644 index 0000000000..5b452bb7c8 --- /dev/null +++ b/Task/Array-concatenation/Order/array-concatenation.order @@ -0,0 +1,7 @@ +#include + +ORDER_PP( 8tuple_append(8tuple(1, 2, 3), 8tuple(4, 5, 6), 8pair(7, 8)) ) +// -> (1,2,3,4,5,6,7,8) + +ORDER_PP( 8seq_append(8seq(1, 2, 3), 8seq(4, 5, 6), 8seq(7, 8)) ) +// -> (1)(2)(3)(4)(5)(6)(7)(8) diff --git a/Task/Array-concatenation/OxygenBasic/array-concatenation.oxy b/Task/Array-concatenation/OxygenBasic/array-concatenation.oxy new file mode 100644 index 0000000000..6fa206d7f0 --- /dev/null +++ b/Task/Array-concatenation/OxygenBasic/array-concatenation.oxy @@ -0,0 +1,22 @@ +'CREATE DYNAMIC ARRAY SPACES USING STRINGS + +string sa=nuls 5* sizeof float +string sb=sa + +'MAP ARRAY VARIABLES ONTO STRINGS + +float a at *sa +float b at *sb + +'ASSIGN SOME VALUES + +a<=10,20,30,40,50 +b<=60,70,80,90,00 + +'ADD ARRAY B TO A BY STRING CONCATENATION + +sa+=sb + +'TEST + +print a[7] 'result 70 diff --git a/Task/Array-concatenation/Oz/array-concatenation.oz b/Task/Array-concatenation/Oz/array-concatenation.oz new file mode 100644 index 0000000000..5aacf87b0f --- /dev/null +++ b/Task/Array-concatenation/Oz/array-concatenation.oz @@ -0,0 +1,5 @@ +%% concatenating 2 lists +{Append [a b] [c d]} = [a b c d] + +%% concatenating 2 tuples +{Tuple.append t(1 2 3) u(4 5 6)} = u(1 2 3 4 5 6) diff --git a/Task/Array-concatenation/PARI-GP/array-concatenation.pari b/Task/Array-concatenation/PARI-GP/array-concatenation.pari new file mode 100644 index 0000000000..31ec833696 --- /dev/null +++ b/Task/Array-concatenation/PARI-GP/array-concatenation.pari @@ -0,0 +1 @@ +concat(u,v) diff --git a/Task/Array-concatenation/PL-I/array-concatenation-1.pli b/Task/Array-concatenation/PL-I/array-concatenation-1.pli new file mode 100644 index 0000000000..e4c2c62d0d --- /dev/null +++ b/Task/Array-concatenation/PL-I/array-concatenation-1.pli @@ -0,0 +1,3 @@ + declare x(12) fixed; + declare b(5) fixed defined x; + declare c(7) fixed defined x(1sub+5); diff --git a/Task/Array-concatenation/PL-I/array-concatenation-2.pli b/Task/Array-concatenation/PL-I/array-concatenation-2.pli new file mode 100644 index 0000000000..edaa73b7e6 --- /dev/null +++ b/Task/Array-concatenation/PL-I/array-concatenation-2.pli @@ -0,0 +1,3 @@ + declare x(m+n) fixed; + declare b(m) fixed defined x; + declare c(n) fixed defined x(1sub+hbound(b,1)); diff --git a/Task/Array-concatenation/PL-I/array-concatenation-3.pli b/Task/Array-concatenation/PL-I/array-concatenation-3.pli new file mode 100644 index 0000000000..4b6e0c553e --- /dev/null +++ b/Task/Array-concatenation/PL-I/array-concatenation-3.pli @@ -0,0 +1,14 @@ + declare a(5,6) fixed; + declare b(3,4) fixed defined a(1sub, 2sub); + declare c(2,2) fixed defined a(1sub+hbound(b,1), 2sub+hbound(b,2)); + declare (i, j, k) fixed; + + a = 0; + put skip list ('Please type elements for a 3 x 4 matrix:'); + get list (b); + put skip list ('Please type elements for a 2 x 2 matrix:'); + get list (c); + put skip edit (c) ( skip, (hbound(c,2)) f(5,0) ); + + put skip list ('Composite matrix:'); + put skip edit (a) ( skip, (hbound(a,2)) f(5,0) ); diff --git a/Task/Array-concatenation/PL-I/array-concatenation-4.pli b/Task/Array-concatenation/PL-I/array-concatenation-4.pli new file mode 100644 index 0000000000..8805927543 --- /dev/null +++ b/Task/Array-concatenation/PL-I/array-concatenation-4.pli @@ -0,0 +1,13 @@ +Please type elements for a 3 x 4 matrix: + +Please type elements for a 2 x 2 matrix: + + 13 14 + 15 16 +Composite matrix: + + 1 2 3 4 0 0 + 5 6 7 8 0 0 + 9 10 11 12 0 0 + 0 0 0 0 13 14 + 0 0 0 0 15 16 diff --git a/Task/Array-concatenation/Perl-6/array-concatenation.pl6 b/Task/Array-concatenation/Perl-6/array-concatenation.pl6 new file mode 100644 index 0000000000..0ed14befaf --- /dev/null +++ b/Task/Array-concatenation/Perl-6/array-concatenation.pl6 @@ -0,0 +1,8 @@ +# the comma ',' can be used to concatenate arrays: +sub concatenateArrays(@a, @b) { + @a, @b +} + +my @a1 = (1,2,3); +my @a2 = (2,3,4); +concatenateArrays(@a1,@a2).join(", ").say; diff --git a/Task/Array-concatenation/PostScript/array-concatenation.ps b/Task/Array-concatenation/PostScript/array-concatenation.ps new file mode 100644 index 0000000000..06ec40b8f2 --- /dev/null +++ b/Task/Array-concatenation/PostScript/array-concatenation.ps @@ -0,0 +1 @@ +[1 2 3 4] [5 6 7 8] concat diff --git a/Task/Array-concatenation/PowerShell/array-concatenation.psh b/Task/Array-concatenation/PowerShell/array-concatenation.psh new file mode 100644 index 0000000000..1c8d4cc8eb --- /dev/null +++ b/Task/Array-concatenation/PowerShell/array-concatenation.psh @@ -0,0 +1,5 @@ +$a = 1,2,3 +$b = 4,5,6 + +$c = $a + $b +Write-Host $c diff --git a/Task/Array-concatenation/PureBasic/array-concatenation.purebasic b/Task/Array-concatenation/PureBasic/array-concatenation.purebasic new file mode 100644 index 0000000000..d1a7661b76 --- /dev/null +++ b/Task/Array-concatenation/PureBasic/array-concatenation.purebasic @@ -0,0 +1,47 @@ +Procedure displayArray(Array a(1), msg.s) + Protected i + Print(msg + " [") + For i = 0 To ArraySize(a()) + Print(Str(a(i))) + If i <> ArraySize(a()) + Print(", ") + EndIf + Next + PrintN("]") +EndProcedure + +Procedure randomElements(Array a(1), lo, hi) + Protected i + For i = 0 To ArraySize(a()) + a(i) = random(hi - lo) + lo + Next +EndProcedure + +Procedure arrayConcat(Array a(1), Array b(1), Array c(1)) + Protected i, newSize = ArraySize(a()) + ArraySize(b()) + 1 + Dim c(newSize) + For i = 0 To ArraySize(a()) + c(i) = a(i) + Next + For i = 0 To ArraySize(b()) + c(i + ArraySize(a()) + 1) = b(i) + Next +EndProcedure + + +If OpenConsole() + Dim a(random(3) + 1) + Dim b(random(3) + 1) + Dim c(0) ;array will be resized by arrayConcat() + + randomElements(a(), -5, 5) + randomElements(b(), -5, 5) + displayArray(a(), "a:") + displayArray(b(), "b:") + arrayConcat(a(), b(), c()) + displayArray(c(), "concat of a[] + b[]:") + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + CloseConsole() +EndIf diff --git a/Task/Array-concatenation/REBOL/array-concatenation.rebol b/Task/Array-concatenation/REBOL/array-concatenation.rebol new file mode 100644 index 0000000000..ba19457326 --- /dev/null +++ b/Task/Array-concatenation/REBOL/array-concatenation.rebol @@ -0,0 +1,7 @@ +a1: [1 2 3] +a2: [4 5 6] +a3: [7 8 9] + +append a1 a2 ; -> [1 2 3 4 5 6] + +append/only a1 a3 ; -> [1 2 3 4 5 6 [7 8 9]] diff --git a/Task/Array-concatenation/RLaB/array-concatenation.rlab b/Task/Array-concatenation/RLaB/array-concatenation.rlab new file mode 100644 index 0000000000..47ac497045 --- /dev/null +++ b/Task/Array-concatenation/RLaB/array-concatenation.rlab @@ -0,0 +1,13 @@ +>> x = [1, 2, 3] +>> y = [4, 5, 6] +// appending matrix 'y' on the right from matrix 'x' is possible if the two matrices have +// the same number of rows: +>> z1 = [x, y] +matrix columns 1 thru 6 + 1 2 3 4 5 6 +// stacking matrix 'y' below the matrix 'x' is possible if the two matrices have +// the same number of columns: +>> z2 = [x; y] + 1 2 3 + 4 5 6 +>> diff --git a/Task/Array-concatenation/Retro/array-concatenation.retro b/Task/Array-concatenation/Retro/array-concatenation.retro new file mode 100644 index 0000000000..5a1edc2bf6 --- /dev/null +++ b/Task/Array-concatenation/Retro/array-concatenation.retro @@ -0,0 +1,3 @@ +needs array' + +^array'new{ 1 2 3 } ^array'new{ 4 5 6 } ^array'append diff --git a/Task/Array-concatenation/SNOBOL4/array-concatenation.sno b/Task/Array-concatenation/SNOBOL4/array-concatenation.sno new file mode 100644 index 0000000000..53e5ab49ef --- /dev/null +++ b/Task/Array-concatenation/SNOBOL4/array-concatenation.sno @@ -0,0 +1,20 @@ +* # Concatenate 2 arrays (vectors) + define('cat(a1,a2)i,j') :(cat_end) +cat cat = array(prototype(a1) + prototype(a2)) +cat1 i = i + 1; cat = a1 :s(cat1) +cat2 j = j + 1; cat = a2 :s(cat2)f(return) +cat_end + +* # Fill arrays + str1 = '1 2 3 4 5'; arr1 = array(5) +loop i = i + 1; str1 len(p) span('0123456789') . arr1 @p :s(loop) + str2 = '6 7 8 9 10'; arr2 = array(5) +loop2 j = j + 1; str2 len(q) span('0123456789') . arr2 @q :s(loop2) + +* # Test and display + arr3 = cat(arr1,arr2) +loop3 k = k + 1; str3 = str3 arr3 ' ' :s(loop3) + output = str1 + output = str2 + output = str3 +end diff --git a/Task/Array-concatenation/Seed7/array-concatenation.seed7 b/Task/Array-concatenation/Seed7/array-concatenation.seed7 new file mode 100644 index 0000000000..1efc86de87 --- /dev/null +++ b/Task/Array-concatenation/Seed7/array-concatenation.seed7 @@ -0,0 +1,16 @@ +$ include "seed7_05.s7i"; + +var array integer: a is [] (1, 2, 3, 4); +var array integer: b is [] (5, 6, 7, 8); +var array integer: c is [] (9, 10); + +const proc: main is func + local + var integer: number is 0; + begin + c := a & b; + for number range c do + write(number <& " "); + end for; + writeln; + end func; diff --git a/Task/Array-concatenation/Slate/array-concatenation.slate b/Task/Array-concatenation/Slate/array-concatenation.slate new file mode 100644 index 0000000000..d65f644e87 --- /dev/null +++ b/Task/Array-concatenation/Slate/array-concatenation.slate @@ -0,0 +1 @@ +{1. 2. 3. 4. 5} ; {6. 7. 8. 9. 10} diff --git a/Task/Array-concatenation/Standard-ML/array-concatenation.ml b/Task/Array-concatenation/Standard-ML/array-concatenation.ml new file mode 100644 index 0000000000..d96978006a --- /dev/null +++ b/Task/Array-concatenation/Standard-ML/array-concatenation.ml @@ -0,0 +1,3 @@ +val l1 = [1,2,3,4];; +val l2 = [5,6,7,8];; +val l3 = l1 @ l2 (* [1,2,3,4,5,6,7,8] *) diff --git a/Task/Array-concatenation/Trith/array-concatenation.trith b/Task/Array-concatenation/Trith/array-concatenation.trith new file mode 100644 index 0000000000..bacf5c9a13 --- /dev/null +++ b/Task/Array-concatenation/Trith/array-concatenation.trith @@ -0,0 +1 @@ +[1 2 3] [4 5 6] concat diff --git a/Task/Array-concatenation/UNIX-Shell/array-concatenation-1.sh b/Task/Array-concatenation/UNIX-Shell/array-concatenation-1.sh new file mode 100644 index 0000000000..9e1ceb83e2 --- /dev/null +++ b/Task/Array-concatenation/UNIX-Shell/array-concatenation-1.sh @@ -0,0 +1,3 @@ +array1=( 1 2 3 4 5 ) +array2=( 6 7 8 9 10 ) +botharrays=( ${array1[@]} ${array2[@]} ) diff --git a/Task/Array-concatenation/UNIX-Shell/array-concatenation-2.sh b/Task/Array-concatenation/UNIX-Shell/array-concatenation-2.sh new file mode 100644 index 0000000000..43425a83ad --- /dev/null +++ b/Task/Array-concatenation/UNIX-Shell/array-concatenation-2.sh @@ -0,0 +1,8 @@ +array1='1 2 3 4 5' +array2='6 7 8 9 10' + +# Concatenated to a Bash array ... +botharrays_a=( $array1 $array2 ) + +# Concatenated to a string ... +botharrays_s="$array1 $array2" diff --git a/Task/Array-concatenation/VBScript/array-concatenation.vbscript b/Task/Array-concatenation/VBScript/array-concatenation.vbscript new file mode 100644 index 0000000000..9d808a4220 --- /dev/null +++ b/Task/Array-concatenation/VBScript/array-concatenation.vbscript @@ -0,0 +1,18 @@ +Function ArrayConcat(arr1, arr2) + ReDim ret(UBound(arr1) + UBound(arr2) + 1) + For i = 0 To UBound(arr1) + ret(i) = arr1(i) + Next + offset = Ubound(arr1) + 1 + For i = 0 To UBound(arr2) + ret(i + offset) = arr2(i) + Next + ArrayConcat = ret +End Function + +arr1 = array(10,20,30) +arr2 = array(40,50,60) +WScript.Echo "arr1 = array(" & Join(arr1,", ") & ")" +WScript.Echo "arr2 = array(" & Join(arr2,", ") & ")" +arr3 = ArrayConcat(arr1, arr2) +WScript.Echo "arr1 + arr2 = array(" & Join(arr3,", ") & ")" diff --git a/Task/Array-concatenation/Vala/array-concatenation.vala b/Task/Array-concatenation/Vala/array-concatenation.vala new file mode 100644 index 0000000000..8815328518 --- /dev/null +++ b/Task/Array-concatenation/Vala/array-concatenation.vala @@ -0,0 +1,14 @@ +int[] array_concat(int[]a,int[]b){ + int[] c = new int[a.length + b.length]; + Memory.copy(c, a, a.length * sizeof(int)); + Memory.copy(&c[a.length], b, b.length * sizeof(int)); + return c; +} +void main(){ + int[] a = {1,2,3,4,5}; + int[] b = {6,7,8}; + int[] c = array_concat(a,b); + foreach(int i in c){ + stdout.printf("%d\n",i); + } +} diff --git a/Task/Array-concatenation/Visual-Basic-.NET/array-concatenation.visual b/Task/Array-concatenation/Visual-Basic-.NET/array-concatenation.visual new file mode 100644 index 0000000000..9834324e79 --- /dev/null +++ b/Task/Array-concatenation/Visual-Basic-.NET/array-concatenation.visual @@ -0,0 +1,5 @@ + Dim iArray1() As Integer = {1, 2, 3} + Dim iArray2() As Integer = {4, 5, 6} + Dim iArray3() As Integer = Nothing + + iArray3 = iArray1.Concat(iArray2).ToArray diff --git a/Task/Array-concatenation/Yorick/array-concatenation.yorick b/Task/Array-concatenation/Yorick/array-concatenation.yorick new file mode 100644 index 0000000000..ede81d0ef6 --- /dev/null +++ b/Task/Array-concatenation/Yorick/array-concatenation.yorick @@ -0,0 +1,3 @@ +a = [1,2,3]; +b = [4,5,6]; +ab = grow(a, b); diff --git a/Task/Arrays/BASIC/arrays-1.bas b/Task/Arrays/BASIC/arrays-1.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-1.bas rename to Task/Arrays/BASIC/arrays-1.basic diff --git a/Task/Arrays/BASIC/arrays-2.bas b/Task/Arrays/BASIC/arrays-2.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-2.bas rename to Task/Arrays/BASIC/arrays-2.basic diff --git a/Task/Arrays/BASIC/arrays-3.bas b/Task/Arrays/BASIC/arrays-3.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-3.bas rename to Task/Arrays/BASIC/arrays-3.basic diff --git a/Task/Arrays/BASIC/arrays-4.bas b/Task/Arrays/BASIC/arrays-4.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-4.bas rename to Task/Arrays/BASIC/arrays-4.basic diff --git a/Task/Arrays/BASIC/arrays-5.bas b/Task/Arrays/BASIC/arrays-5.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-5.bas rename to Task/Arrays/BASIC/arrays-5.basic diff --git a/Task/Arrays/BASIC/arrays-6.bas b/Task/Arrays/BASIC/arrays-6.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-6.bas rename to Task/Arrays/BASIC/arrays-6.basic diff --git a/Task/Arrays/BASIC/arrays-7.bas b/Task/Arrays/BASIC/arrays-7.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-7.bas rename to Task/Arrays/BASIC/arrays-7.basic diff --git a/Task/Arrays/BASIC/arrays-8.bas b/Task/Arrays/BASIC/arrays-8.basic similarity index 100% rename from Task/Arrays/BASIC/arrays-8.bas rename to Task/Arrays/BASIC/arrays-8.basic diff --git a/Task/Arrays/CoffeeScript/arrays-1.coffee b/Task/Arrays/CoffeeScript/arrays-1.coffeescript similarity index 100% rename from Task/Arrays/CoffeeScript/arrays-1.coffee rename to Task/Arrays/CoffeeScript/arrays-1.coffeescript diff --git a/Task/Arrays/CoffeeScript/arrays-2.coffee b/Task/Arrays/CoffeeScript/arrays-2.coffeescript similarity index 100% rename from Task/Arrays/CoffeeScript/arrays-2.coffee rename to Task/Arrays/CoffeeScript/arrays-2.coffeescript diff --git a/Task/Arrays/CoffeeScript/arrays-3.coffee b/Task/Arrays/CoffeeScript/arrays-3.coffeescript similarity index 100% rename from Task/Arrays/CoffeeScript/arrays-3.coffee rename to Task/Arrays/CoffeeScript/arrays-3.coffeescript diff --git a/Task/Arrays/Component-Pascal/arrays.pascal b/Task/Arrays/Component-Pascal/arrays.component similarity index 100% rename from Task/Arrays/Component-Pascal/arrays.pascal rename to Task/Arrays/Component-Pascal/arrays.component diff --git a/Task/Arrays/Golfscript/arrays.golf b/Task/Arrays/Golfscript/arrays.golfscript similarity index 100% rename from Task/Arrays/Golfscript/arrays.golf rename to Task/Arrays/Golfscript/arrays.golfscript diff --git a/Task/Arrays/KonsolScript/arrays.konso b/Task/Arrays/KonsolScript/arrays.konsolscript similarity index 100% rename from Task/Arrays/KonsolScript/arrays.konso rename to Task/Arrays/KonsolScript/arrays.konsolscript diff --git a/Task/Arrays/Mathematica/arrays.mathematica b/Task/Arrays/Mathematica/arrays.math similarity index 100% rename from Task/Arrays/Mathematica/arrays.mathematica rename to Task/Arrays/Mathematica/arrays.math diff --git a/Task/Arrays/NSIS/arrays.nsis b/Task/Arrays/NSIS/arrays.nsis new file mode 100644 index 0000000000..a8dc3fb58f --- /dev/null +++ b/Task/Arrays/NSIS/arrays.nsis @@ -0,0 +1,13 @@ +!include NSISArray.nsh +Function ArrayTest + Push $0 + ; Declaring an array + NSISArray::New TestArray 1 2 + NSISArray::Push TestArray "Hello" + ; NSISArray arrays are dynamic by default. + NSISArray::Push TestArray "World" + NSISArray::Read TestArray 1 + Pop $0 + DetailPrint $0 + Pop $0 +FunctionEnd diff --git a/Task/Arrays/Nemerle/arrays.nemerle b/Task/Arrays/Nemerle/arrays.nemerle new file mode 100644 index 0000000000..96d1bbcfb1 --- /dev/null +++ b/Task/Arrays/Nemerle/arrays.nemerle @@ -0,0 +1,20 @@ +using System; +using System.Console; +using System.Collections; + +module ArrayOps +{ + Main() : void + { + def fives = array(10); + foreach (i in [1 .. 10]) fives[i - 1] = i * 5; + def ten = fives[1]; + WriteLine($"Ten: $ten"); + + def dynamic = ArrayList(); + dynamic.Add(1); + dynamic.Add(3); + dynamic[1] = 2; + foreach (i in dynamic) Write($"$i\t"); // Nemerle isn't great about displaying arrays, it's better with lists though + } +} diff --git a/Task/Arrays/NetRexx/arrays.netrexx b/Task/Arrays/NetRexx/arrays.netrexx new file mode 100644 index 0000000000..cb159c3c87 --- /dev/null +++ b/Task/Arrays/NetRexx/arrays.netrexx @@ -0,0 +1,34 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols nobinary + +array = int[10] +array[0] = 42 + +say array[0] array[3] +say + +words = ['Ogof', 'Ffynnon', 'Ddu'] + +say words[0] words[1] words[2] +say + +-- Dynamic arrays can be simulated via the Java Collections package +splk = ArrayList() +splk.add(words[0]) +splk.add(words[1]) +splk.add(words[2]) +splk.add('Draenen') + +say splk.get(0) splk.get(3) +say splk.get(0) splk.get(1) splk.get(2) +say + +-- or by using NetRexx "indexed strings" (associative arrays) +cymru = '' +cymru[0] = 0 +cymru[0] = cymru[0] + 1; cymru[cymru[0]] = splk.get(0) splk.get(1) splk.get(2) +cymru[0] = cymru[0] + 1; cymru[cymru[0]] = splk.get(0) splk.get(3) + +loop x_ = 1 to cymru[0] by 1 + say x_':' cymru[x_] + end x_ diff --git a/Task/Arrays/NewLISP/arrays-1.newlisp b/Task/Arrays/NewLISP/arrays-1.newlisp new file mode 100644 index 0000000000..8d01a0cede --- /dev/null +++ b/Task/Arrays/NewLISP/arrays-1.newlisp @@ -0,0 +1,2 @@ +(array 5) +→ (nil nil nil nil nil) diff --git a/Task/Arrays/NewLISP/arrays-2.newlisp b/Task/Arrays/NewLISP/arrays-2.newlisp new file mode 100644 index 0000000000..c846b6695b --- /dev/null +++ b/Task/Arrays/NewLISP/arrays-2.newlisp @@ -0,0 +1,2 @@ +(set 'myarray (array 3 4 (sequence 1 12))) +→ ((1 2 3 4) (5 6 7 8) (9 10 11 12)) diff --git a/Task/Arrays/OCaml/arrays.ocaml b/Task/Arrays/OCaml/arrays.ocaml new file mode 100644 index 0000000000..bbe3a51403 --- /dev/null +++ b/Task/Arrays/OCaml/arrays.ocaml @@ -0,0 +1,17 @@ +# Array.make 6 'A' ;; +- : char array = [|'A'; 'A'; 'A'; 'A'; 'A'; 'A'|] + +# Array.init 8 (fun i -> i * 10) ;; +- : int array = [|0; 10; 20; 30; 40; 50; 60; 70|] + +# let arr = [|0; 1; 2; 3; 4; 5; 6 |] ;; +val arr : int array = [|0; 1; 2; 3; 4; 5; 6|] + +# arr.(4) ;; +- : int = 4 + +# arr.(4) <- 65 ;; +- : unit = () + +# arr ;; +- : int array = [|0; 1; 2; 3; 65; 5; 6|] diff --git a/Task/Arrays/Objeck/arrays.objeck b/Task/Arrays/Objeck/arrays.objeck new file mode 100644 index 0000000000..b0b97222de --- /dev/null +++ b/Task/Arrays/Objeck/arrays.objeck @@ -0,0 +1,10 @@ +bundle Default { + class Arithmetic { + function : Main(args : System.String[]), Nil { + array := Int->New[2]; + array[0] := 13; + array[1] := 7; + (array[0] + array[1])->PrintLine(); + } + } +} diff --git a/Task/Arrays/Objective-C/arrays.m b/Task/Arrays/Objective-C/arrays.m new file mode 100644 index 0000000000..308c2c67f4 --- /dev/null +++ b/Task/Arrays/Objective-C/arrays.m @@ -0,0 +1,23 @@ +// NSArrays are ordered collections of NSObject subclasses only. + +// Create an array of NSString objects. +NSArray *firstArray = [[NSArray alloc] initWithObjects:@"Hewey", @"Louie", @"Dewey", nil]; + +// NSArrays are immutable; it does have a mutable subclass, however - NSMutableArray. +// Let's instantiate one with a mutable copy of our array. +// We can do this by sending our first array a -mutableCopy message. +NSMutableArray *secondArray = [firstArray mutableCopy]; + +// Replace Louie with Launchpad McQuack. +[secondArray replaceObjectAtIndex:1 withObject:@"Launchpad"]; + +// Display the first object in the array. +NSLog(@"%@", [secondArray objectAtIndex:0]); + +// In non-ARC or non-GC environments, retained objects must be released later. +[firstArray release]; +[secondArray release]; + +// There is also a modern syntax which allows convenient creation of autoreleased immutable arrays. +// No nil termination is then needed. +NSArray *thirdArray = @[ @"Hewey", @"Louie", @"Dewey", @1, @2, @3 ]; diff --git a/Task/Arrays/OxygenBasic/arrays.oxy b/Task/Arrays/OxygenBasic/arrays.oxy new file mode 100644 index 0000000000..27526f7332 --- /dev/null +++ b/Task/Arrays/OxygenBasic/arrays.oxy @@ -0,0 +1,17 @@ +'CREATING AN ARRAY + +float f[100] + +'SETTING INDEX BASE + +indexbase 1 'default + +'FILLING PART OF AN ARRAY + +f[20]<=1,2,3,4,5,1.25 + +'MAPPING AN ARRAY TO ANOTHER + +float *g +@g=@f[20] +print g[6] 'result 1.25 diff --git a/Task/Arrays/Oz/arrays.oz b/Task/Arrays/Oz/arrays.oz new file mode 100644 index 0000000000..abefc10db5 --- /dev/null +++ b/Task/Arrays/Oz/arrays.oz @@ -0,0 +1,8 @@ +declare + Arr = {Array.new 1 %% lowest index + 10 %% highest index + 37} %% all 10 fields initialized to 37 +in + {Show Arr.1} + Arr.1 := 64 + {Show Arr.1} diff --git a/Task/Arrays/PARI-GP/arrays.pari b/Task/Arrays/PARI-GP/arrays.pari new file mode 100644 index 0000000000..249ee50694 --- /dev/null +++ b/Task/Arrays/PARI-GP/arrays.pari @@ -0,0 +1,3 @@ +v=[]; +v=concat(v,7); +v[1] diff --git a/Task/Arrays/PL-I/arrays.pli b/Task/Arrays/PL-I/arrays.pli new file mode 100644 index 0000000000..326d2ed2fe --- /dev/null +++ b/Task/Arrays/PL-I/arrays.pli @@ -0,0 +1,19 @@ +/* Example of an array having fixed dimensions */ +declare A(10) float initial (1, 9, 4, 6, 7, 2, 5, 8, 3, 10); + +A(6) = -45; + +/* Example of an array having dynamic bounds. */ +get list (N); + +begin; + declare B(N) float initial (9, 4, 7, 3, 8, 11, 0, 5, 15, 6); + B(3) = -11; +end; + +/* Example of a dynamic array. */ + declare C(N) float controlled; + get list (N); + allocate C; + C = 0; + c(7) = 12; diff --git a/Task/Arrays/Pascal/arrays.pascal b/Task/Arrays/Pascal/arrays.pascal new file mode 100644 index 0000000000..7be4808f36 --- /dev/null +++ b/Task/Arrays/Pascal/arrays.pascal @@ -0,0 +1,33 @@ +Program ArrayDemo; +uses + SysUtils; +var + StaticArray: array[0..9] of Integer; + DynamicArray: array of Integer; + StaticArrayText, + DynamicArrayText: string; + lcv: Integer; +begin + // Setting the length of the dynamic array the same as the static one + SetLength(DynamicArray, Length(StaticArray)); + // Asking random numbers storing into the static array + for lcv := 0 to Pred(Length(StaticArray)) do + begin + write('Enter a integer random number for position ', Succ(lcv), ': '); + readln(StaticArray[lcv]); + end; + // Storing entered numbers of the static array in reverse order into the dynamic + for lcv := 0 to Pred(Length(StaticArray)) do + DynamicArray[Pred(Length(DynamicArray)) - lcv] := StaticArray[lcv]; + // Concatenating the static and dynamic array into a single string variable + StaticArrayText := ''; + DynamicArrayText := ''; + for lcv := 0 to Pred(Length(StaticArray)) do + begin + StaticArrayText := StaticArrayText + IntToStr(StaticArray[lcv]) + ' '; + DynamicArrayText := DynamicArrayText + IntToStr(DynamicArray[lcv]) + ' '; + end; + // Displaying both arrays + writeln(StaticArrayText); + writeln(DynamicArrayText); +end. diff --git a/Task/Arrays/Perl-6/arrays.pl6 b/Task/Arrays/Perl-6/arrays.pl6 new file mode 100644 index 0000000000..1253310991 --- /dev/null +++ b/Task/Arrays/Perl-6/arrays.pl6 @@ -0,0 +1,8 @@ +my @arr; + +push @arr, 1; +push @arr, 3; + +@arr[0] = 2; + +say @arr[0]; diff --git a/Task/Arrays/Pike/arrays.pike b/Task/Arrays/Pike/arrays.pike new file mode 100644 index 0000000000..4807c0b50f --- /dev/null +++ b/Task/Arrays/Pike/arrays.pike @@ -0,0 +1,8 @@ +int main(){ + // Initial array, few random elements. + array arr = ({3,"hi",84.2}); + + arr += ({"adding","to","the","array"}); // Lets add some elements. + + write(arr[5] + "\n"); // And finally print element 5. +} diff --git a/Task/Arrays/PostScript/arrays.ps b/Task/Arrays/PostScript/arrays.ps new file mode 100644 index 0000000000..e9d66c17cf --- /dev/null +++ b/Task/Arrays/PostScript/arrays.ps @@ -0,0 +1,16 @@ +%Declaring array + +/x [0 1] def + +%Assigning value to an element, PostScript arrays are 0 based. + +x 0 3 put + +%Print array + +x pstack +[3 1] + +%Get an element + +x 1 get diff --git a/Task/Arrays/PowerShell/arrays-1.psh b/Task/Arrays/PowerShell/arrays-1.psh new file mode 100644 index 0000000000..747bc45030 --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-1.psh @@ -0,0 +1 @@ +$a = @() diff --git a/Task/Arrays/PowerShell/arrays-2.psh b/Task/Arrays/PowerShell/arrays-2.psh new file mode 100644 index 0000000000..9669522a4c --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-2.psh @@ -0,0 +1,2 @@ +$a = ,2 +$a = @(2) # alternative diff --git a/Task/Arrays/PowerShell/arrays-3.psh b/Task/Arrays/PowerShell/arrays-3.psh new file mode 100644 index 0000000000..6f95b96dc5 --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-3.psh @@ -0,0 +1 @@ +$a = 1,2,3 diff --git a/Task/Arrays/PowerShell/arrays-4.psh b/Task/Arrays/PowerShell/arrays-4.psh new file mode 100644 index 0000000000..280352a330 --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-4.psh @@ -0,0 +1 @@ +$a += 5 diff --git a/Task/Arrays/PowerShell/arrays-5.psh b/Task/Arrays/PowerShell/arrays-5.psh new file mode 100644 index 0000000000..3fe2ef1b2d --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-5.psh @@ -0,0 +1 @@ +$a[1] diff --git a/Task/Arrays/PowerShell/arrays-6.psh b/Task/Arrays/PowerShell/arrays-6.psh new file mode 100644 index 0000000000..2170cde7ee --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-6.psh @@ -0,0 +1 @@ +$a[1] = 42 diff --git a/Task/Arrays/PowerShell/arrays-7.psh b/Task/Arrays/PowerShell/arrays-7.psh new file mode 100644 index 0000000000..99fa1e9a5b --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-7.psh @@ -0,0 +1 @@ +$r = 1..100 diff --git a/Task/Arrays/PowerShell/arrays-8.psh b/Task/Arrays/PowerShell/arrays-8.psh new file mode 100644 index 0000000000..64613cbac7 --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-8.psh @@ -0,0 +1 @@ +$r[0..9+25..27+80,85,90] diff --git a/Task/Arrays/PowerShell/arrays-9.psh b/Task/Arrays/PowerShell/arrays-9.psh new file mode 100644 index 0000000000..d85d26b3c0 --- /dev/null +++ b/Task/Arrays/PowerShell/arrays-9.psh @@ -0,0 +1 @@ +$r[-1] # last index diff --git a/Task/Arrays/PureBasic/arrays-1.purebasic b/Task/Arrays/PureBasic/arrays-1.purebasic new file mode 100644 index 0000000000..56b03c9be7 --- /dev/null +++ b/Task/Arrays/PureBasic/arrays-1.purebasic @@ -0,0 +1,5 @@ + ;Set up an Array of 23 cells, e.g. 0-22 +Dim MyArray.i(22) + MyArray(0) = 7 + MyArray(1) = 11 + MyArray(7) = 23 diff --git a/Task/Arrays/PureBasic/arrays-2.purebasic b/Task/Arrays/PureBasic/arrays-2.purebasic new file mode 100644 index 0000000000..5d76fac528 --- /dev/null +++ b/Task/Arrays/PureBasic/arrays-2.purebasic @@ -0,0 +1,5 @@ + ;Extend the Array above to 56 items without affecting the already stored data +ReDim MyArray(55) + MyArray(22) = 7 + MyArray(33) = 11 + MyArray(44) = 23 diff --git a/Task/Arrays/PureBasic/arrays-3.purebasic b/Task/Arrays/PureBasic/arrays-3.purebasic new file mode 100644 index 0000000000..8957fbda38 --- /dev/null +++ b/Task/Arrays/PureBasic/arrays-3.purebasic @@ -0,0 +1,6 @@ + ;Find all 6 non-zero cells from the Array above +For i=0 To ArraySize(MyArray()) + If MyArray(i) + PrintN(Str(i)+" differs from zero.") + EndIf +Next diff --git a/Task/Arrays/PureBasic/arrays-4.purebasic b/Task/Arrays/PureBasic/arrays-4.purebasic new file mode 100644 index 0000000000..e753391a15 --- /dev/null +++ b/Task/Arrays/PureBasic/arrays-4.purebasic @@ -0,0 +1,4 @@ + ; Now, set up a multi dimensional Array +Dim MultiArray.i(800, 600) + MultiArray(100, 200) = 640 + MultiArray(130, 40) = 120 diff --git a/Task/Arrays/PureBasic/arrays-5.purebasic b/Task/Arrays/PureBasic/arrays-5.purebasic new file mode 100644 index 0000000000..38601384b5 --- /dev/null +++ b/Task/Arrays/PureBasic/arrays-5.purebasic @@ -0,0 +1,2 @@ +Dim MultiArray2.i(64, 128, 32) + PrintN( Str(ArraySize(MultiArray2(), 2)) ; Will tell that second dimension size is '128' diff --git a/Task/Arrays/REBOL/arrays-1.rebol b/Task/Arrays/REBOL/arrays-1.rebol new file mode 100644 index 0000000000..c671b2ab96 --- /dev/null +++ b/Task/Arrays/REBOL/arrays-1.rebol @@ -0,0 +1,2 @@ +a: [] ; Empty. +b: ["foo"] ; Pre-initialized. diff --git a/Task/Arrays/REBOL/arrays-2.rebol b/Task/Arrays/REBOL/arrays-2.rebol new file mode 100644 index 0000000000..dc71c4149d --- /dev/null +++ b/Task/Arrays/REBOL/arrays-2.rebol @@ -0,0 +1,2 @@ +append a ["up" "down"] ; -> ["up" "down"] +insert a [left right] ; -> [left right "up" "down"] diff --git a/Task/Arrays/REBOL/arrays-3.rebol b/Task/Arrays/REBOL/arrays-3.rebol new file mode 100644 index 0000000000..4ec9ab212b --- /dev/null +++ b/Task/Arrays/REBOL/arrays-3.rebol @@ -0,0 +1,4 @@ +first a ; -> left +third a ; -> "up" +last a ; -> "down" +a/2 ; -> right (Note: REBOL is 1-based.) diff --git a/Task/Arrays/REBOL/arrays-4.rebol b/Task/Arrays/REBOL/arrays-4.rebol new file mode 100644 index 0000000000..8a8feb92f2 --- /dev/null +++ b/Task/Arrays/REBOL/arrays-4.rebol @@ -0,0 +1,10 @@ +a ; -> [left right "up" "down"] +next a ; -> [right "up" "down"] +skip a 2 ; -> ["up" "down"] + +a: next a ; -> [right "up" "down"] +head a ; -> [left right "up" "down"] + +copy a ; -> [left right "up" "down"] +copy/part a 2 ; -> [left right] +copy/part skip a 2 2 ; -> ["up" "down"] diff --git a/Task/Arrays/RLaB/arrays.rlab b/Task/Arrays/RLaB/arrays.rlab new file mode 100644 index 0000000000..8328e2678c --- /dev/null +++ b/Task/Arrays/RLaB/arrays.rlab @@ -0,0 +1,29 @@ +// 1-D (row- or column-vectors) +// Static: +// row-vector +x = [1:3]; +x = zeros(1,3); x[1]=1; x[2]=2; x[3]=3; +// column-vector +x = [1:3]'; // or +x = [1;2;3]; // or +x = zeros(3,1); x[1]=1; x[2]=2; x[3]=3; +// Dynamic: +x = []; // create an empty array +x = [x; 1, 2]; // add a row to 'x' containing [1, 2], or +x = [x, [1; 2]]; // add a column to 'x' containing [1; 2] + +// 2-D array +// Static: +x = zeros(3,5); // create an zero-filed matrix of size 3x5 +x[1;1] = 1; // set the x(1,1) element to 1 +x[2;] = [1,2,3,4,5]; // set the second row x(2,) to a row vector +x[3;4:5] = [2,3]; // set x(3,4) to 2 and x(3,5) to 3 +// Dynamic +x = [1:5]; // create an row-vector x(1,1)=1, x(1,2)=2, ... x(1,5)=5 +x = [x; 2, 3, 4, 6, 7]; // add to 'x' a row. + +// Accessing an element of arrays: +// to retrieve/print element of matrix 'x' just put this in a single line in the script +i=1; +j=2; +x[i;j] diff --git a/Task/Arrays/RPG/arrays.rpg b/Task/Arrays/RPG/arrays.rpg new file mode 100644 index 0000000000..8cda869319 --- /dev/null +++ b/Task/Arrays/RPG/arrays.rpg @@ -0,0 +1,27 @@ + //-Static array + //--def of 10 el array of integers, initialised to zeros + D array... + D s 10i 0 dim(10) + D inz + //--def an el + D el_1... + D s 10i 0 inz + + /free + + //-assign first el + //--first element of RPG array is indexed with 1 + array(1) = 111; + + //-get first el of array + el_1 = array(1); + + //--display it + dsply ('First el of array='+%char(el_1)); + //--displays: First el of array=111 + + //---or shorter, without "el_1" + dsply ('First el of array='+%char(array(1))); + //--displays: First el of array=111 + + /end-free diff --git a/Task/Arrays/Retro/arrays.retro b/Task/Arrays/Retro/arrays.retro new file mode 100644 index 0000000000..e82809ac3b --- /dev/null +++ b/Task/Arrays/Retro/arrays.retro @@ -0,0 +1,34 @@ +needs array' + +( Create an array with four elements ) +^array'new{ 1 2 3 4 } constant a + +( Add 10 to each element in an array and update the array with the results ) +a [ 10 + ] ^array'map + +( Apply a quote to each element in an array; leaves the contents alone ) +a [ 10 + putn cr ] ^array'apply + +( Display an array ) +a ^array'display + +( Look for a value in an array ) +3 a ^array'in? +6 a ^array'in? + +( Look for a string in an array ) +"hello" a ^array'stringIn? + +( Reverse the order of items in an array ) +a ^array'reverse + +( Append two arrays and return a new one ) +^array'new{ 1 2 3 } constant a +^array'new{ 4 5 6 } constant b +a b ^array'append constant c + +( Create an array from the values returned by a quote ) +[ 1 2 "hello" "world" ] ^array'fromQuote constant d + +( Create a quote from the values in an array ) +d ^array'toQuote diff --git a/Task/Arrays/Run-BASIC/arrays.run b/Task/Arrays/Run-BASIC/arrays.run new file mode 100644 index 0000000000..fc7c5f27ca --- /dev/null +++ b/Task/Arrays/Run-BASIC/arrays.run @@ -0,0 +1,9 @@ +print "Enter array 1 greater than 0"; : input a1 +print "Enter array 2 greater than 0"; : input a2 + +dim chrArray$(max(a1,1),max(a2,1)) +dim numArray(max(a1,1),max(a2,1)) + +chrArray$(1,1) = "Hello" +numArray(1,1) = 987.2 +print chrArray$(1,1);" ";numArray(1,1) diff --git a/Task/Arrays/Slate/arrays.slate b/Task/Arrays/Slate/arrays.slate new file mode 100644 index 0000000000..2138dca56e --- /dev/null +++ b/Task/Arrays/Slate/arrays.slate @@ -0,0 +1,14 @@ +slate[1]> #x := ##(1 2 3). +{1. 2. 3} +slate[2]> x +{1. 2. 3} +slate[3]> #y := {1 + 2. 3 + 4. 5}. +{3. 7. 5} +slate[4]> y at: 2 put: 99. +99 +slate[5]> y +{3. 7. 99} +slate[6]> x first +1 +slate[7]> x at: 0. +1 diff --git a/Task/Arrays/Suneido/arrays.suneido b/Task/Arrays/Suneido/arrays.suneido new file mode 100644 index 0000000000..68bb3d09bc --- /dev/null +++ b/Task/Arrays/Suneido/arrays.suneido @@ -0,0 +1,5 @@ +array = Object('zero', 'one', 'two') +array.Add('three') +array.Add('five', at: 5) +array[4] = 'four' +Print(array[3]) --> 'three' diff --git a/Task/Arrays/TI-83-BASIC/arrays-1.ti-83 b/Task/Arrays/TI-83-BASIC/arrays-1.ti-83 new file mode 100644 index 0000000000..287ff5886e --- /dev/null +++ b/Task/Arrays/TI-83-BASIC/arrays-1.ti-83 @@ -0,0 +1 @@ +{1,2,3,4,5}→L1 diff --git a/Task/Arrays/TI-83-BASIC/arrays-2.ti-83 b/Task/Arrays/TI-83-BASIC/arrays-2.ti-83 new file mode 100644 index 0000000000..44a9a5fa84 --- /dev/null +++ b/Task/Arrays/TI-83-BASIC/arrays-2.ti-83 @@ -0,0 +1,3 @@ +{1,2,3,4,5}→L1 +Disp L1(3) +0→L1(4) diff --git a/Task/Arrays/TXR/arrays.txr b/Task/Arrays/TXR/arrays.txr new file mode 100644 index 0000000000..761e09e228 --- /dev/null +++ b/Task/Arrays/TXR/arrays.txr @@ -0,0 +1,7 @@ +@(collect) +@line +@(bind f @(split-str line ",")) +@(output) +@{f[-1]}@\t@{f[1..-1] "\t"}@\t@{f[0]} +@(end) +@(end) diff --git a/Task/Arrays/TorqueScript/arrays-1.torquescript b/Task/Arrays/TorqueScript/arrays-1.torquescript new file mode 100644 index 0000000000..982524a945 --- /dev/null +++ b/Task/Arrays/TorqueScript/arrays-1.torquescript @@ -0,0 +1,5 @@ +$array[0] = "hi"; +$array[1] = "hello"; + +for(%i=0;%i<2;%i++) + echo($array[%i]); diff --git a/Task/Arrays/TorqueScript/arrays-2.torquescript b/Task/Arrays/TorqueScript/arrays-2.torquescript new file mode 100644 index 0000000000..b6834c4f39 --- /dev/null +++ b/Task/Arrays/TorqueScript/arrays-2.torquescript @@ -0,0 +1,5 @@ +$array["Greet",0] = "hi"; +$array["Greet",1] = "hello"; + +for(%i=0;%i<2;%i++) + echo($array["Greet",%i]); diff --git a/Task/Arrays/UNIX-Shell/arrays-1.sh b/Task/Arrays/UNIX-Shell/arrays-1.sh new file mode 100644 index 0000000000..7aa7e0a3eb --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-1.sh @@ -0,0 +1,6 @@ +alist=( item1 item2 item3 ) # creates a 3 item array called "alist" +declare -a list2 # declare an empty list called "list2" +declare -a list3[0] # empty list called "list3"; the subscript is ignored + +# create a 4 item list, with a specific order +list5=([3]=apple [2]=cherry [1]=banana [0]=strawberry) diff --git a/Task/Arrays/UNIX-Shell/arrays-10.sh b/Task/Arrays/UNIX-Shell/arrays-10.sh new file mode 100644 index 0000000000..19e02d0232 --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-10.sh @@ -0,0 +1 @@ +unset alist diff --git a/Task/Arrays/UNIX-Shell/arrays-2.sh b/Task/Arrays/UNIX-Shell/arrays-2.sh new file mode 100644 index 0000000000..11ae5d6eb0 --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-2.sh @@ -0,0 +1,2 @@ +count=${#alist[*]} +echo "The number of items in alist is ${#alist[*]}" diff --git a/Task/Arrays/UNIX-Shell/arrays-3.sh b/Task/Arrays/UNIX-Shell/arrays-3.sh new file mode 100644 index 0000000000..f2ae61eab2 --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-3.sh @@ -0,0 +1,5 @@ +x=0 +while [[ $x < ${#alist[*]} ]]; do + echo "Item $x = ${alist[$x]}" + : $((x++)) +done diff --git a/Task/Arrays/UNIX-Shell/arrays-4.sh b/Task/Arrays/UNIX-Shell/arrays-4.sh new file mode 100644 index 0000000000..e5623827b2 --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-4.sh @@ -0,0 +1,5 @@ +x=${#alist[*]} # start with the number of items in the array +while [[ $x > 0 ]]; do # while there are items left + : $((x--)) # decrement first, because indexing is zero-based + echo "Item $x = ${alist[$x]}" # show the current item +done diff --git a/Task/Arrays/UNIX-Shell/arrays-5.sh b/Task/Arrays/UNIX-Shell/arrays-5.sh new file mode 100644 index 0000000000..ac8a8e11c0 --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-5.sh @@ -0,0 +1 @@ +alist[${#alist[*]}]=new_item diff --git a/Task/Arrays/UNIX-Shell/arrays-6.sh b/Task/Arrays/UNIX-Shell/arrays-6.sh new file mode 100644 index 0000000000..a48846f942 --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-6.sh @@ -0,0 +1,10 @@ +# shell function to append values to an array +# push LIST VALUES ... +push() { + local var=${1:?'Missing variable name!'} + shift + eval "\$$var=( \"\${$var[@]}\" \"$@\" )" +} + +push alist "one thing to add" +push alist many words to add diff --git a/Task/Arrays/UNIX-Shell/arrays-7.sh b/Task/Arrays/UNIX-Shell/arrays-7.sh new file mode 100644 index 0000000000..9d49617d6d --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-7.sh @@ -0,0 +1 @@ +unset alist[0] diff --git a/Task/Arrays/UNIX-Shell/arrays-8.sh b/Task/Arrays/UNIX-Shell/arrays-8.sh new file mode 100644 index 0000000000..a7334665a4 --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-8.sh @@ -0,0 +1,23 @@ +# pop ARRAY -- pop the last item on ARRAY and output it + +pop() { + local var=${1:?'Missing array name'} + local x ; eval "x=\${#$var[*]}" + if [[ $x > 0 ]]; then + local val ; eval "val=\"\${$var[$((--x))]}\"" + unset $var[$x] + else + echo 1>&2 "No items in $var" ; exit 1 + fi + echo "$val" +} + +alist=(a b c) +pop alist +a +pop alist +b +pop alist +c +pop alist +No items in alist diff --git a/Task/Arrays/UNIX-Shell/arrays-9.sh b/Task/Arrays/UNIX-Shell/arrays-9.sh new file mode 100644 index 0000000000..1e479a450e --- /dev/null +++ b/Task/Arrays/UNIX-Shell/arrays-9.sh @@ -0,0 +1 @@ +unset alist[*] diff --git a/Task/Arrays/Vala/arrays-1.vala b/Task/Arrays/Vala/arrays-1.vala new file mode 100644 index 0000000000..299efc31d7 --- /dev/null +++ b/Task/Arrays/Vala/arrays-1.vala @@ -0,0 +1,6 @@ +int[] array = new int[10]; + +array[0] = 1; +array[1] = 3; + +stdout.printf("%d\n", array[0]); diff --git a/Task/Arrays/Vala/arrays-2.vala b/Task/Arrays/Vala/arrays-2.vala new file mode 100644 index 0000000000..bd9c1baa3b --- /dev/null +++ b/Task/Arrays/Vala/arrays-2.vala @@ -0,0 +1,8 @@ +var array = new ArrayList (); + +array.add(1); +array.add(3); + +array[0] = 2; + +stdout.printf("%d\n", array[0]); diff --git a/Task/Arrays/X86-Assembly/arrays.x86 b/Task/Arrays/X86-Assembly/arrays.x86 new file mode 100644 index 0000000000..466f294dae --- /dev/null +++ b/Task/Arrays/X86-Assembly/arrays.x86 @@ -0,0 +1,78 @@ +section .text + global _start + + _print: + mov ebx, 1 + mov eax, 4 + int 0x80 + ret + + _start: + ;print out our byte array. ergo, String. + mov edx, sLen + mov ecx, sArray + call _print + mov edx, f_len + mov ecx, f_msg + call _print + mov edx, 6 ;our array members length. + xor ecx, ecx + mov ecx, 4 + ;turnicate through the array and print all it's members. + ;At an offset of *4, each array member is referenced + ;at 1,2,3 and so on. + _out_loops: + push ecx + mov ecx, [fArray+esi*4] + call _print + inc esi + pop ecx + loop _out_loops + mov edx, u_len + mov ecx, u_msg + call _print + ;Let's populate 'uArray' with something from sArray. + ;mov edi, uArray + mov ecx, 4 + xor esi, esi + _read_loops: + push dword [fArray+esi*4] + pop dword [uArray+esi*4] + inc esi + loop _read_loops + mov ecx, 4 + xor esi, esi + _out_loops2: + push ecx + mov ecx, [uArray+esi*4] + call _print + inc esi + pop ecx + loop _out_loops2 + push 0x1 + mov eax, 1 + push eax + int 0x80 + +section .data +sArray db 'a','r','r','a','y','s',' ','a','r','e',' ','f','u','n',0xa +sLen equ $-sArray + +crap1 db "crap1",0xa +crap2 db "crap2",0xa +crap3 db "crap3",0xa +crap4 db "crap4",0xa + +fArray dd crap1,crap2 + dd crap3,crap4 + +f_msg db "fArray contents",0xa,"----------------------",0xa +f_len equ $-f_msg +u_msg db "uArray now holds fArray contents.. dumping..",0xa,"----------------------",0xa +u_len equ $-u_msg + +section .bss +uArray resd 1 + resd 1 + resd 1 + resd 1 diff --git a/Task/Arrays/XPL0/arrays.xpl0 b/Task/Arrays/XPL0/arrays.xpl0 new file mode 100644 index 0000000000..7c2abc132c --- /dev/null +++ b/Task/Arrays/XPL0/arrays.xpl0 @@ -0,0 +1,8 @@ +include c:\cxpl\codes; +char A(10); \creates a static array of 10 bytes, pointed to by "A" +char B; \declares a variable for a pointer to a dynamic array +[A(3):= 14; +B:= Reserve(10); \reserve 10 bytes and point to their starting address +B(7):= 28; +IntOut(0, A(3)+B(7)); \displays 42 +] diff --git a/Task/Assertions/Component-Pascal/assertions.pascal b/Task/Assertions/Component-Pascal/assertions.component similarity index 100% rename from Task/Assertions/Component-Pascal/assertions.pascal rename to Task/Assertions/Component-Pascal/assertions.component diff --git a/Task/Assertions/Mathematica/assertions.mathematica b/Task/Assertions/Mathematica/assertions.math similarity index 100% rename from Task/Assertions/Mathematica/assertions.mathematica rename to Task/Assertions/Mathematica/assertions.math diff --git a/Task/Assertions/Nimrod/assertions.nimrod b/Task/Assertions/Nimrod/assertions.nimrod new file mode 100644 index 0000000000..541f20f9c9 --- /dev/null +++ b/Task/Assertions/Nimrod/assertions.nimrod @@ -0,0 +1,2 @@ +var a = 42 +assert(a == 42) diff --git a/Task/Assertions/OCaml/assertions.ocaml b/Task/Assertions/OCaml/assertions.ocaml new file mode 100644 index 0000000000..7ba05242f2 --- /dev/null +++ b/Task/Assertions/OCaml/assertions.ocaml @@ -0,0 +1,3 @@ +let a = get_some_value () in + assert (a = 42); (* throws Assert_failure when a is not 42 *) + (* evaluate stuff to return here when a is 42 *) diff --git a/Task/Assertions/Oberon-2/assertions.oberon-2 b/Task/Assertions/Oberon-2/assertions.oberon-2 new file mode 100644 index 0000000000..82763732bf --- /dev/null +++ b/Task/Assertions/Oberon-2/assertions.oberon-2 @@ -0,0 +1,7 @@ +MODULE Assertions; +VAR + a: INTEGER; +BEGIN + a := 40; + ASSERT(a = 42); +END Assertions. diff --git a/Task/Assertions/Objective-C/assertions-1.m b/Task/Assertions/Objective-C/assertions-1.m new file mode 100644 index 0000000000..4cc30939e6 --- /dev/null +++ b/Task/Assertions/Objective-C/assertions-1.m @@ -0,0 +1 @@ +NSAssert(a == 42, @"Error message"); diff --git a/Task/Assertions/Objective-C/assertions-2.m b/Task/Assertions/Objective-C/assertions-2.m new file mode 100644 index 0000000000..83cf0f8e7b --- /dev/null +++ b/Task/Assertions/Objective-C/assertions-2.m @@ -0,0 +1 @@ +NSAssert1(a == 42, @"a is not 42, a is actually %d", a); # has 1 formatting arg, so use NSAssert"1" diff --git a/Task/Assertions/Oz/assertions.oz b/Task/Assertions/Oz/assertions.oz new file mode 100644 index 0000000000..44798afbd5 --- /dev/null +++ b/Task/Assertions/Oz/assertions.oz @@ -0,0 +1,8 @@ +declare + proc {PrintNumber N} + N=42 %% assert + {Show N} + end +in + {PrintNumber 42} %% ok + {PrintNumber 11} %% throws diff --git a/Task/Assertions/PARI-GP/assertions.pari b/Task/Assertions/PARI-GP/assertions.pari new file mode 100644 index 0000000000..4007269324 --- /dev/null +++ b/Task/Assertions/PARI-GP/assertions.pari @@ -0,0 +1,10 @@ +#include + +void +test() +{ + int a; + // ... input or change a here + + assert(a == 42); // Aborts program if a is not 42, unless the NDEBUG macro was defined +} diff --git a/Task/Assertions/PL-I/assertions.pli b/Task/Assertions/PL-I/assertions.pli new file mode 100644 index 0000000000..6ef9a4d649 --- /dev/null +++ b/Task/Assertions/PL-I/assertions.pli @@ -0,0 +1,18 @@ +/* PL/I does not have an assert function as such, */ +/* but it is something that can be implemented in */ +/* any of several ways. A straight-forward way */ +/* raises a user-defined interrupt. */ + +on condition (assert_failure) snap + put skip list ('Assert failure'); +.... +if a ^= b then signal condition(assert_failure); + +/* Another way is to use the preprocessor, thus: */ +%assert: procedure (a, b) returns (character); + return ('if ' || a || '^=' || b || + ' then signal condition(assert_failure);'); +%end assert; +%activate assert; + +assert(a, 42); diff --git a/Task/Assertions/Perl-6/assertions.pl6 b/Task/Assertions/Perl-6/assertions.pl6 new file mode 100644 index 0000000000..0c831822fe --- /dev/null +++ b/Task/Assertions/Perl-6/assertions.pl6 @@ -0,0 +1,8 @@ +my $a = (1..100).pick; + +# with a (non-hygienic) macro +macro assert ($x) { "$x or die 'assertion failed: $x'" } +assert('$a == 42'); + +# but usually we just say +$a == 42 or die "$x ain't 42"; diff --git a/Task/Assertions/PureBasic/assertions-1.purebasic b/Task/Assertions/PureBasic/assertions-1.purebasic new file mode 100644 index 0000000000..5c0a493ac3 --- /dev/null +++ b/Task/Assertions/PureBasic/assertions-1.purebasic @@ -0,0 +1,8 @@ +Macro Assert(TEST,MSG="Assert: ") + CompilerIf #PB_Compiler_Debugger + If Not (TEST) + Debug MSG+" Line="+Str(#PB_Compiler_Line)+" in "+#PB_Compiler_File + CallDebugger + EndIf + CompilerEndIf +EndMacro diff --git a/Task/Assertions/PureBasic/assertions-2.purebasic b/Task/Assertions/PureBasic/assertions-2.purebasic new file mode 100644 index 0000000000..89c2da25f3 --- /dev/null +++ b/Task/Assertions/PureBasic/assertions-2.purebasic @@ -0,0 +1,4 @@ +A=42 +Assert(A=42,"Assert that A=42") +A=42-1 +Assert(A=42) diff --git a/Task/Assertions/RLaB/assertions.rlab b/Task/Assertions/RLaB/assertions.rlab new file mode 100644 index 0000000000..9558f22357 --- /dev/null +++ b/Task/Assertions/RLaB/assertions.rlab @@ -0,0 +1,6 @@ +// test if 'a' is 42, and if not stop the execution of the code and print +// some error message +if (a != 42) +{ + stop("a is not 42 as expected, therefore I stop until this issue is resolved!"); +} diff --git a/Task/Assertions/SPARK/assertions-1.spark b/Task/Assertions/SPARK/assertions-1.spark new file mode 100644 index 0000000000..f6214525f3 --- /dev/null +++ b/Task/Assertions/SPARK/assertions-1.spark @@ -0,0 +1 @@ +-# check X = 42; diff --git a/Task/Assertions/SPARK/assertions-2.spark b/Task/Assertions/SPARK/assertions-2.spark new file mode 100644 index 0000000000..2e18f64750 --- /dev/null +++ b/Task/Assertions/SPARK/assertions-2.spark @@ -0,0 +1 @@ +-# assert X = 42; diff --git a/Task/Assertions/SPARK/assertions-3.spark b/Task/Assertions/SPARK/assertions-3.spark new file mode 100644 index 0000000000..0a809955ab --- /dev/null +++ b/Task/Assertions/SPARK/assertions-3.spark @@ -0,0 +1,3 @@ +procedure P (X : in out Integer); +--# derives X from *; +--# pre X = 42; diff --git a/Task/Assertions/SPARK/assertions-4.spark b/Task/Assertions/SPARK/assertions-4.spark new file mode 100644 index 0000000000..0e4feb81da --- /dev/null +++ b/Task/Assertions/SPARK/assertions-4.spark @@ -0,0 +1,3 @@ +procedure P (X : in out Integer); +--# derives X from *; +--# post X = 42; diff --git a/Task/Assertions/SPARK/assertions-5.spark b/Task/Assertions/SPARK/assertions-5.spark new file mode 100644 index 0000000000..8f1371cf34 --- /dev/null +++ b/Task/Assertions/SPARK/assertions-5.spark @@ -0,0 +1,2 @@ +X := 7; +--# check X = 42; diff --git a/Task/Assertions/Slate/assertions.slate b/Task/Assertions/Slate/assertions.slate new file mode 100644 index 0000000000..5e0181ef47 --- /dev/null +++ b/Task/Assertions/Slate/assertions.slate @@ -0,0 +1,3 @@ +load: 'src/lib/assert.slate'. +define: #n -> 7. +assert: n = 42 &description: 'That is not the Answer.'. diff --git a/Task/Assertions/VBScript/assertions-1.vbscript b/Task/Assertions/VBScript/assertions-1.vbscript new file mode 100644 index 0000000000..3ee447a83c --- /dev/null +++ b/Task/Assertions/VBScript/assertions-1.vbscript @@ -0,0 +1,5 @@ +sub Assert( boolExpr, strOnFail ) + if not boolExpr then + Err.Raise vbObjectError + 99999, , strOnFail + end if +end sub diff --git a/Task/Assertions/VBScript/assertions-2.vbscript b/Task/Assertions/VBScript/assertions-2.vbscript new file mode 100644 index 0000000000..4a2b74bce0 --- /dev/null +++ b/Task/Assertions/VBScript/assertions-2.vbscript @@ -0,0 +1,3 @@ +dim i +i = 43 +Assert i=42, "There's got to be more to life than this!" diff --git a/Task/Assertions/VBScript/assertions-3.vbscript b/Task/Assertions/VBScript/assertions-3.vbscript new file mode 100644 index 0000000000..b80426879f --- /dev/null +++ b/Task/Assertions/VBScript/assertions-3.vbscript @@ -0,0 +1,2 @@ +>cscript "C:\foo\assert.vbs" +C:\foo\assert.vbs(3, 3) (null): There's got to be more to life than this! diff --git a/Task/Assertions/Vala/assertions.vala b/Task/Assertions/Vala/assertions.vala new file mode 100644 index 0000000000..a0b793c8d9 --- /dev/null +++ b/Task/Assertions/Vala/assertions.vala @@ -0,0 +1,4 @@ +int a = 42; +int b = 33; +assert (a == 42); +assert (b == 42); // will break the program with "assertion failed" error diff --git a/Task/Assertions/Visual-Basic/assertions.vb b/Task/Assertions/Visual-Basic/assertions.vb new file mode 100644 index 0000000000..44c1e5c060 --- /dev/null +++ b/Task/Assertions/Visual-Basic/assertions.vb @@ -0,0 +1 @@ +Debug.Assert i = 42 diff --git a/Task/Assertions/XPL0/assertions.xpl0 b/Task/Assertions/XPL0/assertions.xpl0 new file mode 100644 index 0000000000..40daea3c39 --- /dev/null +++ b/Task/Assertions/XPL0/assertions.xpl0 @@ -0,0 +1,10 @@ +proc Fatal(Str); \Display error message and terminate program +char Str; +[\return; uncomment this if "assertions" are to be disabled +SetVid(3); \set normal text display if program uses graphics +Text(0, Str); \display error message +ChOut(0, 7); \sound the bell +exit 1; \terminate the program; pass optional error code to DOS +]; + +if X#42 then Fatal("X#42"); diff --git a/Task/Associative-array-Creation/Mathematica/associative-array-creation.mathematica b/Task/Associative-array-Creation/Mathematica/associative-array-creation.math similarity index 100% rename from Task/Associative-array-Creation/Mathematica/associative-array-creation.mathematica rename to Task/Associative-array-Creation/Mathematica/associative-array-creation.math diff --git a/Task/Associative-array-Creation/Nemerle/associative-array-creation.nemerle b/Task/Associative-array-Creation/Nemerle/associative-array-creation.nemerle new file mode 100644 index 0000000000..b35019bf2e --- /dev/null +++ b/Task/Associative-array-Creation/Nemerle/associative-array-creation.nemerle @@ -0,0 +1,17 @@ +using System; +using System.Console; +using Nemerle.Collections; + +module AssocArray +{ + Main() : void + { + def hash1 = Hashtable([(1, "one"), (2, "two"), (3, "three")]); + def hash2 = Hashtable(3); + foreach (e in hash1) + hash2[e.Value] = e.Key; + WriteLine("Enter 1, 2, or 3:"); + def entry = int.Parse(ReadLine()); + WriteLine(hash1[entry]); + } +} diff --git a/Task/Associative-array-Creation/NetRexx/associative-array-creation.netrexx b/Task/Associative-array-Creation/NetRexx/associative-array-creation.netrexx new file mode 100644 index 0000000000..fcbfe3e662 --- /dev/null +++ b/Task/Associative-array-Creation/NetRexx/associative-array-creation.netrexx @@ -0,0 +1,12 @@ +/* NetRexx */ + +options replace format comments java crossref savelog symbols + +key0 = '0' +key1 = 'key0' + +hash = '.' -- Initialize the associative array 'hash' to '.' +hash[key1] = 'value0' -- Set a specific key/value pair + +say '' -- Display a value for a key that wasn't set +say '' -- Display a value for a key that was set diff --git a/Task/Associative-array-Creation/OCaml/associative-array-creation-1.ocaml b/Task/Associative-array-Creation/OCaml/associative-array-creation-1.ocaml new file mode 100644 index 0000000000..3044663818 --- /dev/null +++ b/Task/Associative-array-Creation/OCaml/associative-array-creation-1.ocaml @@ -0,0 +1,3 @@ +let hash = Hashtbl.create 0;; +List.iter (fun (key, value) -> Hashtbl.add hash key value) + ["foo", 5; "bar", 10; "baz", 15];; diff --git a/Task/Associative-array-Creation/OCaml/associative-array-creation-2.ocaml b/Task/Associative-array-Creation/OCaml/associative-array-creation-2.ocaml new file mode 100644 index 0000000000..8176324c24 --- /dev/null +++ b/Task/Associative-array-Creation/OCaml/associative-array-creation-2.ocaml @@ -0,0 +1 @@ +let bar = Hashtbl.find hash "bar";; (* bar = 10 *) diff --git a/Task/Associative-array-Creation/OCaml/associative-array-creation-3.ocaml b/Task/Associative-array-Creation/OCaml/associative-array-creation-3.ocaml new file mode 100644 index 0000000000..d06a537eca --- /dev/null +++ b/Task/Associative-array-Creation/OCaml/associative-array-creation-3.ocaml @@ -0,0 +1 @@ +let quux = try Hashtbl.find hash "quux" with Not_found -> some_value;; diff --git a/Task/Associative-array-Creation/OCaml/associative-array-creation-4.ocaml b/Task/Associative-array-Creation/OCaml/associative-array-creation-4.ocaml new file mode 100644 index 0000000000..f7aa3e99d3 --- /dev/null +++ b/Task/Associative-array-Creation/OCaml/associative-array-creation-4.ocaml @@ -0,0 +1,12 @@ +module String = struct + type t = string + let compare = Pervasives.compare +end +module StringMap = Map.Make(String);; + +let map = + List.fold_left + (fun map (key, value) -> StringMap.add key value map) + StringMap.empty + ["foo", 5; "bar", 10; "baz", 15] +;; diff --git a/Task/Associative-array-Creation/OCaml/associative-array-creation-5.ocaml b/Task/Associative-array-Creation/OCaml/associative-array-creation-5.ocaml new file mode 100644 index 0000000000..9d1ff2239d --- /dev/null +++ b/Task/Associative-array-Creation/OCaml/associative-array-creation-5.ocaml @@ -0,0 +1 @@ +let bar = StringMap.find "bar" map;; (* bar = 10 *) diff --git a/Task/Associative-array-Creation/OCaml/associative-array-creation-6.ocaml b/Task/Associative-array-Creation/OCaml/associative-array-creation-6.ocaml new file mode 100644 index 0000000000..734ccaabbe --- /dev/null +++ b/Task/Associative-array-Creation/OCaml/associative-array-creation-6.ocaml @@ -0,0 +1 @@ +let quux = try StringMap.find "quux" map with Not_found -> some_value;; diff --git a/Task/Associative-array-Creation/OCaml/associative-array-creation-7.ocaml b/Task/Associative-array-Creation/OCaml/associative-array-creation-7.ocaml new file mode 100644 index 0000000000..f1bfc91de0 --- /dev/null +++ b/Task/Associative-array-Creation/OCaml/associative-array-creation-7.ocaml @@ -0,0 +1,7 @@ +let dict = ["foo", 5; "bar", 10; "baz", 15] + +(* retrieve value *) +let bar_num = try List.assoc "bar" dict with Not_found -> 0;; + +(* see if key exists *) +print_endline (if List.mem_assoc "foo" dict then "key found" else "key missing") diff --git a/Task/Associative-array-Creation/Objeck/associative-array-creation-1.objeck b/Task/Associative-array-Creation/Objeck/associative-array-creation-1.objeck new file mode 100644 index 0000000000..7013e1a16e --- /dev/null +++ b/Task/Associative-array-Creation/Objeck/associative-array-creation-1.objeck @@ -0,0 +1,10 @@ +# create map +map := StringMap->New(); +# insert +map->Insert("two", IntHolder->New(2)->As(Base)); +map->Insert("thirteen", IntHolder->New(13)->As(Base)); +map->Insert("five", IntHolder->New(5)->As(Base)); +map->Insert("seven", IntHolder->New(7)->As(Base)); +# find +map->Find("thirteen")->As(IntHolder)->GetValue()->PrintLine(); +map->Find("seven")->As(IntHolder)->GetValue()->PrintLine(); diff --git a/Task/Associative-array-Creation/Objeck/associative-array-creation-2.objeck b/Task/Associative-array-Creation/Objeck/associative-array-creation-2.objeck new file mode 100644 index 0000000000..3606493446 --- /dev/null +++ b/Task/Associative-array-Creation/Objeck/associative-array-creation-2.objeck @@ -0,0 +1,10 @@ +# create map +map := StringHash->New(); +# insert +map->Insert("two", IntHolder->New(2)->As(Base)); +map->Insert("thirteen", IntHolder->New(13)->As(Base)); +map->Insert("five", IntHolder->New(5)->As(Base)); +map->Insert("seven", IntHolder->New(7)->As(Base)); +# find +map->Find("thirteen")->As(IntHolder)->GetValue()->PrintLine(); +map->Find("seven")->As(IntHolder)->GetValue()->PrintLine(); diff --git a/Task/Associative-array-Creation/Objective-C/associative-array-creation-1.m b/Task/Associative-array-Creation/Objective-C/associative-array-creation-1.m new file mode 100644 index 0000000000..d606af58b5 --- /dev/null +++ b/Task/Associative-array-Creation/Objective-C/associative-array-creation-1.m @@ -0,0 +1,5 @@ +NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: + @"Joe Doe", @"name", + [NSNumber numberWithUnsignedInt:42], @"age", + [NSNull null], @"extra", + nil]; diff --git a/Task/Associative-array-Creation/Objective-C/associative-array-creation-2.m b/Task/Associative-array-Creation/Objective-C/associative-array-creation-2.m new file mode 100644 index 0000000000..5ce16e9684 --- /dev/null +++ b/Task/Associative-array-Creation/Objective-C/associative-array-creation-2.m @@ -0,0 +1,5 @@ +NSDictionary *dict = @{ + @"name": @"Joe Doe", + @"age": @42, + @"extra": [NSNull null], + }; diff --git a/Task/Associative-array-Creation/Objective-C/associative-array-creation-3.m b/Task/Associative-array-Creation/Objective-C/associative-array-creation-3.m new file mode 100644 index 0000000000..9d6cd4c6bc --- /dev/null +++ b/Task/Associative-array-Creation/Objective-C/associative-array-creation-3.m @@ -0,0 +1,3 @@ +NSMutableDictionary *dict = [NSMutableDictionary dictionary]; +[dict setObject:@"Joe Doe" forKey:@"name"]; +[dict setObject:[NSNumber numberWithInt:42] forKey:@"age"]; diff --git a/Task/Associative-array-Creation/Objective-C/associative-array-creation-4.m b/Task/Associative-array-Creation/Objective-C/associative-array-creation-4.m new file mode 100644 index 0000000000..f81d3922ce --- /dev/null +++ b/Task/Associative-array-Creation/Objective-C/associative-array-creation-4.m @@ -0,0 +1,3 @@ +NSString *name = [dict objectForKey:@"name"]; +unsigned age = [dict objectForKey:@"age"] unsignedIntValue]; +id missing = [dict objectForKey:@"missing"]; diff --git a/Task/Associative-array-Creation/OxygenBasic/associative-array-creation.oxy b/Task/Associative-array-Creation/OxygenBasic/associative-array-creation.oxy new file mode 100644 index 0000000000..ed2581eda4 --- /dev/null +++ b/Task/Associative-array-Creation/OxygenBasic/associative-array-creation.oxy @@ -0,0 +1,52 @@ +def n 200 + +Class AssociativeArray +'===================== + + indexbase 1 + string s[n] + sys max + + method find(string k) as sys + sys i,e + e=max*2 + for i=1 to e step 2 + if k=s[i] then return i + next + end method + + method dat(string k) as string + sys i=find(k) + if i then return s[i+1] + end method + + method dat(string k, d) as sys + sys i=find(k) + if i=0 then + if max>=n + print "Array overflow" : return 0 + end if + max+=1 + i=max*2-1 + s[i]=k + end if + s[i+1]=d + return i + end method + +end class + + +'==== +'TEST +'==== + +AssociativeArray A + +'fill +A.s<={"shoes","LC1", "ships","LC2", "sealingwax","LC3", "cabbages","LC4", "kings","LC5"} +A.max=5 +'access +print A.dat("ships") 'result LC2 +A.dat("computers")="LC99" ' +print A.dat("computers") 'result LC99 diff --git a/Task/Associative-array-Creation/Oz/associative-array-creation-1.oz b/Task/Associative-array-Creation/Oz/associative-array-creation-1.oz new file mode 100644 index 0000000000..7fa80229f1 --- /dev/null +++ b/Task/Associative-array-Creation/Oz/associative-array-creation-1.oz @@ -0,0 +1,9 @@ +declare + Dict = {Dictionary.new} +in + Dict.foo := 5 + Dict.bar := 10 + Dict.baz := 15 + Dict.foo := 20 + + {Inspect Dict} diff --git a/Task/Associative-array-Creation/Oz/associative-array-creation-2.oz b/Task/Associative-array-Creation/Oz/associative-array-creation-2.oz new file mode 100644 index 0000000000..16ec907e09 --- /dev/null +++ b/Task/Associative-array-Creation/Oz/associative-array-creation-2.oz @@ -0,0 +1,4 @@ +declare + Rec = name(foo:5 bar:10 baz:20) +in + {Inspect Rec} diff --git a/Task/Associative-array-Creation/PL-SQL/associative-array-creation.sql b/Task/Associative-array-Creation/PL-SQL/associative-array-creation.sql new file mode 100644 index 0000000000..fc80f8ac1c --- /dev/null +++ b/Task/Associative-array-Creation/PL-SQL/associative-array-creation.sql @@ -0,0 +1,14 @@ +DECLARE + type assocArrayType is record ( + myShape VARCHAR2(20), + mySize number, + isActive BOOLEAN + ); + assocArray assocArrayType; +BEGIN + assocArray.myShape := 'circle'; + + dbms_output.put_line ('assocArray.myShape: ' || assocArray.myShape); + dbms_output.put_line ('assocArray.mySize: ' || assocArray.mySize); +END; +/ diff --git a/Task/Associative-array-Creation/Perl-6/associative-array-creation-1.pl6 b/Task/Associative-array-Creation/Perl-6/associative-array-creation-1.pl6 new file mode 100644 index 0000000000..fb4ebecda9 --- /dev/null +++ b/Task/Associative-array-Creation/Perl-6/associative-array-creation-1.pl6 @@ -0,0 +1,2 @@ +my %h1 = key1 => 'val1', 'key-2' => 2, three => -238.83, 4 => 'val3'; +my %h2 = 'key1', 'val1', 'key-2', 2, 'three', -238.83, 4, 'val3'; diff --git a/Task/Associative-array-Creation/Perl-6/associative-array-creation-2.pl6 b/Task/Associative-array-Creation/Perl-6/associative-array-creation-2.pl6 new file mode 100644 index 0000000000..10a1790b3d --- /dev/null +++ b/Task/Associative-array-Creation/Perl-6/associative-array-creation-2.pl6 @@ -0,0 +1,3 @@ +my @a = 1..5; +my @b = 'a'..'e'; +my %h = @a Z=> @b; diff --git a/Task/Associative-array-Creation/Perl-6/associative-array-creation-3.pl6 b/Task/Associative-array-Creation/Perl-6/associative-array-creation-3.pl6 new file mode 100644 index 0000000000..d86aec54ad --- /dev/null +++ b/Task/Associative-array-Creation/Perl-6/associative-array-creation-3.pl6 @@ -0,0 +1,4 @@ +say %h1{'key1'}; +say %h1; +%h1 = 'val1'; +%h1 = 'val1', -238.83; diff --git a/Task/Associative-array-Creation/Perl-6/associative-array-creation-4.pl6 b/Task/Associative-array-Creation/Perl-6/associative-array-creation-4.pl6 new file mode 100644 index 0000000000..008456f898 --- /dev/null +++ b/Task/Associative-array-Creation/Perl-6/associative-array-creation-4.pl6 @@ -0,0 +1,2 @@ +my $h = {key1 => 'val1', 'key-2' => 2, three => -238.83, 4 => 'val3'}; +say $h; diff --git a/Task/Associative-array-Creation/Pop11/associative-array-creation.pop11 b/Task/Associative-array-Creation/Pop11/associative-array-creation.pop11 new file mode 100644 index 0000000000..e4725f3a5e --- /dev/null +++ b/Task/Associative-array-Creation/Pop11/associative-array-creation.pop11 @@ -0,0 +1,22 @@ +;;; Create expandable hash table of initial size 50 and with default +;;; value 0 (default value is returned when the item is absent). +vars ht = newmapping([], 50, 0, true); +;;; Set value corresponding to string 'foo' +12 -> ht('foo'); +;;; print it +ht('foo') => +;;; Set value corresponding to vector {1 2 3} +17 -> ht({1 2 3}); +;;; print it +ht({1 2 3}) => +;;; Set value corresponding to number 42 to vector {0 1} +{0 1} -> ht(42); +;;; print it +ht(42) => + +;;; Iterate over keys printing keys and values. + appproperty(ht, + procedure (key, value); + printf(value, '%p\t'); + printf(key, '%p\n'); + endprocedure); diff --git a/Task/Associative-array-Creation/PostScript/associative-array-creation.ps b/Task/Associative-array-Creation/PostScript/associative-array-creation.ps new file mode 100644 index 0000000000..6e6ce2a58b --- /dev/null +++ b/Task/Associative-array-Creation/PostScript/associative-array-creation.ps @@ -0,0 +1,2 @@ + <> + dup /a get = diff --git a/Task/Associative-array-Creation/PowerShell/associative-array-creation-1.psh b/Task/Associative-array-Creation/PowerShell/associative-array-creation-1.psh new file mode 100644 index 0000000000..d9f043c4ab --- /dev/null +++ b/Task/Associative-array-Creation/PowerShell/associative-array-creation-1.psh @@ -0,0 +1 @@ +$hashtable = @{} diff --git a/Task/Associative-array-Creation/PowerShell/associative-array-creation-2.psh b/Task/Associative-array-Creation/PowerShell/associative-array-creation-2.psh new file mode 100644 index 0000000000..23dfff3cfe --- /dev/null +++ b/Task/Associative-array-Creation/PowerShell/associative-array-creation-2.psh @@ -0,0 +1,4 @@ +$hashtable = @{ + "key1" = "value 1" + "key2" = 5 +} diff --git a/Task/Associative-array-Creation/PowerShell/associative-array-creation-3.psh b/Task/Associative-array-Creation/PowerShell/associative-array-creation-3.psh new file mode 100644 index 0000000000..be15395c66 --- /dev/null +++ b/Task/Associative-array-Creation/PowerShell/associative-array-creation-3.psh @@ -0,0 +1,4 @@ +$hashtable.foo = "bar" +$hashtable['bar'] = 42 +$hashtable."a b" = 3.14 # keys can contain spaces, property-style access needs quotation marks, then +$hashtable[5] = 8 # keys don't need to be strings diff --git a/Task/Associative-array-Creation/PowerShell/associative-array-creation-4.psh b/Task/Associative-array-Creation/PowerShell/associative-array-creation-4.psh new file mode 100644 index 0000000000..b2af6c89a4 --- /dev/null +++ b/Task/Associative-array-Creation/PowerShell/associative-array-creation-4.psh @@ -0,0 +1,2 @@ +$hashtable.key1 # value 1 +$hashtable['key2'] # 5 diff --git a/Task/Associative-array-Creation/PowerShell/associative-array-creation-5.psh b/Task/Associative-array-Creation/PowerShell/associative-array-creation-5.psh new file mode 100644 index 0000000000..6a2ede739e --- /dev/null +++ b/Task/Associative-array-Creation/PowerShell/associative-array-creation-5.psh @@ -0,0 +1,6 @@ +$addressObj= "" | Select-Object nameStr,street1Str,street2Str,cityStr,stateStr,zipStr +$addressObj.nameStr = [string]"FirstName LastName" +$addressObj.street1Str= [string]"1 Main Street" +$addressObj.cityStr= [string]"Washington DC" +$addressObj.stateStr= [string]"DC" +$addressObj.zipStr= [string]"20009" diff --git a/Task/Associative-array-Creation/PureBasic/associative-array-creation.purebasic b/Task/Associative-array-Creation/PureBasic/associative-array-creation.purebasic new file mode 100644 index 0000000000..a1d0f1accc --- /dev/null +++ b/Task/Associative-array-Creation/PureBasic/associative-array-creation.purebasic @@ -0,0 +1,3 @@ +NewMap dict.s() +dict("country") = "Germany" +Debug dict("country") diff --git a/Task/Associative-array-Creation/RLaB/associative-array-creation.rlab b/Task/Associative-array-Creation/RLaB/associative-array-creation.rlab new file mode 100644 index 0000000000..bcc019c61b --- /dev/null +++ b/Task/Associative-array-Creation/RLaB/associative-array-creation.rlab @@ -0,0 +1,24 @@ +x = <<>>; // create an empty list using strings as identifiers. +x.red = strtod("0xff0000"); // RLaB doesn't deal with hexadecimal numbers directly. Thus we +x.green = strtod("0x00ff00"); // convert it to real numbers using ''strtod'' function. +x.blue = strtod("0x0000ff"); + +// print content of a list +for (i in members(x)) +{ printf("%8s %06x\n", i, int(x.[i])); } // we have to use ''int'' function to convert reals to integers so "%x" format works + +// deleting a key/value +clear (x.red); + +// we can also use numeric identifiers in the above example +xid = members(x); // this is a string array + +for (i in 1:length(xid)) +{ printf("%8s %06x\n", xid[i], int(x.[ xid[i] ])); } + +// Finally, we can use numerical identifiers +// Note: ''members'' function orders the list identifiers lexicographically, in other words +// instead of, say, 1,2,3,4,5,6,7,8,9,10,11 ''members'' returns 1,10,11,2,3,4,5,6,7,8,9 +x = <<>>; // create an empty list +for (i in 1:5) +{ x.[i] = i; } // assign to the element of list ''i'' the real value equal to i. diff --git a/Task/Associative-array-Creation/Raven/associative-array-creation.raven b/Task/Associative-array-Creation/Raven/associative-array-creation.raven new file mode 100644 index 0000000000..5457e1805e --- /dev/null +++ b/Task/Associative-array-Creation/Raven/associative-array-creation.raven @@ -0,0 +1,13 @@ +{ 'a' 1 'b' 2 'c' 3.14 'd' 'xyz' } as a_hash +a_hash print + +hash (4 items) + a => 1 + b => 2 + c => 3.14 + d => "xyz" + +a_hash 'c' get # get key 'c' +6.28 a_hash 'c' set # set key 'c' +a_hash.'c' # get key 'c' shorthand +6.28 a_hash:'c' # set key 'c' shorthand diff --git a/Task/Associative-array-Creation/Retro/associative-array-creation.retro b/Task/Associative-array-Creation/Retro/associative-array-creation.retro new file mode 100644 index 0000000000..e43229e1bc --- /dev/null +++ b/Task/Associative-array-Creation/Retro/associative-array-creation.retro @@ -0,0 +1,8 @@ +with hashTable' +hashTable constant table + +table %{ first = 100 }% +table %{ second = "hello, world!" keepString %} + +table @" first" putn +table @" second" puts diff --git a/Task/Associative-array-Creation/SNOBOL4/associative-array-creation.sno b/Task/Associative-array-Creation/SNOBOL4/associative-array-creation.sno new file mode 100644 index 0000000000..753f9554f4 --- /dev/null +++ b/Task/Associative-array-Creation/SNOBOL4/associative-array-creation.sno @@ -0,0 +1,9 @@ + t = table() + t<"red"> = "#ff0000" + t<"green"> = "#00ff00" + t<"blue"> = "#0000ff" + + output = t<"red"> + output = t<"blue"> + output = t<"green"> +end diff --git a/Task/Associative-array-Creation/Seed7/associative-array-creation.seed7 b/Task/Associative-array-Creation/Seed7/associative-array-creation.seed7 new file mode 100644 index 0000000000..e17669572e --- /dev/null +++ b/Task/Associative-array-Creation/Seed7/associative-array-creation.seed7 @@ -0,0 +1,45 @@ +$ include "seed7_05.s7i"; + +# Define hash type +const type: myHashType is hash [string] integer; + +# Define hash table +var myHashType: aHash is myHashType.value; + +const proc: main is func + local + var string: stri is ""; + var integer: number is 0; + begin + # Add elements + aHash @:= ["foo"] 42; + aHash @:= ["bar"] 100; + + # Check presence of an element + if "foo" in aHash then + + # Access an element + writeln(aHash["foo"]); + end if; + + # Change an element + aHash @:= ["foo"] 7; + + # Remove an element + excl(aHash, "foo"); + + # Loop over the hash values + for number range aHash do + writeln(number); + end for; + + # Loop over the hash keys + for key stri range aHash do + writeln(stri); + end for; + + # Loop over hash keys and values + for number key stri range aHash do + writeln("key: " <& stri <& ", value: " <& number); + end for; + end func; diff --git a/Task/Associative-array-Creation/Slate/associative-array-creation.slate b/Task/Associative-array-Creation/Slate/associative-array-creation.slate new file mode 100644 index 0000000000..4d45545fd2 --- /dev/null +++ b/Task/Associative-array-Creation/Slate/associative-array-creation.slate @@ -0,0 +1 @@ +Dictionary new*, 'MI' -> 'Michigan', 'MN' -> 'Minnesota' diff --git a/Task/Associative-array-Creation/Toka/associative-array-creation.toka b/Task/Associative-array-Creation/Toka/associative-array-creation.toka new file mode 100644 index 0000000000..224b2354cd --- /dev/null +++ b/Task/Associative-array-Creation/Toka/associative-array-creation.toka @@ -0,0 +1,14 @@ +needs asarray + +( create an associative array ) +1024 cells is-asarray foo + +( store 100 as the "first" element in the array ) +100 " first" foo asarray.put + +( store 200 as the "second" element in the array ) +200 " second" foo asarray.put + +( obtain and print the values ) +" first" foo asarray.get . +" second" foo asarray.get . diff --git a/Task/Associative-array-Creation/UnixPipes/associative-array-creation.unixpipes b/Task/Associative-array-Creation/UnixPipes/associative-array-creation.unixpipes new file mode 100644 index 0000000000..26dc85bebc --- /dev/null +++ b/Task/Associative-array-Creation/UnixPipes/associative-array-creation.unixpipes @@ -0,0 +1,44 @@ +map='p.map' + +function init() { +cat < $map +apple a +boy b +cat c +dog d +elephant e +EOF +} + +function put() { + k=$1; v=$2; + del $k + echo $v $k >> $map + } + +function get() { + k=$1 + for v in $(cat $map | grep "$k$"); do + echo $v + break + done + } + +function del() { + k=$1 + temp=$(mktemp) + mv $map $temp + cat $temp | grep -v "$k$" > $map +} + +function dump() { + echo "-- Dump begin --" + cat $map + echo "-- Dump complete --" +} + +init +get c +put c cow +get c +dump diff --git a/Task/Associative-array-Creation/Vala/associative-array-creation.vala b/Task/Associative-array-Creation/Vala/associative-array-creation.vala new file mode 100644 index 0000000000..364faf0dc3 --- /dev/null +++ b/Task/Associative-array-Creation/Vala/associative-array-creation.vala @@ -0,0 +1,17 @@ +using Gee; + +void main(){ + var map = new HashMap(); // creates a HashMap with keys of type string, and values of type int + + // two methods to set key,value pair + map["one"] = 1; + map["two"] = 2; + + map.set("four", 4); + map.set("five", 5); + + // two methods of getting key,value pair + stdout.printf("%d\n", map["one"]); + + stdout.printf("%d\n", map.get("two")); +} diff --git a/Task/Associative-array-Creation/XPL0/associative-array-creation.xpl0 b/Task/Associative-array-Creation/XPL0/associative-array-creation.xpl0 new file mode 100644 index 0000000000..a300f63691 --- /dev/null +++ b/Task/Associative-array-Creation/XPL0/associative-array-creation.xpl0 @@ -0,0 +1,27 @@ +include c:\cxpl\stdlib; +char Dict(10,10); +int Entries; + +proc AddEntry(Letter, Greek); \Insert entry into associative array +char Letter, Greek; +[Dict(Entries,0):= Letter; +StrCopy(Greek, @Dict(Entries,1)); +Entries:= Entries+1; \(limit checks ignored for simplicity) +]; + +func Lookup(Greek); \Given Greek name return English letter +char Greek; +int I; +[for I:= 0, Entries-1 do + if StrCmp(Greek, @Dict(I,1)) = 0 then return Dict(I,0); +return ^?; +]; + +[Entries:= 0; +AddEntry(^A, "alpha"); +AddEntry(^D, "delta"); +AddEntry(^B, "beta"); +AddEntry(^C, "gamma"); +ChOut(0, Lookup("beta")); CrLf(0); +ChOut(0, Lookup("omega")); CrLf(0); +] diff --git a/Task/Associative-array-Iteration/CoffeeScript/associative-array-iteration.coffee b/Task/Associative-array-Iteration/CoffeeScript/associative-array-iteration.coffeescript similarity index 100% rename from Task/Associative-array-Iteration/CoffeeScript/associative-array-iteration.coffee rename to Task/Associative-array-Iteration/CoffeeScript/associative-array-iteration.coffeescript diff --git a/Task/Associative-array-Iteration/Mathematica/associative-array-iteration.mathematica b/Task/Associative-array-Iteration/Mathematica/associative-array-iteration.math similarity index 100% rename from Task/Associative-array-Iteration/Mathematica/associative-array-iteration.mathematica rename to Task/Associative-array-Iteration/Mathematica/associative-array-iteration.math diff --git a/Task/Associative-array-Iteration/NetRexx/associative-array-iteration.netrexx b/Task/Associative-array-Iteration/NetRexx/associative-array-iteration.netrexx new file mode 100644 index 0000000000..f106174905 --- /dev/null +++ b/Task/Associative-array-Iteration/NetRexx/associative-array-iteration.netrexx @@ -0,0 +1,14 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols + +surname = 'Unknown' -- default value +surname['Fred'] = 'Bloggs' +surname['Davy'] = 'Jones' + +try = 'Fred' +say surname[try] surname['Bert'] + +-- extract the keys +loop fn over surname + say fn.right(10) ':' surname[fn] + end fn diff --git a/Task/Associative-array-Iteration/OCaml/associative-array-iteration-1.ocaml b/Task/Associative-array-Iteration/OCaml/associative-array-iteration-1.ocaml new file mode 100644 index 0000000000..388ed918be --- /dev/null +++ b/Task/Associative-array-Iteration/OCaml/associative-array-iteration-1.ocaml @@ -0,0 +1,15 @@ +#!/usr/bin/env ocaml + +let map = [| ('A', 1); ('B', 2); ('C', 3) |] ;; + +(* iterate over pairs *) +Array.iter (fun (k,v) -> Printf.printf "key: %c - value: %d\n" k v) map ;; + +(* iterate over keys *) +Array.iter (fun (k,_) -> Printf.printf "key: %c\n" k) map ;; + +(* iterate over values *) +Array.iter (fun (_,v) -> Printf.printf "value: %d\n" v) map ;; + +(* in functional programming it is often more useful to fold over the elements *) +Array.fold_left (fun acc (k,v) -> acc ^ Printf.sprintf "key: %c - value: %d\n" k v) "Elements:\n" map ;; diff --git a/Task/Associative-array-Iteration/OCaml/associative-array-iteration-2.ocaml b/Task/Associative-array-Iteration/OCaml/associative-array-iteration-2.ocaml new file mode 100644 index 0000000000..a7230d5aa5 --- /dev/null +++ b/Task/Associative-array-Iteration/OCaml/associative-array-iteration-2.ocaml @@ -0,0 +1,10 @@ +let map = Hashtbl.create 42;; +Hashtbl.add map 'A' 1;; +Hashtbl.add map 'B' 2;; +Hashtbl.add map 'C' 3;; + +(* iterate over pairs *) +Hashtbl.iter (fun k v -> Printf.printf "key: %c - value: %d\n" k v) map ;; + +(* in functional programming it is often more useful to fold over the elements *) +Hashtbl.fold (fun k v acc -> acc ^ Printf.sprintf "key: %c - value: %d\n" k v) map "Elements:\n" ;; diff --git a/Task/Associative-array-Iteration/OCaml/associative-array-iteration-3.ocaml b/Task/Associative-array-Iteration/OCaml/associative-array-iteration-3.ocaml new file mode 100644 index 0000000000..4b95bc0d9c --- /dev/null +++ b/Task/Associative-array-Iteration/OCaml/associative-array-iteration-3.ocaml @@ -0,0 +1,11 @@ +module CharMap = Map.Make (Char);; +let map = CharMap.empty;; +let map = CharMap.add 'A' 1 map;; +let map = CharMap.add 'B' 2 map;; +let map = CharMap.add 'C' 3 map;; + +(* iterate over pairs *) +CharMap.iter (fun k v -> Printf.printf "key: %c - value: %d\n" k v) map ;; + +(* in functional programming it is often more useful to fold over the elements *) +CharMap.fold (fun k v acc -> acc ^ Printf.sprintf "key: %c - value: %d\n" k v) map "Elements:\n" ;; diff --git a/Task/Associative-array-Iteration/Objeck/associative-array-iteration.objeck b/Task/Associative-array-Iteration/Objeck/associative-array-iteration.objeck new file mode 100644 index 0000000000..909f6a0fc6 --- /dev/null +++ b/Task/Associative-array-Iteration/Objeck/associative-array-iteration.objeck @@ -0,0 +1,25 @@ +class Iteration { + function : Main(args : String[]) ~ Nil { + assoc_array := Collection.StringMap->New(); + assoc_array->Insert("Hello", IntHolder->New(1)); + assoc_array->Insert("World", IntHolder->New(2)); + assoc_array->Insert("!", IntHolder->New(3)); + + keys := assoc_array->GetKeys(); + values := assoc_array->GetValues(); + + each(i : keys) { + key := keys->Get(i)->As(String); + value := assoc_array->Find(key)->As(IntHolder)->Get(); + "key={$key}, value={$value}"->PrintLine(); + }; + + "-------------"->PrintLine(); + + each(i : keys) { + key := keys->Get(i)->As(String); + value := values->Get(i)->As(IntHolder)->Get(); + "key={$key}, value={$value}"->PrintLine(); + }; + } +} diff --git a/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-1.m b/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-1.m new file mode 100644 index 0000000000..9843233b1b --- /dev/null +++ b/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-1.m @@ -0,0 +1,14 @@ +NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:13], @"hello", + [NSNumber numberWithInt:31], @"world", + [NSNumber numberWithInt:71], @"!", nil]; + +// iterating over keys: +for (id key in myDict) { + NSLog(@"key = %@", key); +} + +// iterating over values: +for (id value in [myDict objectEnumerator]) { + NSLog(@"value = %@", value); +} diff --git a/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-2.m b/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-2.m new file mode 100644 index 0000000000..b845b61b31 --- /dev/null +++ b/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-2.m @@ -0,0 +1,18 @@ +NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:13], @"hello", + [NSNumber numberWithInt:31], @"world", + [NSNumber numberWithInt:71], @"!", nil]; + +// iterating over keys: +NSEnumerator *enm = [myDict keyEnumerator]; +id key; +while ((key = [enm nextObject])) { + NSLog(@"key = %@", key); +} + +// iterating over values: +enm = [myDict objectEnumerator]; +id value; +while ((value = [enm nextObject])) { + NSLog(@"value = %@", value); +} diff --git a/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-3.m b/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-3.m new file mode 100644 index 0000000000..2a112f569d --- /dev/null +++ b/Task/Associative-array-Iteration/Objective-C/associative-array-iteration-3.m @@ -0,0 +1,9 @@ +NSDictionary *myDict = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:13], @"hello", + [NSNumber numberWithInt:31], @"world", + [NSNumber numberWithInt:71], @"!", nil]; + +// iterating over keys and values: +[myDict enumerateKeysAndObjectsUsingBlock: ^(id key, id value, BOOL *stop) { + NSLog(@"key = %@, value = %@", key, value); +}]; diff --git a/Task/Associative-array-Iteration/Oz/associative-array-iteration.oz b/Task/Associative-array-Iteration/Oz/associative-array-iteration.oz new file mode 100644 index 0000000000..8d9947555f --- /dev/null +++ b/Task/Associative-array-Iteration/Oz/associative-array-iteration.oz @@ -0,0 +1,6 @@ +declare + MyMap = unit('hello':13 'world':31 '!':71) +in + {ForAll {Record.toListInd MyMap} Show} %% pairs + {ForAll {Record.arity MyMap} Show} %% keys + {ForAll {Record.toList MyMap} Show} %% values diff --git a/Task/Associative-array-Iteration/Perl-6/associative-array-iteration.pl6 b/Task/Associative-array-Iteration/Perl-6/associative-array-iteration.pl6 new file mode 100644 index 0000000000..b830e3afe1 --- /dev/null +++ b/Task/Associative-array-Iteration/Perl-6/associative-array-iteration.pl6 @@ -0,0 +1,11 @@ +my %pairs = hello => 13, world => 31, '!' => 71; + +for %pairs.kv -> $k, $v { + say "(k,v) = ($k, $v)"; +} + +{ say "$^a => $^b" } for %pairs.kv; + +say "key = $_" for %pairs.keys; + +say "value = $_" for %pairs.values; diff --git a/Task/Associative-array-Iteration/Pike/associative-array-iteration.pike b/Task/Associative-array-Iteration/Pike/associative-array-iteration.pike new file mode 100644 index 0000000000..cd9d8edf30 --- /dev/null +++ b/Task/Associative-array-Iteration/Pike/associative-array-iteration.pike @@ -0,0 +1,20 @@ +mapping(string:string) m = ([ "A":"a", "B":"b", "C":"c" ]); +foreach(m; string key; string value) +{ + write(key+value); +} +Result: BbAaCc + +// only keys +foreach(m; string key;) +{ + write(key); +} +Result: BAC + +// only values +foreach(m;; string value) +{ + write(value); +} +Result: bac diff --git a/Task/Associative-array-Iteration/PostScript/associative-array-iteration.ps b/Task/Associative-array-Iteration/PostScript/associative-array-iteration.ps new file mode 100644 index 0000000000..1b3955bda2 --- /dev/null +++ b/Task/Associative-array-Iteration/PostScript/associative-array-iteration.ps @@ -0,0 +1,6 @@ +% over keys and values +<> {= =} forall +% just keys +<> {= } forall +% just values +<> {pop =} forall diff --git a/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-1.psh b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-1.psh new file mode 100644 index 0000000000..16fc9fa3bc --- /dev/null +++ b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-1.psh @@ -0,0 +1 @@ +$h = @{ 'a' = 1; 'b' = 2; 'c' = 3 } diff --git a/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-2.psh b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-2.psh new file mode 100644 index 0000000000..3c5edd9848 --- /dev/null +++ b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-2.psh @@ -0,0 +1 @@ +$h.GetEnumerator() | ForEach-Object { Write-Host Key: $_.Name, Value: $_.Value } diff --git a/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-3.psh b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-3.psh new file mode 100644 index 0000000000..42751a5552 --- /dev/null +++ b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-3.psh @@ -0,0 +1,3 @@ +foreach ($e in $h.GetEnumerator()) { + Write-Host Key: $e.Name, Value: $e.Value +} diff --git a/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-4.psh b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-4.psh new file mode 100644 index 0000000000..6ba0845a67 --- /dev/null +++ b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-4.psh @@ -0,0 +1,5 @@ +$h.Keys | ForEach-Object { Write-Host Key: $_ } + +foreach ($k in $h.Keys) { + Write-Host Key: $k +} diff --git a/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-5.psh b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-5.psh new file mode 100644 index 0000000000..fd71275166 --- /dev/null +++ b/Task/Associative-array-Iteration/PowerShell/associative-array-iteration-5.psh @@ -0,0 +1,5 @@ +$h.Values | ForEach-Object { Write-Host Value: $_ } + +foreach ($v in $h.Values) { + Write-Host Value: $v +} diff --git a/Task/Associative-array-Iteration/PureBasic/associative-array-iteration.purebasic b/Task/Associative-array-Iteration/PureBasic/associative-array-iteration.purebasic new file mode 100644 index 0000000000..ffefceea29 --- /dev/null +++ b/Task/Associative-array-Iteration/PureBasic/associative-array-iteration.purebasic @@ -0,0 +1,8 @@ +NewMap dict.s() +dict("de") = "German" +dict("en") = "English" +dict("fr") = "French" + +ForEach dict() + Debug MapKey(dict()) + ":" + dict() +Next diff --git a/Task/Associative-array-Iteration/RLaB/associative-array-iteration.rlab b/Task/Associative-array-Iteration/RLaB/associative-array-iteration.rlab new file mode 100644 index 0000000000..4adae723eb --- /dev/null +++ b/Task/Associative-array-Iteration/RLaB/associative-array-iteration.rlab @@ -0,0 +1,22 @@ +x = <<>>; // create an empty list +x.hello = 1; +x.world = 2; +x.["!"] = 3; + +// to iterate over identifiers of a list one needs to use the function ''members'' +// the identifiers are returned as a lexicographically ordered string row-vector +// here ["!", "hello", "world"] +for(i in members(x)) +{ printf("%s %g\n", i, x.[i]); } + +// occasionally one needs to check if there exists member of a list +y = members(x); // y contains ["!", "hello", "world"] +clear(x.["!"]); // remove member with identifier "!" from the list "x" +for(i in y) +{ printf("%s %g\n", i, x.[i]); } // this produces error because x.["!"] does not exist + +for(i in y) +{ + if (exist(x.[i])) + { printf("%s %g\n", i, x.[i]); } // we print a member of the list "x" only if it exists +} diff --git a/Task/Associative-array-Iteration/SNOBOL4/associative-array-iteration.sno b/Task/Associative-array-Iteration/SNOBOL4/associative-array-iteration.sno new file mode 100644 index 0000000000..13815acd47 --- /dev/null +++ b/Task/Associative-array-Iteration/SNOBOL4/associative-array-iteration.sno @@ -0,0 +1,16 @@ +* # Create sample table + t = table() + t<'cat'> = 'meow' + t<'dog'> = 'woof' + t<'pig'> = 'oink' + +* # Convert table to key/value array + a = convert(t,'array') + +* # Iterate pairs +ploop i = i + 1; output = a ' -> ' a :s(ploop) +* # Iterate keys +kloop j = j + 1; output = a :s(kloop) +* # Iterate vals +vloop k = k + 1; output = a :s(vloop) +end diff --git a/Task/Associative-array-Iteration/Seed7/associative-array-iteration.seed7 b/Task/Associative-array-Iteration/Seed7/associative-array-iteration.seed7 new file mode 100644 index 0000000000..86e9c3664d --- /dev/null +++ b/Task/Associative-array-Iteration/Seed7/associative-array-iteration.seed7 @@ -0,0 +1,29 @@ +$ include "seed7_05.s7i"; + +const type: dictType is hash [string] integer; +var dictType: myDict is dictType.value; + +const proc: main is func + local + var string: stri is ""; + var integer: number is 0; + begin + myDict @:= ["hello"] 1; + myDict @:= ["world"] 2; + myDict @:= ["!"] 3; + + # iterating over key-value pairs: + for number key stri range myDict do + writeln("key = " <& number <& ", value = " <& stri); + end for; + + # iterating over keys: + for key stri range myDict do + writeln("key = " <& stri); + end for; + + # iterating over values: + for number range myDict do + writeln("value = " <& number); + end for; + end func; diff --git a/Task/Associative-array-Iteration/Slate/associative-array-iteration.slate b/Task/Associative-array-Iteration/Slate/associative-array-iteration.slate new file mode 100644 index 0000000000..51a2864fb4 --- /dev/null +++ b/Task/Associative-array-Iteration/Slate/associative-array-iteration.slate @@ -0,0 +1,12 @@ +define: #pairs -> ({'hello' -> 1. 'world' -> 2. '!' -> 3. 'another!' -> 3} as: Dictionary). +pairs keysAndValuesDo: [| :key :value | + inform: '(k, v) = (' ; key printString ; ', ' ; value printString ; ')' +]. + +pairs keysDo: [| :key | + inform: '(k, v) = (' ; key printString ; ', ' ; (pairs at: key) printString ; ')' +]. + +pairs do: [| :value | + inform: 'value = ' ; value printString +]. diff --git a/Task/Associative-array-Iteration/TXR/associative-array-iteration.txr b/Task/Associative-array-Iteration/TXR/associative-array-iteration.txr new file mode 100644 index 0000000000..6852a99be9 --- /dev/null +++ b/Task/Associative-array-Iteration/TXR/associative-array-iteration.txr @@ -0,0 +1,6 @@ +@(do (defvar *h* (make-hash nil nil nil)) + (each ((k '(a b c)) + (v '(1 2 3))) + (set [*h* k nil] v)) + (dohash (k v *h*) + (format t "~a -> ~a\n" k v)))) diff --git a/Task/Associative-array-Iteration/UNIX-Shell/associative-array-iteration-1.sh b/Task/Associative-array-Iteration/UNIX-Shell/associative-array-iteration-1.sh new file mode 100644 index 0000000000..d7b05c8817 --- /dev/null +++ b/Task/Associative-array-Iteration/UNIX-Shell/associative-array-iteration-1.sh @@ -0,0 +1,12 @@ +a=([key1]=value1 [key2]=value2) + +# just keys +printf '%s\n' "${!a[@]}" + +# just values +printf '%s\n' "${a[@]}" + +# keys and values +for key in "${!a[@]}"; do + printf '%s => %s\n' "$key" "${a[$key]}" +done diff --git a/Task/Associative-array-Iteration/UNIX-Shell/associative-array-iteration-2.sh b/Task/Associative-array-Iteration/UNIX-Shell/associative-array-iteration-2.sh new file mode 100644 index 0000000000..16be605f8a --- /dev/null +++ b/Task/Associative-array-Iteration/UNIX-Shell/associative-array-iteration-2.sh @@ -0,0 +1,11 @@ +typeset -A a +a=(key1 value1 key2 value2) + +# just keys +print -l -- ${(k)a} + +# just values +print -l -- ${(v)a} + +# keys and values +printf '%s => %s\n' ${(kv)a} diff --git a/Task/Associative-array-Iteration/Vala/associative-array-iteration.vala b/Task/Associative-array-Iteration/Vala/associative-array-iteration.vala new file mode 100644 index 0000000000..0f8869cb89 --- /dev/null +++ b/Task/Associative-array-Iteration/Vala/associative-array-iteration.vala @@ -0,0 +1,29 @@ +using Gee; + +void main(){ + // declare HashMap + var map = new HashMap(); + + // set 3 entries + map["pi"] = 3.14; + map["e"] = 2.72; + map["golden"] = 1.62; + + // iterate over (key,value) pair + foreach (var elem in map.entries){ + string name = elem.key; + double num = elem.value; + + stdout.printf("%s,%f\n", name, num); + } + + // iterate over keys + foreach (string key in map.keys){ + stdout.printf("%s\n", key); + } + + // iterate over values + foreach (double num in map.values){ + stdout.printf("%f\n", num); + } +} diff --git a/Task/Associative-array-Iteration/XPL0/associative-array-iteration.xpl0 b/Task/Associative-array-Iteration/XPL0/associative-array-iteration.xpl0 new file mode 100644 index 0000000000..a016d7c045 --- /dev/null +++ b/Task/Associative-array-Iteration/XPL0/associative-array-iteration.xpl0 @@ -0,0 +1,20 @@ +include c:\cxpl\stdlib; +char Dict(10,10); +int Entries; + +proc AddEntry(Letter, Greek); \Insert entry into associative array +char Letter, Greek; +[Dict(Entries,0):= Letter; +StrCopy(Greek, @Dict(Entries,1)); +Entries:= Entries+1; \(limit checks ignored for simplicity) +]; + +int I; +[Entries:= 0; +AddEntry(^A, "alpha"); +AddEntry(^D, "delta"); +AddEntry(^B, "beta"); +AddEntry(^C, "gamma"); +for I:= 0 to Entries-1 do + [ChOut(0, Dict(I,0)); ChOut(0, ^ ); Text(0, @Dict(I,1)); CrLf(0)]; +] diff --git a/Task/Atomic-updates/Oz/atomic-updates-1.oz b/Task/Atomic-updates/Oz/atomic-updates-1.oz new file mode 100644 index 0000000000..ea068f3160 --- /dev/null +++ b/Task/Atomic-updates/Oz/atomic-updates-1.oz @@ -0,0 +1,98 @@ +declare + %% + %% INIT + %% + NBuckets = 100 + StartVal = 50 + ExpectedSum = NBuckets * StartVal + + %% Makes a tuple and calls Fun for every field + fun {Make Label N Fun} + R = {Tuple.make Label N} + in + for I in 1..N do R.I = {Fun} end + R + end + + Buckets = {Make buckets NBuckets fun {$} {Cell.new StartVal} end} + Locks = {Make locks NBuckets Lock.new} + LockList = {Record.toList Locks} + + %% + %% DISPLAY + %% + proc {Display} + Snapshot = {WithLocks LockList + fun {$} + {Record.map Buckets Cell.access} + end + } + Sum = {Record.foldL Snapshot Number.'+' 0} + in + {Print Snapshot} + {System.showInfo " sum: "#Sum} + Sum = ExpectedSum %% assert + end + + %% Calls Fun with multiple locks locked and returns the result of Fun. + fun {WithLocks Ls Fun} + case Ls of L|Lr then + lock L then + {WithLocks Lr Fun} + end + [] nil then {Fun} + end + end + + %% + %% MANIPULATE + %% + proc {Smooth I J} + Diff = @(Buckets.I) - @(Buckets.J) %% reading without lock: by design + Amount = Diff div 4 + in + {Transfer I J Amount} + end + + proc {Roughen I J} + Amount = @(Buckets.I) div 3 %% reading without lock: by design + in + {Transfer I J Amount} + end + + %% Atomically transfer an amount from From to To. + %% Negative amounts are allowed; + %% will never make a bucket negative. + proc {Transfer From To Amount} + if From \= To then + %% lock in order (to avoid deadlocks) + Smaller = {Min From To} + Bigger = {Max From To} + in + lock Locks.Smaller then + lock Locks.Bigger then + FromBucket = Buckets.From + ToBucket = Buckets.To + NewFromValue = @FromBucket - Amount + NewToValue = @ToBucket + Amount + in + if NewFromValue >= 0 andthen NewToValue >= 0 then + FromBucket := NewFromValue + ToBucket := NewToValue + end + end + end + end + end + + %% Returns a random bucket index. + fun {Pick} + {OS.rand} mod NBuckets + 1 + end +in + %% + %% START + %% + thread for do {Smooth {Pick} {Pick}} end end + thread for do {Roughen {Pick} {Pick}} end end + for do {Display} {Time.delay 50} end diff --git a/Task/Atomic-updates/Oz/atomic-updates-2.oz b/Task/Atomic-updates/Oz/atomic-updates-2.oz new file mode 100644 index 0000000000..d0cdfbb31a --- /dev/null +++ b/Task/Atomic-updates/Oz/atomic-updates-2.oz @@ -0,0 +1,7 @@ +buckets(50 50 50 50 50 50 50 50 50 50 ,,,) sum: 5000 +buckets(24 68 58 43 78 85 43 66 14 48 ,,,) sum: 5000 +buckets(36 33 59 38 39 23 55 51 43 45 ,,,) sum: 5000 +buckets(64 32 62 26 50 82 38 70 16 43 ,,,) sum: 5000 +buckets(51 51 49 50 51 51 51 49 49 49 ,,,) sum: 5000 +buckets(43 28 27 60 77 41 36 48 72 70 ,,,) sum: 5000 +... diff --git a/Task/Atomic-updates/PureBasic/atomic-updates.purebasic b/Task/Atomic-updates/PureBasic/atomic-updates.purebasic new file mode 100644 index 0000000000..53dcabb08e --- /dev/null +++ b/Task/Atomic-updates/PureBasic/atomic-updates.purebasic @@ -0,0 +1,84 @@ +#Buckets=9 +#TotalAmount=200 +Global Dim Buckets(#Buckets) +Global BMutex=CreateMutex() +Global Quit=#False + +Procedure max(x,y) + If x>=y: ProcedureReturn x + Else: ProcedureReturn y + EndIf +EndProcedure + +Procedure Move(WantedAmount, From, Dest) + Protected RealAmount + If from<>Dest + LockMutex(BMutex) + RealAmount=max(0, Buckets(from)-WantedAmount) + Buckets(From)-RealAmount + Buckets(Dest)+RealAmount + UnlockMutex(BMutex) + EndIf + ProcedureReturn RealAmount +EndProcedure + +Procedure Level(A,B) + Protected i, j, t + If A<>B + LockMutex(BMutex) + t=Buckets(A)+Buckets(B) + i=t/2: j=t-i + Buckets(A)=i + Buckets(B)=j + UnlockMutex(BMutex) + EndIf +EndProcedure + +Procedure DoInvent(Array A(1)) + Protected i, sum + LockMutex(BMutex) + For i=0 To ArraySize(Buckets()) + A(i)=Buckets(i) + sum+A(i) + Next i + UnlockMutex(BMutex) + ProcedureReturn sum +EndProcedure + +Procedure MixingThread(arg) + Repeat + Move(Random(#TotalAmount),Random(#Buckets),Random(#Buckets)) + Until Quit +EndProcedure + +Procedure LevelingThread(arg) + Repeat + Level(Random(#Buckets),Random(#Buckets)) + Until Quit +EndProcedure + +If OpenWindow(0,0,0,100,150,"Atomic updates",#PB_Window_SystemMenu) + Define Thread1=CreateThread(@MixingThread(),0) + Define Thread2=CreateThread(@MixingThread(),0) + Define i, Event + Dim Inventory(#Buckets) + ; Set up a small GUI + For i=0 To 9 + TextGadget(i, 0,i*15,50, 15,"Bucket #"+Str(i)) + Next i + TextGadget(10,55,135,40,15,"=") + AddWindowTimer(0,0,500) + Buckets(0)=#TotalAmount + Repeat + Event=WaitWindowEvent() + If Event=#PB_Event_Timer + i=DoInvent(Inventory()) + SetGadgetText(10,"="+Str(i)) + For i=0 To #Buckets + SetGadgetText(i, Str(Inventory(i))) + Next i + EndIf + Until Event=#PB_Event_CloseWindow + Quit=#True ; Tell threads to shut down + WaitThread(Thread1): WaitThread(Thread2) +EndIf diff --git a/Task/Atomic-updates/Run-BASIC/atomic-updates.run b/Task/Atomic-updates/Run-BASIC/atomic-updates.run new file mode 100644 index 0000000000..02f84f60ed --- /dev/null +++ b/Task/Atomic-updates/Run-BASIC/atomic-updates.run @@ -0,0 +1,34 @@ +DIM bucket(10) +FOR i = 1 TO 10 : bucket(i) = int(RND(0)*100) : NEXT + +a = display(" Display:") ' show original array +a = flatten(a) ' flatten the array +a = display(" Flatten:") ' show flattened array +a = transfer(3,5) ' transfer some amount from 3 to 5 +a = display(a;" from 3 to 5:") ' Show transfer array +end + +FUNCTION display(a$) + print a$;" ";chr$(9); + for i = 1 to 10 + display = display + bucket(i) + print bucket(i);chr$(9); + next i + print " Total:";display +END FUNCTION + +FUNCTION flatten(f) + f1 = int((f / 10) + .5) + for i = 1 to 10 + bucket(i) = f1 + f2 = f2 + f1 + next i + bucket(10) = bucket(10) + f - f2 +END FUNCTION + + +FUNCTION transfer(a1,a2) +transfer = int(rnd(0) * bucket(a1)) +bucket(a1) = bucket(a1) - transfer +bucket(a2) = bucket(a2) + transfer +END FUNCTION diff --git a/Task/Average-loop-length/Mathematica/average-loop-length.mathematica b/Task/Average-loop-length/Mathematica/average-loop-length.math similarity index 100% rename from Task/Average-loop-length/Mathematica/average-loop-length.mathematica rename to Task/Average-loop-length/Mathematica/average-loop-length.math diff --git a/Task/Average-loop-length/Perl-6/average-loop-length.pl6 b/Task/Average-loop-length/Perl-6/average-loop-length.pl6 new file mode 100644 index 0000000000..cb0f84dd15 --- /dev/null +++ b/Task/Average-loop-length/Perl-6/average-loop-length.pl6 @@ -0,0 +1,18 @@ +constant MAX_N = 20; +constant TRIALS = 100; + +for 1 .. MAX_N -> $N { + my $empiric = TRIALS R/ [+] find-loop(random-mapping($N)).elems xx TRIALS; + my $theoric = [+] + map -> $k { $N ** ($k + 1) R/ [*] $k**2, $N - $k + 1 .. $N }, 1 .. $N; + + FIRST say " N empiric theoric (error)"; + FIRST say "=== ========= ============ ========="; + + printf "%3d %9.4f %12.4f (%4.2f%%)\n", + $N, $empiric, + $theoric, 100 * abs($theoric - $empiric) / $theoric; +} + +sub random-mapping { hash .list Z=> .roll given ^$^size } +sub find-loop { 0, %^mapping{*} ...^ { (state %){$_}++ } } diff --git a/Task/Average-loop-length/Unicon/average-loop-length.unicon b/Task/Average-loop-length/Unicon/average-loop-length.unicon new file mode 100644 index 0000000000..bd00cca8ff --- /dev/null +++ b/Task/Average-loop-length/Unicon/average-loop-length.unicon @@ -0,0 +1,39 @@ +link printf, factors + +$define MAX_N 20 +$define TIMES 1000000 +$define RAND_MAX 2147483647 + +procedure expected(n) + local sum := 0 + every i := 1 to n do + sum +:= factorial(n) / (n ^ i) / factorial(n - i) + return sum +end + +procedure test(n, times) + local i, count := 0, x, bits + every i := 0 to times-1 do { + x := 1 + bits := 0 + while iand(bits, x)=0 do { + count +:= 1 + bits := ior(bits, x) + x := ishift(1 , ?n-1) + } + } + return count +end + +procedure main(void) + local n, cnt, avg, theory, diff + write(" n\tavg\texp.\tdiff\n", repl("-",29)) + every n := 1 to MAX_N do { + cnt := test(n, TIMES) + avg := real(cnt) / TIMES + theory := expected(n) + diff := (avg / theory - 1) * 100 + printf("%2d %8.4r %8.4r %6.3r%%\n", n, avg, theory, diff) + } + return 0 +end diff --git a/Task/Averages-Arithmetic-mean/BASIC/averages-arithmetic-mean.bas b/Task/Averages-Arithmetic-mean/BASIC/averages-arithmetic-mean.basic similarity index 100% rename from Task/Averages-Arithmetic-mean/BASIC/averages-arithmetic-mean.bas rename to Task/Averages-Arithmetic-mean/BASIC/averages-arithmetic-mean.basic diff --git a/Task/Averages-Arithmetic-mean/CoffeeScript/averages-arithmetic-mean.coffee b/Task/Averages-Arithmetic-mean/CoffeeScript/averages-arithmetic-mean.coffeescript similarity index 100% rename from Task/Averages-Arithmetic-mean/CoffeeScript/averages-arithmetic-mean.coffee rename to Task/Averages-Arithmetic-mean/CoffeeScript/averages-arithmetic-mean.coffeescript diff --git a/Task/Averages-Arithmetic-mean/MAXScript/averages-arithmetic-mean.max b/Task/Averages-Arithmetic-mean/MAXScript/averages-arithmetic-mean.maxscript similarity index 100% rename from Task/Averages-Arithmetic-mean/MAXScript/averages-arithmetic-mean.max rename to Task/Averages-Arithmetic-mean/MAXScript/averages-arithmetic-mean.maxscript diff --git a/Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-1.mathematica b/Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-1.math similarity index 100% rename from Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-1.mathematica rename to Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-1.math diff --git a/Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-2.mathematica b/Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-2.math similarity index 100% rename from Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-2.mathematica rename to Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-2.math diff --git a/Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-3.mathematica b/Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-3.math similarity index 100% rename from Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-3.mathematica rename to Task/Averages-Arithmetic-mean/Mathematica/averages-arithmetic-mean-3.math diff --git a/Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-1.mathprog b/Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-1.math similarity index 100% rename from Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-1.mathprog rename to Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-1.math diff --git a/Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-2.mathprog b/Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-2.math similarity index 100% rename from Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-2.mathprog rename to Task/Averages-Arithmetic-mean/Mathprog/averages-arithmetic-mean-2.math diff --git a/Task/Averages-Arithmetic-mean/Nemerle/averages-arithmetic-mean.nemerle b/Task/Averages-Arithmetic-mean/Nemerle/averages-arithmetic-mean.nemerle new file mode 100644 index 0000000000..82a8c10727 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Nemerle/averages-arithmetic-mean.nemerle @@ -0,0 +1,17 @@ +using System; +using System.Console; +using Nemerle.Collections; + +module Mean +{ + ArithmeticMean(x : list[int]) : double + { + |[] => 0.0 + |_ =>(x.FoldLeft(0, _+_) :> double) / x.Length + } + + Main() : void + { + WriteLine("Mean of [1 .. 10]: {0}", ArithmeticMean($[1 .. 10])); + } +} diff --git a/Task/Averages-Arithmetic-mean/NetRexx/averages-arithmetic-mean.netrexx b/Task/Averages-Arithmetic-mean/NetRexx/averages-arithmetic-mean.netrexx new file mode 100644 index 0000000000..3acdf9b339 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/NetRexx/averages-arithmetic-mean.netrexx @@ -0,0 +1,51 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +launchSample() +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method arithmeticMean(vv = Vector) public static signals DivideException returns Rexx + sum = 0 + n_ = Rexx + loop n_ over vv + sum = sum + n_ + end n_ + mean = sum / vv.size() + + return mean + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method launchSample() public static + TRUE_ = 1 == 1 + FALSE_ = \TRUE_ + tracing = FALSE_ + vectors = getSampleData() + loop v_ = 0 to vectors.length - 1 + say 'Average of:' vectors[v_].toString() + do + say ' =' arithmeticMean(vectors[v_]) + catch dex = DivideException + say 'Caught "Divide By Zero"; bypassing...' + if tracing then dex.printStackTrace() + catch xex = RuntimeException + say 'Caught unspecified run-time exception; bypassing...' + if tracing then xex.printStackTrace() + end + say + end v_ + return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method getSampleData() private static returns Vector[] + seed = 1066 + rng = Random(seed) + vectors =[ - + Vector(Arrays.asList([Rexx 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])), - + Vector(), - + Vector(Arrays.asList([Rexx rng.nextInt(seed), rng.nextInt(seed), rng.nextInt(seed), rng.nextInt(seed), rng.nextInt(seed), rng.nextInt(seed)])), - + Vector(Arrays.asList([Rexx rng.nextDouble(), rng.nextDouble(), rng.nextDouble(), rng.nextDouble(), rng.nextDouble(), rng.nextDouble(), rng.nextDouble()])), - + Vector(Arrays.asList([Rexx '1.0', '2.0', 3.0])), - + Vector(Arrays.asList([Rexx '1.0', 'not a number', 3.0])) - + ] + return vectors diff --git a/Task/Averages-Arithmetic-mean/NewLISP/averages-arithmetic-mean.newlisp b/Task/Averages-Arithmetic-mean/NewLISP/averages-arithmetic-mean.newlisp new file mode 100644 index 0000000000..e317eaf0cf --- /dev/null +++ b/Task/Averages-Arithmetic-mean/NewLISP/averages-arithmetic-mean.newlisp @@ -0,0 +1,7 @@ +(define (Mean Lst) + (if (empty? Lst) + 0 + (/ (apply + Lst) (length Lst)))) + + (Mean (sequence 1 1000))-> 500 + (Mean '()) -> 0 diff --git a/Task/Averages-Arithmetic-mean/Nial/averages-arithmetic-mean-1.nial b/Task/Averages-Arithmetic-mean/Nial/averages-arithmetic-mean-1.nial new file mode 100644 index 0000000000..7741943d1f --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Nial/averages-arithmetic-mean-1.nial @@ -0,0 +1,4 @@ +mean is / [sum, tally] + +mean 6 2 4 += 4 diff --git a/Task/Averages-Arithmetic-mean/Nial/averages-arithmetic-mean-2.nial b/Task/Averages-Arithmetic-mean/Nial/averages-arithmetic-mean-2.nial new file mode 100644 index 0000000000..cd954392f7 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Nial/averages-arithmetic-mean-2.nial @@ -0,0 +1,5 @@ +dtally is recur [ empty rest, 1 first, 1 first, plus, rest ] +mean is / [sum, dtally] + +mean [] +=0 diff --git a/Task/Averages-Arithmetic-mean/Niue/averages-arithmetic-mean.niue b/Task/Averages-Arithmetic-mean/Niue/averages-arithmetic-mean.niue new file mode 100644 index 0000000000..701288c367 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Niue/averages-arithmetic-mean.niue @@ -0,0 +1,7 @@ +[ [ , len 1 - at ! ] len 3 - times swap , ] 'map ; ( a Lisp like map, to sum the stack ) +[ len 'n ; [ + ] 0 n swap-at map n / ] 'avg ; + +1 2 3 4 5 avg . +=> 3 +3.4 2.3 .01 2.0 2.1 avg . +=> 1.9619999999999997 diff --git a/Task/Averages-Arithmetic-mean/OCaml/averages-arithmetic-mean-1.ocaml b/Task/Averages-Arithmetic-mean/OCaml/averages-arithmetic-mean-1.ocaml new file mode 100644 index 0000000000..e907fb5ce9 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/OCaml/averages-arithmetic-mean-1.ocaml @@ -0,0 +1,5 @@ +let mean_floats = function + | [] -> 0. + | xs -> List.fold_left (+.) 0. xs /. float_of_int (List.length xs) + +let mean_ints xs = mean_floats (List.map float_of_int xs) diff --git a/Task/Averages-Arithmetic-mean/OCaml/averages-arithmetic-mean-2.ocaml b/Task/Averages-Arithmetic-mean/OCaml/averages-arithmetic-mean-2.ocaml new file mode 100644 index 0000000000..1ea9c85161 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/OCaml/averages-arithmetic-mean-2.ocaml @@ -0,0 +1,24 @@ +let mean_floats xs = + if xs = [] then + invalid_arg "empty list" + else + let total, length = + List.fold_left + (fun (tot,len) x -> (x +. tot), len +. 1.) + (0., 0.) xs + in + (total /. length) +;; + + +let mean_ints xs = + if xs = [] then + invalid_arg "empty list" + else + let total, length = + List.fold_left + (fun (tot,len) x -> (x + tot), len +. 1.) + (0, 0.) xs + in + (float total /. length) +;; diff --git a/Task/Averages-Arithmetic-mean/Oberon-2/averages-arithmetic-mean.oberon-2 b/Task/Averages-Arithmetic-mean/Oberon-2/averages-arithmetic-mean.oberon-2 new file mode 100644 index 0000000000..e399bc7235 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Oberon-2/averages-arithmetic-mean.oberon-2 @@ -0,0 +1,29 @@ +MODULE AvgMean; +IMPORT Out; +CONST MAXSIZE = 10; +PROCEDURE Avg(a: ARRAY OF REAL; items: INTEGER): REAL; +VAR + i: INTEGER; + total: REAL; +BEGIN + total := 0.0; + FOR i := 0 TO LEN(a) - 1 DO + total := total + a[i] + END; + RETURN total/LEN(a) +END Avg; +VAR + ary: ARRAY MAXSIZE OF REAL; +BEGIN + ary[0] := 10.0; + ary[1] := 11.01; + ary[2] := 12.02; + ary[3] := 13.03; + ary[4] := 14.04; + ary[5] := 15.05; + ary[6] := 16.06; + ary[7] := 17.07; + ary[8] := 18.08; + ary[9] := 19.09; + Out.Fixed(Avg(ary),4,2);Out.Ln +END AvgMean. diff --git a/Task/Averages-Arithmetic-mean/Objeck/averages-arithmetic-mean.objeck b/Task/Averages-Arithmetic-mean/Objeck/averages-arithmetic-mean.objeck new file mode 100644 index 0000000000..a06a08c7a6 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Objeck/averages-arithmetic-mean.objeck @@ -0,0 +1,3 @@ +function : native : PrintAverage(values : FloatVector) ~ Nil { + values->Average()->PrintLine(); +} diff --git a/Task/Averages-Arithmetic-mean/Octave/averages-arithmetic-mean-1.octave b/Task/Averages-Arithmetic-mean/Octave/averages-arithmetic-mean-1.octave new file mode 100644 index 0000000000..f7d2d536af --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Octave/averages-arithmetic-mean-1.octave @@ -0,0 +1,10 @@ +function m = omean(l) + if ( numel(l) == 0 ) + m = 0; + else + m = mean(l); + endif +endfunction + +disp(omean([])); +disp(omean([1,2,3])); diff --git a/Task/Averages-Arithmetic-mean/Octave/averages-arithmetic-mean-2.octave b/Task/Averages-Arithmetic-mean/Octave/averages-arithmetic-mean-2.octave new file mode 100644 index 0000000000..d62341eece --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Octave/averages-arithmetic-mean-2.octave @@ -0,0 +1,6 @@ +function m = omean(l) + n = sum(~isnan(l)); + l(isnan(l))=0; + s = sum(l); + m = s./n; +end; diff --git a/Task/Averages-Arithmetic-mean/Oz/averages-arithmetic-mean.oz b/Task/Averages-Arithmetic-mean/Oz/averages-arithmetic-mean.oz new file mode 100644 index 0000000000..f21f6ef2b0 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Oz/averages-arithmetic-mean.oz @@ -0,0 +1,6 @@ +declare + fun {Mean Xs} + {FoldL Xs Number.'+' 0.0} / {Int.toFloat {Length Xs}} + end +in + {Show {Mean [3. 1. 4. 1. 5. 9.]}} diff --git a/Task/Averages-Arithmetic-mean/PARI-GP/averages-arithmetic-mean.pari b/Task/Averages-Arithmetic-mean/PARI-GP/averages-arithmetic-mean.pari new file mode 100644 index 0000000000..def3d963a1 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/PARI-GP/averages-arithmetic-mean.pari @@ -0,0 +1,3 @@ +avg(v)={ + if(#v,vecsum(v)/#v) +}; diff --git a/Task/Averages-Arithmetic-mean/PL-I/averages-arithmetic-mean.pli b/Task/Averages-Arithmetic-mean/PL-I/averages-arithmetic-mean.pli new file mode 100644 index 0000000000..028a45ec6d --- /dev/null +++ b/Task/Averages-Arithmetic-mean/PL-I/averages-arithmetic-mean.pli @@ -0,0 +1 @@ +arithmetic_mean = sum(A)/dimension(A,1); diff --git a/Task/Averages-Arithmetic-mean/Pascal/averages-arithmetic-mean-1.pascal b/Task/Averages-Arithmetic-mean/Pascal/averages-arithmetic-mean-1.pascal new file mode 100644 index 0000000000..9045c4f294 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Pascal/averages-arithmetic-mean-1.pascal @@ -0,0 +1,30 @@ +Program Mean; + + function DoMean(vector: array of double): double; + var + sum: double; + i, len: integer; + begin + sum := 0; + len := length(vector); + if len > 0 then + begin + for i := low(vector) to high(vector) do + sum := sum + vector[i]; + sum := sum / len; + end; + DoMean := sum; + end; + +const + vector: array [3..8] of double = (3.0, 1.0, 4.0, 1.0, 5.0, 9.0); +var + i: integer; +begin + writeln('Calculating the arithmetic mean of a series of numbers:'); + write('Numbers: [ '); + for i := low(vector) to high(vector) do + write (vector[i]:3:1, ' '); + writeln (']'); + writeln('Mean: ', DoMean(vector):10:8); +end. diff --git a/Task/Averages-Arithmetic-mean/Pascal/averages-arithmetic-mean-2.pascal b/Task/Averages-Arithmetic-mean/Pascal/averages-arithmetic-mean-2.pascal new file mode 100644 index 0000000000..76fadfcd3e --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Pascal/averages-arithmetic-mean-2.pascal @@ -0,0 +1,18 @@ +Program DoMean; +uses math; +const + vector: array [3..8] of double = (3.0, 1.0, 4.0, 1.0, 5.0, 9.0); +var + i: integer; + mean: double; +begin + writeln('Calculating the arithmetic mean of a series of numbers:'); + write('Numbers: [ '); + for i := low(vector) to high(vector) do + write (vector[i]:3:1, ' '); + writeln (']'); + mean := 0; + if length(vector) > 0 then + mean := sum(vector)/length(vector); + writeln('Mean: ', mean:10:8); +end. diff --git a/Task/Averages-Arithmetic-mean/Perl-6/averages-arithmetic-mean.pl6 b/Task/Averages-Arithmetic-mean/Perl-6/averages-arithmetic-mean.pl6 new file mode 100644 index 0000000000..f8c61623d5 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Perl-6/averages-arithmetic-mean.pl6 @@ -0,0 +1 @@ +sub mean (@a) { ([+] @a) / (@a || 1) } diff --git a/Task/Averages-Arithmetic-mean/Pop11/averages-arithmetic-mean.pop11 b/Task/Averages-Arithmetic-mean/Pop11/averages-arithmetic-mean.pop11 new file mode 100644 index 0000000000..db25ff80c3 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Pop11/averages-arithmetic-mean.pop11 @@ -0,0 +1,11 @@ +define mean(v); + lvars n = length(v), i, s = 0; + if n = 0 then + return(0); + else + for i from 1 to n do + s + v(i) -> s; + endfor; + endif; + return(s/n); +enddefine; diff --git a/Task/Averages-Arithmetic-mean/PostScript/averages-arithmetic-mean-1.ps b/Task/Averages-Arithmetic-mean/PostScript/averages-arithmetic-mean-1.ps new file mode 100644 index 0000000000..7043b293c7 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/PostScript/averages-arithmetic-mean-1.ps @@ -0,0 +1,15 @@ +/findmean{ +/x exch def +/sum 0 def +/i 0 def +x length 0 eq +{} +{ +x length{ +/sum sum x i get add def +/i i 1 add def +}repeat +/sum sum x length div def +}ifelse +sum == +}def diff --git a/Task/Averages-Arithmetic-mean/PostScript/averages-arithmetic-mean-2.ps b/Task/Averages-Arithmetic-mean/PostScript/averages-arithmetic-mean-2.ps new file mode 100644 index 0000000000..27dbec7480 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/PostScript/averages-arithmetic-mean-2.ps @@ -0,0 +1,8 @@ +/avg { + dup length + {0 gt} { + exch 0 {add} fold exch div + } { + exch pop + } ifte +}. diff --git a/Task/Averages-Arithmetic-mean/PowerShell/averages-arithmetic-mean-1.psh b/Task/Averages-Arithmetic-mean/PowerShell/averages-arithmetic-mean-1.psh new file mode 100644 index 0000000000..17594cda09 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/PowerShell/averages-arithmetic-mean-1.psh @@ -0,0 +1,11 @@ +function mean ($x) { + if ($x.Count -eq 0) { + return 0 + } else { + $sum = 0 + foreach ($i in $x) { + $sum += $i + } + return $sum / $x.Count + } +} diff --git a/Task/Averages-Arithmetic-mean/PowerShell/averages-arithmetic-mean-2.psh b/Task/Averages-Arithmetic-mean/PowerShell/averages-arithmetic-mean-2.psh new file mode 100644 index 0000000000..5e5b533ad3 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/PowerShell/averages-arithmetic-mean-2.psh @@ -0,0 +1,7 @@ +function mean ($x) { + if ($x.Count -eq 0) { + return 0 + } else { + return ($x | Measure-Object -Average).Average + } +} diff --git a/Task/Averages-Arithmetic-mean/PureBasic/averages-arithmetic-mean.purebasic b/Task/Averages-Arithmetic-mean/PureBasic/averages-arithmetic-mean.purebasic new file mode 100644 index 0000000000..9a3c560d22 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/PureBasic/averages-arithmetic-mean.purebasic @@ -0,0 +1,9 @@ +Procedure.d mean(List number()) + Protected sum=0 + + ForEach number() + sum + number() + Next + ProcedureReturn sum / ListSize(number()) + ; Depends on programm if zero check needed, returns nan on division by zero +EndProcedure diff --git a/Task/Averages-Arithmetic-mean/REBOL/averages-arithmetic-mean.rebol b/Task/Averages-Arithmetic-mean/REBOL/averages-arithmetic-mean.rebol new file mode 100644 index 0000000000..2bdbafe8ba --- /dev/null +++ b/Task/Averages-Arithmetic-mean/REBOL/averages-arithmetic-mean.rebol @@ -0,0 +1,21 @@ +rebol [ + Title: "Arithmetic Mean (Average)" + Author: oofoe + Date: 2009-12-11 + URL: http://rosettacode.org/wiki/Average/Arithmetic_mean +] + +average: func [v /local sum][ + if empty? v [return 0] + + sum: 0 + forall v [sum: sum + v/1] + sum / length? v +] + +; Note precision loss as spread increased. + +print [mold x: [] "->" average x] +print [mold x: [3 1 4 1 5 9] "->" average x] +print [mold x: [1000 3 1 4 1 5 9 -1000] "->" average x] +print [mold x: [1e20 3 1 4 1 5 9 -1e20] "->" average x] diff --git a/Task/Averages-Arithmetic-mean/Run-BASIC/averages-arithmetic-mean.run b/Task/Averages-Arithmetic-mean/Run-BASIC/averages-arithmetic-mean.run new file mode 100644 index 0000000000..4f131f4b7a --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Run-BASIC/averages-arithmetic-mean.run @@ -0,0 +1,11 @@ +print "Gimme the number in the array:";input numArray +dim value(numArray) +for i = 1 to numArray + value(i) = i * 1.5 +next + +for i = 1 to total + totValue = totValue +value(numArray) +next +if totValue <> 0 then mean = totValue/numArray +print "The mean is: ";mean diff --git a/Task/Averages-Arithmetic-mean/SNOBOL4/averages-arithmetic-mean.sno b/Task/Averages-Arithmetic-mean/SNOBOL4/averages-arithmetic-mean.sno new file mode 100644 index 0000000000..5afb0a811f --- /dev/null +++ b/Task/Averages-Arithmetic-mean/SNOBOL4/averages-arithmetic-mean.sno @@ -0,0 +1,14 @@ + define('avg(a)i,sum') :(avg_end) +avg i = i + 1; sum = sum + a :s(avg) + avg = 1.0 * sum / prototype(a) :(return) +avg_end + +* # Fill arrays + str = '1 2 3 4 5 6 7 8 9 10'; arr = array(10) +loop i = i + 1; str len(p) span('0123456789') . arr @p :s(loop) + empty = array(1) ;* Null vector + +* # Test and display + output = '[' str '] -> ' avg(arr) + output = '[ ] -> ' avg(empty) +end diff --git a/Task/Averages-Arithmetic-mean/Seed7/averages-arithmetic-mean.seed7 b/Task/Averages-Arithmetic-mean/Seed7/averages-arithmetic-mean.seed7 new file mode 100644 index 0000000000..f1b6b517c2 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Seed7/averages-arithmetic-mean.seed7 @@ -0,0 +1,24 @@ +$ include "seed7_05.s7i"; + include "float.s7i"; + +const array float: numVector is [] (1.0, 2.0, 3.0, 4.0, 5.0); + +const func float: mean (in array float: numbers) is func + result + var float: result is 0.0; + local + var float: total is 0.0; + var float: num is 0.0; + begin + if length(numbers) <> 0 then + for num range numbers do + total +:= num; + end for; + result := total / flt(length(numbers)); + end if; + end func; + +const proc: main is func + begin + writeln(mean(numVector)); + end func; diff --git a/Task/Averages-Arithmetic-mean/Slate/averages-arithmetic-mean.slate b/Task/Averages-Arithmetic-mean/Slate/averages-arithmetic-mean.slate new file mode 100644 index 0000000000..7fafa52f38 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Slate/averages-arithmetic-mean.slate @@ -0,0 +1,2 @@ +[|:list| (list reduce: #+ `er ifEmpty: [0]) / (list isEmpty ifTrue: [1] ifFalse: [list size])] applyWith: #(3 1 4 1 5 9). +[|:list| (list reduce: #+ `er ifEmpty: [0]) / (list isEmpty ifTrue: [1] ifFalse: [list size])] applyWith: {}. diff --git a/Task/Averages-Arithmetic-mean/Standard-ML/averages-arithmetic-mean-1.ml b/Task/Averages-Arithmetic-mean/Standard-ML/averages-arithmetic-mean-1.ml new file mode 100644 index 0000000000..d0ed1393d0 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Standard-ML/averages-arithmetic-mean-1.ml @@ -0,0 +1,4 @@ +fun mean_reals [] = 0.0 + | mean_reals xs = foldl op+ 0.0 xs / real (length xs); + +val mean_ints = mean_reals o (map real); diff --git a/Task/Averages-Arithmetic-mean/Standard-ML/averages-arithmetic-mean-2.ml b/Task/Averages-Arithmetic-mean/Standard-ML/averages-arithmetic-mean-2.ml new file mode 100644 index 0000000000..e96ccbefc4 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Standard-ML/averages-arithmetic-mean-2.ml @@ -0,0 +1,20 @@ +fun mean_reals [] = raise Empty + | mean_reals xs = let + val (total, length) = + foldl + (fn (x, (tot,len)) => (x + tot, len + 1.0)) + (0.0, 0.0) xs + in + (total / length) + end; + + +fun mean_ints [] = raise Empty + | mean_ints xs = let + val (total, length) = + foldl + (fn (x, (tot,len)) => (x + tot, len + 1.0)) + (0, 0.0) xs + in + (real total / length) + end; diff --git a/Task/Averages-Arithmetic-mean/TI-89-BASIC/averages-arithmetic-mean.ti-89 b/Task/Averages-Arithmetic-mean/TI-89-BASIC/averages-arithmetic-mean.ti-89 new file mode 100644 index 0000000000..7d225ec71f --- /dev/null +++ b/Task/Averages-Arithmetic-mean/TI-89-BASIC/averages-arithmetic-mean.ti-89 @@ -0,0 +1 @@ +Define rcmean(nums) = when(dim(nums) = 0, 0, mean(nums)) diff --git a/Task/Averages-Arithmetic-mean/Trith/averages-arithmetic-mean.trith b/Task/Averages-Arithmetic-mean/Trith/averages-arithmetic-mean.trith new file mode 100644 index 0000000000..556e9626e8 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Trith/averages-arithmetic-mean.trith @@ -0,0 +1,3 @@ +: mean dup empty? [drop 0] [dup [+] foldl1 swap length /] branch ; + +[3 1 4 1 5 9] mean diff --git a/Task/Averages-Arithmetic-mean/UNIX-Shell/averages-arithmetic-mean.sh b/Task/Averages-Arithmetic-mean/UNIX-Shell/averages-arithmetic-mean.sh new file mode 100644 index 0000000000..4d5c4b7630 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/UNIX-Shell/averages-arithmetic-mean.sh @@ -0,0 +1,24 @@ +mean() { + if expr $# >/dev/null; then + (count=0 + sum=0 + while expr $# \> 0 >/dev/null; do + sum=`expr $sum + "$1"` + result=$? + expr $result \> 1 >/dev/null && exit $result + + count=`expr $count + 1` + shift + done + expr $sum / $count) + else + echo 0 + fi +} + +printf "test 1: "; mean # 0 +printf "test 2: "; mean 300 # 300 +printf "test 3: "; mean 300 100 400 # 266 +printf "test 4: "; mean -400 400 -1300 200 # -275 +printf "test 5: "; mean - # expr: syntax error +printf "test 6: "; mean 1 2 A 3 # expr: non-numeric argument diff --git a/Task/Averages-Arithmetic-mean/UnixPipes/averages-arithmetic-mean.unixpipes b/Task/Averages-Arithmetic-mean/UnixPipes/averages-arithmetic-mean.unixpipes new file mode 100644 index 0000000000..55351e9fec --- /dev/null +++ b/Task/Averages-Arithmetic-mean/UnixPipes/averages-arithmetic-mean.unixpipes @@ -0,0 +1,22 @@ +term() { + b=$1;res=$2 + echo "scale=5;$res+$b" | bc +} + +sum() { + (read B; res=$1; + test -n "$B" && (term $B $res) || (term 0 $res)) +} + +fold() { + func=$1 + (while read a ; do + fold $func | $func $a + done) +} + +mean() { + tee >(wc -l > count) | fold sum | xargs echo "scale=5;(1/" $(cat count) ") * " | bc +} + +(echo 3; echo 1; echo 4) | mean diff --git a/Task/Averages-Arithmetic-mean/Ursala/averages-arithmetic-mean.ursala b/Task/Averages-Arithmetic-mean/Ursala/averages-arithmetic-mean.ursala new file mode 100644 index 0000000000..b77ab385f1 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Ursala/averages-arithmetic-mean.ursala @@ -0,0 +1,8 @@ +#import nat +#import flo + +mean = ~&?\0.! div^/plus:-0. float+ length + +#cast %e + +example = mean <5.,3.,-2.,6.,-4.> diff --git a/Task/Averages-Arithmetic-mean/V/averages-arithmetic-mean.v b/Task/Averages-Arithmetic-mean/V/averages-arithmetic-mean.v new file mode 100644 index 0000000000..181be8422e --- /dev/null +++ b/Task/Averages-Arithmetic-mean/V/averages-arithmetic-mean.v @@ -0,0 +1,5 @@ +[mean + [sum 0 [+] fold]. + dup sum + swap size [[1 <] [1]] when / +]. diff --git a/Task/Averages-Arithmetic-mean/Vala/averages-arithmetic-mean.vala b/Task/Averages-Arithmetic-mean/Vala/averages-arithmetic-mean.vala new file mode 100644 index 0000000000..3986aeeef7 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Vala/averages-arithmetic-mean.vala @@ -0,0 +1,25 @@ +double arithmetic(double[] list){ + double mean; + double sum = 0; + + if (list.length == 0) + return 0.0; + foreach(double number in list){ + sum += number; + } // foreach + + mean = sum / list.length; + + return mean; +} // end arithmetic mean + +public static void main(){ + double[] test = {1.0, 2.0, 5.0, -5.0, 9.5, 3.14159}; + double[] zero_len = {}; + + double mean = arithmetic(test); + double mean_zero = arithmetic(zero_len); + + stdout.printf("%s\n", mean.to_string()); + stdout.printf("%s\n", mean_zero.to_string()); +} diff --git a/Task/Averages-Arithmetic-mean/Vedit-macro-language/averages-arithmetic-mean.vedit b/Task/Averages-Arithmetic-mean/Vedit-macro-language/averages-arithmetic-mean.vedit new file mode 100644 index 0000000000..e4d8a9a2c3 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Vedit-macro-language/averages-arithmetic-mean.vedit @@ -0,0 +1,10 @@ +#1 = 0 // Sum +#2 = 0 // Count +BOF +While(!At_EOF) { + #1 += Num_Eval(SIMPLE) + #2++ + Line(1, ERRBREAK) +} +if (#2) { #1 /= #2 } +Num_Type(#1) diff --git a/Task/Averages-Arithmetic-mean/XPL0/averages-arithmetic-mean.xpl0 b/Task/Averages-Arithmetic-mean/XPL0/averages-arithmetic-mean.xpl0 new file mode 100644 index 0000000000..5ab0ffa88a --- /dev/null +++ b/Task/Averages-Arithmetic-mean/XPL0/averages-arithmetic-mean.xpl0 @@ -0,0 +1,17 @@ +code CrLf=9; +code real RlOut=48; + +func real Mean(A, N); +real A; int N; +real S; int I; +[if N=0 then return 0.0; +S:= 0.0; +for I:= 0 to N-1 do + S:= S+A(I); +return S/float(N); +]; \Mean + +real Test; +[Test:= [1.0, 2.0, 5.0, -5.0, 9.5, 3.14159]; +RlOut(0, Mean(Test, 6)); CrLf(0); +] diff --git a/Task/Averages-Arithmetic-mean/Yorick/averages-arithmetic-mean.yorick b/Task/Averages-Arithmetic-mean/Yorick/averages-arithmetic-mean.yorick new file mode 100644 index 0000000000..883c955732 --- /dev/null +++ b/Task/Averages-Arithmetic-mean/Yorick/averages-arithmetic-mean.yorick @@ -0,0 +1,4 @@ +func mean(x) { + if(is_void(x)) return 0; + return x(*)(avg); +} diff --git a/Task/Averages-Mean-angle/Mathematica/averages-mean-angle.mathematica b/Task/Averages-Mean-angle/Mathematica/averages-mean-angle.math similarity index 100% rename from Task/Averages-Mean-angle/Mathematica/averages-mean-angle.mathematica rename to Task/Averages-Mean-angle/Mathematica/averages-mean-angle.math diff --git a/Task/Averages-Mean-angle/OCaml/averages-mean-angle-1.ocaml b/Task/Averages-Mean-angle/OCaml/averages-mean-angle-1.ocaml new file mode 100644 index 0000000000..a654bb23b0 --- /dev/null +++ b/Task/Averages-Mean-angle/OCaml/averages-mean-angle-1.ocaml @@ -0,0 +1,25 @@ +let pi = 3.14159_26535_89793_23846_2643 + +let deg2rad d = + d *. pi /. 180.0 + +let rad2deg r = + r *. 180.0 /. pi + +let mean_angle angles = + let rad_angles = List.map deg2rad angles in + let sum_sin = List.fold_left (fun sum a -> sum +. sin a) 0.0 rad_angles + and sum_cos = List.fold_left (fun sum a -> sum +. cos a) 0.0 rad_angles + in + rad2deg (atan2 sum_sin sum_cos) + +let test angles = + Printf.printf "The mean angle of [%s] is: %g degrees\n" + (String.concat "; " (List.map (Printf.sprintf "%g") angles)) + (mean_angle angles) + +let () = + test [350.0; 10.0]; + test [90.0; 180.0; 270.0; 360.0]; + test [10.0; 20.0; 30.0]; +;; diff --git a/Task/Averages-Mean-angle/OCaml/averages-mean-angle-2.ocaml b/Task/Averages-Mean-angle/OCaml/averages-mean-angle-2.ocaml new file mode 100644 index 0000000000..3c6e7ff08d --- /dev/null +++ b/Task/Averages-Mean-angle/OCaml/averages-mean-angle-2.ocaml @@ -0,0 +1,7 @@ +open Complex + +let mean_angle angles = + let sum = + List.fold_left (fun sum a -> add sum (polar 1.0 (deg2rad a))) zero angles + in + rad2deg (arg sum) diff --git a/Task/Averages-Mean-angle/PARI-GP/averages-mean-angle.pari b/Task/Averages-Mean-angle/PARI-GP/averages-mean-angle.pari new file mode 100644 index 0000000000..3740c62fd4 --- /dev/null +++ b/Task/Averages-Mean-angle/PARI-GP/averages-mean-angle.pari @@ -0,0 +1,3 @@ +meanAngle(v)=atan(sum(i=1,#v,sin(v[i]))/sum(i=1,#v,cos(v[i])))%(2*Pi) +meanDegrees(v)=meanAngle(v*Pi/180)*180/Pi +apply(meanDegrees,[[350, 10], [90, 180, 270, 360], [10, 20, 30]]) diff --git a/Task/Averages-Mean-angle/PL-I/averages-mean-angle.pli b/Task/Averages-Mean-angle/PL-I/averages-mean-angle.pli new file mode 100644 index 0000000000..ba214def5d --- /dev/null +++ b/Task/Averages-Mean-angle/PL-I/averages-mean-angle.pli @@ -0,0 +1,18 @@ +averages: procedure options (main); /* 31 August 2012 */ + declare b1(2) fixed initial (350, 10); + declare b2(4) fixed initial (90, 180, 270, 360); + declare b3(3) fixed initial (10, 20, 30); + + put edit ( b1) (f(7)); + put edit ( ' mean=', mean(b1) ) (a, f(7) ); + put skip edit ( b3) (f(7)); + put edit ( ' mean=', mean(b3) ) (a, f(7) ); + put skip edit ( b2) (f(7)); + put edit ( ' mean=', mean(b2) ) (a, f(7) ); + +mean: procedure (a) returns (fixed); + declare a(*) float (18); + return ( atand(sum(sind(a))/hbound(a), sum(cosd(a))/hbound(a) ) ); +end mean; + +end averages; diff --git a/Task/Averages-Mean-angle/Perl-6/averages-mean-angle.pl6 b/Task/Averages-Mean-angle/Perl-6/averages-mean-angle.pl6 new file mode 100644 index 0000000000..dd7ea230de --- /dev/null +++ b/Task/Averages-Mean-angle/Perl-6/averages-mean-angle.pl6 @@ -0,0 +1,14 @@ +sub deg2rad { $^d * pi / 180 } +sub rad2deg { $^r * 180 / pi } +sub phase ($c) { + my ($mag,$ang) = $c.polar; + return NaN if $mag < 1e-16; + $ang; +} + +sub meanAngle { rad2deg phase [+] map { cis deg2rad $_ }, @^angles } + +say meanAngle($_).fmt("%.2f\tis the mean angle of "), $_ for + [350, 10], + [90, 180, 270, 360], + [10, 20, 30]; diff --git a/Task/Averages-Mean-angle/XPL0/averages-mean-angle.xpl0 b/Task/Averages-Mean-angle/XPL0/averages-mean-angle.xpl0 new file mode 100644 index 0000000000..3fc77e147a --- /dev/null +++ b/Task/Averages-Mean-angle/XPL0/averages-mean-angle.xpl0 @@ -0,0 +1,22 @@ +include c:\cxpl\codes; + +def Pi = 3.14159265358979323846; +def D2R = Pi/180.0; \coefficient to convert degrees to radians + +func real MeanAng(A); \Return the mean of the given list of angles +int A; +real X, Y; +int I; +[X:= 0.0; Y:= 0.0; +for I:= 1 to A(0) do + [X:= X + Cos(D2R*float(A(I))); + Y:= Y + Sin(D2R*float(A(I))); + ]; +return ATan2(Y,X)/D2R; +]; + +[Format(5, 15); +RlOut(0, MeanAng([2, 350, 10])); CrLf(0); +RlOut(0, MeanAng([4, 90, 180, 270, 360])); CrLf(0); +RlOut(0, MeanAng([3, 10, 20, 30])); CrLf(0); +] diff --git a/Task/Averages-Mean-time-of-day/Mathematica/averages-mean-time-of-day.mathematica b/Task/Averages-Mean-time-of-day/Mathematica/averages-mean-time-of-day.math similarity index 100% rename from Task/Averages-Mean-time-of-day/Mathematica/averages-mean-time-of-day.mathematica rename to Task/Averages-Mean-time-of-day/Mathematica/averages-mean-time-of-day.math diff --git a/Task/Averages-Mean-time-of-day/OCaml/averages-mean-time-of-day.ocaml b/Task/Averages-Mean-time-of-day/OCaml/averages-mean-time-of-day.ocaml new file mode 100644 index 0000000000..45ea084e27 --- /dev/null +++ b/Task/Averages-Mean-time-of-day/OCaml/averages-mean-time-of-day.ocaml @@ -0,0 +1,37 @@ +let pi_twice = 2.0 *. 3.14159_26535_89793_23846_2643 +let day = float (24 * 60 * 60) + +let rad_of_time t = + t *. pi_twice /. day + +let time_of_rad r = + r *. day /. pi_twice + +let mean_angle angles = + let sum_sin = List.fold_left (fun sum a -> sum +. sin a) 0.0 angles + and sum_cos = List.fold_left (fun sum a -> sum +. cos a) 0.0 angles in + atan2 sum_sin sum_cos + +let mean_time times = + let angles = List.map rad_of_time times in + let t = time_of_rad (mean_angle angles) in + if t < 0.0 then t +. day else t + +let parse_time t = + Scanf.sscanf t "%d:%d:%d" (fun h m s -> float (s + m * 60 + h * 3600)) + +let round x = int_of_float (floor (x +. 0.5)) + +let string_of_time t = + let t = round t in + let h = t / 3600 in + let rem = t mod 3600 in + let m = rem / 60 in + let s = rem mod 60 in + Printf.sprintf "%d:%d:%d" h m s + +let () = + let times = ["23:00:17"; "23:40:20"; "00:12:45"; "00:17:19"] in + Printf.printf "The mean time of [%s] is: %s\n" + (String.concat "; " times) + (string_of_time (mean_time (List.map parse_time times))) diff --git a/Task/Averages-Mean-time-of-day/PARI-GP/averages-mean-time-of-day.pari b/Task/Averages-Mean-time-of-day/PARI-GP/averages-mean-time-of-day.pari new file mode 100644 index 0000000000..ae95866faf --- /dev/null +++ b/Task/Averages-Mean-time-of-day/PARI-GP/averages-mean-time-of-day.pari @@ -0,0 +1,3 @@ +meanAngle(v)=atan(sum(i=1,#v,sin(v[i]))/sum(i=1,#v,cos(v[i])))%(2*Pi) +meanTime(v)=my(x=meanAngle(2*Pi*apply(u->u[1]/24+u[2]/1440+u[3]/86400, v))*12/Pi); [x\1, 60*(x-=x\1)\1, 60*(60*x-60*x\1)] +meanTime([[23,0,17], [23,40,20], [0,12,45], [0,17,19]]) diff --git a/Task/Averages-Mean-time-of-day/Perl-6/averages-mean-time-of-day.pl6 b/Task/Averages-Mean-time-of-day/Perl-6/averages-mean-time-of-day.pl6 new file mode 100644 index 0000000000..5416be607b --- /dev/null +++ b/Task/Averages-Mean-time-of-day/Perl-6/averages-mean-time-of-day.pl6 @@ -0,0 +1,13 @@ +sub tod2rad($_) { [+](.comb(/\d+/) Z* 3600,60,1) * pi / 43200 } + +sub rad2tod ($r) { + my $x = $r * 43200 / pi; + (($x xx 3 Z/ 3600,60,1) Z% 24,60,60).fmt('%02d',':'); +} + +sub phase ($c) { $c.polar[1] } + +sub mean-time (@t) { rad2tod phase [+] map { cis tod2rad $_ }, @t } + +say mean-time($_).fmt("%s is the mean time of "), $_ for + ["23:00:17", "23:40:20", "00:12:45", "00:17:19"]; diff --git a/Task/Averages-Mean-time-of-day/XPL0/averages-mean-time-of-day.xpl0 b/Task/Averages-Mean-time-of-day/XPL0/averages-mean-time-of-day.xpl0 new file mode 100644 index 0000000000..03ccb72fe7 --- /dev/null +++ b/Task/Averages-Mean-time-of-day/XPL0/averages-mean-time-of-day.xpl0 @@ -0,0 +1,37 @@ +include c:\cxpl\codes; + +proc NumOut(N); \Display 2-digit N with leading zero +int N; +[if N<10 then ChOut(0, ^0); +IntOut(0, N); +]; + +proc TimeOut(Sec); \Display real seconds as HH:MM:SS +real Sec; +[NumOut(fix(Sec)/3600); ChOut(0, ^:); + NumOut(rem(0)/60); ChOut(0, ^:); + NumOut(rem(0)); +]; + +func real HMS2Sec(H, M, S); \Convert hours, minutes, seconds to real seconds +int H, M, S; +return float(((H*60 + M)*60) + S); + +func real MeanTime(A); \Return the mean of the given list of times +int A; +real X, Y, Sec; +int I; +def Pi = 3.14159265358979323846; +def S2R = Pi/(12.*60.*60.); \coefficient to convert seconds to radians +[X:= 0.0; Y:= 0.0; +for I:= 1 to A(0) do + [Sec:= HMS2Sec(A(I,0), A(I,1), A(I,2)); + X:= X + Cos(Sec*S2R); + Y:= Y + Sin(Sec*S2R); + ]; +Sec:= ATan2(Y,X)/S2R; +if Sec < 0.0 then Sec:= Sec + 24.*60.*60.; +return Sec; +]; + +TimeOut(MeanTime([4, [23,00,17], [23,40,20], [00,12,45], [00,17,19]])) diff --git a/Task/Averages-Median/BASIC/averages-median.bas b/Task/Averages-Median/BASIC/averages-median.basic similarity index 100% rename from Task/Averages-Median/BASIC/averages-median.bas rename to Task/Averages-Median/BASIC/averages-median.basic diff --git a/Task/Averages-Median/Mathematica/averages-median-1.mathematica b/Task/Averages-Median/Mathematica/averages-median-1.math similarity index 100% rename from Task/Averages-Median/Mathematica/averages-median-1.mathematica rename to Task/Averages-Median/Mathematica/averages-median-1.math diff --git a/Task/Averages-Median/Mathematica/averages-median-2.mathematica b/Task/Averages-Median/Mathematica/averages-median-2.math similarity index 100% rename from Task/Averages-Median/Mathematica/averages-median-2.mathematica rename to Task/Averages-Median/Mathematica/averages-median-2.math diff --git a/Task/Averages-Median/Mathematica/averages-median-3.mathematica b/Task/Averages-Median/Mathematica/averages-median-3.math similarity index 100% rename from Task/Averages-Median/Mathematica/averages-median-3.mathematica rename to Task/Averages-Median/Mathematica/averages-median-3.math diff --git a/Task/Averages-Median/NetRexx/averages-median.netrexx b/Task/Averages-Median/NetRexx/averages-median.netrexx new file mode 100644 index 0000000000..e16346ac78 --- /dev/null +++ b/Task/Averages-Median/NetRexx/averages-median.netrexx @@ -0,0 +1,64 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +class RAvgMedian00 public + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method median(lvector = java.util.List) public static returns Rexx + cvector = ArrayList(lvector) -- make a copy of input to ensure it's contents are preserved + Collections.sort(cvector, RAvgMedian00.RexxComparator()) + kVal = ((Rexx cvector.get(cvector.size() % 2)) + (Rexx cvector.get((cvector.size() - 1) % 2))) / 2 + return kVal + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method median(rvector = Rexx[]) public static returns Rexx + return median(ArrayList(Arrays.asList(rvector))) + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method show_median(lvector = java.util.List) public static returns Rexx + mVal = median(lvector) + say 'Meadian:' mVal.format(10, 6, 3, 6, 's')', Vector:' (Rexx lvector).space(0) + return mVal + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method show_median(rvector = Rexx[]) public static returns Rexx + return show_median(ArrayList(Arrays.asList(rvector))) + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method run_samples() public static + show_median([Rexx 10.0]) -- 10.0 + show_median([Rexx 10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0]) -- 5.5 + show_median([Rexx 9, 8, 7, 6, 5, 4, 3, 2, 1]) -- 5.0 + show_median([Rexx 1.0, 9, 2.0, 4.0]) -- 3.0 + show_median([Rexx 3.0, 1, 4, 1.0, 5.0, 9, 7.0, 6.0]) -- 4.5 + show_median([Rexx 3, 4, 1, -8.4, 7.2, 4, 1, 1.2]) -- 2.1 + show_median([Rexx -1.2345678e+99, 2.3e+700]) -- 1.15e+700 + show_median([Rexx 4.1, 5.6, 7.2, 1.7, 9.3, 4.4, 3.2]) -- 4.4 + show_median([Rexx 4.1, 7.2, 1.7, 9.3, 4.4, 3.2]) -- 4.25 + show_median([Rexx 28.207, 74.916, 51.695, 72.486, 51.118, 3.241, 73.807]) -- 51.695 + show_median([Rexx 27.984, 89.172, 0.250, 66.316, 41.805, 60.043]) -- 50.924 + show_median([Rexx 5.1, 2.6, 6.2, 8.8, 4.6, 4.1]) -- 4.85 + show_median([Rexx 5.1, 2.6, 8.8, 4.6, 4.1]) -- 4.6 + show_median([Rexx 4.4, 2.3, -1.7, 7.5, 6.6, 0.0, 1.9, 8.2, 9.3, 4.5]) -- 4.45 + show_median([Rexx 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0.11]) -- 3.0 + show_median([Rexx 10, 20, 30, 40, 50, -100, 4.7, -11e+2]) -- 15.0 + show_median([Rexx 9.3, -2.0, 4.0, 7.3, 8.1, 4.1, -6.3, 4.2, -1.0, -8.4]) -- 4.05 + show_median([Rexx 8.3, -3.6, 5.7, 2.3, 9.3, 5.4, -2.3, 6.3, 9.9]) -- 5.7 + return + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method main(args = String[]) public static + run_samples() + return + +-- ============================================================================= +class RAvgMedian00.RexxComparator implements Comparator + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method compare(i1=Object, i2=Object) public returns int + i = Rexx i1 + j = Rexx i2 + + if i < j then return -1 + if i > j then return +1 + else return 0 diff --git a/Task/Averages-Median/NewLISP/averages-median.newlisp b/Task/Averages-Median/NewLISP/averages-median.newlisp new file mode 100644 index 0000000000..3cb517fadc --- /dev/null +++ b/Task/Averages-Median/NewLISP/averages-median.newlisp @@ -0,0 +1,23 @@ +; median.lsp +; oofoe 2012-01-25 + +(define (median lst) + (sort lst) ; Sorts in place. + (if (empty? lst) + nil + (letn ((n (length lst)) + (h (/ (- n 1) 2))) + (if (zero? (mod n 2)) + (div (add (lst h) (lst (+ h 1))) 2) + (lst h)) + ))) + + +(define (test lst) (println lst " -> " (median lst))) + +(test '()) +(test '(5 3 4)) +(test '(5 4 2 3)) +(test '(3 4 1 -8.4 7.2 4 1 1.2)) + +(exit) diff --git a/Task/Averages-Median/OCaml/averages-median.ocaml b/Task/Averages-Median/OCaml/averages-median.ocaml new file mode 100644 index 0000000000..65ad21a0b7 --- /dev/null +++ b/Task/Averages-Median/OCaml/averages-median.ocaml @@ -0,0 +1,10 @@ +(* note: this modifies the input array *) +let median array = + let len = Array.length array in + Array.sort compare array; + (array.((len-1)/2) +. array.(len/2)) /. 2.0;; + +let a = [|4.1; 5.6; 7.2; 1.7; 9.3; 4.4; 3.2|];; +median a;; +let a = [|4.1; 7.2; 1.7; 9.3; 4.4; 3.2|];; +median a;; diff --git a/Task/Averages-Median/Oberon-2/averages-median.oberon-2 b/Task/Averages-Median/Oberon-2/averages-median.oberon-2 new file mode 100644 index 0000000000..5bd94693bb --- /dev/null +++ b/Task/Averages-Median/Oberon-2/averages-median.oberon-2 @@ -0,0 +1,81 @@ +MODULE Median; +IMPORT Out; +CONST + MAXSIZE = 100; + +PROCEDURE Partition(VAR a: ARRAY OF REAL; left, right: INTEGER): INTEGER; +VAR + pValue,aux: REAL; + store,i,pivot: INTEGER; +BEGIN + pivot := right; + pValue := a[pivot]; + aux := a[right];a[right] := a[pivot];a[pivot] := aux; (* a[pivot] <-> a[right] *) + store := left; + FOR i := left TO right -1 DO + IF a[i] <= pValue THEN + aux := a[store];a[store] := a[i];a[i]:=aux; + INC(store) + END + END; + aux := a[right];a[right] := a[store]; a[store] := aux; + RETURN store +END Partition; + +(* QuickSelect algorithm *) +PROCEDURE Select(a: ARRAY OF REAL; left,right,k: INTEGER;VAR r: REAL); +VAR + pIndex, pDist : INTEGER; +BEGIN + IF left = right THEN r := a[left]; RETURN END; + pIndex := Partition(a,left,right); + pDist := pIndex - left + 1; + IF pDist = k THEN + r := a[pIndex];RETURN + ELSIF k < pDist THEN + Select(a,left, pIndex - 1, k, r) + ELSE + Select(a,pIndex + 1, right, k - pDist, r) + END +END Select; + +PROCEDURE Median(a: ARRAY OF REAL;left,right: INTEGER): REAL; +VAR + idx,len : INTEGER; + r1,r2 : REAL; +BEGIN + len := right - left + 1; + idx := len DIV 2 + 1; + r1 := 0.0;r2 := 0.0; + Select(a,left,right,idx,r1); + IF ODD(len) THEN RETURN r1 END; + Select(a,left,right,idx - 1,r2); + RETURN (r1 + r2) / 2; +END Median; + + +VAR + ary: ARRAY MAXSIZE OF REAL; + r: REAL; +BEGIN + r := 0.0; + Out.Fixed(Median(ary,0,0),4,2);Out.Ln; (* empty *) + ary[0] := 5; + ary[1] := 3; + ary[2] := 4; + Out.Fixed(Median(ary,0,2),4,2);Out.Ln; + ary[0] := 5; + ary[1] := 4; + ary[2] := 2; + ary[3] := 3; + Out.Fixed(Median(ary,0,3),4,2);Out.Ln; + ary[0] := 3; + ary[1] := 4; + ary[2] := 1; + ary[3] := -8.4; + ary[4] := 7.2; + ary[5] := 4; + ary[6] := 1; + ary[7] := 1.2; + Out.Fixed(Median(ary,0,7),4,2);Out.Ln; +END Median. diff --git a/Task/Averages-Median/Objeck/averages-median.objeck b/Task/Averages-Median/Objeck/averages-median.objeck new file mode 100644 index 0000000000..d6c855a632 --- /dev/null +++ b/Task/Averages-Median/Objeck/averages-median.objeck @@ -0,0 +1,31 @@ +use Structure; + +bundle Default { + class Median { + function : Main(args : String[]) ~ Nil { + numbers := FloatVector->New([4.1, 5.6, 7.2, 1.7, 9.3, 4.4, 3.2]); + DoMedian(numbers)->PrintLine(); + + numbers := FloatVector->New([4.1, 7.2, 1.7, 9.3, 4.4, 3.2]); + DoMedian(numbers)->PrintLine(); + } + + function : native : DoMedian(numbers : FloatVector) ~ Float { + if(numbers->Size() = 0) { + return 0.0; + } + else if(numbers->Size() = 1) { + return numbers->Get(0); + }; + + numbers->Sort(); + + i := numbers->Size() / 2; + if(numbers->Size() % 2 = 0) { + return (numbers->Get(i - 1) + numbers->Get(i)) / 2.0; + }; + + return numbers->Get(i); + } + } +} diff --git a/Task/Averages-Median/Octave/averages-median.octave b/Task/Averages-Median/Octave/averages-median.octave new file mode 100644 index 0000000000..8451fc3014 --- /dev/null +++ b/Task/Averages-Median/Octave/averages-median.octave @@ -0,0 +1,21 @@ +function y = median2(v) + if (numel(v) < 1) + y = NA; + else + sv = sort(v); + l = numel(v); + if ( mod(l, 2) == 0 ) + y = (sv(floor(l/2)+1) + sv(floor(l/2)))/2; + else + y = sv(floor(l/2)+1); + endif + endif +endfunction + +a = [4.1, 5.6, 7.2, 1.7, 9.3, 4.4, 3.2]; +b = [4.1, 7.2, 1.7, 9.3, 4.4, 3.2]; + +disp(median2(a)) % 4.4 +disp(median(a)) +disp(median2(b)) % 4.25 +disp(median(b)) diff --git a/Task/Averages-Median/Oz/averages-median.oz b/Task/Averages-Median/Oz/averages-median.oz new file mode 100644 index 0000000000..bf505fbad0 --- /dev/null +++ b/Task/Averages-Median/Oz/averages-median.oz @@ -0,0 +1,13 @@ +declare + fun {Median Xs} + Len = {Length Xs} + Mid = Len div 2 + 1 %% 1-based index + Sorted = {Sort Xs Value.'<'} + in + if {IsOdd Len} then {Nth Sorted Mid} + else ({Nth Sorted Mid} + {Nth Sorted Mid-1}) / 2.0 + end + end +in + {Show {Median [4.1 5.6 7.2 1.7 9.3 4.4 3.2]}} + {Show {Median [4.1 7.2 1.7 9.3 4.4 3.2]}} diff --git a/Task/Averages-Median/PARI-GP/averages-median-1.pari b/Task/Averages-Median/PARI-GP/averages-median-1.pari new file mode 100644 index 0000000000..9fc6e86268 --- /dev/null +++ b/Task/Averages-Median/PARI-GP/averages-median-1.pari @@ -0,0 +1,3 @@ +median(v)={ + vecsort(v)[#v\2] +}; diff --git a/Task/Averages-Median/PARI-GP/averages-median-2.pari b/Task/Averages-Median/PARI-GP/averages-median-2.pari new file mode 100644 index 0000000000..a89dcbd57b --- /dev/null +++ b/Task/Averages-Median/PARI-GP/averages-median-2.pari @@ -0,0 +1,21 @@ +BFPRT(v,k=#v\2)={ + if(#v<15, return(vecsort(v)[k])); + my(u=List(),pivot,left=List(),right=List()); + forstep(i=1,#v-4,5, + listput(u,BFPRT([v[i],v[i+1],v[i+2],v[i+3],v[i+4]])) + ); + pivot=BFPRT(Vec(u)); + u=0; + for(i=1,#v, + if(v[i]#left, + BFPRT(right, k-#left) + , + BFPRT(left, k) + ) +}; diff --git a/Task/Averages-Median/PL-I/averages-median.pli b/Task/Averages-Median/PL-I/averages-median.pli new file mode 100644 index 0000000000..603541c4af --- /dev/null +++ b/Task/Averages-Median/PL-I/averages-median.pli @@ -0,0 +1,6 @@ +call sort(A); +n = dimension(A,1); +if iand(n,1) = 1 then /* an odd number of elements */ + median = A(n/2); +else /* an even number of elements */ + median = (a(n/2) + a(trunc(n/2)+1) )/2; diff --git a/Task/Averages-Median/Pascal/averages-median.pascal b/Task/Averages-Median/Pascal/averages-median.pascal new file mode 100644 index 0000000000..9600bac8e7 --- /dev/null +++ b/Task/Averages-Median/Pascal/averages-median.pascal @@ -0,0 +1,57 @@ +Program AveragesMedian(output); + +type + TDoubleArray = array of double; + +procedure bubbleSort(var list: TDoubleArray); +var + i, j, n: integer; + t: double; +begin + n := length(list); + for i := n downto 2 do + for j := 0 to i - 1 do + if list[j] > list[j + 1] then + begin + t := list[j]; + list[j] := list[j + 1]; + list[j + 1] := t; + end; +end; + +function Median(aArray: TDoubleArray): double; +var + lMiddleIndex: integer; +begin + bubbleSort(aArray); + lMiddleIndex := (high(aArray) - low(aArray)) div 2; + if Odd(Length(aArray)) then + Median := aArray[lMiddleIndex + 1] + else + Median := (aArray[lMiddleIndex + 1] + aArray[lMiddleIndex]) / 2; +end; + +var + A: TDoubleArray; + i: integer; + +begin + randomize; + setlength(A, 7); + for i := low(A) to high(A) do + begin + A[i] := 100 * random; + write (A[i]:7:3, ' '); + end; + writeln; + writeln('Median: ', Median(A):7:3); + + setlength(A, 6); + for i := low(A) to high(A) do + begin + A[i] := 100 * random; + write (A[i]:7:3, ' '); + end; + writeln; + writeln('Median: ', Median(A):7:3); +end. diff --git a/Task/Averages-Median/Perl-6/averages-median.pl6 b/Task/Averages-Median/Perl-6/averages-median.pl6 new file mode 100644 index 0000000000..91de232a45 --- /dev/null +++ b/Task/Averages-Median/Perl-6/averages-median.pl6 @@ -0,0 +1,4 @@ +sub median { + my @a = sort @_; + return (@a[@a.end / 2] + @a[@a / 2]) / 2; +} diff --git a/Task/Averages-Median/Pure/averages-median.pure b/Task/Averages-Median/Pure/averages-median.pure new file mode 100644 index 0000000000..2309b4be22 --- /dev/null +++ b/Task/Averages-Median/Pure/averages-median.pure @@ -0,0 +1,5 @@ +median x = (/(2-rem)) $ foldl1 (+) $ take (2-rem) $ drop (mid-(1-rem)) $ sort (<=) x + when len = # x; + mid = len div 2; + rem = len mod 2; + end; diff --git a/Task/Averages-Median/PureBasic/averages-median.purebasic b/Task/Averages-Median/PureBasic/averages-median.purebasic new file mode 100644 index 0000000000..d5814a6b51 --- /dev/null +++ b/Task/Averages-Median/PureBasic/averages-median.purebasic @@ -0,0 +1,35 @@ +Procedure.d median(Array values.d(1), length.i) + If length = 0 : ProcedureReturn 0.0 : EndIf + SortArray(values(), #PB_Sort_Ascending) + If length % 2 + ProcedureReturn values(length / 2) + EndIf + ProcedureReturn 0.5 * (values(length / 2 - 1) + values(length / 2)) +EndProcedure + +Procedure.i readArray(Array values.d(1)) + Protected length.i, i.i + Read.i length + ReDim values(length - 1) + For i = 0 To length - 1 + Read.d values(i) + Next + ProcedureReturn i +EndProcedure + +Dim floats.d(0) +Restore array1 +length.i = readArray(floats()) +Debug median(floats(), length) +Restore array2 +length.i = readArray(floats()) +Debug median(floats(), length) + +DataSection + array1: + Data.i 7 + Data.d 4.1, 5.6, 7.2, 1.7, 9.3, 4.4, 3.2 + array2: + Data.i 6 + Data.d 4.1, 7.2, 1.7, 9.3, 4.4, 3.2 +EndDataSection diff --git a/Task/Averages-Median/REBOL/averages-median.rebol b/Task/Averages-Median/REBOL/averages-median.rebol new file mode 100644 index 0000000000..3b059ddcdc --- /dev/null +++ b/Task/Averages-Median/REBOL/averages-median.rebol @@ -0,0 +1,15 @@ +median: func [ + "Returns the midpoint value in a series of numbers; half the values are above, half are below." + block [any-block!] + /local len mid +][ + if empty? block [return none] + block: sort copy block + len: length? block + mid: to integer! len / 2 + either odd? len [ + pick block add 1 mid + ][ + (block/:mid) + (pick block add 1 mid) / 2 + ] +] diff --git a/Task/Averages-Median/Seed7/averages-median.seed7 b/Task/Averages-Median/Seed7/averages-median.seed7 new file mode 100644 index 0000000000..27558e29be --- /dev/null +++ b/Task/Averages-Median/Seed7/averages-median.seed7 @@ -0,0 +1,28 @@ +$ include "seed7_05.s7i"; + include "float.s7i"; + +const type: floatList is array float; + +const func float: median (in floatList: floats) is func + result + var float: median is 0.0; + local + var floatList: sortedFloats is 0 times 0.0; + begin + sortedFloats := sort(floats); + if odd(length(sortedFloats)) then + median := sortedFloats[succ(length(sortedFloats)) div 2]; + else + median := 0.5 * (sortedFloats[length(sortedFloats) div 2] + + sortedFloats[succ(length(sortedFloats) div 2)]); + end if; + end func; + +const proc: main is func + local + const floatList: flist1 is [] (5.1, 2.6, 6.2, 8.8, 4.6, 4.1); + const floatList: flist2 is [] (5.1, 2.6, 8.8, 4.6, 4.1); + begin + writeln("flist1 median is " <& median(flist1) digits 2 lpad 7); # 4.85 + writeln("flist2 median is " <& median(flist2) digits 2 lpad 7); # 4.60 + end func; diff --git a/Task/Averages-Median/Slate/averages-median-1.slate b/Task/Averages-Median/Slate/averages-median-1.slate new file mode 100644 index 0000000000..6566975723 --- /dev/null +++ b/Task/Averages-Median/Slate/averages-median-1.slate @@ -0,0 +1,11 @@ +s@(Sequence traits) median +[ + s isEmpty + ifTrue: [Nil] + ifFalse: + [| sorted | + sorted: s sort. + sorted length `cache isEven + ifTrue: [(sorted middle + (sorted at: sorted indexMiddle - 1)) / 2] + ifFalse: [sorted middle]] +]. diff --git a/Task/Averages-Median/Slate/averages-median-2.slate b/Task/Averages-Median/Slate/averages-median-2.slate new file mode 100644 index 0000000000..146fb497cf --- /dev/null +++ b/Task/Averages-Median/Slate/averages-median-2.slate @@ -0,0 +1,2 @@ +inform: { 4.1 . 5.6 . 7.2 . 1.7 . 9.3 . 4.4 . 3.2 } median. +inform: { 4.1 . 7.2 . 1.7 . 9.3 . 4.4 . 3.2 } median. diff --git a/Task/Averages-Median/TI-83-BASIC/averages-median.ti-83 b/Task/Averages-Median/TI-83-BASIC/averages-median.ti-83 new file mode 100644 index 0000000000..d9b90ff036 --- /dev/null +++ b/Task/Averages-Median/TI-83-BASIC/averages-median.ti-83 @@ -0,0 +1 @@ +median({1.1, 2.5, 0.3241}) diff --git a/Task/Averages-Median/TI-89-BASIC/averages-median.ti-89 b/Task/Averages-Median/TI-89-BASIC/averages-median.ti-89 new file mode 100644 index 0000000000..d4aaa1f494 --- /dev/null +++ b/Task/Averages-Median/TI-89-BASIC/averages-median.ti-89 @@ -0,0 +1 @@ +median({3, 4, 1, -8.4, 7.2, 4, 1, 1}) diff --git a/Task/Averages-Median/Ursala/averages-median-1.ursala b/Task/Averages-Median/Ursala/averages-median-1.ursala new file mode 100644 index 0000000000..2fb25d0ef5 --- /dev/null +++ b/Task/Averages-Median/Ursala/averages-median-1.ursala @@ -0,0 +1,4 @@ +#import std +#import flo + +median = fleq-<; @K30K31X eql?\~&rh div\2.+ plus@lzPrhPX diff --git a/Task/Averages-Median/Ursala/averages-median-2.ursala b/Task/Averages-Median/Ursala/averages-median-2.ursala new file mode 100644 index 0000000000..23cfa34c11 --- /dev/null +++ b/Task/Averages-Median/Ursala/averages-median-2.ursala @@ -0,0 +1,7 @@ +#cast %eW + +examples = + +median~~ ( + <9.3,-2.0,4.0,7.3,8.1,4.1,-6.3,4.2,-1.0,-8.4>, + <8.3,-3.6,5.7,2.3,9.3,5.4,-2.3,6.3,9.9>) diff --git a/Task/Averages-Median/Vedit-macro-language/averages-median.vedit b/Task/Averages-Median/Vedit-macro-language/averages-median.vedit new file mode 100644 index 0000000000..c920931b7f --- /dev/null +++ b/Task/Averages-Median/Vedit-macro-language/averages-median.vedit @@ -0,0 +1,3 @@ +Sort(0, File_Size, NOCOLLATE+NORESTORE) +EOF Goto_Line(Cur_Line/2) +Reg_Copy(10, 1) diff --git a/Task/Averages-Mode/Mathematica/averages-mode.mathematica b/Task/Averages-Mode/Mathematica/averages-mode.math similarity index 100% rename from Task/Averages-Mode/Mathematica/averages-mode.mathematica rename to Task/Averages-Mode/Mathematica/averages-mode.math diff --git a/Task/Averages-Mode/NetRexx/averages-mode.netrexx b/Task/Averages-Mode/NetRexx/averages-mode.netrexx new file mode 100644 index 0000000000..4469cdf32a --- /dev/null +++ b/Task/Averages-Mode/NetRexx/averages-mode.netrexx @@ -0,0 +1,75 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +run_samples() +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method mode(lvector = java.util.List) public static returns java.util.List + seen = 0 + modes = '' + modeMax = 0 + loop v_ = 0 to lvector.size() - 1 + mv = Rexx lvector.get(v_) + seen[mv] = seen[mv] + 1 + select + when seen[mv] > modeMax then do + modeMax = seen[mv] + modes = '' + nx = 1 + modes[0] = nx + modes[nx] = mv + end + when seen[mv] = modeMax then do + nx = modes[0] + 1 + modes[0] = nx + modes[nx] = mv + end + otherwise do + nop + end + end + end v_ + + modeList = ArrayList(modes[0]) + loop v_ = 1 to modes[0] + val = modes[v_] + modeList.add(val) + end v_ + + return modeList + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method mode(rvector = Rexx[]) public static returns java.util.List + return mode(ArrayList(Arrays.asList(rvector))) + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method show_mode(lvector = java.util.List) public static returns java.util.List + modes = mode(lvector) + say 'Vector:' (Rexx lvector).space(0)', Mode(s):' (Rexx modes).space(0) + return modes + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method show_mode(rvector = Rexx[]) public static returns java.util.List + return show_mode(ArrayList(Arrays.asList(rvector))) + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method run_samples() public static + show_mode([Rexx 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) -- 10 9 8 7 6 5 4 3 2 1 + show_mode([Rexx 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0.11]) -- 0 + show_mode([Rexx 30, 10, 20, 30, 40, 50, -100, 4.7, -11e+2]) -- 30 + show_mode([Rexx 30, 10, 20, 30, 40, 50, -100, 4.7, -11e+2, -11e+2]) -- 30 -11e2 + show_mode([Rexx 1, 8, 6, 0, 1, 9, 4, 6, 1, 9, 9, 9]) -- 9 + show_mode([Rexx 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) -- 1 2 3 4 5 6 7 8 9 10 11 + show_mode([Rexx 8, 8, 8, 2, 2, 2]) -- 8 2 + show_mode([Rexx 'cat', 'kat', 'Cat', 'emu', 'emu', 'Kat']) -- emu + show_mode([Rexx 0, 1, 2, 3, 3, 3, 4, 4, 4, 4, 1, 0]) -- 4 + show_mode([Rexx 2, 7, 1, 8, 2]) -- 2 + show_mode([Rexx 2, 7, 1, 8, 2, 8]) -- 8 2 + show_mode([Rexx 'E', 'n', 'z', 'y', 'k', 'l', 'o', 'p', 'ä', 'd', 'i', 'e']) -- E n z y k l o p ä d i e + show_mode([Rexx 'E', 'n', 'z', 'y', 'k', 'l', 'o', 'p', 'ä', 'd', 'i', 'e', 'ä']) -- ä + show_mode([Rexx 3, 1, 4, 1, 5, 9, 7, 6]) -- 1 + show_mode([Rexx 3, 1, 4, 1, 5, 9, 7, 6, 3]) -- 3, 1 + show_mode([Rexx 1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]) -- 6 + show_mode([Rexx 1, 1, 2, 4, 4]) -- 4 1 + return diff --git a/Task/Averages-Mode/OCaml/averages-mode.ocaml b/Task/Averages-Mode/OCaml/averages-mode.ocaml new file mode 100644 index 0000000000..e8fd19a4b9 --- /dev/null +++ b/Task/Averages-Mode/OCaml/averages-mode.ocaml @@ -0,0 +1,13 @@ +let mode lst = + let seen = Hashtbl.create 42 in + List.iter (fun x -> + let old = if Hashtbl.mem seen x then + Hashtbl.find seen x + else 0 in + Hashtbl.replace seen x (old + 1)) + lst; + let best = Hashtbl.fold (fun _ -> max) seen 0 in + Hashtbl.fold (fun k v acc -> + if v = best then k :: acc + else acc) + seen [] diff --git a/Task/Averages-Mode/Objective-C/averages-mode.m b/Task/Averages-Mode/Objective-C/averages-mode.m new file mode 100644 index 0000000000..0696bc925a --- /dev/null +++ b/Task/Averages-Mode/Objective-C/averages-mode.m @@ -0,0 +1,26 @@ +#import + +@interface NSArray (Mode) +- (NSArray *)mode; +@end + +@implementation NSArray (Mode) +- (NSArray *)mode { + NSCountedSet *seen = [NSCountedSet setWithArray:self]; + int max = 0; + NSMutableArray *maxElems = [NSMutableArray array]; + NSEnumerator *enm = [seen objectEnumerator]; + id obj; + while( (obj = [enm nextObject]) ) { + int count = [seen countForObject:obj]; + if (count > max) { + max = count; + [maxElems removeAllObjects]; + [maxElems addObject:obj]; + } else if (count == max) { + [maxElems addObject:obj]; + } + } + return maxElems; +} +@end diff --git a/Task/Averages-Mode/Octave/averages-mode-1.octave b/Task/Averages-Mode/Octave/averages-mode-1.octave new file mode 100644 index 0000000000..b6f1a2bced --- /dev/null +++ b/Task/Averages-Mode/Octave/averages-mode-1.octave @@ -0,0 +1,29 @@ +function m = mode2(v) + sv = sort(v); + % build two vectors, vals and c, so that + % c(i) holds how many times vals(i) appears + i = 1; c = []; vals = []; + while (i <= numel(v) ) + tc = sum(sv==sv(i)); % it would be faster to count + % them "by hand", since sv is sorted... + c = [c, tc]; + vals = [vals, sv(i)]; + i += tc; + endwhile + % stack vals and c building a 2-rows matrix x + x = cat(1,vals,c); + % sort the second row (frequencies) into t (most frequent + % first) and take the "original indices" i ... + [t, i] = sort(x(2,:), "descend"); + % ... so that we can use them to sort columns according + % to frequencies + nv = x(1,i); + % at last, collect into m (the result) all the values + % having the same bigger frequency + r = t(1); i = 1; + m = []; + while ( t(i) == r ) + m = [m, nv(i)]; + i++; + endwhile +endfunction diff --git a/Task/Averages-Mode/Octave/averages-mode-2.octave b/Task/Averages-Mode/Octave/averages-mode-2.octave new file mode 100644 index 0000000000..422085c75d --- /dev/null +++ b/Task/Averages-Mode/Octave/averages-mode-2.octave @@ -0,0 +1,7 @@ +a = [1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]; +mode2(a) +mode(a) + +a = [1, 1, 2, 4, 4]; +mode2(a) % returns 1 and 4 +mode(a) % returns 1 only diff --git a/Task/Averages-Mode/Oz/averages-mode.oz b/Task/Averages-Mode/Oz/averages-mode.oz new file mode 100644 index 0000000000..db029fd029 --- /dev/null +++ b/Task/Averages-Mode/Oz/averages-mode.oz @@ -0,0 +1,17 @@ +declare + fun {Mode Xs} + Freq = {Dictionary.new} + for X in Xs do + Freq.X := {CondSelect Freq X 0} + 1 + end + MaxCount = {FoldL {Dictionary.items Freq} Max 0} + in + for Value#Count in {Dictionary.entries Freq} collect:C do + if Count == MaxCount then + {C Value} + end + end + end +in + {Show {Mode [1 2 3 3 2 1 1]}} + {Show {Mode [1 2 3 3 2 1]}} diff --git a/Task/Averages-Mode/PARI-GP/averages-mode.pari b/Task/Averages-Mode/PARI-GP/averages-mode.pari new file mode 100644 index 0000000000..508f531528 --- /dev/null +++ b/Task/Averages-Mode/PARI-GP/averages-mode.pari @@ -0,0 +1,16 @@ +mode(v)={ + my(count=1,r=1,b=v[1]); + v=vecsort(v); + for(i=2,#v, + if(v[i]==v[i-1], + count++ + , + if(count>r, + r=count; + b=v[i-1] + ); + count=1 + ) + ); + if(count>r,v[#v],b) +}; diff --git a/Task/Averages-Mode/Perl-6/averages-mode.pl6 b/Task/Averages-Mode/Perl-6/averages-mode.pl6 new file mode 100644 index 0000000000..75beb3264a --- /dev/null +++ b/Task/Averages-Mode/Perl-6/averages-mode.pl6 @@ -0,0 +1,6 @@ +sub mode (@a) { + my %counts; + ++%counts{$_} for @a; + my $max = [max] values %counts; + return map { .key }, grep { .value == $max }, %counts.pairs; +} diff --git a/Task/Averages-Mode/PowerShell/averages-mode.psh b/Task/Averages-Mode/PowerShell/averages-mode.psh new file mode 100644 index 0000000000..a390910fd6 --- /dev/null +++ b/Task/Averages-Mode/PowerShell/averages-mode.psh @@ -0,0 +1,3 @@ +$data = @(1,1,1,2,3,4,5,5,6,7,7,7) +$groups = $data | group-object | sort-object count -Descending +$groups | ? {$_.Count -eq $groups[0].Count} diff --git a/Task/Averages-Mode/PureBasic/averages-mode.purebasic b/Task/Averages-Mode/PureBasic/averages-mode.purebasic new file mode 100644 index 0000000000..7aa935e08b --- /dev/null +++ b/Task/Averages-Mode/PureBasic/averages-mode.purebasic @@ -0,0 +1,38 @@ +Procedure mean(Array InArray(1)) + + Structure MyMean + Value.i + Cnt.i + EndStructure + + Protected i, max, found + Protected NewList MyDatas.MyMean() + + Repeat + found=#False + ForEach MyDatas() + If InArray(i)=MyDatas()\Value + MyDatas()\Cnt+1 + found=#True + Break + EndIf + Next + If Not found + AddElement(MyDatas()) + MyDatas()\Value=InArray(i) + MyDatas()\cnt+1 + EndIf + If MyDatas()\Cnt>max + max=MyDatas()\Cnt + EndIf + i+1 + Until i>ArraySize(InArray()) + + ForEach MyDatas() + If MyDatas()\Cnt=max + For i=1 To max + Print(Str(MyDatas()\Value)+" ") + Next + EndIf + Next +EndProcedure diff --git a/Task/Averages-Mode/Slate/averages-mode.slate b/Task/Averages-Mode/Slate/averages-mode.slate new file mode 100644 index 0000000000..3ae03b6922 --- /dev/null +++ b/Task/Averages-Mode/Slate/averages-mode.slate @@ -0,0 +1,5 @@ +s@(Sequence traits) mode +[| sortedCounts | + sortedCounts: (s as: Bag) sortedCounts. + (sortedCounts mapSelect: [| :count :elem | sortedCounts last count = count]) valueSet +]. diff --git a/Task/Averages-Mode/UNIX-Shell/averages-mode-1.sh b/Task/Averages-Mode/UNIX-Shell/averages-mode-1.sh new file mode 100644 index 0000000000..b2274a9685 --- /dev/null +++ b/Task/Averages-Mode/UNIX-Shell/averages-mode-1.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +function mode { + declare -A map + max=0 + for x in "$@"; do + tmp=$((${map[$x]} + 1)) + map[$x]=$tmp + ((tmp > max)) && max=$tmp + done + for x in "${!map[@]}"; do + [[ ${map[$x]} == $max ]] && echo -n "$x " + done + echo +} diff --git a/Task/Averages-Mode/UNIX-Shell/averages-mode-2.sh b/Task/Averages-Mode/UNIX-Shell/averages-mode-2.sh new file mode 100644 index 0000000000..9c480f1b20 --- /dev/null +++ b/Task/Averages-Mode/UNIX-Shell/averages-mode-2.sh @@ -0,0 +1,2 @@ +mode 1 2 1 2 a b a b a 2 +a 2 diff --git a/Task/Averages-Mode/Ursala/averages-mode.ursala b/Task/Averages-Mode/Ursala/averages-mode.ursala new file mode 100644 index 0000000000..9fd7a2f41c --- /dev/null +++ b/Task/Averages-Mode/Ursala/averages-mode.ursala @@ -0,0 +1,7 @@ +#import std + +mode = ~&hS+ leql$^&h+ eql|=@K2 + +#cast %nLW + +examples = mode~~ (<1,3,6,6,6,7,7,12,12,17>,<1,1,2,4,4>) diff --git a/Task/Averages-Mode/Vedit-macro-language/averages-mode.vedit b/Task/Averages-Mode/Vedit-macro-language/averages-mode.vedit new file mode 100644 index 0000000000..e38ac2ab88 --- /dev/null +++ b/Task/Averages-Mode/Vedit-macro-language/averages-mode.vedit @@ -0,0 +1,25 @@ +BOF // Copy all data to a new buffer +Reg_Copy(10, ALL) +Buf_Switch(Buf_Free) +Reg_Ins(10) + +Sort(0, File_Size) // Sort the data + +BOF +repeat(ALL) { // Count & delete duplicate lines + #1 = 1 + while(Match("^{.*}\N\1$", REGEXP)==0) { + Del_Line(1) + #1++ + } + Num_Ins(#1, NOCR) // Insert item count at the beginning of line + Ins_Char(9) // TAB + Line(1, ERRBREAK) // Next (different) line +} + +Sort(0, File_Size, REVERSE) // Sort according to the count + +BOF // Display the results +Reg_Copy_Block(10, CP, EOL_pos) +Buf_Quit(OK) +Statline_Message(@10) diff --git a/Task/Averages-Pythagorean-means/Mathematica/averages-pythagorean-means.mathematica b/Task/Averages-Pythagorean-means/Mathematica/averages-pythagorean-means.math similarity index 100% rename from Task/Averages-Pythagorean-means/Mathematica/averages-pythagorean-means.mathematica rename to Task/Averages-Pythagorean-means/Mathematica/averages-pythagorean-means.math diff --git a/Task/Averages-Pythagorean-means/NetRexx/averages-pythagorean-means.netrexx b/Task/Averages-Pythagorean-means/NetRexx/averages-pythagorean-means.netrexx new file mode 100644 index 0000000000..de7f1f7c01 --- /dev/null +++ b/Task/Averages-Pythagorean-means/NetRexx/averages-pythagorean-means.netrexx @@ -0,0 +1,48 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +numeric digits 20 + +a1 = ArrayList(Arrays.asList([Rexx 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])) +say "Arithmetic =" arithmeticMean(a1)", Geometric =" geometricMean(a1)", Harmonic =" harmonicMean(a1) + +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method arithmeticMean(numbers = java.util.List) public static returns Rexx + -- somewhat arbitrary return for ooRexx + if numbers.isEmpty then return "NaN" + + mean = 0 + number = Rexx + loop number over numbers + mean = mean + number + end + return mean / numbers.size + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method geometricMean(numbers = java.util.List) public static returns Rexx + -- somewhat arbitrary return for ooRexx + if numbers.isEmpty then return "NaN" + + mean = 1 + number = Rexx + loop number over numbers + mean = mean * number + end + return Math.pow(mean, 1 / numbers.size) + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method harmonicMean(numbers = java.util.List) public static returns Rexx + -- somewhat arbitrary return for ooRexx + if numbers.isEmpty then return "NaN" + + mean = 0 + number = Rexx + loop number over numbers + if number = 0 then return "Nan" + mean = mean + (1 / number) + end + + -- problem here... + return numbers.size / mean diff --git a/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-1.ocaml b/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-1.ocaml new file mode 100644 index 0000000000..e9b6653b65 --- /dev/null +++ b/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-1.ocaml @@ -0,0 +1,13 @@ +let means v = + let n = Array.length v + and a = ref 0.0 + and b = ref 1.0 + and c = ref 0.0 in + for i=0 to n-1 do + a := !a +. v.(i); + b := !b *. v.(i); + c := !c +. 1.0/.v.(i); + done; + let nn = float_of_int n in + (!a /. nn, !b ** (1.0/.nn), nn /. !c) +;; diff --git a/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-2.ocaml b/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-2.ocaml new file mode 100644 index 0000000000..c7e1d99a9a --- /dev/null +++ b/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-2.ocaml @@ -0,0 +1,2 @@ +means (Array.init 10 (function i -> (float_of_int (i+1)))) ;; +(* (5.5, 4.5287286881167654, 3.4141715214740551) *) diff --git a/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-3.ocaml b/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-3.ocaml new file mode 100644 index 0000000000..2c2707a557 --- /dev/null +++ b/Task/Averages-Pythagorean-means/OCaml/averages-pythagorean-means-3.ocaml @@ -0,0 +1,9 @@ +let means v = + let (a, b, c) = + Array.fold_left + (fun (a, b, c) x -> (a+.x, b*.x, c+.1./.x)) + (0.,1.,0.) v + in + let n = float_of_int (Array.length v) in + (a /. n, b ** (1./.n), n /. c) +;; diff --git a/Task/Averages-Pythagorean-means/Oberon-2/averages-pythagorean-means.oberon-2 b/Task/Averages-Pythagorean-means/Oberon-2/averages-pythagorean-means.oberon-2 new file mode 100644 index 0000000000..dce18e10cb --- /dev/null +++ b/Task/Averages-Pythagorean-means/Oberon-2/averages-pythagorean-means.oberon-2 @@ -0,0 +1,34 @@ +MODULE PythMean; +IMPORT Out, ML := MathL; + +PROCEDURE Triplets(a: ARRAY OF INTEGER;VAR triplet: ARRAY OF LONGREAL); +VAR + i: INTEGER; +BEGIN + triplet[0] := 0.0;triplet[1] := 0.0; triplet[2] := 0.0; + FOR i:= 0 TO LEN(a) - 1 DO + triplet[0] := triplet[0] + a[i]; + triplet[1] := triplet[1] + ML.Ln(a[i]); + triplet[2] := triplet[2] + (1 / a[i]) + END +END Triplets; + +PROCEDURE Means*(a: ARRAY OF INTEGER); +VAR + triplet: ARRAY 3 OF LONGREAL; +BEGIN + Triplets(a,triplet); + Out.String("A(1 .. 10): ");Out.LongReal(triplet[0] / LEN(a));Out.Ln; + Out.String("G(1 .. 10): ");Out.LongReal(ML.Exp(triplet[1]/ LEN(a)));Out.Ln; + Out.String("H(1 .. 10): ");Out.LongReal(LEN(a) / triplet[2]);Out.Ln; +END Means; + +VAR + nums: ARRAY 10 OF INTEGER; + i: INTEGER; +BEGIN + FOR i := 0 TO LEN(nums) - 1 DO + nums[i] := i + 1 + END; + Means(nums) +END PythMean. diff --git a/Task/Averages-Pythagorean-means/Octave/averages-pythagorean-means.octave b/Task/Averages-Pythagorean-means/Octave/averages-pythagorean-means.octave new file mode 100644 index 0000000000..a3c99af4f3 --- /dev/null +++ b/Task/Averages-Pythagorean-means/Octave/averages-pythagorean-means.octave @@ -0,0 +1,3 @@ + A = mean(list); % arithmetic mean + G = mean(list,'g'); % geometric mean + H = mean(list,'a'); % harmonic mean diff --git a/Task/Averages-Pythagorean-means/Oz/averages-pythagorean-means.oz b/Task/Averages-Pythagorean-means/Oz/averages-pythagorean-means.oz new file mode 100644 index 0000000000..925fc54c5c --- /dev/null +++ b/Task/Averages-Pythagorean-means/Oz/averages-pythagorean-means.oz @@ -0,0 +1,31 @@ +declare + %% helpers + fun {Sum Xs} {FoldL Xs Number.'+' 0.0} end + fun {Product Xs} {FoldL Xs Number.'*' 1.0} end + fun {Len Xs} {Int.toFloat {Length Xs}} end + + fun {AMean Xs} + {Sum Xs} + / + {Len Xs} + end + + fun {GMean Xs} + {Pow + {Product Xs} + 1.0/{Len Xs}} + end + + fun {HMean Xs} + {Len Xs} + / + {Sum {Map Xs fun {$ X} 1.0 / X end}} + end + + Numbers = {Map {List.number 1 10 1} Int.toFloat} + + [A G H] = [{AMean Numbers} {GMean Numbers} {HMean Numbers}] +in + {Show [A G H]} + A >= G = true + G >= H = true diff --git a/Task/Averages-Pythagorean-means/PARI-GP/averages-pythagorean-means-1.pari b/Task/Averages-Pythagorean-means/PARI-GP/averages-pythagorean-means-1.pari new file mode 100644 index 0000000000..7a5dda4bde --- /dev/null +++ b/Task/Averages-Pythagorean-means/PARI-GP/averages-pythagorean-means-1.pari @@ -0,0 +1,12 @@ +arithmetic(v)={ + sum(i=1,#v,v[i])/#v +}; +geometric(v)={ + prod(i=1,#v,v[i])^(1/#v) +}; +harmonic(v)={ + #v/sum(i=1,#v,1/v[i]) +}; + +v=vector(10,i,i); +[arithmetic(v),geometric(v),harmonic(v)] diff --git a/Task/Averages-Pythagorean-means/PARI-GP/averages-pythagorean-means-2.pari b/Task/Averages-Pythagorean-means/PARI-GP/averages-pythagorean-means-2.pari new file mode 100644 index 0000000000..251b9566ec --- /dev/null +++ b/Task/Averages-Pythagorean-means/PARI-GP/averages-pythagorean-means-2.pari @@ -0,0 +1,16 @@ +arithmetic_first(n)={ + (n+1)/2 +}; +geometric_first(n)={ + n!^(1/n) +}; +harmonic_first(n)={ + n/if(n>1000, + log(n)+Euler+1/(n+n)+1/(12*n^2)-1/(120*n^4)+1/(252*n^6)-1/(240*n^8)+1/(132*n^10) + , + n/sum(k=1,n,1/k) + ) +}; + +[arithmetic_first(10),geometric_first(10),harmonic_first(10)] +%[1]>=%[2] && %[2] >= %[3] diff --git a/Task/Averages-Pythagorean-means/PL-I/averages-pythagorean-means.pli b/Task/Averages-Pythagorean-means/PL-I/averages-pythagorean-means.pli new file mode 100644 index 0000000000..a5db0a4fbd --- /dev/null +++ b/Task/Averages-Pythagorean-means/PL-I/averages-pythagorean-means.pli @@ -0,0 +1,21 @@ +declare n fixed binary, + (Average, Geometric, Harmonic) float; +declare A(10) float static initial (1,2,3,4,5,6,7,8,9,10); + +n = hbound(A,1); + +/* compute the average */ +Average = sum(A)/n; + +/* Compute the geometric mean: */ +Geometric = prod(A)**(1/n); + +/* Compute the Harmonic mean: */ +Harmonic = n / sum(1/A); + +put skip data (Average); +put skip data (Geometric); +put skip data (Harmonic); + +if Average < Geometric then put skip list ('Error'); +if Geometric < Harmonic then put skip list ('Error'); diff --git a/Task/Averages-Pythagorean-means/Perl-6/averages-pythagorean-means.pl6 b/Task/Averages-Pythagorean-means/Perl-6/averages-pythagorean-means.pl6 new file mode 100644 index 0000000000..16df1421e8 --- /dev/null +++ b/Task/Averages-Pythagorean-means/Perl-6/averages-pythagorean-means.pl6 @@ -0,0 +1,7 @@ +sub A(@x) { ([+] @x) / @x.elems } +sub G(@x) { ([*] @x) ** (1 / @x.elems) } +sub H(@x) { @x.elems / [+] @x.map: 1/* } + +say "A(1,...,10) = ", A(1..10); +say "G(1,...,10) = ", G(1..10); +say "H(1,...,10) = ", H(1..10); diff --git a/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-1.ps b/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-1.ps new file mode 100644 index 0000000000..9f2b9b8c6e --- /dev/null +++ b/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-1.ps @@ -0,0 +1,22 @@ +/pythamean{ +/x exch def +/sum 0 def +/prod 1 def +/invsum 0 def +/i 1 def + +x{ +/sum sum i add def +/prod prod i mul def +/invsum invsum i -1 exp add def +/i i 1 add def +}repeat +(Arithmetic Mean : ) print +sum x div = +(Geometric Mean : ) print +prod x -1 exp exp = +(Harmonic Mean : ) print +x invsum div = +}def + +10 pythamean diff --git a/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-2.ps b/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-2.ps new file mode 100644 index 0000000000..2ac2e335ed --- /dev/null +++ b/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-2.ps @@ -0,0 +1,3 @@ +Arithmetic Mean : 5.5 +Geometric Mean : 4.52873 +Harmonic Mean : 3.41417 diff --git a/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-3.ps b/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-3.ps new file mode 100644 index 0000000000..3bb75fdb94 --- /dev/null +++ b/Task/Averages-Pythagorean-means/PostScript/averages-pythagorean-means-3.ps @@ -0,0 +1,9 @@ +/numbers {[1 10] 1 range}. +/recip {1 exch div}. + +% Arithmetic mean +numbers dup 0 {+} fold exch length div +% Geometric mean +numbers dup 1 {*} fold exch length recip exp +% Harmonic mean +numbers dup 0 {recip +} fold exch length exch div diff --git a/Task/Averages-Pythagorean-means/PowerShell/averages-pythagorean-means.psh b/Task/Averages-Pythagorean-means/PowerShell/averages-pythagorean-means.psh new file mode 100644 index 0000000000..bce581d667 --- /dev/null +++ b/Task/Averages-Pythagorean-means/PowerShell/averages-pythagorean-means.psh @@ -0,0 +1,23 @@ +$A = 0 +$LogG = 0 +$InvH = 0 + +$ii = 1..10 +foreach($i in $ii) { + # Arithmetic mean is computed directly + $A += $i / $ii.Count + # Geometric mean is computed using Logarithms + $LogG += [Math]::Log($i) / $ii.Count + # Harmonic mean is computed using its inverse + $InvH += 1 / ($i * $ii.Count) +} + +$G = [Math]::Exp($LogG) +$H = 1/$InvH + +write-host "Arithmetic mean: A = $A" +write-host "Geometric mean: G = $G" +write-host "Harmonic mean: H = $H" + +write-host "Is A >= G ? $($A -ge $G)" +write-host "Is G >= H ? $($G -ge $H)" diff --git a/Task/Averages-Pythagorean-means/PureBasic/averages-pythagorean-means.purebasic b/Task/Averages-Pythagorean-means/PureBasic/averages-pythagorean-means.purebasic new file mode 100644 index 0000000000..0323a73c94 --- /dev/null +++ b/Task/Averages-Pythagorean-means/PureBasic/averages-pythagorean-means.purebasic @@ -0,0 +1,26 @@ +Procedure.d ArithmeticMean() + For a = 1 To 10 + mean + a + Next + ProcedureReturn mean / 10 +EndProcedure +Procedure.d GeometricMean() + mean = 1 + For a = 1 To 10 + mean * a + Next + ProcedureReturn Pow(mean, 1 / 10) +EndProcedure +Procedure.d HarmonicMean() + For a = 1 To 10 + mean.d + 1 / a + Next + ProcedureReturn 10 / mean +EndProcedure + +If HarmonicMean() <= GeometricMean() And GeometricMean() <= ArithmeticMean() + Debug "true" +EndIf +Debug ArithmeticMean() +Debug GeometricMean() +Debug HarmonicMean() diff --git a/Task/Averages-Pythagorean-means/Run-BASIC/averages-pythagorean-means.run b/Task/Averages-Pythagorean-means/Run-BASIC/averages-pythagorean-means.run new file mode 100644 index 0000000000..bea352dce8 --- /dev/null +++ b/Task/Averages-Pythagorean-means/Run-BASIC/averages-pythagorean-means.run @@ -0,0 +1,16 @@ +bXsum = 1 +for i = 1 to 10 + sum = sum + i ' sum of 1 -> 10 + bXsum = bXsum * i ' sum i * i + sum1i = sum1i + (1/i) ' sum 1/i +next + +average = sum / 10 +geometric = bXsum ^ (1/10) +harmonic = 10/sum1i + + print "ArithmeticMean:";average + print "Geometric Mean:";geometric + print " Harmonic Mean:";harmonic + + if (average >= geometric) and (geometric >= harmonic) then print "True" else print "False" diff --git a/Task/Averages-Pythagorean-means/Seed7/averages-pythagorean-means.seed7 b/Task/Averages-Pythagorean-means/Seed7/averages-pythagorean-means.seed7 new file mode 100644 index 0000000000..7e9da85a83 --- /dev/null +++ b/Task/Averages-Pythagorean-means/Seed7/averages-pythagorean-means.seed7 @@ -0,0 +1,21 @@ +$ include "seed7_05.s7i"; + include "float.s7i"; + +const array float: numbers is [] (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0); + +const func proc: main is func + local + var float: number is 0.0; + var float: sum is 0.0; + var float: product is 1.0; + var float: reciprocalSum is 0.0; + begin + for number range numbers do + sum +:= number; + product *:= number; + reciprocalSum +:= 1.0 / number; + end for; + writeln("Arithmetic mean: " <& sum / flt(length(numbers))); + writeln("Geometric mean: " <& product ** (1.0 / flt(length(numbers)))); + writeln("Harmonic mean: " <& flt(length(numbers)) / reciprocalSum); + end func; diff --git a/Task/Averages-Pythagorean-means/Ursala/averages-pythagorean-means.ursala b/Task/Averages-Pythagorean-means/Ursala/averages-pythagorean-means.ursala new file mode 100644 index 0000000000..83346f698f --- /dev/null +++ b/Task/Averages-Pythagorean-means/Ursala/averages-pythagorean-means.ursala @@ -0,0 +1,12 @@ +#import std +#import flo + +data = ari10(1.,10.) # arithmetic progression, length 10 with endpoints 1 and 10 + +a = mean data +g = exp mean ln* data +h = div/1. mean div/*1. data + +#cast %eLbX + +main = ^(~&,ordered not fleq) diff --git a/Task/Averages-Pythagorean-means/Vala/averages-pythagorean-means.vala b/Task/Averages-Pythagorean-means/Vala/averages-pythagorean-means.vala new file mode 100644 index 0000000000..0ccc2d846d --- /dev/null +++ b/Task/Averages-Pythagorean-means/Vala/averages-pythagorean-means.vala @@ -0,0 +1,52 @@ +double arithmetic(int[] list){ + double mean; + double sum = 0; + foreach(int number in list){ + sum += number; + } // foreach + + mean = sum / list.length; + + return mean; +} // end arithmetic mean + +double geometric(int[] list){ + double mean; + double product = 1; + foreach(int number in list){ + product *= number; + } // foreach + + mean = Math.pow(product, (1 / (double) list.length)); + + return mean; +} // end geometric mean + +double harmonic(int[] list){ + double mean; + double sum_inverse = 0; + foreach(int number in list){ + sum_inverse += (1 / (double) number); + } // foreach + + mean = (double) list.length / sum_inverse; + + return mean; +} // end harmonic mean + +public static void main(){ + int[] list = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + double arithmetic_mean = arithmetic(list); + double geometric_mean = geometric(list); + double harmonic_mean = harmonic(list); + + // should be 5.5 + stdout.printf("Arithmetic mean: %s\n", arithmetic_mean.to_string()); + + // should be 4.528728688116765 + stdout.printf("Geometric mean: %s\n", geometric_mean.to_string()); + + // should be 4.528728688116765 + stdout.printf("Harmonic mean: %s\n", harmonic_mean.to_string()); +} diff --git a/Task/Averages-Pythagorean-means/XPL0/averages-pythagorean-means.xpl0 b/Task/Averages-Pythagorean-means/XPL0/averages-pythagorean-means.xpl0 new file mode 100644 index 0000000000..16450fea12 --- /dev/null +++ b/Task/Averages-Pythagorean-means/XPL0/averages-pythagorean-means.xpl0 @@ -0,0 +1,28 @@ +include c:\cxpl\codes; + +func real Power(X, Y); \X raised to the Y power +real X, Y; \ (from StdLib.xpl) +return Exp(Y * Ln(X)); + +int N, Order; +real R, A, A1, G, G1, H, H1; +[A1:= 0.0; G1:= 1.0; H1:= 0.0; +Order:= true; +for N:= 1 to 10 do + [R:= float(N); \convert integer N to real R + A1:= A1 + R; + A:= A1/R; \arithmetic mean + G1:= G1 * R; + G:= Power(G1, 1.0/R); \geometric mean (Nth root of G1) + if G>A then Order:= false; + H1:= H1 + 1.0/R; + H:= R/H1; \harmonic mean + if H>G then Order:= false; + ]; +RlOut(0, A); CrLf(0); +RlOut(0, G); CrLf(0); +RlOut(0, H); CrLf(0); +if not Order then Text(0, "NOT "); +Text(0, "ALWAYS DECREASING ORDER +"); +] diff --git a/Task/Averages-Root-mean-square/BASIC/averages-root-mean-square.bas b/Task/Averages-Root-mean-square/BASIC/averages-root-mean-square.basic similarity index 100% rename from Task/Averages-Root-mean-square/BASIC/averages-root-mean-square.bas rename to Task/Averages-Root-mean-square/BASIC/averages-root-mean-square.basic diff --git a/Task/Averages-Root-mean-square/CoffeeScript/averages-root-mean-square.coffee b/Task/Averages-Root-mean-square/CoffeeScript/averages-root-mean-square.coffeescript similarity index 100% rename from Task/Averages-Root-mean-square/CoffeeScript/averages-root-mean-square.coffee rename to Task/Averages-Root-mean-square/CoffeeScript/averages-root-mean-square.coffeescript diff --git a/Task/Averages-Root-mean-square/Mathematica/averages-root-mean-square.mathematica b/Task/Averages-Root-mean-square/Mathematica/averages-root-mean-square.math similarity index 100% rename from Task/Averages-Root-mean-square/Mathematica/averages-root-mean-square.mathematica rename to Task/Averages-Root-mean-square/Mathematica/averages-root-mean-square.math diff --git a/Task/Averages-Root-mean-square/Nemerle/averages-root-mean-square.nemerle b/Task/Averages-Root-mean-square/Nemerle/averages-root-mean-square.nemerle new file mode 100644 index 0000000000..8cefd67bbe --- /dev/null +++ b/Task/Averages-Root-mean-square/Nemerle/averages-root-mean-square.nemerle @@ -0,0 +1,17 @@ +using System; +using System.Console; +using System.Math; + +module RMS +{ + RMS(x : list[int]) : double + { + def sum = x.Map(fun (x) {x*x}).FoldLeft(0, _+_); + Sqrt((sum :> double) / x.Length) + } + + Main() : void + { + WriteLine("RMS of [1 .. 10]: {0:g6}", RMS($[1 .. 10])); + } +} diff --git a/Task/Averages-Root-mean-square/NetRexx/averages-root-mean-square.netrexx b/Task/Averages-Root-mean-square/NetRexx/averages-root-mean-square.netrexx new file mode 100644 index 0000000000..32a18c1796 --- /dev/null +++ b/Task/Averages-Root-mean-square/NetRexx/averages-root-mean-square.netrexx @@ -0,0 +1,15 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +parse arg maxV . +if maxV = '' | maxV = '.' then maxV = 10 + +sum = 0 +loop nr = 1 for maxV + sum = sum + nr ** 2 + end nr +rmsD = Math.sqrt(sum / maxV) + +say 'RMS of values from 1 to' maxV':' rmsD + +return diff --git a/Task/Averages-Root-mean-square/OCaml/averages-root-mean-square.ocaml b/Task/Averages-Root-mean-square/OCaml/averages-root-mean-square.ocaml new file mode 100644 index 0000000000..fa56779283 --- /dev/null +++ b/Task/Averages-Root-mean-square/OCaml/averages-root-mean-square.ocaml @@ -0,0 +1,7 @@ +let rms a = + sqrt (Array.fold_left (fun s x -> s +. x*.x) 0.0 a /. + float_of_int (Array.length a)) +;; + +rms (Array.init 10 (fun i -> float_of_int (i+1))) ;; +(* 6.2048368229954285 *) diff --git a/Task/Averages-Root-mean-square/Oberon-2/averages-root-mean-square.oberon-2 b/Task/Averages-Root-mean-square/Oberon-2/averages-root-mean-square.oberon-2 new file mode 100644 index 0000000000..e17aa6ec9b --- /dev/null +++ b/Task/Averages-Root-mean-square/Oberon-2/averages-root-mean-square.oberon-2 @@ -0,0 +1,24 @@ +MODULE QM; +IMPORT ML := MathL, Out; +VAR + nums: ARRAY 10 OF LONGREAL; + i: INTEGER; + +PROCEDURE Rms(a: ARRAY OF LONGREAL): LONGREAL; +VAR + i: INTEGER; + s: LONGREAL; +BEGIN + s := 0.0; + FOR i := 0 TO LEN(a) - 1 DO + s := s + (a[i] * a[i]) + END; + RETURN ML.Sqrt(s / LEN(a)) +END Rms; + +BEGIN + FOR i := 0 TO LEN(nums) - 1 DO + nums[i] := i + 1 + END; + Out.String("Quadratic Mean: ");Out.LongReal(Rms(nums));Out.Ln +END QM. diff --git a/Task/Averages-Root-mean-square/Objeck/averages-root-mean-square.objeck b/Task/Averages-Root-mean-square/Objeck/averages-root-mean-square.objeck new file mode 100644 index 0000000000..ec12d4e537 --- /dev/null +++ b/Task/Averages-Root-mean-square/Objeck/averages-root-mean-square.objeck @@ -0,0 +1,18 @@ +bundle Default { + class Hello { + function : Main(args : String[]) ~ Nil { + values := [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]; + RootSquareMean(values)->PrintLine(); + } + + function : native : RootSquareMean(values : Float[]) ~ Float { + sum := 0.0; + each(i : values) { + x := values[i]->Power(2.0); + sum += values[i]->Power(2.0); + }; + + return (sum / values->Size())->SquareRoot(); + } + } +} diff --git a/Task/Averages-Root-mean-square/Oz/averages-root-mean-square.oz b/Task/Averages-Root-mean-square/Oz/averages-root-mean-square.oz new file mode 100644 index 0000000000..932a83e941 --- /dev/null +++ b/Task/Averages-Root-mean-square/Oz/averages-root-mean-square.oz @@ -0,0 +1,11 @@ +declare + fun {Square X} X*X end + + fun {RMS Xs} + {Sqrt + {Int.toFloat {FoldL {Map Xs Square} Number.'+' 0}} + / + {Int.toFloat {Length Xs}}} + end +in + {Show {RMS {List.number 1 10 1}}} diff --git a/Task/Averages-Root-mean-square/PARI-GP/averages-root-mean-square-1.pari b/Task/Averages-Root-mean-square/PARI-GP/averages-root-mean-square-1.pari new file mode 100644 index 0000000000..ead790c1ca --- /dev/null +++ b/Task/Averages-Root-mean-square/PARI-GP/averages-root-mean-square-1.pari @@ -0,0 +1,5 @@ +RMS(v)={ + sqrt(sum(i=1,#v,v[i]^2)/#v) +}; + +RMS(vector(10,i,i)) diff --git a/Task/Averages-Root-mean-square/PARI-GP/averages-root-mean-square-2.pari b/Task/Averages-Root-mean-square/PARI-GP/averages-root-mean-square-2.pari new file mode 100644 index 0000000000..b260ece3c4 --- /dev/null +++ b/Task/Averages-Root-mean-square/PARI-GP/averages-root-mean-square-2.pari @@ -0,0 +1,5 @@ +RMS_first(n)={ + sqrt((n+1)*(2*n+1)/6) +}; + +RMS_first(10) diff --git a/Task/Averages-Root-mean-square/PL-I/averages-root-mean-square.pli b/Task/Averages-Root-mean-square/PL-I/averages-root-mean-square.pli new file mode 100644 index 0000000000..5da5c25f0a --- /dev/null +++ b/Task/Averages-Root-mean-square/PL-I/averages-root-mean-square.pli @@ -0,0 +1,3 @@ +declare A(10) fixed decimal static initial (1,2,3,4,5,6,7,8,9,10); +n = hbound(A,1); +RMS = sqrt(sum(A**2)/n); diff --git a/Task/Averages-Root-mean-square/Perl-6/averages-root-mean-square.pl6 b/Task/Averages-Root-mean-square/Perl-6/averages-root-mean-square.pl6 new file mode 100644 index 0000000000..0d1bac61f8 --- /dev/null +++ b/Task/Averages-Root-mean-square/Perl-6/averages-root-mean-square.pl6 @@ -0,0 +1,3 @@ +sub rms(*@nums) { sqrt [+](@nums X** 2) / @nums } + +say rms 1..10; diff --git a/Task/Averages-Root-mean-square/PostScript/averages-root-mean-square-1.ps b/Task/Averages-Root-mean-square/PostScript/averages-root-mean-square-1.ps new file mode 100644 index 0000000000..3d7d650304 --- /dev/null +++ b/Task/Averages-Root-mean-square/PostScript/averages-root-mean-square-1.ps @@ -0,0 +1,16 @@ +/findrms{ +/x exch def +/sum 0 def +/i 0 def +x length 0 eq{} +{ +x length{ +/sum x i get 2 exp sum add def +/i i 1 add def +}repeat +/sum sum x length div sqrt def +}ifelse +sum == +}def + +[1 2 3 4 5 6 7 8 9 10] findrms diff --git a/Task/Averages-Root-mean-square/PostScript/averages-root-mean-square-2.ps b/Task/Averages-Root-mean-square/PostScript/averages-root-mean-square-2.ps new file mode 100644 index 0000000000..bc0f4fa3ef --- /dev/null +++ b/Task/Averages-Root-mean-square/PostScript/averages-root-mean-square-2.ps @@ -0,0 +1 @@ +[1 10] 1 range dup 0 {dup * +} fold exch length div sqrt diff --git a/Task/Averages-Root-mean-square/PowerShell/averages-root-mean-square.psh b/Task/Averages-Root-mean-square/PowerShell/averages-root-mean-square.psh new file mode 100644 index 0000000000..b6fa95fcad --- /dev/null +++ b/Task/Averages-Root-mean-square/PowerShell/averages-root-mean-square.psh @@ -0,0 +1,6 @@ +function get-rms([float[]]$nums){ + $sqsum=$nums | foreach-object { $_*$_} | measure-object -sum | select-object -expand Sum + return [math]::sqrt($sqsum/$nums.count) +} + +get-rms @(1..10) diff --git a/Task/Averages-Root-mean-square/PureBasic/averages-root-mean-square.purebasic b/Task/Averages-Root-mean-square/PureBasic/averages-root-mean-square.purebasic new file mode 100644 index 0000000000..49c9d92ae6 --- /dev/null +++ b/Task/Averages-Root-mean-square/PureBasic/averages-root-mean-square.purebasic @@ -0,0 +1,27 @@ +NewList MyList() ; To hold a unknown amount of numbers to calculate + +If OpenConsole() + Define.d result + Define i, sum_of_squares + + ;Populate a random amounts of numbers to calculate + For i=0 To (Random(45)+5) ; max elements is unknown to the program + AddElement(MyList()) + MyList()=Random(15) ; Put in a random number + Next + + Print("Averages/Root mean square"+#CRLF$+"of : ") + + ; Calculate square of each element, print each & add them together + ForEach MyList() + Print(Str(MyList())+" ") ; Present to our user + sum_of_squares+MyList()*MyList() ; Sum the squares, e.g + Next + + ;Present the result + result=Sqr(sum_of_squares/ListSize(MyList())) + PrintN(#CRLF$+"= "+StrD(result)) + + PrintN("Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Averages-Root-mean-square/Qi/averages-root-mean-square.qi b/Task/Averages-Root-mean-square/Qi/averages-root-mean-square.qi new file mode 100644 index 0000000000..99ac40d1ab --- /dev/null +++ b/Task/Averages-Root-mean-square/Qi/averages-root-mean-square.qi @@ -0,0 +1,2 @@ +(define rms + R -> (sqrt (/ (APPLY + (MAPCAR * R R)) (length R)))) diff --git a/Task/Averages-Root-mean-square/Run-BASIC/averages-root-mean-square.run b/Task/Averages-Root-mean-square/Run-BASIC/averages-root-mean-square.run new file mode 100644 index 0000000000..f327ff8226 --- /dev/null +++ b/Task/Averages-Root-mean-square/Run-BASIC/averages-root-mean-square.run @@ -0,0 +1,8 @@ +valueList$ = "1 2 3 4 5 6 7 8 9 10" +while word$(valueList$,i +1) <> "" ' grab values from list + thisValue = val(word$(valueList$,i +1)) ' turn values into numbers + sumSquares = sumSquares + thisValue ^ 2 ' sum up the squares + i = i +1 ' +wend +print "List of Values:";valueList$;" containing ";i;" values" +print "Root Mean Square =";(sumSquares/i)^0.5 diff --git a/Task/Averages-Root-mean-square/SNOBOL4/averages-root-mean-square.sno b/Task/Averages-Root-mean-square/SNOBOL4/averages-root-mean-square.sno new file mode 100644 index 0000000000..2e499ed6fe --- /dev/null +++ b/Task/Averages-Root-mean-square/SNOBOL4/averages-root-mean-square.sno @@ -0,0 +1,10 @@ + define('rms(a)i,ssq') :(rms_end) +rms i = i + 1; ssq = ssq + (a * a) :s(rms) + rms = sqrt(1.0 * ssq / prototype(a)) :(return) +rms_end + +* # Fill array, test and display + str = '1 2 3 4 5 6 7 8 9 10'; a = array(10) +loop i = i + 1; str len(p) span('0123456789') . a @p :s(loop) + output = str ' -> ' rms(a) +end diff --git a/Task/Averages-Root-mean-square/Seed7/averages-root-mean-square.seed7 b/Task/Averages-Root-mean-square/Seed7/averages-root-mean-square.seed7 new file mode 100644 index 0000000000..d1e7422d5e --- /dev/null +++ b/Task/Averages-Root-mean-square/Seed7/averages-root-mean-square.seed7 @@ -0,0 +1,23 @@ +$ include "seed7_05.s7i"; + include "float.s7i"; + include "math.s7i"; + +const array float: numbers is [] (1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0); + +const func float: rms (in array float: numbers) is func + result + var float: rms is 0.0; + local + var float: number is 0.0; + var float: sum is 0.0; + begin + for number range numbers do + sum +:= number ** 2; + end for; + rms := sqrt(sum / flt(length(numbers))); + end func; + +const proc: main is func + begin + writeln(rms(numbers) digits 7); + end func; diff --git a/Task/Averages-Root-mean-square/Ursala/averages-root-mean-square.ursala b/Task/Averages-Root-mean-square/Ursala/averages-root-mean-square.ursala new file mode 100644 index 0000000000..521446a4db --- /dev/null +++ b/Task/Averages-Root-mean-square/Ursala/averages-root-mean-square.ursala @@ -0,0 +1,6 @@ +#import nat +#import flo + +#cast %e + +rms = sqrt mean sqr* float* nrange(1,10) diff --git a/Task/Averages-Root-mean-square/Vala/averages-root-mean-square.vala b/Task/Averages-Root-mean-square/Vala/averages-root-mean-square.vala new file mode 100644 index 0000000000..866e38802b --- /dev/null +++ b/Task/Averages-Root-mean-square/Vala/averages-root-mean-square.vala @@ -0,0 +1,19 @@ +double rms(double[] list){ + double sum_squares = 0; + double mean; + + foreach ( double number in list){ + sum_squares += (number * number); + } + + mean = Math.sqrt(sum_squares / (double) list.length); + + return mean; +} // end rms + +public static void main(){ + double[] list = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + double mean = rms(list); + + stdout.printf("%s\n", mean.to_string()); +} diff --git a/Task/Averages-Root-mean-square/XPL0/averages-root-mean-square.xpl0 b/Task/Averages-Root-mean-square/XPL0/averages-root-mean-square.xpl0 new file mode 100644 index 0000000000..d7234fe15b --- /dev/null +++ b/Task/Averages-Root-mean-square/XPL0/averages-root-mean-square.xpl0 @@ -0,0 +1,9 @@ +code CrLf=9; +code real RlOut=48; +int N; +real S; +[S:= 0.0; +for N:= 1 to 10 do S:= S + sq(float(N)); +RlOut(0, sqrt(S/10.0)); +CrLf(0); +] diff --git a/Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-1.coffee b/Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-1.coffeescript similarity index 100% rename from Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-1.coffee rename to Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-1.coffeescript diff --git a/Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-2.coffee b/Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-2.coffeescript similarity index 100% rename from Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-2.coffee rename to Task/Averages-Simple-moving-average/CoffeeScript/averages-simple-moving-average-2.coffeescript diff --git a/Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-1.mathematica b/Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-1.math similarity index 100% rename from Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-1.mathematica rename to Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-1.math diff --git a/Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-2.mathematica b/Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-2.math similarity index 100% rename from Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-2.mathematica rename to Task/Averages-Simple-moving-average/Mathematica/averages-simple-moving-average-2.math diff --git a/Task/Averages-Simple-moving-average/NetRexx/averages-simple-moving-average.netrexx b/Task/Averages-Simple-moving-average/NetRexx/averages-simple-moving-average.netrexx new file mode 100644 index 0000000000..5a52cf39c2 --- /dev/null +++ b/Task/Averages-Simple-moving-average/NetRexx/averages-simple-moving-average.netrexx @@ -0,0 +1,63 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +numeric digits 20 + +class RAvgSimpleMoving public + + properties private + window = java.util.Queue + period + sum + + properties constant + exMsg = 'Period must be a positive integer' + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method RAvgSimpleMoving(period_) public + if \period_.datatype('w') then signal RuntimeException(exMsg) + if period_ <= 0 then signal RuntimeException(exMsg) + window = LinkedList() + period = period_ + sum = 0 + return + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method newNum(num) public + sum = sum + num + window.add(num) + if window.size() > period then do + rmv = (Rexx window.remove()) + sum = sum - rmv + end + return + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method getAvg() public returns Rexx + if window.isEmpty() then do + avg = 0 + end + else do + avg = sum / window.size() + end + return avg + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method run_samples(args = String[]) public static + testData = [Rexx 1, 2, 3, 4, 5, 5, 4, 3, 2, 1] + windowSizes = [Rexx 3, 5] + loop windSize over windowSizes + ma = RAvgSimpleMoving(windSize) + loop xVal over testData + ma.newNum(xVal) + say 'Next number =' xVal.right(5)', SMA =' ma.getAvg().format(10, 9) + end xVal + say + end windSize + + return + + -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + method main(args = String[]) public static + run_samples(args) + return diff --git a/Task/Averages-Simple-moving-average/OCaml/averages-simple-moving-average-1.ocaml b/Task/Averages-Simple-moving-average/OCaml/averages-simple-moving-average-1.ocaml new file mode 100644 index 0000000000..6f6fa6e927 --- /dev/null +++ b/Task/Averages-Simple-moving-average/OCaml/averages-simple-moving-average-1.ocaml @@ -0,0 +1,25 @@ +let sma (n, s, q) x = + let l = Queue.length q and s = s +. x in + Queue.push x q; + if l < n then + (n, s, q), s /. float (l + 1) + else ( + let s = s -. Queue.pop q in + (n, s, q), s /. float l + ) + +let _ = + let periodLst = [ 3; 5 ] in + let series = [ 1.; 2.; 3.; 4.; 5.; 5.; 4.; 3.; 2.; 1. ] in + + List.iter (fun d -> + Printf.printf "SIMPLE MOVING AVERAGE: PERIOD = %d\n" d; + ignore ( + List.fold_left (fun o x -> + let o, m = sma o x in + Printf.printf "Next number = %-2g, SMA = %g\n" x m; + o + ) (d, 0., Queue.create ()) series; + ); + print_newline (); + ) periodLst diff --git a/Task/Averages-Simple-moving-average/OCaml/averages-simple-moving-average-2.ocaml b/Task/Averages-Simple-moving-average/OCaml/averages-simple-moving-average-2.ocaml new file mode 100644 index 0000000000..d7b9b9cd57 --- /dev/null +++ b/Task/Averages-Simple-moving-average/OCaml/averages-simple-moving-average-2.ocaml @@ -0,0 +1,22 @@ +let sma_create period = + let q = Queue.create () + and sum = ref 0.0 in + fun x -> + sum := !sum +. x; + Queue.push x q; + if Queue.length q > period then + sum := !sum -. Queue.pop q; + !sum /. float (Queue.length q) + +let () = + let periodLst = [ 3; 5 ] in + let series = [ 1.; 2.; 3.; 4.; 5.; 5.; 4.; 3.; 2.; 1. ] in + + List.iter (fun d -> + Printf.printf "SIMPLE MOVING AVERAGE: PERIOD = %d\n" d; + let sma = sma_create d in + List.iter (fun x -> + Printf.printf "Next number = %-2g, SMA = %g\n" x (sma x); + ) series; + print_newline (); + ) periodLst diff --git a/Task/Averages-Simple-moving-average/Objective-C/averages-simple-moving-average-1.m b/Task/Averages-Simple-moving-average/Objective-C/averages-simple-moving-average-1.m new file mode 100644 index 0000000000..52bcbd25f7 --- /dev/null +++ b/Task/Averages-Simple-moving-average/Objective-C/averages-simple-moving-average-1.m @@ -0,0 +1,83 @@ +#import + +@interface MovingAverage : NSObject { + unsigned int period; + NSMutableArray *window; + double sum; +} +@end + +@implementation MovingAverage + +// init with default period +- (id)init { + self = [super init]; + if(self) { + period = 10; + window = [[NSMutableArray alloc] init]; + sum = 0.0; + } + return self; +} + +// init with specified period +- (id)initWithPeriod:(unsigned int)thePeriod { + self = [super init]; + if(self) { + period = thePeriod; + window = [[NSMutableArray alloc] init]; + sum = 0.0; + } + return self; +} + +// clear +- (void)dealloc { + [window release]; + [super dealloc]; +} + +// add a new number to the window +- (void)add:(double)val { + sum += val; + [window addObject:[NSNumber numberWithDouble:val]]; + if([window count] > period) { + NSNumber *n = [window objectAtIndex:0]; + sum -= [n doubleValue]; + [window removeObjectAtIndex:0]; + } +} + +// get the average value +- (double)avg { + if([window count] == 0) { + return 0; // technically the average is undefined + } + return sum / [window count]; +} + +// set the period, resizes current window +- (void)setPeriod:(unsigned int)thePeriod { + // make smaller? + if(thePeriod < [window count]) { + for(int i = 0; i < thePeriod; ++i) { + NSNumber *n = [window objectAtIndex:0]; + sum -= [n doubleValue]; + [window removeObjectAtIndex:0]; + } + } + period = thePeriod; +} + +// get the period (window size) +- (unsigned int)period { + return period; +} + +// clear the window and current sum +- (void)clear { + [window removeAllObjects]; + sum = 0; +} + +@end diff --git a/Task/Averages-Simple-moving-average/Objective-C/averages-simple-moving-average-2.m b/Task/Averages-Simple-moving-average/Objective-C/averages-simple-moving-average-2.m new file mode 100644 index 0000000000..de2ef66386 --- /dev/null +++ b/Task/Averages-Simple-moving-average/Objective-C/averages-simple-moving-average-2.m @@ -0,0 +1,11 @@ +double testData[10] = {1,2,3,4,5,5,4,3,2,1}; +int periods[2] = {3,5}; +for(int i = 0; i < 2; ++i) { + MovingAverage *ma = [[MovingAverage alloc] initWithPeriod:periods[i]]; + for(int j = 0; j < 10; ++j) { + [ma add:testData[j]]; + NSLog(@"Next number = %f, SMA = %f", testData[j], [ma avg]); + } + [ma release]; + NSLog(@"\n"); +} diff --git a/Task/Averages-Simple-moving-average/OxygenBasic/averages-simple-moving-average.oxy b/Task/Averages-Simple-moving-average/OxygenBasic/averages-simple-moving-average.oxy new file mode 100644 index 0000000000..0a8b0fbfd0 --- /dev/null +++ b/Task/Averages-Simple-moving-average/OxygenBasic/averages-simple-moving-average.oxy @@ -0,0 +1,42 @@ +def max 1000 + +Class MovingAverage +'================== + +indexbase 1 +double average,invperiod,mdata[max] +sys index,period + +method Setup(double a,p) +sys i +Period=p +invPeriod=1/p +index=0 +average=a +for i=1 to period + mdata[i]=a +next +end method + +method Data(double v) as double +sys i +index++ +if index>period then index=1 'recycle +i=index+1 'for oldest data +if i>period then i=1 'recycle +mdata[index]=v +average=average+invperiod*(v-mdata[i]) +end method + +end class + +'TEST +'==== + +MovingAverage A + +A.Setup 100,10 'initial value and period + +A.data 50 +'... +print A.average 'reult 95 diff --git a/Task/Averages-Simple-moving-average/Oz/averages-simple-moving-average.oz b/Task/Averages-Simple-moving-average/Oz/averages-simple-moving-average.oz new file mode 100644 index 0000000000..e0a3b85575 --- /dev/null +++ b/Task/Averages-Simple-moving-average/Oz/averages-simple-moving-average.oz @@ -0,0 +1,27 @@ +declare + + fun {CreateSMA Period} + Xs = {NewCell nil} + in + fun {$ X} + Xs := {List.take X|@Xs Period} + + {FoldL @Xs Number.'+' 0.0} + / + {Int.toFloat {Min Period {Length @Xs}}} + end + end + +in + + for Period in [3 5] do + SMA = {CreateSMA Period} + in + {System.showInfo "\nSTART PERIOD "#Period} + for I in 1..5 do + {System.showInfo " Number = "#I#" , SMA = "#{SMA {Int.toFloat I}}} + end + for I in 5..1;~1 do + {System.showInfo " Number = "#I#" , SMA = "#{SMA {Int.toFloat I}}} + end + end diff --git a/Task/Averages-Simple-moving-average/PARI-GP/averages-simple-moving-average.pari b/Task/Averages-Simple-moving-average/PARI-GP/averages-simple-moving-average.pari new file mode 100644 index 0000000000..8d06ee044d --- /dev/null +++ b/Task/Averages-Simple-moving-average/PARI-GP/averages-simple-moving-average.pari @@ -0,0 +1,5 @@ +sma_per(n)={ + sma_v=vector(n); + sma_i = 0; + n->if(sma_i++>#sma_v,sma_v[sma_i=1]=n;0,sma_v[sma_i]=n;0)+sum(i=1,#sma_v,sma_v[i])/#sma_v +}; diff --git a/Task/Averages-Simple-moving-average/PL-I/averages-simple-moving-average.pli b/Task/Averages-Simple-moving-average/PL-I/averages-simple-moving-average.pli new file mode 100644 index 0000000000..6743c3f01c --- /dev/null +++ b/Task/Averages-Simple-moving-average/PL-I/averages-simple-moving-average.pli @@ -0,0 +1,20 @@ +SMA: procedure (N) returns (float byaddr); + declare N fixed; + declare A(*) fixed controlled, + (p, q) fixed binary static initial (0); + + if allocation(A) = 0 then signal error; + + p = p + 1; if q < 20 then q = q + 1; + if p > hbound(A, 1) then p = 1; + A(p) = N; + return (sum(float(A))/q); + +I: ENTRY (Period); + declare Period fixed binary; + + if allocation(A) > 0 then FREE A; + allocate A(Period); + A = 0; + p = 0; +end SMA; diff --git a/Task/Averages-Simple-moving-average/Perl-6/averages-simple-moving-average.pl6 b/Task/Averages-Simple-moving-average/Perl-6/averages-simple-moving-average.pl6 new file mode 100644 index 0000000000..879fb63b32 --- /dev/null +++ b/Task/Averages-Simple-moving-average/Perl-6/averages-simple-moving-average.pl6 @@ -0,0 +1,10 @@ +sub sma (Int $period where (* > 0)) returns Sub { + my $sum = 0; + my @a; + return sub ($x) { + @a.push: $x; + $sum += $x; + $sum -= @a.shift if @a > $period; + return $sum / @a; + } +} diff --git a/Task/Averages-Simple-moving-average/PureBasic/averages-simple-moving-average.purebasic b/Task/Averages-Simple-moving-average/PureBasic/averages-simple-moving-average.purebasic new file mode 100644 index 0000000000..711271aa88 --- /dev/null +++ b/Task/Averages-Simple-moving-average/PureBasic/averages-simple-moving-average.purebasic @@ -0,0 +1,19 @@ +Procedure.d SMA(Number, Period=0) + Static P + Static NewList L() + Protected Sum=0 + If Period<>0 + P=Period + EndIf + LastElement(L()) + AddElement(L()) + L()=Number + While ListSize(L())>P + FirstElement(L()) + DeleteElement(L(),1) + Wend + ForEach L() + sum+L() + Next + ProcedureReturn sum/ListSize(L()) +EndProcedure diff --git a/Task/Averages-Simple-moving-average/TI-83-BASIC/averages-simple-moving-average.ti-83 b/Task/Averages-Simple-moving-average/TI-83-BASIC/averages-simple-moving-average.ti-83 new file mode 100644 index 0000000000..a99d9c580c --- /dev/null +++ b/Task/Averages-Simple-moving-average/TI-83-BASIC/averages-simple-moving-average.ti-83 @@ -0,0 +1,8 @@ +:1->C +:While 1 +:Prompt I +:C->dim(L1) +:I->L1(C) +:Disp mean(L1) +:1+C->C +:End diff --git a/Task/Averages-Simple-moving-average/TI-89-BASIC/averages-simple-moving-average-1.ti-89 b/Task/Averages-Simple-moving-average/TI-89-BASIC/averages-simple-moving-average-1.ti-89 new file mode 100644 index 0000000000..367cab6bed --- /dev/null +++ b/Task/Averages-Simple-moving-average/TI-89-BASIC/averages-simple-moving-average-1.ti-89 @@ -0,0 +1,10 @@ +movinavg(list,p) +Func + Local r, i, z + + For i,1,dim(list) + max(i-p,0)→z + sum(mid(list,z+1,i-z))/(i-z)→r[i] + EndFor + r +EndFunc diff --git a/Task/Averages-Simple-moving-average/TI-89-BASIC/averages-simple-moving-average-2.ti-89 b/Task/Averages-Simple-moving-average/TI-89-BASIC/averages-simple-moving-average-2.ti-89 new file mode 100644 index 0000000000..2de228c3a1 --- /dev/null +++ b/Task/Averages-Simple-moving-average/TI-89-BASIC/averages-simple-moving-average-2.ti-89 @@ -0,0 +1,11 @@ +movinav2(x_,v_) +Prgm + If getType(x_)="STR" Then + {}→list + v_→p + Return + EndIf + + right(augment(list,{x_}),p)→list + sum(list)/dim(list)→#v_ +EndPrgm diff --git a/Task/Balanced-brackets/BASIC/balanced-brackets.bas b/Task/Balanced-brackets/BASIC/balanced-brackets.basic similarity index 100% rename from Task/Balanced-brackets/BASIC/balanced-brackets.bas rename to Task/Balanced-brackets/BASIC/balanced-brackets.basic diff --git a/Task/Balanced-brackets/CoffeeScript/balanced-brackets-1.coffee b/Task/Balanced-brackets/CoffeeScript/balanced-brackets-1.coffeescript similarity index 100% rename from Task/Balanced-brackets/CoffeeScript/balanced-brackets-1.coffee rename to Task/Balanced-brackets/CoffeeScript/balanced-brackets-1.coffeescript diff --git a/Task/Balanced-brackets/CoffeeScript/balanced-brackets-2.coffee b/Task/Balanced-brackets/CoffeeScript/balanced-brackets-2.coffeescript similarity index 100% rename from Task/Balanced-brackets/CoffeeScript/balanced-brackets-2.coffee rename to Task/Balanced-brackets/CoffeeScript/balanced-brackets-2.coffeescript diff --git a/Task/Balanced-brackets/Mathematica/balanced-brackets.mathematica b/Task/Balanced-brackets/Mathematica/balanced-brackets.math similarity index 100% rename from Task/Balanced-brackets/Mathematica/balanced-brackets.mathematica rename to Task/Balanced-brackets/Mathematica/balanced-brackets.math diff --git a/Task/Balanced-brackets/OCaml/balanced-brackets.ocaml b/Task/Balanced-brackets/OCaml/balanced-brackets.ocaml new file mode 100644 index 0000000000..f846751aab --- /dev/null +++ b/Task/Balanced-brackets/OCaml/balanced-brackets.ocaml @@ -0,0 +1,25 @@ +let generate_brackets n = + let rec aux i acc = + if i <= 0 then acc else + aux (pred i) ('['::']'::acc) + in + let brk = aux n [] in + List.sort (fun _ _ -> (Random.int 3) - 1) brk + +let is_balanced brk = + let rec aux = function + | [], 0 -> true + | '['::brk, level -> aux (brk, succ level) + | ']'::brk, 0 -> false + | ']'::brk, level -> aux (brk, pred level) + | _ -> assert false + in + aux (brk, 0) + +let () = + let n = int_of_string Sys.argv.(1) in + Random.self_init(); + let brk = generate_brackets n in + List.iter print_char brk; + Printf.printf " %B\n" (is_balanced brk); +;; diff --git a/Task/Balanced-brackets/Objeck/balanced-brackets.objeck b/Task/Balanced-brackets/Objeck/balanced-brackets.objeck new file mode 100644 index 0000000000..144deb366b --- /dev/null +++ b/Task/Balanced-brackets/Objeck/balanced-brackets.objeck @@ -0,0 +1,32 @@ +bundle Default { + class Balanced { + function : IsBalanced(text : String) ~ Bool { + level := 0; + each(i : text) { + character := text->Get(i); + if(character = ']') { + if(level = 0) { + return false; + }; + level -= 1; + }; + + if(character = '[') { + level += 1; + }; + }; + + return level = 0; + } + + function : Main(args : String[]) ~ Nil { + ": "->Print(); IsBalanced("")->PrintLine(); + "[]: "->Print(); IsBalanced("[]")->PrintLine(); + "[][]: "->Print(); IsBalanced("[][]")->PrintLine(); + "[[][]]: "->Print(); IsBalanced("[[][]]")->PrintLine(); + "][: "->Print(); IsBalanced("][")->PrintLine(); + "][][: "->Print(); IsBalanced("][][")->PrintLine(); + "[]][[]: "->Print(); IsBalanced("[]][[]")->PrintLine(); + } + } +} diff --git a/Task/Balanced-brackets/OxygenBasic/balanced-brackets.oxy b/Task/Balanced-brackets/OxygenBasic/balanced-brackets.oxy new file mode 100644 index 0000000000..33f4f1a038 --- /dev/null +++ b/Task/Balanced-brackets/OxygenBasic/balanced-brackets.oxy @@ -0,0 +1,27 @@ +function CheckBrackets(string s) as bool +'======================================= + sys co, le=len s + byte b at strptr s + indexbase 0 + for i=0 to xx $n).pick(*).join; +say "$s {balanced($s) ?? "is" !! "is not"} well-balanced" diff --git a/Task/Balanced-brackets/Perl-6/balanced-brackets-2.pl6 b/Task/Balanced-brackets/Perl-6/balanced-brackets-2.pl6 new file mode 100644 index 0000000000..9195dffad8 --- /dev/null +++ b/Task/Balanced-brackets/Perl-6/balanced-brackets-2.pl6 @@ -0,0 +1,8 @@ +sub balanced($s) { + .none < 0 and .[*-1] == 0 + given [\+] '\\' «leg« $s.comb; +} + +my $n = prompt "Number of bracket pairs: "; +my $s = <[ ]>.roll($n*2).join; +say "$s { balanced($s) ?? "is" !! "is not" } well-balanced" diff --git a/Task/Balanced-brackets/Perl-6/balanced-brackets-3.pl6 b/Task/Balanced-brackets/Perl-6/balanced-brackets-3.pl6 new file mode 100644 index 0000000000..1e5da3a4b7 --- /dev/null +++ b/Task/Balanced-brackets/Perl-6/balanced-brackets-3.pl6 @@ -0,0 +1,8 @@ +sub balanced($_ is copy) { + () while s:g/'[]'//; + $_ eq ''; +} + +my $n = prompt "Number of bracket pairs: "; +my $s = <[ ]>.roll($n*2).join; +say "$s is", ' not' xx not balanced($s)), " well-balanced"; diff --git a/Task/Balanced-brackets/Perl-6/balanced-brackets-4.pl6 b/Task/Balanced-brackets/Perl-6/balanced-brackets-4.pl6 new file mode 100644 index 0000000000..b620a6e0ab --- /dev/null +++ b/Task/Balanced-brackets/Perl-6/balanced-brackets-4.pl6 @@ -0,0 +1,8 @@ +grammar BalBrack { + token TOP { ^ * $ }; + token balanced { '[' * ']' } +} + +my $n = prompt "Number of bracket pairs: "; +my $s = (<[ ]> xx $n).pick(*).join; +say "$s { BalBrack.parse($s) ?? "is" !! "is not" } well-balanced"; diff --git a/Task/Balanced-brackets/PureBasic/balanced-brackets.purebasic b/Task/Balanced-brackets/PureBasic/balanced-brackets.purebasic new file mode 100644 index 0000000000..2adf090a19 --- /dev/null +++ b/Task/Balanced-brackets/PureBasic/balanced-brackets.purebasic @@ -0,0 +1,44 @@ +Procedure.s Generate(N) + For i=1 To N + sample$+"[]" + Next + For i=Len(sample$)-1 To 2 Step -1 + r=Random(i-1)+1 + If r<>i + a.c=PeekC(@sample$+r*SizeOf(Character)) + b.c=PeekC(@sample$+i*SizeOf(Character)) + PokeC(@sample$+r*SizeOf(Character), b) + PokeC(@sample$+i*SizeOf(Character), a) + EndIf + Next + ProcedureReturn sample$ +EndProcedure + +Procedure Balanced(String$) + Protected *p.Character, cnt + *p=@String$ + While *p\c + If *p\c='[' + cnt+1 + ElseIf *p\c=']' + cnt-1 + If cnt<0: Break: EndIf + EndIf + *p+SizeOf(Character) + Wend + If cnt=0 + ProcedureReturn #True + EndIf +EndProcedure + +;- Test code +OpenConsole() +For i=1 To 5 + TestString$ = Generate(i) + Print(TestString$) + If Balanced(TestString$) + PrintN(" is ballanced.") + Else + PrintN(" is not ballanced") + EndIf +Next diff --git a/Task/Balanced-brackets/Qi/balanced-brackets.qi b/Task/Balanced-brackets/Qi/balanced-brackets.qi new file mode 100644 index 0000000000..f0b26cf57d --- /dev/null +++ b/Task/Balanced-brackets/Qi/balanced-brackets.qi @@ -0,0 +1,21 @@ +(define balanced-brackets-0 + [] 0 -> true + [] _ -> false + [#\[|R] Sum -> (balanced-brackets-0 R (+ Sum 1)) + _ 0 -> false + [_ |R] Sum -> (balanced-brackets-0 R (- Sum 1))) + + +(define balanced-brackets + "" -> true + S -> (balanced-brackets-0 (explode (INTERN S)) 0)) + +(balanced-brackets "") + +(balanced-brackets "[]") +(balanced-brackets "[][]") +(balanced-brackets "[[][]]") + +(balanced-brackets "][") +(balanced-brackets "][][") +(balanced-brackets "[]][[]") diff --git a/Task/Balanced-brackets/Run-BASIC/balanced-brackets.run b/Task/Balanced-brackets/Run-BASIC/balanced-brackets.run new file mode 100644 index 0000000000..d24763e6c1 --- /dev/null +++ b/Task/Balanced-brackets/Run-BASIC/balanced-brackets.run @@ -0,0 +1,21 @@ +dim brk$(10) +brk$(1) = "[[[][]]]" +brk$(2) = "[[[]][[[][[][]]]]]" +brk$(3) = "][][]][[" +brk$(4) = "[][][]" +brk$(5) = "[][]][]][[]]][[[" +brk$(6) = "]][[[[]]]][]]][[[[" +brk$(7) = "[[][[[]]][]]" +brk$(8) = "[]][][][[[]]" +brk$(9) = "][]][[" +brk$(10) = "[]][][][[]" + +for i = 1 to 10 + b$ = brk$(i) + while instr(b$,"[]") <> 0 + x = instr(b$,"[]") + if x > 0 then b$ = left$(b$,x - 1) + mid$(b$,x + 2) + wend + if trim$(b$) = "" then print " OK "; else print "Not OK "; + print brk$(i) +next i diff --git a/Task/Balanced-brackets/Seed7/balanced-brackets.seed7 b/Task/Balanced-brackets/Seed7/balanced-brackets.seed7 new file mode 100644 index 0000000000..32f04f08af --- /dev/null +++ b/Task/Balanced-brackets/Seed7/balanced-brackets.seed7 @@ -0,0 +1,53 @@ +$ include "seed7_05.s7i"; + +const func string: generateBrackets (in integer: count) is func + result + var string: stri is ""; + local + var integer: index is 0; + var integer: pos is 0; + var char: ch is ' '; + begin + stri := "[" mult count & "]" mult count; + for index range 1 to length(stri) do + pos := rand(1, length(stri)); + ch := stri[index]; + stri @:= [index] stri[pos]; + stri @:= [pos] ch; + end for; + end func; + +const func boolean: checkBrackets (in string: test) is func + result + var boolean: okay is TRUE; + local + var char: ch is ' '; + var integer: open is 0; + begin + for ch range test do + if ch = '[' then + incr(open); + elsif ch = ']' then + if open = 0 then + okay := FALSE; + else + decr(open); + end if; + end if; + end for; + okay := open = 0; + end func; + +const proc: main is func + local + var integer: n is 0; + var integer: count is 0; + var string: stri is ""; + begin + for n range 0 to 4 do + for count range 1 to 3 do + stri := generateBrackets(n); + writeln(stri <& ": " <& checkBrackets(stri)); + end for; + end for; + end func; diff --git a/Task/Balanced-brackets/TUSCRIPT/balanced-brackets.tuscript b/Task/Balanced-brackets/TUSCRIPT/balanced-brackets.tuscript new file mode 100644 index 0000000000..2f7e06f197 --- /dev/null +++ b/Task/Balanced-brackets/TUSCRIPT/balanced-brackets.tuscript @@ -0,0 +1,29 @@ +$$ MODE TUSCRIPT + +SECTION gen_brackets +values="[']",brackets="" +LOOP n=1,12 + brackets=APPEND (brackets,"","~") + LOOP m=1,n + a=RANDOM_NUMBERS (1,2,1),br=SELECT(values,#a) + brackets=APPEND(brackets,"",br) + b=RANDOM_NUMBERS (1,2,1),br=SELECT(values,#b) + brackets=APPEND(brackets,"",br) + ENDLOOP +ENDLOOP +brackets=SPLIT (brackets,":~:") +ENDSECTION + +MODE DATA +$$ BUILD X_TABLE brackets=* + [[[[ (4 ]]]] )4 + [[[ (3 ]]] )3 + [[ (2 ]] )2 + [ (1 ] )1 + +$$ MODE TUSCRIPT +DO gen_brackets +LOOP b=brackets +status=CHECK_BRACKETS (b,brackets,a1,e1,a2,e2) +PRINT b," ",status +ENDLOOP diff --git a/Task/Balanced-brackets/TXR/balanced-brackets.txr b/Task/Balanced-brackets/TXR/balanced-brackets.txr new file mode 100644 index 0000000000..4b6139ff39 --- /dev/null +++ b/Task/Balanced-brackets/TXR/balanced-brackets.txr @@ -0,0 +1,33 @@ +@(define paren)@(maybe)[@(coll)@(paren)@(until)]@(end)]@(end)@(end) +@(do (defvar r (make-random-state nil)) + (defun shuffle (list) + (for* ((vec (vector-list list)) + (len (length vec)) + (i 0)) + ((< i len) (list-vector vec)) + ((inc i)) + (let ((j (random r len)) + (temp (vecref vec i))) + (set (vecref vec i) (vecref vec j)) + (set (vecref vec j) temp)))) + (defun generate-1 (count) + (for ((i 0) chars) ((< i count) (cat-str (shuffle chars) "")) ((inc i)) + (push #\[ chars) + (push #\] chars))) + (defun generate-list (num count) + (for ((i 0) list) ((< i num) list) ((inc i)) + (push (generate-1 count) list)))) +@(next :list @(generate-list 22 6)) +@(output) +INPUT MATCHED REST +@(end) +@ (collect) +@ (all) +@parens +@ (and) +@{matched (paren)}@mismatched +@ (end) +@ (output) +@{parens 15} @{matched 15} @{mismatched 15} +@ (end) +@(end) diff --git a/Task/Balanced-brackets/Ursala/balanced-brackets.ursala b/Task/Balanced-brackets/Ursala/balanced-brackets.ursala new file mode 100644 index 0000000000..2c2234385c --- /dev/null +++ b/Task/Balanced-brackets/Ursala/balanced-brackets.ursala @@ -0,0 +1,8 @@ +#import std +#import nat + +balanced = @NiX ~&irB->ilZB ~&rh?/~&lbtPB ~&NlCrtPX + +#cast %bm + +main = ^(2-$'[]'*,balanced)* eql@ZFiFX*~ iota64 diff --git a/Task/Balanced-brackets/VBA/balanced-brackets.vba b/Task/Balanced-brackets/VBA/balanced-brackets.vba new file mode 100644 index 0000000000..b47702fc67 --- /dev/null +++ b/Task/Balanced-brackets/VBA/balanced-brackets.vba @@ -0,0 +1,66 @@ +Public Function checkBrackets(s As String) As Boolean +'function checks strings for balanced brackets +Dim Depth As Integer +Dim ch As String * 1 + +Depth = 0 +For i = 1 To Len(s) + ch = Mid$(s, i, 1) + If ch = "[" Then Depth = Depth + 1 + If ch = "]" Then + If Depth = 0 Then 'not balanced + checkBrackets = False + Exit Function + Else + Depth = Depth - 1 + End If + End If +Next +checkBrackets = (Depth = 0) +End Function + +Public Function GenerateBrackets(N As Integer) As String +'generate a string with N opening and N closing brackets in random order +Dim s As String +Dim N2 As Integer, j As Integer +Dim Brackets() As String * 1 +Dim temp As String * 1 + +'catch trivial value +If N <= 0 Then + GenerateBrackets = "" + Exit Function +End If + +N2 = N + N +ReDim Brackets(1 To N2) +For i = 1 To N2 Step 2 + Brackets(i) = "[" + Brackets(i + 1) = "]" +Next i +'shuffle. +For i = 1 To N2 + j = 1 + Int(Rnd() * N2) + 'swap brackets i and j + temp = Brackets(i) + Brackets(i) = Brackets(j) + Brackets(j) = temp +Next i +'generate string +s = "" +For i = 1 To N2 + s = s & Brackets(i) +Next i +GenerateBrackets = s +End Function + +Public Sub BracketsTest() +Dim s As String +Dim i As Integer + +For i = 0 To 10 + s = GenerateBrackets(i) + Debug.Print """" & s & """: "; + If checkBrackets(s) Then Debug.Print " OK" Else Debug.Print " Not OK" +Next +End Sub diff --git a/Task/Balanced-brackets/XPL0/balanced-brackets.xpl0 b/Task/Balanced-brackets/XPL0/balanced-brackets.xpl0 new file mode 100644 index 0000000000..2228a372b3 --- /dev/null +++ b/Task/Balanced-brackets/XPL0/balanced-brackets.xpl0 @@ -0,0 +1,26 @@ +include c:\cxpl\codes; \intrinsic code declarations + +int N, I, C, Nest; +char Str; +[\Generate a string with N open brackets and N close brackets in arbitrary order +N:= IntIn(0); \get number of brackets/2 from keyboard +Str:= Reserve(2*N); +for I:= 0 to 2*N-1 do Str(I):= ^[; +C:= 0; \initialize count of "]" +repeat I:= Ran(2*N); \change N random locations to "]" + if Str(I) # ^] then [Str(I):= ^]; C:= C+1]; +until C>=N; + +\Determine whether string consists of nested pairs of open/close brackets +I:= 0; C:= 0; Nest:= false; +while I<2*N do + [if Str(I) = ^[ then C:= C+1 else C:= C-1; + if C<0 then Nest:= true; + ChOut(0,Str(I)); + I:= I+1; + ]; +ChOut(0,9\tab\); +if Nest then Text(0,"NOT "); +Text(0,"OK +"); +] diff --git a/Task/Balanced-ternary/Mathematica/balanced-ternary-1.mathematica b/Task/Balanced-ternary/Mathematica/balanced-ternary-1.math similarity index 100% rename from Task/Balanced-ternary/Mathematica/balanced-ternary-1.mathematica rename to Task/Balanced-ternary/Mathematica/balanced-ternary-1.math diff --git a/Task/Balanced-ternary/Mathematica/balanced-ternary-2.mathematica b/Task/Balanced-ternary/Mathematica/balanced-ternary-2.math similarity index 100% rename from Task/Balanced-ternary/Mathematica/balanced-ternary-2.mathematica rename to Task/Balanced-ternary/Mathematica/balanced-ternary-2.math diff --git a/Task/Balanced-ternary/OCaml/balanced-ternary.ocaml b/Task/Balanced-ternary/OCaml/balanced-ternary.ocaml new file mode 100644 index 0000000000..c41ce07914 --- /dev/null +++ b/Task/Balanced-ternary/OCaml/balanced-ternary.ocaml @@ -0,0 +1,52 @@ +type btdigit = Pos | Zero | Neg +type btern = btdigit list + +let to_string n = + String.concat "" + (List.rev_map (function Pos -> "+" | Zero -> "0" | Neg -> "-") n) + +let from_string s = + let sl = ref [] in + let digit = function '+' -> Pos | '-' -> Neg | '0' -> Zero + | _ -> failwith "invalid digit" in + String.iter (fun c -> sl := (digit c) :: !sl) s; !sl + +let rec to_int = function + | [Zero] | [] -> 0 + | Pos :: t -> 1 + 3 * to_int t + | Neg :: t -> -1 + 3 * to_int t + | Zero :: t -> 3 * to_int t + +let rec from_int n = + if n = 0 then [] else + match n mod 3 with + | 0 -> Zero :: from_int (n/3) + | 1 | -2 -> Pos :: from_int ((n-1)/3) + | 2 | -1 -> Neg :: from_int ((n+1)/3) + +let rec (+~) n1 n2 = match (n1,n2) with + | ([], a) | (a,[]) -> a + | (Pos::t1, Neg::t2) | (Neg::t1, Pos::t2) | (Zero::t1, Zero::t2) -> + let sum = t1 +~ t2 in if sum = [] then [] else Zero :: sum + | (Pos::t1, Pos::t2) -> Neg :: t1 +~ t2 +~ [Pos] + | (Neg::t1, Neg::t2) -> Pos :: t1 +~ t2 +~ [Neg] + | (Zero::t1, h::t2) | (h::t1, Zero::t2) -> h :: t1 +~ t2 + +let neg = List.map (function Pos -> Neg | Neg -> Pos | Zero -> Zero) +let (-~) a b = a +~ (neg b) + +let rec ( *~) n1 = function + | [] -> [] + | [Pos] -> n1 + | [Neg] -> neg n1 + | Pos::t -> (Zero :: t *~ n1) +~ n1 + | Neg::t -> (Zero :: t *~ n1) -~ n1 + | Zero::t -> Zero :: t *~ n1 + +let a = from_string "+-0++0+" +let b = from_int (-436) +let c = from_string "+-++-" +let d = a *~ (b -~ c) +let _ = + Printf.printf "a = %d\nb = %d\nc = %d\na * (b - c) = %s = %d\n" + (to_int a) (to_int b) (to_int c) (to_string d) (to_int d); diff --git a/Task/Balanced-ternary/Perl-6/balanced-ternary.pl6 b/Task/Balanced-ternary/Perl-6/balanced-ternary.pl6 new file mode 100644 index 0000000000..5ddee3ec7d --- /dev/null +++ b/Task/Balanced-ternary/Perl-6/balanced-ternary.pl6 @@ -0,0 +1,63 @@ +class BT { + has @.coeff; + + my %co2bt = '-1' => '-', '0' => '0', '1' => '+'; + my %bt2co = %co2bt.invert; + + multi method new (Str $s) { + self.bless(*, coeff => %bt2co{$s.flip.comb}); + } + multi method new (Int $i where $i >= 0) { + self.bless(*, coeff => carry $i.base(3).comb.reverse); + } + multi method new (Int $i where $i < 0) { + self.new(-$i).neg; + } + + method Str () { %co2bt{@!coeff}.join.flip } + method Int () { [+] @!coeff Z* (1,3,9...*) } + + multi method neg () { + self.new: coeff => carry self.coeff X* -1; + } +} + +sub carry (*@digits is copy) { + loop (my $i = 0; $i < @digits; $i++) { + while @digits[$i] < -1 { @digits[$i] += 3; @digits[$i+1]--; } + while @digits[$i] > 1 { @digits[$i] -= 3; @digits[$i+1]++; } + } + pop @digits while @digits and not @digits[*-1]; + @digits; +} + +multi prefix:<-> (BT $x) { $x.neg } + +multi infix:<+> (BT $x, BT $y) { + my ($b,$a) = sort +*.coeff, $x, $y; + BT.new: coeff => carry $a.coeff Z+ $b.coeff, 0 xx *; +} + +multi infix:<-> (BT $x, BT $y) { $x + $y.neg } + +multi infix:<*> (BT $x, BT $y) { + my @x = $x.coeff; + my @y = $y.coeff; + my @z = 0 xx @x+@y-1; + my @safe; + for @x -> $xd { + @z = @z Z+ (@y X* $xd), 0 xx *; + @safe.push: @z.shift; + } + BT.new: coeff => carry @safe, @z; +} + +my $a = BT.new: "+-0++0+"; +my $b = BT.new: -436; +my $c = BT.new: "+-++-"; +my $x = $a * ( $b - $c ); + +say 'a == ', $a.Int; +say 'b == ', $b.Int; +say 'c == ', $c.Int; +say "a × (b − c) == ", ~$x, ' == ', $x.Int; diff --git a/Task/Best-shuffle/Mathematica/best-shuffle.mathematica b/Task/Best-shuffle/Mathematica/best-shuffle.math similarity index 100% rename from Task/Best-shuffle/Mathematica/best-shuffle.mathematica rename to Task/Best-shuffle/Mathematica/best-shuffle.math diff --git a/Task/Best-shuffle/OCaml/best-shuffle.ocaml b/Task/Best-shuffle/OCaml/best-shuffle.ocaml new file mode 100644 index 0000000000..a2420e8fb7 --- /dev/null +++ b/Task/Best-shuffle/OCaml/best-shuffle.ocaml @@ -0,0 +1,37 @@ +let best_shuffle s = + let len = String.length s in + let r = String.copy s in + for i = 0 to pred len do + for j = 0 to pred len do + if i <> j && s.[i] <> r.[j] && s.[j] <> r.[i] then + begin + let tmp = r.[i] in + r.[i] <- r.[j]; + r.[j] <- tmp; + end + done; + done; + (r) + +let count_same s1 s2 = + let len1 = String.length s1 + and len2 = String.length s2 in + let n = ref 0 in + for i = 0 to pred (min len1 len2) do + if s1.[i] = s2.[i] then incr n + done; + !n + +let () = + let test s = + let s2 = best_shuffle s in + Printf.printf " '%s', '%s' -> %d\n" s s2 (count_same s s2); + in + test "tree"; + test "abracadabra"; + test "seesaw"; + test "elk"; + test "grrrrrr"; + test "up"; + test "a"; +;; diff --git a/Task/Best-shuffle/PL-I/best-shuffle.pli b/Task/Best-shuffle/PL-I/best-shuffle.pli new file mode 100644 index 0000000000..c4fbca48b5 --- /dev/null +++ b/Task/Best-shuffle/PL-I/best-shuffle.pli @@ -0,0 +1,67 @@ +shuffle: procedure options (main); /* 14/1/2011 */ + declare (s, saves) character (20) varying, c character (1); + declare t(length(s)) bit (1); + declare (i, k, moves initial (0)) fixed binary; + + get edit (s) (L); + put skip list (s); + saves = s; + t = '0'b; + do i = 1 to length (s); + if t(i) then iterate; /* This character has already been moved. */ + c = substr(s, i, 1); + k = search (s, c, i+1); + if k > 0 then + do; + substr(s, i, 1) = substr(s, k, 1); + substr(s, k, 1) = c; + t(k), t(i) = '1'b; + end; + end; + + do k = length(s) to 2 by -1; + if ^t(k) then /* this character wasn't moved. */ +all: do; + c = substr(s, k, 1); + do i = k-1 to 1 by -1; + if c ^= substr(s, i, 1) then + if substr(saves, i, 1) ^= c then + do; + substr(s, k, 1) = substr(s, i, 1); + substr(s, i, 1) = c; + t(k) = '1'b; + leave all; + end; + end; + end; + end; + moves = length(s) - sum(t); + put skip edit (s, trim(moves))(a, x(1)); + +search: procedure (s, c, k) returns (fixed binary); + declare s character (*) varying; + declare c character (1); + declare k fixed binary; + declare i fixed binary; + + do i = k to length(s); + if ^t(i) then if c ^= substr(s, i, 1) then return (i); + end; + return (0); /* No eligible character. */ +end search; + +end shuffle; + +OUTPUT: + +abracadabra +baaracadrab 0 + +prrrrrr +rprrrrr 5 + +tree +eert 0 + +A +A 1 diff --git a/Task/Best-shuffle/Pascal/best-shuffle.pascal b/Task/Best-shuffle/Pascal/best-shuffle.pascal new file mode 100644 index 0000000000..7813844dac --- /dev/null +++ b/Task/Best-shuffle/Pascal/best-shuffle.pascal @@ -0,0 +1,40 @@ +program BestShuffleDemo(output); + +function BestShuffle(s: string): string; + + var + tmp: char; + i, j: integer; + t: string; + begin + t := s; + for i := 1 to length(t) do + for j := 1 to length(t) do + if (i <> j) and (s[i] <> t[j]) and (s[j] <> t[i]) then + begin + tmp := t[i]; + t[i] := t[j]; + t[j] := tmp; + end; + BestShuffle := t; + end; + +const + original: array[1..6] of string = + ('abracadabra', 'seesaw', 'elk', 'grrrrrr', 'up', 'a'); + +var + shuffle: string; + i, j, score: integer; + +begin + for i := low(original) to high(original) do + begin + shuffle := BestShuffle(original[i]); + score := 0; + for j := 1 to length(shuffle) do + if original[i][j] = shuffle[j] then + inc(score); + writeln(original[i], ', ', shuffle, ', (', score, ')'); + end; +end. diff --git a/Task/Best-shuffle/Perl-6/best-shuffle.pl6 b/Task/Best-shuffle/Perl-6/best-shuffle.pl6 new file mode 100644 index 0000000000..a47a416c79 --- /dev/null +++ b/Task/Best-shuffle/Perl-6/best-shuffle.pl6 @@ -0,0 +1,38 @@ +sub best-shuffle (Str $s) { + my @orig = $s.comb; + + my @pos; + # Fill @pos with positions in the order that we want to fill + # them. (Once Rakudo has &roundrobin, this will be doable in + # one statement.) + { + my %pos = classify { @orig[$^i] }, keys @orig; + my @k = map *.key, sort *.value.elems, %pos; + while %pos { + for @k -> $letter { + %pos{$letter} or next; + push @pos, %pos{$letter}.pop; + %pos{$letter}.elems or %pos.delete: $letter; + } + } + @pos .= reverse; + } + + my @letters = @orig; + my @new = Any xx $s.chars; + # Now fill in @new with @letters according to each position + # in @pos, but skip ahead in @letters if we can avoid + # matching characters that way. + while @letters { + my ($i, $p) = 0, shift @pos; + ++$i while @letters[$i] eq @orig[$p] and $i < @letters.end; + @new[$p] = splice @letters, $i, 1; + } + + my $score = elems grep ?*, map * eq *, do @new Z @orig; + + @new.join, $score; +} + +printf "%s, %s, (%d)\n", $_, best-shuffle $_ + for ; diff --git a/Task/Best-shuffle/PowerShell/best-shuffle.psh b/Task/Best-shuffle/PowerShell/best-shuffle.psh new file mode 100644 index 0000000000..52bcbcd8a3 --- /dev/null +++ b/Task/Best-shuffle/PowerShell/best-shuffle.psh @@ -0,0 +1,10 @@ +function Best-Shuffle($strings){ + foreach($string in $strings){ + $sa1 = $string.ToCharArray() + $sa2 = Get-Random -InputObject $sa1 -Count ([int]::MaxValue) + $string = [String]::Join("",$sa2) + echo $string + } +} + +Best-Shuffle "abracadabra", "seesaw", "pop", "grrrrrr", "up", "a" diff --git a/Task/Best-shuffle/PureBasic/best-shuffle.purebasic b/Task/Best-shuffle/PureBasic/best-shuffle.purebasic new file mode 100644 index 0000000000..672c90279d --- /dev/null +++ b/Task/Best-shuffle/PureBasic/best-shuffle.purebasic @@ -0,0 +1,110 @@ +Structure charInfo + Char.s + List Position.i() + count.i ;number of occurrences of Char +EndStructure + +Structure cycleInfo + Char.s + Position.i +EndStructure + +Structure cycle + List cycle.cycleInfo() +EndStructure + +Procedure.s shuffleWordLetters(word.s) + Protected i + Dim originalLetters.s(len(word) - 1) + For i = 1 To Len(word) + originalLetters(i - 1) = Mid(word, i, 1) + Next + + Dim shuffledLetters.s(0) + CopyArray(originalLetters(), shuffledLetters()) + + ;record original letters and their positions + Protected curChar.s + NewList letters.charInfo() + NewMap *wordInfo.charInfo() + For i = 0 To ArraySize(originalLetters()) + curChar = originalLetters(i) + If FindMapElement(*wordInfo(), curChar) + AddElement(*wordInfo()\position()) + *wordInfo()\position() = i + Else + *wordInfo(curChar) = AddElement(letters()) + If *wordInfo() + *wordInfo()\Char = curChar + AddElement(*wordInfo()\position()) + *wordInfo()\position() = i + EndIf + EndIf + Next + + ForEach letters() + letters()\count = ListSize(letters()\Position()) + Next + + SortStructuredList(letters(), #PB_Sort_Ascending, OffsetOf(charInfo\Char), #PB_Sort_String) ;extra sort step, not strictly necessary + SortStructuredList(letters(), #PB_Sort_Descending, OffsetOf(charInfo\count), #PB_Sort_integer) + + ;construct letter cycles + FirstElement(letters()) + Protected maxLetterCount = letters()\count + Dim letterCycles.cycle(maxLetterCount - 1) + + Protected curCycleIndex + ForEach letters() + ForEach letters()\Position() + With letterCycles(curCycleIndex) + AddElement(\cycle()) + \cycle()\Char = letters()\Char + \cycle()\Position = letters()\position() + EndWith + curCycleIndex = (curCycleIndex + 1) % maxLetterCount + Next + Next + + ;rotate letters in each cycle + Protected isFirst, prevChar.s, pos_1 + For i = 0 To maxLetterCount - 1 + With letterCycles(i) + isFirst = #True + ForEach \cycle() + If Not isFirst + shuffledLetters(\cycle()\Position) = prevChar + Else + pos_1 = \cycle()\Position + isFirst = #False + EndIf + prevChar = \cycle()\Char + Next + shuffledLetters(pos_1) = prevChar + EndWith + Next + + ;score and display shuffle + Protected shuffledWord.s, ignored + For i = 0 To ArraySize(shuffledLetters()) + shuffledWord + shuffledLetters(i) + If shuffledLetters(i) = originalLetters(i) + ignored + 1 + EndIf + Next + + PrintN(word + ", " + shuffledWord + ", (" + Str(ignored) + ")") + ProcedureReturn shuffledWord +EndProcedure + +If OpenConsole() + shuffleWordLetters("abracadabra") + shuffleWordLetters("seesaw") + shuffleWordLetters("elk") + shuffleWordLetters("grrrrrr") + shuffleWordLetters("up") + shuffleWordLetters("a") + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Best-shuffle/Rascal/best-shuffle.rascal b/Task/Best-shuffle/Rascal/best-shuffle.rascal new file mode 100644 index 0000000000..6526046bc1 --- /dev/null +++ b/Task/Best-shuffle/Rascal/best-shuffle.rascal @@ -0,0 +1,13 @@ +import Prelude; + +public tuple[str, str, int] bestShuffle(str s){ + characters = chars(s); + + ranking = { | p <- permutations(characters)}; + best = { | <- ranking, n == min(range(ranking))}; + return takeOneFrom(best)[0]; +} + +public int countSame(list[int] permutations, list[int] characters){ + return (0 | it + 1 | n <- index(characters), permutations[n] == characters[n]); +} diff --git a/Task/Best-shuffle/Ursala/best-shuffle-1.ursala b/Task/Best-shuffle/Ursala/best-shuffle-1.ursala new file mode 100644 index 0000000000..b9a74829f7 --- /dev/null +++ b/Task/Best-shuffle/Ursala/best-shuffle-1.ursala @@ -0,0 +1,10 @@ +#import std +#import nat + +words = <'abracadabra','seesaw','elk','grrrrrr','up','a'> + +shuffle = num; ^H/(*@K24) ^H\~&lS @rK2lSS *+ ^arPfarhPlzPClyPCrtPXPRalPqzyCipSLK24\~&L leql$^NS + +#show+ + +main = ~&LS <.~&l,@r :/` ,' ('--+ --')'+ ~&h+ %nP+ length@plrEF>^(~&,shuffle)* words diff --git a/Task/Best-shuffle/Ursala/best-shuffle-2.ursala b/Task/Best-shuffle/Ursala/best-shuffle-2.ursala new file mode 100644 index 0000000000..6ba7a6513f --- /dev/null +++ b/Task/Best-shuffle/Ursala/best-shuffle-2.ursala @@ -0,0 +1 @@ +shuffle = ~&r+ length@plrEZF$^^D/~& permutations diff --git a/Task/Best-shuffle/XPL0/best-shuffle.xpl0 b/Task/Best-shuffle/XPL0/best-shuffle.xpl0 new file mode 100644 index 0000000000..44f26c17d7 --- /dev/null +++ b/Task/Best-shuffle/XPL0/best-shuffle.xpl0 @@ -0,0 +1,35 @@ +include c:\cxpl\codes; \'code' declarations +string 0; \use zero-terminated string convention + +func StrLen(A); \Return number of characters in an ASCIIZ string +char A; +int I; +for I:= 0 to -1>>1-1 do + if A(I) = 0 then return I; + +proc Shuffle(W0); \Display best shuffle of characters in a word +char W0; +char W(20), SW(20); +int L, I, S, SS, C, T; +[L:= StrLen(W0); \word length +for I:= 0 to L do W(I):= W0(I); \get working copy of word (including 0) +SS:= 20; \initialize best (saved) score +for C:= 1 to 1_000_000 do \overkill? XPL0 is fast + [I:= Ran(L); \shuffle: swap random char with end char + T:= W(I); W(I):= W(L-1); W(L-1):= T; + S:= 0; \compute score + for I:= 0 to L-1 do + if W(I) = W0(I) then S:= S+1; + if S < SS then + [SS:= S; \save best score and best shuffle + for I:= 0 to L do SW(I):= W(I); + ]; + ]; +Text(0, W0); Text(0, ", "); \show original and shuffled words, score +Text(0, SW); Text(0, ", ("); IntOut(0, SS); ChOut(0, ^)); CrLf(0); +]; + +int S, I; +[S:= ["abracadabra", "seesaw", "elk", "grrrrrr", "up", "a"]; +for I:= 0 to 5 do Shuffle(S(I)); +] diff --git a/Task/Binary-search/BASIC/binary-search-1.bas b/Task/Binary-search/BASIC/binary-search-1.basic similarity index 100% rename from Task/Binary-search/BASIC/binary-search-1.bas rename to Task/Binary-search/BASIC/binary-search-1.basic diff --git a/Task/Binary-search/BASIC/binary-search-2.bas b/Task/Binary-search/BASIC/binary-search-2.basic similarity index 100% rename from Task/Binary-search/BASIC/binary-search-2.bas rename to Task/Binary-search/BASIC/binary-search-2.basic diff --git a/Task/Binary-search/BASIC/binary-search-3.bas b/Task/Binary-search/BASIC/binary-search-3.basic similarity index 100% rename from Task/Binary-search/BASIC/binary-search-3.bas rename to Task/Binary-search/BASIC/binary-search-3.basic diff --git a/Task/Binary-search/CoffeeScript/binary-search.coffee b/Task/Binary-search/CoffeeScript/binary-search.coffeescript similarity index 100% rename from Task/Binary-search/CoffeeScript/binary-search.coffee rename to Task/Binary-search/CoffeeScript/binary-search.coffeescript diff --git a/Task/Binary-search/MAXScript/binary-search-1.max b/Task/Binary-search/MAXScript/binary-search-1.maxscript similarity index 100% rename from Task/Binary-search/MAXScript/binary-search-1.max rename to Task/Binary-search/MAXScript/binary-search-1.maxscript diff --git a/Task/Binary-search/MAXScript/binary-search-2.max b/Task/Binary-search/MAXScript/binary-search-2.maxscript similarity index 100% rename from Task/Binary-search/MAXScript/binary-search-2.max rename to Task/Binary-search/MAXScript/binary-search-2.maxscript diff --git a/Task/Binary-search/Mathematica/binary-search-1.mathematica b/Task/Binary-search/Mathematica/binary-search-1.math similarity index 100% rename from Task/Binary-search/Mathematica/binary-search-1.mathematica rename to Task/Binary-search/Mathematica/binary-search-1.math diff --git a/Task/Binary-search/Mathematica/binary-search-2.mathematica b/Task/Binary-search/Mathematica/binary-search-2.math similarity index 100% rename from Task/Binary-search/Mathematica/binary-search-2.mathematica rename to Task/Binary-search/Mathematica/binary-search-2.math diff --git a/Task/Binary-search/Niue/binary-search.niue b/Task/Binary-search/Niue/binary-search.niue new file mode 100644 index 0000000000..c8e21fafcb --- /dev/null +++ b/Task/Binary-search/Niue/binary-search.niue @@ -0,0 +1,10 @@ +1 2 3 4 5 +3 bsearch . ( => 2 ) +5 bsearch . ( => 0 ) +'sam 'tom 'kenny ( must be sorted before calling bsearch ) +sort +.s ( => kenny sam tom ) +'sam bsearch . ( => 1 ) +'tom bsearch . ( => 0 ) +'kenny bsearch . ( => 2 ) +'tony bsearch . ( => -1) diff --git a/Task/Binary-search/OCaml/binary-search.ocaml b/Task/Binary-search/OCaml/binary-search.ocaml new file mode 100644 index 0000000000..80c290a876 --- /dev/null +++ b/Task/Binary-search/OCaml/binary-search.ocaml @@ -0,0 +1,13 @@ +let rec binary_search a value low high = + if high = low then + if a.(low) = value then + low + else + raise Not_found + else let mid = (low + high) / 2 in + if a.(mid) > value then + binary_search a value low (mid - 1) + else if a.(mid) < value then + binary_search a value (mid + 1) high + else + mid diff --git a/Task/Binary-search/Objeck/binary-search.objeck b/Task/Binary-search/Objeck/binary-search.objeck new file mode 100644 index 0000000000..32b23b1cee --- /dev/null +++ b/Task/Binary-search/Objeck/binary-search.objeck @@ -0,0 +1,32 @@ +use Structure; + +bundle Default { + class BinarySearch { + function : Main(args : String[]) ~ Nil { + values := [-1, 3, 8, 13, 22]; + DoBinarySearch(values, 13)->PrintLine(); + DoBinarySearch(values, 7)->PrintLine(); + } + + function : native : DoBinarySearch(values : Int[], value : Int) ~ Int { + low := 0; + high := values->Size() - 1; + + while(low <= high) { + mid := (low + high) / 2; + + if(values[mid] > value) { + high := mid - 1; + } + else if(values[mid] < value) { + low := mid + 1; + } + else { + return mid; + }; + }; + + return -1; + } + } +} diff --git a/Task/Binary-search/Objective-C/binary-search-1.m b/Task/Binary-search/Objective-C/binary-search-1.m new file mode 100644 index 0000000000..5a8cf26cbd --- /dev/null +++ b/Task/Binary-search/Objective-C/binary-search-1.m @@ -0,0 +1,51 @@ +#import + +@interface NSArray (BinarySearch) +// Requires all elements of this array to implement a -compare: method which +// returns a NSComparisonResult for comparison. +// Returns NSNotFound when not found +- (NSInteger) binarySearch:(id)key; +@end + +@implementation NSArray (BinarySearch) +- (NSInteger) binarySearch:(id)key { + NSInteger lo = 0; + NSInteger hi = [self count] - 1; + while (lo <= hi) { + NSInteger mid = lo + (hi - lo) / 2; + id midVal = [self objectAtIndex:mid]; + switch ([midVal compare:key]) { + case NSOrderedAscending: + lo = mid + 1; + break; + case NSOrderedDescending: + hi = mid - 1; + break; + case NSOrderedSame: + return mid; + } + } + return NSNotFound; +} +@end + +int main() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSArray *a = [NSArray arrayWithObjects: + [NSNumber numberWithInt: 1], + [NSNumber numberWithInt: 3], + [NSNumber numberWithInt: 4], + [NSNumber numberWithInt: 5], + [NSNumber numberWithInt: 6], + [NSNumber numberWithInt: 7], + [NSNumber numberWithInt: 8], + [NSNumber numberWithInt: 9], + [NSNumber numberWithInt: 10], + nil]; + NSLog(@"6 is at position %d", [a binarySearch:[NSNumber numberWithInt: 6]]); // prints 4 + + [pool drain]; + return 0; +} diff --git a/Task/Binary-search/Objective-C/binary-search-2.m b/Task/Binary-search/Objective-C/binary-search-2.m new file mode 100644 index 0000000000..6b0ad87c7d --- /dev/null +++ b/Task/Binary-search/Objective-C/binary-search-2.m @@ -0,0 +1,49 @@ +#import + +@interface NSArray (BinarySearchRecursive) +// Requires all elements of this array to implement a -compare: method which +// returns a NSComparisonResult for comparison. +// Returns NSNotFound when not found +- (NSInteger) binarySearch:(id)key inRange:(NSRange)range; +@end + +@implementation NSArray (BinarySearchRecursive) +- (NSInteger) binarySearch:(id)key inRange:(NSRange)range { + if (range.length == 0) + return NSNotFound; + NSInteger mid = range.location + range.length / 2; + id midVal = [self objectAtIndex:mid]; + switch ([midVal compare:key]) { + case NSOrderedAscending: + return [self binarySearch:key + inRange:NSMakeRange(mid + 1, NSMaxRange(range) - (mid + 1))]; + case NSOrderedDescending: + return [self binarySearch:key + inRange:NSMakeRange(range.location, mid - range.location)]; + default: + return mid; + } +} +@end + +int main() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSArray *a = [NSArray arrayWithObjects: + [NSNumber numberWithInt: 1], + [NSNumber numberWithInt: 3], + [NSNumber numberWithInt: 4], + [NSNumber numberWithInt: 5], + [NSNumber numberWithInt: 6], + [NSNumber numberWithInt: 7], + [NSNumber numberWithInt: 8], + [NSNumber numberWithInt: 9], + [NSNumber numberWithInt: 10], + nil]; + NSLog(@"6 is at position %d", [a binarySearch:[NSNumber numberWithInt: 6] + inRange:NSMakeRange(0, [a count])]); // prints 4 + + [pool drain]; + return 0; +} diff --git a/Task/Binary-search/Objective-C/binary-search-3.m b/Task/Binary-search/Objective-C/binary-search-3.m new file mode 100644 index 0000000000..adb7edb27b --- /dev/null +++ b/Task/Binary-search/Objective-C/binary-search-3.m @@ -0,0 +1,25 @@ +#import + +int main() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSArray *a = [NSArray arrayWithObjects: + [NSNumber numberWithInt: 1], + [NSNumber numberWithInt: 3], + [NSNumber numberWithInt: 4], + [NSNumber numberWithInt: 5], + [NSNumber numberWithInt: 6], + [NSNumber numberWithInt: 7], + [NSNumber numberWithInt: 8], + [NSNumber numberWithInt: 9], + [NSNumber numberWithInt: 10], + nil]; + NSLog(@"6 is at position %lu", [a indexOfObject:[NSNumber numberWithInt: 6] + inSortedRange:NSMakeRange(0, [a count]) + options:0 + usingComparator:^(id x, id y){ return [x compare: y]; }]); // prints 4 + + [pool drain]; + return 0; +} diff --git a/Task/Binary-search/Objective-C/binary-search-4.m b/Task/Binary-search/Objective-C/binary-search-4.m new file mode 100644 index 0000000000..06ebdd37ba --- /dev/null +++ b/Task/Binary-search/Objective-C/binary-search-4.m @@ -0,0 +1,30 @@ +#import + +CFComparisonResult myComparator(const void *x, const void *y, void *context) { + return [(id)x compare:(id)y]; +} + +int main() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSArray *a = [NSArray arrayWithObjects: + [NSNumber numberWithInt: 1], + [NSNumber numberWithInt: 3], + [NSNumber numberWithInt: 4], + [NSNumber numberWithInt: 5], + [NSNumber numberWithInt: 6], + [NSNumber numberWithInt: 7], + [NSNumber numberWithInt: 8], + [NSNumber numberWithInt: 9], + [NSNumber numberWithInt: 10], + nil]; + NSLog(@"6 is at position %d", CFArrayBSearchValues((CFArrayRef)a, + CFRangeMake(0, [a count]), + [NSNumber numberWithInt: 6], + myComparator, + NULL)); // prints 4 + + [pool drain]; + return 0; +} diff --git a/Task/Binary-search/Octave/binary-search-1.octave b/Task/Binary-search/Octave/binary-search-1.octave new file mode 100644 index 0000000000..18de0e6f23 --- /dev/null +++ b/Task/Binary-search/Octave/binary-search-1.octave @@ -0,0 +1,14 @@ +function i = binsearch_r(array, val, low, high) + if ( high < low ) + i = 0; + else + mid = floor((low + high) / 2); + if ( array(mid) > val ) + i = binsearch_r(array, val, low, mid-1); + elseif ( array(mid) < val ) + i = binsearch_r(array, val, mid+1, high); + else + i = mid; + endif + endif +endfunction diff --git a/Task/Binary-search/Octave/binary-search-2.octave b/Task/Binary-search/Octave/binary-search-2.octave new file mode 100644 index 0000000000..1e96a2ae44 --- /dev/null +++ b/Task/Binary-search/Octave/binary-search-2.octave @@ -0,0 +1,16 @@ +function i = binsearch(array, value) + low = 1; + high = numel(array); + i = 0; + while ( low <= high ) + mid = floor((low + high)/2); + if (array(mid) > value) + high = mid - 1; + elseif (array(mid) < value) + low = mid + 1; + else + i = mid; + return; + endif + endwhile +endfunction diff --git a/Task/Binary-search/Octave/binary-search-3.octave b/Task/Binary-search/Octave/binary-search-3.octave new file mode 100644 index 0000000000..e78fcb1661 --- /dev/null +++ b/Task/Binary-search/Octave/binary-search-3.octave @@ -0,0 +1,4 @@ +r = sort(discrete_rnd(10, [1:10], ones(10,1)/10)); +disp(r); +binsearch_r(r, 5, 1, numel(r)) +binsearch(r, 5) diff --git a/Task/Binary-search/Oz/binary-search-1.oz b/Task/Binary-search/Oz/binary-search-1.oz new file mode 100644 index 0000000000..1b86ce162a --- /dev/null +++ b/Task/Binary-search/Oz/binary-search-1.oz @@ -0,0 +1,21 @@ +declare + fun {BinarySearch Arr Val} + fun {Search Low High} + if Low > High then nil + else + Mid = (Low+High) div 2 + in + if Val < Arr.Mid then {Search Low Mid-1} + elseif Val > Arr.Mid then {Search Mid+1 High} + else [Mid] + end + end + end + in + {Search {Array.low Arr} {Array.high Arr}} + end + + A = {Tuple.toArray unit(2 3 5 6 8)} +in + {System.printInfo "searching 4: "} {Show {BinarySearch A 4}} + {System.printInfo "searching 8: "} {Show {BinarySearch A 8}} diff --git a/Task/Binary-search/Oz/binary-search-2.oz b/Task/Binary-search/Oz/binary-search-2.oz new file mode 100644 index 0000000000..74e0329765 --- /dev/null +++ b/Task/Binary-search/Oz/binary-search-2.oz @@ -0,0 +1,19 @@ +declare + fun {BinarySearch Arr Val} + Low = {NewCell {Array.low Arr}} + High = {NewCell {Array.high Arr}} + in + for while:@Low =< @High return:Return default:nil do + Mid = (@Low + @High) div 2 + in + if Val < Arr.Mid then High := Mid-1 + elseif Val > Arr.Mid then Low := Mid+1 + else {Return [Mid]} + end + end + end + + A = {Tuple.toArray unit(2 3 5 6 8)} +in + {System.printInfo "searching 4: "} {Show {BinarySearch A 4}} + {System.printInfo "searching 8: "} {Show {BinarySearch A 8}} diff --git a/Task/Binary-search/PARI-GP/binary-search.pari b/Task/Binary-search/PARI-GP/binary-search.pari new file mode 100644 index 0000000000..c747fcf150 --- /dev/null +++ b/Task/Binary-search/PARI-GP/binary-search.pari @@ -0,0 +1 @@ +setsearch(s, n) diff --git a/Task/Binary-search/PL-I/binary-search.pli b/Task/Binary-search/PL-I/binary-search.pli new file mode 100644 index 0000000000..5c9dc74ac8 --- /dev/null +++ b/Task/Binary-search/PL-I/binary-search.pli @@ -0,0 +1,16 @@ +/* A binary search of list A for element M */ +search: procedure (A, M) returns (fixed binary); + declare (A(*), M) fixed binary; + declare (l, r, mid) fixed binary; + + l = lbound(a,1)-1; r = hbound(A,1)+1; + do while (l+1 < r); + mid = (l+r)/2; + if A(mid) = M then return (mid); + if A(mid) < M then + L = mid; + else + R = mid; + end; + return (lbound(A,1)-1); +end search; diff --git a/Task/Binary-search/Pascal/binary-search-1.pascal b/Task/Binary-search/Pascal/binary-search-1.pascal new file mode 100644 index 0000000000..c9f9d1ea92 --- /dev/null +++ b/Task/Binary-search/Pascal/binary-search-1.pascal @@ -0,0 +1,25 @@ +function binary_search(element: real; list: array of real): integer; +var + l, m, h: integer; +begin + l := 0; + h := High(list) - 1; + binary_search := -1; + while l <= h do + begin + m := (l + h) div 2; + if list[m] > element then + begin + h := m - 1; + end + else if list[m] < element then + begin + l := m + 1; + end + else + begin + binary_search := m; + break; + end; + end; +end; diff --git a/Task/Binary-search/Pascal/binary-search-2.pascal b/Task/Binary-search/Pascal/binary-search-2.pascal new file mode 100644 index 0000000000..9f2f6d4438 --- /dev/null +++ b/Task/Binary-search/Pascal/binary-search-2.pascal @@ -0,0 +1,4 @@ +var + list: array[0 .. 9] of real; +// ... +indexof := binary_search(123, list); diff --git a/Task/Binary-search/Perl-6/binary-search-1.pl6 b/Task/Binary-search/Perl-6/binary-search-1.pl6 new file mode 100644 index 0000000000..eee577e23d --- /dev/null +++ b/Task/Binary-search/Perl-6/binary-search-1.pl6 @@ -0,0 +1,3 @@ +sub search (@a, Num $x --> Int) { + binary_search { $x <=> @a[$^i] }, 0, @a.end +} diff --git a/Task/Binary-search/Perl-6/binary-search-2.pl6 b/Task/Binary-search/Perl-6/binary-search-2.pl6 new file mode 100644 index 0000000000..94ccaa831d --- /dev/null +++ b/Task/Binary-search/Perl-6/binary-search-2.pl6 @@ -0,0 +1,11 @@ +sub binary_search (&p, Int $lo is copy, Int $hi is copy --> Int) { + until $lo > $hi { + my Int $mid = ($lo + $hi) div 2; + given p $mid { + when -1 { $hi = $mid - 1; } + when 1 { $lo = $mid + 1; } + default { return $mid; } + } + } + fail; +} diff --git a/Task/Binary-search/Perl-6/binary-search-3.pl6 b/Task/Binary-search/Perl-6/binary-search-3.pl6 new file mode 100644 index 0000000000..228d9586ac --- /dev/null +++ b/Task/Binary-search/Perl-6/binary-search-3.pl6 @@ -0,0 +1,9 @@ +sub binary_search (&p, Int $lo, Int $hi --> Int) { + $lo <= $hi or fail; + my Int $mid = ($lo + $hi) div 2; + given p $mid { + when -1 { binary_search &p, $lo, $mid - 1 } + when 1 { binary_search &p, $mid + 1, $hi } + default { $mid } + } +} diff --git a/Task/Binary-search/Pop11/binary-search-1.pop11 b/Task/Binary-search/Pop11/binary-search-1.pop11 new file mode 100644 index 0000000000..41264d09d2 --- /dev/null +++ b/Task/Binary-search/Pop11/binary-search-1.pop11 @@ -0,0 +1,21 @@ +define BinarySearch(A, value); + lvars low = 1, high = length(A), mid; + while low <= high do + (low + high) div 2 -> mid; + if A(mid) > value then + mid - 1 -> high; + elseif A(mid) < value then + mid + 1 -> low; + else + return(mid); + endif; + endwhile; + return("not_found"); +enddefine; + +/* Tests */ +lvars A = {2 3 5 6 8}; + +BinarySearch(A, 4) => +BinarySearch(A, 5) => +BinarySearch(A, 8) => diff --git a/Task/Binary-search/Pop11/binary-search-2.pop11 b/Task/Binary-search/Pop11/binary-search-2.pop11 new file mode 100644 index 0000000000..dd9d76486e --- /dev/null +++ b/Task/Binary-search/Pop11/binary-search-2.pop11 @@ -0,0 +1,16 @@ +define BinarySearch(A, value); + define do_it(low, high); + if high < low then + return("not_found"); + endif; + (low + high) div 2 -> mid; + if A(mid) > value then + do_it(low, mid-1); + elseif A(mid) < value then + do_it(mid+1, high); + else + mid; + endif; + enddefine; + do_it(1, length(A)); +enddefine; diff --git a/Task/Binary-search/PureBasic/binary-search.purebasic b/Task/Binary-search/PureBasic/binary-search.purebasic new file mode 100644 index 0000000000..5989b85464 --- /dev/null +++ b/Task/Binary-search/PureBasic/binary-search.purebasic @@ -0,0 +1,87 @@ +#Recursive = 0 ;recursive binary search method +#Iterative = 1 ;iterative binary search method +#NotFound = -1 ;search result if item not found + +;Recursive +Procedure R_BinarySearch(Array a(1), value, low, high) + Protected mid + If high < low + ProcedureReturn #NotFound + EndIf + + mid = (low + high) / 2 + If a(mid) > value + ProcedureReturn R_BinarySearch(a(), value, low, mid - 1) + ElseIf a(mid) < value + ProcedureReturn R_BinarySearch(a(), value, mid + 1, high) + Else + ProcedureReturn mid + EndIf +EndProcedure + +;Iterative +Procedure I_BinarySearch(Array a(1), value, low, high) + Protected mid + While low <= high + mid = (low + high) / 2 + If a(mid) > value + high = mid - 1 + ElseIf a(mid) < value + low = mid + 1 + Else + ProcedureReturn mid + EndIf + Wend + + ProcedureReturn #NotFound +EndProcedure + +Procedure search (Array a(1), value, method) + Protected idx + + Select method + Case #Iterative + idx = I_BinarySearch(a(), value, 0, ArraySize(a())) + Default + idx = R_BinarySearch(a(), value, 0, ArraySize(a())) + EndSelect + + Print(" Value " + Str(Value)) + If idx < 0 + PrintN(" not found") + Else + PrintN(" found at index " + Str(idx)) + EndIf +EndProcedure + + +#NumElements = 9 ;zero based count +Dim test(#NumElements) + +DataSection + Data.i 2, 3, 5, 6, 8, 10, 11, 15, 19, 20 +EndDataSection + +;fill the test array +For i = 0 To #NumElements + Read test(i) +Next + + +If OpenConsole() + + PrintN("Recursive search:") + search(test(), 4, #Recursive) + search(test(), 8, #Recursive) + search(test(), 20, #Recursive) + + PrintN("") + PrintN("Iterative search:") + search(test(), 4, #Iterative) + search(test(), 8, #Iterative) + search(test(), 20, #Iterative) + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + CloseConsole() +EndIf diff --git a/Task/Binary-search/Run-BASIC/binary-search.run b/Task/Binary-search/Run-BASIC/binary-search.run new file mode 100644 index 0000000000..3d8b49a0ac --- /dev/null +++ b/Task/Binary-search/Run-BASIC/binary-search.run @@ -0,0 +1,18 @@ +dim theArray(100) +global theArray +for i = 1 to 100 + theArray(i) = i +next i + +print binarySearch(80,30,90) + +FUNCTION binarySearch(val, lo, hi) + IF hi < lo THEN + binarySearch = 0 + ELSE + middle = (hi + lo) / 2 + if val < theArray(middle) then binarySearch = binarySearch(val, lo, middle-1) + if val > theArray(middle) then binarySearch = binarySearch(val, middle+1, hi) + if val = theArray(middle) then binarySearch = middle + END IF +END FUNCTION diff --git a/Task/Binary-search/SPARK/binary-search-1.spark b/Task/Binary-search/SPARK/binary-search-1.spark new file mode 100644 index 0000000000..a0b92e43eb --- /dev/null +++ b/Task/Binary-search/SPARK/binary-search-1.spark @@ -0,0 +1,97 @@ +package Binary_Searches is + + subtype Item_Type is Integer; -- From specs. + subtype Index_Type is Integer range 1 .. 100; + type Array_Type is array (Index_Type range <>) of Item_Type; + + procedure Search (Source : in Array_Type; + Item : in Item_Type; + Found : out Boolean; + Position : out Index_Type); + --# derives Found, + --# Position from + --# Source, + --# Item; + --# post Found -> Source (Position) = Item; + -- If Found is False then Position is undefined. + +end Binary_Searches; + + +package body Binary_Searches is + + procedure Search (Source : in Array_Type; + Item : in Item_Type; + Found : out Boolean; + Position : out Index_Type) + is + Lower : Index_Type; -- Lower bound of Subrange. + Upper : Index_Type; -- Upper bound of Subrange. + Terminated : Boolean; + begin + Found := False; + -- Default status updated on success. + + Lower := Source'First; + Upper := Source'Last; + Position := (Lower + Upper) / 2; + Terminated := False; + + while not Terminated loop + --# assert Lower >= Source'First + --# and Upper <= Source'Last + --# and Position in Lower .. Upper + --# and not Found; + if Item < Source (Position) then + if Position = Lower then + -- No lower subrange. + Terminated := True; + else + --# check Position > Lower; + -- For the two following proofs. + + --# check Position - 1 >= Lower; + --# check Lower + Position - 1 >= Lower * 2; + --# check (Lower + Position - 1) / 2 >= Lower; + -- For "Position >= Lower" in loop assertion. + + --# check Lower < Position; + --# check Lower + Position - 1 <= (Position - 1) * 2; + --# check (Lower + Position - 1) / 2 <= (Position - 1); + -- For "Position <= Upper" in loop assertion. + + -- Switch to lower half subrange. + Upper := Position - 1; + Position := (Lower + Upper) / 2; + end if; + + elsif Item > Source (Position) then + if Position = Upper then + -- No upper subrange. + Terminated := True; + else + --# check Position < Upper; + -- For the two following proofs. + + --# check Upper >= Position + 1; + --# check Position + 1 + Upper >= (Position + 1) * 2; + --# check (Position + 1 + Upper) / 2 >= (Position + 1); + -- For "Position >= Lower" in loop assertion. + + --# check Position + 1 <= Upper; + --# check Position + 1 + Upper <= Upper * 2; + --# check (Position + 1 + Upper) / 2 <= Upper; + -- For "Position <= Upper" in loop assertion. + + -- Switch to upper half subrange. + Lower := Position + 1; + Position := (Lower + Upper) / 2; + end if; + else + Found := True; + Terminated := True; + end if; + end loop; + end Search; + +end Binary_Searches; diff --git a/Task/Binary-search/SPARK/binary-search-2.spark b/Task/Binary-search/SPARK/binary-search-2.spark new file mode 100644 index 0000000000..654808167e --- /dev/null +++ b/Task/Binary-search/SPARK/binary-search-2.spark @@ -0,0 +1,90 @@ +package Binary_Searches is + + subtype Item_Type is Integer; -- From specs. + subtype Index_Type is Integer range 1 .. 100; + type Array_Type is array (Index_Type range <>) of Item_Type; + + -- Ordered_Between is a 'proof function'. It does not have a code + -- body, but its meaning is defined by a proof rule: + -- + -- Ordered_Between (Source, Low_Bound, High_Bound) + -- <-> + -- for all I in Index_Type range Low_Bound .. High_Bound - 1 => + -- (Source(I) < Source(I + 1)) ; + -- + --# function Ordered_Between (Source : Array_Type; + --# Range_From, Range_To : Index_Type) + --# return Boolean; + + procedure Search (Source : in Array_Type; + Item : in Item_Type; + Found : out Boolean; + Position : out Index_Type); + --# derives Found, + --# Position from + --# Source, + --# Item; + --# pre Ordered_Between (Source, Source'First, Source'Last); + --# post (Found -> (Source (Position) = Item)) + --# and (not Found -> + --# (for all I in Index_Type range Source'Range + --# => (Source(I) /= Item))); + +end Binary_Searches; + + +package body Binary_Searches is + + procedure Search (Source : in Array_Type; + Item : in Item_Type; + Found : out Boolean; + Position : out Index_Type) + is + Lower : Index_Type; -- Lower bound of Subrange. + Upper : Index_Type; -- Upper bound of Subrange. + Terminated : Boolean; + begin + Found := False; + -- Default status updated on success. + + Lower := Source'First; + Upper := Source'Last; + Position := (Lower + Upper) / 2; + Terminated := False; + + while not Terminated loop + --# assert not Terminated + --# and not Found + --# and Lower >= Source'First + --# and Upper <= Source'Last + --# and Position in Lower .. Upper + --# and (Lower = Source'First or + --# (Lower > Source'First and Source(Lower - 1) < Item)) + --# and (Upper = Source'Last or + --# (Upper < Source'Last and Source(Upper + 1) > Item)); + if Item < Source (Position) then + if Position = Lower then + -- No lower subrange. + Terminated := True; + else + -- Switch to lower half subrange. + Upper := Position - 1; + Position := (Lower + Upper) / 2; + end if; + elsif Item > Source (Position) then + if Position = Upper then + -- No upper subrange. + Terminated := True; + else + -- Switch to upper half subrange. + Lower := Position + 1; + Position := (Lower + Upper) / 2; + end if; + else + Found := True; + Terminated := True; + end if; + end loop; + end Search; + +end Binary_Searches; diff --git a/Task/Binary-search/SPARK/binary-search-3.spark b/Task/Binary-search/SPARK/binary-search-3.spark new file mode 100644 index 0000000000..fd4da6fce7 --- /dev/null +++ b/Task/Binary-search/SPARK/binary-search-3.spark @@ -0,0 +1,84 @@ +with Binary_Searches; +with SPARK_IO; + +--# inherit Binary_Searches, +--# SPARK_IO; + +--# main_program; +procedure Test_Binary_Search +--# global in out SPARK_IO.Outputs; +--# derives SPARK_IO.Outputs from *; +is + + subtype Index_Type5 is Binary_Searches.Index_Type range 1 .. 5; + subtype Index_Type7 is Binary_Searches.Index_Type range 1 .. 7; + subtype Index_Type9 is Binary_Searches.Index_Type range 91 .. 99; + -- Needed to define a constrained Array_Type. + + subtype Array_Type5 is Binary_Searches.Array_Type (Index_Type5); + subtype Array_Type7 is Binary_Searches.Array_Type (Index_Type7); + subtype Array_Type9 is Binary_Searches.Array_Type (Index_Type9); + -- Needed to pass an array literal to Run_Search. + -- SPARK does not allow an unconstrained type mark for that purpose. + + procedure Run_Search (Source : in Binary_Searches.Array_Type; + Item : in Binary_Searches.Item_Type) + --# global in out SPARK_IO.Outputs; + --# derives SPARK_IO.Outputs from *, + --# Item, + --# Source; + is + Found : Boolean; + Position : Binary_Searches.Index_Type; + begin + SPARK_IO.Put_String (File => SPARK_IO.Standard_Output, + Item => "Searching for ", + Stop => 0); + SPARK_IO.Put_Integer (File => SPARK_IO.Standard_Output, + Item => Item, + Width => 3, + Base => 10); + SPARK_IO.Put_String (File => SPARK_IO.Standard_Output, + Item => " in (", + Stop => 0); + for Source_Index in Binary_Searches.Index_Type range Source'Range loop + SPARK_IO.Put_Integer (File => SPARK_IO.Standard_Output, + Item => Source (Source_Index), + Width => 3, + Base => 10); + end loop; + SPARK_IO.Put_String (File => SPARK_IO.Standard_Output, + Item => "): ", + Stop => 0); + Binary_Searches.Search (Source => Source, -- in + Item => Item, -- in + Found => Found, -- out + Position => Position); -- out + if Found then + SPARK_IO.Put_String (File => SPARK_IO.Standard_Output, + Item => "found as #", + Stop => 0); + SPARK_IO.Put_Integer (File => SPARK_IO.Standard_Output, + Item => Position, + Width => 0, -- to stick to the sibling '#' sign. + Base => 10); + SPARK_IO.Put_Line (File => SPARK_IO.Standard_Output, + Item => ".", + Stop => 0); + else + SPARK_IO.Put_Line (File => SPARK_IO.Standard_Output, + Item => "not found.", + Stop => 0); + end if; + end Run_Search; + +begin + SPARK_IO.New_Line (File => SPARK_IO.Standard_Output, Spacing => 1); + Run_Search (Source => Array_Type5'(0, 1, 2, 3, 4), Item => 3); + Run_Search (Source => Array_Type5'(2, 4, 6, 8, 10), Item => 3); + Run_Search (Source => Array_Type7'(1, 2, 3, 4, 5, 6, 7), Item => 0); + Run_Search (Source => Array_Type7'(1, 2, 3, 4, 5, 6, 7), Item => 7); + Run_Search (Source => Array_Type9'(1, 2, 3, 4, 5, 6, 7, 8, 9), Item => 10); + Run_Search (Source => Array_Type9'(1, 2, 3, 4, 5, 6, 7, 8, 9), Item => 1); + Run_Search (Source => Array_Type9'(1, 2, 3, 4, 5, 6, 7, 8, 9), Item => 6); +end Test_Binary_Search; diff --git a/Task/Binary-search/Seed7/binary-search-1.seed7 b/Task/Binary-search/Seed7/binary-search-1.seed7 new file mode 100644 index 0000000000..55703806af --- /dev/null +++ b/Task/Binary-search/Seed7/binary-search-1.seed7 @@ -0,0 +1,20 @@ +const func integer: binarySearchIterative (in array elemType: arr, in elemType: aKey) is func + result + var integer: result is 0; + local + var integer: low is 1; + var integer: high is 0; + var integer: middle is 0; + begin + high := length(arr); + while result = 0 and low <= high do + middle := low + (high - low) div 2; + if aKey < arr[middle] then + high := pred(middle); + elsif aKey > arr[middle] then + low := succ(middle); + else + result := middle; + end if; + end while; + end func; diff --git a/Task/Binary-search/Seed7/binary-search-2.seed7 b/Task/Binary-search/Seed7/binary-search-2.seed7 new file mode 100644 index 0000000000..2b1eeeffac --- /dev/null +++ b/Task/Binary-search/Seed7/binary-search-2.seed7 @@ -0,0 +1,16 @@ +const func integer: binarySearch (in array elemType: arr, in elemType: aKey, in integer: low, in integer: high) is func + result + var integer: result is 0; + begin + if low <= high then + result := (low + high) div 2; + if aKey < arr[result] then + result := binarySearch(arr, aKey, low, pred(result)); # search left + elsif aKey > arr[result] then + result := binarySearch(arr, aKey, succ(result), high); # search right + end if; + end if; + end func; + +const func integer: binarySearchRecursive (in array elemType: arr, in elemType: aKey) is + return binarySearch(arr, aKey, 1, length(arr)); diff --git a/Task/Binary-search/Standard-ML/binary-search.ml b/Task/Binary-search/Standard-ML/binary-search.ml new file mode 100644 index 0000000000..ccbcb939cf --- /dev/null +++ b/Task/Binary-search/Standard-ML/binary-search.ml @@ -0,0 +1,17 @@ +fun binary_search cmp (key, arr) = + let + fun aux slice = + if ArraySlice.isEmpty slice then + NONE + else + let + val mid = ArraySlice.length slice div 2 + in + case cmp (ArraySlice.sub (slice, mid), key) + of LESS => aux (ArraySlice.subslice (slice, mid+1, NONE)) + | GREATER => aux (ArraySlice.subslice (slice, 0, SOME mid)) + | EQUAL => SOME (#2 (ArraySlice.base slice) + mid) + end + in + aux (ArraySlice.full arr) + end diff --git a/Task/Binary-search/UnixPipes/binary-search.unixpipes b/Task/Binary-search/UnixPipes/binary-search.unixpipes new file mode 100644 index 0000000000..7ed53b1d52 --- /dev/null +++ b/Task/Binary-search/UnixPipes/binary-search.unixpipes @@ -0,0 +1,18 @@ +splitter() { + a=$1; s=$2; l=$3; r=$4; + mid=$(expr ${#a[*]} / 2); + echo $s ${a[*]:0:$mid} > $l + echo $(($mid + $s)) ${a[*]:$mid} > $r +} + +bsearch() { + (to=$1; read s arr; a=($arr); + test ${#a[*]} -gt 1 && (splitter $a $s >(bsearch $to) >(bsearch $to)) || (test "$a" -eq "$to" && echo $a at $s) + ) +} + +binsearch() { + (read arr; echo "0 $arr" | bsearch $1) +} + +echo "1 2 3 4 6 7 8 9" | binsearch 6 diff --git a/Task/Binary-search/VBA/binary-search-1.vba b/Task/Binary-search/VBA/binary-search-1.vba new file mode 100644 index 0000000000..01f676dd95 --- /dev/null +++ b/Task/Binary-search/VBA/binary-search-1.vba @@ -0,0 +1,17 @@ +Public Function BinarySearch(a, value, low, high) +'search for "value" in ordered array a(low..high) +'return index point if found, -1 if not found + + If high < low Then + BinarySearch = -1 'not found + Exit Function + End If + midd = low + Int((high - low) / 2) ' "midd" because "Mid" is reserved in VBA + If a(midd) > value Then + BinarySearch = BinarySearch(a, value, low, midd - 1) + ElseIf a(midd) < value Then + BinarySearch = BinarySearch(a, value, midd + 1, high) + Else + BinarySearch = midd + End If +End Function diff --git a/Task/Binary-search/VBA/binary-search-2.vba b/Task/Binary-search/VBA/binary-search-2.vba new file mode 100644 index 0000000000..f67a9059b9 --- /dev/null +++ b/Task/Binary-search/VBA/binary-search-2.vba @@ -0,0 +1,13 @@ +Public Sub testBinarySearch(n) +Dim a(1 To 100) +'create an array with values = multiples of 10 +For i = 1 To 100: a(i) = i * 10: Next +Debug.Print BinarySearch(a, n, LBound(a), UBound(a)) +End Sub + +Public Sub stringtestBinarySearch(w) +'uses BinarySearch with a string array +Dim a +a = Array("AA", "Maestro", "Mario", "Master", "Mattress", "Mister", "Mistress", "ZZ") +Debug.Print BinarySearch(a, w, LBound(a), UBound(a)) +End Sub diff --git a/Task/Binary-search/VBA/binary-search-3.vba b/Task/Binary-search/VBA/binary-search-3.vba new file mode 100644 index 0000000000..ff32186aa3 --- /dev/null +++ b/Task/Binary-search/VBA/binary-search-3.vba @@ -0,0 +1,19 @@ +Public Function BinarySearch2(a, value) +'search for "value" in array a +'return index point if found, -1 if not found + + low = LBound(a) + high = UBound(a) + Do While low <= high + midd = low + Int((high - low) / 2) + If a(midd) = value Then + BinarySearch2 = midd + Exit Function + ElseIf a(midd) > value Then + high = midd - 1 + Else + low = midd + 1 + End If + Loop + BinarySearch2 = -1 'not found +End Function diff --git a/Task/Binary-search/Vedit-macro-language/binary-search.vedit b/Task/Binary-search/Vedit-macro-language/binary-search.vedit new file mode 100644 index 0000000000..ba162a91ab --- /dev/null +++ b/Task/Binary-search/Vedit-macro-language/binary-search.vedit @@ -0,0 +1,30 @@ +// Main program for testing BINARY_SEARCH +#3 = Get_Num("Value to search: ") +EOF +#2 = Cur_Line // hi +#1 = 1 // lo +Call("BINARY_SEARCH") +Message("Value ") Num_Type(#3, NOCR) +if (Return_Value < 1) { + Message(" not found\n") +} else { + Message(" found at index ") Num_Type(Return_Value) +} +return + +:BINARY_SEARCH: +while (#1 <= #2) { + #12 = (#1 + #2) / 2 + Goto_Line(#12) + #11 = Num_Eval() + if (#3 == #11) { + return(#12) // found + } else { + if (#3 < #11) { + #2 = #12-1 + } else { + #1 = #12+1 + } + } +} +return(0) // not found diff --git a/Task/Binary-search/Visual-Basic-.NET/binary-search-1.visual b/Task/Binary-search/Visual-Basic-.NET/binary-search-1.visual new file mode 100644 index 0000000000..1bd54ff28a --- /dev/null +++ b/Task/Binary-search/Visual-Basic-.NET/binary-search-1.visual @@ -0,0 +1,18 @@ +Function BinarySearch(ByVal A() As Integer, ByVal value As Integer) As Integer + Dim low As Integer = 0 + Dim high As Integer = A.Length - 1 + Dim middle As Integer = 0 + + While low <= high + middle = (low + high) / 2 + If A(middle) > value Then + high = middle - 1 + ElseIf A(middle) < value Then + low = middle + 1 + Else + Return middle + End If + End While + + Return Nothing +End Function diff --git a/Task/Binary-search/Visual-Basic-.NET/binary-search-2.visual b/Task/Binary-search/Visual-Basic-.NET/binary-search-2.visual new file mode 100644 index 0000000000..cbb3f3a69d --- /dev/null +++ b/Task/Binary-search/Visual-Basic-.NET/binary-search-2.visual @@ -0,0 +1,17 @@ +Function BinarySearch(ByVal A() As Integer, ByVal value As Integer, ByVal low As Integer, ByVal high As Integer) As Integer + Dim middle As Integer = 0 + + If high < low Then + Return Nothing + End If + + middle = (low + high) / 2 + + If A(middle) > value Then + Return BinarySearch(A, value, low, middle - 1) + ElseIf A(middle) < value Then + Return BinarySearch(A, value, middle + 1, high) + Else + Return middle + End If +End Function diff --git a/Task/Binary-strings/BASIC/binary-strings.bas b/Task/Binary-strings/BASIC/binary-strings.basic similarity index 100% rename from Task/Binary-strings/BASIC/binary-strings.bas rename to Task/Binary-strings/BASIC/binary-strings.basic diff --git a/Task/Binary-strings/Mathematica/binary-strings.mathematica b/Task/Binary-strings/Mathematica/binary-strings.math similarity index 100% rename from Task/Binary-strings/Mathematica/binary-strings.mathematica rename to Task/Binary-strings/Mathematica/binary-strings.math diff --git a/Task/Binary-strings/OCaml/binary-strings-1.ocaml b/Task/Binary-strings/OCaml/binary-strings-1.ocaml new file mode 100644 index 0000000000..73665f059a --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-1.ocaml @@ -0,0 +1,2 @@ +# String.create 10 ;; +- : string = "\000\023\000\000\001\000\000\000\000\000" diff --git a/Task/Binary-strings/OCaml/binary-strings-10.ocaml b/Task/Binary-strings/OCaml/binary-strings-10.ocaml new file mode 100644 index 0000000000..20607ee78b --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-10.ocaml @@ -0,0 +1,2 @@ +# "Now just remind me" ^ " how the horse moves again?" ;; +- : string = "Now just remind me how the horse moves again?" diff --git a/Task/Binary-strings/OCaml/binary-strings-2.ocaml b/Task/Binary-strings/OCaml/binary-strings-2.ocaml new file mode 100644 index 0000000000..d722073cd3 --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-2.ocaml @@ -0,0 +1,6 @@ +# let str = "some text" ;; +val str : string = "some text" + +(* modifying a character, OCaml strings are mutable *) +# str.[0] <- 'S' ;; +- : unit = () diff --git a/Task/Binary-strings/OCaml/binary-strings-3.ocaml b/Task/Binary-strings/OCaml/binary-strings-3.ocaml new file mode 100644 index 0000000000..ff5fbea0d6 --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-3.ocaml @@ -0,0 +1,5 @@ +# str = "Some text" ;; +- : bool = true + +# "Hello" > "Ciao" ;; +- : bool = true diff --git a/Task/Binary-strings/OCaml/binary-strings-4.ocaml b/Task/Binary-strings/OCaml/binary-strings-4.ocaml new file mode 100644 index 0000000000..a1c0746db4 --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-4.ocaml @@ -0,0 +1,2 @@ +# String.copy str ;; +- : string = "Some text" diff --git a/Task/Binary-strings/OCaml/binary-strings-5.ocaml b/Task/Binary-strings/OCaml/binary-strings-5.ocaml new file mode 100644 index 0000000000..78e2812f08 --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-5.ocaml @@ -0,0 +1,8 @@ +# let string_is_empty s = (s = "") ;; +val string_is_empty : string -> bool = + +# string_is_empty str ;; +- : bool = false + +# string_is_empty "" ;; +- : bool = true diff --git a/Task/Binary-strings/OCaml/binary-strings-6.ocaml b/Task/Binary-strings/OCaml/binary-strings-6.ocaml new file mode 100644 index 0000000000..a9febcccdf --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-6.ocaml @@ -0,0 +1,2 @@ +# str ^ "!" ;; +- : string = "Some text!" diff --git a/Task/Binary-strings/OCaml/binary-strings-7.ocaml b/Task/Binary-strings/OCaml/binary-strings-7.ocaml new file mode 100644 index 0000000000..19b57349a9 --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-7.ocaml @@ -0,0 +1 @@ +Buffer.add_char str c diff --git a/Task/Binary-strings/OCaml/binary-strings-8.ocaml b/Task/Binary-strings/OCaml/binary-strings-8.ocaml new file mode 100644 index 0000000000..af7f751053 --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-8.ocaml @@ -0,0 +1,2 @@ +# String.sub str 5 4 ;; +- : string = "text" diff --git a/Task/Binary-strings/OCaml/binary-strings-9.ocaml b/Task/Binary-strings/OCaml/binary-strings-9.ocaml new file mode 100644 index 0000000000..5bc0e9a8e9 --- /dev/null +++ b/Task/Binary-strings/OCaml/binary-strings-9.ocaml @@ -0,0 +1,7 @@ +# #load "str.cma";; +# let replace str occ by = + Str.global_replace (Str.regexp_string occ) by str + ;; +val replace : string -> string -> string -> string = +# replace "The white dog let out a single, loud bark." "white" "black" ;; +- : string = "The black dog let out a single, loud bark." diff --git a/Task/Binary-strings/PL-I/binary-strings.pli b/Task/Binary-strings/PL-I/binary-strings.pli new file mode 100644 index 0000000000..e59750f5d5 --- /dev/null +++ b/Task/Binary-strings/PL-I/binary-strings.pli @@ -0,0 +1,22 @@ +/* PL/I has immediate facilities for all those operations except for */ +/* replace. */ +s = t; /* assignment */ +s = t || u; /* catenation - append one or more bytes. */ +if length(s) = 0 then ... /* test for an empty string. */ +if s = t then ... /* compare strings. */ +u = substr(t, i, j); /* take a substring of t beginning at the */ + /* i-th character andcontinuing for j */ + /* characters. */ +substr(u, i, j) = t; /* replace j characters in u, beginning */ + /* with the i-th character. */ + +/* In string t, replace every occurrence of string u with string v. */ +replace: procedure (t, u, v); + declare (t, u, v) character (*) varying; + + do until (k = 0); + k = index(t, u); + if k > 0 then + t = substr(t, 1, k-1) || v || substr(t, k+length(u)); + end; +end replace; diff --git a/Task/Binary-strings/Pascal/binary-strings.pascal b/Task/Binary-strings/Pascal/binary-strings.pascal new file mode 100644 index 0000000000..71bf3979cf --- /dev/null +++ b/Task/Binary-strings/Pascal/binary-strings.pascal @@ -0,0 +1,26 @@ +const + greeting = 'Hello'; +var + s1: string; + s2: ansistring; + s3: pchar; +begin +{ Assignments } + s1 := 'Mister Presiden'; (* typo is on purpose. See below! *) +{ Comparisons } + if s2 > 'a' then + writeln ('The first letter of ', s1, ' is later than a'); +{ Cloning and copying } + s2 := greeting; +{ Check if a string is empty } + if s1 = '' then + writeln('This string is empty!'); +{ Append a byte to a string } + s1 := s1 + 't'; +{ Extract a substring from a string } + s3 := copy(S2, 2, 4); (* s3 receives ello *) +{ String replacement } (* the unit StrUtils of the FreePascal rtl has AnsiReplaceStr *) + s1 := AnsiReplaceStr('Thees ees a text weeth typos', 'ee', 'i'); +{ Join strings} + s3 := greeting + ' and how are you, ' + s1 + '?'; +end. diff --git a/Task/Binary-strings/Perl-6/binary-strings.pl6 b/Task/Binary-strings/Perl-6/binary-strings.pl6 new file mode 100644 index 0000000000..3fee0cf4c9 --- /dev/null +++ b/Task/Binary-strings/Perl-6/binary-strings.pl6 @@ -0,0 +1,83 @@ +# Perl 6 is perfectly fine with NUL *characters* in strings: + +my Str $s = 'nema' ~ 0.chr ~ 'problema!'; +say $s; + +# However, Perl 6 makes a clear distinction between strings +# (i.e. sequences of characters), like your name, or … +my Str $str = "My God, it's full of chars!"; +# … and sequences of bytes (called Bufs), for example a PNG image, or … +my Buf $buf = Buf.new(255, 0, 1, 2, 3); +say $buf; + +# Strs can be encoded into Bufs … +my Buf $this = 'foo'.encode('ascii'); +# … and Bufs can be decoded into Strs … +my Str $that = $this.decode('ascii'); + +# So it's all there. Nevertheless, let's solve this task explicitly +# in order to see some nice language features: + +# We define a class … +class ByteStr { + # … that keeps an array of bytes, and we delegate some + # straight-forward stuff directly to this attribute: + # (Note: "has byte @.bytes" would be nicer, but that is + # not yet implemented in rakudo or niecza.) + has Int @.bytes handles(< Bool elems gist push >); + + # A handful of methods … + method clone() { + self.new(:@.bytes); + } + + method substr(Int $pos, Int $length) { + self.new(:bytes(@.bytes[$pos .. $pos + $length - 1])); + } + + method replace(*@substitutions) { + my %h = @substitutions; + @.bytes.=map: { %h{$_} // $_ } + } +} + +# A couple of operators for our new type: +multi infix:(ByteStr $x, ByteStr $y) { $x.bytes cmp $y.bytes } +multi infix:<~> (ByteStr $x, ByteStr $y) { ByteStr.new(:bytes($x.bytes, $y.bytes)) } + +# create some byte strings (destruction not needed due to garbage collection) +my ByteStr $b0 = ByteStr.new; +my ByteStr $b1 = ByteStr.new(:bytes( 'foo'.ords, 0, 10, 'bar'.ords )); + +# assignment ($b1 and $b2 contain the same ByteStr object afterwards): +my ByteStr $b2 = $b1; + +# comparing: +say 'b0 cmp b1 = ', $b0 cmp $b1; +say 'b1 cmp b2 = ', $b1 cmp $b2; + +# cloning: +my $clone = $b1.clone; +$b1.replace('o'.ord => 0); +say 'b1 = ', $b1; +say 'b2 = ', $b2; +say 'clone = ', $clone; + +# to check for (non-)emptiness we evaluate the ByteStr in boolean context: +say 'b0 is ', $b0 ?? 'not empty' !! 'empty'; +say 'b1 is ', $b1 ?? 'not empty' !! 'empty'; + +# appending a byte: +$b1.push: 123; + +# extracting a substring: +my $sub = $b1.substr(2, 4); +say 'sub = ', $sub; + +# replacing a byte: +$b2.replace(102 => 103); +say $b2; + +# joining: +my ByteStr $b3 = $b1 ~ $sub; +say 'joined = ', $b3; diff --git a/Task/Binary-strings/PureBasic/binary-strings.purebasic b/Task/Binary-strings/PureBasic/binary-strings.purebasic new file mode 100644 index 0000000000..6222cb43d5 --- /dev/null +++ b/Task/Binary-strings/PureBasic/binary-strings.purebasic @@ -0,0 +1,26 @@ +;string creation +x$ = "hello world" + +;string destruction +x$ = "" + +;string comparison +If x$ = "hello world" : PrintN("String is equal") : EndIf + +;string copying; +y$ = x$ + +; check If empty +If x$ = "" : PrintN("String is empty") : EndIf + +; append a byte +x$ = x$ + Chr(41) + +; extract a substring +x$ = Mid(x$, 1, 5) + +; replace bytes +x$ = ReplaceString(x$, "world", "earth") + +; join strings +x$ = "hel" + "lo w" + "orld" diff --git a/Task/Binary-strings/Run-BASIC/binary-strings.run b/Task/Binary-strings/Run-BASIC/binary-strings.run new file mode 100644 index 0000000000..3f859a33ad --- /dev/null +++ b/Task/Binary-strings/Run-BASIC/binary-strings.run @@ -0,0 +1,33 @@ +' Create string +s$ = "Hello, world" + +' String destruction +s$ = "" + +' String comparison +If s$ = "Hello, world" then print "Equal String" + +' Copying string +a$ = s$ + +' Check If empty +If s$ = "" then print "String is MT" + +' Append a byte +s$ = s$ + Chr$(65) + +' Extract a substring +a$ = Mid$(s$, 1, 5) ' bytes 1 -> 5 + +'substitute string "world" with "universe" +a$ = "Hello, world" +for i = 1 to len(a$) + if mid$(a$,i,5)="world" then + a$=left$(a$,i-1)+"universe"+mid$(a$,i+5) + end if +next +print a$ + +'join strings +s$ = "See " + "you " + "later." +print s$ diff --git a/Task/Bitcoin-address-validation/Perl-6/bitcoin-address-validation.pl6 b/Task/Bitcoin-address-validation/Perl-6/bitcoin-address-validation.pl6 new file mode 100644 index 0000000000..0b08155fe5 --- /dev/null +++ b/Task/Bitcoin-address-validation/Perl-6/bitcoin-address-validation.pl6 @@ -0,0 +1,25 @@ +enum B58 < + 1 2 3 4 5 6 7 8 9 + A B C D E F G H J K L M N P Q R S T U V W X Y Z + a b c d e f g h i j k m n o p q r s t u v w x y z +>; + +sub unbase58(Str $str) { + my @out = 0 xx 25; + for B58.enums.hash{$str.comb} { + my $c = $_; + for reverse ^25 { + $c += 58 * @out[$_]; + @out[$_] = $c % 256; + $c div= 256; + } + } + return @out; +} + +sub check-bitcoin-address($addr) { + use Digest; + my @byte = unbase58 $addr; + !!! 'wrong checksum' unless @byte[21..24] ~~ + sha256(sha256 Buf.new: @byte[0..20]).subbuf(0, 4).list; +} diff --git a/Task/Bitcoin-address-validation/UNIX-Shell/bitcoin-address-validation.sh b/Task/Bitcoin-address-validation/UNIX-Shell/bitcoin-address-validation.sh new file mode 100644 index 0000000000..a0e0727754 --- /dev/null +++ b/Task/Bitcoin-address-validation/UNIX-Shell/bitcoin-address-validation.sh @@ -0,0 +1,28 @@ +base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z}) +bitcoinregex="^[$(printf "%s" "${base58[@]}")]{34}$" + +decodeBase58() { + local s=$1 + for i in {0..57} + do s="${s//${base58[i]}/ $i}" + done + dc <<< "16o0d${s// /+58*}+f" +} + +checksum() { + xxd -p -r <<<"$1" | + openssl dgst -sha256 -binary | + openssl dgst -sha256 -binary | + xxd -p -c 80 | + head -c 8 +} + +checkBitcoinAddress() { + if [[ "$1" =~ $bitcoinregex ]] + then + h=$(decodeBase58 "$1") + checksum "00${h::${#h}-8}" | + grep -qi "^${h: -8}$" + else return 2 + fi +} diff --git a/Task/Bitmap-B-zier-curves-Cubic/Mathematica/bitmap-b-zier-curves-cubic.mathematica b/Task/Bitmap-B-zier-curves-Cubic/Mathematica/bitmap-b-zier-curves-cubic.math similarity index 100% rename from Task/Bitmap-B-zier-curves-Cubic/Mathematica/bitmap-b-zier-curves-cubic.mathematica rename to Task/Bitmap-B-zier-curves-Cubic/Mathematica/bitmap-b-zier-curves-cubic.math diff --git a/Task/Bitmap-B-zier-curves-Cubic/OCaml/bitmap-b-zier-curves-cubic.ocaml b/Task/Bitmap-B-zier-curves-Cubic/OCaml/bitmap-b-zier-curves-cubic.ocaml new file mode 100644 index 0000000000..f30184af03 --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Cubic/OCaml/bitmap-b-zier-curves-cubic.ocaml @@ -0,0 +1,44 @@ +let cubic_bezier ~img ~color + ~p1:(_x1, _y1) + ~p2:(_x2, _y2) + ~p3:(_x3, _y3) + ~p4:(_x4, _y4) = + let x1, y1, x2, y2, x3, y3, x4, y4 = + (float _x1, float _y1, + float _x2, float _y2, + float _x3, float _y3, + float _x4, float _y4) + in + let bz t = + let a = (1.0 -. t) ** 3.0 + and b = 3.0 *. t *. ((1.0 -. t) ** 2.0) + and c = 3.0 *. (t ** 2.0) *. (1.0 -. t) + and d = t ** 3.0 + in + let x = a *. x1 +. b *. x2 +. c *. x3 +. d *. x4 + and y = a *. y1 +. b *. y2 +. c *. y3 +. d *. y4 + in + (int_of_float x, int_of_float y) + in + let rec loop _t acc = + if _t > 20 then acc else + begin + let t = (float _t) /. 20.0 in + let x, y = bz t in + loop (succ _t) ((x,y)::acc) + end + in + let pts = loop 0 [] in + + (* + (* draw only points *) + List.iter (fun (x, y) -> put_pixel img color x y) pts; + *) + + (* draw segments *) + let line = draw_line ~img ~color in + let by_pair li f = + ignore (List.fold_left (fun prev x -> f prev x; x) (List.hd li) (List.tl li)) + in + by_pair pts (fun p0 p1 -> line ~p0 ~p1); +;; diff --git a/Task/Bitmap-B-zier-curves-Cubic/PureBasic/bitmap-b-zier-curves-cubic.purebasic b/Task/Bitmap-B-zier-curves-Cubic/PureBasic/bitmap-b-zier-curves-cubic.purebasic new file mode 100644 index 0000000000..f4aeb8c859 --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Cubic/PureBasic/bitmap-b-zier-curves-cubic.purebasic @@ -0,0 +1,36 @@ +Procedure cubic_bezier(img, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y, Color, n_seg) + Protected i + Protected.f t, t1, a, b, c, d + Dim pts.POINT(n_seg) + + For i = 0 To n_seg + t = i / n_seg + t1 = 1.0 - t + a = Pow(t1, 3) + b = 3.0 * t * Pow(t1, 2) + c = 3.0 * Pow(t, 2) * t1 + d = Pow(t, 3) + pts(i)\x = a * p1x + b * p2x + c * p3x + d * p4x + pts(i)\y = a * p1y + b * p2y + c * p3y + d * p4y + Next + + StartDrawing(ImageOutput(img)) + FrontColor(Color) + For i = 0 To n_seg - 1 + BresenhamLine(pts(i)\x, pts(i)\y, pts(i + 1)\x, pts(i + 1)\y) ;this calls the implementation of a draw_line routine + Next + StopDrawing() +EndProcedure + +Define w, h, img +w = 200: h = 200: img = 1 +CreateImage(img, w, h) ;img is internal id of the image + +OpenWindow(0, 0, 0, w, h,"Bezier curve, cubic", #PB_Window_SystemMenu) +cubic_bezier(1, 160,10, 10,40, 30,160, 150,110, RGB(255, 255, 255), 20) +ImageGadget(0, 0, 0, w, h, ImageID(1)) + +Define event +Repeat + event = WaitWindowEvent() +Until event = #PB_Event_CloseWindow diff --git a/Task/Bitmap-B-zier-curves-Cubic/TI-89-BASIC/bitmap-b-zier-curves-cubic.ti-89 b/Task/Bitmap-B-zier-curves-Cubic/TI-89-BASIC/bitmap-b-zier-curves-cubic.ti-89 new file mode 100644 index 0000000000..2c828d9b13 --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Cubic/TI-89-BASIC/bitmap-b-zier-curves-cubic.ti-89 @@ -0,0 +1,13 @@ +Define cubic(p1,p2,p3,p4,segs) = Prgm + Local i,t,u,prev,pt + 0 → pt + For i,1,segs+1 + (i-1.0)/segs → t © Decimal to avoid slow exact arithetic + (1-t) → u + pt → prev + u^3*p1 + 3t*u^2*p2 + 3t^2*u*p3 + t^3*p4 → pt + If i>1 Then + PxlLine floor(prev[1,1]), floor(prev[1,2]), floor(pt[1,1]), floor(pt[1,2]) + EndIf + EndFor +EndPrgm diff --git a/Task/Bitmap-B-zier-curves-Cubic/XPL0/bitmap-b-zier-curves-cubic.xpl0 b/Task/Bitmap-B-zier-curves-Cubic/XPL0/bitmap-b-zier-curves-cubic.xpl0 new file mode 100644 index 0000000000..4e09b21807 --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Cubic/XPL0/bitmap-b-zier-curves-cubic.xpl0 @@ -0,0 +1,33 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +func real Power(X, Y); \X raised to the Y power; (X > 0.0) +real X, Y; +return Exp(Y * Ln(X)); + +proc Bezier(P0, P1, P2, P3); \Draw cubic Bezier curve +real P0, P1, P2, P3; +def Segments = 8; +int I; +real T, A, B, C, D, X, Y; +[Move(fix(P0(0)), fix(P0(1))); +for I:= 1 to Segments-1 do + [T:= float(I)/float(Segments); + A:= Power((1.-T), 3.); + B:= 3.*T*Power((1.-T), 2.); + C:= 3.*Power(T, 2.)*(1.-T); + D:= Power(T, 3.); + X:= A*P0(0) + B*P1(0) + C*P2(0) + D*P3(0); + Y:= A*P0(1) + B*P1(1) + C*P2(1) + D*P3(1); + Line(fix(X), fix(Y), $00FFFF); \cyan line segments + ]; + Line(fix(P3(0)), fix(P3(1)), $00FFFF); +Point(fix(P0(0)), fix(P0(1)), $FF0000); \red control points +Point(fix(P1(0)), fix(P1(1)), $FF0000); +Point(fix(P2(0)), fix(P2(1)), $FF0000); +Point(fix(P3(0)), fix(P3(1)), $FF0000); +]; + +[SetVid($112); \set 640x480x24 video graphics +Bezier([0., 0.], [30., 100.], [120., 20.], [160., 120.]); +if ChIn(1) then []; \wait for keystroke +SetVid(3); \restore normal text display +] diff --git a/Task/Bitmap-B-zier-curves-Quadratic/Mathematica/bitmap-b-zier-curves-quadratic.mathematica b/Task/Bitmap-B-zier-curves-Quadratic/Mathematica/bitmap-b-zier-curves-quadratic.math similarity index 100% rename from Task/Bitmap-B-zier-curves-Quadratic/Mathematica/bitmap-b-zier-curves-quadratic.mathematica rename to Task/Bitmap-B-zier-curves-Quadratic/Mathematica/bitmap-b-zier-curves-quadratic.math diff --git a/Task/Bitmap-B-zier-curves-Quadratic/OCaml/bitmap-b-zier-curves-quadratic.ocaml b/Task/Bitmap-B-zier-curves-Quadratic/OCaml/bitmap-b-zier-curves-quadratic.ocaml new file mode 100644 index 0000000000..c8b0a741c7 --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Quadratic/OCaml/bitmap-b-zier-curves-quadratic.ocaml @@ -0,0 +1,39 @@ +let quad_bezier ~img ~color + ~p1:(_x1, _y1) + ~p2:(_x2, _y2) + ~p3:(_x3, _y3) = + let (x1, y1, x2, y2, x3, y3) = + (float _x1, float _y1, float _x2, float _y2, float _x3, float _y3) + in + let bz t = + let a = (1.0 -. t) ** 2.0 + and b = 2.0 *. t *. (1.0 -. t) + and c = t ** 2.0 + in + let x = a *. x1 +. b *. x2 +. c *. x3 + and y = a *. y1 +. b *. y2 +. c *. y3 + in + (int_of_float x, int_of_float y) + in + let rec loop _t acc = + if _t > 20 then acc else + begin + let t = (float _t) /. 20.0 in + let x, y = bz t in + loop (succ _t) ((x,y)::acc) + end + in + let pts = loop 0 [] in + + (* + (* draw only points *) + List.iter (fun (x, y) -> put_pixel img color x y) pts; + *) + + (* draw segments *) + let line = draw_line ~img ~color in + let by_pair li f = + ignore (List.fold_left (fun prev x -> f prev x; x) (List.hd li) (List.tl li)) + in + by_pair pts (fun p0 p1 -> line ~p0 ~p1); +;; diff --git a/Task/Bitmap-B-zier-curves-Quadratic/PureBasic/bitmap-b-zier-curves-quadratic.purebasic b/Task/Bitmap-B-zier-curves-Quadratic/PureBasic/bitmap-b-zier-curves-quadratic.purebasic new file mode 100644 index 0000000000..bf5b1b0bbc --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Quadratic/PureBasic/bitmap-b-zier-curves-quadratic.purebasic @@ -0,0 +1,35 @@ +Procedure quad_bezier(img, p1x, p1y, p2x, p2y, p3x, p3y, Color, n_seg) + Protected i + Protected.f T, t1, a, b, c, d + Dim pts.POINT(n_seg) + + For i = 0 To n_seg + T = i / n_seg + t1 = 1.0 - T + a = Pow(t1, 2) + b = 2.0 * T * t1 + c = Pow(T, 2) + pts(i)\x = a * p1x + b * p2x + c * p3x + pts(i)\y = a * p1y + b * p2y + c * p3y + Next + + StartDrawing(ImageOutput(img)) + FrontColor(Color) + For i = 0 To n_seg - 1 + BresenhamLine(pts(i)\x, pts(i)\y, pts(i + 1)\x, pts(i + 1)\y) + Next + StopDrawing() +EndProcedure + +Define w, h, img +w = 200: h = 200: img = 1 +CreateImage(img, w, h) ;img is internal id of the image + +OpenWindow(0, 0, 0, w, h,"Bezier curve, quadratic", #PB_Window_SystemMenu) +quad_bezier(1, 80,20, 130,80, 20,150, RGB(255, 255, 255), 20) +ImageGadget(0, 0, 0, w, h, ImageID(1)) + +Define event +Repeat + event = WaitWindowEvent() +Until event = #PB_Event_CloseWindow diff --git a/Task/Bitmap-B-zier-curves-Quadratic/TI-89-BASIC/bitmap-b-zier-curves-quadratic.ti-89 b/Task/Bitmap-B-zier-curves-Quadratic/TI-89-BASIC/bitmap-b-zier-curves-quadratic.ti-89 new file mode 100644 index 0000000000..a0f2ac60fe --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Quadratic/TI-89-BASIC/bitmap-b-zier-curves-quadratic.ti-89 @@ -0,0 +1,13 @@ +Define cubic(p1,p2,p3,segs) = Prgm + Local i,t,u,prev,pt + 0 → pt + For i,1,segs+1 + (i-1.0)/segs → t © Decimal to avoid slow exact arithetic + (1-t) → u + pt → prev + u^2*p1 + 2*t*u*p2 + t^2*p3 → pt + If i>1 Then + PxlLine floor(prev[1,1]), floor(prev[1,2]), floor(pt[1,1]), floor(pt[1,2]) + EndIf + EndFor +EndPrgm diff --git a/Task/Bitmap-B-zier-curves-Quadratic/Vedit-macro-language/bitmap-b-zier-curves-quadratic.vedit b/Task/Bitmap-B-zier-curves-Quadratic/Vedit-macro-language/bitmap-b-zier-curves-quadratic.vedit new file mode 100644 index 0000000000..7cc9299585 --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Quadratic/Vedit-macro-language/bitmap-b-zier-curves-quadratic.vedit @@ -0,0 +1,33 @@ +// Daw a Cubic bezier curve +// #20, #30 = Start point +// #21, #31 = Control point 1 +// #22, #32 = Control point 2 +// #23, #33 = end point +// #40 = depth of recursion + +:CUBIC_BEZIER: +if (#40 > 0) { + #24 = (#20+#21)/2; #34 = (#30+#31)/2 + #26 = (#22+#23)/2; #36 = (#32+#33)/2 + #27 = (#20+#21*2+#22)/4; #37 = (#30+#31*2+#32)/4 + #28 = (#21+#22*2+#23)/4; #38 = (#31+#32*2+#33)/4 + #29 = (#20+#21*3+#22*3+#23)/8; #39 = (#30+#31*3+#32*3+#33)/8 + Num_Push(20,40) + #21 = #24; #31 = #34 // control 1 + #22 = #27; #32 = #37 // control 2 + #23 = #29; #33 = #39 // end point + #40-- + Call("CUBIC_BEZIER") // Draw "left" part + Num_Pop(20,40) + Num_Push(20,40) + #20 = #29; #30 = #39 // start point + #21 = #28; #31 = #38 // control 1 + #22 = #26; #32 = #36 // control 2 + #40-- + Call("CUBIC_BEZIER") // Draw "right" part + Num_Pop(20,40) +} else { + #1=#20; #2=#30; #3=#23; #4=#33 + Call("DRAW_LINE") +} +return diff --git a/Task/Bitmap-B-zier-curves-Quadratic/XPL0/bitmap-b-zier-curves-quadratic.xpl0 b/Task/Bitmap-B-zier-curves-Quadratic/XPL0/bitmap-b-zier-curves-quadratic.xpl0 new file mode 100644 index 0000000000..ccc41c38f9 --- /dev/null +++ b/Task/Bitmap-B-zier-curves-Quadratic/XPL0/bitmap-b-zier-curves-quadratic.xpl0 @@ -0,0 +1,27 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations + +proc Bezier(P0, P1, P2); \Draw quadratic Bezier curve +real P0, P1, P2; +def Segments = 8; +int I; +real T, A, B, C, X, Y; +[Move(fix(P0(0)), fix(P0(1))); +for I:= 1 to Segments do + [T:= float(I)/float(Segments); + A:= sq(1.-T); + B:= 2.*T*(1.-T); + C:= sq(T); + X:= A*P0(0) + B*P1(0) + C*P2(0); + Y:= A*P0(1) + B*P1(1) + C*P2(1); + Line(fix(X), fix(Y), $00FFFF); \cyan line segments + ]; +Point(fix(P0(0)), fix(P0(1)), $FF0000); \red control points +Point(fix(P1(0)), fix(P1(1)), $FF0000); +Point(fix(P2(0)), fix(P2(1)), $FF0000); +]; + +[SetVid($112); \set 640x480x24 video graphics +Bezier([0., 0.], [80., 100.], [160., 20.]); +if ChIn(1) then []; \wait for keystroke +SetVid(3); \restore normal text display +] diff --git a/Task/Bitmap-Bresenhams-line-algorithm/MAXScript/bitmap-bresenhams-line-algorithm.max b/Task/Bitmap-Bresenhams-line-algorithm/MAXScript/bitmap-bresenhams-line-algorithm.maxscript similarity index 100% rename from Task/Bitmap-Bresenhams-line-algorithm/MAXScript/bitmap-bresenhams-line-algorithm.max rename to Task/Bitmap-Bresenhams-line-algorithm/MAXScript/bitmap-bresenhams-line-algorithm.maxscript diff --git a/Task/Bitmap-Bresenhams-line-algorithm/Mathematica/bitmap-bresenhams-line-algorithm.mathematica b/Task/Bitmap-Bresenhams-line-algorithm/Mathematica/bitmap-bresenhams-line-algorithm.math similarity index 100% rename from Task/Bitmap-Bresenhams-line-algorithm/Mathematica/bitmap-bresenhams-line-algorithm.mathematica rename to Task/Bitmap-Bresenhams-line-algorithm/Mathematica/bitmap-bresenhams-line-algorithm.math diff --git a/Task/Bitmap-Bresenhams-line-algorithm/OCaml/bitmap-bresenhams-line-algorithm.ocaml b/Task/Bitmap-Bresenhams-line-algorithm/OCaml/bitmap-bresenhams-line-algorithm.ocaml new file mode 100644 index 0000000000..d7a54cce22 --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/OCaml/bitmap-bresenhams-line-algorithm.ocaml @@ -0,0 +1,40 @@ +let draw_line ~img ~color ~p0:(x0,y0) ~p1:(x1,y1) = + + let steep = abs(y1 - y0) > abs(x1 - x0) in + + let plot = + if steep + then (fun x y -> put_pixel img color y x) + else (fun x y -> put_pixel img color x y) + in + + let x0, y0, x1, y1 = + if steep + then y0, x0, y1, x1 + else x0, y0, x1, y1 + in + let x0, x1, y0, y1 = + if x0 > x1 + then x1, x0, y1, y0 + else x0, x1, y0, y1 + in + + let delta_x = x1 - x0 + and delta_y = abs(y1 - y0) in + let error = -delta_x / 2 + and y_step = + if y0 < y1 then 1 else -1 + in + let rec loop x y error = + plot x y; + if x <= x1 then + let error = error + delta_y in + let y, error = + if error > 0 + then (y + y_step), (error - delta_x) + else y, error + in + loop (succ x) y error + in + loop x0 y0 error +;; diff --git a/Task/Bitmap-Bresenhams-line-algorithm/PL-I/bitmap-bresenhams-line-algorithm-1.pli b/Task/Bitmap-Bresenhams-line-algorithm/PL-I/bitmap-bresenhams-line-algorithm-1.pli new file mode 100644 index 0000000000..060c392249 --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/PL-I/bitmap-bresenhams-line-algorithm-1.pli @@ -0,0 +1,36 @@ +/* Draw a line from (x0, y0) to (x1, y1). 13 May 2010 */ +/* Based on Rosetta code proforma. */ + + /* Declarations for image and selected color, for 4-bit colors. */ + declare image(40,40) bit (4), color bit (4) static initial ('1000'b); + +draw_line: procedure (xi, yi, xf, yf ); + declare (xi, yi, xf, yf) fixed binary (31) nonassignable; + declare (x0, y0, x1, y1) fixed binary (31); + declare (deltax, deltay, x, y, ystep) fixed binary; + declare (error initial (0), delta_error) float; + declare steep bit (1); + + x0 = xi; y = YI; y0 = yi; x1 = xf; y1 = yf; + steep = abs(y1 - y0) > abs (x1 - x0); + if steep then + do; call swap (x0, y0); call swap (x1, y1); end; + if x0 > x1 then + do; call swap (x0, x1); call swap (y0, y1); end; + deltax = x1 - x0; deltay = abs(y1 - y0); + delta_error = deltay/deltax; + if y0 < y1 then ystep = 1; else ystep = -1; + do x = x0 to x1; + if steep then image(y, x) = color; else image(x, y) = color; + if steep then put skip list (y, x); else put skip list (x, y); + error = error + delta_error; + if error >= 0.5 then do; y = y + ystep; error = error - 1; end; + end; + +swap: procedure (a, b); + declare (a, b) fixed binary (31); + declare t fixed binary (31); + t = a; a = b; b = t; +end swap; + +end draw_line; diff --git a/Task/Bitmap-Bresenhams-line-algorithm/PL-I/bitmap-bresenhams-line-algorithm-2.pli b/Task/Bitmap-Bresenhams-line-algorithm/PL-I/bitmap-bresenhams-line-algorithm-2.pli new file mode 100644 index 0000000000..690fc5f595 --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/PL-I/bitmap-bresenhams-line-algorithm-2.pli @@ -0,0 +1,21 @@ +..........|.......... +..........|.......... +..........|.......... +..........|.......... +..........|.......... +..........|.......... +..........|.........* +..........|.......**. +..........|.....**... +..........|...**..... +----------+-**------- +..........**......... +........**|.......... +.......*..|.......... +..........|.......... +..........|.......... +..........|.......... +..........|.......... +..........|.......... +..........|.......... +..........|.......... diff --git a/Task/Bitmap-Bresenhams-line-algorithm/Perl-6/bitmap-bresenhams-line-algorithm.pl6 b/Task/Bitmap-Bresenhams-line-algorithm/Perl-6/bitmap-bresenhams-line-algorithm.pl6 new file mode 100644 index 0000000000..3b8cb13788 --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/Perl-6/bitmap-bresenhams-line-algorithm.pl6 @@ -0,0 +1,30 @@ +sub line(Bitmap $bitmap, $x0 is copy, $x1 is copy, $y0 is copy, $y1 is copy) { + my $steep = abs($y1 - $y0) > abs($x1 - $x0); + if $steep { + ($x0, $y0) = ($y0, $x0); + ($x1, $y1) = ($y1, $x1); + } + if $x0 > $x1 { + ($x0, $x1) = ($x1, $x0); + ($y0, $y1) = ($y1, $y0); + } + my $Δx = $x1 - $x0; + my $Δy = abs($y1 - $y0); + my $error = 0; + my $Δerror = $Δy / $Δx; + my $y-step = $y0 < $y1 ?? 1 !! -1; + my $y = $y0; + for $x0 .. $x1 -> $x { + my $pix = Pixel.new(R => 100, G => 200, B => 0); + if $steep { + $bitmap.set-pixel($y, $x, $pix); + } else { + $bitmap.set-pixel($x, $y, $pix); + } + $error += $Δerror; + if $error >= 0.5 { + $y += $y-step; + $error -= 1.0; + } + } +} diff --git a/Task/Bitmap-Bresenhams-line-algorithm/PureBasic/bitmap-bresenhams-line-algorithm.purebasic b/Task/Bitmap-Bresenhams-line-algorithm/PureBasic/bitmap-bresenhams-line-algorithm.purebasic new file mode 100644 index 0000000000..790d9a4848 --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/PureBasic/bitmap-bresenhams-line-algorithm.purebasic @@ -0,0 +1,59 @@ +Procedure BresenhamLine(x0 ,y0 ,x1 ,y1) + If Abs(y1 - y0) > Abs(x1 - x0); + steep =#True + Swap x0, y0 + Swap x1, y1 + EndIf + If x0 > x1 + Swap x0, x1 + Swap y0, y1 + EndIf + deltax = x1 - x0 + deltay = Abs(y1 - y0) + error = deltax / 2 + y = y0 + If y0 < y1 + ystep = 1 + Else + ystep = -1 + EndIf + For x = x0 To x1 + If steep + Plot(y,x) + Else + Plot(x,y) + EndIf + error - deltay + If error < 0 + y + ystep + error + deltax + EndIf + Next +EndProcedure + +#Window1 = 0 +#Image1 = 0 +#ImgGadget = 0 +#width = 300 +#height = 300 + +Define.i Event +Define.f Angle + +If OpenWindow(#Window1, 0, 0, #width, #height, "Bresenham's Line PureBasic Example", #PB_Window_SystemMenu|#PB_Window_ScreenCentered) + If CreateImage(#Image1, #width, #height) + ImageGadget(#ImgGadget, 0, 0, #width, #height, ImageID(#Image1)) + StartDrawing(ImageOutput(#Image1)) + FillArea(0,0,-1,$FFFFFF) :FrontColor(0) + While Angle < 2*#PI + BresenhamLine(150,150,150+Cos(Angle)*120,150+Sin(Angle)*120) + Angle + #PI/60 + Wend + + StopDrawing() + SetGadgetState(#ImgGadget, ImageID(#Image1)) + Repeat + Event = WaitWindowEvent() + Until Event = #PB_Event_CloseWindow + EndIf +EndIf diff --git a/Task/Bitmap-Bresenhams-line-algorithm/RapidQ/bitmap-bresenhams-line-algorithm-1.rapidq b/Task/Bitmap-Bresenhams-line-algorithm/RapidQ/bitmap-bresenhams-line-algorithm-1.rapidq new file mode 100644 index 0000000000..192c9651d1 --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/RapidQ/bitmap-bresenhams-line-algorithm-1.rapidq @@ -0,0 +1,35 @@ +SUB draw_line(x1, y1, x2, y2, colour) + x_dist = abs(x2-x1) + y_dist = abs(y2-y1) + IF y2-y1 < -x_dist OR x2-x1 <= -y_dist THEN + SWAP x1, x2 ' Swap start and end points + SWAP y1, y2 + END IF + IF x1 < x2 THEN x_step = 1 ELSE x_step = -1 + IF y1 < y2 THEN y_step = 1 ELSE y_step = -1 + + IF y_dist > x_dist THEN ' steep angle, step by y + error = y_dist/2 + x = x1 + FOR y = y1 TO y2 + canvas.Pset(x, y, colour) + error = error - x_dist + IF error < 0 THEN + x = x + x_step + error = error + y_dist + END IF + NEXT y + ELSE ' not steep, step by x + error = x_dist/2 + y = y1 + FOR x = x1 TO x2 + canvas.Pset(x, y, colour) + error = error - y_dist + IF error < 0 THEN + y = y + y_step + error = error + x_dist + END IF + NEXT y + END IF + +END SUB diff --git a/Task/Bitmap-Bresenhams-line-algorithm/RapidQ/bitmap-bresenhams-line-algorithm-2.rapidq b/Task/Bitmap-Bresenhams-line-algorithm/RapidQ/bitmap-bresenhams-line-algorithm-2.rapidq new file mode 100644 index 0000000000..60d8ce296a --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/RapidQ/bitmap-bresenhams-line-algorithm-2.rapidq @@ -0,0 +1,6 @@ +SUB PaintCanvas + draw_line 200, 10, 100, 200, &H00ff00 + draw_line 100, 200, 200, 400, &H00ff00 + draw_line 200, 400, 300, 200, &H00ff00 + draw_line 300, 200, 200, 10, &H00ff00 +END SUB diff --git a/Task/Bitmap-Bresenhams-line-algorithm/TI-89-BASIC/bitmap-bresenhams-line-algorithm.ti-89 b/Task/Bitmap-Bresenhams-line-algorithm/TI-89-BASIC/bitmap-bresenhams-line-algorithm.ti-89 new file mode 100644 index 0000000000..cdb896523a --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/TI-89-BASIC/bitmap-bresenhams-line-algorithm.ti-89 @@ -0,0 +1,34 @@ +(lx0, ly0, lx1, ly1) +Prgm + Local steep, x, y, dx, dy, ystep, error, tmp + abs(ly1 - ly0) > abs(lx1 - lx0) → steep + If steep Then + lx0 → tmp + ly0 → lx0 + tmp → ly0 + lx1 → tmp + ly1 → lx1 + tmp → ly1 + EndIf + If lx0 > lx1 Then + lx0 → tmp + lx1 → lx0 + tmp → lx1 + ly0 → tmp + ly1 → ly0 + tmp → ly1 + EndIf + lx1 - lx0 → dx + abs(ly1 - ly0) → dy + when(ly0 < ly1, 1, –1) → ystep + intDiv(dx, 2) → error + ly0 → y + For x,lx0,lx1 + If steep Then: PxlChg x, y :Else: PxlChg y, x :EndIf + error - dy → error + If error < 0 Then + y + ystep → y + error + dx → error + EndIf + EndFor +EndPrgm diff --git a/Task/Bitmap-Bresenhams-line-algorithm/Vedit-macro-language/bitmap-bresenhams-line-algorithm.vedit b/Task/Bitmap-Bresenhams-line-algorithm/Vedit-macro-language/bitmap-bresenhams-line-algorithm.vedit new file mode 100644 index 0000000000..617c367e9f --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/Vedit-macro-language/bitmap-bresenhams-line-algorithm.vedit @@ -0,0 +1,39 @@ +// Daw a line using Bresenham's line algorithm. +// #1=x1, #2=y1; #3=x2, #4=y2 + +:DRAW_LINE: +Num_Push(31,35) +#31 = abs(#3-#1) // x distance +#32 = abs(#4-#2) // y distance +if (#4-#2 < -#31 || #3-#1 <= -#32) { + #99=#1; #1=#3; #3=#99 // swap start and end points + #99=#2; #2=#4; #4=#99 +} +if (#1 < #3) { #34=1 } else { #34=-1 } // x step +if (#2 < #4) { #35=1 } else { #35=-1 } // y step + +if (#32 > #31) { // steep angle, step by Y + #33 = #32 / 2 // error distance + while (#2 <= #4) { + Call("DRAW_PIXEL") + #33 -= #31 + if (#33 < 0) { + #1 += #34 // move right + #33 += #32 + } + #2++ // move up + } +} else { // not steep, step by X + #33 = #31 / 2 + while (#1 <= #3) { + Call("DRAW_PIXEL") + #33 -= #32 + if (#33 < 0) { + #2 += #35 // move up + #33 += #31 + } + #1++ // move right + } +} +Num_Pop(31,35) +return diff --git a/Task/Bitmap-Bresenhams-line-algorithm/XPL0/bitmap-bresenhams-line-algorithm.xpl0 b/Task/Bitmap-Bresenhams-line-algorithm/XPL0/bitmap-bresenhams-line-algorithm.xpl0 new file mode 100644 index 0000000000..7922c24244 --- /dev/null +++ b/Task/Bitmap-Bresenhams-line-algorithm/XPL0/bitmap-bresenhams-line-algorithm.xpl0 @@ -0,0 +1,7 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +[SetVid($112); \set 640x480 graphics in 24-bit color +Move(10, 20); \set start of line segment +Line(600, 400, $123456);\draw line segment, red=$12, green=$34, blue=$56 +if ChIn(1) then []; \wait for keystroke while viewing graphic screen +SetVid(3); \restore normal text mode +] diff --git a/Task/Bitmap-Flood-fill/Mathematica/bitmap-flood-fill.mathematica b/Task/Bitmap-Flood-fill/Mathematica/bitmap-flood-fill.math similarity index 100% rename from Task/Bitmap-Flood-fill/Mathematica/bitmap-flood-fill.mathematica rename to Task/Bitmap-Flood-fill/Mathematica/bitmap-flood-fill.math diff --git a/Task/Bitmap-Flood-fill/PL-I/bitmap-flood-fill-1.pli b/Task/Bitmap-Flood-fill/PL-I/bitmap-flood-fill-1.pli new file mode 100644 index 0000000000..406ac753cf --- /dev/null +++ b/Task/Bitmap-Flood-fill/PL-I/bitmap-flood-fill-1.pli @@ -0,0 +1,26 @@ +fill: procedure (x, y, fill_color) recursive; /* 12 May 2010 */ + declare (x, y) fixed binary; + declare fill_color bit (24) aligned; + + if x <= lbound(image, 2) | x >= hbound(image, 2) then return; + if y <= lbound(image, 1) | y >= hbound(image, 1) then return; + + pixel_color = image (x,y); /* Obtain the color of the current pixel. */ + if pixel_color ^= area_color then return; + /* the pixel has already been filled with fill_color, */ + /* or we are not within the area to be filled. */ + image(x, y) = fill_color; /* color the desired area. */ + + pixel_color = image (x,y-1); /* Obtain the color of the pixel to the north. */ + if pixel_color = area_color then call fill (x, y-1, fill_color); + + pixel_color = image (x-1,y); /* Obtain the color of the pixel to the west. */ + if pixel_color = area_color then call fill (x-1, y, fill_color); + + pixel_color = image (x+1,y); /* Obtain the color of the pixel to the east. */ + if pixel_color = area_color then call fill (x+1, y, fill_color); + + pixel_color = image (x,y+1); /* Obtain the color of the pixel to the south. */ + if pixel_color = area_color then call fill (x, y+1, fill_color); + +end fill; diff --git a/Task/Bitmap-Flood-fill/PL-I/bitmap-flood-fill-2.pli b/Task/Bitmap-Flood-fill/PL-I/bitmap-flood-fill-2.pli new file mode 100644 index 0000000000..a6f96ab3b8 --- /dev/null +++ b/Task/Bitmap-Flood-fill/PL-I/bitmap-flood-fill-2.pli @@ -0,0 +1,7 @@ + /* Fill the white area of the suggested image with red color. */ + area_color = (24)'1'b; + call fill (125, 25, '000000000000000011111111'b ); + + /* Fill the center orb of the suggested image with green color. */ + area_color = '0'b; + call fill (125, 125, '000000001111111100000000'b ); diff --git a/Task/Bitmap-Flood-fill/PureBasic/bitmap-flood-fill-1.purebasic b/Task/Bitmap-Flood-fill/PureBasic/bitmap-flood-fill-1.purebasic new file mode 100644 index 0000000000..7c7a88854a --- /dev/null +++ b/Task/Bitmap-Flood-fill/PureBasic/bitmap-flood-fill-1.purebasic @@ -0,0 +1,2 @@ +FillArea(0,0,-1,$ff) +; Fills an Area in red diff --git a/Task/Bitmap-Flood-fill/PureBasic/bitmap-flood-fill-2.purebasic b/Task/Bitmap-Flood-fill/PureBasic/bitmap-flood-fill-2.purebasic new file mode 100644 index 0000000000..8a32e9c579 --- /dev/null +++ b/Task/Bitmap-Flood-fill/PureBasic/bitmap-flood-fill-2.purebasic @@ -0,0 +1,30 @@ + Procedure Floodfill(x,y,new_color) + old_color = Point(x,y) + NewList stack.POINT() + AddElement(stack()):stack()\x = x : stack()\y = y + While(LastElement(stack())) + x = stack()\x : y = stack()\y + DeleteElement(stack()) + If Point(x,y) = old_color + Plot(x, y, new_color) + AddElement(stack()):stack()\x = x : stack()\y = y +1 + AddElement(stack()):stack()\x = x : stack()\y = y -1 + AddElement(stack()):stack()\x = x +1 : stack()\y = y + AddElement(stack()):stack()\x = x -1 : stack()\y = y + EndIf + Wend + EndProcedure + + If OpenWindow(0, 0, 0, 200, 200, "Floodfill Beispiel", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) + StartDrawing(WindowOutput(0)) + Box(0, 0, 200, 200, RGB(255, 255, 255)) + DrawingMode(#PB_2DDrawing_Outlined ) + Circle(100, 100, 90, RGB(255 ,0,0)): Circle(120, 80, 30, RGB(255 ,0,0)): Circle(200,200, 70, RGB(255 ,0,0)) + + Floodfill(40,40,RGB(0 ,255,0)) + + StopDrawing() + Repeat + Event = WaitWindowEvent() + Until Event = #PB_Event_CloseWindow + EndIf diff --git a/Task/Bitmap-Flood-fill/XPL0/bitmap-flood-fill.xpl0 b/Task/Bitmap-Flood-fill/XPL0/bitmap-flood-fill.xpl0 new file mode 100644 index 0000000000..d27c9719f1 --- /dev/null +++ b/Task/Bitmap-Flood-fill/XPL0/bitmap-flood-fill.xpl0 @@ -0,0 +1,60 @@ +include c:\cxpl\codes; + +proc Flood(X, Y, C, C0); \Fill an area of color C0 with color C +int X, Y, \seed coordinate (where to start) + C, C0; \color to fill with and color to replace +def S=8000; \size of queue (must be an even number) +int Q(S), \queue (FIFO) + F, E; \fill and empty indexes + + proc EnQ(X, Y); \Enqueue coordinate + int X, Y; + [Q(F):= X; + F:= F+1; + Q(F):= Y; + F:= F+1; + if F >= S then F:= 0; + ]; \EnQ + + proc DeQ; \Dequeue coordinate + [X:= Q(E); + E:= E+1; + Y:= Q(E); + E:= E+1; + if E >= S then E:= 0; + ]; \DeQ + +[F:= 0; E:= 0; +EnQ(X, Y); +while E # F do + [DeQ; + if ReadPix(X, Y) = C0 then + [Point(X, Y, C); + EnQ(X+1, Y); \enqueue adjacent pixels + EnQ(X-1, Y); + EnQ(X, Y+1); + EnQ(X, Y-1); + ]; + ]; +]; \Flood + +def Size = 30.0; +int X, Y; +real Ang, Dist; +[SetVid($101); \set 640x480 graphics with 256 colors + +Ang:= 0.0; \draw some flower petals +repeat Dist:= Size*(Cos(Ang*3.0) - 1.0); + X:= fix(Dist*Cos(Ang)); + Y:= fix(Dist*Sin(Ang)); + Point(X+320, 240-Y, $F); + Ang:= Ang + 0.001; \draw dots close together to prevent leaks +until Ang >= 2.0*3.14159; + +Flood(330, 240, $2A, 0); \color the petals +Flood(310, 230, $2C, 0); +Flood(310, 250, $2E, 0); + +if ChIn(1) then []; \wait for keystroke +SetVid(3); \restore normal text mode +] diff --git a/Task/Bitmap-Histogram/Mathematica/bitmap-histogram.mathematica b/Task/Bitmap-Histogram/Mathematica/bitmap-histogram.math similarity index 100% rename from Task/Bitmap-Histogram/Mathematica/bitmap-histogram.mathematica rename to Task/Bitmap-Histogram/Mathematica/bitmap-histogram.math diff --git a/Task/Bitmap-Histogram/OCaml/bitmap-histogram-1.ocaml b/Task/Bitmap-Histogram/OCaml/bitmap-histogram-1.ocaml new file mode 100644 index 0000000000..4f93776ded --- /dev/null +++ b/Task/Bitmap-Histogram/OCaml/bitmap-histogram-1.ocaml @@ -0,0 +1,14 @@ +type histogram = int array + +let get_histogram ~img:gray_channel = + let width = Bigarray.Array2.dim1 gray_channel + and height = Bigarray.Array2.dim2 gray_channel in + let t = Array.make 256 0 in + for x = 0 to pred width do + for y = 0 to pred height do + let v = gray_get_pixel_unsafe gray_channel x y in + t.(v) <- t.(v) + 1; + done; + done; + (t: histogram) +;; diff --git a/Task/Bitmap-Histogram/OCaml/bitmap-histogram-2.ocaml b/Task/Bitmap-Histogram/OCaml/bitmap-histogram-2.ocaml new file mode 100644 index 0000000000..5dee685f4a --- /dev/null +++ b/Task/Bitmap-Histogram/OCaml/bitmap-histogram-2.ocaml @@ -0,0 +1,15 @@ +let histogram_median (h : histogram) = + + let from = 0 and to_ = 255 in + let left = h.(from) and right = h.(to_) in + + let rec aux from to_ left right = + if from = to_ + then (from) + else + if left < right + then aux (succ from) to_ (left + h.(from)) right + else aux from (pred to_) left (right + h.(to_)) + in + aux from to_ left right +;; diff --git a/Task/Bitmap-Histogram/OCaml/bitmap-histogram-3.ocaml b/Task/Bitmap-Histogram/OCaml/bitmap-histogram-3.ocaml new file mode 100644 index 0000000000..d09065e238 --- /dev/null +++ b/Task/Bitmap-Histogram/OCaml/bitmap-histogram-3.ocaml @@ -0,0 +1,24 @@ +let () = + let img = read_ppm ~filename:"/tmp/foo.ppm" in + + let width, height = get_dims img in + let res = new_img ~width ~height in + + let g_img = to_grayscale ~img in + let h = get_histogram g_img in + let m = histogram_median h in + + let light = (255, 255, 0) + and dark = (127, 0, 127) in + + for x = 0 to pred width do + for y = 0 to pred height do + let v = gray_get_pixel_unsafe g_img x y in + if v > m + then put_pixel_unsafe res light x y + else put_pixel_unsafe res dark x y + done; + done; + + output_ppm ~oc:stdout ~img:res; +;; diff --git a/Task/Bitmap-Histogram/Octave/bitmap-histogram.octave b/Task/Bitmap-Histogram/Octave/bitmap-histogram.octave new file mode 100644 index 0000000000..5b8b764086 --- /dev/null +++ b/Task/Bitmap-Histogram/Octave/bitmap-histogram.octave @@ -0,0 +1,52 @@ +function h = imagehistogram(imago) + if ( isgray(imago) ) + for j = 0:255 + h(j+1) = numel(imago( imago == j )); + endfor + else + error("histogram on gray img only"); + endif +endfunction + +% test +im = jpgread("Lenna100.jpg"); +img = rgb2gray(im); +h = imagehistogram(img); +% let's try to show the histogram +bar(h); +pause; + +% in order to obtain the requested filtering, we +% can use median directly on the img, and then +% use that value, this way: +m = median(reshape(img, 1, numel(img))); +disp(m); +ibw = img; +ibw( img > m ) = 255; +ibw( img <= m ) = 0; +jpgwrite("lennamed_.jpg", ibw, 100); +% which disagree (128) with the m computed with histog_med (130). +% If we compute it this way: +% m = sort(reshape(img, 1, numel(img)))(ceil(numel(img)/2)); +% we obtain 130... but builtin median works as expected, since +% N (number of pixel of Lenna) is even, not odd. + +% but let's use our histogram h instead +function m = histog_med(histog) + from = 0; to = 255; + left = histog(from + 1); right = histog(to+1); + while ( from != to ) + if ( left < right ) + from++; left += histog(from+1); + else + to--; right += histog(to+1); + endif + endwhile + m = from; +endfunction + +m = histog_med(h); +disp(m); +ibw( img > m ) = 255; +ibw( img <= m ) = 0; +jpgwrite("lennamed.jpg", ibw, 100); diff --git a/Task/Bitmap-Histogram/PureBasic/bitmap-histogram.purebasic b/Task/Bitmap-Histogram/PureBasic/bitmap-histogram.purebasic new file mode 100644 index 0000000000..ab64542dd2 --- /dev/null +++ b/Task/Bitmap-Histogram/PureBasic/bitmap-histogram.purebasic @@ -0,0 +1,63 @@ +Procedure getHistogram(image, Array histogram(1)) + Protected w = ImageWidth(image) - 1 + Protected h = ImageHeight(image) - 1 + Dim histogram(255) ;output + + StartDrawing(ImageOutput(image)) + For x = 0 To w + For y = 0 To h + lum = Red(Point(x, y)) ;the Green or Blue color components could be used also + histogram(lum) + 1 + Next + Next + StopDrawing() +EndProcedure + +Procedure median(Array histogram(1)) + Protected low, high = 255, left, right + + While low <> high + If left < right + low + 1 + left + histogram(low) + Else + high - 1 + right + histogram(high) + EndIf + Wend + ProcedureReturn low +EndProcedure + +Procedure blackAndWhite(image, median) + Protected w = ImageWidth(image) - 1 + Protected h = ImageHeight(image) - 1 + CallDebugger + StartDrawing(ImageOutput(image)) + For x = 0 To w + For y = 0 To h + If Red(Point(x, y)) < median ;the Green or Blue color components could be used also + Plot(x, y, $000000) ;black + Else + Plot(x, y, $FFFFFF) ;white + EndIf + Next + Next + StopDrawing() +EndProcedure + +Define sourceFile.s, outputFile.s, image = 3, m +Dim histogram(255) + +sourceFile = OpenFileRequester("Select source image file", "*.ppm", "PPM image (*.ppm)|PPM", 0) + +If sourceFile And LCase(GetExtensionPart(sourceFile)) = "ppm" + LoadImagePPM(image, sourceFile) + ImageGrayout(image) + + getHistogram(image,histogram()) + m = median(histogram()) + blackAndWhite(image, m) + + outputFile = Left(sourceFile, Len(sourceFile) - Len(GetExtensionPart(sourceFile))) + "_bw." + GetExtensionPart(sourceFile) + SaveImageAsPPM(image, outputFile, 1) +EndIf diff --git a/Task/Bitmap-Histogram/Vedit-macro-language/bitmap-histogram.vedit b/Task/Bitmap-Histogram/Vedit-macro-language/bitmap-histogram.vedit new file mode 100644 index 0000000000..df0380645d --- /dev/null +++ b/Task/Bitmap-Histogram/Vedit-macro-language/bitmap-histogram.vedit @@ -0,0 +1,10 @@ +:HISTOGRAM: +#30 = Buf_Free // #30 = buffer to store histogram data +for (#9=0; #9<256; #9++) { + Out_Reg(21) TC(#9) Out_Reg(Clear) // @21 = intensity value to be counted + Buf_Switch(#15) // switch to image buffer + #8 = Search(@21, CASE+BEGIN+ALL+NOERR) // count intensity values + Buf_Switch(#30) // switch to histogram buffer + Num_Ins(#8, FILL) // store count +} +Return diff --git a/Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-1.mathematica b/Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-1.math similarity index 100% rename from Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-1.mathematica rename to Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-1.math diff --git a/Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-2.mathematica b/Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-2.math similarity index 100% rename from Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-2.mathematica rename to Task/Bitmap-Midpoint-circle-algorithm/Mathematica/bitmap-midpoint-circle-algorithm-2.math diff --git a/Task/Bitmap-Midpoint-circle-algorithm/PL-I/bitmap-midpoint-circle-algorithm-1.pli b/Task/Bitmap-Midpoint-circle-algorithm/PL-I/bitmap-midpoint-circle-algorithm-1.pli new file mode 100644 index 0000000000..53a26c45cf --- /dev/null +++ b/Task/Bitmap-Midpoint-circle-algorithm/PL-I/bitmap-midpoint-circle-algorithm-1.pli @@ -0,0 +1,52 @@ +/* Plot three circles. */ + +CIRCLE: PROCEDURE OPTIONS (MAIN); + declare image (-20:20, -20:20) character (1); + declare j fixed binary; + + image = '.'; + image(0,*) = '-'; + image(*,0) = '|'; + image(0,0) = '+'; + + CALL DRAW_CIRCLE (0, 0, 11); + CALL DRAW_CIRCLE (0, 0, 8); + CALL DRAW_CIRCLE (0, 0, 19); + + do j = hbound(image,1) to lbound(image,1) by -1; + put skip edit (image(j,*)) (a(1)); + end; + +draw_circle: procedure (x0, y0, radius); /* 14 May 2010. */ + declare ( x0, y0, radius ) fixed binary; + declare ( ddfx, ddfy, x, y, f ) fixed binary; + declare debug bit (1) aligned static initial ('0'b); + + f = 1-radius; + ddfx = 1; + ddfy = -2*radius; + x = 0; + y = radius; + image(x0, y0+radius) = '*'; /* Octet 0. */ + image(x0+radius, y0) = '*'; /* Octet 1. */ + image(x0, y0-radius) = '*'; /* Octet 2. */ + image(x0-radius, y0) = '*'; /* Octet 3. */ + + do while (x < y); + if f >= 0 then + do; y = y - 1; ddfy = ddfy +2; f = f + ddfy; end; + x = x + 1; + ddfx = ddfx + 2; + f = f + ddfx; + image(x0+x, y0+y) = '0'; /* Draws octant 0. */ + image(x0+y, y0+x) = '1'; /* Draws octant 1. */ + image(x0+y, y0-x) = '2'; /* Draws octant 2. */ + image(x0+x, y0-y) = '3'; /* Draws octant 3. */ + image(x0-x, y0-y) = '4'; /* Draws octant 4. */ + image(x0-y, y0-x) = '5'; /* Draws octant 5. */ + image(x0-y, y0+x) = '6'; /* Draws octant 6. */ + image(x0-x, y0+y) = '7'; /* Draws octant 7. */ + end; +end draw_circle; + +END CIRCLE; diff --git a/Task/Bitmap-Midpoint-circle-algorithm/PL-I/bitmap-midpoint-circle-algorithm-2.pli b/Task/Bitmap-Midpoint-circle-algorithm/PL-I/bitmap-midpoint-circle-algorithm-2.pli new file mode 100644 index 0000000000..aa545bca6f --- /dev/null +++ b/Task/Bitmap-Midpoint-circle-algorithm/PL-I/bitmap-midpoint-circle-algorithm-2.pli @@ -0,0 +1,41 @@ +....................|.................... +................2222*1111................ +.............222....|....111............. +...........22.......|.......11........... +..........2.........|.........1.......... +........22..........|..........11........ +.......3............|............0....... +......2.............|.............1...... +.....3..............|..............0..... +.....3...........222*111...........0..... +....3..........22...|...11..........0.... +...3..........2.....|.....1..........0... +...3........32....22*11....11........0... +..3.........3...22..|..11...0.........0.. +..3........3...3....|....0...0........0.. +..3.......3...2.....|.....1...0.......0.. +.3........3..3......|......0..0........0. +.3.......3...3......|......0...0.......0. +.3.......3..3.......|.......0..0.......0. +.3.......3..3.......|.......0..0.......0. +-*-------*--*-------+-------*--*-------*- +.4.......4..4.......|.......7..7.......7. +.4.......4..4.......|.......7..7.......7. +.4.......4...4......|......7...7.......7. +.4........4..4......|......7..7........7. +..4.......4...5.....|.....6...7.......7.. +..4........4...4....|....7...7........7.. +..4.........4...55..|..66...7.........7.. +...4........55....55*66....67........7... +...4..........5.....|.....6..........7... +....4..........55...|...66..........7.... +.....4...........555*666...........7..... +.....4..............|..............7..... +......5.............|.............6...... +.......4............|............7....... +........55..........|..........66........ +..........5.........|.........6.......... +...........55.......|.......66........... +.............555....|....666............. +................5555*6666................ +....................|.................... diff --git a/Task/Bitmap-Midpoint-circle-algorithm/PureBasic/bitmap-midpoint-circle-algorithm.purebasic b/Task/Bitmap-Midpoint-circle-algorithm/PureBasic/bitmap-midpoint-circle-algorithm.purebasic new file mode 100644 index 0000000000..5d414f62fa --- /dev/null +++ b/Task/Bitmap-Midpoint-circle-algorithm/PureBasic/bitmap-midpoint-circle-algorithm.purebasic @@ -0,0 +1,40 @@ +Procedure rasterCircle(cx, cy, r, Color) + ;circle must lie completely within the image boundaries + Protected f= 1 - r + Protected ddF_X, ddF_Y = -2 * r + Protected x, y = r + + Plot(cx, cy + r, Color) + Plot(cx, cy - r, Color) + Plot(cx + r, cy, Color) + Plot(cx - r, cy, Color) + While x < y + If f >= 0 + y - 1 + ddF_Y + 2 + f + ddF_Y + EndIf + x + 1 + ddF_X + 2 + f + ddF_X + 1 + Plot(cx + x, cy + y, Color) + Plot(cx - x, cy + y, Color) + Plot(cx + x, cy - y, Color) + Plot(cx - x, cy - y, Color) + Plot(cx + y, cy + x, Color) + Plot(cx - y, cy + x, Color) + Plot(cx + y, cy - x, Color) + Plot(cx - y, cy - x, Color) + Wend +EndProcedure + +OpenWindow(0, 0, 0, 100, 100, "MidPoint Circle Algorithm", #PB_Window_SystemMenu) +CreateImage(0, 100, 100, 32) +StartDrawing(ImageOutput(0)) + Box(0, 0, 100, 100, RGB(0, 0, 0)) + rasterCircle(25, 25, 20, RGB(255, 255, 255)) + rasterCircle(50, 50, 40, RGB(255, 0, 0)) +StopDrawing() +ImageGadget(0, 0, 0, 0, 0, ImageID(0)) + +Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow diff --git a/Task/Bitmap-Midpoint-circle-algorithm/Vedit-macro-language/bitmap-midpoint-circle-algorithm.vedit b/Task/Bitmap-Midpoint-circle-algorithm/Vedit-macro-language/bitmap-midpoint-circle-algorithm.vedit new file mode 100644 index 0000000000..3a37522166 --- /dev/null +++ b/Task/Bitmap-Midpoint-circle-algorithm/Vedit-macro-language/bitmap-midpoint-circle-algorithm.vedit @@ -0,0 +1,30 @@ +// Draw a circle using Bresenham's circle algorithm. +// #21 = center x, #22 = center y; #23 = radius + +:DRAW_CIRCLE: +#30 = 1 - #23 // f +#31 = 0 // ddF_x +#32 = -2 * #23 // ddF_y +#41 = 0 // x +#42 = #23 // y + +while (#41 <= #42) { + #1 = #21+#41; #2 = #22+#42; Call("DRAW_PIXEL") + #1 = #21-#41; #2 = #22+#42; Call("DRAW_PIXEL") + #1 = #21+#41; #2 = #22-#42; Call("DRAW_PIXEL") + #1 = #21-#41; #2 = #22-#42; Call("DRAW_PIXEL") + #1 = #21+#42; #2 = #22+#41; Call("DRAW_PIXEL") + #1 = #21-#42; #2 = #22+#41; Call("DRAW_PIXEL") + #1 = #21+#42; #2 = #22-#41; Call("DRAW_PIXEL") + #1 = #21-#42; #2 = #22-#41; Call("DRAW_PIXEL") + if (#30 >= 0) { + #42-- + #32 += 2 + #30 += #32 + } + #41++ + #31 += 2 + #30 += #31 + 1 +} + +return diff --git a/Task/Bitmap-Midpoint-circle-algorithm/XPL0/bitmap-midpoint-circle-algorithm.xpl0 b/Task/Bitmap-Midpoint-circle-algorithm/XPL0/bitmap-midpoint-circle-algorithm.xpl0 new file mode 100644 index 0000000000..5698257702 --- /dev/null +++ b/Task/Bitmap-Midpoint-circle-algorithm/XPL0/bitmap-midpoint-circle-algorithm.xpl0 @@ -0,0 +1,38 @@ +include c:\cxpl\codes; \include 'code' declarations + +proc Circle(X0, Y0, Radius, Color); \Display a circle +int X0, Y0, \coordinates of center + Radius, \radius in (pixels) + Color; \line color +int X, Y, E, U, V; + + proc PlotOctants; \Segment + [Point(X0+Y, Y0+X, Color); \ 0 + Point(X0+X, Y0+Y, Color); \ 1 + Point(X0-X, Y0+Y, Color); \ 2 + Point(X0-Y, Y0+X, Color); \ 3 + Point(X0-Y, Y0-X, Color); \ 4 + Point(X0-X, Y0-Y, Color); \ 5 + Point(X0+X, Y0-Y, Color); \ 6 + Point(X0+Y, Y0-X, Color); \ 7 + ]; \PlotOctants + +[X:= 0; Y:= Radius; +U:= 1; +V:= 1 -Radius -Radius; +E:= 1 -Radius; +while X < Y do + [PlotOctants; + if E < 0 then + [U:= U+2; V:= V+2; E:= E+U] + else [U:= U+2; V:= V+4; E:= E+V; Y:= Y-1]; + X:= X+1; + ]; +if X = Y then PlotOctants; +]; \Circle + +[SetVid($112); \640x480 in 24-bit RGB color +Circle(110, 110, 50, $FFFF00); +if ChIn(1) then []; \wait for keystroke +SetVid(3); \restore normal text mode +] diff --git a/Task/Bitmap-Read-a-PPM-file/Mathematica/bitmap-read-a-ppm-file.mathematica b/Task/Bitmap-Read-a-PPM-file/Mathematica/bitmap-read-a-ppm-file.math similarity index 100% rename from Task/Bitmap-Read-a-PPM-file/Mathematica/bitmap-read-a-ppm-file.mathematica rename to Task/Bitmap-Read-a-PPM-file/Mathematica/bitmap-read-a-ppm-file.math diff --git a/Task/Bitmap-Read-a-PPM-file/OCaml/bitmap-read-a-ppm-file-1.ocaml b/Task/Bitmap-Read-a-PPM-file/OCaml/bitmap-read-a-ppm-file-1.ocaml new file mode 100644 index 0000000000..c09406e3cd --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/OCaml/bitmap-read-a-ppm-file-1.ocaml @@ -0,0 +1,38 @@ +let read_ppm ~filename = + let ic = open_in filename in + let line = input_line ic in + if line <> "P6" then invalid_arg "not a P6 ppm file"; + let line = input_line ic in + let line = + try if line.[0] = '#' (* skip comments *) + then input_line ic + else line + with _ -> line + in + let width, height = + Scanf.sscanf line "%d %d" (fun w h -> (w, h)) + in + let line = input_line ic in + if line <> "255" then invalid_arg "not a 8 bit depth image"; + let all_channels = + let kind = Bigarray.int8_unsigned + and layout = Bigarray.c_layout + in + Bigarray.Array3.create kind layout 3 width height + in + let r_channel = Bigarray.Array3.slice_left_2 all_channels 0 + and g_channel = Bigarray.Array3.slice_left_2 all_channels 1 + and b_channel = Bigarray.Array3.slice_left_2 all_channels 2 + in + for y = 0 to pred height do + for x = 0 to pred width do + r_channel.{x,y} <- (input_byte ic); + g_channel.{x,y} <- (input_byte ic); + b_channel.{x,y} <- (input_byte ic); + done; + done; + close_in ic; + (all_channels, + r_channel, + g_channel, + b_channel) diff --git a/Task/Bitmap-Read-a-PPM-file/OCaml/bitmap-read-a-ppm-file-2.ocaml b/Task/Bitmap-Read-a-PPM-file/OCaml/bitmap-read-a-ppm-file-2.ocaml new file mode 100644 index 0000000000..20c1e486d6 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/OCaml/bitmap-read-a-ppm-file-2.ocaml @@ -0,0 +1,5 @@ +let () = + let img = read_ppm ~filename:"logo.ppm" in + let img = to_color(to_grayscale ~img) in + output_ppm ~oc:stdout ~img; +;; diff --git a/Task/Bitmap-Read-a-PPM-file/Oz/bitmap-read-a-ppm-file-1.oz b/Task/Bitmap-Read-a-PPM-file/Oz/bitmap-read-a-ppm-file-1.oz new file mode 100644 index 0000000000..5d3fd1c6e4 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/Oz/bitmap-read-a-ppm-file-1.oz @@ -0,0 +1,84 @@ +functor +import + Bitmap + Open +export + Read + %% Write +define + fun {Read Filename} + F = {New Open.file init(name:Filename)} + + fun {ReadColor8 _} + Bytes = {F read(list:$ size:3)} + in + {List.toTuple color Bytes} + end + + fun {ReadColor16 _} + Bytes = {F read(list:$ size:6)} + in + {List.toTuple color {Map {PairUp Bytes} FromBytes}} + end + in + try + Magic = {F read(size:2 list:$)} + if Magic \= "P6" then raise bitmapIO(read unsupportedFormat(Magic)) end end + Width = {ReadNumber F} + Height = {ReadNumber F} + MaxVal = {ReadNumber F} + MaxVal =< 0xffff = true + Reader = if MaxVal =< 0xff then ReadColor8 else ReadColor16 end + B = {Bitmap.new Width Height} + in + {Bitmap.transform B Reader} + B + finally + {F close} + end + end + + fun {ReadNumber F} + Ds + in + {SkipWS F} + Ds = for collect:Collect break:Break do + [C] = {F read(list:$ size:1)} + in + if {Char.isDigit C} then {Collect C} + else {Break} + end + end + {SkipWS F} + {String.toInt Ds} + end + + proc {SkipWS F} + [C] = {F read(list:$ size:1)} + in + if {Char.isSpace C} then {SkipWS F} + elseif C == &# then + {SkipLine F} + else + {F seek(whence:current offset:~1)} + end + end + + proc {SkipLine F} + [C] = {F read(list:$ size:1)} + in + if C \= &\n andthen C \= &\r then {SkipLine F} end + end + + fun {PairUp Xs} + case Xs of X1|X2|Xr then [X1 X2]|{PairUp Xr} + [] nil then nil + end + end + + fun {FromBytes [C1 C2]} + C1 * 0x100 + C2 + end + + %% Omitted: Write +end diff --git a/Task/Bitmap-Read-a-PPM-file/Oz/bitmap-read-a-ppm-file-2.oz b/Task/Bitmap-Read-a-PPM-file/Oz/bitmap-read-a-ppm-file-2.oz new file mode 100644 index 0000000000..bf55340ac7 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/Oz/bitmap-read-a-ppm-file-2.oz @@ -0,0 +1,7 @@ +declare + [BitmapIO Grayscale] = {Module.link ['BitmapIO.ozf' 'Grayscale.ozf']} + + B = {BitmapIO.read "image.ppm"} + G = {Grayscale.toGraymap B} +in + {BitmapIO.write {Grayscale.fromGraymap G} "greyimage.ppm"} diff --git a/Task/Bitmap-Read-a-PPM-file/PL-I/bitmap-read-a-ppm-file.pli b/Task/Bitmap-Read-a-PPM-file/PL-I/bitmap-read-a-ppm-file.pli new file mode 100644 index 0000000000..36d3ee87b3 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/PL-I/bitmap-read-a-ppm-file.pli @@ -0,0 +1,64 @@ +/* BITMAP FILE: read in a file in PPM format, P6 (binary). 14/5/2010 */ +test: procedure options (main); + declare (m, n, max_color, i, j) fixed binary (31); + declare ch character (1), ID character (2); + declare 1 pixel union, + 2 color bit(24) aligned, + 2 primary_colors, + 3 R char (1), + 3 G char (1), + 3 B char (1); + declare in file record; + + open file (in) title ('/IMAGE.PPM,TYPE(FIXED),RECSIZE(1)' ) input; + + call get_char; + ID = ch; + call get_char; + substr(ID, 2,1) = ch; + /* Read in the dimensions of the image */ + call get_integer (m); + call get_integer (n); + + /* Read in the maximum color size used */ + call get_integer (max_color); + /* The previous call reads in ONE line feed or CR or other terminator */ + /* character. */ + +begin; + declare image (0:m-1,0:n-1) bit (24); + + do i = 0 to hbound(image, 1); + do j = 0 to hbound(image,2); + read file (in) into (R); + read file (in) into (G); + read file (in) into (B); + image(i,j) = color; + end; + end; +end; + +get_char: procedure; + do until (ch ^= ' '); + read file (in) into (ch); + end; +end get_char; + +get_integer: procedure (value); + declare value fixed binary (31); + + do until (ch = ' '); + read file (in) into (ch); + end; + value = 0; + do until (is_digit(ch)); + value = value*10 + ch; + read file (in) into (ch); + end; +end get_integer; + +is_digit: procedure (ch) returns (bit(1)); + declare ch character (1); + return (index('0123456789', ch) > 0); +end is_digit; +end test; diff --git a/Task/Bitmap-Read-a-PPM-file/PureBasic/bitmap-read-a-ppm-file-1.purebasic b/Task/Bitmap-Read-a-PPM-file/PureBasic/bitmap-read-a-ppm-file-1.purebasic new file mode 100644 index 0000000000..d92af796d7 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/PureBasic/bitmap-read-a-ppm-file-1.purebasic @@ -0,0 +1,58 @@ +Structure PPMColor + r.c + g.c + b.c +EndStructure + +Procedure LoadImagePPM(Image, file$) + ; Author Roger Rösch (Nickname Macros) + IDFile = ReadFile(#PB_Any, file$) + If IDFile + If CreateImage(Image, 1, 1) + Format$ = ReadString(IDFile) + ReadString(IDFile) ; skip comment + Dimensions$ = ReadString(IDFile) + w = Val(StringField(Dimensions$, 1, " ")) + h = Val(StringField(Dimensions$, 2, " ")) + ResizeImage(Image, w, h) + StartDrawing(ImageOutput(Image)) + max = Val(ReadString(IDFile)) ; Maximal Value for a color + Select Format$ + Case "P3" ; File in ASCII format + ; Exract everey number remaining in th file into an array using an RegEx + Stringlen = Lof(IDFile) - Loc(IDFile) + content$ = Space(Stringlen) + Dim color.s(0) + ReadData(IDFile, @content$, Stringlen) + CreateRegularExpression(1, "\d+") + ExtractRegularExpression(1, content$, color()) + ; Plot color information on our empty Image + For y = 0 To h - 1 + For x = 0 To w - 1 + pos = (y*w + x)*3 + r=Val(color(pos))*255 / max + g=Val(color(pos+1))*255 / max + b=Val(color(pos+2))*255 / max + Plot(x, y, RGB(r,g,b)) + Next + Next + Case "P6" ;File In binary format + ; Read whole bytes into a buffer because its faster than reading single ones + Bufferlen = Lof(IDFile) - Loc(IDFile) + *Buffer = AllocateMemory(Bufferlen) + ReadData(IDFile, *Buffer, Bufferlen) + ; Plot color information on our empty Image + For y = 0 To h - 1 + For x = 0 To w - 1 + *color.PPMColor = pos + *Buffer + Plot(x, y, RGB(*color\r*255 / max, *color\g*255 / max, *color\b*255 / max)) + pos + 3 + Next + Next + EndSelect + StopDrawing() + ; Return 1 if successfully loaded to behave as other PureBasic functions + ProcedureReturn 1 + EndIf + EndIf +EndProcedure diff --git a/Task/Bitmap-Read-a-PPM-file/PureBasic/bitmap-read-a-ppm-file-2.purebasic b/Task/Bitmap-Read-a-PPM-file/PureBasic/bitmap-read-a-ppm-file-2.purebasic new file mode 100644 index 0000000000..833793d7b2 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/PureBasic/bitmap-read-a-ppm-file-2.purebasic @@ -0,0 +1,8 @@ +Define file.s, file2.s, image = 3 +file = OpenFileRequester("Select source image file", "", "PPM image (*.ppm)|*.ppm", 0) +If file And LCase(GetExtensionPart(file)) = "ppm" + LoadImagePPM(image, file) + ImageGrayout(image) + file2 = Left(file, Len(file) - Len(GetExtensionPart(file))) + "_grayscale." + GetExtensionPart(file) + SaveImageAsPPM(image, file2, 1) +EndIf diff --git a/Task/Bitmap-Read-a-PPM-file/Seed7/bitmap-read-a-ppm-file.seed7 b/Task/Bitmap-Read-a-PPM-file/Seed7/bitmap-read-a-ppm-file.seed7 new file mode 100644 index 0000000000..ce45e2ba68 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/Seed7/bitmap-read-a-ppm-file.seed7 @@ -0,0 +1,36 @@ +$ include "seed7_05.s7i"; + include "draw.s7i"; + include "color.s7i"; + +const func PRIMITIVE_WINDOW: getPPM (in string: fileName) is func + result + var PRIMITIVE_WINDOW: aWindow is PRIMITIVE_WINDOW.value; + local + var file: ppmFile is STD_NULL; + var string: line is ""; + var integer: width is 0; + var integer: height is 0; + var integer: x is 0; + var integer: y is 0; + var color: pixColor is black; + begin + ppmFile := open(fileName, "r"); + if ppmFile <> STD_NULL then + if getln(ppmFile) = "P6" then + repeat + line := getln(ppmFile); + until line = "" or line[1] <> '#'; + read(ppmFile, width); + readln(ppmFile, height); + aWindow := newPixmap(width, height); + for y range 0 to pred(height) do + for x range 0 to pred(width) do + pixColor.red_part := ord(getc(ppmFile)); + pixColor.green_part := ord(getc(ppmFile)); + pixColor.blue_part := ord(getc(ppmFile)); + end for; + end for; + end if; + close(ppmFile); + end if; + end func; diff --git a/Task/Bitmap-Read-a-PPM-file/Vedit-macro-language/bitmap-read-a-ppm-file-1.vedit b/Task/Bitmap-Read-a-PPM-file/Vedit-macro-language/bitmap-read-a-ppm-file-1.vedit new file mode 100644 index 0000000000..c5de2d216f --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/Vedit-macro-language/bitmap-read-a-ppm-file-1.vedit @@ -0,0 +1,17 @@ +// Load a PPM file +// @10 = filename +// On return: +// #10 points to buffer containing pixel data, +// #11 = width, #12 = height. + +:LOAD_PPM: +File_Open(@10) +BOF +Search("|X", ADVANCE) // skip "P6" +#11 = Num_Eval(ADVANCE) // #11 = width +Match("|X", ADVANCE) // skip separator +#12 = Num_Eval(ADVANCE) // #12 = height +Match("|X", ADVANCE) +Search("|X", ADVANCE) // skip maxval (assume 255) +Del_Block(0,CP) // remove the header +Return diff --git a/Task/Bitmap-Read-a-PPM-file/Vedit-macro-language/bitmap-read-a-ppm-file-2.vedit b/Task/Bitmap-Read-a-PPM-file/Vedit-macro-language/bitmap-read-a-ppm-file-2.vedit new file mode 100644 index 0000000000..e91eea2bb6 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/Vedit-macro-language/bitmap-read-a-ppm-file-2.vedit @@ -0,0 +1,19 @@ +// Load RGB image +Reg_Set(10, "|(USER_MACRO)\example.ppm") +Call("LOAD_PPM") + +// Convert to grayscale +#10 = Buf_Num +Call("RGB_TO_GRAYSCALE") +Buf_Switch(#10) Buf_Quit(OK) + +// Convert to RGB +Call("GRAYSCALE_TO_RGB") + +// Save the image +Reg_Set(10, "|(USER_MACRO)\example_gray.ppm") +Call("SAVE_PPM") + +// Cleanup and exit +Buf_Switch(#20) Buf_Quit(OK) +return diff --git a/Task/Bitmap-Read-a-PPM-file/XPL0/bitmap-read-a-ppm-file.xpl0 b/Task/Bitmap-Read-a-PPM-file/XPL0/bitmap-read-a-ppm-file.xpl0 new file mode 100644 index 0000000000..413022d0a1 --- /dev/null +++ b/Task/Bitmap-Read-a-PPM-file/XPL0/bitmap-read-a-ppm-file.xpl0 @@ -0,0 +1,45 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations + +func OpenInFile; \Open for input the file typed on command line +int CpuReg, Handle; +char CmdTail($80); +[CpuReg:= GetReg; +Blit(CpuReg(11), $81, CpuReg(12), CmdTail, $7F); \get copy of command line +Trap(false); \turn off error trapping +Handle:= FOpen(CmdTail, 0); \open named file for input +FSet(Handle, ^I); \assign file to input device 3 +OpenI(3); \initialize input buffer pointers +if GetErr then return false; +Trap(true); +return true; +]; + +int C, X, Y, Width, Height, Max, Lum; +real Red, Green, Blue; +[if not OpenInFile then [Text(0, "File not found"); exit]; +if ChIn(3)#^P or ChIn(3)#^6 then [Text(0, "Not P6 PPM file"); exit]; +repeat loop [C:= ChIn(3); + if C # ^# then quit; + repeat C:= ChIn(3) until C=$0A\EOL\; + ]; +until C>=^0 & C<=^9; +Backup; \back up so IntIn re-reads first digit +Width:= IntIn(3); \(skips any whitespace) +Height:= IntIn(3); +Max:= IntIn(3) + 1; \(255/15=17; 256/16=16) +case of + Width<= 640 & Height<=480: SetVid($112); + Width<= 800 & Height<=600: SetVid($115); + Width<=1024 & Height<=768: SetVid($118) +other SetVid($11B); \1280x1024 +for Y:= 0 to Height-1 do + for X:= 0 to Width-1 do + [Red := float(ChIn(3)*256/Max) * 0.21; \convert color to grayscale + Green:= float(ChIn(3)*256/Max) * 0.72; + Blue := float(ChIn(3)*256/Max) * 0.07; + Lum:= fix(Red) + fix(Green) + fix(Blue); + Point(X, Y, Lum<<16 + Lum<<8 + Lum); + ]; +X:= ChIn(1); \wait for keystroke +SetVid(3); \restore normal text display +] diff --git a/Task/Bitmap-Read-an-image-through-a-pipe/OCaml/bitmap-read-an-image-through-a-pipe.ocaml b/Task/Bitmap-Read-an-image-through-a-pipe/OCaml/bitmap-read-an-image-through-a-pipe.ocaml new file mode 100644 index 0000000000..3734dcd981 --- /dev/null +++ b/Task/Bitmap-Read-an-image-through-a-pipe/OCaml/bitmap-read-an-image-through-a-pipe.ocaml @@ -0,0 +1,8 @@ +let read_image ~filename = + if not(Sys.file_exists filename) + then failwith(Printf.sprintf "the file %s does not exist" filename); + let cmd = Printf.sprintf "convert \"%s\" ppm:-" filename in + let ic, oc = Unix.open_process cmd in + let img = read_ppm ~ic in + (img) +;; diff --git a/Task/Bitmap-Write-a-PPM-file/Mathematica/bitmap-write-a-ppm-file.mathematica b/Task/Bitmap-Write-a-PPM-file/Mathematica/bitmap-write-a-ppm-file.math similarity index 100% rename from Task/Bitmap-Write-a-PPM-file/Mathematica/bitmap-write-a-ppm-file.mathematica rename to Task/Bitmap-Write-a-PPM-file/Mathematica/bitmap-write-a-ppm-file.math diff --git a/Task/Bitmap-Write-a-PPM-file/Oz/bitmap-write-a-ppm-file.oz b/Task/Bitmap-Write-a-PPM-file/Oz/bitmap-write-a-ppm-file.oz new file mode 100644 index 0000000000..dca6a5e19e --- /dev/null +++ b/Task/Bitmap-Write-a-PPM-file/Oz/bitmap-write-a-ppm-file.oz @@ -0,0 +1,39 @@ +functor +import + Bitmap + Open +export + %% Read + Write +define + %% Omitted: Read + + proc {Write B=bitmap(array2d(width:W height:H ...)) Filename} + F = {New Open.file init(name:Filename flags:[write create truncate binary])} + + proc {WriteColor8 color(R G B)} + {F write(vs:[R G B])} + end + + fun {ToBytes C} + [C div 0x100 C mod 0x100] + end + + proc {WriteColor16 color(R G B)} + {F write(vs:{Flatten {Map [R G B] ToBytes}})} + end + + MaxCol = {Bitmap.maxValue B} + MaxVal#Writer = if MaxCol =< 0xff then 0xff#WriteColor8 + else 0xffff#WriteColor16 + end + Header = "P6\n"#W#" "#H#" "#MaxVal#"\n" + in + try + {F write(vs:Header)} + {Bitmap.forAllPixels B Writer} + finally + {F close} + end + end +end diff --git a/Task/Bitmap-Write-a-PPM-file/PL-I/bitmap-write-a-ppm-file.pli b/Task/Bitmap-Write-a-PPM-file/PL-I/bitmap-write-a-ppm-file.pli new file mode 100644 index 0000000000..42e74adc3a --- /dev/null +++ b/Task/Bitmap-Write-a-PPM-file/PL-I/bitmap-write-a-ppm-file.pli @@ -0,0 +1,47 @@ +/* BITMAP FILE: write out a file in PPM format, P6 (binary). 14/5/2010 */ +test: procedure options (main); + declare image (0:19,0:19) bit (24); + declare 1 pixel union, + 2 color bit (24) aligned, + 2 primaries, + 3 R character (1), + 3 G character (1), + 3 B character (1); + declare ch character (1); + declare (i, j) fixed binary; + declare out file record; + + open file (out) title ('/IMAGE.PPM,TYPE(FIXED),RECSIZE(1)' ) OUTPUT; + + ch = 'P'; write file (out) from (ch); + ch = '6'; write file (out) from (ch); + + call put_integer (hbound(image, 1)); + call put_integer (hbound(image, 2)); + call put_integer (255); + + do i = 0 to hbound(image,1); + do j = 0 to hbound(image, 2); + color = image(i,j); + write file (out) from (R); + write file (out) from (G); + write file (out) from (B); + end; + end; + +put_integer: procedure (k); + declare k fixed binary; + declare s character (30) varying; + declare i fixed binary; + declare ch character (1); + + s = k; + s = trim(s); + do i = 1 to length(s); + ch = substr(s, i, 1); + write file (out) from (ch); + end; + ch = '09'x; + write file (out) from (ch); +end put_integer; +end test; diff --git a/Task/Bitmap-Write-a-PPM-file/Perl-6/bitmap-write-a-ppm-file.pl6 b/Task/Bitmap-Write-a-PPM-file/Perl-6/bitmap-write-a-ppm-file.pl6 new file mode 100644 index 0000000000..5c8fe02abe --- /dev/null +++ b/Task/Bitmap-Write-a-PPM-file/Perl-6/bitmap-write-a-ppm-file.pl6 @@ -0,0 +1,13 @@ +sub MAIN ($filename = 'default.ppm') { + my $width = my $height = 125; + + # Since P6 is a binary format, open in binary mode + my $out = open( $filename, :w, :bin ) or die "$!\n"; + + $out.say("P6\n$width $height\n255"); + + for ^$height X ^$width -> $r, $g { + $out.printf("%c%c%c", $r*2, $g*2, 255-$r*2); + } + $out.close; +} diff --git a/Task/Bitmap-Write-a-PPM-file/PureBasic/bitmap-write-a-ppm-file.purebasic b/Task/Bitmap-Write-a-PPM-file/PureBasic/bitmap-write-a-ppm-file.purebasic new file mode 100644 index 0000000000..0826deaf45 --- /dev/null +++ b/Task/Bitmap-Write-a-PPM-file/PureBasic/bitmap-write-a-ppm-file.purebasic @@ -0,0 +1,34 @@ +Procedure SaveImageAsPPM(Image, file$, Binary = 1) + ; Author Roger Rösch (Nickname Macros) + IDFiIe = CreateFile(#PB_Any, file$) + If IDFiIe + If StartDrawing(ImageOutput(Image)) + WriteStringN(IDFiIe, "P" + Str(3 + 3*Binary)) + WriteStringN(IDFiIe, "#Created with PureBasic using a Function created from Macros for Rosettacode.org ") + width = ImageWidth(Image) + height = ImageHeight(Image) + WriteStringN(IDFiIe, Str(width) + " " + Str(height)) + WriteStringN(IDFiIe, "255") + If Binary = 0 + For y = 0 To height - 1 + For x = 0 To width - 1 + color = Point(x, y) + WriteString(IDFiIe, Str(Red(color)) + " " + Str(Green(color)) + " " + Str(Blue(color)) + " ") + Next + WriteStringN(IDFiIe, "") + Next + Else ; Save in Binary Format + For y = 0 To height - 1 + For x = 0 To width - 1 + color = Point(x, y) + WriteByte(IDFiIe, Red(color)) + WriteByte(IDFiIe, Green(color)) + WriteByte(IDFiIe, Blue(color)) + Next + Next + EndIf + StopDrawing() + EndIf + CloseFile(IDFiIe) + EndIf +EndProcedure diff --git a/Task/Bitmap-Write-a-PPM-file/Seed7/bitmap-write-a-ppm-file.seed7 b/Task/Bitmap-Write-a-PPM-file/Seed7/bitmap-write-a-ppm-file.seed7 new file mode 100644 index 0000000000..e0f06155eb --- /dev/null +++ b/Task/Bitmap-Write-a-PPM-file/Seed7/bitmap-write-a-ppm-file.seed7 @@ -0,0 +1,25 @@ +$ include "seed7_05.s7i"; + include "draw.s7i"; + include "color.s7i"; + +const proc: writePPM (in string: fileName, in PRIMITIVE_WINDOW: aWindow) is func + local + var file: ppmFile is STD_NULL; + var integer: x is 0; + var integer: y is 0; + var color: pixColor is black; + begin + ppmFile := open(fileName, "w"); + if ppmFile <> STD_NULL then + writeln(ppmFile, "P6"); + writeln(ppmFile, width(aWindow) <& " " <& height(aWindow)); + writeln(ppmFile, "255"); + for y range 0 to pred(height(aWindow)) do + for x range 0 to pred(width(aWindow)) do + pixColor := getPixelColor(aWindow, x, y); + write(ppmFile, str(chr(pixColor.red_part)) <& chr(pixColor.green_part) <& chr(pixColor.blue_part)); + end for; + end for; + close(ppmFile); + end if; + end func; diff --git a/Task/Bitmap-Write-a-PPM-file/Visual-Basic-.NET/bitmap-write-a-ppm-file.visual b/Task/Bitmap-Write-a-PPM-file/Visual-Basic-.NET/bitmap-write-a-ppm-file.visual new file mode 100644 index 0000000000..1de24a760e --- /dev/null +++ b/Task/Bitmap-Write-a-PPM-file/Visual-Basic-.NET/bitmap-write-a-ppm-file.visual @@ -0,0 +1,17 @@ +Public Shared Sub SaveRasterBitmapToPpmFile(ByVal rasterBitmap As RasterBitmap, ByVal filepath As String) + Dim header As String = String.Format("P6{0}{1}{2}{3}{0}255{0}", vbLf, rasterBitmap.Width, " "c, rasterBitmap.Height) + Dim bufferSize As Integer = header.Length + (rasterBitmap.Width * rasterBitmap.Height * 3) + Dim bytes(bufferSize - 1) As Byte + Buffer.BlockCopy(Encoding.ASCII.GetBytes(header.ToString), 0, bytes, 0, header.Length) + Dim index As Integer = header.Length + For y As Integer = 0 To rasterBitmap.Height - 1 + For x As Integer = 0 To rasterBitmap.Width - 1 + Dim color As Rgb = rasterBitmap.GetPixel(x, y) + bytes(index) = color.R + bytes(index + 1) = color.G + bytes(index + 2) = color.B + index += 3 + Next + Next + My.Computer.FileSystem.WriteAllBytes(filepath, bytes, False) +End Sub diff --git a/Task/Bitmap-Write-a-PPM-file/XPL0/bitmap-write-a-ppm-file.xpl0 b/Task/Bitmap-Write-a-PPM-file/XPL0/bitmap-write-a-ppm-file.xpl0 new file mode 100644 index 0000000000..f2f125e874 --- /dev/null +++ b/Task/Bitmap-Write-a-PPM-file/XPL0/bitmap-write-a-ppm-file.xpl0 @@ -0,0 +1,38 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +def Width=180, Height=135, Color=$123456; + +proc WriteImage; \Write screen image to a a PPM file +int X, Y, C; +[Text(3,"P6 "); IntOut(3,Width); ChOut(3,^ ); IntOut(3,Height); Text(3," 255 +"); +for Y:= 0 to Height-1 do + for X:= 0 to Width-1 do + [C:= ReadPix(X, Y); + ChOut(3, C>>16); + ChOut(3, C>>8); + ChOut(3, C); + ]; +]; + +proc OpenOutFile(FN); \Open for output the named file +char FN; \file name string +int H; \handle +[H:= FOpen(FN, 1); +FSet(H, ^o); \small buffer allows multiple files, and it is +OpenO(3); \ closed automatically when the program exits +]; + +proc MakeImage; \Make a bitmap image +int X, Y; +[for Y:= 0 to Height-1 do \fill area with Color + for X:= 0 to Width-1 do + Point(X, Y, Color); +Move(60, 60); HexOut(6, ReadPix(0,0)); \show hex value of color of pixel at 0,0 +]; + +[SetVid($112); \set display for 640x480 graphics in 24-bit RGB color +MakeImage; +OpenOutFile("IMAGE.PPM"); +WriteImage; +SetVid(3); \restore display to normal text mode +] diff --git a/Task/Bitmap/KonsolScript/bitmap.konso b/Task/Bitmap/KonsolScript/bitmap.konsolscript similarity index 100% rename from Task/Bitmap/KonsolScript/bitmap.konso rename to Task/Bitmap/KonsolScript/bitmap.konsolscript diff --git a/Task/Bitmap/MAXScript/bitmap-1.max b/Task/Bitmap/MAXScript/bitmap-1.maxscript similarity index 100% rename from Task/Bitmap/MAXScript/bitmap-1.max rename to Task/Bitmap/MAXScript/bitmap-1.maxscript diff --git a/Task/Bitmap/MAXScript/bitmap-2.max b/Task/Bitmap/MAXScript/bitmap-2.maxscript similarity index 100% rename from Task/Bitmap/MAXScript/bitmap-2.max rename to Task/Bitmap/MAXScript/bitmap-2.maxscript diff --git a/Task/Bitmap/MAXScript/bitmap-3.max b/Task/Bitmap/MAXScript/bitmap-3.maxscript similarity index 100% rename from Task/Bitmap/MAXScript/bitmap-3.max rename to Task/Bitmap/MAXScript/bitmap-3.maxscript diff --git a/Task/Bitmap/MAXScript/bitmap-4.max b/Task/Bitmap/MAXScript/bitmap-4.maxscript similarity index 100% rename from Task/Bitmap/MAXScript/bitmap-4.max rename to Task/Bitmap/MAXScript/bitmap-4.maxscript diff --git a/Task/Bitmap/Mathematica/bitmap-1.mathematica b/Task/Bitmap/Mathematica/bitmap-1.math similarity index 100% rename from Task/Bitmap/Mathematica/bitmap-1.mathematica rename to Task/Bitmap/Mathematica/bitmap-1.math diff --git a/Task/Bitmap/Mathematica/bitmap-2.mathematica b/Task/Bitmap/Mathematica/bitmap-2.math similarity index 100% rename from Task/Bitmap/Mathematica/bitmap-2.mathematica rename to Task/Bitmap/Mathematica/bitmap-2.math diff --git a/Task/Bitmap/OCaml/bitmap-1.ocaml b/Task/Bitmap/OCaml/bitmap-1.ocaml new file mode 100644 index 0000000000..0bb3d4ce5e --- /dev/null +++ b/Task/Bitmap/OCaml/bitmap-1.ocaml @@ -0,0 +1,15 @@ +let new_img ~width ~height = + let all_channels = + let kind = Bigarray.int8_unsigned + and layout = Bigarray.c_layout + in + Bigarray.Array3.create kind layout 3 width height + in + let r_channel = Bigarray.Array3.slice_left_2 all_channels 0 + and g_channel = Bigarray.Array3.slice_left_2 all_channels 1 + and b_channel = Bigarray.Array3.slice_left_2 all_channels 2 + in + (all_channels, + r_channel, + g_channel, + b_channel) diff --git a/Task/Bitmap/OCaml/bitmap-2.ocaml b/Task/Bitmap/OCaml/bitmap-2.ocaml new file mode 100644 index 0000000000..a87edb4f49 --- /dev/null +++ b/Task/Bitmap/OCaml/bitmap-2.ocaml @@ -0,0 +1,12 @@ +let new_img ~width ~height = + let r_channel, g_channel, b_channel = + let kind = Bigarray.int8_unsigned + and layout = Bigarray.c_layout + in + (Bigarray.Array2.create kind layout width height, + Bigarray.Array2.create kind layout width height, + Bigarray.Array2.create kind layout width height) + in + (r_channel, + g_channel, + b_channel) diff --git a/Task/Bitmap/OCaml/bitmap-3.ocaml b/Task/Bitmap/OCaml/bitmap-3.ocaml new file mode 100644 index 0000000000..4324a9d91b --- /dev/null +++ b/Task/Bitmap/OCaml/bitmap-3.ocaml @@ -0,0 +1,5 @@ +let fill_img ~img:(_, r_channel, g_channel, b_channel) ~color:(r,g,b) = + Bigarray.Array2.fill r_channel r; + Bigarray.Array2.fill g_channel g; + Bigarray.Array2.fill b_channel b; +;; diff --git a/Task/Bitmap/OCaml/bitmap-4.ocaml b/Task/Bitmap/OCaml/bitmap-4.ocaml new file mode 100644 index 0000000000..172c440bbb --- /dev/null +++ b/Task/Bitmap/OCaml/bitmap-4.ocaml @@ -0,0 +1,6 @@ +let put_pixel_unsafe (_, r_channel, g_channel, b_channel) (r,g,b) = + (fun x y -> + r_channel.{x,y} <- r; + g_channel.{x,y} <- g; + b_channel.{x,y} <- b; + ) diff --git a/Task/Bitmap/OCaml/bitmap-5.ocaml b/Task/Bitmap/OCaml/bitmap-5.ocaml new file mode 100644 index 0000000000..0d879e5e0b --- /dev/null +++ b/Task/Bitmap/OCaml/bitmap-5.ocaml @@ -0,0 +1,6 @@ +let get_pixel_unsafe (_, r_channel, g_channel, b_channel) = + (fun x y -> + (r_channel.{x,y}, + g_channel.{x,y}, + b_channel.{x,y}) + ) diff --git a/Task/Bitmap/OCaml/bitmap-6.ocaml b/Task/Bitmap/OCaml/bitmap-6.ocaml new file mode 100644 index 0000000000..8816636693 --- /dev/null +++ b/Task/Bitmap/OCaml/bitmap-6.ocaml @@ -0,0 +1,24 @@ +let put_pixel img color x y = + let _, r_channel,_,_ = img in + let width = Bigarray.Array2.dim1 r_channel + and height = Bigarray.Array2.dim2 r_channel in + + if (x < 0) || (x >= width) then invalid_arg "x out of bounds"; + if (y < 0) || (y >= height) then invalid_arg "y out of bounds"; + + let r, g, b = color in + if (r < 0) || (r > 255) then invalid_arg "red out of bounds"; + if (g < 0) || (g > 255) then invalid_arg "green out of bounds"; + if (b < 0) || (b > 255) then invalid_arg "blue out of bounds"; + + put_pixel_unsafe img color x y; +;; + +let get_pixel ~img ~pt:(x, y) = + let _, r_channel,_,_ = img in + let width = Bigarray.Array2.dim1 r_channel + and height = Bigarray.Array2.dim2 r_channel in + if (x < 0) || (x >= width) then invalid_arg "x out of bounds"; + if (y < 0) || (y >= height) then invalid_arg "y out of bounds"; + get_pixel_unsafe img x y; +;; diff --git a/Task/Bitmap/OCaml/bitmap-7.ocaml b/Task/Bitmap/OCaml/bitmap-7.ocaml new file mode 100644 index 0000000000..d07ddafb4a --- /dev/null +++ b/Task/Bitmap/OCaml/bitmap-7.ocaml @@ -0,0 +1,4 @@ +let get_dims ~img:(_, r_channel, _, _) = + let width = Bigarray.Array2.dim1 r_channel + and height = Bigarray.Array2.dim2 r_channel in + (width, height) diff --git a/Task/Bitmap/Octave/bitmap-1.octave b/Task/Bitmap/Octave/bitmap-1.octave new file mode 100644 index 0000000000..e18e3ff153 --- /dev/null +++ b/Task/Bitmap/Octave/bitmap-1.octave @@ -0,0 +1,10 @@ +im = zeros(W, H, 3, "uint8"); % create an RGB image of width W and height H + % and intensity from 0 to 255; black (all zeros) +im(:,:,1) = 255; % set R to 255 +im(:,:,2) = 100; % set G to 100 +im(:,:,3) = 155; % set B to 155 +im(floor(W/2), floor(H/2), :) = 0; % pixel in the center made black +disp(im(floor(W/3), floor(H/3), :)) % display intensities of the pixel + % at W/3, H/3 +p = im(40,40,:); % or just store it in the vector p, so that + % p(1) is R, p(2) G and p(3) is B diff --git a/Task/Bitmap/Octave/bitmap-2.octave b/Task/Bitmap/Octave/bitmap-2.octave new file mode 100644 index 0000000000..7b899bbbef --- /dev/null +++ b/Task/Bitmap/Octave/bitmap-2.octave @@ -0,0 +1,21 @@ +function im = create_rgb_image(w, h) + im = zeros(w, h, 3, "uint8"); +endfunction + +function set_background(im, colorvector) + im(:,:,1) = colorvector(1); + im(:,:,2) = colorvector(2); + im(:,:,3) = colorvector(3); +endfunction + +function set_pixel(im, coord, colorvector) + im(coord(1), coord(2), 1) = colorvector(1); + im(coord(1), coord(2), 2) = colorvector(2); + im(coord(1), coord(2), 3) = colorvector(3); +endfunction + +function [r, g, b] = get_pixel(im, coord) + r = im(coord(1), coord(2), 1) + g = im(coord(1), coord(2), 2) + b = im(coord(1), coord(2), 3) +endfunction diff --git a/Task/Bitmap/Octave/bitmap-3.octave b/Task/Bitmap/Octave/bitmap-3.octave new file mode 100644 index 0000000000..0e616e986e --- /dev/null +++ b/Task/Bitmap/Octave/bitmap-3.octave @@ -0,0 +1,8 @@ +%example +im = create_rgb_image(200,200); +for x = 1:128 + im = set_pixel(im, [x, x], [200, 50, 220]); +endfor + +% it seems like saveimage wants double class on [0,1] +saveimage("image.ppm", double(im)./256, "ppm"); diff --git a/Task/Bitmap/OxygenBasic/bitmap.oxy b/Task/Bitmap/OxygenBasic/bitmap.oxy new file mode 100644 index 0000000000..c70f31cbdc --- /dev/null +++ b/Task/Bitmap/OxygenBasic/bitmap.oxy @@ -0,0 +1,41 @@ +'GENERIC BITMAP + +type pixel byte r,g,b + +'=========== +class BitMap +'=========== + +% sp sizeof(pixel) +sys wx,wy,px,py +string buf +sys pb +method Constructor(sys x=640,y=480) { wx=x : wy=y : buf=nuls x*y*sp : pb=strptr buf} +method Destructor() {buf="" : wx=0 : wy=0 : pb=0} +method GetPixel(sys x,y,pixel*p) {copy @p,pb+(y*wx+x)*sp,sp} +method SetPixel(sys x,y,pixel*p) {copy pb+(y*wx+x)*sp,@p,sp} +' +method Fill(pixel*p) + sys i, e=wx*wy*sp+pb-1 + for i=pb to e step sp {copy i,@p,sp} +end method + +end class + +pixel p,q + +new BitMap m(400,400) 'width, height in pixels + +p<=100,120,140 'red,green,blue + +m.fill p + +m.getPixel 200,100,q +print "" q.r "," q.g "," q.b 'result 100,120,140 +q<=10,20,40 +m.setPixel 200,100,q +m.getPixel 200,100,p +print "" p.r "," p.g "," p.b 'result 10,20,40 + + +del m diff --git a/Task/Bitmap/Oz/bitmap-1.oz b/Task/Bitmap/Oz/bitmap-1.oz new file mode 100644 index 0000000000..894345a7e0 --- /dev/null +++ b/Task/Bitmap/Oz/bitmap-1.oz @@ -0,0 +1,37 @@ +functor +export + New + Get + Set + Transform +define + fun {New Width Height Init} + C = {Array.new 1 Height unit} + in + for Row in 1..Height do + C.Row := {Array.new 1 Width Init} + end + + array2d(width:Width + height:Height + contents:C) + end + + fun {Get array2d(contents:C ...) X Y} + C.Y.X + end + + proc {Set array2d(contents:C ...) X Y Val} + C.Y.X := Val + end + + proc {Transform array2d(contents:C width:W height:H ...) Fun} + for Y in 1..H do + for X in 1..W do + C.Y.X := {Fun C.Y.X} + end + end + end + + %% omitted: Clone, Map, Fold, ForAll +end diff --git a/Task/Bitmap/Oz/bitmap-2.oz b/Task/Bitmap/Oz/bitmap-2.oz new file mode 100644 index 0000000000..f1a313cf1c --- /dev/null +++ b/Task/Bitmap/Oz/bitmap-2.oz @@ -0,0 +1,32 @@ +%% For real task prefer QTk's images: +%% http://www.mozart-oz.org/home/doc/mozart-stdlib/wp/qtk/html/node38.html + +functor +import + Array2D +export + New + Fill + GetPixel + SetPixel +define + Black = color(0x00 0x00 0x00) + + fun {New Width Height} + bitmap( {Array2D.new Width Height Black} ) + end + + proc {Fill bitmap(Arr) Color} + {Array2D.transform Arr fun {$ _} Color end} + end + + fun {GetPixel bitmap(Arr) X Y} + {Array2D.get Arr X Y} + end + + proc {SetPixel bitmap(Arr) X Y Color} + {Array2D.set Arr X Y Color} + end + + %% Omitted: MaxValue, ForAllPixels, Transform +end diff --git a/Task/Bitmap/PL-I/bitmap.pli b/Task/Bitmap/PL-I/bitmap.pli new file mode 100644 index 0000000000..6eadbb2e8a --- /dev/null +++ b/Task/Bitmap/PL-I/bitmap.pli @@ -0,0 +1,26 @@ +/* Declaration for an image, suitable for BMP files. */ +declare image(0:500, 0:500) bit (24) aligned; + +image = '000000000000000011111111'b; + /* Sets the entire image to red. */ + +image(10,40) = '111111110000000000000000'b; + /* Sets one pixel to blue. */ + +declare color bit (24) aligned; +color = image(20,50); /* Obtain the color of a pixel */ + + + +/* To allocate an image of size (x,y) */ +allocate_image: procedure (image, x, y); + declare image (*, *) controlled bit (24) aligned; + declare (x, y) fixed binary (31); + + allocate image (0:x, 0:y); +end allocate_image; + +/* To use the above procedure, it's necessary to define */ +/* the image in the calling program thus, for BMP images: */ + +declare image(*,*) controlled bit (24) aligned; diff --git a/Task/Bitmap/Pascal/bitmap.pascal b/Task/Bitmap/Pascal/bitmap.pascal new file mode 100644 index 0000000000..09867f7945 --- /dev/null +++ b/Task/Bitmap/Pascal/bitmap.pascal @@ -0,0 +1,131 @@ +Interface +uses crt, { GetDir } + graph; { function GetPixel } + +type { integer numbers } + { from unit bitmaps XPERT software production Tamer Fakhoury } + _bit = $00000000..$00000001; {number 1 bit without sign = (0..1) } + _byte = $00000000..$000000FF; {number 1 byte without sign = (0..255)} + _word = $00000000..$0000FFFF; {number 2 bytes without sign = (0..65 535)} + _dWord = $00000000..$7FFFFFFF; {number 4 bytes without sign = (0..4 294 967 296)} + _longInt = $80000000..$7FFFFFFF; {number 4 bytes with sign + = (-2 147 483 648..2 147 483 648} + + TbmpFileHeader = + record + ID: _word; { Must be 'BM' =19778=$424D for windows } + FileSize: _dWord; { Size of this file in bytes } + Reserved: _dWord; { ??? } + bmpDataOffset: _dword; { = 54 = $36 from begining of file to begining of bmp data } + end; + + TbmpInfoHeader = + record + InfoHeaderSize: _dword; { Size of Info header + = 28h = 40 (decimal) + for windows } + Width, + Height: _longInt; { Width and Height of image in pixels } + Planes, { number of planes of bitmap } + BitsPerPixel: _word; { Bits can be 1, 4, 8, 24 or 32 } + Compression, + bmpDataSize: _dword; { in bytes rounded to the next 4 byte boundary } + XPixPerMeter, { horizontal resolution in pixels } + YPixPerMeter: _longInt; { vertical } + NumbColorsUsed, + NumbImportantColors: _dword; {= NumbColorUsed} + end; { TbmpHeader = Record ... } + + T32Color = + record { 4 byte = 32 bit } + Blue: byte; + Green: byte; + Red: byte; + Alfa: byte + end; + +var directory, + bmpFileName: string; + bmpFile: file; { untyped file } + bmpFileHeader: TbmpFileHeader; + bmpInfoHeader: TbmpInfoHeader; + color32: T32Color; + RowSizeInBytes: integer; + BytesPerPixel: integer; + +const defaultBmpFileName = 'test'; + DefaultDirectory = 'c:\bp\'; + DefaultExtension = '.bmp'; + bmpFileHeaderSize = 14; + { compression specyfication } + bi_RGB = 0; { compression } + bi_RLE8 = 1; + bi_RLE4 = 2; + bi_BITFIELDS = 3; + + bmp_OK = 0; + bmp_NotBMP = 1; + bmp_OpenError = 2; + bmp_ReadError = 3; + +Procedure CreateBmpFile32(directory: string; FileName: string; + iWidth, iHeight: _LongInt); + +{************************************************} +Implementation {-----------------------------} +{************************************************} + +Procedure CreateBmpFile32(directory: string; FileName: string; + iWidth, iHeight: _LongInt); + var + x, y: integer; + begin + if directory = '' then + GetDir(0, directory); + if FileName = '' then + FileName: = DefaultBmpFileName; + { create a new file on a disk in a given directory with given name } + Assign(bmpFile, directory + FileName + DefaultExtension); + ReWrite(bmpFile, 1); + + { fill the headers } + with bmpInfoHeader, bmpFileHeader do + begin + ID := 19778; + InfoheaderSize := 40; + width := iWidth; + height := iHeight; + BitsPerPixel := 32; + BytesPerPixel := BitsPerPixel div 8; + reserved := 0; + bmpDataOffset := InfoHeaderSize + bmpFileHeaderSize; + planes := 1; + compression := bi_RGB; + XPixPerMeter := 0; + YPixPerMeter := 0; + NumbColorsUsed := 0; + NumbImportantColors := 0; + + RowSizeInBytes := (Width * BytesPerPixel); { only for >=8 bits per pixel } + bmpDataSize := height * RowSizeinBytes; + FileSize := InfoHeaderSize + bmpFileHeaderSize + bmpDataSize; + + { copy headers to disk file } + BlockWrite(bmpFile, bmpFileHeader, bmpFileHeaderSize); + BlockWrite(bmpFile, bmpInfoHeader, infoHeaderSize); + + { fill the pixel data area } + for y := (height - 1) downto 0 do + begin + for x := 0 to (width - 1) do + begin { Pixel(x,y) } + color32.Blue := 255; + color32.Green := 0; + color32.Red := 0; + color32.Alfa := 0; + BlockWrite(bmpFile, color32, 4); + end; { for x ... } + end; { for y ... } + Close(bmpFile); + end; { with bmpInfoHeader, bmpFileHeader } + end; { procedure } diff --git a/Task/Bitmap/Perl-6/bitmap.pl6 b/Task/Bitmap/Perl-6/bitmap.pl6 new file mode 100644 index 0000000000..354af1057c --- /dev/null +++ b/Task/Bitmap/Perl-6/bitmap.pl6 @@ -0,0 +1,37 @@ +class Pixel { + has Int $.R; + has Int $.G; + has Int $.B; +} + +class Bitmap { + has Pixel @.data; + has Int $.width; + has Int $.height; + + method fill(Pixel $p) { + for ^$.width X ^$.height -> $i, $j { + @.data[$i][$j] = $p.clone; + } + } + + method set-pixel ( $i, $j, Pixel $value) { + fail unless 0 <= $i <= $.width && 0 <= $j <= $.height; + @.data[$i][$j] = $value; + } + + method get-pixel ($i, $j) { + fail unless 0 <= $i <= $.width && 0 <= $j <= $.height; + @.data[$i][$j]; + } +} + +# Usage: + +my Bitmap $b = Bitmap.new( width => 10, height => 10); + +$b.fill( Pixel.new( R => 0, G => 0, B => 200) ); + +$b.set-pixel( 7, 5, Pixel.new( R => 100, G => 200, B => 0) ); + +say $b.perl; diff --git a/Task/Bitmap/PureBasic/bitmap.purebasic b/Task/Bitmap/PureBasic/bitmap.purebasic new file mode 100644 index 0000000000..b6e74cb644 --- /dev/null +++ b/Task/Bitmap/PureBasic/bitmap.purebasic @@ -0,0 +1,12 @@ +w=800 : h=600 +CreateImage(1,w,h) +;1 is internal id of image +StartDrawing(ImageOutput(1)) +; fill with color red +Box(0,0,w,h,$ff) +; or using another (but slower) way in green +FillArea(0,0,-1,$ff00) +; a green Dot +Plot(10,10,$ff0000) +; check if we set it right (should be 255) +Debug Blue(Point(10,10)) diff --git a/Task/Bitmap/REALbasic/bitmap.realbasic b/Task/Bitmap/REALbasic/bitmap.realbasic new file mode 100644 index 0000000000..620ee69340 --- /dev/null +++ b/Task/Bitmap/REALbasic/bitmap.realbasic @@ -0,0 +1,17 @@ +Function CreatePicture(width As Integer, height As Integer, depth As Integer) As Picture + 'It is not possible to create a Picture object with dimensions without initializing it + Return New Picture(width, height, depth) +End Function + +Sub FillPicture(ByRef p As Picture, FillColor As Color) + p.Graphics.ForeColor = FillColor + p.Graphics.FillRect(0, 0, p.Width, p.Height) +End Sub + +Function GetPixelColor(p As Picture, x As Integer, y As Integer) As Color + Return p.Graphics.Pixel(x, y) +End Function + +Sub SetPixelColor(p As Picture, x As Integer, y As Integer, pColor As Color) + p.Graphics.Pixel(x, y) = pColor +End Sub diff --git a/Task/Bitmap/RapidQ/bitmap.rapidq b/Task/Bitmap/RapidQ/bitmap.rapidq new file mode 100644 index 0000000000..ad4ebfe355 --- /dev/null +++ b/Task/Bitmap/RapidQ/bitmap.rapidq @@ -0,0 +1,24 @@ +DECLARE SUB PaintCanvas + +CREATE form AS QForm + Width = 640 + Height = 480 + CREATE canvas AS QCanvas + Height = form.ClientHeight + Width = form.ClientWidth + OnPaint = PaintCanvas + END CREATE +END CREATE + +SUB PaintCanvas + ' Fill background + canvas.FillRect(0, 0, canvas.Width, canvas.Height, &H301000) + + ' Draw a pixel + canvas.Pset(300, 200, &H00ddff) + + ' Read pixel color + PRINT canvas.Pixel(300, 200) +END SUB + +form.ShowModal diff --git a/Task/Bitmap/Seed7/bitmap.seed7 b/Task/Bitmap/Seed7/bitmap.seed7 new file mode 100644 index 0000000000..b864bd532c --- /dev/null +++ b/Task/Bitmap/Seed7/bitmap.seed7 @@ -0,0 +1,14 @@ +$ include "seed7_05.s7i"; + include "draw.s7i"; + +const proc: main is func + local + var PRIMITIVE_WINDOW: myPixmap is PRIMITIVE_WINDOW.value; + var color: myColor is black; + begin + myPixmap := newPixmap(300, 200); + clear(myPixmap, light_green); + point(myPixmap, 20, 30, color(256, 512, 768)); + myColor := getPixelColor(myPixmap, 20, 30); + writeln(myColor.red_part <& " " <& myColor.green_part <& " " <& myColor.blue_part); + end func; diff --git a/Task/Bitmap/Vedit-macro-language/bitmap.vedit b/Task/Bitmap/Vedit-macro-language/bitmap.vedit new file mode 100644 index 0000000000..616c17071b --- /dev/null +++ b/Task/Bitmap/Vedit-macro-language/bitmap.vedit @@ -0,0 +1,67 @@ +#11 = 400 // Width of the image +#12 = 300 // Height of the image + +// Create an empty RGB image and fill it with black color +// +File_Open("|(VEDIT_TEMP)\pixel.data", OVERWRITE+NOEVENT) +BOF +Del_Char(ALL) +#10 = Buf_Num +Repeat(#11 * #12) { + Ins_Char(0, COUNT, 3) +} + +// Fill the image with dark blue color +// +#5 = 0 // Red +#6 = 0 // Green +#7 = 64 // Blue +Call("FILL_IMAGE") + +// Draw one pixel in orange color +// +#1 = 100 // x +#2 = 50 // y +#5 = 255 #6 = 128 #7 = 0 // Orange color +Call("DRAW_PIXEL") + +// Get the color of a pixel +// +#1 = 10 +#2 = 3 +Call("GET_COLOR") + +Buf_Switch(#10) Buf_Quit(OK) +Return + +///////////////////////////////////////////////////////////////////// +// +// Fill image with given color: #5 = Red, #6 = Green, #7 = Blue +// +:FILL_IMAGE: +BOF +Repeat (File_Size/3) { + IC(#5,OVERWRITE) IC(#6,OVERWRITE) IC(#7,OVERWRITE) +} +Return + +///////////////////////////////////////////////////////////////////// +// +// Daw a pixel. #1 = x, #2 = y +// +:DRAW_PIXEL: +Goto_Pos((#1 + #2*#11)*3) +IC(#5,OVERWRITE) IC(#6,OVERWRITE) IC(#7,OVERWRITE) +Return + +///////////////////////////////////////////////////////////////////// +// +// Get color of a pixel. #1 = x, #2 = y +// Return: #5 = Red, #6 = Green, #7 = Blue +// +:GET_COLOR: +Goto_Pos((#1 + #2*#11)*3) +#5 = Cur_Char +#6 = Cur_Char(1) +#7 = Cur_Char(2) +Return diff --git a/Task/Bitmap/Visual-Basic-.NET/bitmap-1.visual b/Task/Bitmap/Visual-Basic-.NET/bitmap-1.visual new file mode 100644 index 0000000000..f4c9548d47 --- /dev/null +++ b/Task/Bitmap/Visual-Basic-.NET/bitmap-1.visual @@ -0,0 +1,23 @@ +' The StructLayout attribute allows fields to overlap in memory. + _ +Public Structure Rgb + + _ + Public Rgb As Integer + + _ + Public B As Byte + + _ + Public G As Byte + + _ + Public R As Byte + + Public Sub New(ByVal r As Byte, ByVal g As Byte, ByVal b As Byte) + Me.R = r + Me.G = g + Me.B = b + End Sub + +End Structure diff --git a/Task/Bitmap/Visual-Basic-.NET/bitmap-2.visual b/Task/Bitmap/Visual-Basic-.NET/bitmap-2.visual new file mode 100644 index 0000000000..6c167df0e3 --- /dev/null +++ b/Task/Bitmap/Visual-Basic-.NET/bitmap-2.visual @@ -0,0 +1,39 @@ +Public Class RasterBitmap + + Private m_pixels() As Rgb + + Private m_width As Integer + Public ReadOnly Property Width As Integer + Get + Return m_width + End Get + End Property + + Private m_height As Integer + Public ReadOnly Property Height As Integer + Get + Return m_height + End Get + End Property + + Public Sub New(ByVal width As Integer, ByVal height As Integer) + m_pixels = New Rgb(width * height - 1) {} + m_width = width + m_height = height + End Sub + + Public Sub Clear(ByVal color As Rgb) + For i As Integer = 0 To m_pixels.Length - 1 + m_pixels(i) = color + Next + End Sub + + Public Sub SetPixel(ByVal x As Integer, ByVal y As Integer, ByVal color As Rgb) + m_pixels((y * m_width) + x) = color + End Sub + + Public Function GetPixel(ByVal x As Integer, ByVal y As Integer) As Rgb + Return m_pixels((y * m_width) + x) + End Function + +End Class diff --git a/Task/Bitmap/XPL0/bitmap.xpl0 b/Task/Bitmap/XPL0/bitmap.xpl0 new file mode 100644 index 0000000000..a715668189 --- /dev/null +++ b/Task/Bitmap/XPL0/bitmap.xpl0 @@ -0,0 +1,11 @@ +include c:\cxpl\codes; \include 'code' declarations +def Width=180, Height=135, Color=$123456; +int X, Y; +[SetVid($112); \set display for 640x480 graphics in 24-bit RGB color +for Y:= 0 to Height-1 do \fill area with Color one pixel at a time + for X:= 0 to Width-1 do \(this takes 4.12 ms on a Duron 850) + Point(X, Y, Color); +Move(60, 60); HexOut(6, ReadPix(0,0)); \show color of pixel at 0,0 +X:= ChIn(1); \wait for keystroke +SetVid(3); \restore display to normal text mode +] diff --git a/Task/Bitwise-IO/OCaml/bitwise-io-1.ocaml b/Task/Bitwise-IO/OCaml/bitwise-io-1.ocaml new file mode 100644 index 0000000000..15d50de024 --- /dev/null +++ b/Task/Bitwise-IO/OCaml/bitwise-io-1.ocaml @@ -0,0 +1,7 @@ +let write_7bit_string ~filename ~str = + let oc = open_out filename in + let ob = IO.output_bits(IO.output_channel oc) in + String.iter (fun c -> IO.write_bits ob 7 (int_of_char c)) str; + IO.flush_bits ob; + close_out oc; +;; diff --git a/Task/Bitwise-IO/OCaml/bitwise-io-2.ocaml b/Task/Bitwise-IO/OCaml/bitwise-io-2.ocaml new file mode 100644 index 0000000000..5445680a30 --- /dev/null +++ b/Task/Bitwise-IO/OCaml/bitwise-io-2.ocaml @@ -0,0 +1,10 @@ +let read_7bit_string ~filename = + let ic = open_in filename in + let ib = IO.input_bits(IO.input_channel ic) in + let buf = Buffer.create 2048 in + try while true do + let c = IO.read_bits ib 7 in + Buffer.add_char buf (char_of_int c); + done; "" + with IO.No_more_input -> + (Buffer.contents buf) diff --git a/Task/Bitwise-IO/PL-I/bitwise-io.pli b/Task/Bitwise-IO/PL-I/bitwise-io.pli new file mode 100644 index 0000000000..9a5bafb44d --- /dev/null +++ b/Task/Bitwise-IO/PL-I/bitwise-io.pli @@ -0,0 +1,11 @@ +declare onebit bit(1) aligned, bs bit (1000) varying aligned; +on endfile (sysin) go to ending; +bs = ''b; +do forever; + get edit (onebit) (F(1)); + bs = bs || onebit; +end; +ending: +bs = bs || copy('0'b, mod(length(bs), 8) ); + /* pad length to a multiple of 8 */ +put edit (bs) (b); diff --git a/Task/Bitwise-IO/Perl-6/bitwise-io.pl6 b/Task/Bitwise-IO/Perl-6/bitwise-io.pl6 new file mode 100644 index 0000000000..ac1a1eeb11 --- /dev/null +++ b/Task/Bitwise-IO/Perl-6/bitwise-io.pl6 @@ -0,0 +1,14 @@ +sub encode-ascii(Str $s) { + my @b = $s.ords».fmt("%07b")».comb; + @b.push(0) until @b %% 8; # padding + Buf.new: gather while @b { take reduce * *2+*, (@b.pop for ^8) } +} + +sub decode-ascii(Buf $b) { + my @b = $b.list».fmt("%08b")».comb; + @b.shift until @b %% 7; # remove padding + @b = gather while @b { take reduce * *2+*, (@b.pop for ^7) } + return [~] @b».chr; +} +say my $encode = encode-ascii 'STRING'; +say decode-ascii $encode; diff --git a/Task/Bitwise-IO/PureBasic/bitwise-io.purebasic b/Task/Bitwise-IO/PureBasic/bitwise-io.purebasic new file mode 100644 index 0000000000..e239143de8 --- /dev/null +++ b/Task/Bitwise-IO/PureBasic/bitwise-io.purebasic @@ -0,0 +1,120 @@ +Structure fileDataBits + bitsToWrite.i + bitsToRead.i + outputByte.i + inputByte.i +EndStructure +#BitsPerByte = SizeOf(Byte) * 8 +#BitsPerInteger = SizeOf(Integer) * 8 + +Global Dim fileBitMask(8) +Define i, x +For i = 0 To 8 + fileBitMask(i) = x + x = (x << 1) + 1 +Next + +Global NewMap fileDataBits.fileDataBits() +Procedure flushBits(fileID) + If FindMapElement(fileDataBits(), Str(fileID)) + If fileDataBits()\bitsToWrite > 0 + WriteByte(fileID, fileDataBits()\outputByte << (#BitsPerByte - fileDataBits()\bitsToWrite)) + fileDataBits()\bitsToWrite = 0 + fileDataBits()\outputByte = 0 + EndIf + DeleteMapElement(fileDataBits()) + EndIf +EndProcedure + +Procedure writeBits(fileID, Value.i, bitCount) + Protected *fileData.fileDataBits = FindMapElement(fileDataBits(), Str(fileID)) + If Not *fileData + *fileData = AddMapElement(fileDataBits(), Str(fileID)) + If Not *fileData: End: EndIf ;simple error check for lack of memory + EndIf + + Value << (#BitsPerInteger - bitCount) ;shift value so it's first bit (HSB) is in the highest position + While bitCount > 0 + If bitCount > #BitsPerByte - *fileData\bitsToWrite + bitGroupSize = #BitsPerByte - *fileData\bitsToWrite + Else + bitGroupSize = bitCount + EndIf + + *fileData\outputByte << bitGroupSize + *fileData\outputByte + (Value >> (#BitsPerInteger - bitGroupSize)) & fileBitMask(bitGroupSize) + Value << bitGroupSize + *fileData\bitsToWrite + bitGroupSize + If *fileData\bitsToWrite = #BitsPerByte + WriteByte(fileID, *fileData\outputByte) + *fileData\bitsToWrite = 0 + *fileData\outputByte = 0 + EndIf + bitCount - bitGroupSize + Wend +EndProcedure + +Procedure.i readBits(fileID, bitCount) + Protected *fileData.fileDataBits = FindMapElement(fileDataBits(), Str(fileID)) + If Not *fileData + *fileData = AddMapElement(fileDataBits(), Str(fileID)) + If Not *fileData: End: EndIf ;simple error check for lack of memory + EndIf + + Protected Value.i, bitGroupSize + While bitCount > 0 + If *fileData\bitsToRead = 0 + If Not Eof(fileID) + *fileData\inputByte = ReadByte(fileID) + *fileData\bitsToRead = #BitsPerByte + Else + flushBits(fileID) + Break ;simple error check aborts if nothing left to read + EndIf + EndIf + + If bitCount > *fileData\bitsToRead + bitGroupSize = *fileData\bitsToRead + Else + bitGroupSize = bitCount + EndIf + Value << bitGroupSize + Value + (*fileData\inputByte >> (#BitsPerByte - bitGroupSize)) & fileBitMask(bitGroupSize) ;shift last bit being read in byte to the lowest position + *fileData\inputByte << bitGroupSize + *fileData\bitsToRead - bitGroupSize + bitCount - bitGroupSize + Wend + ProcedureReturn Value +EndProcedure + +;test +Define testWriteString.s, testReadString.s, fileNum, result.s +testWriteString = "This is an ascii string that will be crunched, written, read and expanded." +fileNum = CreateFile(#PB_Any, "BitIO_Test.dat") +If fileNum + For i = 1 To Len(testWriteString) + writeBits(fileNum, Asc(Mid(testWriteString, i, 1)), 7) + Next + flushBits(fileNum) + CloseFile(fileNum) +EndIf + +fileNum = ReadFile(#PB_Any, "BitIO_Test.dat") +If fileNum + For i = 1 To Len(testWriteString) + testReadString + Chr(readBits(fileNum, 7)) + Next + flushBits(fileNum) + CloseFile(fileNum) +EndIf + +result = "Original ascii string is " + Str(Len(testWriteString)) + " bytes." + #LF$ +result + "Filesize written is " + Str(FileSize("test.xxx")) + " bytes." + #LF$ +If testReadString = testWriteString + result + "The expanded string is the same as the original." + #LF$ +Else + result + "The expanded string is not the same as the original." + #LF$ +EndIf +result + "Expanded string = '" + testReadString + "'" + +MessageRequester("Results", result) diff --git a/Task/Bitwise-operations/BASIC/bitwise-operations-1.bas b/Task/Bitwise-operations/BASIC/bitwise-operations-1.basic similarity index 100% rename from Task/Bitwise-operations/BASIC/bitwise-operations-1.bas rename to Task/Bitwise-operations/BASIC/bitwise-operations-1.basic diff --git a/Task/Bitwise-operations/BASIC/bitwise-operations-2.bas b/Task/Bitwise-operations/BASIC/bitwise-operations-2.basic similarity index 100% rename from Task/Bitwise-operations/BASIC/bitwise-operations-2.bas rename to Task/Bitwise-operations/BASIC/bitwise-operations-2.basic diff --git a/Task/Bitwise-operations/CoffeeScript/bitwise-operations-1.coffee b/Task/Bitwise-operations/CoffeeScript/bitwise-operations-1.coffeescript similarity index 100% rename from Task/Bitwise-operations/CoffeeScript/bitwise-operations-1.coffee rename to Task/Bitwise-operations/CoffeeScript/bitwise-operations-1.coffeescript diff --git a/Task/Bitwise-operations/CoffeeScript/bitwise-operations-2.coffee b/Task/Bitwise-operations/CoffeeScript/bitwise-operations-2.coffeescript similarity index 100% rename from Task/Bitwise-operations/CoffeeScript/bitwise-operations-2.coffee rename to Task/Bitwise-operations/CoffeeScript/bitwise-operations-2.coffeescript diff --git a/Task/Bitwise-operations/MAXScript/bitwise-operations.max b/Task/Bitwise-operations/MAXScript/bitwise-operations.maxscript similarity index 100% rename from Task/Bitwise-operations/MAXScript/bitwise-operations.max rename to Task/Bitwise-operations/MAXScript/bitwise-operations.maxscript diff --git a/Task/Bitwise-operations/Mathematica/bitwise-operations-1.mathematica b/Task/Bitwise-operations/Mathematica/bitwise-operations-1.math similarity index 100% rename from Task/Bitwise-operations/Mathematica/bitwise-operations-1.mathematica rename to Task/Bitwise-operations/Mathematica/bitwise-operations-1.math diff --git a/Task/Bitwise-operations/Mathematica/bitwise-operations-2.mathematica b/Task/Bitwise-operations/Mathematica/bitwise-operations-2.math similarity index 100% rename from Task/Bitwise-operations/Mathematica/bitwise-operations-2.mathematica rename to Task/Bitwise-operations/Mathematica/bitwise-operations-2.math diff --git a/Task/Bitwise-operations/Mathematica/bitwise-operations-3.mathematica b/Task/Bitwise-operations/Mathematica/bitwise-operations-3.math similarity index 100% rename from Task/Bitwise-operations/Mathematica/bitwise-operations-3.mathematica rename to Task/Bitwise-operations/Mathematica/bitwise-operations-3.math diff --git a/Task/Bitwise-operations/NSIS/bitwise-operations.nsis b/Task/Bitwise-operations/NSIS/bitwise-operations.nsis new file mode 100644 index 0000000000..e57d134b35 --- /dev/null +++ b/Task/Bitwise-operations/NSIS/bitwise-operations.nsis @@ -0,0 +1,27 @@ +Function Bitwise + Push $0 + Push $1 + Push $2 + StrCpy $0 7 + StrCpy $1 2 + + IntOp $2 $0 & $1 + DetailPrint "Bitwise AND: $0 & $1 = $2" + IntOp $2 $0 | $1 + DetailPrint "Bitwise OR: $0 | $1 = $2" + IntOp $2 $0 ^ $1 + DetailPrint "Bitwise XOR: $0 ^ $1 = $2" + IntOp $2 $0 ~ + DetailPrint "Bitwise NOT (negate in NSIS docs): ~$0 = $2" + DetailPrint "There are no Arithmetic shifts in NSIS" + IntOp $2 $0 >> $1 + DetailPrint "Right Shift: $0 >> 1 = $2" + IntOp $2 $0 << $1 + DetailPrint "Left Shift: $0 << $1 = $2" + DetailPrint "There are no Rotates in NSIS" + + + Pop $2 + Pop $1 + Pop $0 +FunctionEnd diff --git a/Task/Bitwise-operations/Nemerle/bitwise-operations.nemerle b/Task/Bitwise-operations/Nemerle/bitwise-operations.nemerle new file mode 100644 index 0000000000..1ea865ade5 --- /dev/null +++ b/Task/Bitwise-operations/Nemerle/bitwise-operations.nemerle @@ -0,0 +1,13 @@ +def i = 255; +def j = 2; + +WriteLine($"$i and $j is $(i & j)"); +WriteLine($"$i or $j is $(i | j)"); +WriteLine($"$i xor $j is $(i ^ j)"); +WriteLine($"not $i is $(~i)"); +WriteLine($"$i lshift $j is $(i << j)"); +WriteLine($"$i arshift $j is $(i >> j)"); // When the left operand of the >> operator is of a signed integral type, + // the operator performs an arithmetic shift right +WriteLine($"$(i :> uint) rshift $j is $(c >> j)"); // When the left operand of the >> operator is of an unsigned integral type, + // the operator performs a logical shift right +// there are no rotation operators in Nemerle, but you could define your own w/ a macro if you really wanted it diff --git a/Task/Bitwise-operations/OCaml/bitwise-operations.ocaml b/Task/Bitwise-operations/OCaml/bitwise-operations.ocaml new file mode 100644 index 0000000000..ea2219cc9e --- /dev/null +++ b/Task/Bitwise-operations/OCaml/bitwise-operations.ocaml @@ -0,0 +1,9 @@ +let bitwise a b = + Printf.printf "a and b: %d\n" (a land b); + Printf.printf "a or b: %d\n" (a lor b); + Printf.printf "a xor b: %d\n" (a lxor b); + Printf.printf "not a: %d\n" (lnot a); + Printf.printf "a lsl b: %d\n" (a lsl b); (* left shift *) + Printf.printf "a asr b: %d\n" (a asr b); (* arithmetic right shift *) + Printf.printf "a lsr b: %d\n" (a lsr b); (* logical right shift *) +;; diff --git a/Task/Bitwise-operations/Objeck/bitwise-operations.objeck b/Task/Bitwise-operations/Objeck/bitwise-operations.objeck new file mode 100644 index 0000000000..e97fc18928 --- /dev/null +++ b/Task/Bitwise-operations/Objeck/bitwise-operations.objeck @@ -0,0 +1,17 @@ +use IO; + +bundle Default { + class Test { + function : Main(args : String[]) ~ Nil { + BitWise(3, 4); + } + + function : BitWise(a : Int, b : Int) ~ Nil { + Console->GetInstance()->Print("a and b: ")->PrintLine(a and b); + Console->GetInstance()->Print("a or b: ")->PrintLine(a or b); + Console->GetInstance()->Print("a xor b: ")->PrintLine(a xor b); + # shift left & right are supported by the compiler and VM but not + # exposed to end-users; those instructions are used for optimizations + } + } +} diff --git a/Task/Bitwise-operations/Octave/bitwise-operations.octave b/Task/Bitwise-operations/Octave/bitwise-operations.octave new file mode 100644 index 0000000000..b32c1f0ac2 --- /dev/null +++ b/Task/Bitwise-operations/Octave/bitwise-operations.octave @@ -0,0 +1,11 @@ +function bitops(a, b) + s = sprintf("%s %%s %s = %%s\n", dec2bin(a), dec2bin(b)); + printf(s, "or", dec2bin(bitor(a, b))); + printf(s, "and", dec2bin(bitand(a, b))); + printf(s, "xor", dec2bin(bitxor(a, b))); + printf(s, "left shift", dec2bin(bitshift(a, abs(b)))); + printf(s, "right shift", dec2bin(bitshift(a, -abs(b)))); + printf("simul not %s = %s", dec2bin(a), dec2bin(bitxor(a, 0xffffffff))); +endfunction + +bitops(0x1e, 0x3); diff --git a/Task/Bitwise-operations/PARI-GP/bitwise-operations.pari b/Task/Bitwise-operations/PARI-GP/bitwise-operations.pari new file mode 100644 index 0000000000..6aea3c2b0f --- /dev/null +++ b/Task/Bitwise-operations/PARI-GP/bitwise-operations.pari @@ -0,0 +1,8 @@ +bo(a,b)={ + print("And: "bitand(a,b)); + print("Or: "bitor(a,b)); + print("Not: "bitneg(a)); + print("Xor: "bitxor(a,b)); + print("Left shift: ",a<>b); +} diff --git a/Task/Bitwise-operations/PL-I/bitwise-operations.pli b/Task/Bitwise-operations/PL-I/bitwise-operations.pli new file mode 100644 index 0000000000..a57bff00e5 --- /dev/null +++ b/Task/Bitwise-operations/PL-I/bitwise-operations.pli @@ -0,0 +1,19 @@ +/* PL/I can perform bit operations on binary integers. */ +k = iand(i,j); +k = ior(i,j); +k = inot(i,j); +k = ieor(i,j); +k = ishl(i,n); /* unsigned shifts i left by n places. */ +k = ishr(i,n); /* unsigned shifts i right by n places. */ +k = lower2(i, n); /* arithmetic right shift i by n places. */ +k = raise2(i, n); /* arithmetic left shift i by n places. */ + +/* PL/I can also perform boolean operations on bit strings */ +/* of any length: */ + +declare (s, t, u) bit (*); + +u = s & t; /* logical and */ +u = s | t; /* logical or */ +u = ^ s; /* logical not */ +u = s ^ t; /* exclusive or */ diff --git a/Task/Bitwise-operations/Pascal/bitwise-operations.pascal b/Task/Bitwise-operations/Pascal/bitwise-operations.pascal new file mode 100644 index 0000000000..b9898908d8 --- /dev/null +++ b/Task/Bitwise-operations/Pascal/bitwise-operations.pascal @@ -0,0 +1,9 @@ +var + a, b: integer; +begin + a := 10; { binary 1010 } + b := 12; { binary 1100 } + writeln('a and b = ', a and b); { 8 = 1000 } + writeln('a or b = ', a or b); { 14 = 1110 } + writeln('a xor b = ', a xor b) { 6 = 0110 } +end. diff --git a/Task/Bitwise-operations/Perl-6/bitwise-operations-1.pl6 b/Task/Bitwise-operations/Perl-6/bitwise-operations-1.pl6 new file mode 100644 index 0000000000..2fb4be305e --- /dev/null +++ b/Task/Bitwise-operations/Perl-6/bitwise-operations-1.pl6 @@ -0,0 +1,48 @@ +sub bool ($a, $b) { + say 'Coerce to Boolean'; + say_bool_buff "$a and $b", $a ?& $b; + say_bool_buff "$a or $b", $a ?| $b; + say_bool_buff "$a xor $b", $a ?^ $b; + say_bool_buff "not $a", !$a; +} + +sub buf ($a, $b) { + say 'Coerce to Buffer'; + say_bool_buff "$a and $b", $a ~& $b; + say_bool_buff "$a or $b", $a ~| $b; + say_bool_buff "$a xor $b", $a ~^ $b; +# say_bool_buff "$a bit shift right $b", $a ~> $b; #NYI in Rakudo +# say_bool_buff "$a bit shift left $b", $a ~< $b; #NYI in Rakudo +} + +sub int ($a, $b) { + say 'Coerce to Int'; + say_bit "$a and $b", $a +& $b; + say_bit "$a or $b", $a +| $b; + say_bit "$a xor $b", $a +^ $b; + say_bit "$a signed bit shift right $b", $a +> $b; +# say_bit "$a unsigned bit shift right $b", $a +> $b :unsigned; #NYI in Rakudo +# say_bit "$a rotate right $b", $a +> $b :rotate; #NYI in Rakudo + say_bit "$a bit shift left $b", $a +< $b; +# say_bit "$a rotate shift left $b", $a +< $b :rotate; #NYI in Rakudo + say_bit "twos complement not $a", +^$a; + +} + +bool(7,2); +say '-' x 80; +buf(7,2); +say '-' x 80; +int(7,2); +say '-' x 80; + + +sub say_bit ($message, $value) { + my $INTSIZE = $*VM{'config'}{'intvalsize'} * 8; # hack to get native Int size + printf("%30s: %4d, %032b\n", $message, $value, $value) if $INTSIZE == 32; + printf("%30s: %4d, %064b\n", $message, $value, $value) if $INTSIZE == 64; +} + +sub say_bool_buff ($message, $value) { + printf("%30s: %4d, %s\n", $message, $value, $value); +} diff --git a/Task/Bitwise-operations/Perl-6/bitwise-operations-2.pl6 b/Task/Bitwise-operations/Perl-6/bitwise-operations-2.pl6 new file mode 100644 index 0000000000..a9598dd443 --- /dev/null +++ b/Task/Bitwise-operations/Perl-6/bitwise-operations-2.pl6 @@ -0,0 +1,30 @@ +sub infix:( $a, $b, :$rotate, :$unsigned ) { + if $rotate { + my $INTSIZE = $*VM{'config'}{'intvalsize'} * 8; # hack to get native Int size + my $c = $b % $INTSIZE; + return pir::lsr__III($a, $c) +| pir::shl__III((2**$c-1) +& $a, $INTSIZE-$c); + } + if $unsigned { + return pir::lsr__III($a, $b); + } + pir::shr__III($a, $b); +} + +sub infix:( $a, $b, :$rotate, :$unsigned ) { + if $rotate { + my $INTSIZE = $*VM{'config'}{'intvalsize'} * 8; # hack to get native Int size + my $c = $b % $INTSIZE; + return pir::shl__III($a, $c) +| pir::lsr__III($a, $INTSIZE-$c); + } + pir::shl__III($a, $b); +} + +bs_int(7,2); + +sub bs_int ($a, $b) { + say_bit "$a Signed Bit shift right $b", $a bsr $b; + say_bit "$a Unsigned Bit shift right $b", infix:($a, $b, :unsigned); + say_bit "$a Rotate right $b", infix:($a, $b, :rotate); + say_bit "$a Bit shift left $b", $a bsl $b; + say_bit "$a Rotate left $b", infix:($a, $b, :rotate); +} diff --git a/Task/Bitwise-operations/Pop11/bitwise-operations.pop11 b/Task/Bitwise-operations/Pop11/bitwise-operations.pop11 new file mode 100644 index 0000000000..e79ee297e6 --- /dev/null +++ b/Task/Bitwise-operations/Pop11/bitwise-operations.pop11 @@ -0,0 +1,8 @@ +define bitwise(a, b); + printf(a && b, 'a and b = %p\n'); + printf(a || b, 'a or b = %p\n'); + printf(a ||/& b, 'a xor b = %p\n'); + printf(~~ a, 'not a = %p\n'); + printf(a << b, 'left shift of a by b = %p\n'); + printf(a >> b, 'arithmetic right shift of a by b = %p\n'); +enddefine; diff --git a/Task/Bitwise-operations/PureBasic/bitwise-operations.purebasic b/Task/Bitwise-operations/PureBasic/bitwise-operations.purebasic new file mode 100644 index 0000000000..d25fca0776 --- /dev/null +++ b/Task/Bitwise-operations/PureBasic/bitwise-operations.purebasic @@ -0,0 +1,29 @@ +Procedure Bitwise(a, b) + Debug a & b ; And + Debug a | b ;Or + Debug a ! b ; XOr + Debug ~a ;Not + Debug a << b ; shift left + Debug a >> b ; arithmetic shift right + ; Logical shift right and rotates are not available + ; You can of use inline ASM to achieve this: + Define Temp + ; logical shift right + !mov edx, dword [p.v_a] + !mov ecx, dword [p.v_b] + !shr edx, cl + !mov dword [p.v_Temp], edx + Debug Temp + ; rotate left + !mov edx, dword [p.v_a] + !mov ecx, dword [p.v_b] + !rol edx, cl + !mov dword [p.v_Temp], edx + Debug Temp + ; rotate right + !mov edx, dword [p.v_a] + !mov ecx, dword [p.v_b] + !ror edx, cl + !mov dword [p.v_Temp], edx + Debug Temp +EndProcedure diff --git a/Task/Bitwise-operations/RLaB/bitwise-operations.rlab b/Task/Bitwise-operations/RLaB/bitwise-operations.rlab new file mode 100644 index 0000000000..f7f8399558 --- /dev/null +++ b/Task/Bitwise-operations/RLaB/bitwise-operations.rlab @@ -0,0 +1,13 @@ +>> x = int(3); +>> y = int(1); +>> z = x && y; printf("0x%08x\n",z); // logical 'and' +0x00000001 +>> z = x || y; printf("0x%08x\n",z); // logical 'or' +0x00000003 +>> z = !x; printf("0x%08x\n",z); // logical 'not' +0xfffffffc +>> i2 = int(2); +>> z = x * i2; printf("0x%08x\n",z); // left-shift is multiplication by 2 where both arguments are integers +0x00000006 +>> z = x / i2; printf("0x%08x\n",z); // right-shift is division by 2 where both arguments are integers +0x00000001 diff --git a/Task/Bitwise-operations/Retro/bitwise-operations.retro b/Task/Bitwise-operations/Retro/bitwise-operations.retro new file mode 100644 index 0000000000..6ca8b1d3db --- /dev/null +++ b/Task/Bitwise-operations/Retro/bitwise-operations.retro @@ -0,0 +1,11 @@ +: bitwise ( ab- ) + cr + over "a = %d\n" puts + dup "b = %d\n" puts + 2over and "a and b = %d\n" puts + 2over or "a or b = %d\n" puts + 2over xor "a xor b = %d\n" puts + over not "not a = %d\n" puts + 2over << "a << b = %d\n" puts + 2over >> "a >> b = %d\n" puts + 2drop ; diff --git a/Task/Bitwise-operations/SAS/bitwise-operations.sas b/Task/Bitwise-operations/SAS/bitwise-operations.sas new file mode 100644 index 0000000000..1e8ba97aed --- /dev/null +++ b/Task/Bitwise-operations/SAS/bitwise-operations.sas @@ -0,0 +1,12 @@ +/* rotations are not available, but are easy to implement with the other bitwise operators */ +data _null_; + a=105; + b=91; + c=bxor(a,b); + d=band(a,b); + e=bor(a,b); + f=bnot(a); /* on 32 bits */ + g=blshift(a,1); + h=brshift(a,1); + put _all_; +run; diff --git a/Task/Bitwise-operations/Slate/bitwise-operations.slate b/Task/Bitwise-operations/Slate/bitwise-operations.slate new file mode 100644 index 0000000000..a47b40b31e --- /dev/null +++ b/Task/Bitwise-operations/Slate/bitwise-operations.slate @@ -0,0 +1,10 @@ +[ |:a :b | + + inform: (a bitAnd: b) printString. + inform: (a bitOr: b) printString. + inform: (a bitXor: b) printString. + inform: (a bitNot) printString. + inform: (a << b) printString. + inform: (a >> b) printString. + +] applyTo: {8. 12}. diff --git a/Task/Bitwise-operations/Standard-ML/bitwise-operations-1.ml b/Task/Bitwise-operations/Standard-ML/bitwise-operations-1.ml new file mode 100644 index 0000000000..3612fbd0b3 --- /dev/null +++ b/Task/Bitwise-operations/Standard-ML/bitwise-operations-1.ml @@ -0,0 +1,8 @@ +fun bitwise_ints (a, b) = ( + print ("a and b: " ^ IntInf.toString (IntInf.andb (IntInf.fromInt a, IntInf.fromInt b)) ^ "\n"); + print ("a or b: " ^ IntInf.toString (IntInf.orb (IntInf.fromInt a, IntInf.fromInt b)) ^ "\n"); + print ("a xor b: " ^ IntInf.toString (IntInf.xorb (IntInf.fromInt a, IntInf.fromInt b)) ^ "\n"); + print ("not a: " ^ IntInf.toString (IntInf.notb (IntInf.fromInt a )) ^ "\n"); + print ("a lsl b: " ^ IntInf.toString (IntInf.<< (IntInf.fromInt a, Word.fromInt b )) ^ "\n"); (* left shift *) + print ("a asr b: " ^ IntInf.toString (IntInf.~>> (IntInf.fromInt a, Word.fromInt b )) ^ "\n") (* arithmetic right shift *) +) diff --git a/Task/Bitwise-operations/Standard-ML/bitwise-operations-2.ml b/Task/Bitwise-operations/Standard-ML/bitwise-operations-2.ml new file mode 100644 index 0000000000..85c2cb85a4 --- /dev/null +++ b/Task/Bitwise-operations/Standard-ML/bitwise-operations-2.ml @@ -0,0 +1,9 @@ +fun bitwise_words (a, b) = ( + print ("a and b: " ^ Word.fmt StringCvt.DEC (Word.andb (a, b)) ^ "\n"); + print ("a or b: " ^ Word.fmt StringCvt.DEC (Word.orb (a, b)) ^ "\n"); + print ("a xor b: " ^ Word.fmt StringCvt.DEC (Word.xorb (a, b)) ^ "\n"); + print ("not a: " ^ Word.fmt StringCvt.DEC (Word.notb a ) ^ "\n"); + print ("a lsl b: " ^ Word.fmt StringCvt.DEC (Word.<< (a, b) ) ^ "\n"); (* left shift *) + print ("a asr b: " ^ Word.fmt StringCvt.DEC (Word.~>> (a, b) ) ^ "\n"); (* arithmetic right shift *) + print ("a asr b: " ^ Word.fmt StringCvt.DEC (Word.>> (a, b) ) ^ "\n") (* logical right shift *) +) diff --git a/Task/Bitwise-operations/SystemVerilog/bitwise-operations-1.v b/Task/Bitwise-operations/SystemVerilog/bitwise-operations-1.v new file mode 100644 index 0000000000..3c310ad41c --- /dev/null +++ b/Task/Bitwise-operations/SystemVerilog/bitwise-operations-1.v @@ -0,0 +1,20 @@ +program main; + + initial begin + bit [52:0] a,b,c; + a = 53'h123476547890fe; + b = 53'h06453bdef23ca6; + + c = a & b; $display("%h & %h = %h", a,b,c); + c = a | b; $display("%h | %h = %h", a,b,c); + c = a ^ b; $display("%h ^ %h = %h", a,b,c); + c = ~ a; $display("~%h = %h", a, c); + + c = a << 5; $display("%h << 5 = %h", a, c); + c = a >> 5; $display("%h >> 5 = %h", a, c); + + c = { a[53-23:0], a[52-:23] }; $display("%h rotate-left 23 = %h", a, c); + c = { a[1:0], a[52:2] }; $display("%h rotate-right 2 = %h", a, c); + end + +endprogram diff --git a/Task/Bitwise-operations/SystemVerilog/bitwise-operations-2.v b/Task/Bitwise-operations/SystemVerilog/bitwise-operations-2.v new file mode 100644 index 0000000000..04eab180d8 --- /dev/null +++ b/Task/Bitwise-operations/SystemVerilog/bitwise-operations-2.v @@ -0,0 +1,12 @@ +module rotate(in, out, shift); + + parameter BITS = 32; + parameter SHIFT_BITS = 5; + + input [BITS-1:0] in; + output [BITS-1:0] out; + input [SHIFT_BITS-1:0] shift; + + always_comb foreach (out[i]) out[i] = in[ (i+shift) % BITS ]; + +endmodule diff --git a/Task/Bitwise-operations/TI-89-BASIC/bitwise-operations.ti-89 b/Task/Bitwise-operations/TI-89-BASIC/bitwise-operations.ti-89 new file mode 100644 index 0000000000..e0ad92b606 --- /dev/null +++ b/Task/Bitwise-operations/TI-89-BASIC/bitwise-operations.ti-89 @@ -0,0 +1,23 @@ +bitwise(a,b) +Prgm + Local show, oldbase + Define show(label, x)=Prgm + Local r + setMode("Base","DEC") + string(x) → r + setMode("Base","HEX") + Disp label & r & " " & string(x) + EndPrgm + getMode("Base") → oldbase + show("", {a, b}) + show("And ", a and b) + show("Or ", a or b) + show("Xor ", a xor b) + show("Not ", not a) + Pause "[Press ENTER]" + show("LSh ", shift(a,b)) + show("RSh ", shift(a,–b)) + show("LRo ", rotate(a,b)) + show("RRo ", rotate(a,–b)) + setMode("Base",oldbase) +EndPrgm diff --git a/Task/Bitwise-operations/Visual-Basic-.NET/bitwise-operations.visual b/Task/Bitwise-operations/Visual-Basic-.NET/bitwise-operations.visual new file mode 100644 index 0000000000..1c7716b72d --- /dev/null +++ b/Task/Bitwise-operations/Visual-Basic-.NET/bitwise-operations.visual @@ -0,0 +1,8 @@ +Sub Test(a as Integer, b as Integer) + WriteLine("And " & a And b) + WriteLine("Or " & a Or b) + WriteLine("Xor " & a Xor b) + WriteLine("Not " & Not a) + WriteLine("Left Shift " & a << 2) + WriteLine("Right Shift " & a >> 2) +End Sub diff --git a/Task/Bitwise-operations/XPL0/bitwise-operations.xpl0 b/Task/Bitwise-operations/XPL0/bitwise-operations.xpl0 new file mode 100644 index 0000000000..73dbccd2b0 --- /dev/null +++ b/Task/Bitwise-operations/XPL0/bitwise-operations.xpl0 @@ -0,0 +1,12 @@ +Text(0, "A and B = "); HexOut(0, A and B); CrLf(0); \alternate symbol: & +Text(0, "A or B = "); HexOut(0, A or B); CrLf(0); \alternate symbol: ! +Text(0, "A xor B = "); HexOut(0, A xor B); CrLf(0); \alternate symbol: | +Text(0, "not A = "); HexOut(0, not A); CrLf(0); \alternate symbol: ~ +Text(0, "A << B = "); HexOut(0, A << B); CrLf(0); +Text(0, "A >> B logical = "); HexOut(0, A >> B); CrLf(0); +Text(0, "A >> B arithmetic = "); HexOut(0, A ->> B); CrLf(0); + +\Rotate operations must be done by calling a function such as: +func ROR(A, B); int A, B; return A>>B ! A<<(32-B); + +Text(0, "A ror B = "); HexOut(0, ROR(A,B)); CrLf(0); diff --git a/Task/Boolean-values/BASIC/boolean-values.bas b/Task/Boolean-values/BASIC/boolean-values.basic similarity index 100% rename from Task/Boolean-values/BASIC/boolean-values.bas rename to Task/Boolean-values/BASIC/boolean-values.basic diff --git a/Task/Boolean-values/CoffeeScript/boolean-values.coffee b/Task/Boolean-values/CoffeeScript/boolean-values.coffeescript similarity index 100% rename from Task/Boolean-values/CoffeeScript/boolean-values.coffee rename to Task/Boolean-values/CoffeeScript/boolean-values.coffeescript diff --git a/Task/Boolean-values/NetRexx/boolean-values.netrexx b/Task/Boolean-values/NetRexx/boolean-values.netrexx new file mode 100644 index 0000000000..c38e35be82 --- /dev/null +++ b/Task/Boolean-values/NetRexx/boolean-values.netrexx @@ -0,0 +1,18 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols nobinary + +bval = [1, 0, 5, 'a', 1 == 1, 1 \= 1, isTrue, isFalse] + +loop b_ = 0 for bval.length + select case bval[b_] + when isTrue then say bval[b_] 'is true' + when isFalse then say bval[b_] 'is false' + otherwise say bval[b_] 'is not boolean' + end + end b_ + +method isTrue public static returns boolean + return (1 == 1) + +method isFalse public static returns boolean + return \isTrue diff --git a/Task/Boolean-values/OCaml/boolean-values.ocaml b/Task/Boolean-values/OCaml/boolean-values.ocaml new file mode 100644 index 0000000000..d621b2a19b --- /dev/null +++ b/Task/Boolean-values/OCaml/boolean-values.ocaml @@ -0,0 +1 @@ +type bool = false | true diff --git a/Task/Boolean-values/PL-I/boolean-values.pli b/Task/Boolean-values/PL-I/boolean-values.pli new file mode 100644 index 0000000000..6d86fe38da --- /dev/null +++ b/Task/Boolean-values/PL-I/boolean-values.pli @@ -0,0 +1 @@ +true is '1'b and false is '0'b diff --git a/Task/Boolean-values/Pascal/boolean-values-1.pascal b/Task/Boolean-values/Pascal/boolean-values-1.pascal new file mode 100644 index 0000000000..9f4c7bcbe5 --- /dev/null +++ b/Task/Boolean-values/Pascal/boolean-values-1.pascal @@ -0,0 +1,3 @@ +var + pInt : ^integer ; + ValidP : boolean ; diff --git a/Task/Boolean-values/Pascal/boolean-values-2.pascal b/Task/Boolean-values/Pascal/boolean-values-2.pascal new file mode 100644 index 0000000000..0d70ba85c8 --- /dev/null +++ b/Task/Boolean-values/Pascal/boolean-values-2.pascal @@ -0,0 +1 @@ +if pInt then ... diff --git a/Task/Boolean-values/Pascal/boolean-values-3.pascal b/Task/Boolean-values/Pascal/boolean-values-3.pascal new file mode 100644 index 0000000000..6967f9daa3 --- /dev/null +++ b/Task/Boolean-values/Pascal/boolean-values-3.pascal @@ -0,0 +1 @@ +if pInt^ then ... diff --git a/Task/Boolean-values/Pascal/boolean-values-4.pascal b/Task/Boolean-values/Pascal/boolean-values-4.pascal new file mode 100644 index 0000000000..46f466b177 --- /dev/null +++ b/Task/Boolean-values/Pascal/boolean-values-4.pascal @@ -0,0 +1 @@ +if not(pInt = nil) then ValidP := true ; diff --git a/Task/Boolean-values/Pascal/boolean-values-5.pascal b/Task/Boolean-values/Pascal/boolean-values-5.pascal new file mode 100644 index 0000000000..3dde889433 --- /dev/null +++ b/Task/Boolean-values/Pascal/boolean-values-5.pascal @@ -0,0 +1 @@ +if ( ValidP ) and (pInt^ <> 0) then ... diff --git a/Task/Boolean-values/Perl-6/boolean-values.pl6 b/Task/Boolean-values/Perl-6/boolean-values.pl6 new file mode 100644 index 0000000000..fed71e7ed2 --- /dev/null +++ b/Task/Boolean-values/Perl-6/boolean-values.pl6 @@ -0,0 +1,2 @@ +my Bool $crashed = False; +my $val = 0 but True; diff --git a/Task/Boolean-values/Pike/boolean-values.pike b/Task/Boolean-values/Pike/boolean-values.pike new file mode 100644 index 0000000000..d71ab99692 --- /dev/null +++ b/Task/Boolean-values/Pike/boolean-values.pike @@ -0,0 +1,13 @@ +> 0; +(3) Result: 0 +> false; +(4) Result: 0 +> 0; +(6) Result: 0 +> !true; +(7) Result: 0 +> true; +(8) Result: 1 +> 1; +(9) Result: 1 +> diff --git a/Task/Boolean-values/PostScript/boolean-values.ps b/Task/Boolean-values/PostScript/boolean-values.ps new file mode 100644 index 0000000000..da29283aaa --- /dev/null +++ b/Task/Boolean-values/PostScript/boolean-values.ps @@ -0,0 +1,2 @@ +true +false diff --git a/Task/Boolean-values/PowerBASIC/boolean-values.powerbasic b/Task/Boolean-values/PowerBASIC/boolean-values.powerbasic new file mode 100644 index 0000000000..25cf1d61e5 --- /dev/null +++ b/Task/Boolean-values/PowerBASIC/boolean-values.powerbasic @@ -0,0 +1,5 @@ +DIM x AS LONG +x = ISTRUE(1 = 1) ' returns -1 +x = ISTRUE(1 = 0) ' returns 0 +x = ISFALSE(1 = 1) ' returns 0 +x = ISFALSE(1 = 0) ' returns -1 diff --git a/Task/Boolean-values/PowerShell/boolean-values.psh b/Task/Boolean-values/PowerShell/boolean-values.psh new file mode 100644 index 0000000000..4d06109c52 --- /dev/null +++ b/Task/Boolean-values/PowerShell/boolean-values.psh @@ -0,0 +1,2 @@ +$true +$false diff --git a/Task/Boolean-values/Run-BASIC/boolean-values.run b/Task/Boolean-values/Run-BASIC/boolean-values.run new file mode 100644 index 0000000000..dd57ea0242 --- /dev/null +++ b/Task/Boolean-values/Run-BASIC/boolean-values.run @@ -0,0 +1,6 @@ +if 1 then print "1 is true" +if not(0) then print "0 is false" +if 1 < 2 then print "1 < 2 TRUE" +if 2 > 1 then print "2 > 1 TRUE" +if not(2 < 1) then print "2 not < 1" +if not(1 = 0) then print "1 not = 0" diff --git a/Task/Boolean-values/Standard-ML/boolean-values.ml b/Task/Boolean-values/Standard-ML/boolean-values.ml new file mode 100644 index 0000000000..c69a888631 --- /dev/null +++ b/Task/Boolean-values/Standard-ML/boolean-values.ml @@ -0,0 +1 @@ +datatype bool = false | true diff --git a/Task/Boolean-values/UNIX-Shell/boolean-values-1.sh b/Task/Boolean-values/UNIX-Shell/boolean-values-1.sh new file mode 100644 index 0000000000..60457bfd06 --- /dev/null +++ b/Task/Boolean-values/UNIX-Shell/boolean-values-1.sh @@ -0,0 +1,8 @@ +if + echo 'Looking for file' # This is the evaluation block + test -e foobar.fil # The exit code from this statement determines whether the branch runs +then + echo 'The file exists' # This is the optional branch + echo 'I am going to delete it' + rm foobar.fil +fi diff --git a/Task/Boolean-values/UNIX-Shell/boolean-values-2.sh b/Task/Boolean-values/UNIX-Shell/boolean-values-2.sh new file mode 100644 index 0000000000..ec5178a378 --- /dev/null +++ b/Task/Boolean-values/UNIX-Shell/boolean-values-2.sh @@ -0,0 +1 @@ +true && echo "true" || echo "false" diff --git a/Task/Boolean-values/Visual-Basic/boolean-values.vb b/Task/Boolean-values/Visual-Basic/boolean-values.vb new file mode 100644 index 0000000000..846514d4b8 --- /dev/null +++ b/Task/Boolean-values/Visual-Basic/boolean-values.vb @@ -0,0 +1,3 @@ +Dim x As Boolean +x = IIf(Int(Rnd * 2), True, False) +MsgBox x diff --git a/Task/Boolean-values/XSLT/boolean-values.xslt b/Task/Boolean-values/XSLT/boolean-values.xslt new file mode 100644 index 0000000000..7b40394265 --- /dev/null +++ b/Task/Boolean-values/XSLT/boolean-values.xslt @@ -0,0 +1,9 @@ + + True and false are returned by built-in XPath functions. + + + Node attributes set to "true" or "false" are just strings. Use string comparison to convert them to booleans. + + + Test an attribute for its presence (empty or not), or whether a node set is empty. + diff --git a/Task/Box-the-compass/Mathematica/box-the-compass.mathematica b/Task/Box-the-compass/Mathematica/box-the-compass.math similarity index 100% rename from Task/Box-the-compass/Mathematica/box-the-compass.mathematica rename to Task/Box-the-compass/Mathematica/box-the-compass.math diff --git a/Task/Box-the-compass/NetRexx/box-the-compass.netrexx b/Task/Box-the-compass/NetRexx/box-the-compass.netrexx new file mode 100644 index 0000000000..09fa11c1fa --- /dev/null +++ b/Task/Box-the-compass/NetRexx/box-the-compass.netrexx @@ -0,0 +1,201 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols nobinary utf8 + +class RCBoxTheCompass + +properties public constant + _FULL = '_FULL' + +properties indirect + headings = Rexx + rosepoints = Rexx + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method RCBoxTheCompass() public + + setHeadings(makeHeadings) + setRosepoints(makeRosepoints) + + return + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method main(args = String[]) public static + + box = RCBoxTheCompass() + + cp = box.getCompassPoints + loop r_ = 1 to cp[0] + say cp[r_] + end r_ + say + + hx = box.getHeadingsReport(box.getHeadings) + loop r_ = 1 to hx[0] + say hx[r_] + end r_ + say + + return + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method getDecimalAngle(degrees, minutes, seconds) public static returns Rexx + + degrees = degrees * 10 % 10 + minutes = minutes * 10 % 10 + angle = degrees + (minutes / 60 + (seconds / 60 / 60)) + + return angle + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method getDegreesMinutesSeconds(angle) public static returns Rexx + + degrees = angle * 100 % 100 + minutes = ((angle - degrees) * 60) * 100 % 100 + seconds = ((((angle - degrees) * 60) - minutes) * 60) * 100 % 100 + + return degrees minutes seconds + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method getHeadingsReport(bearings) public returns Rexx + + r_ = 0 + table = '' + r_ = r_ + 1; table[0] = r_; table[r_] = 'Idx' - + 'Abbr' - + 'Compass Point'.left(20) - + 'Degrees'.right(10) + + loop h_ = 1 to bearings[0] + heading = bearings[h_] + index = getRosepointIndex(heading) + parse getRosepoint(index) p_abbrev p_full + + r_ = r_ + 1; table[0] = r_; table[r_] = index.right(3) - + p_abbrev.left(4) - + p_full.left(20) - + heading.format(6, 3).right(10) + end h_ + + return table + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method getRosepointIndex(heading) public returns Rexx + + one_pt = 360 / 32 + hn = heading // 360 + hi = hn % one_pt + + if hn > hi * one_pt + one_pt / 2 then do + hi = hi + 1 -- greater than max range for this point; bump to next point + end + + idx = hi // 32 + 1 -- add one to get index into rosepoints indexed string + + return idx + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method getRosepoint(index) public returns Rexx + + rp = getRosepoints + return rp[index] rp[index, _FULL] + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method makeRosepoints() private returns Rexx + + p_ = 0 + rp = '' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'N'; rp[p_, _FULL] = 'North' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NbE'; rp[p_, _FULL] = 'North by East' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NNE'; rp[p_, _FULL] = 'North-Northeast' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NEbn'; rp[p_, _FULL] = 'Northeast by North' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NE'; rp[p_, _FULL] = 'Northeast' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NEbE'; rp[p_, _FULL] = 'Northeast by East' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'ENE'; rp[p_, _FULL] = 'East-Northeast' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'EbN'; rp[p_, _FULL] = 'East by North' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'E'; rp[p_, _FULL] = 'East' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'EbS'; rp[p_, _FULL] = 'East by South' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'ESE'; rp[p_, _FULL] = 'East-Southeast' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SEbE'; rp[p_, _FULL] = 'Southeast by East' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SE'; rp[p_, _FULL] = 'Southeast' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SEbS'; rp[p_, _FULL] = 'Southeast by South' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SSE'; rp[p_, _FULL] = 'South-Southeast' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SbE'; rp[p_, _FULL] = 'South by East' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'S'; rp[p_, _FULL] = 'South' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SbW'; rp[p_, _FULL] = 'South by West' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SSW'; rp[p_, _FULL] = 'South-Southwest' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SWbS'; rp[p_, _FULL] = 'Southwest by South' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SW'; rp[p_, _FULL] = 'Southwest' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'SWbW'; rp[p_, _FULL] = 'Southwest by West' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'WSW'; rp[p_, _FULL] = 'Southwest' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'WbS'; rp[p_, _FULL] = 'West by South' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'W'; rp[p_, _FULL] = 'West' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'WbN'; rp[p_, _FULL] = 'West by North' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'WNW'; rp[p_, _FULL] = 'West-Northwest' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NWbW'; rp[p_, _FULL] = 'Northwest by West' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NW'; rp[p_, _FULL] = 'Northwest' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NWbN'; rp[p_, _FULL] = 'Northwest by North' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NNW'; rp[p_, _FULL] = 'North-Northwest' + p_ = p_ + 1; rp[0] = p_; rp[p_] = 'NbW'; rp[p_, _FULL] = 'North by West' + + return rp + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method makeHeadings() private returns Rexx + + hdg = '' + hdg[0] = 0 + points = 32 + loop i_ = 0 to points + heading = i_ * 360 / points + + select case i_ // 3 + when 1 then heading_h = heading + 5.62 + when 2 then heading_h = heading - 5.62 + otherwise heading_h = heading + end + + ix = hdg[0] + 1; hdg[0] = ix; hdg[ix] = heading_h + end i_ + + return hdg + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +method getCompassPoints() public returns Rexx + + r_ = 0 + table = '' + r_ = r_ + 1; table[0] = r_; table[r_] = 'Idx' - + 'Abbr' - + 'Compass Point'.left(20) - + 'Low (Deg.)'.right(10) - + 'Mid (Deg.)'.right(10) - + 'Hi (Deg.)'.right(10) + + -- one point of the compass is 360 / 32 (11.25) degrees + -- using functions to calculate this just for fun + one_pt = 360 / 32 + parse getDegreesMinutesSeconds(one_pt / 2) ad am as . + points = 32 + loop h_ = 0 to points - 1 + heading = h_ * 360 / points + hmin = heading - getDecimalAngle(ad, am, as) + hmax = heading + getDecimalAngle(ad, am, as) + + if hmin < 0 then do + hmin = hmin + 360 + end + if hmax >= 360 then do + hmax = hmax - 360 + end + + index = getRosepointIndex(heading) + parse getRosepoint(index) p_abbrev p_full + r_ = r_ + 1; table[0] = r_; table[r_] = index.right(3) - + p_abbrev.left(4) - + p_full.left(20) - + hmin.format(6, 3).right(10) - + heading.format(6, 3).right(10) - + hmax.format(6, 3).right(10) + end h_ + + return table diff --git a/Task/Box-the-compass/Objeck/box-the-compass.objeck b/Task/Box-the-compass/Objeck/box-the-compass.objeck new file mode 100644 index 0000000000..b1c60bfcc7 --- /dev/null +++ b/Task/Box-the-compass/Objeck/box-the-compass.objeck @@ -0,0 +1,34 @@ +class BoxCompass { + function : Main(args : String[]) ~ Nil { + points := [ + "North ", "North by east ", "North-northeast ", + "Northeast by north", "Northeast ", "Northeast by east ", "East-northeast ", + "East by north ", "East ", "East by south ", "East-southeast ", + "Southeast by east ", "Southeast ", "Southeast by south", "South-southeast ", + "South by east ", "South ", "South by west ", "South-southwest ", + "Southwest by south", "Southwest ", "Southwest by west ", "West-southwest ", + "West by south ", "West ", "West by north ", "West-northwest ", + "Northwest by west ", "Northwest ", "Northwest by north", "North-northwest ", + "North by west " ]; + + for(i := 0; i<= 32; i += 1;) { + heading := i * 11.25; + select(i % 3) { + label 1: { + heading += 5.62; + } + + label 2: { + heading -= 5.62; + } + }; + + IO.Console->Print((i % 32) + 1)->Print('\t')->Print(points[GetPoint(heading)]) + ->Print('\t')->PrintLine(heading); + }; + } + + function : GetPoint(degrees : Float) ~ Int { + return (degrees / 11.25 + 0.5)->Floor()->As(Int) % 32; + } +} diff --git a/Task/Box-the-compass/PARI-GP/box-the-compass.pari b/Task/Box-the-compass/PARI-GP/box-the-compass.pari new file mode 100644 index 0000000000..59ed84cb4c --- /dev/null +++ b/Task/Box-the-compass/PARI-GP/box-the-compass.pari @@ -0,0 +1,7 @@ +box(x)={["North","North by east","North-northeast","Northeast by north","Northeast", +"Northeast by east","East-northeast","East by north","East","East by south","East-southeast", +"Southeast by east","Southeast","Southeast by south","South-southeast","South by east","South", +"South by west","South-southwest","Southwest by south","Southwest","Southwest by west","West-southwest", +"West by south","West","West by north","West-northwest","Northwest by west","Northwest", +"Northwest by north","North-northwest","North by west"][round(x*4/45)%32+1]}; +for(i=0,32,print(i%32+1" "box(x=i*11.25+if(i%3==1,5.62,if(i%3==2,-5.62)))" "x)) diff --git a/Task/Box-the-compass/Pascal/box-the-compass.pascal b/Task/Box-the-compass/Pascal/box-the-compass.pascal new file mode 100644 index 0000000000..8434f0cf4b --- /dev/null +++ b/Task/Box-the-compass/Pascal/box-the-compass.pascal @@ -0,0 +1,37 @@ +program BoxTheCompass(output); + +function compasspoint(angle: real): string; + const + points: array [1..32] of string = + ('North ', 'North by east ', 'North-northeast ', 'Northeast by north', + 'Northeast ', 'Northeast by east ', 'East-northeast ', 'East by north ', + 'East ', 'East by south ', 'East-southeast ', 'Southeast by east ', + 'Southeast ', 'Southeast by south', 'South-southeast ', 'South by east ', + 'South ', 'South by west ', 'South-southwest ', 'Southwest by south', + 'Southwest ', 'Southwest by west ', 'West-southwest ', 'West by south ', + 'West ', 'West by north ', 'West-northwest ', 'Northwest by west ', + 'Northwest ', 'Northwest by north', 'North-northwest ', 'North by west ' + ); + var + index: integer; + begin + index := round (angle / 11.25); + index := index mod 32 + 1; + compasspoint := points[index]; + end; + +var + i: integer; + heading: real; + +begin + for i := 0 to 32 do + begin + heading := i * 11.25; + case (i mod 3) of + 1: heading := heading + 5.62; + 2: heading := heading - 5.62; + end; + writeln((i mod 32) + 1:2, ' ', compasspoint(heading), ' ', heading:8:4); + end; +end. diff --git a/Task/Box-the-compass/Perl-6/box-the-compass.pl6 b/Task/Box-the-compass/Perl-6/box-the-compass.pl6 new file mode 100644 index 0000000000..74cf78224f --- /dev/null +++ b/Task/Box-the-compass/Perl-6/box-the-compass.pl6 @@ -0,0 +1,22 @@ +sub point (Int $index) { + my $ix = $index % 32; + if $ix +& 1 + { "&point(($ix + 1) +& 28) by &point(((2 - ($ix +& 2)) * 4) + $ix +& 24)" } + elsif $ix +& 2 + { "&point(($ix + 2) +& 24)-&point(($ix +| 4) +& 28)" } + elsif $ix +& 4 + { "&point(($ix + 8) +& 16)&point(($ix +| 8) +& 24)" } + else + { [$ix div 8]; } +} + +sub test-angle ($ix) { $ix * 11.25 + (0, 5.62, -5.62)[ $ix % 3 ] } +sub angle-to-point($𝜽) { floor $𝜽 / 360 * 32 + 0.5 } + +for 0 .. 32 -> $ix { + my $𝜽 = test-angle($ix); + printf " %2d %6.2f%s %s\n", + $ix % 32 + 1, + $𝜽, '°', + ucfirst point angle-to-point $𝜽; +} diff --git a/Task/Box-the-compass/PureBasic/box-the-compass.purebasic b/Task/Box-the-compass/PureBasic/box-the-compass.purebasic new file mode 100644 index 0000000000..f50b65112a --- /dev/null +++ b/Task/Box-the-compass/PureBasic/box-the-compass.purebasic @@ -0,0 +1,73 @@ +DataSection + Data.s "N", "north", "E", "east", "W", "west", "S", "south", "b", " by " ;abbreviations, expansions + Data.s "N NbE N-NE NEbN NE NEbE E-NE EbN E EbS E-SE SEbE SE SEbS S-SE SbE" ;dirs + Data.s "S SbW S-SW SWbS SW SWbW W-SW WbS W WbN W-NW NWbW NW NWbN N-NW NbW" +EndDataSection + +;initialize data +NewMap dirSubst.s() +Define i, abbr.s, expansion.s +For i = 1 To 5 + Read.s abbr + Read.s expansion + dirSubst(abbr) = expansion +Next + +Dim dirs.s(32) +Define j, s.s +For j = 0 To 1 + Read.s s.s + For i = 0 To 15 + abbr.s = StringField(s, i + 1, " ") + dirs(j * 16 + i) = abbr + Next +Next + +;expand abbreviated compass point and capitalize +Procedure.s abbr2compassPoint(abbr.s) + Shared dirSubst() + Protected i, compassPoint.s, key.s + + For i = 1 To Len(abbr) + key.s = Mid(abbr, i, 1) + If FindMapElement(dirSubst(), key) + compassPoint + dirSubst(key) + Else + compassPoint + key + EndIf + Next + ProcedureReturn UCase(Left(compassPoint, 1)) + Mid(compassPoint, 2) +EndProcedure + +Procedure.s angle2compass(angle.f) + Shared dirs() + Static segment.f = 360.0 / 32 ;width of each compass segment + Protected dir + + ;work out which segment contains the compass angle + dir = Int((Mod(angle, 360) / segment) + 0.5) + + ;convert to a named direction + ProcedureReturn abbr2compassPoint(dirs(dir)) +EndProcedure + +;box the compass +If OpenConsole() + + Define i, heading.f, index + For i = 0 To 32 + heading = i * 11.25 + If i % 3 = 1 + heading + 5.62 + EndIf + If i % 3 = 2 + heading - 5.62 + EndIf + index = i % 32 + 1 + + PrintN(RSet(Str(index), 2) + " " + LSet(angle2compass(heading), 18) + RSet(StrF(heading, 2), 7)) + Next + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Box-the-compass/Run-BASIC/box-the-compass.run b/Task/Box-the-compass/Run-BASIC/box-the-compass.run new file mode 100644 index 0000000000..ccc35ff042 --- /dev/null +++ b/Task/Box-the-compass/Run-BASIC/box-the-compass.run @@ -0,0 +1,37 @@ +global direct$ +dim direct$(22) +direct$(1) = "y" 'by +direct$(4) = "ast" 'East +direct$(13) = "orth" 'North +direct$(18) = "outh" 'Soutn +direct$(22) = "est" 'West + +dim point$(32) +for i =1 to 32: read point$(i) :next i + +html "" +for i = 0 to 32 + hdng = i * 11.25 + if (i mod 3) = 1 then + hdng = hdng +5.62 + else + if (i mod 3) = 2 then hdng = hdng -5.62 + end if + pointer = i mod 32 + 1 + html "" +next i +html "
";pointer;"";compas$(hdng);"";hdng;"
" +end + +function compas$(hd) +x = hd /11.25 + 1.5 +if (x >=33.0) then x =x -32.0 + p$ = point$(int(x)) + for i = 1 to len(p$) + compas$ = compas$ + mid$(p$,i,1) + direct$(max(asc(upper$(mid$(p$,i,1)))-65,0)) + next i +end function + +data "N","N b e","N-ne","Ne b n","Ne","Ne b e","E-ne","E b n","E","E b s","E-se" +data "Se b e","Se","Se b s","S-se","S b e","S","S b w","S-sw","Sw b s","Sw","Sw b w" +data "W-sw","W b s","W","W b n","W-nw","Nw b w","Nw","Nw b n","N-nw","N b w" diff --git a/Task/Box-the-compass/Seed7/box-the-compass.seed7 b/Task/Box-the-compass/Seed7/box-the-compass.seed7 new file mode 100644 index 0000000000..a48e053b09 --- /dev/null +++ b/Task/Box-the-compass/Seed7/box-the-compass.seed7 @@ -0,0 +1,24 @@ +$ include "seed7_05.s7i"; + include "float.s7i"; + +const array string: names is [] ("North", "North by east", "North-northeast", "Northeast by north", + "Northeast", "Northeast by east", "East-northeast", "East by north", "East", "East by south", + "East-southeast", "Southeast by east", "Southeast", "Southeast by south", "South-southeast", + "South by east", "South", "South by west", "South-southwest", "Southwest by south", "Southwest", + "Southwest by west", "West-southwest", "West by south", "West", "West by north", "West-northwest", + "Northwest by west", "Northwest", "Northwest by north", "North-northwest", "North by west", "North"); + +const proc: main is func + local + const array float: degrees is [] (0.0, 16.87, 16.88, 33.75, 50.62, 50.63, 67.5, 84.37, 84.38, + 101.25, 118.12, 118.13, 135.0, 151.87, 151.88, 168.75, 185.62, 185.63, 202.5, 219.37, 219.38, + 236.25, 253.12, 253.13, 270.0, 286.87, 286.88, 303.75, 320.62, 320.63, 337.5, 354.37, 354.38); + var integer: index is 0; + var integer: nameIndex is 0; + begin + for key index range degrees do + nameIndex := round(degrees[index] * 32.0 / 360.0); + writeln(succ(pred(index) rem 32) lpad 2 <& " " <& names[succ(nameIndex rem 32)] rpad 22 <& + degrees[index] digits 2 lpad 6); + end for; + end func; diff --git a/Task/Box-the-compass/UNIX-Shell/box-the-compass.sh b/Task/Box-the-compass/UNIX-Shell/box-the-compass.sh new file mode 100644 index 0000000000..d2f37885b5 --- /dev/null +++ b/Task/Box-the-compass/UNIX-Shell/box-the-compass.sh @@ -0,0 +1,51 @@ +# List of abbreviated compass point labels +compass_points=( N NbE N-NE NEbN NE NEbE E-NE EbN + E EbS E-SE SEbE SE SEbS S-SE SbE + S SbW S-SW SWbS SW SWbW W-SW WbS + W WbN W-NW NWbW NW NWbN N-NW NbW ) + +# List of angles to test +test_angles=( 0.00 16.87 16.88 33.75 50.62 50.63 67.50 + 84.37 84.38 101.25 118.12 118.13 135.00 151.87 + 151.88 168.75 185.62 185.63 202.50 219.37 219.38 + 236.25 253.12 253.13 270.00 286.87 286.88 303.75 + 320.62 320.63 337.50 354.37 354.38 ) + + +# capitalize a string +function capitalize { + echo "$1" | sed 's/^./\U&/' +} + +# convert compass point abbreviation to full text of label +function expand_point { + local label="$1" + set -- N north E east S south W west b " by " + while (( $# )); do + label="${label//$1/$2}" + shift 2 + done + capitalize "$label" +} + +# modulus function that returns 1..N instead of 0..N-1 +function amod { + echo $(( ($1 - 1) % $2 + 1 )) +} + +# convert a compass angle from degrees into a box index (1..32) +function compass_point { + #amod $(dc <<<"$1 5.625 + 11.25 / 1 + p") 32 + amod $(bc <<<"($1 + 5.625) / 11.25 + 1") 32 +} + +# Now output the table of test data +header_format="%-7s | %-18s | %s\n" +row_format="%7.2f | %-18s | %2d\n" +printf "$header_format" "Degrees" "Closest Point" "Index" +for angle in ${test_angles[@]}; do + let index=$(compass_point $angle) + abbr=${compass_points[index-1]} + label="$(expand_point $abbr)" + printf "$row_format" $angle "$label" $index +done diff --git a/Task/Box-the-compass/Visual-Basic-.NET/box-the-compass.visual b/Task/Box-the-compass/Visual-Basic-.NET/box-the-compass.visual new file mode 100644 index 0000000000..7f4bcf4bce --- /dev/null +++ b/Task/Box-the-compass/Visual-Basic-.NET/box-the-compass.visual @@ -0,0 +1,46 @@ +Module BoxingTheCompass + Dim _points(32) As String + + Sub Main() + BuildPoints() + + Dim heading As Double = 0D + + For i As Integer = 0 To 32 + heading = i * 11.25 + Select Case i Mod 3 + Case 1 + heading += 5.62 + Case 2 + heading -= 5.62 + End Select + + Console.WriteLine("{0,2}: {1,-18} {2,6:F2}°", (i Mod 32) + 1, InitialUpper(GetPoint(heading)), heading) + Next + End Sub + + Private Sub BuildPoints() + Dim cardinal As String() = New String() {"north", "east", "south", "west"} + Dim pointDesc As String() = New String() {"1", "1 by 2", "1-C", "C by 1", "C", "C by 2", "2-C", "2 by 1"} + + Dim str1, str2, strC As String + + For i As Integer = 0 To 3 + str1 = cardinal(i) + str2 = cardinal((i + 1) Mod 4) + strC = IIf(str1 = "north" Or str1 = "south", str1 & str2, str2 & str1) + For j As Integer = 0 To 7 + _points(i * 8 + j) = pointDesc(j).Replace("1", str1).Replace("2", str2).Replace("C", strC) + Next + Next + End Sub + + Private Function InitialUpper(ByVal s As String) As String + Return s.Substring(0, 1).ToUpper() & s.Substring(1) + End Function + + Private Function GetPoint(ByVal Degrees As Double) As String + Dim testD As Double = (Degrees / 11.25) + 0.5 + Return _points(CInt(Math.Floor(testD Mod 32))) + End Function +End Module diff --git a/Task/Break-OO-privacy/Objective-C/break-oo-privacy.m b/Task/Break-OO-privacy/Objective-C/break-oo-privacy.m new file mode 100644 index 0000000000..ea5c51b132 --- /dev/null +++ b/Task/Break-OO-privacy/Objective-C/break-oo-privacy.m @@ -0,0 +1,43 @@ +#import + +@interface Example : NSObject { +@private + NSString *_name; +} +- (id)initWithName:(NSString *)name; +@end + +@implementation Example +- (NSString *)description { + return [NSString stringWithFormat:@"Hello, I am %@", _name]; +} +- (id)initWithName:(NSString *)name { + if ((self = [super init])) { + _name = [name copy]; + } + return self; +} +- (void)dealloc { + [_name release]; + [super dealloc]; +} +@end + +int main (int argc, const char * argv[]) { + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + + Example *foo = [[Example alloc] initWithName:@"Eric"]; + + // get private field + NSLog(@"%@", foo->_name); + + // set private field + [foo->_name release]; + foo->_name = [@"Edith" copy]; + NSLog(@"%@", foo); + + [foo release]; + + [pool release]; + return 0; +} diff --git a/Task/Break-OO-privacy/Perl-6/break-oo-privacy.pl6 b/Task/Break-OO-privacy/Perl-6/break-oo-privacy.pl6 new file mode 100644 index 0000000000..392a3991f8 --- /dev/null +++ b/Task/Break-OO-privacy/Perl-6/break-oo-privacy.pl6 @@ -0,0 +1,6 @@ +class Foo { + has $!shyguy = 42; +} +my Foo $foo .= new; + +say $foo.^attributes.first('$!shyguy').get_value($foo); diff --git a/Task/Bulls-and-cows-Player/Mathematica/bulls-and-cows-player.mathematica b/Task/Bulls-and-cows-Player/Mathematica/bulls-and-cows-player.math similarity index 100% rename from Task/Bulls-and-cows-Player/Mathematica/bulls-and-cows-player.mathematica rename to Task/Bulls-and-cows-Player/Mathematica/bulls-and-cows-player.math diff --git a/Task/Bulls-and-cows-Player/Perl-6/bulls-and-cows-player.pl6 b/Task/Bulls-and-cows-Player/Perl-6/bulls-and-cows-player.pl6 new file mode 100644 index 0000000000..960d9b911e --- /dev/null +++ b/Task/Bulls-and-cows-Player/Perl-6/bulls-and-cows-player.pl6 @@ -0,0 +1,45 @@ +# we use the [] reduction meta operator along with the Cartesian Product +# operator X to create the Cartesian Product of four times [1..9] and then get +# all the elements where the number of unique digits is four. +my @candidates = ([X] [1..9] xx 4).tree.grep: *.uniq == 4; + +repeat { + my $guess = @candidates.pick; + my ($bulls, $cows) = read-score; + @candidates .= grep: &score-correct; + + # note how we declare our two subroutines within the repeat block. This + # limits the scope in which the routines are known to the scope in which + # they are needed and saves us a lot of arguments to our two routines. + sub score-correct($a) { + # use the Z (zip) meta operator along with == to construct the + # list ($a[0] == $b[0], $a[1] == $b[1], ...) and then add it up + # using the reduction meta operator [] and +. + my $exact = [+] $a Z== $guess; + + # number of elements of $a that match any element of $b + my $loose = +$a.grep: any @$guess; + + return $bulls == $exact && $cows == $loose - $exact; + } + + sub read-score() { + loop { + my $score = prompt "My guess: {$guess.join}.\n"; + + # use the :s modifier to tell Perl 6 to handle spaces + # automatically and save the first digit in $ and + # the second digit in $ + if $score ~~ m:s/^ $=(\d) $=(\d) $/ + and $ + $ <= 4 { + return +$, +$; + } + + say "Please specify the number of bulls and cows"; + } + } +} while @candidates > 1; + +say @candidates + ?? "Your secret number is {@candidates[0].join}!" + !! "I think you made a mistake with your scoring."; diff --git a/Task/Bulls-and-cows-Player/PureBasic/bulls-and-cows-player.purebasic b/Task/Bulls-and-cows-Player/PureBasic/bulls-and-cows-player.purebasic new file mode 100644 index 0000000000..b56e5c5620 --- /dev/null +++ b/Task/Bulls-and-cows-Player/PureBasic/bulls-and-cows-player.purebasic @@ -0,0 +1,106 @@ +#answerSize = 4 +Structure history + answer.s + bulls.i + cows.i +EndStructure + +Procedure evaluateGuesses(*answer.history, List remainingGuesses.s()) + Protected i, cows, bulls + + ForEach remainingGuesses() + bulls = 0: cows = 0 + For i = 1 To #answerSize + If Mid(remainingGuesses(), i, 1) = Mid(*answer\answer, i, 1) + bulls + 1 + ElseIf FindString(remainingGuesses(), Mid(*answer\answer, i, 1), 1) + cows + 1 + EndIf + Next + If bulls <> *answer\bulls Or cows <> *answer\cows + DeleteElement(remainingGuesses()) + EndIf + Next +EndProcedure + +Procedure findPermutations(List permutations.s(), elementChar.s, permSize) + Protected i, j, stackDepth, elementCount = Len(elementChar) - 1, working.s = Space(permSize), *working = @working + permSize - 1 + Dim stack(permSize) ;holds index states + + Dim elements(elementCount) + Dim elementChar.c(elementCount) + For i = 0 To elementCount + elementChar(i) = PeekC(@elementChar + i * SizeOf(Character)) + Next + + i = 0 + Repeat + While i <= elementCount + If elements(i) = 0 + stack(stackDepth) = i + If stackDepth = permSize + For j = 0 To permSize + PokeC(*working + j * SizeOf(Character), elementChar(stack(j))) + Next + AddElement(permutations()) + permutations() = working + Else + elements(i) = 1 + stackDepth + 1 + i = 0 + Continue ;skip update + EndIf + EndIf + i + 1 + Wend + stackDepth - 1 + If stackDepth < 0 + Break + EndIf + i = stack(stackDepth) + 1 + elements(i - 1) = 0 + ForEver +EndProcedure + + +If OpenConsole() + Define guess.s, guessNum, score.s, delimeter.s + NewList remainingGuesses.s() + NewList answer.history() + findPermutations(remainingGuesses(), "123456789", 4) + + PrintN("Playing Bulls & Cows with " + Str(#answerSize) + " unique digits." + #CRLF$) + Repeat + If ListSize(remainingGuesses()) = 0 + If answer()\bulls = #answerSize And answer()\cows = 0 + PrintN(#CRLF$ + "Solved!") + Break ;exit Repeat/Forever + EndIf + + PrintN(#CRLF$ + "BadScoring! Nothing fits the scores you gave.") + ForEach answer() + PrintN(answer()\answer + " -> [" + Str(answer()\bulls) + ", " + Str(answer()\cows) + "]") + Next + Break ;exit Repeat/Forever + Else + guessNum + 1 + SelectElement(remainingGuesses(), Random(ListSize(remainingGuesses()) - 1)) + guess = remainingGuesses() + DeleteElement(remainingGuesses()) + + Print("Guess #" + Str(guessNum) + " is " + guess + ". What does it score (bulls, cows)?") + score = Input() + If CountString(score, ",") > 0: delimeter = ",": Else: delimeter = " ": EndIf + + AddElement(answer()) + answer()\answer = guess + answer()\bulls = Val(StringField(score, 1, delimeter)) + answer()\cows = Val(StringField(score, 2, delimeter)) + evaluateGuesses(@answer(), remainingGuesses()) + EndIf + ForEver + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Bulls-and-cows/BASIC/bulls-and-cows.bas b/Task/Bulls-and-cows/BASIC/bulls-and-cows.basic similarity index 100% rename from Task/Bulls-and-cows/BASIC/bulls-and-cows.bas rename to Task/Bulls-and-cows/BASIC/bulls-and-cows.basic diff --git a/Task/Bulls-and-cows/Mathematica/bulls-and-cows.mathematica b/Task/Bulls-and-cows/Mathematica/bulls-and-cows.math similarity index 100% rename from Task/Bulls-and-cows/Mathematica/bulls-and-cows.mathematica rename to Task/Bulls-and-cows/Mathematica/bulls-and-cows.math diff --git a/Task/Bulls-and-cows/OCaml/bulls-and-cows.ocaml b/Task/Bulls-and-cows/OCaml/bulls-and-cows.ocaml new file mode 100644 index 0000000000..b3d1df99e6 --- /dev/null +++ b/Task/Bulls-and-cows/OCaml/bulls-and-cows.ocaml @@ -0,0 +1,50 @@ +let rec input() = + let s = read_line () in + try + if String.length s <> 4 then raise Exit; + String.iter (function + | '1'..'9' -> () + | _ -> raise Exit + ) s; + let t = [ s.[0]; s.[1]; s.[2]; s.[3] ] in + let _ = List.fold_left (* reject entry with duplication *) + (fun ac b -> if List.mem b ac then raise Exit; (b::ac)) + [] t in + List.map (fun c -> int_of_string (String.make 1 c)) t + with Exit -> + prerr_endline "That is an invalid entry. Please try again."; + input() +;; + +let print_score g t = + let bull = ref 0 in + List.iter2 (fun x y -> + if x = y then incr bull + ) g t; + let cow = ref 0 in + List.iter (fun x -> + if List.mem x t then incr cow + ) g; + cow := !cow - !bull; + Printf.printf "%d bulls, %d cows\n%!" !bull !cow +;; + +let () = + Random.self_init(); + let rec mkgoal acc = function 4 -> acc + | i -> + let n = succ(Random.int 9) in + if List.mem n acc + then mkgoal acc i + else mkgoal (n::acc) (succ i) + in + let g = mkgoal [] 0 in + let found = ref false in + while not !found do + let t = input() in + if t = g + then found := true + else print_score g t + done; + print_endline "Congratulations you guessed correctly"; +;; diff --git a/Task/Bulls-and-cows/Oz/bulls-and-cows.oz b/Task/Bulls-and-cows/Oz/bulls-and-cows.oz new file mode 100644 index 0000000000..404f5ff4e9 --- /dev/null +++ b/Task/Bulls-and-cows/Oz/bulls-and-cows.oz @@ -0,0 +1,69 @@ +declare + proc {Main} + Solution = {PickNUnique 4 {List.number 1 9 1}} + + proc {Loop} + Guess = {EnterGuess} + in + {System.showInfo + {Bulls Guess Solution}#" bulls and "# + {Cows Guess Solution}#" cows"} + if Guess \= Solution then {Loop} end + end + in + {Loop} + {System.showInfo "You have won!"} + end + + fun {Bulls Xs Sol} + {Length {Filter {List.zip Xs Sol Value.'=='} Id}} + end + + fun {Cows Xs Sol} + {Length {Intersection Xs Sol}} + end + + local + class TextFile from Open.file Open.text end + StdIn = {New TextFile init(name:stdin)} + in + fun {EnterGuess} + try + {System.printInfo "Enter your guess (e.g. \"1234\"): "} + S = {StdIn getS($)} + in + %% verify + {Length S} = 4 + {All S Char.isDigit} = true + {FD.distinct S} %% assert there is no duplicate digit + %% convert from digits to numbers + {Map S fun {$ D} D-&0 end} + catch _ then + {EnterGuess} + end + end + end + + fun {PickNUnique N Xs} + {FoldL {MakeList N} + fun {$ Z _} + {Pick {Diff Xs Z}}|Z + end + nil} + end + + fun {Pick Xs} + {Nth Xs {OS.rand} mod {Length Xs} + 1} + end + + fun {Diff Xs Ys} + {FoldL Ys List.subtract Xs} + end + + fun {Intersection Xs Ys} + {Filter Xs fun {$ X} {Member X Ys} end} + end + + fun {Id X} X end +in + {Main} diff --git a/Task/Bulls-and-cows/PARI-GP/bulls-and-cows.pari b/Task/Bulls-and-cows/PARI-GP/bulls-and-cows.pari new file mode 100644 index 0000000000..3f6289c23c --- /dev/null +++ b/Task/Bulls-and-cows/PARI-GP/bulls-and-cows.pari @@ -0,0 +1,11 @@ +bc()={ + my(u,v,bulls,cows); + while(#vecsort(v=vector(4,i,random(9)+1),,8)<4,); + while(bulls<4, + u=input(); + if(type(u)!="t_VEC"|#u!=4,next); + bulls=sum(i=1,4,u[i]==v[i]); + cows=sum(i=1,4,sum(j=1,4,i!=j&v[i]==u[j])); + print("You have "bulls" bulls and "cows" cows") + ) +}; diff --git a/Task/Bulls-and-cows/Perl-6/bulls-and-cows.pl6 b/Task/Bulls-and-cows/Perl-6/bulls-and-cows.pl6 new file mode 100644 index 0000000000..135efadfa6 --- /dev/null +++ b/Task/Bulls-and-cows/Perl-6/bulls-and-cows.pl6 @@ -0,0 +1,21 @@ +my $size = 4; +my @secret = pick $size, '1' .. '9'; + +for 1..* -> $guesses { + my @guess; + loop { + @guess = (prompt("Guess $guesses: ") // exit).comb; + last if @guess == $size and + all(@guess) eq one(@guess) & any('1' .. '9'); + say 'Malformed guess; try again.'; + } + my ($bulls, $cows) = 0, 0; + for ^$size { + when @guess[$_] eq @secret[$_] { ++$bulls; } + when @guess[$_] eq any @secret { ++$cows; } + } + last if $bulls == $size; + say "$bulls bulls, $cows cows."; +} + +say 'A winner is you!'; diff --git a/Task/Bulls-and-cows/PureBasic/bulls-and-cows.purebasic b/Task/Bulls-and-cows/PureBasic/bulls-and-cows.purebasic new file mode 100644 index 0000000000..b8832fa208 --- /dev/null +++ b/Task/Bulls-and-cows/PureBasic/bulls-and-cows.purebasic @@ -0,0 +1,70 @@ +Define.s secret, guess, c +Define.i bulls, cows, guesses, i + +If OpenConsole() + + While Len(secret) < 4 + c = Chr(Random(8) + 49) + If FindString(secret, c, 1) = 0 + secret + c + EndIf + Wend + + Repeat + Print("Guess a 4-digit number with no duplicate digits: ") + guess = Input() + If Len(guess) = 0 + Break ;break from loop + EndIf + + isMalformedGuess = #False + If Len(guess) <> 4 + ;guess is too short + isMalformedGuess = #True + Else + For i = 1 To 4 + c = Mid(guess, i, 1) + If Not FindString("123456789", c, 1) Or CountString(guess, c) <> 1 + ;guess contains either non-digits or duplicate digits + isMalformedGuess = #True + Break ;break from For/Next loop + EndIf + Next + EndIf + + If isMalformedGuess + PrintN("** You should enter 4 different numeric digits that are each from 1 to 9!") + Continue ;continue loop + EndIf + + bulls = 0: cows = 0: guesses = guesses + 1 + For i = 1 To 4 + c = Mid(secret, i, 1) + If Mid(guess, i, 1) = c + bulls + 1 + ElseIf FindString(guess, c, 1) + cows + 1 + EndIf + Next + + Print( Str(bulls) + " bull") + If bulls <> 1 + Print( "s") + EndIf + Print( ", " + Str(cows) + " cow") + If cows <> 1 + PrintN( "s") + Else + PrintN("") + EndIf + + If guess = secret + PrintN("You won after " + Str(guesses) + " guesses!") + Break ;break from loop + EndIf + ForEver + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + CloseConsole() +EndIf diff --git a/Task/Bulls-and-cows/TUSCRIPT/bulls-and-cows.tuscript b/Task/Bulls-and-cows/TUSCRIPT/bulls-and-cows.tuscript new file mode 100644 index 0000000000..775109d257 --- /dev/null +++ b/Task/Bulls-and-cows/TUSCRIPT/bulls-and-cows.tuscript @@ -0,0 +1,38 @@ +$$ MODE tuscript +SET nr1=RANDOM_NUMBERS (1,9,1) +LOOP + SET nr2=RANDOM_NUMBERS (1,9,1) + IF (nr2!=nr1) EXIT +ENDLOOP +LOOP + SET nr3=RANDOM_NUMBERS (1,9,1) + IF (nr3!=nr1,nr2) EXIT +ENDLOOP +LOOP + SET nr4=RANDOM_NUMBERS (1,9,1) + IF (nr4!=nr1,nr2,nr3) EXIT +ENDLOOP +SET nr=JOIN(nr1,"'",nr2,nr3,nr4), limit=10 +LOOP r=1,limit +SET bulls=cows=0 +ASK "round {r} insert a number":guessnr="" +SET length=LENGTH(guessnr), checknr=STRINGS (guessnr,":>/:") + LOOP n=nr,y=checknr + IF (length!=4) THEN + PRINT "4-letter digit required" + EXIT + ELSEIF (n==y) THEN + SET bulls=bulls+1 + ELSEIF (nr.ct.":{y}:") THEN + SET cows=cows+1 + ENDIF + ENDLOOP +PRINT "bulls=",bulls," cows=",cows + IF (bulls==4) THEN + PRINT "BINGO" + EXIT + ELSEIF (r==limit) THEN + PRINT "BETTER NEXT TIME" + EXIT + ENDIF +ENDLOOP diff --git a/Task/Bulls-and-cows/UNIX-Shell/bulls-and-cows.sh b/Task/Bulls-and-cows/UNIX-Shell/bulls-and-cows.sh new file mode 100644 index 0000000000..f5b7ae1984 --- /dev/null +++ b/Task/Bulls-and-cows/UNIX-Shell/bulls-and-cows.sh @@ -0,0 +1,150 @@ +#!/bin/bash + +rand() { + local min=${1:-0} + local max=${2:-32767} + + [ ${min} -gt ${max} ] && + min=$(( min ^ max )) && + max=$(( min ^ max )) && + min=$(( min ^ max )) + + echo -n $(( ( $RANDOM % $max ) + $min )) +} + +in_arr() { + local quandry="${1}" + shift + local arr=( $@ ) + local i='' + + for i in ${arr[*]} + do + [ "${quandry}" == "${i}" ] && return 0 && break + done + + return 1 +} + +delete_at() { + local idx="$(( $1 + 1 ))" + shift + local arr=( "sentinel" $@ ) + + echo -n "${arr[@]:1:$(( idx - 1 ))} ${arr[@]:$((idx + 1)):$(( ${#arr[@]} - idx - 1))}" +} + +delete_first() { + local meanie="${1}" + shift + local arr=( $@ ) + local i=0 + + for (( i = 0; i < ${#arr[@]} ; i++ )) + do + [ "${arr[${i}]}" == "${meanie}" ] && arr=( $( delete_at ${i} ${arr[*]} ) ) + done + + echo -n "${arr[*]}" +} + +to_arr() { + local string="${1}" + local arr=() + + while [ "${#string}" -gt 0 ] + do + arr=( ${arr[*]} ${string:0:1} ) + string="${string:1}" + done + + echo -n "${arr[*]}" +} + +choose_idx() { + local arr=( $@ ) + + echo -n "$( rand 0 $(( ${#arr[@]} - 1 )) )" +} + +locate_bulls() { + local secret=( $( to_arr "${1}" ) ) + local guess=( $( to_arr "${2}" ) ) + local hits=() + local i=0 + + for (( i=0; i<4; i++ )) + do + [ "${secret[${i}]}" -eq "${guess[${i}]}" ] && hits=( ${hits[*]} ${i} ) + done + + echo -n "${hits[*]}" +} + +bulls() { + local secret="${1}" + local guess="${2}" + local bulls=( $( locate_bulls "${secret}" "${guess}" ) ) + + echo -n "${#bulls[@]}" +} + +cows() { + local secret=( $( to_arr "${1}" ) ) + local guess=( $( to_arr "${2}" ) ) + local bulls=( $( locate_bulls "${1}" "${2}" ) ) + local hits=0 + local i='' + + # Avoid double-counting bulls + for i in ${bulls[*]} + do + secret=( $( delete_at ${i} ${secret[*]} ) ) + done + + # Process the guess against what's left of the secret + for i in ${guess[*]} + do + in_arr "${i}" ${secret[*]} && + secret=( $( delete_first "${i}" ${secret[*]} ) ) && + (( hits++ )) + done + + echo -n ${hits} +} + +malformed() { + local guess=( $( to_arr "${1}" ) ) + local i='' + + [ ${#guess[@]} -ne 4 ] && + return 0 + + for i in ${guess[*]} + do + if ! in_arr ${i} 1 2 3 4 5 6 7 8 9 + then + return 0 + break + fi + done + + return 1 +} + +candidates=( 1 2 3 4 5 6 7 8 9 ) +secret='' + +while [ "${#secret}" -lt 4 ] +do + cidx=$( choose_idx ${candidates[*]} ) + secret="${secret}${candidates[${cidx}]}" + candidates=( $(delete_at ${cidx} ${candidates[*]} ) ) +done + +while read -p "Enter a four-digit guess: " guess +do + malformed "${guess}" && echo "Malformed guess" && continue + [ "${guess}" == "${secret}" ] && echo "You win!" && exit + echo "Score: $( bulls "${secret}" "${guess}" ) Bulls, $( cows "${secret}" "${guess}" ) Cows" +done diff --git a/Task/Bulls-and-cows/Vedit-macro-language/bulls-and-cows.vedit b/Task/Bulls-and-cows/Vedit-macro-language/bulls-and-cows.vedit new file mode 100644 index 0000000000..44e5730b29 --- /dev/null +++ b/Task/Bulls-and-cows/Vedit-macro-language/bulls-and-cows.vedit @@ -0,0 +1,47 @@ +Buf_Switch(Buf_Free) +#90 = Time_Tick // seed for random number generator +#91 = 10 // random numbers in range 0 to 9 +while (EOB_pos < 4) { // 4 digits needed + Call("RANDOM") + BOF Ins_Char(Return_Value + '0') + Replace("(.)(.*)\1", "\1\2", REGEXP+BEGIN+NOERR) // remove any duplicate +} + +#3 = 0 +repeat (99) { + Get_Input(10, "Guess a 4-digit number with no duplicate digits: ", NOCR) + if (Reg_Size(10) == 0) { Break } // empty string = exit + Num_Eval_Reg(10) // check for numeric digits + if (Chars_Matched != 4) { + M("You should enter 4 numeric digits\n") + Continue + } + + Goto_Pos(4) // count bulls + Reg_Ins(10, OVERWRITE) + #1 = Search("(.)...\1", REGEXP+BEGIN+ALL+NOERR) + + RS(10, "[", INSERT) // count cows + RS(10, "]", APPEND) + #2 = Search_Block(@10, 0, 4, REGEXP+BEGIN+ALL+NOERR) - #1 + + #3++ + NT(#1, NOCR) M(" bulls,") NT(#2, NOCR) M(" cows\n") + if (#1 == 4) { + M("You won after") NT(#3, NOCR) M(" guesses!\n") + Break + } +} +Buf_Quit(OK) +Return + +//-------------------------------------------------------------- +// Generate random numbers in range 0 <= Return_Value < #91 +// #90 = Seed (0 to 0x7fffffff) +// #91 = Scaling (0 to 0x10000) + +:RANDOM: +#92 = 0x7fffffff / 48271 +#93 = 0x7fffffff % 48271 +#90 = (48271 * (#90 % #92) - #93 * (#90 / #92)) & 0x7fffffff +Return ((#90 & 0xffff) * #91 / 0x10000) diff --git a/Task/Bulls-and-cows/Visual-Basic-.NET/bulls-and-cows.visual b/Task/Bulls-and-cows/Visual-Basic-.NET/bulls-and-cows.visual new file mode 100644 index 0000000000..4d2051ed37 --- /dev/null +++ b/Task/Bulls-and-cows/Visual-Basic-.NET/bulls-and-cows.visual @@ -0,0 +1,56 @@ +Imports System +Imports System.Text.RegularExpressions + +Module Bulls_and_Cows + Function CreateNumber() As String + Dim random As New Random() + Dim sequence As Char() = {"1"c, "2"c, "3"c, "4"c, "5"c, "6"c, "7"c, "8"c, "9"c} + + For i As Integer = 0 To sequence.Length - 1 + Dim j As Integer = random.Next(sequence.Length) + Dim temp As Char = sequence(i) : sequence(i) = sequence(j) : sequence(j) = temp + Next + + Return New String(sequence, 0, 4) + End Function + + Function IsFourDigitNumber(ByVal number As String) As Boolean + Return Regex.IsMatch(number, "^[1-9]{4}$") + End Function + + Sub Main() + Dim chosenNumber As String = CreateNumber() + Dim attempt As Integer = 0 + Console.WriteLine("Number is chosen") + Dim gameOver As Boolean = False + Do + attempt += 1 + Console.WriteLine("Attempt #{0}. Enter four digit number: ", attempt) + Dim number As String = Console.ReadLine() + Do While Not IsFourDigitNumber(number) + Console.WriteLine("Invalid number: type four characters. Every character must digit be between '1' and '9'.") + number = Console.ReadLine() + Loop + + Dim bulls As Integer = 0 + Dim cows As Integer = 0 + + For i As Integer = 0 To number.Length - 1 + Dim j As Integer = chosenNumber.IndexOf(number(i)) + If i = j Then + bulls += 1 + ElseIf j >= 0 Then + cows += 1 + End If + Next + + If bulls < chosenNumber.Length Then + Console.WriteLine("The number '{0}' has {1} bulls and {2} cows", _ + number, bulls, cows) + Else + gameOver = True + End If + Loop Until gameOver + Console.WriteLine("The number was guessed in {0} attempts. Congratulations!", attempt) + End Sub +End Module diff --git a/Task/CRC-32/Mathematica/crc-32.mathematica b/Task/CRC-32/Mathematica/crc-32.math similarity index 100% rename from Task/CRC-32/Mathematica/crc-32.mathematica rename to Task/CRC-32/Mathematica/crc-32.math diff --git a/Task/CRC-32/NetRexx/crc-32.netrexx b/Task/CRC-32/NetRexx/crc-32.netrexx new file mode 100644 index 0000000000..0a06f8922a --- /dev/null +++ b/Task/CRC-32/NetRexx/crc-32.netrexx @@ -0,0 +1,11 @@ +/* NetRexx */ +options replace format comments java crossref symbols binary + +import java.util.zip.CRC32 + +toBeEncoded = String("The quick brown fox jumps over the lazy dog") +myCRC = CRC32() +myCRC.update(toBeEncoded.getBytes()) +say "The CRC-32 value is :" Long.toHexString(myCRC.getValue()) "!" + +return diff --git a/Task/CRC-32/OCaml/crc-32.ocaml b/Task/CRC-32/OCaml/crc-32.ocaml new file mode 100644 index 0000000000..1a0023a748 --- /dev/null +++ b/Task/CRC-32/OCaml/crc-32.ocaml @@ -0,0 +1,4 @@ +let () = + let s = "The quick brown fox jumps over the lazy dog" in + let crc = Zlib.update_crc 0l s 0 (String.length s) in + Printf.printf "crc: %lX\n" crc diff --git a/Task/CRC-32/Perl-6/crc-32-1.pl6 b/Task/CRC-32/Perl-6/crc-32-1.pl6 new file mode 100644 index 0000000000..1bfc1e41fe --- /dev/null +++ b/Task/CRC-32/Perl-6/crc-32-1.pl6 @@ -0,0 +1,6 @@ +use NativeCall; + +sub crc32(int32 $crc, Str $buf, int32 $len --> int32) is native('/usr/lib/libz.dylib') { * } + +my $buf = 'The quick brown fox jumps over the lazy dog'; +say crc32(0, $buf, $buf.chars).fmt('%08x'); diff --git a/Task/CRC-32/Perl-6/crc-32-2.pl6 b/Task/CRC-32/Perl-6/crc-32-2.pl6 new file mode 100644 index 0000000000..65228aca99 --- /dev/null +++ b/Task/CRC-32/Perl-6/crc-32-2.pl6 @@ -0,0 +1,20 @@ +sub crc( + Buf $buf, + # polynomial including leading term, default: ISO 3309/PNG/gzip + :@poly = (1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1), + :$n = @poly.end, # degree of polynomial + :@init = 1 xx $n, # initial XOR bits + :@fini = 1 xx $n, # final XOR bits + :@bitorder = 0..7, # default: eat bytes LSB-first + :@crcorder = 0..$n-1, # default: MSB of checksum is coefficient of x⁰ +) { + my @bit = ($buf.list X+& (1 X+< @bitorder))».so».Int, 0 xx $n; + + @bit[0 .. $n-1] «+^=» @init; + @bit[$_ ..$_+$n] «+^=» @poly if @bit[$_] for 0..@bit.end-$n; + @bit[*-$n.. *-1] «+^=» @fini; + + :2[@bit[@bit.end X- @crcorder]]; +} + +say crc('The quick brown fox jumps over the lazy dog'.encode('ascii')).base(16); diff --git a/Task/CRC-32/XPL0/crc-32.xpl0 b/Task/CRC-32/XPL0/crc-32.xpl0 new file mode 100644 index 0000000000..2a926b954d --- /dev/null +++ b/Task/CRC-32/XPL0/crc-32.xpl0 @@ -0,0 +1,19 @@ +code HexOut=27; \intrinsic routine +string 0; \use zero-terminated strings + +func CRC32(Str, Len); \Return CRC-32 for given string +char Str; int Len; \byte array, number of bytes +int I, J, R, C; +[R:= -1; \initialize with all 1's +for J:= 0 to Len-1 do + [C:= Str(J); + for I:= 0 to 8-1 do \for each bit in byte... + [if (R xor C) and 1 then R:= R>>1 xor $EDB88320 + else R:= R>>1; + C:= C>>1; + ]; + ]; +return not R; +]; + +HexOut(0, CRC32("The quick brown fox jumps over the lazy dog", 43)) diff --git a/Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-1.coffee b/Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-1.coffeescript similarity index 100% rename from Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-1.coffee rename to Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-1.coffeescript diff --git a/Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-2.coffee b/Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-2.coffeescript similarity index 100% rename from Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-2.coffee rename to Task/CSV-to-HTML-translation/CoffeeScript/csv-to-html-translation-2.coffeescript diff --git a/Task/CSV-to-HTML-translation/Mathematica/csv-to-html-translation.mathematica b/Task/CSV-to-HTML-translation/Mathematica/csv-to-html-translation.math similarity index 100% rename from Task/CSV-to-HTML-translation/Mathematica/csv-to-html-translation.mathematica rename to Task/CSV-to-HTML-translation/Mathematica/csv-to-html-translation.math diff --git a/Task/CSV-to-HTML-translation/NetRexx/csv-to-html-translation-1.netrexx b/Task/CSV-to-HTML-translation/NetRexx/csv-to-html-translation-1.netrexx new file mode 100644 index 0000000000..20ef6778aa --- /dev/null +++ b/Task/CSV-to-HTML-translation/NetRexx/csv-to-html-translation-1.netrexx @@ -0,0 +1,120 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +parse arg inFileName . +if inFileName = '' | inFileName = '.' then inFileName = './data/Brian.csv' +csv = RREadFileLineByLine01.scanFile(inFileName) + +header = htmlHeader() +pre = htmlCsvText(csv, inFileName) +table = htmlCsvTable(csv, inFileName) +footer = htmlFooter() + +say header +say pre +say table +say footer + +return + +method htmlHeader() public static returns Rexx + html = '\n' - + || '\n' - + || '\n' - + || '\n' - + || '\n' - + || 'RCsv2Html\n' - + || '\n' - + || '\n' - + || '\n' - + || '

Rosetta Code – NetRexx Sample Output

\n' - + || '

CSV to HTML translation

\n' - + || '' + + return html + +method htmlFooter() public static returns Rexx + html = '\n' - + || '\n' - + || '' + return html + +method htmlCsvText(csv, fileName = '.') public static returns Rexx + html = '

Contents of CSV 'fileName'

\n' - + || '
\n' -
+      || ''
+  loop row = 1 to csv[0]
+    html = html || csv[row]'\n'
+    end row
+  html = html -
+      || '
\n' - + || '' + return html + +method htmlCsvTable(csv, fileName = '.') public static returns Rexx + html = '\n' - + || '\n' - + || '\n' - + || '' + html = html - + || htmlCsvTableRow(csv[1], 'th')'\n' - + || '\n' - + || '\n' - + || '' + loop r_ = 2 to csv[0] + html = html - + || htmlCsvTableRow(csv[r_])'\n' - + || '' + end r_ + html = html - + || '\n' - + || '
Translation of CSV 'fileName'
\n' - + || '' + return html + +method htmlCsvTableRow(row, tag = 'td') public static returns Rexx + row = row.strip('t') + row = row.changestr('&', '&') -- need to do this one first to avoid double translation + row = row.changestr('"', '"') + row = row.changestr("'", ''') + row = row.changestr('<', '<') + row = row.changestr('>', '>') + elmts = '' + elmts[0] = 0 + e_ = 0 + loop while row.length() > 0 + parse row elmt ',' row + e_ = e_ + 1; elmts[0] = e_; elmts[e_] = elmt + end + html = '\n' - + || '' + loop e_ = 1 to elmts[0] + html = html - + || '<'tag'>'elmts[e_]'\n' - + || '' + end e_ + html = html - + || '\n' - + || '' + return html diff --git a/Task/CSV-to-HTML-translation/NetRexx/csv-to-html-translation-2.netrexx b/Task/CSV-to-HTML-translation/NetRexx/csv-to-html-translation-2.netrexx new file mode 100644 index 0000000000..36f05ebed7 --- /dev/null +++ b/Task/CSV-to-HTML-translation/NetRexx/csv-to-html-translation-2.netrexx @@ -0,0 +1,83 @@ + + + + + +RCsv2Html + + + +

Rosetta Code – NetRexx Sample Output

+

CSV to HTML translation

+ +

Contents of CSV ./data/Brian.csv

+
+Character,Speech
+The multitude,The messiah! Show us the messiah!
+Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!
+The multitude,Who are you?
+Brians mother,I'm his mother; that's who!
+The multitude,Behold his mother! Behold his mother!
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Contents of CSV ./data/Brian.csv
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
+ + + diff --git a/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-1.ocaml b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-1.ocaml new file mode 100644 index 0000000000..27cd35cdd2 --- /dev/null +++ b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-1.ocaml @@ -0,0 +1,35 @@ +open Printf + +let csv_data = "\ +Character,Speech +The multitude,The messiah! Show us the messiah! +Brians mother,Now you listen here! He's not the messiah; \ + he's a very naughty boy! Now go away! +The multitude,Who are you? +Brians mother,I'm his mother; that's who! +The multitude,Behold his mother! Behold his mother!" + +(* General HTML escape *) +let escape = + let html_escapes = Str.regexp "\\([^A-Za-z0-9 ;!?'/]\\)" in + let esc s = sprintf "&#%04d;" (Char.code s.[Str.group_beginning 1]) in + Str.global_substitute html_escapes esc + +let nl = Str.regexp "\n\r?" +let coma = Str.regexp "," + +let list_of_csv csv = + List.map (fun l -> Str.split coma l) (Str.split nl csv) + +let print_html_table segments = + printf "\n"; + List.iter (fun line -> + printf ""; + List.iter (fun c -> printf "" (escape c)) line; + printf "\n"; + ) segments; + printf "
%s
\n"; +;; + +let () = + print_html_table (list_of_csv csv_data) diff --git a/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-2.ocaml b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-2.ocaml new file mode 100644 index 0000000000..55c48bc6c9 --- /dev/null +++ b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-2.ocaml @@ -0,0 +1,8 @@ + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-3.ocaml b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-3.ocaml new file mode 100644 index 0000000000..8aa9f7edcd --- /dev/null +++ b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-3.ocaml @@ -0,0 +1,44 @@ +open Printf + +let csv_data = "\ +Character,Speech +The multitude,The messiah! Show us the messiah! +Brians mother,Now you listen here! He's not the messiah; \ + he's a very naughty boy! Now go away! +The multitude,Who are you? +Brians mother,I'm his mother; that's who! +The multitude,Behold his mother! Behold his mother!" + +(* General HTML escape *) +let escape = + let html_escapes = Str.regexp "\\([^A-Za-z0-9 ;!?'/]\\)" in + let esc s = sprintf "&#%04d;" (Char.code s.[Str.group_beginning 1]) in + Str.global_substitute html_escapes esc + +let nl = Str.regexp "\n\r?" +let coma = Str.regexp "," + +let list_of_csv csv = + List.map (fun l -> Str.split coma l) (Str.split nl csv) + +let print_html_table segments = + let print_row line = + printf ""; + List.iter (fun c -> printf "%s" (escape c)) line; + printf "\n" in + printf " + + + "; + printf "\n"; + print_row (List.hd segments); + printf "\n"; + List.iter print_row (List.tl segments); + printf "\n
\n"; +;; + +let () = + print_html_table (list_of_csv csv_data) diff --git a/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-4.ocaml b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-4.ocaml new file mode 100644 index 0000000000..fd2d3a2be9 --- /dev/null +++ b/Task/CSV-to-HTML-translation/OCaml/csv-to-html-translation-4.ocaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
+ diff --git a/Task/CSV-to-HTML-translation/OpenEdge-Progress/csv-to-html-translation-1.openedge b/Task/CSV-to-HTML-translation/OpenEdge-Progress/csv-to-html-translation-1.openedge new file mode 100644 index 0000000000..df231367b2 --- /dev/null +++ b/Task/CSV-to-HTML-translation/OpenEdge-Progress/csv-to-html-translation-1.openedge @@ -0,0 +1,50 @@ +FUNCTION csvToHtml RETURNS CHARACTER ( + i_lhas_header AS LOGICAL, + i_cinput AS CHARACTER +): + + DEFINE VARIABLE coutput AS CHARACTER NO-UNDO. + + DEFINE VARIABLE irow AS INTEGER NO-UNDO. + DEFINE VARIABLE icolumn AS INTEGER NO-UNDO. + DEFINE VARIABLE crow AS CHARACTER NO-UNDO. + DEFINE VARIABLE ccell AS CHARACTER NO-UNDO. + + coutput = "~n~t". + + DO irow = 1 TO NUM-ENTRIES( i_cinput, "~n":U ): + + coutput = coutput + "~n~t~t". + + crow = ENTRY( irow, i_cinput, "~n":U ). + + DO icolumn = 1 TO NUM-ENTRIES( crow ): + ccell = ENTRY( icolumn, crow ). + + coutput = coutput + "~n~t~t~t" + IF i_lhas_header AND irow = 1 THEN "". + + END. + + coutput = coutput + "~n~t~t". + + END. + + coutput = coutput + "~n~t
" ELSE "". + coutput = coutput + REPLACE( REPLACE( REPLACE( ccell, "&", "&" ), "<", "<" ), ">", ">" ). + coutput = coutput + IF i_lhas_header AND irow = 1 THEN "" ELSE "
~n". + + RETURN coutput. + +END FUNCTION. /* csvToHtml */ + +MESSAGE + csvToHtml( + TRUE, + "Character,Speech" + "~n" + + "The multitude,The messiah! Show us the messiah!" + "~n" + + "Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!" + "~n" + + "The multitude,Who are you?" + "~n" + + "Brians mother,I'm his mother; that's who!" + "~n" + + "The multitude,Behold his mother! Behold his mother!" + ) +VIEW-AS ALERT-BOX. diff --git a/Task/CSV-to-HTML-translation/OpenEdge-Progress/csv-to-html-translation-2.openedge b/Task/CSV-to-HTML-translation/OpenEdge-Progress/csv-to-html-translation-2.openedge new file mode 100644 index 0000000000..0a1dc0c135 --- /dev/null +++ b/Task/CSV-to-HTML-translation/OpenEdge-Progress/csv-to-html-translation-2.openedge @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
+ diff --git a/Task/CSV-to-HTML-translation/Perl-6/csv-to-html-translation-1.pl6 b/Task/CSV-to-HTML-translation/Perl-6/csv-to-html-translation-1.pl6 new file mode 100644 index 0000000000..488d58fcf5 --- /dev/null +++ b/Task/CSV-to-HTML-translation/Perl-6/csv-to-html-translation-1.pl6 @@ -0,0 +1,28 @@ +my $str = "Character,Speech +The multitude,The messiah! Show us the messiah! +Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away! +The multitude,Who are you? +Brians mother,I'm his mother; that's who! +The multitude,Behold his mother! Behold his mother!"; + +# comment the next line out, if you want to read from standard input instead of the hard-coded $str above +# my $str = $*IN.slurp; + +my &escape = *.trans([ <& < \>>] => [<& < >> ]); # a function with one argument that escapes the entities +my &tag = {"<$^tag>"~$^what~""}; + +printf +' + +Some Text + +%s +
+', [~] # concatenation reduction ('a', 'b', 'c') → 'abc' +(escape($str).split(/\n/) # escape the string and split at newline + ==> map -> $line {tag 'tr', # feed that into a map, that map function will tag as 'tr, and has an argument called $line + ([~] $line.split(/','/)\ # split $line at ',', + # that / at the end is just an unspace, you can omit it, but then you have to delete + # all whitespace and comments between split(…) and .map + .map({tag 'td', $^cell}))})\ # map those cells as td + .join("\n"); # append a newline for nicer output diff --git a/Task/CSV-to-HTML-translation/Perl-6/csv-to-html-translation-2.pl6 b/Task/CSV-to-HTML-translation/Perl-6/csv-to-html-translation-2.pl6 new file mode 100644 index 0000000000..ac4dc68bd0 --- /dev/null +++ b/Task/CSV-to-HTML-translation/Perl-6/csv-to-html-translation-2.pl6 @@ -0,0 +1,11 @@ + + +Some Text + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-1.psh b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-1.psh new file mode 100644 index 0000000000..41bdd3067e --- /dev/null +++ b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-1.psh @@ -0,0 +1 @@ +Import-Csv -Path .\csv_html_test.csv | ConvertTo-Html -Fragment | Out-File .\csv_html_test.html diff --git a/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-2.psh b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-2.psh new file mode 100644 index 0000000000..30d5135ea8 --- /dev/null +++ b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-2.psh @@ -0,0 +1,13 @@ + ++++ + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-3.psh b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-3.psh new file mode 100644 index 0000000000..0d58c33260 --- /dev/null +++ b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-3.psh @@ -0,0 +1,9 @@ +$htmlformat = 'Csv to Html' +$htmlformat += '' +Import-Csv -Path .\csv_html_test.csv | ConvertTo-Html -Head $htmlformat -Body '

Csv to Html

' | Out-File .\csv_html_test.html +Invoke-Expression .\csv_html_test.html diff --git a/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-4.psh b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-4.psh new file mode 100644 index 0000000000..0eae705991 --- /dev/null +++ b/Task/CSV-to-HTML-translation/PowerShell/csv-to-html-translation-4.psh @@ -0,0 +1,21 @@ + + + +Csv to Html + +

Csv to Html

+ ++++ + + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
+ diff --git a/Task/CSV-to-HTML-translation/Retro/csv-to-html-translation-1.retro b/Task/CSV-to-HTML-translation/Retro/csv-to-html-translation-1.retro new file mode 100644 index 0000000000..0a76396019 --- /dev/null +++ b/Task/CSV-to-HTML-translation/Retro/csv-to-html-translation-1.retro @@ -0,0 +1,23 @@ +remapping off +"Character,Speech +The multitude,The messiah! Show us the messiah! +Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away! +The multitude,Who are you? +Brians mother,I'm his mother; that's who! +The multitude,Behold his mother! Behold his mother!" remapping on +keepString constant CSV + +: display ( c- ) + [ ', = ] [ drop "" puts ] when + [ 10 = ] [ drop "\n" puts ] when + [ '< = ] [ drop "<" puts ] when + [ '> = ] [ drop ">" puts ] when + [ '& = ] [ drop "&" puts ] when + putc ; + +: displayHTML ( $- ) + "\n\n
" puts + [ @ display ] ^types'STRING each@ + "
" puts ; + +CSV displayHTML diff --git a/Task/CSV-to-HTML-translation/Retro/csv-to-html-translation-2.retro b/Task/CSV-to-HTML-translation/Retro/csv-to-html-translation-2.retro new file mode 100644 index 0000000000..0964db10ff --- /dev/null +++ b/Task/CSV-to-HTML-translation/Retro/csv-to-html-translation-2.retro @@ -0,0 +1,8 @@ + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/Run-BASIC/csv-to-html-translation.run b/Task/CSV-to-HTML-translation/Run-BASIC/csv-to-html-translation.run new file mode 100644 index 0000000000..4fa25a5ea3 --- /dev/null +++ b/Task/CSV-to-HTML-translation/Run-BASIC/csv-to-html-translation.run @@ -0,0 +1,24 @@ +csv$ = "Character,Speech +The multitude,The messiah! Show us the messiah! +Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away! +The multitude,Who are you? +Brians mother,I'm his mother; that's who! +The multitude,Behold his mother! Behold his mother!" + +k = instr(csv$,",") ' 2 exra lines to get heading +csv$ = left$(csv$,k - 1) + " + mid$(csv$,k + 1) + +csv$ = strRep$(csv$,",","") +html "|\>|g +s|^| \n \n \n | +1s|^|
";strRep$(csv$,chr$(13),"
");"
| +s|,|| +s|$|
\n| +$s|$|\n
| diff --git a/Task/CSV-to-HTML-translation/Sed/csv-to-html-translation-2.sed b/Task/CSV-to-HTML-translation/Sed/csv-to-html-translation-2.sed new file mode 100644 index 0000000000..913eb2aa3f --- /dev/null +++ b/Task/CSV-to-HTML-translation/Sed/csv-to-html-translation-2.sed @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/Seed7/csv-to-html-translation-1.seed7 b/Task/CSV-to-HTML-translation/Seed7/csv-to-html-translation-1.seed7 new file mode 100644 index 0000000000..135f80da8b --- /dev/null +++ b/Task/CSV-to-HTML-translation/Seed7/csv-to-html-translation-1.seed7 @@ -0,0 +1,30 @@ +$ include "seed7_05.s7i"; + include "html_ent.s7i"; + +const string: csvData is "\ + \Character,Speech\n\ + \The multitude,The messiah! Show us the messiah!\n\ + \Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!\n\ + \The multitude,Who are you?\n\ + \Brians mother,I'm his mother; that's who!\n\ + \The multitude,Behold his mother! Behold his mother!\n"; + +const proc: main is func + local + var string: line is ""; + var string: column is ""; + const array [boolean] string: columnStartTag is [boolean] ("", ""); + const array [boolean] string: columnEndTag is [boolean] ("", ""); + var boolean: firstLine is TRUE; + begin + writeln(""); + for line range split(csvData, '\n') do + write(""); + for column range split(line, ',') do + write(columnStartTag[firstLine] <& encodeHtmlContent(column) <& columnEndTag[firstLine]); + end for; + writeln(""); + firstLine := FALSE; + end for; + writeln("
"); + end func; diff --git a/Task/CSV-to-HTML-translation/Seed7/csv-to-html-translation-2.seed7 b/Task/CSV-to-HTML-translation/Seed7/csv-to-html-translation-2.seed7 new file mode 100644 index 0000000000..c6a54c2e4f --- /dev/null +++ b/Task/CSV-to-HTML-translation/Seed7/csv-to-html-translation-2.seed7 @@ -0,0 +1,9 @@ + + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/TUSCRIPT/csv-to-html-translation-1.tuscript b/Task/CSV-to-HTML-translation/TUSCRIPT/csv-to-html-translation-1.tuscript new file mode 100644 index 0000000000..df490c786d --- /dev/null +++ b/Task/CSV-to-HTML-translation/TUSCRIPT/csv-to-html-translation-1.tuscript @@ -0,0 +1,38 @@ +$$ MODE TUSCRIPT +MODE DATA +$$ csv=* +Character,Speech +The multitude,The messiah! Show us the messiah! +Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away! +The multitude,Who are you? +Brians mother,I'm his mother; that's who! +The multitude,Behold his mother! Behold his mother! +$$ htmlhead=* + + + +Life of Brian + +$$ BUILD X_TABLE txt2html=* + << < + >> > +$$ MODE TUSCRIPT +file="brian.html" +ERROR/STOP CREATE (file,FDF-o,-std-) +csv=EXCHANGE (csv,txt2html) +x=SPLIT (csv,":,:",row1,row2) +ACCESS html: WRITE/ERASE/RECORDS/UTF8 $file s,html +WRITE html htmlhead +LOOP n,td1=row1,td2=row2 +IF (n==1) THEN +row=CONCAT ("") +ELSE +row=CONCAT ("") +ENDIF +WRITE html row +ENDLOOP +WRITE html "
",td1,"",td2,"
",td1,"",td2,"
" +ENDACCESS/PRINT html diff --git a/Task/CSV-to-HTML-translation/TUSCRIPT/csv-to-html-translation-2.tuscript b/Task/CSV-to-HTML-translation/TUSCRIPT/csv-to-html-translation-2.tuscript new file mode 100644 index 0000000000..bc7a92dcac --- /dev/null +++ b/Task/CSV-to-HTML-translation/TUSCRIPT/csv-to-html-translation-2.tuscript @@ -0,0 +1,15 @@ + + + +Life of Brian + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-1.txr b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-1.txr new file mode 100644 index 0000000000..3c46811c01 --- /dev/null +++ b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-1.txr @@ -0,0 +1,13 @@ +@(collect) +@char,@speech +@(end) +@(output :filter :to_html) + +@ (repeat) + + + + +@ (end) +
@char@speech
+@(end) diff --git a/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-2.txr b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-2.txr new file mode 100644 index 0000000000..95250ed08f --- /dev/null +++ b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-2.txr @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-3.txr b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-3.txr new file mode 100644 index 0000000000..8bbb83edd2 --- /dev/null +++ b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-3.txr @@ -0,0 +1,29 @@ +@(collect) +@char,@speech +@(end) +@(output :filter :to_html) + + +@ (repeat :counter row) + + + + +@ (first) + + + + +@ (end) +
@char@speech
@char@speech
+@(end) diff --git a/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-4.txr b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-4.txr new file mode 100644 index 0000000000..85d94a32ea --- /dev/null +++ b/Task/CSV-to-HTML-translation/TXR/csv-to-html-translation-4.txr @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/Vedit-macro-language/csv-to-html-translation-1.vedit b/Task/CSV-to-HTML-translation/Vedit-macro-language/csv-to-html-translation-1.vedit new file mode 100644 index 0000000000..394d1635c2 --- /dev/null +++ b/Task/CSV-to-HTML-translation/Vedit-macro-language/csv-to-html-translation-1.vedit @@ -0,0 +1,27 @@ +if (BB < 0) { // block not set + BB(0) // convert entire file + BE(File_Size) +} + +// Convert special characters into entities +Replace_Block("&","&", BB, BE, BEGIN+ALL+NOERR) +Replace_Block("<","<", BB, BE, BEGIN+ALL+NOERR) +Replace_Block(">",">", BB, BE, BEGIN+ALL+NOERR) + +// Convert CSV into HTML table +Goto_Pos(BB) +IT('') IN +#80 = Cur_Pos +Goto_Pos(BE) +IT("
") +#81 = Cur_Line +IN +Goto_Pos(#80) +while (Cur_Line < #81) { + IT(" ") + Replace_Block(",","",Cur_Pos,EOL_Pos,ALL+NOERR) + EOL + IT("") + Line(1) +} +BB(Clear) diff --git a/Task/CSV-to-HTML-translation/Vedit-macro-language/csv-to-html-translation-2.vedit b/Task/CSV-to-HTML-translation/Vedit-macro-language/csv-to-html-translation-2.vedit new file mode 100644 index 0000000000..166c5676fc --- /dev/null +++ b/Task/CSV-to-HTML-translation/Vedit-macro-language/csv-to-html-translation-2.vedit @@ -0,0 +1,8 @@ + + + + + + + +
CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
diff --git a/Task/CSV-to-HTML-translation/XSLT-2.0/csv-to-html-translation-1.xslt b/Task/CSV-to-HTML-translation/XSLT-2.0/csv-to-html-translation-1.xslt new file mode 100644 index 0000000000..8254dd7a5a --- /dev/null +++ b/Task/CSV-to-HTML-translation/XSLT-2.0/csv-to-html-translation-1.xslt @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + CSV to HTML translation - Extra Credit + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
diff --git a/Task/CSV-to-HTML-translation/XSLT-2.0/csv-to-html-translation-2.xslt b/Task/CSV-to-HTML-translation/XSLT-2.0/csv-to-html-translation-2.xslt new file mode 100644 index 0000000000..2f67febfff --- /dev/null +++ b/Task/CSV-to-HTML-translation/XSLT-2.0/csv-to-html-translation-2.xslt @@ -0,0 +1,38 @@ + + + + + CSV to HTML translation - Extra Credit + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ CharacterSpeech
The multitudeThe messiah! Show us the messiah!
Brians mother<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go + away!</angry> +
The multitudeWho are you?
Brians motherI'm his mother; that's who!
The multitudeBehold his mother! Behold his mother!
+ + diff --git a/Task/Caesar-cipher/CoffeeScript/caesar-cipher.coffee b/Task/Caesar-cipher/CoffeeScript/caesar-cipher.coffeescript similarity index 100% rename from Task/Caesar-cipher/CoffeeScript/caesar-cipher.coffee rename to Task/Caesar-cipher/CoffeeScript/caesar-cipher.coffeescript diff --git a/Task/Caesar-cipher/Mathematica/caesar-cipher.mathematica b/Task/Caesar-cipher/Mathematica/caesar-cipher.math similarity index 100% rename from Task/Caesar-cipher/Mathematica/caesar-cipher.mathematica rename to Task/Caesar-cipher/Mathematica/caesar-cipher.math diff --git a/Task/Caesar-cipher/NetRexx/caesar-cipher.netrexx b/Task/Caesar-cipher/NetRexx/caesar-cipher.netrexx new file mode 100644 index 0000000000..7f719a3782 --- /dev/null +++ b/Task/Caesar-cipher/NetRexx/caesar-cipher.netrexx @@ -0,0 +1,92 @@ +/* NetRexx */ + +options replace format comments java crossref savelog symbols nobinary + +messages = [ - + 'The five boxing wizards jump quickly', - + 'Attack at dawn!', - + 'HI'] +keys = [1, 2, 20, 25, 13] + +loop m_ = 0 to messages.length - 1 + in = messages[m_] + loop k_ = 0 to keys.length - 1 + say 'Caesar cipher, key:' keys[k_].right(3) + ec = caesar_encipher(in, keys[k_]) + dc = caesar_decipher(ec, keys[k_]) + say in + say ec + say dc + say + end k_ + say 'Rot-13:' + ec = rot13(in) + dc = rot13(ec) + say in + say ec + say dc + say + end m_ + +return + +method rot13(input) public static signals IllegalArgumentException + + return caesar(input, 13, isFalse) + +method caesar(input = Rexx, idx = int, caps = boolean) public static signals IllegalArgumentException + + if idx < 1 | idx > 25 then signal IllegalArgumentException() + + -- 12345678901234567890123456 + itab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + shift = itab.length - idx + parse itab tl +(shift) tr + otab = tr || tl + + if caps then input = input.upper + + cipher = input.translate(itab || itab.lower, otab || otab.lower) + + return cipher + +method caesar_encipher(input = Rexx, idx = int, caps = boolean) public static signals IllegalArgumentException + + return caesar(input, idx, caps) + +method caesar_decipher(input = Rexx, idx = int, caps = boolean) public static signals IllegalArgumentException + + return caesar(input, int(26) - idx, isFalse) + +method caesar_encipher(input = Rexx, idx = int) public static signals IllegalArgumentException + + return caesar(input, idx, isFalse) + +method caesar_decipher(input = Rexx, idx = int) public static signals IllegalArgumentException + + return caesar(input, int(26) - idx, isFalse) + +method caesar_encipher(input = Rexx, idx = int, opt = Rexx) public static signals IllegalArgumentException + + return caesar(input, idx, opt) + +method caesar_decipher(input = Rexx, idx = int, opt = Rexx) public static signals IllegalArgumentException + + return caesar(input, int(26) - idx, opt) + +method caesar(input = Rexx, idx = int, opt = Rexx) public static signals IllegalArgumentException + + if opt.upper.abbrev('U') >= 1 then caps = isTrue + else caps = isFalse + + return caesar(input, idx, caps) + +method caesar(input = Rexx, idx = int) public static signals IllegalArgumentException + + return caesar(input, idx, isFalse) + +method isTrue public static returns boolean + return (1 == 1) + +method isFalse public static returns boolean + return \isTrue diff --git a/Task/Caesar-cipher/OCaml/caesar-cipher-1.ocaml b/Task/Caesar-cipher/OCaml/caesar-cipher-1.ocaml new file mode 100644 index 0000000000..ee84fdeba4 --- /dev/null +++ b/Task/Caesar-cipher/OCaml/caesar-cipher-1.ocaml @@ -0,0 +1,51 @@ +let islower c = + c >= 'a' && c <= 'z' + +let isupper c = + c >= 'A' && c <= 'Z' + +let rot x str = + let upchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + and lowchars = "abcdefghijklmnopqrstuvwxyz" in + let rec decal x = + if x < 0 then decal (x + 26) else x + in + let x = (decal x) mod 26 in + let decal_up = x - (int_of_char 'A') + and decal_low = x - (int_of_char 'a') in + let len = String.length str in + let res = String.create len in + for i = 0 to pred len do + let c = str.[i] in + if islower c then + let j = ((int_of_char c) + decal_low) mod 26 in + res.[i] <- lowchars.[j] + else if isupper c then + let j = ((int_of_char c) + decal_up) mod 26 in + res.[i] <- upchars.[j] + else + res.[i] <- c + done; + (res) + +(* or in OCaml 4.00+: +let rot x = + let upchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + and lowchars = "abcdefghijklmnopqrstuvwxyz" in + let rec decal x = + if x < 0 then decal (x + 26) else x + in + let x = (decal x) mod 26 in + let decal_up = x - (int_of_char 'A') + and decal_low = x - (int_of_char 'a') in + String.map (fun c -> + if islower c then + let j = ((int_of_char c) + decal_low) mod 26 in + lowchars.[j] + else if isupper c then + let j = ((int_of_char c) + decal_up) mod 26 in + upchars.[j] + else + c + ) +*) diff --git a/Task/Caesar-cipher/OCaml/caesar-cipher-2.ocaml b/Task/Caesar-cipher/OCaml/caesar-cipher-2.ocaml new file mode 100644 index 0000000000..1c8c97c9fc --- /dev/null +++ b/Task/Caesar-cipher/OCaml/caesar-cipher-2.ocaml @@ -0,0 +1,9 @@ +let () = + let key = 3 in + let orig = "The five boxing wizards jump quickly" in + let enciphered = rot key orig in + print_endline enciphered; + let deciphered = rot (- key) enciphered in + print_endline deciphered; + Printf.printf "equal: %b\n" (orig = deciphered) +;; diff --git a/Task/Caesar-cipher/PARI-GP/caesar-cipher.pari b/Task/Caesar-cipher/PARI-GP/caesar-cipher.pari new file mode 100644 index 0000000000..e5decb58a3 --- /dev/null +++ b/Task/Caesar-cipher/PARI-GP/caesar-cipher.pari @@ -0,0 +1,5 @@ +enc(s,n)={ + Strchr(Vecsmall(apply(k->if(k>96&&k<123,(k+n-97)%26+97, if(k>64&&k<91, (k+n-65)%26+65, k)), + Vec(Vecsmall(s))))) +}; +dec(s,n)=enc(s,-n); diff --git a/Task/Caesar-cipher/PL-I/caesar-cipher.pli b/Task/Caesar-cipher/PL-I/caesar-cipher.pli new file mode 100644 index 0000000000..2ded87cd58 --- /dev/null +++ b/Task/Caesar-cipher/PL-I/caesar-cipher.pli @@ -0,0 +1,20 @@ +caesar: procedure options (main); + declare cypher_string character (52) static initial + ((2)'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); + declare (text, encyphered_text) character (100) varying, + offset fixed binary; + + get edit (text) (L); /* Read in one line of text */ + get list (offset); + if offset < 1 | offset > 25 then signal error; + put skip list ('Plain text=', text); + + encyphered_text = translate(text, substr(cypher_string, offset+1, 26), + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ); + put skip list ('Encyphered text=', encyphered_text); + + text = translate(encyphered_text, substr(cypher_string, 27-offset, 26), + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ); + put skip list ('Decyphered text=', text); + +end caesar; diff --git a/Task/Caesar-cipher/Pascal/caesar-cipher.pascal b/Task/Caesar-cipher/Pascal/caesar-cipher.pascal new file mode 100644 index 0000000000..53fb189ff9 --- /dev/null +++ b/Task/Caesar-cipher/Pascal/caesar-cipher.pascal @@ -0,0 +1,37 @@ +Program CaesarCipher(output); + +procedure encrypt(var message: string; key: integer); + var + i: integer; + begin + for i := 1 to length(message) do + case message[i] of + 'A'..'Z': message[i] := chr(ord('A') + (ord(message[i]) - ord('A') + key) mod 26); + 'a'..'z': message[i] := chr(ord('a') + (ord(message[i]) - ord('a') + key) mod 26); + end; + end; + +procedure decrypt(var message: string; key: integer); + var + i: integer; + begin + for i := 1 to length(message) do + case message[i] of + 'A'..'Z': message[i] := chr(ord('A') + (ord(message[i]) - ord('A') - key + 26) mod 26); + 'a'..'z': message[i] := chr(ord('a') + (ord(message[i]) - ord('a') - key + 26) mod 26); + end; + end; + +var + key: integer; + message: string; + +begin + key := 3; + message := 'The five boxing wizards jump quickly'; + writeln ('Original message: ', message); + encrypt(message, key); + writeln ('Encrypted message: ', message); + decrypt(message, key); + writeln ('Decrypted message: ', message); +end. diff --git a/Task/Caesar-cipher/Perl-6/caesar-cipher.pl6 b/Task/Caesar-cipher/Perl-6/caesar-cipher.pl6 new file mode 100644 index 0000000000..4c420d3acf --- /dev/null +++ b/Task/Caesar-cipher/Perl-6/caesar-cipher.pl6 @@ -0,0 +1,15 @@ +my @alpha = 'A' .. 'Z'; +sub encrypt ( $key where 1..25, $plaintext ) { + $plaintext.trans( @alpha Z=> @alpha.rotate($key) ); +} +sub decrypt ( $key where 1..25, $cyphertext ) { + $cyphertext.trans( @alpha.rotate($key) Z=> @alpha ); +} + +my $original = 'THE FIVE BOXING WIZARDS JUMP QUICKLY'; +my $en = encrypt( 13, $original ); +my $de = decrypt( 13, $en ); + +.say for $original, $en, $de; + +say 'OK' if $original eq all( map { .&decrypt(.&encrypt($original)) }, 1..25 ); diff --git a/Task/Caesar-cipher/PureBasic/caesar-cipher-1.purebasic b/Task/Caesar-cipher/PureBasic/caesar-cipher-1.purebasic new file mode 100644 index 0000000000..426c55f841 --- /dev/null +++ b/Task/Caesar-cipher/PureBasic/caesar-cipher-1.purebasic @@ -0,0 +1,37 @@ +Procedure.s CC_encrypt(plainText.s, key, reverse = 0) + ;if reverse <> 0 then reverse the encryption (decrypt) + If reverse: reverse = 26: key = 26 - key: EndIf + + Static alphabet$ = "ABCEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" + + Protected result.s, i, length = Len(plainText), letter.s, legal + If key < 1 Or key > 25: ProcedureReturn: EndIf ;keep key in range + + For i = 1 To length + letter = Mid(plainText, i, 1) + legal = FindString(alphabet$, letter, 1 + reverse) + If legal + result + Mid(alphabet$, legal + key, 1) + Else + result + letter + EndIf + Next + ProcedureReturn result +EndProcedure + +Procedure.s CC_decrypt(cypherText.s, key) + ProcedureReturn CC_encrypt(cypherText, key, 1) +EndProcedure + +If OpenConsole() + Define key, plainText.s, encryptedText.s, decryptedText.s + + key = Random(24) + 1 ;get a random key in the range 1 -> 25 + + plainText = "The quick brown fox jumped over the lazy dogs.": PrintN(RSet("Plain text = ", 17) + #DQUOTE$ + plainText + #DQUOTE$) + encryptedText = CC_encrypt(plainText, key): PrintN(RSet("Encrypted text = ", 17) + #DQUOTE$ + encryptedText + #DQUOTE$) + decryptedText = CC_decrypt(encryptedText, key): PrintN(RSet("Decrypted text = ", 17) + #DQUOTE$ + decryptedText + #DQUOTE$) + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Caesar-cipher/PureBasic/caesar-cipher-2.purebasic b/Task/Caesar-cipher/PureBasic/caesar-cipher-2.purebasic new file mode 100644 index 0000000000..a63d3f82db --- /dev/null +++ b/Task/Caesar-cipher/PureBasic/caesar-cipher-2.purebasic @@ -0,0 +1,21 @@ +Procedure.s CC_encrypt(text.s, key, reverse = 0) + ;if reverse <> 0 then reverse the encryption (decrypt) + Protected i, *letter.Character, *resultLetter.Character, result.s = Space(Len(text)) + + If reverse: key = 26 - key: EndIf + If key < 1 Or key > 25: ProcedureReturn: EndIf ;exit if key out of range + + *letter = @text: *resultLetter = @result + While *letter\c + Select *letter\c + Case 'A' To 'Z' + *resultLetter\c = ((*letter\c - 65 + key) % 26) + 65 + Case 'a' To 'z' + *resultLetter\c = ((*letter\c - 97 + key) % 26) + 97 + Default + *resultLetter\c = *letter\c + EndSelect + *letter + SizeOf(Character): *resultLetter + SizeOf(Character) + Wend + ProcedureReturn result +EndProcedure diff --git a/Task/Caesar-cipher/Retro/caesar-cipher.retro b/Task/Caesar-cipher/Retro/caesar-cipher.retro new file mode 100644 index 0000000000..a500e77969 --- /dev/null +++ b/Task/Caesar-cipher/Retro/caesar-cipher.retro @@ -0,0 +1,14 @@ +{{ + variable offset + : rotate ( cb-c ) tuck - @offset + 26 mod + ; + : rotate? ( c-c ) + dup 'a 'z within [ 'a rotate ] ifTrue + dup 'A 'Z within [ 'A rotate ] ifTrue ; +---reveal--- + : ceaser ( $n-$ ) + !offset dup [ [ @ rotate? ] sip ! ] ^types'STRING each@ ; +}} + +( Example ) +"THEYBROKEOURCIPHEREVERYONECANREADTHIS" 3 ceaser ( returns encrypted string ) +23 ceaser ( returns decrypted string ) diff --git a/Task/Caesar-cipher/Run-BASIC/caesar-cipher.run b/Task/Caesar-cipher/Run-BASIC/caesar-cipher.run new file mode 100644 index 0000000000..c50ed3b1d2 --- /dev/null +++ b/Task/Caesar-cipher/Run-BASIC/caesar-cipher.run @@ -0,0 +1,21 @@ +input "Gimme a ofset:";ofst ' set any offset you like + +a$ = "Pack my box with five dozen liquor jugs" +print " Original: ";a$ +a$ = cipher$(a$,ofst) +print "Encrypted: ";a$ +print "Decrypted: ";cipher$(a$,ofst+6) + +FUNCTION cipher$(a$,ofst) +for i = 1 to len(a$) + aa$ = mid$(a$,i,1) + code$ = " " + if aa$ <> " " then + ua$ = upper$(aa$) + a = asc(ua$) - 64 + code$ = chr$((((a mod 26) + ofst) mod 26) + 65) + if ua$ <> aa$ then code$ = lower$(code$) + end if + cipher$ = cipher$;code$ +next i +END FUNCTION diff --git a/Task/Caesar-cipher/Seed7/caesar-cipher.seed7 b/Task/Caesar-cipher/Seed7/caesar-cipher.seed7 new file mode 100644 index 0000000000..e97a97c65f --- /dev/null +++ b/Task/Caesar-cipher/Seed7/caesar-cipher.seed7 @@ -0,0 +1,29 @@ +$ include "seed7_05.s7i"; + +const func string: rot (in string: stri, in integer: encodingKey) is func + result + var string: encodedStri is ""; + local + var char: ch is ' '; + var integer: index is 0; + begin + encodedStri := stri; + for ch key index range stri do + if ch >= 'a' and ch <= 'z' then + ch := chr((ord(ch) - ord('a') + encodingKey) rem 26 + ord('a')); + elsif ch >= 'A' and ch <= 'Z' then + ch := chr((ord(ch) - ord('A') + encodingKey) rem 26 + ord('A')); + end if; + encodedStri @:= [index] ch; + end for; + end func; + +const proc: main is func + local + const integer: exampleKey is 3; + const string: testText is "The five boxing wizards jump quickly"; + begin + writeln("Original: " <& testText); + writeln("Encrypted: " <& rot(testText, exampleKey)); + writeln("Decrypted: " <& rot(rot(testText, exampleKey), 26 - exampleKey)); + end func; diff --git a/Task/Caesar-cipher/TUSCRIPT/caesar-cipher.tuscript b/Task/Caesar-cipher/TUSCRIPT/caesar-cipher.tuscript new file mode 100644 index 0000000000..b0925f0b7e --- /dev/null +++ b/Task/Caesar-cipher/TUSCRIPT/caesar-cipher.tuscript @@ -0,0 +1,24 @@ +$$ MODE TUSCRIPT +text="THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" +PRINT "text orginal ",text + +abc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",key=3,caesarskey=key+1 +secretbeg=EXTRACT (abc,#caesarskey,0) +secretend=EXTRACT (abc,0,#caesarskey) +secretabc=CONCAT (secretbeg,secretend) + +abc=STRINGS (abc,": ") +@(end) +@(do + (defvar k (int-str key 10))) +@(bind enc-dec + @(collect-each ((i (range 0 25))) + (let* ((p (tostringp (+ #\a i))) + (e (tostringp (+ #\a (mod (+ i k) 26)))) + (P (upcase-str p)) + (E (upcase-str e))) + '(((,p ,e) (,P ,E)) + ((,e ,p) (,E ,P)))))) +@(deffilter enc . @(mappend (fun first) enc-dec)) +@(deffilter dec . @(mappend (fun second) enc-dec)) +@(output) +encoded: @{text :filter enc} +decoded: @{text :filter dec} +@(end) diff --git a/Task/Caesar-cipher/Ursala/caesar-cipher.ursala b/Task/Caesar-cipher/Ursala/caesar-cipher.ursala new file mode 100644 index 0000000000..511fb645d2 --- /dev/null +++ b/Task/Caesar-cipher/Ursala/caesar-cipher.ursala @@ -0,0 +1,11 @@ +#import std +#import nat + +enc "n" = * -:~&@T ^p(rep"n" ~&zyC,~&)~~K30K31X letters # encryption function +dec "n" = * -:~&@T ^p(~&,rep"n" ~&zyC)~~K30K31X letters # decryption function + +plaintext = 'the five boxing wizards jump quickly THE FIVE BOXING WIZARDS JUMP QUICKLY' + +#show+ # exhaustive test + +test = ("n". <.enc"n",dec"n"+ enc"n"> plaintext)*= nrange/1 25 diff --git a/Task/Caesar-cipher/Vedit-macro-language/caesar-cipher.vedit b/Task/Caesar-cipher/Vedit-macro-language/caesar-cipher.vedit new file mode 100644 index 0000000000..058a1d7857 --- /dev/null +++ b/Task/Caesar-cipher/Vedit-macro-language/caesar-cipher.vedit @@ -0,0 +1,11 @@ +#10 = Get_Num("Enter the key: positive to cipher, negative to de-cipher: ", STATLINE) + +Goto_Pos(Block_Begin) +while(Cur_Pos < Block_End) { + #11 = Cur_Char & 0x60 + 1 + if (Cur_Char >= 'A') { + Ins_Char((Cur_Char - #11 + 26 + #10) % 26 + #11, OVERWRITE) + } else { + Char(1) + } +} diff --git a/Task/Caesar-cipher/XPL0/caesar-cipher.xpl0 b/Task/Caesar-cipher/XPL0/caesar-cipher.xpl0 new file mode 100644 index 0000000000..0509112dd2 --- /dev/null +++ b/Task/Caesar-cipher/XPL0/caesar-cipher.xpl0 @@ -0,0 +1,13 @@ +code ChIn=7, ChOut=8, IntIn=10; +int Key, C; +[Key:= IntIn(8); +repeat C:= ChIn(1); + if C>=^a & C<=^z then C:= C-$20; + if C>=^A & C<=^Z then + [C:= C+Key; + if C>^Z then C:= C-26 + else if C<^A then C:= C+26; + ]; + ChOut(0, C); +until C=$1A; \EOF +] diff --git a/Task/Calendar-for-real-programmers/Perl-6/calendar-for-real-programmers.pl6 b/Task/Calendar-for-real-programmers/Perl-6/calendar-for-real-programmers.pl6 new file mode 100644 index 0000000000..e181e1f627 --- /dev/null +++ b/Task/Calendar-for-real-programmers/Perl-6/calendar-for-real-programmers.pl6 @@ -0,0 +1,4 @@ +$_=["\0"..."~"];< +114 117 110 32 34 99 97 116 32 115 110 111 111 112 121 46 +116 120 116 59 99 97 108 32 64 42 65 82 71 83 91 48 93 34 +>."$_[99]$_[104]$_[114]$_[115]"()."$_[101]$_[118]$_[97]$_[108]"() diff --git a/Task/Calendar-for-real-programmers/Vedit-macro-language/calendar-for-real-programmers.vedit b/Task/Calendar-for-real-programmers/Vedit-macro-language/calendar-for-real-programmers.vedit new file mode 100644 index 0000000000..d621fe3a32 --- /dev/null +++ b/Task/Calendar-for-real-programmers/Vedit-macro-language/calendar-for-real-programmers.vedit @@ -0,0 +1,65 @@ +BS(BF) +CFT(22) +#3 = 6 // NUMBER OF MONTHS PER LINE +#2 = 1969 // YEAR +#1 = 1 // STARTING MONTH +IC(' ', COUNT, #3*9) IT("[SNOOPY]") IN(2) +IC(' ', COUNT, #3*9+1) NI(#2) IN +REPEAT(12/#3) { + REPEAT (#3) { + BS(BF) + CALL("DRAW_CALENDAR") + RCB(10, 1, EOB_POS, COLSET, 1, 21) + BQ(OK) + #5 = CP + RI(10) + GP(#5) + EOL IC(9) + #1++ + } + EOF IN(2) +} +RETURN + +:DRAW_CALENDAR: +NUM_PUSH(4,20) +#20 = RF +BOF DC(ALL) + +NI(#1, LEFT+NOCR) IT("/1/") NI(#2, LEFT+NOCR) +RCB(#20, BOL_POS, EOL_POS, DELETE) +#10 = JDATE(@(#20)) + +#4 = #2+(#1==12) +NI(#1%12+1, LEFT+NOCR) IT("/1/") NI(#4, LEFT+NOCR) +RCB(#20, BOL_POS, CP, DELETE) +#11 = JDATE(@(#20)) - #10 +#7 = (#10-1) % 7 + +IF (#1==1) { RS(#20," JANUARY ") } +IF (#1==2) { RS(#20," FEBRUARY") } +IF (#1==3) { RS(#20," MARCH ") } +IF (#1==4) { RS(#20," APRIL ") } +IF (#1==5) { RS(#20," MAY ") } +IF (#1==6) { RS(#20," JUNE ") } +IF (#1==7) { RS(#20," JULY ") } +IF (#1==8) { RS(#20," AUGUST ") } +IF (#1==9) { RS(#20,"SEPTEMBER") } +IF (#1==10) { RS(#20," OCTOBER ") } +IF (#1==11) { RS(#20," NOVEMBER") } +IF (#1==12) { RS(#20," DECEMBER") } + +IT(" ") RI(#20) IN +IT(" MO TU WE TH FR SA SU") IN +IT(" --------------------") IN +IC(' ', COUNT, #7*3) +FOR (#8 = 1; #8 <= #11; #8++) { + NI(#8, COUNT, 3) + #5 = (#8+#10+5) % 7 + IF (#5 == 6) { IN } +} +IT(" ") + +REG_EMPTY(#20) +NUM_POP(4,20) +RETURN diff --git a/Task/Calendar-for-real-programmers/X86-Assembly/calendar-for-real-programmers.x86 b/Task/Calendar-for-real-programmers/X86-Assembly/calendar-for-real-programmers.x86 new file mode 100644 index 0000000000..b48eeae6ba --- /dev/null +++ b/Task/Calendar-for-real-programmers/X86-Assembly/calendar-for-real-programmers.x86 @@ -0,0 +1,187 @@ + .MODEL TINY + .CODE + .486 + ORG 100H ;.COM FILES START HERE +YEAR EQU 1969 ;DISPLAY CALENDAR FOR SPECIFIED YEAR +START: MOV CX, 61 ;SPACE(61); TEXT(0, "[SNOOPY]"); CRLF(0) + CALL SPACE + MOV DX, OFFSET SNOOPY + CALL TEXT + MOV CL, 63 ;SPACE(63); INTOUT(0, YEAR); CRLF(0); CRLF(0) + CALL SPACE + MOV AX, YEAR + CALL INTOUT + CALL CRLF + CALL CRLF + + MOV DI, 1 ;FOR MONTH:= 1 TO 12 DO DI=MONTH +L22: XOR SI, SI ; FOR COL:= 0 TO 6-1 DO SI=COL +L23: MOV CL, 5 ; SPACE(5) + CALL SPACE + MOV DX, DI ; TEXT(0, MONAME(MONTH+COL-1)); SPACE(7); + DEC DX ; DX:= (MONTH+COL-1)*10+MONAME + ADD DX, SI + IMUL DX, 10 + ADD DX, OFFSET MONAME + CALL TEXT + MOV CL, 7 + CALL SPACE + CMP SI, 5 ; IF COL<5 THEN SPACE(1); + JGE L24 + MOV CL, 1 + CALL SPACE + INC SI + JMP L23 +L24: CALL CRLF + + MOV SI, 6 ; FOR COL:= 0 TO 6-1 DO +L25: MOV DX, OFFSET SUMO ; TEXT(0, "SU MO TU WE TH FR SA"); + CALL TEXT + DEC SI ; IF COL<5 THEN SPACE(2); + JE L27 + MOV CL, 2 + CALL SPACE + JMP L25 +L27: CALL CRLF + + XOR SI, SI ;FOR COL:= 0 TO 6-1 DO +L28: MOV BX, DI ;DAY OF FIRST SUNDAY OF MONTH (CAN BE NEGATIVE) + ADD BX, SI ;DAY(COL):= 1 - WEEKDAY(YEAR, MONTH+COL, 1); + MOV BP, YEAR + +;DAY OF WEEK FOR FIRST DAY OF THE MONTH (0=SUN 1=MON..6=SAT) + CMP BL, 2 ;IF MONTH<=2 THEN + JG L3 + ADD BL, 12 ; MONTH:= MONTH+12; + DEC BP ; YEAR:= YEAR-1; +L3: +;REM((1-1 + (MONTH+1)*26/10 + YEAR + YEAR/4 + YEAR/100*6 + YEAR/400)/7) + INC BX ;MONTH + IMUL AX, BX, 26 + MOV CL, 10 + CWD + IDIV CX + MOV BX, AX + MOV AX, BP ;YEAR + ADD BX, AX + SHR AX, 2 + ADD BX, AX + MOV CL, 25 + CWD + IDIV CX + IMUL DX, AX, 6 ;YEAR/100*6 + ADD BX, DX + SHR AX, 2 ;YEAR/400 + ADD AX, BX + MOV CL, 7 + CWD + IDIV CX + NEG DX + INC DX + MOV [SI+DAY], DL ;COL+DAY + INC SI + CMP SI, 5 + JLE L28 + + MOV BP, 6 ;FOR LINE:= 0 TO 6-1 DO BP=LINE +L29: XOR SI, SI ; FOR COL:= 0 TO 6-1 DO SI=COL +L30: MOV BX, DI ; DAYMAX:= DAYS(MONTH+COL); + MOV BL, [BX+SI+DAYS] + +;IF MONTH+COL=2 & (REM(YEAR/4)=0 & REM(YEAR/100)#0 ! REM(YEAR/400)=0) THEN + MOV AX, DI ;MONTH + ADD AX, SI + CMP AL, 2 + JNE L32 + MOV AX, YEAR + TEST AL, 03H + JNE L32 + MOV CL,100 + CWD + IDIV CX + TEST DX, DX + JNE L31 + TEST AL, 03H + JNE L32 +L31: INC BX ;IF FEBRUARY AND LEAP YEAR THEN ADD A DAY +L32: + MOV DX, 7 ;FOR WEEKDAY:= 0 TO 7-1 DO +L33: MOVZX AX, [SI+DAY] ; IF DAY(COL)>=1 & DAY(COL)<=DAYMAX THEN + CMP AL, 1 + JL L34 + CMP AL, BL + JG L34 + CALL INTOUT ; INTOUT(0, DAY(COL)); + CMP AL, 10 ; IF DAY(COL)<10 THEN SPACE(1); LEFT JUSTIFY + JGE L36 + MOV CL, 1 + CALL SPACE + JMP L36 +L34: MOV CL, 2 ; ELSE SPACE(2); + CALL SPACE ; SUPPRESS OUT OF RANGE DAYS +L36: MOV CL, 1 ; SPACE(1); + CALL SPACE + INC BYTE PTR [SI+DAY] ; DAY(COL):= DAY(COL)+1; + DEC DX ;NEXT WEEKDAY + JNE L33 + + CMP SI, 5 ;IF COL<5 THEN SPACE(1); + JGE L37 + MOV CL, 1 + CALL SPACE + INC SI + JMP L30 +L37: CALL CRLF + + DEC BP ;NEXT LINE DOWN + JNE L29 + CALL CRLF + + ADD DI, 6 ;NEXT 6 MONTHS + CMP DI, 12 + JLE L22 + RET + +;DISPLAY POSITIVE INTEGER IN AX +INTOUT: PUSHA + MOV BX, 10 + XOR CX, CX +NO10: CWD + IDIV BX + PUSH DX + INC CX + TEST AX, AX + JNE NO10 +NO20: MOV AH, 02H + POP DX + ADD DL, '0' + INT 21H + LOOP NO20 + POPA + RET + +;DISPLAY CX SPACE CHARACTERS +SPACE: PUSHA +SP10: MOV AH, 02H + MOV DL, 20H + INT 21H + LOOP SP10 + POPA + RET + +;START A NEW LINE +CRLF: MOV DX, OFFSET LCRLF + +;DISPLAY STRING AT DX +TEXT: MOV AH, 09H + INT 21H + RET + +SNOOPY DB "[SNOOPY]" +LCRLF DB 0DH, 0AH, '$' +MONAME DB " JANUARY $ FEBRUARY$ MARCH $ APRIL $ MAY $ JUNE $" + DB " JULY $ AUGUST $SEPTEMBER$ OCTOBER$ NOVEMBER$ DECEMBER$" +SUMO DB "SU MO TU WE TH FR SA$" +DAYS DB 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 +DAY DB ?, ?, ?, ?, ?, ? + END START diff --git a/Task/Calendar/Mathematica/calendar-1.mathematica b/Task/Calendar/Mathematica/calendar-1.math similarity index 100% rename from Task/Calendar/Mathematica/calendar-1.mathematica rename to Task/Calendar/Mathematica/calendar-1.math diff --git a/Task/Calendar/Mathematica/calendar-2.mathematica b/Task/Calendar/Mathematica/calendar-2.math similarity index 100% rename from Task/Calendar/Mathematica/calendar-2.mathematica rename to Task/Calendar/Mathematica/calendar-2.math diff --git a/Task/Calendar/Mathematica/calendar-3.mathematica b/Task/Calendar/Mathematica/calendar-3.math similarity index 100% rename from Task/Calendar/Mathematica/calendar-3.mathematica rename to Task/Calendar/Mathematica/calendar-3.math diff --git a/Task/Calendar/PL-I/calendar.pli b/Task/Calendar/PL-I/calendar.pli new file mode 100644 index 0000000000..4681e41e46 --- /dev/null +++ b/Task/Calendar/PL-I/calendar.pli @@ -0,0 +1,51 @@ +calendar: procedure (year) options (main); + declare year character (4) varying; + declare (a, b, c) (0:5,0:6) character (3); + declare name_month(12) static character (9) varying initial ( + 'JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', + 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER'); + declare i fixed; + declare (mm, mmp1, mmp2) pic '99'; + + put edit (center('CALENDAR FOR ' || YEAR, 67)) (a); + put skip (2); + + do mm = 1 to 12 by 3; + mmp1 = mm + 1; mmp2 = mm + 2; + call prepare_month('01' || mm || YEAR, a); + call prepare_month('01' || mmp1 || YEAR, b); + call prepare_month('01' || mmp2 || YEAR, c); + + put skip edit (center(name_month(mm), 23), + center(name_month(mmp1), 23), + center(name_month(mmp2), 23) ) (a); + put skip edit ((3)' M T W T F S S ') (a); + do i = 0 to 5; + put skip edit (a(i,*), b(i,*), c(i,*)) (7 a, x(2)); + end; + end; + +prepare_month: procedure (start, month); + declare month(0:5,0:6) character (3); + declare start character (8); + declare i pic 'ZZ9'; + declare offset fixed; + declare (j, day) fixed binary (31); + declare (this_month, next_month, k) fixed binary; + + day = days(start, 'DDMMYYYY'); + offset = weekday(day) - 1; + if offset = 0 then offset = 7; + month = ''; + do j = day by 1; + this_month = substr(daystodate(j, 'DDMMYYYY'), 3, 2); + next_month = substr(daystodate(j+1, 'DDMMYYYY'), 3, 2); + if this_month^= next_month then leave; + end; + i = 1; + do k = offset-1 to offset+j-day-1; + month(k/7, mod(k,7)) = i; i = i + 1; + end; +end prepare_month; + +end calendar; diff --git a/Task/Calendar/Perl-6/calendar.pl6 b/Task/Calendar/Perl-6/calendar.pl6 new file mode 100644 index 0000000000..e43458e0c8 --- /dev/null +++ b/Task/Calendar/Perl-6/calendar.pl6 @@ -0,0 +1,55 @@ +my $months-per-col = 3; +my @week-day-names = ; +my @month-names = ; + +my Int $year = +(@*ARGS.shift || 1969); + +say fmt-year($year); +exit; + +sub fmt-year ($year) { + + my $str = (' ' x 30) ~ $year ~ "\n"; + + my @month-strs; + @month-strs[$_] = fmt-month($year, $_).lines for 1 .. 12; + + loop ( my $month = 1; $month <= 12; $month += $months-per-col ) { + while @month-strs[$month] { + for ^$months-per-col { + next unless @month-strs[$month+$_]; + $str ~= @month-strs[$month+$_].shift; + $str ~= " " x 3; + } + $str ~= "\n"; + } + $str ~= "\n"; + } + return $str; +} +sub fmt-month ($year, $month) { + my $str = sprintf "%-20s\n", @month-names[$month-1]; + $str ~= @week-day-names~"\n"; + my $date = DateTime.new(year => $year, month => $month); + my $week-day = $date.day-of-week; + + $str ~= (" " xx $week-day-1).join(" "); + + for $date.day .. $date.days-in-month -> $day { + + $date = DateTime.new(year => $year, month => $month, day => $day); + + $str ~= " " if 1 < $week-day < 8; + if $week-day == 8 { + $str ~= "\n"; + $week-day = 1; + } + $str ~= sprintf "%2d", $day; + + $week-day++; + } + $str ~= " " if $week-day < 8; + $str ~= (" " xx 8-$week-day).join(" "); + $str ~= "\n"; + return $str; +} diff --git a/Task/Calendar/Pike/calendar.pike b/Task/Calendar/Pike/calendar.pike new file mode 100644 index 0000000000..4ce03b863f --- /dev/null +++ b/Task/Calendar/Pike/calendar.pike @@ -0,0 +1,118 @@ +#!/bin/env pike + +int main(int argc, array(string) argv) +{ + object cal = Calendar; + object year; + string region = "us"; + + array date = argv[1..]; + if (sizeof(date) && objectp(Calendar[date[0]]) && Calendar[date[0]]->Day) + { + cal = Calendar[date[0]]; + date = Array.shift(date)[1]; + } + + if (sizeof(date) && (int)date[0]) + { + year = cal.Year((int)date[0]); + date = Array.shift(date)[1]; + } + + if (sizeof(date)) + region = date[0]; + + if (!year) + year = cal.Year(); + + print_year(year, region); +} + +array make_month(object month, int field_width, void|string region) +{ + array out =({}); + mapping holidays = ([]); + object today = Calendar.Day(); + + if (region) + holidays = Calendar.Events.find_region(region)->scan_events(month); + + array weekday_names = sprintf("%*.*s", field_width, field_width, month->week()->days()->week_day_shortname()[*]); + + out += ({ ({ month->month_name(), month->month_no(), month->year_name() }) }); + out += ({ weekday_names }); + out += showday(month->weeks()->days()[*][*], month, today, holidays, field_width); + + out += ({ ({ " "*field_width })*sizeof(weekday_names) }); + + return out; +} + +string print_month(object _month, void|int field_width, void|string region) +{ + if (!field_width) + field_width = 2; + array month = make_month(_month, field_width, region); + string out = ""; + + out += sprintf("%|*s\n", (field_width+1)*sizeof(month[1])-1, sprintf("%s", month[0][0])); + out += sprintf((month[1..][*]*" ")*"\n"); + return out; +} + +string print_year(object year, void|string region) +{ + array output = ({}); + int day_width = 2; + int columns = Stdio.stdout.tcgetattr()->columns; + int month_width = sizeof(make_month(year->month(), day_width)[1]) * (day_width+1) - 1; + if (columns < month_width) + columns = month_width; + + // try to find an optimal good looking solution to spread the months + // across the terminal width + // for the common calendar of 12 months this is easy but we need to + // account for caledars that have more than 12 months + float max_width = (float)((columns+2)/(month_width+2)); + float max_height = ceil(year->number_of_months()/max_width); + float w = max_width; + + while(ceil(year->number_of_months()/(w-1)) == max_height) + w--; + + foreach(print_month(year->months()[*], day_width, region)/w;; array row) + { + array rows = row[*]/"\n"; + int l = max(@sizeof(rows[*])); + foreach(rows; int i;) + { + // the last line of each month is an empty line. + // repeat the line as many times as needed to make the months equally long + rows[i]+=({ rows[i][-1] })*(l-sizeof(rows[i])); + } + rows = Array.transpose(rows); + output += rows[*]*" "; + } + write("%*|s\n", sizeof(output[1]), year->format_nice()); + write(output * "\n"); + write("\n"); +} + +string showday(object day, object month, object today, mapping holidays, int field_width) +{ + string dayname; + if (day->month() == month) + { + dayname = (string)day->month_day(); + dayname = " "*(sizeof((string)month->number_of_days())-sizeof(dayname))+dayname; + if (day == today) + dayname = sprintf("%|*.*s", field_width, field_width, dayname); + else + dayname = sprintf("%|*.*s", field_width, field_width, dayname); + if (holidays[day]) + dayname = sprintf("%|s", dayname); + } + else + dayname = " "*field_width; + return dayname; +} diff --git a/Task/Calendar/Run-BASIC/calendar.run b/Task/Calendar/Run-BASIC/calendar.run new file mode 100644 index 0000000000..e97e7ff3d5 --- /dev/null +++ b/Task/Calendar/Run-BASIC/calendar.run @@ -0,0 +1,46 @@ +input "Gimme a year";yr +cls ' clear screen +mths$ = "January,February,March,April,May,June,July,August,September,October,November,December" + +html "" +html "" + +for mm = 1 to 12 + gosub [getMonthInfo] + x = 0 + html "" + + if mm mod 4 = 0 then html "" ' 4 months across +next mm +html "

Year:";yr;"

" + html "" + + for i = 1 to mmDays + dow + if i > dow then x = x + 1 + if x = 0 then html "" else html "" + if (i mod 7) = 0 then html "" + next i + html "
" + html " ";word$(mths$,mm,",") + html "
SunMonTueWedThrFriSat
";x;"
" +wait + +[getMonthInfo] +' ---------------------------------------- +' day of week when month begins. +' days in a month +' ---------------------------------------- +if yr < 100 then yr = val(date$("yy")) +if mm < 1 or mm > 12 then mm = val(date$("mm")) +dayOne$ = mm;"-01-";yr +n = date$(dayOne$) +dow = 1 + (n Mod 7) ' Day of Week month begins +m1 = mm +n1 = n + 27 +while m1 = mm + n1 = n1 + 1 + n$ = date$(n1) + m1 = val(left$(n$,2)) +wend +mmDays = n1 - n ' Days in Month +RETURN diff --git a/Task/Calendar/Seed7/calendar.seed7 b/Task/Calendar/Seed7/calendar.seed7 new file mode 100644 index 0000000000..762aded508 --- /dev/null +++ b/Task/Calendar/Seed7/calendar.seed7 @@ -0,0 +1,53 @@ +$ include "seed7_05.s7i"; + include "time.s7i"; + +const func string: center (in string: stri, in integer: length) is + return ("" lpad (length - length(stri)) div 2 <& stri) rpad length; + +const proc: printCalendar (in integer: year, in integer: cols) is func + local + var time: date is time.value; + var integer: dayOfWeek is 0; + const array string: monthNames is [] ("January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December"); + var array array string: monthTable is 12 times 9 times ""; + var string: str is ""; + var integer: month is 0; + var integer: position is 0; + var integer: row is 0; + var integer: column is 0; + var integer: line is 0; + begin + for month range 1 to 12 do + monthTable[month][1] := " " & center(monthNames[month], 20); + monthTable[month][2] := " Mo Tu We Th Fr Sa Su"; + date := date(year, month, 1); + dayOfWeek := dayOfWeek(date); + for position range 1 to 43 do + if position >= dayOfWeek and position - dayOfWeek < daysInMonth(date.year, date.month) then + str := succ(position - dayOfWeek) lpad 3; + else + str := "" lpad 3; + end if; + monthTable[month][3 + pred(position) div 7] &:= str; + end for; + end for; + writeln(center("[Snoopy Picture]", cols * 24 + 4)); + writeln(center(str(year),cols * 24 + 4)); + writeln; + for row range 1 to succ(11 div cols) do + for line range 1 to 9 do + for column range 1 to cols do + if pred(row) * cols + column <= 12 then + write(" " & monthTable[pred(row) * cols + column][line]); + end if; + end for; + writeln; + end for; + end for; + end func; + +const proc: main is func + begin + printCalendar(1969, 3); + end func; diff --git a/Task/Calendar/UNIX-Shell/calendar.sh b/Task/Calendar/UNIX-Shell/calendar.sh new file mode 100644 index 0000000000..1e51095dce --- /dev/null +++ b/Task/Calendar/UNIX-Shell/calendar.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "Snoopy goes here" +cal 1969 diff --git a/Task/Calendar/Vedit-macro-language/calendar-1.vedit b/Task/Calendar/Vedit-macro-language/calendar-1.vedit new file mode 100644 index 0000000000..fa82c9f329 --- /dev/null +++ b/Task/Calendar/Vedit-macro-language/calendar-1.vedit @@ -0,0 +1,21 @@ +Buf_Switch(Buf_Free) +Config_Tab(5,30,55) +#9 = 1 // first day of week: 0=Su, 1=Mo +#3 = 3 // number of months per line +#2 = 1969 // year +#1 = 1 // starting month +Repeat(12/#3) { + Repeat (#3) { + Buf_Switch(Buf_Free) + Call_File(122, "calendar.vdm", "DRAW_CALENDAR") + Reg_Copy_Block(10, 1, EOB_Pos, COLSET, 1, 21) + Buf_Quit(OK) + EOL Ins_Char(9) + #5 = Cur_Pos + Reg_Ins(10) + Goto_Pos(#5) + #1++ + } + EOF + Ins_Newline(2) +} diff --git a/Task/Calendar/Vedit-macro-language/calendar-2.vedit b/Task/Calendar/Vedit-macro-language/calendar-2.vedit new file mode 100644 index 0000000000..0f5745612b --- /dev/null +++ b/Task/Calendar/Vedit-macro-language/calendar-2.vedit @@ -0,0 +1 @@ +Config_Tab(22) diff --git a/Task/Calendar/XPL0/calendar.xpl0 b/Task/Calendar/XPL0/calendar.xpl0 new file mode 100644 index 0000000000..0c082a3cbb --- /dev/null +++ b/Task/Calendar/XPL0/calendar.xpl0 @@ -0,0 +1,59 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations + +func WeekDay(Year, Month, Day); \Return day of week (0=Sun 1=Mon..6=Sat) +int Year, Month, Day; \Works for years from 1583 onward +[if Month<=2 then [Month:= Month+12; Year:= Year-1]; +return rem((Day-1 + (Month+1)*26/10 + Year + Year/4 + Year/100*6 + Year/400)/7); +]; + +proc Space(N); \Display N space characters +int N; +while N do [ChOut(0, ^ ); N:= N-1]; + +proc Calendar(Year); \Display calendar for specified year +int Year; +int Month, Col, C, Line, MoName, Days, DayMax, Day(3); +[MoName:= [ + " January ", " February", " March ", " April ", " May ", " June ", + " July ", " August ", "September", " October", " November", " December"]; +Space(35); Text(0, "[Snoopy]"); CrLf(0); +Space(37); IntOut(0, Year); CrLf(0); +CrLf(0); +for Month:= 1 to 12 do + [for Col:= 0 to 3-1 do + [Space(5); Text(0, MoName(Month+Col-1)); Space(7); + if Col<2 then Space(8); + ]; + CrLf(0); + for Col:= 0 to 3-1 do + [Text(0, "Su Mo Tu We Th Fr Sa"); + if Col<2 then Space(9); + ]; + CrLf(0); + for Col:= 0 to 3-1 do \day of first Sunday of month (can be negative) + Day(Col):= 1 - WeekDay(Year, Month+Col, 1); + for Line:= 0 to 6-1 do + [for Col:= 0 to 3-1 do + [Days:= [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + DayMax:= Days(Month+Col); + if Month+Col=2 & (rem(Year/4)=0 & rem(Year/100)#0 ! rem(Year/400)=0) then + DayMax:= DayMax+1; \if February and leap year then add a day + for C:= 0 to 7-1 do + [if Day(Col)>=1 & Day(Col)<=DayMax then + [IntOut(0, Day(Col)); + if Day(Col)<10 then Space(1); \left justify + ] + else Space(2); \suppress out of range days + Space(1); + Day(Col):= Day(Col)+1; + ]; + if Col<2 then Space(8); + ]; + CrLf(0); + ]; + CrLf(0); + Month:= Month+2; \2+1 months per Col(umn) + ]; +]; + +Calendar(1969) diff --git a/Task/Call-a-foreign-language-function/Mathematica/call-a-foreign-language-function.mathematica b/Task/Call-a-foreign-language-function/Mathematica/call-a-foreign-language-function.math similarity index 100% rename from Task/Call-a-foreign-language-function/Mathematica/call-a-foreign-language-function.mathematica rename to Task/Call-a-foreign-language-function/Mathematica/call-a-foreign-language-function.math diff --git a/Task/Call-a-foreign-language-function/Nimrod/call-a-foreign-language-function.nimrod b/Task/Call-a-foreign-language-function/Nimrod/call-a-foreign-language-function.nimrod new file mode 100644 index 0000000000..bbb1c47164 --- /dev/null +++ b/Task/Call-a-foreign-language-function/Nimrod/call-a-foreign-language-function.nimrod @@ -0,0 +1,3 @@ +proc strcmp(a, b: cstring): cint {.importc: "strcmp", nodecl.} +echo strcmp("abc", "def") +echo strcmp("hello", "hello") diff --git a/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-1.ocaml b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-1.ocaml new file mode 100644 index 0000000000..5748b3b31d --- /dev/null +++ b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-1.ocaml @@ -0,0 +1,3 @@ +void myfunc_a(); +float myfunc_b(int, float); +char *myfunc_c(int *); diff --git a/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-2.ocaml b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-2.ocaml new file mode 100644 index 0000000000..cae3bc6cb6 --- /dev/null +++ b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-2.ocaml @@ -0,0 +1,3 @@ +external myfunc_a: unit -> unit = "caml_myfunc_a" +external myfunc_b: int -> float -> float = "caml_myfunc_b" +external myfunc_c: int array -> string = "caml_myfunc_c" diff --git a/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-3.ocaml b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-3.ocaml new file mode 100644 index 0000000000..ff4c2099d9 --- /dev/null +++ b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-3.ocaml @@ -0,0 +1,30 @@ +#include +#include +#include + +CAMLprim value +caml_myfunc_a(value unit) { + myfunc_a(); + return Val_unit; +} + +CAMLprim value +caml_myfunc_b(value a; value b) { + float c = myfunc_b(Int_val(a), Double_val(b)); + return caml_copy_double(c); +} + +CAMLprim value +caml_myfunc_c(value ml_array) { + int i, len; + int *arr; + char *s; + len = Wosize_val(ml_array); + arr = malloc(len * sizeof(int)); + for (i=0; i < len; i++) { + arr[i] = Int_val(Field(ml_array, i)); + } + s = myfunc_c(arr); + free(arr); + return caml_copy_string(s); +} diff --git a/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-4.ocaml b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-4.ocaml new file mode 100644 index 0000000000..7cfe6b5f1b --- /dev/null +++ b/Task/Call-a-foreign-language-function/OCaml/call-a-foreign-language-function-4.ocaml @@ -0,0 +1,26 @@ +wrap_mylib.o: wrap_mylib.c + ocamlc -c -ccopt -I/usr/include/mylib $< + +dllmylib_stubs.so: wrap_mylib.o + ocamlmklib -o mylib_stubs $< -lmylib + +mylib.mli: mylib.ml + ocamlc -i $< > $@ + +mylib.cmi: mylib.mli + ocamlc -c $< + +mylib.cmo: mylib.ml mylib.cmi + ocamlc -c $< + +mylib.cma: mylib.cmo dllmylib_stubs.so + ocamlc -a -o $@ $< -dllib -lmylib_stubs -cclib -lmylib + +mylib.cmx: mylib.ml mylib.cmi + ocamlopt -c $< + +mylib.cmxa: mylib.cmx dllmylib_stubs.so + ocamlopt -a -o $@ $< -cclib -lmylib_stubs -cclib -lmylib + +clean: + rm -f *.[oa] *.so *.cm[ixoa] *.cmxa diff --git a/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-1.oz b/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-1.oz new file mode 100644 index 0000000000..2d6ad7f99b --- /dev/null +++ b/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-1.oz @@ -0,0 +1,21 @@ +#include "mozart.h" +#include + +OZ_BI_define(c_strdup,1,1) +{ + OZ_declareVirtualString(0, s1); + char* s2 = strdup(s1); + OZ_Term s3 = OZ_string(s2); + free( s2 ); + OZ_RETURN( s3 ); +} +OZ_BI_end + +OZ_C_proc_interface * oz_init_module(void) +{ + static OZ_C_proc_interface table[] = { + {"strdup",1,1,c_strdup}, + {0,0,0,0} + }; + return table; +} diff --git a/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-2.oz b/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-2.oz new file mode 100644 index 0000000000..f8db0aefa8 --- /dev/null +++ b/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-2.oz @@ -0,0 +1,6 @@ +makefile( + lib : [ + 'strdup.o' 'strdup.so' + ] + rules:o('strdup.so':ld('strdup.o')) + ) diff --git a/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-3.oz b/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-3.oz new file mode 100644 index 0000000000..943980dafc --- /dev/null +++ b/Task/Call-a-foreign-language-function/Oz/call-a-foreign-language-function-3.oz @@ -0,0 +1,4 @@ +declare + [Strdup] = {Module.link ['strdup.so{native}']} +in + {System.showInfo {Strdup.strdup "hello"}} diff --git a/Task/Call-a-foreign-language-function/PL-I/call-a-foreign-language-function.pli b/Task/Call-a-foreign-language-function/PL-I/call-a-foreign-language-function.pli new file mode 100644 index 0000000000..3f599ea34b --- /dev/null +++ b/Task/Call-a-foreign-language-function/PL-I/call-a-foreign-language-function.pli @@ -0,0 +1,3 @@ +declare strdup entry (character (30) varyingz) options (fastcall16); + +put (strdup('hello world') ); diff --git a/Task/Call-a-foreign-language-function/Perl-6/call-a-foreign-language-function.pl6 b/Task/Call-a-foreign-language-function/Perl-6/call-a-foreign-language-function.pl6 new file mode 100644 index 0000000000..0081c0427e --- /dev/null +++ b/Task/Call-a-foreign-language-function/Perl-6/call-a-foreign-language-function.pl6 @@ -0,0 +1,9 @@ +use NativeCall; + +sub strdup(Str $s --> OpaquePointer) is native {*} +sub puts(OpaquePointer $p --> int) is native {*} +sub free(OpaquePointer $p --> int) is native {*} + +my $p = strdup("Success!"); +say 'puts returns ', puts($p); +say 'free returns ', free($p); diff --git a/Task/Call-a-foreign-language-function/PureBasic/call-a-foreign-language-function-1.purebasic b/Task/Call-a-foreign-language-function/PureBasic/call-a-foreign-language-function-1.purebasic new file mode 100644 index 0000000000..fa2ec5085b --- /dev/null +++ b/Task/Call-a-foreign-language-function/PureBasic/call-a-foreign-language-function-1.purebasic @@ -0,0 +1,39 @@ +; Call_a_foreign_language_function.fasm -> Call_a_foreign_language_function.obj +; the assembler code... + +; format COFF or +; format COFF64 classic (DJGPP) variants of COFF file + +; format MS COFF or +; format MS COFF64 Microsoft's variants of COFF file + +format MS COFF + +include "Win32A.Inc" + +section ".text" executable readable code + +proc strucase stdcall str:dword +xor eax,eax +mov ebx,[str] +strucase_loop: +mov al,byte[ebx] +cmp al,0 +jz strucase_is_null_byte +cmp al,'a' +jb strucase_skip +cmp al,'z' +ja strucase_skip +and al,11011111b +strucase_skip: +; mov byte[ebx],al +xchg al,byte[ebx] +inc ebx +jmp strucase_loop +strucase_is_null_byte: +xor eax,eax +mov eax,[str] +ret +endp + +public strucase as "_strucase@4" diff --git a/Task/Call-a-foreign-language-function/PureBasic/call-a-foreign-language-function-2.purebasic b/Task/Call-a-foreign-language-function/PureBasic/call-a-foreign-language-function-2.purebasic new file mode 100644 index 0000000000..15f3f259af --- /dev/null +++ b/Task/Call-a-foreign-language-function/PureBasic/call-a-foreign-language-function-2.purebasic @@ -0,0 +1,10 @@ +; the PureBasic code... + +Import "Call_a_foreign_language_function.obj" +strucase(t.s) As "_strucase@4" +EndImport + +t.s="hElLo WoRld!!" +*r=StrUcase(t.s) ; PureBasic is case-insensitive +; cw(peeks(*r)) +Debug peeks(*r) diff --git a/Task/Call-a-foreign-language-function/REALbasic/call-a-foreign-language-function.realbasic b/Task/Call-a-foreign-language-function/REALbasic/call-a-foreign-language-function.realbasic new file mode 100644 index 0000000000..0bc2d3e510 --- /dev/null +++ b/Task/Call-a-foreign-language-function/REALbasic/call-a-foreign-language-function.realbasic @@ -0,0 +1,22 @@ + Declare Function CreateFileW Lib "Kernel32" (FileName As WString, DesiredAccess As Integer, ShareMode As Integer, SecurityAttributes As Integer, _ + CreateDisposition As Integer, Flags As Integer, Template As Integer) As Integer + Declare Function WriteFile Lib "Kernel32" (fHandle As Integer, writeData As Ptr, numOfBytes As Integer, ByRef numOfBytesWritten As Integer, _ + overlapped As Ptr) As Boolean + Declare Function GetLastError Lib "Kernel32" () As Integer + Declare Function CloseHandle Lib "kernel32" (hObject As Integer) As Boolean + + Const FILE_SHARE_READ = &h00000001 + Const FILE_SHARE_WRITE = &h00000002 + Const OPEN_EXISTING = 3 + + Dim fHandle As Integer = CreateFileW("C:\foo.txt", 0, FILE_SHARE_READ Or FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0) + If fHandle > 0 Then + Dim mb As MemoryBlock = "Hello, World!" + Dim bytesWritten As Integer + If Not WriteFile(fHandle, mb, mb.Size, bytesWritten, Nil) Then + MsgBox("Error Number: " + Str(GetLastError)) + End If + Call CloseHandle(fHandle) + Else + MsgBox("Error Number: " + Str(GetLastError)) + End If diff --git a/Task/Call-a-function-in-a-shared-library/Mathematica/call-a-function-in-a-shared-library.mathematica b/Task/Call-a-function-in-a-shared-library/Mathematica/call-a-function-in-a-shared-library.math similarity index 100% rename from Task/Call-a-function-in-a-shared-library/Mathematica/call-a-function-in-a-shared-library.mathematica rename to Task/Call-a-function-in-a-shared-library/Mathematica/call-a-function-in-a-shared-library.math diff --git a/Task/Call-a-function-in-a-shared-library/OCaml/call-a-function-in-a-shared-library.ocaml b/Task/Call-a-function-in-a-shared-library/OCaml/call-a-function-in-a-shared-library.ocaml new file mode 100644 index 0000000000..c6b0edbbda --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/OCaml/call-a-function-in-a-shared-library.ocaml @@ -0,0 +1,31 @@ +open Dlffi + +let get_int = function Int v -> v | _ -> failwith "get_int" +let get_ptr = function Ptr v -> v | _ -> failwith "get_ptr" +let get_float = function Float v -> v | _ -> failwith "get_float" +let get_double = function Double v -> v | _ -> failwith "get_double" +let get_string = function String v -> v | _ -> failwith "get_string" + +let () = + (* load the library *) + let xlib = dlopen "/usr/lib/libX11.so" [RTLD_LAZY] in + (* load the functions *) + let _open_display = dlsym xlib "XOpenDisplay" + and _default_screen = dlsym xlib "XDefaultScreen" + and _display_width = dlsym xlib "XDisplayWidth" + and _display_height = dlsym xlib "XDisplayHeight" + in + (* wrap functions to provide a higher level interface *) + let open_display ~name = get_ptr(fficall _open_display [| String name |] Return_ptr) + and default_screen ~dpy = get_int(fficall _default_screen [| (Ptr dpy) |] Return_int) + and display_width ~dpy ~scr = get_int(fficall _display_width [| (Ptr dpy); (Int scr) |] Return_int) + and display_height ~dpy ~scr = get_int(fficall _display_height [| (Ptr dpy); (Int scr) |] Return_int) + in + (* use our functions *) + let dpy = open_display ~name:":0" in + let screen_number = default_screen ~dpy in + let width = display_width ~dpy ~scr:screen_number + and height = display_height ~dpy ~scr:screen_number in + Printf.printf "# Screen dimensions are: %d x %d pixels\n" width height; + dlclose xlib; +;; diff --git a/Task/Call-a-function-in-a-shared-library/OxygenBasic/call-a-function-in-a-shared-library.oxy b/Task/Call-a-function-in-a-shared-library/OxygenBasic/call-a-function-in-a-shared-library.oxy new file mode 100644 index 0000000000..4ada8be969 --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/OxygenBasic/call-a-function-in-a-shared-library.oxy @@ -0,0 +1,13 @@ +'Loading a shared library at run time and calling a function. + +declare MessageBox(sys hWnd, String text,caption, sys utype) + +sys user32 = LoadLibrary "user32.dll" + +if user32 then @Messagebox = getProcAddress user32,"MessageBoxA" + +if @MessageBox then MessageBox 0,"Hello","OxygenBasic",0 + +'... + +FreeLibrary user32 diff --git a/Task/Call-a-function-in-a-shared-library/PARI-GP/call-a-function-in-a-shared-library.pari b/Task/Call-a-function-in-a-shared-library/PARI-GP/call-a-function-in-a-shared-library.pari new file mode 100644 index 0000000000..a86f027051 --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/PARI-GP/call-a-function-in-a-shared-library.pari @@ -0,0 +1 @@ +install("function_name","G","gp_name","./test.gp.so"); diff --git a/Task/Call-a-function-in-a-shared-library/Perl-6/call-a-function-in-a-shared-library.pl6 b/Task/Call-a-function-in-a-shared-library/Perl-6/call-a-function-in-a-shared-library.pl6 new file mode 100644 index 0000000000..f44629e09d --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/Perl-6/call-a-function-in-a-shared-library.pl6 @@ -0,0 +1,15 @@ +use NativeCall; + +constant libX11 = '/usr/lib/x86_64-linux-gnu/libX11.so.6'; + +sub XOpenDisplay(Str $s --> Int) is native(libX11) {*} +sub XCloseDisplay(Int $i --> Int) is native(libX11) {*} + +if try my $d = XOpenDisplay ":0.0" { + say "ID = $d"; + XCloseDisplay($d); +} +else { + say "No library {libX11}!"; + say "Use this window instead --> ⬜"; +} diff --git a/Task/Call-a-function-in-a-shared-library/PowerBASIC/call-a-function-in-a-shared-library.powerbasic b/Task/Call-a-function-in-a-shared-library/PowerBASIC/call-a-function-in-a-shared-library.powerbasic new file mode 100644 index 0000000000..782ea17424 --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/PowerBASIC/call-a-function-in-a-shared-library.powerbasic @@ -0,0 +1,37 @@ +#INCLUDE "Win32API.inc" + +FUNCTION PBMAIN () AS LONG + DIM hWnd AS LONG + DIM msg AS ASCIIZ * 14, titl AS ASCIIZ * 8 + + hWnd = LoadLibrary ("user32") + msg = "Hello, world!" + titl = "Example" + IF ISTRUE (hWnd) THEN + funcAddr& = GetProcAddress (hWnd, "MessageBoxA") + IF ISTRUE (funcAddr&) THEN + ASM push 0& + tAdr& = VARPTR(titl) + ASM push tAdr& + mAdr& = VARPTR(msg) + ASM push mAdr& + ASM push 0& + CALL DWORD funcAddr& + ELSE + GOTO epicFail + END IF + ELSE + GOTO epicFail + END IF + + GOTO getMeOuttaHere + +epicFail: + MSGBOX msg, , titl + +getMeOuttaHere: + IF ISTRUE(hWnd) THEN + tmp& = FreeLibrary (hWnd) + IF ISFALSE(tmp&) THEN MSGBOX "Error freeing library... [shrug]" + END IF +END FUNCTION diff --git a/Task/Call-a-function-in-a-shared-library/PureBasic/call-a-function-in-a-shared-library-1.purebasic b/Task/Call-a-function-in-a-shared-library/PureBasic/call-a-function-in-a-shared-library-1.purebasic new file mode 100644 index 0000000000..b8ffd8c5a9 --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/PureBasic/call-a-function-in-a-shared-library-1.purebasic @@ -0,0 +1,5 @@ +if OpenLibrary(0, "USER32.DLL") + *MessageBox = GetFunction(0, "MessageBoxA") + CallFunctionFast(*MessageBox, 0, "Body", "Title", 0) + CloseLibrary(0) +endif diff --git a/Task/Call-a-function-in-a-shared-library/PureBasic/call-a-function-in-a-shared-library-2.purebasic b/Task/Call-a-function-in-a-shared-library/PureBasic/call-a-function-in-a-shared-library-2.purebasic new file mode 100644 index 0000000000..15f820d36a --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/PureBasic/call-a-function-in-a-shared-library-2.purebasic @@ -0,0 +1,7 @@ +Prototype.l ProtoMessageBoxW(Window.l, Body.p-unicode, Title.p-unicode, Flags.l = 0) + +If OpenLibrary(0, "User32.dll") + MsgBox.ProtoMessageBoxW = GetFunction(0, "MessageBoxW") + MsgBox(0, "Hello", "World") + CloseLibrary(0) +EndIf diff --git a/Task/Call-a-function-in-a-shared-library/Ursala/call-a-function-in-a-shared-library.ursala b/Task/Call-a-function-in-a-shared-library/Ursala/call-a-function-in-a-shared-library.ursala new file mode 100644 index 0000000000..60f67baeb9 --- /dev/null +++ b/Task/Call-a-function-in-a-shared-library/Ursala/call-a-function-in-a-shared-library.ursala @@ -0,0 +1,6 @@ +#import std +#import flo + +my_replacement = fleq/0.?/~& negative + +abs = math.|fabs my_replacement diff --git a/Task/Call-a-function/Mathematica/call-a-function-1.mathematica b/Task/Call-a-function/Mathematica/call-a-function-1.math similarity index 100% rename from Task/Call-a-function/Mathematica/call-a-function-1.mathematica rename to Task/Call-a-function/Mathematica/call-a-function-1.math diff --git a/Task/Call-a-function/Mathematica/call-a-function-2.mathematica b/Task/Call-a-function/Mathematica/call-a-function-2.math similarity index 100% rename from Task/Call-a-function/Mathematica/call-a-function-2.mathematica rename to Task/Call-a-function/Mathematica/call-a-function-2.math diff --git a/Task/Call-a-function/Mathematica/call-a-function-3.mathematica b/Task/Call-a-function/Mathematica/call-a-function-3.math similarity index 100% rename from Task/Call-a-function/Mathematica/call-a-function-3.mathematica rename to Task/Call-a-function/Mathematica/call-a-function-3.math diff --git a/Task/Call-a-function/Mathematica/call-a-function-4.mathematica b/Task/Call-a-function/Mathematica/call-a-function-4.math similarity index 100% rename from Task/Call-a-function/Mathematica/call-a-function-4.mathematica rename to Task/Call-a-function/Mathematica/call-a-function-4.math diff --git a/Task/Call-a-function/Mathematica/call-a-function-5.mathematica b/Task/Call-a-function/Mathematica/call-a-function-5.math similarity index 100% rename from Task/Call-a-function/Mathematica/call-a-function-5.mathematica rename to Task/Call-a-function/Mathematica/call-a-function-5.math diff --git a/Task/Call-a-function/Mathematica/call-a-function-6.mathematica b/Task/Call-a-function/Mathematica/call-a-function-6.math similarity index 100% rename from Task/Call-a-function/Mathematica/call-a-function-6.mathematica rename to Task/Call-a-function/Mathematica/call-a-function-6.math diff --git a/Task/Call-a-function/Mathematica/call-a-function-7.mathematica b/Task/Call-a-function/Mathematica/call-a-function-7.math similarity index 100% rename from Task/Call-a-function/Mathematica/call-a-function-7.mathematica rename to Task/Call-a-function/Mathematica/call-a-function-7.math diff --git a/Task/Call-a-function/OCaml/call-a-function-1.ocaml b/Task/Call-a-function/OCaml/call-a-function-1.ocaml new file mode 100644 index 0000000000..39270e49c8 --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-1.ocaml @@ -0,0 +1 @@ +f () diff --git a/Task/Call-a-function/OCaml/call-a-function-2.ocaml b/Task/Call-a-function/OCaml/call-a-function-2.ocaml new file mode 100644 index 0000000000..1d5fd33484 --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-2.ocaml @@ -0,0 +1 @@ +f 1 2 3 diff --git a/Task/Call-a-function/OCaml/call-a-function-3.ocaml b/Task/Call-a-function/OCaml/call-a-function-3.ocaml new file mode 100644 index 0000000000..19e1fff305 --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-3.ocaml @@ -0,0 +1 @@ +val f : ?a:int -> int -> unit diff --git a/Task/Call-a-function/OCaml/call-a-function-4.ocaml b/Task/Call-a-function/OCaml/call-a-function-4.ocaml new file mode 100644 index 0000000000..e222d46af9 --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-4.ocaml @@ -0,0 +1,2 @@ +f 10 +f ~a:6 10 diff --git a/Task/Call-a-function/OCaml/call-a-function-5.ocaml b/Task/Call-a-function/OCaml/call-a-function-5.ocaml new file mode 100644 index 0000000000..5de4b80926 --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-5.ocaml @@ -0,0 +1,2 @@ +g () +g ~b:1.0 () diff --git a/Task/Call-a-function/OCaml/call-a-function-6.ocaml b/Task/Call-a-function/OCaml/call-a-function-6.ocaml new file mode 100644 index 0000000000..85d8650c4f --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-6.ocaml @@ -0,0 +1 @@ +f ~arg:3 diff --git a/Task/Call-a-function/OCaml/call-a-function-7.ocaml b/Task/Call-a-function/OCaml/call-a-function-7.ocaml new file mode 100644 index 0000000000..92f81ebb1f --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-7.ocaml @@ -0,0 +1,2 @@ +let arg = 3 in +f ~arg diff --git a/Task/Call-a-function/OCaml/call-a-function-8.ocaml b/Task/Call-a-function/OCaml/call-a-function-8.ocaml new file mode 100644 index 0000000000..5f7fafe058 --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-8.ocaml @@ -0,0 +1 @@ +(* TODO *) diff --git a/Task/Call-a-function/OCaml/call-a-function-9.ocaml b/Task/Call-a-function/OCaml/call-a-function-9.ocaml new file mode 100644 index 0000000000..3132568a97 --- /dev/null +++ b/Task/Call-a-function/OCaml/call-a-function-9.ocaml @@ -0,0 +1,4 @@ +let ret = f () +let a, b, c = f () (* if there are several returned values given as a tuple *) +let _ = f () (* if we want to ignore the returned value *) +let v, _ = f () (* if we want to ignore one of the returned value *) diff --git a/Task/Call-a-function/PARI-GP/call-a-function.pari b/Task/Call-a-function/PARI-GP/call-a-function.pari new file mode 100644 index 0000000000..fb25c3cecc --- /dev/null +++ b/Task/Call-a-function/PARI-GP/call-a-function.pari @@ -0,0 +1,5 @@ +f(); \\ zero arguments +sin(Pi/2); \\ fixed number of arguments +Str("gg", 1, "hh"); \\ variable number of arguments +(x->x^2)(3); \\ first-class +x = sin(0); \\ get function value diff --git a/Task/Call-a-function/Perl-6/call-a-function-1.pl6 b/Task/Call-a-function/Perl-6/call-a-function-1.pl6 new file mode 100644 index 0000000000..e64bdd4cae --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-1.pl6 @@ -0,0 +1,8 @@ +foo # as list operator +foo() # as function +foo.() # as function, explicit postfix form +$ref() # as object invocation +$ref.() # as object invocation, explicit postfix +&foo() # as object invocation +&foo.() # as object invocation, explicit postfix +::($name)() # as symbolic ref diff --git a/Task/Call-a-function/Perl-6/call-a-function-10.pl6 b/Task/Call-a-function/Perl-6/call-a-function-10.pl6 new file mode 100644 index 0000000000..faebc3dc4d --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-10.pl6 @@ -0,0 +1 @@ +my $result = somefunc(1,2,3) + 2; diff --git a/Task/Call-a-function/Perl-6/call-a-function-2.pl6 b/Task/Call-a-function/Perl-6/call-a-function-2.pl6 new file mode 100644 index 0000000000..a09609ac44 --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-2.pl6 @@ -0,0 +1,13 @@ +foo 1 # as list operator +foo(1) # as named function +foo.(1) # as named function, explicit postfix +$ref(1) # as object invocation (must be hard ref) +$ref.(1) # as object invocation, explicit postfix +1.$foo # as pseudo-method meaning $foo(1) (hard ref only) +1.$foo() # as pseudo-method meaning $foo(1) (hard ref only) +1.&foo # as pseudo-method meaning &foo(1) (is hard foo) +1.&foo() # as pseudo-method meaning &foo(1) (is hard foo) +1.foo # as method via dispatcher +1.foo() # as method via dispatcher +1."$name"() # as method via dispatcher, symbolic ++1 # as operator to prefix:<+> function diff --git a/Task/Call-a-function/Perl-6/call-a-function-3.pl6 b/Task/Call-a-function/Perl-6/call-a-function-3.pl6 new file mode 100644 index 0000000000..a00221f58e --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-3.pl6 @@ -0,0 +1,13 @@ +foo 1,2 # as list operator +foo(1,2) # as named function +foo.(1,2) # as named function, explicit postfix +$ref(1,2) # as object invocation (must be hard ref) +$ref.(1,2) # as object invocation, explicit postfix +1.$foo: 2 # as pseudo-method meaning $foo(1,2) (hard ref only) +1.$foo(2) # as pseudo-method meaning $foo(1,2) (hard ref only) +1.&foo: 2 # as pseudo-method meaning &foo(1,2) (is hard foo) +1.&foo(2) # as pseudo-method meaning &foo(1,2) (is hard foo) +1.foo: 2 # as method via dispatcher +1.foo(2) # as method via dispatcher +1."$name"(2) # as method via dispatcher, symbolic +1 + 2 # as operator to infix:<+> function diff --git a/Task/Call-a-function/Perl-6/call-a-function-4.pl6 b/Task/Call-a-function/Perl-6/call-a-function-4.pl6 new file mode 100644 index 0000000000..938000bfe9 --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-4.pl6 @@ -0,0 +1,13 @@ +foo @args # as list operator +foo(@args) # as named function +foo.(@args) # as named function, explicit postfix +$ref(@args) # as object invocation (must be hard ref) +$ref.(@args) # as object invocation, explicit postfix +1.$foo: @args # as pseudo-method meaning $foo(1,@args) (hard ref) +1.$foo(@args) # as pseudo-method meaning $foo(1,@args) (hard ref) +1.&foo: @args # as pseudo-method meaning &foo(1,@args) +1.&foo(@args) # as pseudo-method meaning &foo(1,@args) +1.foo: @args # as method via dispatcher +1.foo(@args) # as method via dispatcher +1."$name"(@args) # as method via dispatcher, symbolic +@args X @blargs # as list infix operator to infix: diff --git a/Task/Call-a-function/Perl-6/call-a-function-5.pl6 b/Task/Call-a-function/Perl-6/call-a-function-5.pl6 new file mode 100644 index 0000000000..34ebae147d --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-5.pl6 @@ -0,0 +1,2 @@ +my @args = 1,2,3; +foo(|@args); # equivalent to foo(1,2,3) diff --git a/Task/Call-a-function/Perl-6/call-a-function-6.pl6 b/Task/Call-a-function/Perl-6/call-a-function-6.pl6 new file mode 100644 index 0000000000..6166967e8b --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-6.pl6 @@ -0,0 +1,2 @@ +foo :a, :b(4), :!c, d => "stuff" +foo(:a, :b(4), :!c, d => "stuff") diff --git a/Task/Call-a-function/Perl-6/call-a-function-7.pl6 b/Task/Call-a-function/Perl-6/call-a-function-7.pl6 new file mode 100644 index 0000000000..1c5aadd357 --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-7.pl6 @@ -0,0 +1 @@ +1 + 1 :a :b(4) :!c :d("stuff") # calls infix:<+>(1,1,:a, :b(4), :!c, d => "stuff") diff --git a/Task/Call-a-function/Perl-6/call-a-function-8.pl6 b/Task/Call-a-function/Perl-6/call-a-function-8.pl6 new file mode 100644 index 0000000000..10ed6371cd --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-8.pl6 @@ -0,0 +1 @@ +foo(); bar(); baz(); # evaluate for side effects diff --git a/Task/Call-a-function/Perl-6/call-a-function-9.pl6 b/Task/Call-a-function/Perl-6/call-a-function-9.pl6 new file mode 100644 index 0000000000..c249b4753d --- /dev/null +++ b/Task/Call-a-function/Perl-6/call-a-function-9.pl6 @@ -0,0 +1 @@ +1 / find-a-func(1,2,3)(4,5,6) ** 2; diff --git a/Task/Call-a-function/UNIX-Shell/call-a-function.sh b/Task/Call-a-function/UNIX-Shell/call-a-function.sh new file mode 100644 index 0000000000..c72ed14086 --- /dev/null +++ b/Task/Call-a-function/UNIX-Shell/call-a-function.sh @@ -0,0 +1,2 @@ +sayhello # Call a function in statement context with no arguments +multiply 3 4 # Call a function in statement context with two arguments diff --git a/Task/Call-a-function/ZX-Spectrum-Basic/call-a-function.zx b/Task/Call-a-function/ZX-Spectrum-Basic/call-a-function.zx new file mode 100644 index 0000000000..109b950f76 --- /dev/null +++ b/Task/Call-a-function/ZX-Spectrum-Basic/call-a-function.zx @@ -0,0 +1,12 @@ +10 REM functions cannot be called in statement context +20 PRINT FN a(5): REM The function is used in first class context. Arguments are not named +30 PRINT FN b(): REM Here we call a function that has no arguments +40 REM subroutines cannot be passed parameters, however variables are global +50 LET n=1: REM This variable will be visible to the called subroutine +60 GO SUB 1000: REM subroutines are called by line number and do not have names +70 REM subroutines do not return a value, but we can see any variables it defined +80 REM subroutines cannot be used in first class context +90 REM builtin functions are used in first class context, and do not need the FN keyword prefix +100 PRINT SIN(50): REM here we pass a parameter to a builtin function +110 PRINT RND(): REM here we use a builtin function without parameters +120 RANDOMIZE: REM statements are not functions and cannot be used in first class context. diff --git a/Task/Call-an-object-method/NetRexx/call-an-object-method-1.netrexx b/Task/Call-an-object-method/NetRexx/call-an-object-method-1.netrexx new file mode 100644 index 0000000000..bdc4a18009 --- /dev/null +++ b/Task/Call-an-object-method/NetRexx/call-an-object-method-1.netrexx @@ -0,0 +1 @@ +SomeClass.staticMethod() diff --git a/Task/Call-an-object-method/NetRexx/call-an-object-method-2.netrexx b/Task/Call-an-object-method/NetRexx/call-an-object-method-2.netrexx new file mode 100644 index 0000000000..1fdd4db84a --- /dev/null +++ b/Task/Call-an-object-method/NetRexx/call-an-object-method-2.netrexx @@ -0,0 +1,4 @@ +objectInstance = SomeClass() -- create a new instance of the class +objectInstance.instanceMethod() -- call the instance method + +SomeClass().instanceMethod() -- same as above; create a new instance of the class and call the instance method immediately diff --git a/Task/Call-an-object-method/OCaml/call-an-object-method.ocaml b/Task/Call-an-object-method/OCaml/call-an-object-method.ocaml new file mode 100644 index 0000000000..3039d06d00 --- /dev/null +++ b/Task/Call-an-object-method/OCaml/call-an-object-method.ocaml @@ -0,0 +1 @@ +my_obj#my_meth params diff --git a/Task/Call-an-object-method/Objeck/call-an-object-method.objeck b/Task/Call-an-object-method/Objeck/call-an-object-method.objeck new file mode 100644 index 0000000000..061e1fbbaf --- /dev/null +++ b/Task/Call-an-object-method/Objeck/call-an-object-method.objeck @@ -0,0 +1,2 @@ +ClassName->some_function(); # call class function +instance->some_method(); # call instance method diff --git a/Task/Call-an-object-method/Objective-C/call-an-object-method.m b/Task/Call-an-object-method/Objective-C/call-an-object-method.m new file mode 100644 index 0000000000..dd60d8cb29 --- /dev/null +++ b/Task/Call-an-object-method/Objective-C/call-an-object-method.m @@ -0,0 +1,14 @@ +// Class +[MyClass method:someParameter]; +// or equivalently: +id foo = [MyClass class]; +[foo method:someParameter]; + +// Instance +[myInstance method:someParameter]; + +// Method with multiple arguments +[myInstance methodWithRed:arg1 green:arg2 blue:arg3]; + +// Method with no arguments +[myInstance method]; diff --git a/Task/Call-an-object-method/PL-SQL/call-an-object-method.sql b/Task/Call-an-object-method/PL-SQL/call-an-object-method.sql new file mode 100644 index 0000000000..b785e7d5b9 --- /dev/null +++ b/Task/Call-an-object-method/PL-SQL/call-an-object-method.sql @@ -0,0 +1,28 @@ +create or replace TYPE myClass AS OBJECT ( + -- A class needs at least one member even though we don't use it + dummy NUMBER, + STATIC FUNCTION static_method RETURN VARCHAR2, + MEMBER FUNCTION instance_method RETURN VARCHAR2 +); +/ +CREATE OR REPLACE TYPE BODY myClass AS + STATIC FUNCTION static_method RETURN VARCHAR2 IS + BEGIN + RETURN 'Called myClass.static_method'; + END static_method; + + MEMBER FUNCTION instance_method RETURN VARCHAR2 IS + BEGIN + RETURN 'Called myClass.instance_method'; + END instance_method; +END; +/ + +DECLARE + myInstance myClass; +BEGIN + myInstance := myClass(null); + DBMS_OUTPUT.put_line( myClass.static_method() ); + DBMS_OUTPUT.put_line( myInstance.instance_method() ); +END; +/ diff --git a/Task/Call-an-object-method/Perl-6/call-an-object-method.pl6 b/Task/Call-an-object-method/Perl-6/call-an-object-method.pl6 new file mode 100644 index 0000000000..d7a99fbda4 --- /dev/null +++ b/Task/Call-an-object-method/Perl-6/call-an-object-method.pl6 @@ -0,0 +1,2 @@ +ClassName.methodname(); # call class method +$instance.methodname(); # call instance method diff --git a/Task/Call-an-object-method/Pike/call-an-object-method-1.pike b/Task/Call-an-object-method/Pike/call-an-object-method-1.pike new file mode 100644 index 0000000000..51a1156ea1 --- /dev/null +++ b/Task/Call-an-object-method/Pike/call-an-object-method-1.pike @@ -0,0 +1,4 @@ +obj->method(); +obj["method"](); +call_function(obj->method); +call_function(obj["method"]); diff --git a/Task/Call-an-object-method/Pike/call-an-object-method-2.pike b/Task/Call-an-object-method/Pike/call-an-object-method-2.pike new file mode 100644 index 0000000000..43b1c0659c --- /dev/null +++ b/Task/Call-an-object-method/Pike/call-an-object-method-2.pike @@ -0,0 +1,2 @@ +function func = obj->method; +func(); diff --git a/Task/Call-an-object-method/Pike/call-an-object-method-3.pike b/Task/Call-an-object-method/Pike/call-an-object-method-3.pike new file mode 100644 index 0000000000..593c8a42d7 --- /dev/null +++ b/Task/Call-an-object-method/Pike/call-an-object-method-3.pike @@ -0,0 +1,2 @@ +module.func(); +module["func"](); diff --git a/Task/Carmichael-3-strong-pseudoprimes/Mathematica/carmichael-3-strong-pseudoprimes.mathematica b/Task/Carmichael-3-strong-pseudoprimes/Mathematica/carmichael-3-strong-pseudoprimes.math similarity index 100% rename from Task/Carmichael-3-strong-pseudoprimes/Mathematica/carmichael-3-strong-pseudoprimes.mathematica rename to Task/Carmichael-3-strong-pseudoprimes/Mathematica/carmichael-3-strong-pseudoprimes.math diff --git a/Task/Carmichael-3-strong-pseudoprimes/Perl-6/carmichael-3-strong-pseudoprimes.pl6 b/Task/Carmichael-3-strong-pseudoprimes/Perl-6/carmichael-3-strong-pseudoprimes.pl6 new file mode 100644 index 0000000000..9acd1d84aa --- /dev/null +++ b/Task/Carmichael-3-strong-pseudoprimes/Perl-6/carmichael-3-strong-pseudoprimes.pl6 @@ -0,0 +1,15 @@ +for (2..67).grep: *.is-prime -> \Prime1 { + for 1 ^..^ Prime1 -> \h3 { + my \g = h3 + Prime1; + for 0 ^..^ h3 + Prime1 -> \d { + if (h3 + Prime1) * (Prime1 - 1) %% d and -Prime1**2 % h3 == d % h3 { + my \Prime2 = floor 1 + (Prime1 - 1) * g / d; + next unless Prime2.is-prime; + my \Prime3 = floor 1 + Prime1 * Prime2 / h3; + next unless Prime3.is-prime; + next unless (Prime2 * Prime3) % (Prime1 - 1) == 1; + say "{Prime1} × {Prime2} × {Prime3} == {Prime1 * Prime2 * Prime3}"; + } + } + } +} diff --git a/Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-1.coffee b/Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-1.coffeescript similarity index 100% rename from Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-1.coffee rename to Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-1.coffeescript diff --git a/Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-2.coffee b/Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-2.coffeescript similarity index 100% rename from Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-2.coffee rename to Task/Case-sensitivity-of-identifiers/CoffeeScript/case-sensitivity-of-identifiers-2.coffeescript diff --git a/Task/Case-sensitivity-of-identifiers/Mathematica/case-sensitivity-of-identifiers.mathematica b/Task/Case-sensitivity-of-identifiers/Mathematica/case-sensitivity-of-identifiers.math similarity index 100% rename from Task/Case-sensitivity-of-identifiers/Mathematica/case-sensitivity-of-identifiers.mathematica rename to Task/Case-sensitivity-of-identifiers/Mathematica/case-sensitivity-of-identifiers.math diff --git a/Task/Case-sensitivity-of-identifiers/Nemerle/case-sensitivity-of-identifiers.nemerle b/Task/Case-sensitivity-of-identifiers/Nemerle/case-sensitivity-of-identifiers.nemerle new file mode 100644 index 0000000000..d9bee4b94c --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/Nemerle/case-sensitivity-of-identifiers.nemerle @@ -0,0 +1,4 @@ +def dog = "Benjamin"; +def Dog = "Samba"; +def DOG = "Bernie"; +WriteLine($"The three dogs are named $dog, $Dog, and $DOG"); diff --git a/Task/Case-sensitivity-of-identifiers/NetRexx/case-sensitivity-of-identifiers.netrexx b/Task/Case-sensitivity-of-identifiers/NetRexx/case-sensitivity-of-identifiers.netrexx new file mode 100644 index 0000000000..d4042e2092 --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/NetRexx/case-sensitivity-of-identifiers.netrexx @@ -0,0 +1,15 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +dog = "Benjamin"; +Dog = "Samba"; +DOG = "Bernie"; + +if dog == Dog & Dog == DOG & dog == DOG then do + say 'There is just one dog named' dog'.' + end +else do + say 'The three dogs are named' dog',' Dog 'and' DOG'.' + end + +return diff --git a/Task/Case-sensitivity-of-identifiers/Nimrod/case-sensitivity-of-identifiers.nimrod b/Task/Case-sensitivity-of-identifiers/Nimrod/case-sensitivity-of-identifiers.nimrod new file mode 100644 index 0000000000..6ac96626fb --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/Nimrod/case-sensitivity-of-identifiers.nimrod @@ -0,0 +1,4 @@ +var dog = "Benjamin" +Dog = "Samba" +DOG = "Bernie" +echo("There is just one dog named " & doG) diff --git a/Task/Case-sensitivity-of-identifiers/OCaml/case-sensitivity-of-identifiers.ocaml b/Task/Case-sensitivity-of-identifiers/OCaml/case-sensitivity-of-identifiers.ocaml new file mode 100644 index 0000000000..0873f43730 --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/OCaml/case-sensitivity-of-identifiers.ocaml @@ -0,0 +1,5 @@ +let () = + let dog = "Benjamin" in + let dOG = "Samba" in + let dOg = "Bernie" in + Printf.printf "The three dogs are named %s, %s and %s.\n" dog dOG dOg diff --git a/Task/Case-sensitivity-of-identifiers/PARI-GP/case-sensitivity-of-identifiers.pari b/Task/Case-sensitivity-of-identifiers/PARI-GP/case-sensitivity-of-identifiers.pari new file mode 100644 index 0000000000..68c241d650 --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/PARI-GP/case-sensitivity-of-identifiers.pari @@ -0,0 +1,4 @@ +dog="Benjamin"; +Dog="Samba"; +DOG="Bernie"; +printf("The three dogs are named %s, %s, and %s.", dog, Dog, DOG) diff --git a/Task/Case-sensitivity-of-identifiers/Perl-6/case-sensitivity-of-identifiers-1.pl6 b/Task/Case-sensitivity-of-identifiers/Perl-6/case-sensitivity-of-identifiers-1.pl6 new file mode 100644 index 0000000000..894eee74d6 --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/Perl-6/case-sensitivity-of-identifiers-1.pl6 @@ -0,0 +1,4 @@ +my $dog = 'Benjamin'; +my $Dog = 'Samba'; +my $DOG = 'Bernie'; +say "The three dogs are named $dog, $Dog, and $DOG." diff --git a/Task/Case-sensitivity-of-identifiers/Perl-6/case-sensitivity-of-identifiers-2.pl6 b/Task/Case-sensitivity-of-identifiers/Perl-6/case-sensitivity-of-identifiers-2.pl6 new file mode 100644 index 0000000000..3bc1e13e3e --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/Perl-6/case-sensitivity-of-identifiers-2.pl6 @@ -0,0 +1,4 @@ +constant dog = 'Benjamin'; +sub Dog() { 'Samba' } +my &DOG = { 'Bernie' } +say "The three dogs are named {dog}, {Dog}, and {DOG}." diff --git a/Task/Case-sensitivity-of-identifiers/PureBasic/case-sensitivity-of-identifiers.purebasic b/Task/Case-sensitivity-of-identifiers/PureBasic/case-sensitivity-of-identifiers.purebasic new file mode 100644 index 0000000000..4b3641dd76 --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/PureBasic/case-sensitivity-of-identifiers.purebasic @@ -0,0 +1,4 @@ +dog$="Benjamin" +Dog$="Samba" +DOG$="Bernie" +Debug "There is just one dog named "+dog$ diff --git a/Task/Case-sensitivity-of-identifiers/Retro/case-sensitivity-of-identifiers.retro b/Task/Case-sensitivity-of-identifiers/Retro/case-sensitivity-of-identifiers.retro new file mode 100644 index 0000000000..481fd6655e --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/Retro/case-sensitivity-of-identifiers.retro @@ -0,0 +1,5 @@ +: dog ( -$ ) "Benjamin" ; +: Dog ( -$ ) "Samba" ; +: DOG ( -$ ) "Bernie" ; + +DOG Dog dog "The three dogs are named %s, %s, and %s.\n" puts diff --git a/Task/Case-sensitivity-of-identifiers/Run-BASIC/case-sensitivity-of-identifiers.run b/Task/Case-sensitivity-of-identifiers/Run-BASIC/case-sensitivity-of-identifiers.run new file mode 100644 index 0000000000..49f22ae354 --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/Run-BASIC/case-sensitivity-of-identifiers.run @@ -0,0 +1,5 @@ +dog$ = "Benjamin" +doG$ = "Smokey" +Dog$ = "Samba" +DOG$ = "Bernie" +print "The 4 dogs are "; dog$; ", "; doG$; ", "; Dog$; " and "; DOG$; "." diff --git a/Task/Case-sensitivity-of-identifiers/Seed7/case-sensitivity-of-identifiers.seed7 b/Task/Case-sensitivity-of-identifiers/Seed7/case-sensitivity-of-identifiers.seed7 new file mode 100644 index 0000000000..987a15802b --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/Seed7/case-sensitivity-of-identifiers.seed7 @@ -0,0 +1,10 @@ +$ include "seed7_05.s7i"; + +const string: dog is "Benjamin"; +const string: Dog is "Samba"; +const string: DOG is "Bernie"; + +const proc: main is func + begin + writeln("The three dogs are named " <& dog <& ", " <& Dog <& " and " <& DOG <& "."); + end func; diff --git a/Task/Case-sensitivity-of-identifiers/UNIX-Shell/case-sensitivity-of-identifiers.sh b/Task/Case-sensitivity-of-identifiers/UNIX-Shell/case-sensitivity-of-identifiers.sh new file mode 100644 index 0000000000..c52c339492 --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/UNIX-Shell/case-sensitivity-of-identifiers.sh @@ -0,0 +1,4 @@ +dog="Benjamin" +Dog="Samba" +DOG="Bernie" +echo "The three dogs are named $dog, $Dog and $DOG." diff --git a/Task/Case-sensitivity-of-identifiers/ZX-Spectrum-Basic/case-sensitivity-of-identifiers.zx b/Task/Case-sensitivity-of-identifiers/ZX-Spectrum-Basic/case-sensitivity-of-identifiers.zx new file mode 100644 index 0000000000..7d4ba6495d --- /dev/null +++ b/Task/Case-sensitivity-of-identifiers/ZX-Spectrum-Basic/case-sensitivity-of-identifiers.zx @@ -0,0 +1,2 @@ +10 LET D$="Benjamin" +20 PRINT "There is just one dog named ";d$ diff --git a/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-1.mathematica b/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-1.math similarity index 100% rename from Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-1.mathematica rename to Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-1.math diff --git a/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-2.mathematica b/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-2.math similarity index 100% rename from Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-2.mathematica rename to Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-2.math diff --git a/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-3.mathematica b/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-3.math similarity index 100% rename from Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-3.mathematica rename to Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-3.math diff --git a/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-4.mathematica b/Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-4.math similarity index 100% rename from Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-4.mathematica rename to Task/Catmull-Clark-subdivision-surface/Mathematica/catmull-clark-subdivision-surface-4.math diff --git a/Task/Catmull-Clark-subdivision-surface/OCaml/catmull-clark-subdivision-surface-1.ocaml b/Task/Catmull-Clark-subdivision-surface/OCaml/catmull-clark-subdivision-surface-1.ocaml new file mode 100644 index 0000000000..9121c1828f --- /dev/null +++ b/Task/Catmull-Clark-subdivision-surface/OCaml/catmull-clark-subdivision-surface-1.ocaml @@ -0,0 +1,136 @@ +open Dynar + +let add3 (x1, y1, z1) (x2, y2, z2) (x3, y3, z3) = + ( (x1 +. x2 +. x3), + (y1 +. y2 +. y3), + (z1 +. z2 +. z3) ) + +let mul m (x,y,z) = (m *. x, m *. y, m *. z) + +let avg pts = + let n, (x,y,z) = + List.fold_left + (fun (n, (xt,yt,zt)) (xi,yi,zi) -> + succ n, (xt +. xi, yt +. yi, zt +. zi)) + (1, List.hd pts) (List.tl pts) + in + let n = float_of_int n in + (x /. n, y /. n, z /. n) + + +let catmull ~points ~faces = + let da_points = Dynar.of_array points in + let new_faces = Dynar.of_array [| |] in + let push_face face = Dynar.push new_faces face in + let h1 = Hashtbl.create 43 in + let h2 = Hashtbl.create 43 in + let h3 = Hashtbl.create 43 in + let h4 = Hashtbl.create 43 in + let blg = Array.make (Array.length points) 0 in (* how many faces a point belongs to *) + let f_incr p = blg.(p) <- succ blg.(p) in + let eblg = Array.make (Array.length points) 0 in (* how many edges a point belongs to *) + let e_incr p = eblg.(p) <- succ eblg.(p) in + let edge a b = (min a b, max a b) in (* suitable for hash-table keys *) + let mid_edge p1 p2 = + let x1, y1, z1 = points.(p1) + and x2, y2, z2 = points.(p2) in + ( (x1 +. x2) /. 2.0, + (y1 +. y2) /. 2.0, + (z1 +. z2) /. 2.0 ) + in + let mid_face p1 p2 p3 p4 = + let x1, y1, z1 = points.(p1) + and x2, y2, z2 = points.(p2) + and x3, y3, z3 = points.(p3) + and x4, y4, z4 = points.(p4) in + ( (x1 +. x2 +. x3 +. x4) /. 4.0, + (y1 +. y2 +. y3 +. y4) /. 4.0, + (z1 +. z2 +. z3 +. z4) /. 4.0 ) + in + Array.iteri (fun i (a,b,c,d) -> + f_incr a; f_incr b; f_incr c; f_incr d; + + let face_point = mid_face a b c d in + let face_pi = pushi da_points face_point in + Hashtbl.add h3 a face_point; + Hashtbl.add h3 b face_point; + Hashtbl.add h3 c face_point; + Hashtbl.add h3 d face_point; + + let process_edge a b = + let ab = edge a b in + if not(Hashtbl.mem h1 ab) + then begin + let mid_ab = mid_edge a b in + let index = pushi da_points mid_ab in + Hashtbl.add h1 ab (index, mid_ab, [face_point]); + Hashtbl.add h2 a mid_ab; + Hashtbl.add h2 b mid_ab; + Hashtbl.add h4 mid_ab 1; + (index) + end + else begin + let index, mid_ab, fpl = Hashtbl.find h1 ab in + Hashtbl.replace h1 ab (index, mid_ab, face_point::fpl); + Hashtbl.add h4 mid_ab (succ(Hashtbl.find h4 mid_ab)); + (index) + end + in + let mid_ab = process_edge a b + and mid_bc = process_edge b c + and mid_cd = process_edge c d + and mid_da = process_edge d a in + + push_face (a, mid_ab, face_pi, mid_da); + push_face (b, mid_bc, face_pi, mid_ab); + push_face (c, mid_cd, face_pi, mid_bc); + push_face (d, mid_da, face_pi, mid_cd); + ) faces; + + Hashtbl.iter (fun (a,b) (index, mid_ab, fpl) -> + e_incr a; e_incr b; + if List.length fpl = 2 then + da_points.ar.(index) <- avg (mid_ab::fpl) + ) h1; + + Array.iteri (fun i old_vertex -> + let n = blg.(i) + and e_n = eblg.(i) in + (* if the vertex doesn't belongs to as many faces than edges + this means that this is a hole *) + if n = e_n then + begin + let avg_face_points = + let face_point_list = Hashtbl.find_all h3 i in + (avg face_point_list) + in + let avg_mid_edges = + let mid_edge_list = Hashtbl.find_all h2 i in + (avg mid_edge_list) + in + let n = float_of_int n in + let m1 = (n -. 3.0) /. n + and m2 = 1.0 /. n + and m3 = 2.0 /. n in + da_points.ar.(i) <- + add3 (mul m1 old_vertex) + (mul m2 avg_face_points) + (mul m3 avg_mid_edges) + end + else begin + let mid_edge_list = Hashtbl.find_all h2 i in + let mid_edge_list = + (* only average mid-edges near the hole *) + List.fold_left (fun acc mid_edge -> + match Hashtbl.find h4 mid_edge with + | 1 -> mid_edge::acc + | _ -> acc + ) [] mid_edge_list + in + da_points.ar.(i) <- avg (old_vertex :: mid_edge_list) + end + ) points; + + (Dynar.to_array da_points, + Dynar.to_array new_faces) +;; diff --git a/Task/Catmull-Clark-subdivision-surface/OCaml/catmull-clark-subdivision-surface-2.ocaml b/Task/Catmull-Clark-subdivision-surface/OCaml/catmull-clark-subdivision-surface-2.ocaml new file mode 100644 index 0000000000..8aab568789 --- /dev/null +++ b/Task/Catmull-Clark-subdivision-surface/OCaml/catmull-clark-subdivision-surface-2.ocaml @@ -0,0 +1,84 @@ +type point = { x: float; y : float; z : float } +let add a b = { x = a.x+.b.x; y = a.y+.b.y; z = a.z+.b.z } +let mul a k = { x = a.x*.k; y = a.y*.k; z= a.z*.k } +let div p k = mul p (1.0/.k) +let fsgn x y = if x < y then -1 else if x > y then 1 else 0 +let cmp a b = if a.x=b.x then if a.y=b.y then fsgn b.z a.z else fsgn b.y a.y else fsgn b.x a.x + +type face = Face of point list +type edge = Edge of point*point +let ecmp (Edge (p1,p2)) (Edge (p3,p4)) = let sgn = cmp p1 p3 in if sgn = 0 then cmp p2 p4 else sgn + +let make_edge a b = if cmp a b < 0 then Edge (b,a) else Edge (a,b) +let make_face a b c d = Face [a;b;c;d] + +let centroid plist = div (List.fold_left add {x=0.0;y=0.0;z=0.0} plist) (float (List.length plist)) +let mid_edge (Edge (p1,p2)) = div (add p1 p2) 2.0 +let face_point (Face pl) = centroid pl +let point_in_face p (Face pl) = List.mem p pl +let point_in_edge p (Edge (p1,p2)) = (p = p1 || p = p2) +let edge_in_face (Edge (p1,p2)) (Face pl) = (List.mem p1 pl && List.mem p2 pl) + +let border_edge faces e = + List.length (List.filter (edge_in_face e) faces) < 2 + +let edge_point faces e = + if border_edge faces e then mid_edge e else + let adjacent = List.filter (edge_in_face e) faces in + let fps = List.map face_point adjacent in + centroid [mid_edge e; centroid fps] + +let mod_vertex faces edges p = + let v_edges = List.filter (point_in_edge p) edges in + let v_faces = List.filter (point_in_face p) faces in + let n = List.length v_faces in + let is_border = n != (List.length v_edges) in + if is_border then + let border_mids = List.map mid_edge (List.filter (border_edge faces) v_edges) in + (* description ambiguity: average (border+p) or average(average(border),p) ?? *) + centroid (p :: border_mids) + else + let avg_face = centroid (List.map face_point v_faces) in + let avg_mid = centroid (List.map mid_edge v_edges) in + div (add (add (mul p (float(n-3))) avg_face) (mul avg_mid 2.0)) (float n) + +let iter_edges f (Face pl) = + let rec next = function + | [] -> () + | a :: [] -> f a (List.hd pl) + | a :: b :: c -> f a b; next (b::c) in + next pl;; + +let catmull_clark faces = + let module EdgeSet = Set.Make(struct type t = edge let compare = ecmp end) in + let eset = ref EdgeSet.empty in + let add_edge a b = eset := EdgeSet.add (make_edge a b) !eset in + let edges = (List.iter (iter_edges add_edge) faces; EdgeSet.elements !eset) in + let new_faces = ref [] in + let mod_face ((Face pl) as face) = + let fp = face_point face in + let ep = ref [] in ( + iter_edges (fun a b -> ep := (edge_point faces (make_edge a b)):: !ep) face; + let e_tl = List.hd (List.rev !ep) in + let v' = List.map (mod_vertex faces edges) pl in + let rec add_facet e vl el = (match (vl,el) with + | (h1::t1),(h2::t2) -> + new_faces := (make_face e h1 h2 fp) :: !new_faces; + add_facet h2 t1 t2 + | ([],[]) -> () + | _ -> failwith "vertex/edge mismatch") in + add_facet e_tl v' !ep) in + (List.iter mod_face faces; !new_faces) + +let show_faces fl = + let pr_point p = Printf.printf " (%.4f, %.4f, %.4f)" p.x p.y p.z in + let pr_face (Face(pl)) = print_string "Face:"; List.iter pr_point pl; print_string "\n" in + (print_string "surface {\n"; List.iter pr_face fl; print_string "}\n") + +let c p q r = let s i = if i = 0 then -1.0 else 1.0 in { x = s p; y = s q; z = s r } ;; +let cube = [ + Face [c 0 0 0; c 0 0 1; c 0 1 1; c 0 1 0]; Face [c 1 0 0; c 1 0 1; c 1 1 1; c 1 1 0]; + Face [c 0 0 0; c 1 0 0; c 1 0 1; c 0 0 1]; Face [c 0 1 0; c 1 1 0; c 1 1 1; c 0 1 1]; + Face [c 0 0 0; c 0 1 0; c 1 1 0; c 1 0 0]; Face [c 0 0 1; c 0 1 1; c 1 1 1; c 1 0 1] ] in +show_faces cube; +show_faces (catmull_clark cube) diff --git a/Task/Character-codes/BASIC/character-codes-1.bas b/Task/Character-codes/BASIC/character-codes-1.basic similarity index 100% rename from Task/Character-codes/BASIC/character-codes-1.bas rename to Task/Character-codes/BASIC/character-codes-1.basic diff --git a/Task/Character-codes/BASIC/character-codes-2.bas b/Task/Character-codes/BASIC/character-codes-2.basic similarity index 100% rename from Task/Character-codes/BASIC/character-codes-2.bas rename to Task/Character-codes/BASIC/character-codes-2.basic diff --git a/Task/Character-codes/CoffeeScript/character-codes.coffee b/Task/Character-codes/CoffeeScript/character-codes.coffeescript similarity index 100% rename from Task/Character-codes/CoffeeScript/character-codes.coffee rename to Task/Character-codes/CoffeeScript/character-codes.coffeescript diff --git a/Task/Character-codes/Golfscript/character-codes-1.golf b/Task/Character-codes/Golfscript/character-codes-1.golfscript similarity index 100% rename from Task/Character-codes/Golfscript/character-codes-1.golf rename to Task/Character-codes/Golfscript/character-codes-1.golfscript diff --git a/Task/Character-codes/Golfscript/character-codes-2.golf b/Task/Character-codes/Golfscript/character-codes-2.golfscript similarity index 100% rename from Task/Character-codes/Golfscript/character-codes-2.golf rename to Task/Character-codes/Golfscript/character-codes-2.golfscript diff --git a/Task/Character-codes/Mathematica/character-codes.mathematica b/Task/Character-codes/Mathematica/character-codes.math similarity index 100% rename from Task/Character-codes/Mathematica/character-codes.mathematica rename to Task/Character-codes/Mathematica/character-codes.math diff --git a/Task/Character-codes/NetRexx/character-codes.netrexx b/Task/Character-codes/NetRexx/character-codes.netrexx new file mode 100644 index 0000000000..6b637b7c77 --- /dev/null +++ b/Task/Character-codes/NetRexx/character-codes.netrexx @@ -0,0 +1,23 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +runSample(arg) +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method runSample(arg) private static + -- create some sample data: character, hex and unicode + samp = ' ' || 'a'.sequence('e') || '$' || '\xa2'.sequence('\xa5') || '\u20a0'.sequence('\u20b5') + -- use the C2D C2X D2C and X2C built-in functions + say "'"samp"'" + say ' | Chr C2D C2X D2C X2C' + say '---+ --- ------ ---- --- ---' + loop ci = 1 to samp.length + cc = samp.substr(ci, 1) + cd = cc.c2d -- char to decimal + cx = cc.c2x -- char to hexadecimal + dc = cd.d2c -- decimal to char + xc = cx.x2c -- hexadecimal to char + say ci.right(3)"| '"cc"'" cd.right(6) cx.right(4, 0) "'"dc"' '"xc"'" + end ci + return diff --git a/Task/Character-codes/OCaml/character-codes-1.ocaml b/Task/Character-codes/OCaml/character-codes-1.ocaml new file mode 100644 index 0000000000..11a37a4620 --- /dev/null +++ b/Task/Character-codes/OCaml/character-codes-1.ocaml @@ -0,0 +1,2 @@ +Printf.printf "%d\n" (int_of_char 'a'); (* prints "97" *) +Printf.printf "%c\n" (char_of_int 97); (* prints "a" *) diff --git a/Task/Character-codes/OCaml/character-codes-2.ocaml b/Task/Character-codes/OCaml/character-codes-2.ocaml new file mode 100644 index 0000000000..50ac9c8177 --- /dev/null +++ b/Task/Character-codes/OCaml/character-codes-2.ocaml @@ -0,0 +1,4 @@ +# Char.code ;; +- : char -> int = +# Char.chr;; +- : int -> char = diff --git a/Task/Character-codes/Oberon-2/character-codes.oberon-2 b/Task/Character-codes/Oberon-2/character-codes.oberon-2 new file mode 100644 index 0000000000..32d4257f49 --- /dev/null +++ b/Task/Character-codes/Oberon-2/character-codes.oberon-2 @@ -0,0 +1,11 @@ +MODULE Ascii; +IMPORT Out; +VAR + c: CHAR; + d: INTEGER; +BEGIN + c := CHR(97); + d := ORD("a"); + Out.Int(d,3);Out.Ln; + Out.Char(c);Out.Ln +END Ascii. diff --git a/Task/Character-codes/Objeck/character-codes.objeck b/Task/Character-codes/Objeck/character-codes.objeck new file mode 100644 index 0000000000..63944bebf4 --- /dev/null +++ b/Task/Character-codes/Objeck/character-codes.objeck @@ -0,0 +1,2 @@ +'a'->As(Int)->PrintLine(); +97->As(Char)->PrintLine(); diff --git a/Task/Character-codes/OpenEdge-Progress/character-codes.openedge b/Task/Character-codes/OpenEdge-Progress/character-codes.openedge new file mode 100644 index 0000000000..f945efa950 --- /dev/null +++ b/Task/Character-codes/OpenEdge-Progress/character-codes.openedge @@ -0,0 +1,4 @@ +MESSAGE + CHR(97) SKIP + ASC("a") +VIEW-AS ALERT-BOX. diff --git a/Task/Character-codes/Oz/character-codes.oz b/Task/Character-codes/Oz/character-codes.oz new file mode 100644 index 0000000000..109d175d55 --- /dev/null +++ b/Task/Character-codes/Oz/character-codes.oz @@ -0,0 +1,2 @@ +{System.show &a} %% prints "97" +{System.showInfo [97]} %% prints "a" diff --git a/Task/Character-codes/PARI-GP/character-codes.pari b/Task/Character-codes/PARI-GP/character-codes.pari new file mode 100644 index 0000000000..08c5924291 --- /dev/null +++ b/Task/Character-codes/PARI-GP/character-codes.pari @@ -0,0 +1,2 @@ +print(Vecsmall("a")[1]); +print(Strchr([72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33])) diff --git a/Task/Character-codes/PL-I/character-codes.pli b/Task/Character-codes/PL-I/character-codes.pli new file mode 100644 index 0000000000..8d266409d3 --- /dev/null +++ b/Task/Character-codes/PL-I/character-codes.pli @@ -0,0 +1,5 @@ +declare 1 u union, + 2 c character (1), + 2 i fixed binary (8) unsigned; +c = 'a'; put skip list (i); /* prints 97 */ +i = 97; put skip list (c); /* prints 'a' */ diff --git a/Task/Character-codes/Pascal/character-codes.pascal b/Task/Character-codes/Pascal/character-codes.pascal new file mode 100644 index 0000000000..cc1b2a6052 --- /dev/null +++ b/Task/Character-codes/Pascal/character-codes.pascal @@ -0,0 +1,2 @@ +writeln(ord('a')); +writeln(chr(97)); diff --git a/Task/Character-codes/Perl-6/character-codes.pl6 b/Task/Character-codes/Perl-6/character-codes.pl6 new file mode 100644 index 0000000000..9bae28b790 --- /dev/null +++ b/Task/Character-codes/Perl-6/character-codes.pl6 @@ -0,0 +1,2 @@ +say ord('𪚥').fmt('0x%04x'); +say chr(0x2a6a5); diff --git a/Task/Character-codes/PowerShell/character-codes-1.psh b/Task/Character-codes/PowerShell/character-codes-1.psh new file mode 100644 index 0000000000..ef33e7b589 --- /dev/null +++ b/Task/Character-codes/PowerShell/character-codes-1.psh @@ -0,0 +1 @@ +$char = [char] 'a' diff --git a/Task/Character-codes/PowerShell/character-codes-2.psh b/Task/Character-codes/PowerShell/character-codes-2.psh new file mode 100644 index 0000000000..0fa7235522 --- /dev/null +++ b/Task/Character-codes/PowerShell/character-codes-2.psh @@ -0,0 +1 @@ +$charcode = [int] $char # => 97 diff --git a/Task/Character-codes/PowerShell/character-codes-3.psh b/Task/Character-codes/PowerShell/character-codes-3.psh new file mode 100644 index 0000000000..3182e3dde5 --- /dev/null +++ b/Task/Character-codes/PowerShell/character-codes-3.psh @@ -0,0 +1 @@ +[int] [char] '☺' # => 9786 diff --git a/Task/Character-codes/PowerShell/character-codes-4.psh b/Task/Character-codes/PowerShell/character-codes-4.psh new file mode 100644 index 0000000000..a707209b12 --- /dev/null +++ b/Task/Character-codes/PowerShell/character-codes-4.psh @@ -0,0 +1,2 @@ +[char] 97 # a +[char] 9786 # ☺ diff --git a/Task/Character-codes/PureBasic/character-codes-1.purebasic b/Task/Character-codes/PureBasic/character-codes-1.purebasic new file mode 100644 index 0000000000..93e87b8bbd --- /dev/null +++ b/Task/Character-codes/PureBasic/character-codes-1.purebasic @@ -0,0 +1,11 @@ +If OpenConsole() + ;Results are the same when compiled for Ascii or Unicode + charCode.c = 97 + Char.s = "a" + PrintN(Chr(charCode)) ;prints a + PrintN(Str(Asc(Char))) ;prints 97 + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + CloseConsole() +EndIf diff --git a/Task/Character-codes/PureBasic/character-codes-2.purebasic b/Task/Character-codes/PureBasic/character-codes-2.purebasic new file mode 100644 index 0000000000..1c5dc7dcb8 --- /dev/null +++ b/Task/Character-codes/PureBasic/character-codes-2.purebasic @@ -0,0 +1,11 @@ +If OpenConsole() + ;UTF-8 encoding compiled for Unicode (UCS-2) + charCode.c = 960 + Char.s = "π" + PrintN(Chr(charCode)) ;prints π + PrintN(Str(Asc(Char))) ;prints 960 + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + CloseConsole() +EndIf diff --git a/Task/Character-codes/Retro/character-codes.retro b/Task/Character-codes/Retro/character-codes.retro new file mode 100644 index 0000000000..2272064c6f --- /dev/null +++ b/Task/Character-codes/Retro/character-codes.retro @@ -0,0 +1 @@ +'c putc diff --git a/Task/Character-codes/Run-BASIC/character-codes.run b/Task/Character-codes/Run-BASIC/character-codes.run new file mode 100644 index 0000000000..1689082f31 --- /dev/null +++ b/Task/Character-codes/Run-BASIC/character-codes.run @@ -0,0 +1,2 @@ +print chr$(97) 'prints a +print asc("a") 'prints 97 diff --git a/Task/Character-codes/SNOBOL4/character-codes.sno b/Task/Character-codes/SNOBOL4/character-codes.sno new file mode 100644 index 0000000000..8722a28aae --- /dev/null +++ b/Task/Character-codes/SNOBOL4/character-codes.sno @@ -0,0 +1,14 @@ + define('chr(n)') :(chr_end) +chr &alphabet tab(n) len(1) . chr :s(return)f(freturn) +chr_end + + define('asc(str)c') :(asc_end) +asc str len(1) . c + &alphabet break(c) @asc :s(return)f(freturn) +asc_end + +* # Test and display + output = char(65) ;* Built-in + output = chr(65) + output = asc('A') +end diff --git a/Task/Character-codes/Seed7/character-codes.seed7 b/Task/Character-codes/Seed7/character-codes.seed7 new file mode 100644 index 0000000000..cc1b2a6052 --- /dev/null +++ b/Task/Character-codes/Seed7/character-codes.seed7 @@ -0,0 +1,2 @@ +writeln(ord('a')); +writeln(chr(97)); diff --git a/Task/Character-codes/Slate/character-codes.slate b/Task/Character-codes/Slate/character-codes.slate new file mode 100644 index 0000000000..73ec459853 --- /dev/null +++ b/Task/Character-codes/Slate/character-codes.slate @@ -0,0 +1,2 @@ +$a code. +97 as: String Character. diff --git a/Task/Character-codes/Standard-ML/character-codes.ml b/Task/Character-codes/Standard-ML/character-codes.ml new file mode 100644 index 0000000000..4390eca135 --- /dev/null +++ b/Task/Character-codes/Standard-ML/character-codes.ml @@ -0,0 +1,2 @@ +print (Int.toString (ord #"a") ^ "\n"); (* prints "97" *) +print (Char.toString (chr 97) ^ "\n"); (* prints "a" *) diff --git a/Task/Character-codes/TI-83-BASIC/character-codes.ti-83 b/Task/Character-codes/TI-83-BASIC/character-codes.ti-83 new file mode 100644 index 0000000000..fc6d53faf5 --- /dev/null +++ b/Task/Character-codes/TI-83-BASIC/character-codes.ti-83 @@ -0,0 +1,4 @@ +"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789→Str1 +Disp inString(Str1,"A +Input "CODE? ",A +Disp sub(Str1,A,1 diff --git a/Task/Character-codes/TI-89-BASIC/character-codes.ti-89 b/Task/Character-codes/TI-89-BASIC/character-codes.ti-89 new file mode 100644 index 0000000000..c78b6a337e --- /dev/null +++ b/Task/Character-codes/TI-89-BASIC/character-codes.ti-89 @@ -0,0 +1,21 @@ +Prgm + Local k, s + ClrIO + Loop + Disp "Press a key, or ON to exit." + getKey() © clear buffer + 0 → k : While k = 0 : getKey() → k : EndWhile + ClrIO + If k ≥ 256 Then + Disp "Not a character." + Disp "Code: " & string(k) + Else + + char(k) → s © + © char() and ord() are inverses. © + Disp "Character: " & s © + Disp "Code: " & string(ord(s)) © + + EndIf + EndLoop +EndPrgm diff --git a/Task/Character-codes/TUSCRIPT/character-codes.tuscript b/Task/Character-codes/TUSCRIPT/character-codes.tuscript new file mode 100644 index 0000000000..fc93b2f119 --- /dev/null +++ b/Task/Character-codes/TUSCRIPT/character-codes.tuscript @@ -0,0 +1,3 @@ +$$ MODE TUSCRIPT +SET character ="a", code=DECODE (character,byte) +PRINT character,"=",code diff --git a/Task/Character-codes/Trith/character-codes-1.trith b/Task/Character-codes/Trith/character-codes-1.trith new file mode 100644 index 0000000000..8d161fec6a --- /dev/null +++ b/Task/Character-codes/Trith/character-codes-1.trith @@ -0,0 +1,2 @@ +"a" ord print +97 chr print diff --git a/Task/Character-codes/Trith/character-codes-2.trith b/Task/Character-codes/Trith/character-codes-2.trith new file mode 100644 index 0000000000..6d8aeda07c --- /dev/null +++ b/Task/Character-codes/Trith/character-codes-2.trith @@ -0,0 +1,2 @@ +"π" ord print +960 chr print diff --git a/Task/Character-codes/Ursala/character-codes.ursala b/Task/Character-codes/Ursala/character-codes.ursala new file mode 100644 index 0000000000..14a1327433 --- /dev/null +++ b/Task/Character-codes/Ursala/character-codes.ursala @@ -0,0 +1,9 @@ +#import std +#import nat + +chr = -: num characters +asc = -:@rlXS num characters + +#cast %cnX + +test = (chr97,asc`a) diff --git a/Task/Character-codes/Visual-Basic-.NET/character-codes.visual b/Task/Character-codes/Visual-Basic-.NET/character-codes.visual new file mode 100644 index 0000000000..c8077a32eb --- /dev/null +++ b/Task/Character-codes/Visual-Basic-.NET/character-codes.visual @@ -0,0 +1,2 @@ +Console.WriteLine(Chr(97)) 'Prints a +Console.WriteLine(Asc("a")) 'Prints 97 diff --git a/Task/Character-codes/XPL0/character-codes.xpl0 b/Task/Character-codes/XPL0/character-codes.xpl0 new file mode 100644 index 0000000000..948826ac0a --- /dev/null +++ b/Task/Character-codes/XPL0/character-codes.xpl0 @@ -0,0 +1,2 @@ +IntOut(0, ^a); \(Integer Out) displays "97" on the console (device 0) +ChOut(0, 97); \(Character Out) displays "a" on the console (device 0) diff --git a/Task/Character-matching/BASIC/character-matching.bas b/Task/Character-matching/BASIC/character-matching.basic similarity index 100% rename from Task/Character-matching/BASIC/character-matching.bas rename to Task/Character-matching/BASIC/character-matching.basic diff --git a/Task/Character-matching/CoffeeScript/character-matching.coffee b/Task/Character-matching/CoffeeScript/character-matching.coffeescript similarity index 100% rename from Task/Character-matching/CoffeeScript/character-matching.coffee rename to Task/Character-matching/CoffeeScript/character-matching.coffeescript diff --git a/Task/Character-matching/Mathematica/character-matching.mathematica b/Task/Character-matching/Mathematica/character-matching.math similarity index 100% rename from Task/Character-matching/Mathematica/character-matching.mathematica rename to Task/Character-matching/Mathematica/character-matching.math diff --git a/Task/Character-matching/NetRexx/character-matching.netrexx b/Task/Character-matching/NetRexx/character-matching.netrexx new file mode 100644 index 0000000000..baf4cf3213 --- /dev/null +++ b/Task/Character-matching/NetRexx/character-matching.netrexx @@ -0,0 +1,48 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols + +lipsum = '' +x_ = 0 +x_ = x_ + 1; lipsum[0] = x_; lipsum[x_] = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' +x_ = x_ + 1; lipsum[0] = x_; lipsum[x_] = lipsum[1].reverse + +srch = '' +srch[1] = 'Lorem ipsum dolor sit amet' +srch[2] = 'consectetur adipisicing elit' +srch[3] = 'dolore magna aliqua.' + +loop j_ = 1 to lipsum[0] + x1 = lipsum[j_].pos(srch[1]) + x2 = lipsum[j_].pos(srch[2]) + x3 = lipsum[j_].lastpos(srch[3]) + + report(x1 = 1, lipsum[j_], srch[1], 'Test string starts with search string:', 'Test string does not start with search string:') + report(x2 > 0, lipsum[j_], srch[2], 'Search string located in test string at position:' x2, 'Search string not found within test string:') + report(x3 \= srch[3].length, lipsum[j_], srch[3], 'Test string ends with search string:', 'Test string does not start with search string:') + end j_ + +many = '' +x_ = 0 +x_ = x_ + 1; many[0] = x_; many[x_] = 'How many times does "many times" occur in this string?' +x_ = x_ + 1; many[0] = x_; many[x_] = 'How often does "many times" occur in this string?' +x_ = x_ + 1; many[0] = x_; many[x_] = 'How often does it occur in this string?' +srch[4] = 'many times' + +loop j_ = 1 to many[0] + o_ = 0 + k_ = 0 + loop label dups until o_ = 0 + o_ = many[j_].pos(srch[4], o_ + 1) + if o_ \= 0 then k_ = k_ + 1 + end dups + report(k_ > 0, many[j_], srch[4], 'Number of times search string occurs:' k_, 'Search string not found') + end j_ + +method report(state = boolean, ts, ss, testSuccess, testFailure) public static + if state then say testSuccess + else say testFailure + say ' Test string:' ts + say ' Search string:' ss + say + + return diff --git a/Task/Character-matching/OCaml/character-matching-1.ocaml b/Task/Character-matching/OCaml/character-matching-1.ocaml new file mode 100644 index 0000000000..6d147a8d52 --- /dev/null +++ b/Task/Character-matching/OCaml/character-matching-1.ocaml @@ -0,0 +1,6 @@ +let match1 s1 s2 = + let len1 = String.length s1 + and len2 = String.length s2 in + if len1 < len2 then false else + let sub = String.sub s1 0 len2 in + (sub = s2) diff --git a/Task/Character-matching/OCaml/character-matching-2.ocaml b/Task/Character-matching/OCaml/character-matching-2.ocaml new file mode 100644 index 0000000000..66281e2ace --- /dev/null +++ b/Task/Character-matching/OCaml/character-matching-2.ocaml @@ -0,0 +1,10 @@ +let match2 s1 s2 = + let len1 = String.length s1 + and len2 = String.length s2 in + if len1 < len2 then false else + let rec aux i = + if i < 0 then false else + let sub = String.sub s1 i len2 in + if (sub = s2) then true else aux (pred i) + in + aux (len1 - len2) diff --git a/Task/Character-matching/OCaml/character-matching-3.ocaml b/Task/Character-matching/OCaml/character-matching-3.ocaml new file mode 100644 index 0000000000..a88af24c0b --- /dev/null +++ b/Task/Character-matching/OCaml/character-matching-3.ocaml @@ -0,0 +1,6 @@ +let match3 s1 s2 = + let len1 = String.length s1 + and len2 = String.length s2 in + if len1 < len2 then false else + let sub = String.sub s1 (len1 - len2) len2 in + (sub = s2) diff --git a/Task/Character-matching/OCaml/character-matching-4.ocaml b/Task/Character-matching/OCaml/character-matching-4.ocaml new file mode 100644 index 0000000000..1e3f035507 --- /dev/null +++ b/Task/Character-matching/OCaml/character-matching-4.ocaml @@ -0,0 +1,10 @@ +let match2_loc s1 s2 = + let len1 = String.length s1 + and len2 = String.length s2 in + if len1 < len2 then (false, -1) else + let rec aux i = + if i < 0 then (false, -1) else + let sub = String.sub s1 i len2 in + if (sub = s2) then (true, i) else aux (pred i) + in + aux (len1 - len2) diff --git a/Task/Character-matching/OCaml/character-matching-5.ocaml b/Task/Character-matching/OCaml/character-matching-5.ocaml new file mode 100644 index 0000000000..167778804b --- /dev/null +++ b/Task/Character-matching/OCaml/character-matching-5.ocaml @@ -0,0 +1,12 @@ +let match2_num s1 s2 = + let len1 = String.length s1 + and len2 = String.length s2 in + if len1 < len2 then (false, 0) else + let rec aux i n = + if i < 0 then (n <> 0, n) else + let sub = String.sub s1 i len2 in + if (sub = s2) + then aux (pred i) (succ n) + else aux (pred i) (n) + in + aux (len1 - len2) 0 diff --git a/Task/Character-matching/Objeck/character-matching.objeck b/Task/Character-matching/Objeck/character-matching.objeck new file mode 100644 index 0000000000..cac33d3ebb --- /dev/null +++ b/Task/Character-matching/Objeck/character-matching.objeck @@ -0,0 +1,13 @@ +bundle Default { + class Matching { + function : Main(args : System.String[]) ~ Nil { + "abcd"->StartsWith("ab")->PrintLine(); # returns true + "abcd"->EndsWith("zn")->PrintLine(); # returns false + ("abab"->Find("bb") <> -1)->PrintLine(); # returns false + ("abab"->Find("ab") <> -1)->PrintLine(); # returns true + loc := "abab"->Find("bb"); # returns -1 + loc := "abab"->Find("ab"); # returns 0 + loc := "abab"->Find("ab", loc + 1); # returns 2 + } + } +} diff --git a/Task/Character-matching/Objective-C/character-matching.m b/Task/Character-matching/Objective-C/character-matching.m new file mode 100644 index 0000000000..fc32bdc35d --- /dev/null +++ b/Task/Character-matching/Objective-C/character-matching.m @@ -0,0 +1,5 @@ +[@"abcd" hasPrefix:@"ab"] //returns true +[@"abcd" hasSuffix:@"zn"] //returns false +int loc = [@"abab" rangeOfString:@"bb"].location //returns -1 +loc = [@"abab" rangeOfString:@"ab"].location //returns 0 +loc = [@"abab" rangeOfString:@"ab" options:0 range:NSMakeRange(loc+1, [@"abab" length]-(loc+1))].location //returns 2 diff --git a/Task/Character-matching/OxygenBasic/character-matching.oxy b/Task/Character-matching/OxygenBasic/character-matching.oxy new file mode 100644 index 0000000000..9acc56c353 --- /dev/null +++ b/Task/Character-matching/OxygenBasic/character-matching.oxy @@ -0,0 +1,35 @@ +string s="sdfkjhgsdfkdfgkbopefioqwurti487sdfkrglkjfs9wrtgjglsdfkdkjcnmmb.,msfjflkjsdfk" + +string f="sdfk" + +string cr=chr(13)+chr(10),tab=chr(9) + +string pr="FIND STRING LOCATIONS" cr cr + +sys a=0, b=1, count=0, ls=len(s), lf=len(f) + +do + a=instr b,s,f + if a=0 then exit do + count++ + if a=1 then pr+="Begins with keyword" cr + pr+=count tab a cr + if a=ls-lf+1 then pr+="Ends with keyword at " a cr + b=a+1 +end do + +pr+=cr "Total matches: " count cr + +print pr + +'FIND STRING LOCATIONS +' +'Begins with keyword +'1 1 +'2 8 +'3 32 +'4 51 +'5 73 +'Ends with keyword at 73 +' +'Total matches: 5 diff --git a/Task/Character-matching/PARI-GP/character-matching.pari b/Task/Character-matching/PARI-GP/character-matching.pari new file mode 100644 index 0000000000..1293de73dc --- /dev/null +++ b/Task/Character-matching/PARI-GP/character-matching.pari @@ -0,0 +1,27 @@ +startsWith(string, prefix)={ + string=Vec(string); + prefix=Vec(prefix); + if(#prefix > #string, return(0)); + for(i=1,#prefix,if(prefix[i]!=string[i], return(0))); + 1 +}; +contains(string, inner)={ + my(good); + string=Vec(string); + inner=Vec(inner); + for(i=0,#string-#inner, + good=1; + for(j=1,#inner, + if(inner[j]!=string[i+j], good=0; break) + ); + if(good, return(i+1)) + ); + 0 +}; +endsWith(string, suffix)={ + string=Vec(string); + suffix=Vec(suffix); + if(#suffix > #string, return(0)); + for(i=1,#suffix,if(prefix[i]!=string[i+#string-#suffix], return(0))); + 1 +}; diff --git a/Task/Character-matching/PL-I/character-matching-1.pli b/Task/Character-matching/PL-I/character-matching-1.pli new file mode 100644 index 0000000000..9d42540995 --- /dev/null +++ b/Task/Character-matching/PL-I/character-matching-1.pli @@ -0,0 +1,11 @@ +/* Let s be one string, t be the other that might exist within s. */ + /* 8-1-2011 */ +k = index(s, t); +if k = 0 then put skip edit (t, ' is nowhere in sight') (a); +else if k = 1 then + put skip edit (t, ' starts at the beginning of ', s) (a); +else if k+length(t)-1 = length(s) then + put skip edit (t, ' is at the end of ', s) (a); +else put skip edit (t, ' is within ', s) (a); + +if k > 0 then put skip edit (t, ' starts at position ', k) (a); diff --git a/Task/Character-matching/PL-I/character-matching-2.pli b/Task/Character-matching/PL-I/character-matching-2.pli new file mode 100644 index 0000000000..afdbb2be13 --- /dev/null +++ b/Task/Character-matching/PL-I/character-matching-2.pli @@ -0,0 +1,20 @@ +/* Handle multiple occurrences. */ + n = 1; + do forever; + k = index(s, t, n); + if k = 0 then + do; + if n = 1 then put skip list (t, ' is nowhere in sight'); + stop; + end; + else if k = 1 then + put skip edit ('<', t, '> starts at the beginning of ', s) (a); + else if k+length(t)-1 = length(s) then + put skip edit ('<', t, '> is at the end of ', s) (a); + else put skip edit ('<', t, '> is within ', s) (a); + n = k + length(t); + + if k > 0 then + put skip edit ('<', t, '> starts at position ', trim(k)) (a); + else stop; + end; diff --git a/Task/Character-matching/Perl-6/character-matching.pl6 b/Task/Character-matching/Perl-6/character-matching.pl6 new file mode 100644 index 0000000000..c3cf31ad2d --- /dev/null +++ b/Task/Character-matching/Perl-6/character-matching.pl6 @@ -0,0 +1,34 @@ +my @subs = ( + # Regex-based: + sub R_contains ( Str $_, Str $s2 ) { ? m/ $s2 / }, + sub R_starts_with ( Str $_, Str $s2 ) { ? m/ ^ $s2 / }, + sub R_ends_with ( Str $_, Str $s2 ) { ? m/ $s2 $ / }, + + # Index-based: + sub I_contains ( Str $_, Str $s2 ) { .index( $s2)\ .defined }, + sub I_starts_with ( Str $_, Str $s2 ) { my $m = .index( $s2); $m.defined and $m == 0 }, + sub I_ends_with ( Str $_, Str $s2 ) { my $m = .rindex($s2); $m.defined and $m == .chars - $s2.chars }, + + # Substr-based: + sub S_starts_with ( Str $_, Str $s2 ) { .substr(0, $s2.chars) eq $s2 }, + sub S_ends_with ( Str $_, Str $s2 ) { .substr( -$s2.chars) eq $s2 }, + + # Optional tasks: + sub R_find ( Str $_, Str $s2 ) { $/.from if /$s2/ }, + sub R_find_all ( Str $_, Str $s2 ) { + my @p = .match: /$s2/, :g; + @p».from if @p; + }, +); + +my $str1 = 'abcbcbcd'; +my @str2s = < ab bc cd zz >; + +say "'$str1' vs:".fmt('%15s '), @str2s.fmt('%-15s'); +for [1, 4, 6], [2, 5, 7], [0, 3], [8, 9] { + say; + for @subs[.list] -> $sub { + say "{$sub.name}:".fmt('%15s '), + @str2s.map({ ~$sub.($str1, $_) }).fmt('%-15s'); + } +} diff --git a/Task/Character-matching/PowerShell/character-matching.psh b/Task/Character-matching/PowerShell/character-matching.psh new file mode 100644 index 0000000000..fd2cff175f --- /dev/null +++ b/Task/Character-matching/PowerShell/character-matching.psh @@ -0,0 +1,5 @@ +"spicywiener".StartsWith("spicy") +"spicywiener".Contains("icy") +"spicywiener".EndsWith("wiener") +"spicywiener".IndexOf("icy") +[regex]::Matches("spicywiener", "i").count diff --git a/Task/Character-matching/PureBasic/character-matching-1.purebasic b/Task/Character-matching/PureBasic/character-matching-1.purebasic new file mode 100644 index 0000000000..5eb3cceb96 --- /dev/null +++ b/Task/Character-matching/PureBasic/character-matching-1.purebasic @@ -0,0 +1,15 @@ +Procedure StartsWith(String1$, String2$) + Protected Result + If FindString(String1$, String2$, 1) =1 ; E.g Found in possition 1 + Result =CountString(String1$, String2$) + EndIf + ProcedureReturn Result +EndProcedure + +Procedure EndsWith(String1$, String2$) + Protected Result, dl=Len(String1$)-Len(String2$) + If dl>=0 And Right(String1$, Len(String2$))=String2$ + Result =CountString(String1$, String2$) + EndIf + ProcedureReturn Result +EndProcedure diff --git a/Task/Character-matching/PureBasic/character-matching-2.purebasic b/Task/Character-matching/PureBasic/character-matching-2.purebasic new file mode 100644 index 0000000000..0afbed4783 --- /dev/null +++ b/Task/Character-matching/PureBasic/character-matching-2.purebasic @@ -0,0 +1,11 @@ +If OpenConsole() + PrintN(Str(StartsWith("Rosettacode", "Rosetta"))) ; = 1 + PrintN(Str(StartsWith("Rosettacode", "code"))) ; = 0 + PrintN(Str(StartsWith("eleutherodactylus cruralis", "e"))) ; = 3 + PrintN(Str(EndsWith ("Rosettacode", "Rosetta"))) ; = 0 + PrintN(Str(EndsWith ("Rosettacode", "code"))) ; = 1 + PrintN(Str(EndsWith ("Rosettacode", "e"))) ; = 2 + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Character-matching/PureBasic/character-matching-3.purebasic b/Task/Character-matching/PureBasic/character-matching-3.purebasic new file mode 100644 index 0000000000..ccc347814d --- /dev/null +++ b/Task/Character-matching/PureBasic/character-matching-3.purebasic @@ -0,0 +1,42 @@ +Procedure startsWith(string1$, string2$) + ;returns one if string1$ starts with string2$, otherwise returns zero + If FindString(string1$, string2$, 1) = 1 + ProcedureReturn 1 + EndIf + ProcedureReturn 0 +EndProcedure + +Procedure contains(string1$, string2$, location = 0) + ;returns the location of the next occurrence of string2$ in string1$ starting from location, + ;or zero if no remaining occurrences of string2$ are found in string1$ + ProcedureReturn FindString(string1$, string2$, location + 1) +EndProcedure + +Procedure endsWith(string1$, string2$) + ;returns one if string1$ ends with string2$, otherwise returns zero + Protected ls = Len(string2$) + If Len(string1$) - ls >= 0 And Right(string1$, ls) = string2$ + ProcedureReturn 1 + EndIf + ProcedureReturn 0 +EndProcedure + +If OpenConsole() + PrintN(Str(startsWith("RosettaCode", "Rosetta"))) ; = 1, true + PrintN(Str(startsWith("RosettaCode", "Code"))) ; = 0, false + + PrintN("") + PrintN(Str(contains("RosettaCode", "luck"))) ; = 0, no occurrences + Define location + Repeat + location = contains("eleutherodactylus cruralis", "e", location) + PrintN(Str(location)) ;display each occurrence: 1, 3, 7, & 0 (no more occurrences) + Until location = 0 + + PrintN("") + PrintN(Str(endsWith ("RosettaCode", "Rosetta"))) ; = 0, false + PrintN(Str(endsWith ("RosettaCode", "Code"))) ; = 1, true + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Character-matching/Retro/character-matching.retro b/Task/Character-matching/Retro/character-matching.retro new file mode 100644 index 0000000000..6db43bf85a --- /dev/null +++ b/Task/Character-matching/Retro/character-matching.retro @@ -0,0 +1,14 @@ +: startsWith? ( $1 $2 - f ) + withLength &swap dip 0 swap ^strings'getSubset compare ; + +"abcdefghijkl" "abcde" startsWith? +"abcdefghijkl" "bcd" startsWith? + +"abcdefghijkl" "bcd" ^strings'search +"abcdefghijkl" "zmq" ^strings'search + +: endsWith? ( $1 $2 - f ) + swap withLength + over getLength - compare ; + +"abcdefghijkl" "ijkl" endsWith? +"abcdefghijkl" "abc" endsWith? diff --git a/Task/Character-matching/Run-BASIC/character-matching.run b/Task/Character-matching/Run-BASIC/character-matching.run new file mode 100644 index 0000000000..59bac91f2a --- /dev/null +++ b/Task/Character-matching/Run-BASIC/character-matching.run @@ -0,0 +1,28 @@ +s1$ = "abc def ghi klmnop" +s2$ = "abc" ' begins with +s3$ = "ef" ' is in the string +s4$ = "nop" ' ends with + +sn2$ = "abcx" ' not begins with +sn3$ = "efx" ' not in the string +sn4$ = "nopx" ' not ends with + +if left$(s1$,len(s2$)) <> s2$ then a$ = "Not " +print "String:";s1$;" does ";a$;"begin with:";s2$ + +if instr(s1$,s3$) = 0 then a$ = "Not " +print "String:";s1$;" does ";a$;"contain:";s3$ + +if mid$(s1$,len(s1$) + 1 - len(s4$),len(s4$)) <> s4$ then a$ = "Not " +print "String:";s1$;" does ";a$;"end with:";s4$ + +' ----------- not ----------------------------- +print +if left$(s1$,len(sn2$)) <> sn2$ then a$ = "Not " +print "String:";s1$;" does ";a$;"begin with:";sn2$ + +if instr(s1$,sn3$) = 0 then a$ = "Not " +print "String:";s1$;" does ";a$;"contain:";sn3$ + +if mid$(s1$,len(s1$) + 1 - len(sn4$),len(sn4$)) <> sn4$ then a$ = "Not " +print "String:";s1$;" does ";a$;"end with:";sn4$ diff --git a/Task/Character-matching/Seed7/character-matching.seed7 b/Task/Character-matching/Seed7/character-matching.seed7 new file mode 100644 index 0000000000..8c5bfd7fee --- /dev/null +++ b/Task/Character-matching/Seed7/character-matching.seed7 @@ -0,0 +1,16 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: position is 0; + begin + writeln(startsWith("abcd", "ab")); # write TRUE + writeln(endsWith("abcd", "zn")); # write FALSE + writeln(pos("abab", "bb") <> 0); # write FALSE + writeln(pos("abab", "ab") <> 0); # write TRUE + writeln(pos("abab", "bb")); # write 0 + position := pos("abab", "ab"); + writeln(position); # position is 1 + position := pos("abab", "ab", succ(position)); + writeln(position); # position is 3 + end func; diff --git a/Task/Character-matching/Standard-ML/character-matching.ml b/Task/Character-matching/Standard-ML/character-matching.ml new file mode 100644 index 0000000000..ad76b0579b --- /dev/null +++ b/Task/Character-matching/Standard-ML/character-matching.ml @@ -0,0 +1,7 @@ +String.isPrefix "ab" "abcd"; (* returns true *) +String.isSuffix "zn" "abcd"; (* returns false *) +String.isSubstring "bb" "abab"; (* returns false *) +String.isSubstring "ab" "abab"; (* returns true *) +#2 (Substring.base (#2 (Substring.position "bb" (Substring.full "abab")))); (* returns 4 *) +val loc = #2 (Substring.base (#2 (Substring.position "ab" (Substring.full "abab")))); (* returns 0 *) +val loc' = #2 (Substring.base (#2 (Substring.position "ab" (Substring.extract ("abab", loc+1, NONE))))); (* returns 2 *) diff --git a/Task/Character-matching/TUSCRIPT/character-matching.tuscript b/Task/Character-matching/TUSCRIPT/character-matching.tuscript new file mode 100644 index 0000000000..4cc6fa9c91 --- /dev/null +++ b/Task/Character-matching/TUSCRIPT/character-matching.tuscript @@ -0,0 +1,23 @@ +$$ MODE TUSCRIPT +ASK "string1", string1="" +ASK "string2", string2="" + +IF (string1.sw.string2) THEN +PRINT string1," starts with ",string2 +ELSE +PRINT string1," not starts with ",string2 +ENDIF +SET beg=STRING (string1,string2,0,0,0,end) +IF (beg!=0) THEN +PRINT string1," contains ",string2 +PRINT " starting in position ",beg +PRINT " ending in position ",end +ELSE +PRINT string1," not contains ",string2 +ENDIF + +IF (string1.ew.string2) THEN +PRINT string1," ends with ",string2 +ELSE +PRINT string1," not ends with ",string2 +ENDIF diff --git a/Task/Character-matching/TXR/character-matching.txr b/Task/Character-matching/TXR/character-matching.txr new file mode 100644 index 0000000000..bc5b6aed45 --- /dev/null +++ b/Task/Character-matching/TXR/character-matching.txr @@ -0,0 +1,26 @@ +@line +@(cases) +@ line +@ (output) +second line is the same as first line +@ (end) +@(or) +@ (skip)@line +@ (output) +first line is a suffix of the second line +@ (end) +@(or) +@ line@(skip) +@ (output) +first line is a suffix of the second line +@ (end) +@(or) +@ prefix@line@(skip) +@ (output) +first line is embedded in the second line at position @(length prefix) +@ (end) +@(or) +@ (output) +first line is not found in the second line +@ (end) +@(end) diff --git a/Task/Character-matching/XPL0/character-matching.xpl0 b/Task/Character-matching/XPL0/character-matching.xpl0 new file mode 100644 index 0000000000..648977dfae --- /dev/null +++ b/Task/Character-matching/XPL0/character-matching.xpl0 @@ -0,0 +1,42 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +string 0; \use zero-terminated strings + +func StrLen(A); \Return number of characters in a string +char A; +int I; +for I:= 0 to -1>>1-1 do + if A(I) = 0 then return I; + +func StrFind(A, B); \Search for string B in string A +\Returns index of first occurrence of string B in A, or -1 if B is not found +char A, B; \strings to be compared +int LA, LB, I, J; +[LA:= StrLen(A); + LB:= StrLen(B); + for I:= 0 to LA-LB do + [for J:= 0 to LB-1 do + if B(J) # A(J+I) then J:= LB+1; + if J = LB then return I; \found + ]; +return -1; +]; + +char Str; int I, J; +[Str:= "pack my box with"; +\ 0123456789012345 +Text(0, if StrFind(Str, "pack") = 0 then "yes" else "no"); CrLf(0); \1. +Text(0, if StrFind(Str, "ack") = 0 then "yes" else "no"); CrLf(0); +I:= StrFind(Str, "x w"); +Text(0, if I >= 0 then "yes" else "no"); \2. +Text(0, ", at offset "); IntOut(0, I); CrLf(0); +I:= 0; J:= 0; \offsets of space characters +loop [I:= StrFind(Str+J, " "); + if I < 0 then quit; + IntOut(0, I+J); ChOut(0, ^ ); + J:= J+I+1; + ]; +CrLf(0); +Text(0, if StrFind(Str, "X w") >= 0 then "yes" else "no"); CrLf(0); +Text(0, if StrFind(Str, "with") = StrLen(Str)-StrLen("with") then "yes" else "no"); CrLf(0); \3. +Text(0, if StrFind(Str, "x w" ) = StrLen(Str)-StrLen("x w" ) then "yes" else "no"); CrLf(0); +] diff --git a/Task/Chat-server/CoffeeScript/chat-server.coffee b/Task/Chat-server/CoffeeScript/chat-server.coffeescript similarity index 100% rename from Task/Chat-server/CoffeeScript/chat-server.coffee rename to Task/Chat-server/CoffeeScript/chat-server.coffeescript diff --git a/Task/Chat-server/Objeck/chat-server.objeck b/Task/Chat-server/Objeck/chat-server.objeck new file mode 100644 index 0000000000..a668996ad8 --- /dev/null +++ b/Task/Chat-server/Objeck/chat-server.objeck @@ -0,0 +1,109 @@ +use System.IO.Net; +use System.Concurrency; +use Collection; + +bundle Default { + class ChatServer { + @clients : StringMap; + @clients_mutex : ThreadMutex; + + New() { + @clients := StringMap->New(); + @clients_mutex := ThreadMutex->New("clients_mutex"); + } + + method : ValidLogin(login_name : String, clients : StringMap) ~ Bool { + if(clients->Has(login_name)) { + return false; + }; + + return true; + } + + function : Main(args : String[]) ~ Nil { + chat_server := ChatServer->New(); + chat_server->Run(); + } + + method : public : Broadcast(message : String, sender : Client) ~ Nil { + client_array : Vector; + critical(@clients_mutex) { + client_array := @clients->GetValues(); + }; + each(i : client_array) { + client := client_array->Get(i)->As(Client); + if(client <> sender) { + client->Send(message); + }; + }; + } + + method : public : Disconnect(sender : Client) ~ Nil { + send_name := sender->GetName(); + Broadcast("+++ {$send_name} has left +++", sender); + critical(@clients_mutex) { + @clients->Remove(sender->GetName()); + }; + sender->Close(); + } + + method : public : Run() ~ Nil { + server := TCPSocketServer->New(4661); + if(server->Listen(5)) { + while(true) { + client_sock := server->Accept(); + critical(@clients_mutex) { + client_sock->WriteString("login: "); + login_name := client_sock->ReadString(); + if(ValidLogin(login_name, @clients)) { + client := Client->New(login_name, client_sock, @self); + @clients->Insert(client->GetName(), client); + client->Execute(Nil); + } + else { + client_sock->WriteString("+++ login in use +++\r\n"); + client_sock->Close(); + }; + }; + }; + }; + server->Close(); + } + } + + class Client from Thread { + @client_sock : TCPSocket; + @server : ChatServer; + + New(login_name : String, client_sock : TCPSocket, server : ChatServer) { + Parent(login_name); + @client_sock := client_sock; + @server := server; + } + + method : public : Close() ~ Nil { + @client_sock->Close(); + } + + method : public : Send(message : String) ~ Nil { + if(@client_sock->IsOpen() & message->Size() > 0) { + @client_sock->WriteString("{$message}\r\n"); + } + else { + @server->Disconnect(@self); + }; + } + + method : public : Run(param : Base) ~ Nil { + client_name := GetName(); + @server->Broadcast("+++ {$client_name} has arrived +++", @self); + + message := @client_sock->ReadString(); + while(message->Size() > 0 & message->Equals("/quit") = false) { + @server->Broadcast("{$client_name}> {$message}", @self); + message := @client_sock->ReadString(); + }; + @server->Disconnect(@self); + } + } +} diff --git a/Task/Check-Machin-like-formulas/Mathematica/check-machin-like-formulas.mathematica b/Task/Check-Machin-like-formulas/Mathematica/check-machin-like-formulas.math similarity index 100% rename from Task/Check-Machin-like-formulas/Mathematica/check-machin-like-formulas.mathematica rename to Task/Check-Machin-like-formulas/Mathematica/check-machin-like-formulas.math diff --git a/Task/Check-Machin-like-formulas/OCaml/check-machin-like-formulas.ocaml b/Task/Check-Machin-like-formulas/OCaml/check-machin-like-formulas.ocaml new file mode 100644 index 0000000000..209a2dc58b --- /dev/null +++ b/Task/Check-Machin-like-formulas/OCaml/check-machin-like-formulas.ocaml @@ -0,0 +1,51 @@ +open Num;; (* use exact rationals for results *) + +let tadd p q = (p +/ q) // ((Int 1) -/ (p */ q)) in + +(* tan(n*arctan(a/b)) *) +let rec tan_expr (n,a,b) = + if n = 1 then (Int a)//(Int b) else + if n = -1 then (Int (-a))//(Int b) else + let m = n/2 in + let tm = tan_expr (m,a,b) in + let m2 = tadd tm tm and k = n-m-m in + if k = 0 then m2 else tadd (tan_expr (k,a,b)) m2 in + +let verify (k, tlist) = + Printf.printf "Testing: pi/%d = " k; + let t_str = List.map (fun (x,y,z) -> Printf.sprintf "%d*atan(%d/%d)" x y z) tlist in + print_endline (String.concat " + " t_str); + let ans_terms = List.map tan_expr tlist in + let answer = List.fold_left tadd (Int 0) ans_terms in + Printf.printf " tan(RHS) is %s\n" (if answer = (Int 1) then "one" else "not one") in + +(* example: prog 4 5 29 278 7 3 79 represents pi/4 = 5*atan(29/278) + 7*atan(3/79) *) +let args = Sys.argv in +let nargs = Array.length args in +let v k = int_of_string args.(k) in +let rec triples n = + if n+2 > nargs-1 then [] + else (v n, v (n+1), v (n+2)) :: triples (n+3) in +if nargs > 4 then +let dat = (v 1, triples 2) in +verify dat +else +List.iter verify [ + (4,[(1,1,2);(1,1,3)]); + (4,[(2,1,3);(1,1,7)]); + (4,[(4,1,5);(-1,1,239)]); + (4,[(5,1,7);(2,3,79)]); + (4,[(5,29,278);(7,3,79)]); + (4,[(1,1,2);(1,1,5);(1,1,8)]); + (4,[(4,1,5);(-1,1,70);(1,1,99)]); + (4,[(5,1,7);(4,1,53);(2,1,4443)]); + (4,[(6,1,8);(2,1,57);(1,1,239)]); + (4,[(8,1,10);(-1,1,239);(-4,1,515)]); + (4,[(12,1,18);(8,1,57);(-5,1,239)]); + (4,[(16,1,21);(3,1,239);(4,3,1042)]); + (4,[(22,1,28);(2,1,443);(-5,1,1393);(-10,1,11018)]); + (4,[(22,1,38);(17,7,601);(10,7,8149)]); + (4,[(44,1,57);(7,1,239);(-12,1,682);(24,1,12943)]); + (4,[(88,1,172);(51,1,239);(32,1,682);(44,1,5357);(68,1,12943)]); + (4,[(88,1,172);(51,1,239);(32,1,682);(44,1,5357);(68,1,12944)]) +] diff --git a/Task/Check-Machin-like-formulas/Perl-6/check-machin-like-formulas.pl6 b/Task/Check-Machin-like-formulas/Perl-6/check-machin-like-formulas.pl6 new file mode 100644 index 0000000000..b59bc958e1 --- /dev/null +++ b/Task/Check-Machin-like-formulas/Perl-6/check-machin-like-formulas.pl6 @@ -0,0 +1,20 @@ +use Test; +plan *; + +is tan(atan(1/2)+atan(1/3)), 1; +is tan(2*atan(1/3)+atan(1/7)), 1; +is tan(4*atan(1/5)-atan(1/239)), 1; +is tan(5*atan(1/7)+2*atan(3/79)), 1; +is tan(5*atan(29/278)+7*atan(3/79)), 1; +is tan(atan(1/2)+atan(1/5)+atan(1/8)), 1; +is tan(4*atan(1/5)-atan(1/70)+atan(1/99)), 1; +is tan(5*atan(1/7)+4*atan(1/53)+2*atan(1/4443)), 1; +is tan(6*atan(1/8)+2*atan(1/57)+atan(1/239)), 1; +is tan(8*atan(1/10)-atan(1/239)-4*atan(1/515)), 1; +is tan(12*atan(1/18)+8*atan(1/57)-5*atan(1/239)), 1; +is tan(16*atan(1/21)+3*atan(1/239)+4*atan(3/1042)), 1; +is tan(22*atan(1/28)+2*atan(1/443)-5*atan(1/1393)-10*atan(1/11018)), 1; +is tan(22*atan(1/38)+17*atan(7/601)+10*atan(7/8149)), 1; +is tan(44*atan(1/57)+7*atan(1/239)-12*atan(1/682)+24*atan(1/12943)), 1; +is tan(88*atan(1/172)+51*atan(1/239)+32*atan(1/682)+44*atan(1/5357)+68*atan(1/12943)), 1; +is tan(88*atan(1/172)+51*atan(1/239)+32*atan(1/682)+44*atan(1/5357)+68*atan(1/12944)), 1; diff --git a/Task/Check-Machin-like-formulas/XPL0/check-machin-like-formulas.xpl0 b/Task/Check-Machin-like-formulas/XPL0/check-machin-like-formulas.xpl0 new file mode 100644 index 0000000000..bf8e072ce9 --- /dev/null +++ b/Task/Check-Machin-like-formulas/XPL0/check-machin-like-formulas.xpl0 @@ -0,0 +1,96 @@ +code ChOut=8, Text=12; \intrinsic routines +int Number(18); \numbers from equations +def LF=$0A; \ASCII line feed (end-of-line character) + +func Parse(S); \Convert numbers in string S to binary in Number array +char S; +int I, Neg; + + proc GetNum; \Get number from string S + int N; + [while S(0)<^0 ! S(0)>^9 do S:= S+1; + N:= S(0)-^0; S:= S+1; + while S(0)>=^0 & S(0)<=^9 do + [N:= N*10 + S(0) - ^0; S:= S+1]; + Number(I):= N; I:= I+1; + ]; + +[while S(0)#^= do S:= S+1; \skip to "=" +I:= 0; +loop [Neg:= false; \assume positive term + loop [S:= S+1; \next char + case S(0) of + LF: [Number(I):= 0; return S+1]; \mark end of array + ^-: Neg:= true; \term is negative + ^a: [Number(I):= 1; I:= I+1; quit] \no coefficient so use 1 + other if S(0)>=^0 & S(0)<=^9 then \if digit + [S:= S-1; GetNum; quit]; \backup and get number + ]; + GetNum; \numerator + if Neg then Number(I-1):= -Number(I-1); \tan(-a) = -tan(a) + GetNum; \denominator + ]; +]; + + +func GCD(U, V); \Return the greatest common divisor of U and V +int U, V; +int T; +[while V do \Euclid's method + [T:= U; U:= V; V:= rem(T/V)]; +return abs(U); +]; + +proc Verify; \Verify that tangent of equation = 1 (i.e: E = F) +int E, F, I, J; + + proc Machin(A, B, C, D); + int A, B, C, D; + int Div; + \tan(a+b) = (tan(a) + tan(b)) / (1 - tan(a)*tan(b)) + \tan(arctan(A/B) + arctan(C/D)) + \ = (tan(arctan(A/B)) + tan(arctan(C/D))) / (1 - tan(arctan(A/B))*tan(arctan(C/D))) + \ = (A/B + C/D) / (1 - A/B*C/D) + \ = (A*D/B*D + B*C/B*D) / (B*D/B*D - A*C/B*D) + \ = (A*D + B*C) / (B*D - A*C) + [E:= A*D + B*C; F:= B*D - A*C; + Div:= GCD(E, F); \keep integers from getting too big + E:= E/Div; F:= F/Div; + ]; + +[E:= 0; F:= 1; I:= 0; +while Number(I) do + [for J:= 1 to Number(I) do + Machin(E, F, Number(I+1), Number(I+2)); + I:= I+3; + ]; +Text(0, if E=F then "Yes " else "No "); +]; + + +char S, SS; int I; +[S:= "pi/4 = arctan(1/2) + arctan(1/3) +pi/4 = 2*arctan(1/3) + arctan(1/7) +pi/4 = 4*arctan(1/5) - arctan(1/239) +pi/4 = 5*arctan(1/7) + 2*arctan(3/79) +pi/4 = 5*arctan(29/278) + 7*arctan(3/79) +pi/4 = arctan(1/2) + arctan(1/5) + arctan(1/8) +pi/4 = 4*arctan(1/5) - arctan(1/70) + arctan(1/99) +pi/4 = 5*arctan(1/7) + 4*arctan(1/53) + 2*arctan(1/4443) +pi/4 = 6*arctan(1/8) + 2*arctan(1/57) + arctan(1/239) +pi/4 = 8*arctan(1/10) - arctan(1/239) - 4*arctan(1/515) +pi/4 = 12*arctan(1/18) + 8*arctan(1/57) - 5*arctan(1/239) +pi/4 = 16*arctan(1/21) + 3*arctan(1/239) + 4*arctan(3/1042) +pi/4 = 22*arctan(1/28) + 2*arctan(1/443) - 5*arctan(1/1393) - 10*arctan(1/11018) +pi/4 = 22*arctan(1/38) + 17*arctan(7/601) + 10*arctan(7/8149) +pi/4 = 44*arctan(1/57) + 7*arctan(1/239) - 12*arctan(1/682) + 24*arctan(1/12943) +pi/4 = 88*arctan(1/172) + 51*arctan(1/239) + 32*arctan(1/682) + 44*arctan(1/5357) + 68*arctan(1/12943) +pi/4 = 88*arctan(1/172) + 51*arctan(1/239) + 32*arctan(1/682) + 44*arctan(1/5357) + 68*arctan(1/12944) + "; \Python version of equations (thanks!) +for I:= 1 to 17 do + [SS:= S; \save start of string line + S:= Parse(S); \returns start of next line + Verify; \correct Machin equation? Yes or No + repeat ChOut(0, SS(0)); SS:= SS+1 until SS(0)=LF; ChOut(0, LF); \show equation + ]; +] diff --git a/Task/Check-that-file-exists/BASIC/check-that-file-exists-1.bas b/Task/Check-that-file-exists/BASIC/check-that-file-exists-1.basic similarity index 100% rename from Task/Check-that-file-exists/BASIC/check-that-file-exists-1.bas rename to Task/Check-that-file-exists/BASIC/check-that-file-exists-1.basic diff --git a/Task/Check-that-file-exists/BASIC/check-that-file-exists-2.bas b/Task/Check-that-file-exists/BASIC/check-that-file-exists-2.basic similarity index 100% rename from Task/Check-that-file-exists/BASIC/check-that-file-exists-2.bas rename to Task/Check-that-file-exists/BASIC/check-that-file-exists-2.basic diff --git a/Task/Check-that-file-exists/BASIC/check-that-file-exists-3.bas b/Task/Check-that-file-exists/BASIC/check-that-file-exists-3.basic similarity index 100% rename from Task/Check-that-file-exists/BASIC/check-that-file-exists-3.bas rename to Task/Check-that-file-exists/BASIC/check-that-file-exists-3.basic diff --git a/Task/Check-that-file-exists/MAXScript/check-that-file-exists.max b/Task/Check-that-file-exists/MAXScript/check-that-file-exists.maxscript similarity index 100% rename from Task/Check-that-file-exists/MAXScript/check-that-file-exists.max rename to Task/Check-that-file-exists/MAXScript/check-that-file-exists.maxscript diff --git a/Task/Check-that-file-exists/Mathematica/check-that-file-exists.mathematica b/Task/Check-that-file-exists/Mathematica/check-that-file-exists.math similarity index 100% rename from Task/Check-that-file-exists/Mathematica/check-that-file-exists.mathematica rename to Task/Check-that-file-exists/Mathematica/check-that-file-exists.math diff --git a/Task/Check-that-file-exists/OCaml/check-that-file-exists.ocaml b/Task/Check-that-file-exists/OCaml/check-that-file-exists.ocaml new file mode 100644 index 0000000000..38d1ccdeb1 --- /dev/null +++ b/Task/Check-that-file-exists/OCaml/check-that-file-exists.ocaml @@ -0,0 +1,4 @@ +Sys.file_exists "input.txt";; +Sys.file_exists "docs";; +Sys.file_exists "/input.txt";; +Sys.file_exists "/docs";; diff --git a/Task/Check-that-file-exists/Objeck/check-that-file-exists.objeck b/Task/Check-that-file-exists/Objeck/check-that-file-exists.objeck new file mode 100644 index 0000000000..876400e68b --- /dev/null +++ b/Task/Check-that-file-exists/Objeck/check-that-file-exists.objeck @@ -0,0 +1,11 @@ +use IO; + +bundle Default { + class Test { + function : Main(args : String[]) ~ Nil { + File->Exists("input.txt")->PrintLine(); + File->Exists("/input.txt")->PrintLine(); + Directory->Exists("docs")->PrintLine(); + Directory->Exists("/docs")->PrintLine(); + } +} diff --git a/Task/Check-that-file-exists/Objective-C/check-that-file-exists.m b/Task/Check-that-file-exists/Objective-C/check-that-file-exists.m new file mode 100644 index 0000000000..5e963e353b --- /dev/null +++ b/Task/Check-that-file-exists/Objective-C/check-that-file-exists.m @@ -0,0 +1,3 @@ +NSFileManager *fm = [NSFileManager defaultManager]; +NSLog(@"input.txt %s", [fm fileExistsAtPath:@"input.txt"] ? @"exists" : @"doesn't exist"); +NSLog(@"docs %s", [fm fileExistsAtPath:@"docs"] ? @"exists" : @"doesn't exist"); diff --git a/Task/Check-that-file-exists/Oz/check-that-file-exists.oz b/Task/Check-that-file-exists/Oz/check-that-file-exists.oz new file mode 100644 index 0000000000..de5c5fc0f6 --- /dev/null +++ b/Task/Check-that-file-exists/Oz/check-that-file-exists.oz @@ -0,0 +1,7 @@ +declare + [Path] = {Module.link ['x-oz://system/os/Path.ozf']} +in + {Show {Path.exists "docs"}} + {Show {Path.exists "input.txt"}} + {Show {Path.exists "/docs"}} + {Show {Path.exists "/input.txt"}} diff --git a/Task/Check-that-file-exists/PARI-GP/check-that-file-exists.pari b/Task/Check-that-file-exists/PARI-GP/check-that-file-exists.pari new file mode 100644 index 0000000000..5d3da4df65 --- /dev/null +++ b/Task/Check-that-file-exists/PARI-GP/check-that-file-exists.pari @@ -0,0 +1 @@ +trap(,"does not exist",read("input.txt");"exists") diff --git a/Task/Check-that-file-exists/Perl-6/check-that-file-exists.pl6 b/Task/Check-that-file-exists/Perl-6/check-that-file-exists.pl6 new file mode 100644 index 0000000000..f791c2d5bf --- /dev/null +++ b/Task/Check-that-file-exists/Perl-6/check-that-file-exists.pl6 @@ -0,0 +1,4 @@ +'input.txt'.IO ~~ :e; +'docs'.IO ~~ :d; +'/input.txt'.IO ~~ :e; +'/docs'.IO ~~ :d diff --git a/Task/Check-that-file-exists/Pike/check-that-file-exists.pike b/Task/Check-that-file-exists/Pike/check-that-file-exists.pike new file mode 100644 index 0000000000..332290b3c7 --- /dev/null +++ b/Task/Check-that-file-exists/Pike/check-that-file-exists.pike @@ -0,0 +1,11 @@ +import Stdio; + +int main(){ + if(exist("/var")){ + write("/var exists!\n"); + } + + if(exist("file-exists.pike")){ + write("I exist!\n"); + } +} diff --git a/Task/Check-that-file-exists/Pop11/check-that-file-exists-1.pop11 b/Task/Check-that-file-exists/Pop11/check-that-file-exists-1.pop11 new file mode 100644 index 0000000000..5c054a181d --- /dev/null +++ b/Task/Check-that-file-exists/Pop11/check-that-file-exists-1.pop11 @@ -0,0 +1,4 @@ +sys_file_exists('input.txt') => +sys_file_exists('/input.txt') => +sys_file_exists('docs') => +sys_file_exists('/docs') => diff --git a/Task/Check-that-file-exists/Pop11/check-that-file-exists-2.pop11 b/Task/Check-that-file-exists/Pop11/check-that-file-exists-2.pop11 new file mode 100644 index 0000000000..177d1e9806 --- /dev/null +++ b/Task/Check-that-file-exists/Pop11/check-that-file-exists-2.pop11 @@ -0,0 +1,10 @@ +;;; Define an auxilary function, returns boolean +define file_readable(fname); + lvars f = sysopen(fname, 0, true, `A`); + if f then + sysclose(f); + return (true); + else + return (false); + endif; +enddefine; diff --git a/Task/Check-that-file-exists/PowerShell/check-that-file-exists.psh b/Task/Check-that-file-exists/PowerShell/check-that-file-exists.psh new file mode 100644 index 0000000000..1259b6db5c --- /dev/null +++ b/Task/Check-that-file-exists/PowerShell/check-that-file-exists.psh @@ -0,0 +1 @@ + Test-Path input.txt diff --git a/Task/Check-that-file-exists/PureBasic/check-that-file-exists.purebasic b/Task/Check-that-file-exists/PureBasic/check-that-file-exists.purebasic new file mode 100644 index 0000000000..14175d095d --- /dev/null +++ b/Task/Check-that-file-exists/PureBasic/check-that-file-exists.purebasic @@ -0,0 +1,19 @@ +result = ReadFile(#PB_Any, "input.txt") +If result>0 : Debug "this local file exists" + Else : Debug "result=" +Str(result) +" so this local file is missing" +EndIf + +result = ReadFile(#PB_Any, "/input.txt") +If result>0 : Debug "this root file exists" + Else : Debug "result=" +Str(result) +" so this root file is missing" +EndIf + +result = ExamineDirectory(#PB_Any,"docs","") +If result>0 : Debug "this local directory exists" + Else : Debug "result=" +Str(result) +" so this local directory is missing" +EndIf + +result = ExamineDirectory(#PB_Any,"/docs","") +If result>0 : Debug "this root directory exists" + Else : Debug "result=" +Str(result) +" so this root directory is missing" +EndIf diff --git a/Task/Check-that-file-exists/REBOL/check-that-file-exists.rebol b/Task/Check-that-file-exists/REBOL/check-that-file-exists.rebol new file mode 100644 index 0000000000..3bc4bec252 --- /dev/null +++ b/Task/Check-that-file-exists/REBOL/check-that-file-exists.rebol @@ -0,0 +1,5 @@ +exists? %input.txt +exists? %docs/ + +exists? %/input.txt +exists? %/docs/ diff --git a/Task/Check-that-file-exists/RLaB/check-that-file-exists.rlab b/Task/Check-that-file-exists/RLaB/check-that-file-exists.rlab new file mode 100644 index 0000000000..d593e70e38 --- /dev/null +++ b/Task/Check-that-file-exists/RLaB/check-that-file-exists.rlab @@ -0,0 +1,4 @@ +>> isdir("docs") + 0 +>> isfile("input.txt") + 0 diff --git a/Task/Check-that-file-exists/Raven/check-that-file-exists.raven b/Task/Check-that-file-exists/Raven/check-that-file-exists.raven new file mode 100644 index 0000000000..5c87a390b6 --- /dev/null +++ b/Task/Check-that-file-exists/Raven/check-that-file-exists.raven @@ -0,0 +1,4 @@ +'input.txt' exists if 'input.txt exists' print +'/input.txt' exists if '/input.txt exists' print +'docs' isdir if 'docs exists and is a directory' print +'/docs' isdir if '/docs exists and is a directory' print diff --git a/Task/Check-that-file-exists/Run-BASIC/check-that-file-exists.run b/Task/Check-that-file-exists/Run-BASIC/check-that-file-exists.run new file mode 100644 index 0000000000..8e570277bd --- /dev/null +++ b/Task/Check-that-file-exists/Run-BASIC/check-that-file-exists.run @@ -0,0 +1,6 @@ +files #f,"input.txt" +if #f hasanswer() = 1 then print "File does not exist" + +files #f,"docs" +if #f hasanswer() = 1 then print "File does not exist" +if #f isDir() = 0 then print "This is a directory" diff --git a/Task/Check-that-file-exists/Seed7/check-that-file-exists.seed7 b/Task/Check-that-file-exists/Seed7/check-that-file-exists.seed7 new file mode 100644 index 0000000000..f7301f3cee --- /dev/null +++ b/Task/Check-that-file-exists/Seed7/check-that-file-exists.seed7 @@ -0,0 +1,9 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + begin + writeln(fileType("input.txt") = FILE_REGULAR); + writeln(fileType("/input.txt") = FILE_REGULAR); + writeln(fileType("docs") = FILE_DIR); + writeln(fileType("/docs") = FILE_DIR); + end func; diff --git a/Task/Check-that-file-exists/Slate/check-that-file-exists.slate b/Task/Check-that-file-exists/Slate/check-that-file-exists.slate new file mode 100644 index 0000000000..aea91c9adb --- /dev/null +++ b/Task/Check-that-file-exists/Slate/check-that-file-exists.slate @@ -0,0 +1,5 @@ +(File newNamed: 'input.txt') exists +(File newNamed: '/input.txt') exists +(Directory root / 'input.txt') exists +(Directory newNamed: 'docs') exists +(Directory newNamed: '/docs') exists diff --git a/Task/Check-that-file-exists/Standard-ML/check-that-file-exists.ml b/Task/Check-that-file-exists/Standard-ML/check-that-file-exists.ml new file mode 100644 index 0000000000..52e4187add --- /dev/null +++ b/Task/Check-that-file-exists/Standard-ML/check-that-file-exists.ml @@ -0,0 +1,4 @@ +OS.FileSys.access ("input.txt", []); +OS.FileSys.access ("docs", []); +OS.FileSys.access ("/input.txt", []); +OS.FileSys.access ("/docs", []); diff --git a/Task/Check-that-file-exists/TUSCRIPT/check-that-file-exists.tuscript b/Task/Check-that-file-exists/TUSCRIPT/check-that-file-exists.tuscript new file mode 100644 index 0000000000..7939803863 --- /dev/null +++ b/Task/Check-that-file-exists/TUSCRIPT/check-that-file-exists.tuscript @@ -0,0 +1,12 @@ +$$ MODE TUSCRIPT +file="input.txt",directory="docs" +IF (file=='file') THEN +PRINT file, " exists" +ELSE +PRINT/ERROR file," not exists" +ENDIF +IF (directory=='project') THEN +PRINT directory," exists" +ELSE +PRINT/ERROR "directory ",directory," not exists" +ENDIF diff --git a/Task/Check-that-file-exists/Toka/check-that-file-exists.toka b/Task/Check-that-file-exists/Toka/check-that-file-exists.toka new file mode 100644 index 0000000000..de1708ba6e --- /dev/null +++ b/Task/Check-that-file-exists/Toka/check-that-file-exists.toka @@ -0,0 +1,5 @@ +[ "R" file.open dup 0 <> [ dup file.close ] ifTrue 0 <> ] is exists? +" input.txt" exists? . +" /input.txt" exists? . +" docs" exists? . +" /docs" exists? . diff --git a/Task/Check-that-file-exists/UNIX-Shell/check-that-file-exists-1.sh b/Task/Check-that-file-exists/UNIX-Shell/check-that-file-exists-1.sh new file mode 100644 index 0000000000..1d6f965676 --- /dev/null +++ b/Task/Check-that-file-exists/UNIX-Shell/check-that-file-exists-1.sh @@ -0,0 +1,4 @@ +test -f input.txt +test -f /input.txt +test -d docs +test -d /docs diff --git a/Task/Check-that-file-exists/UNIX-Shell/check-that-file-exists-2.sh b/Task/Check-that-file-exists/UNIX-Shell/check-that-file-exists-2.sh new file mode 100644 index 0000000000..fa15dcaf64 --- /dev/null +++ b/Task/Check-that-file-exists/UNIX-Shell/check-that-file-exists-2.sh @@ -0,0 +1,8 @@ +for f in input.txt /input.txt; do + test -f "$f" && r=true || r=false + echo "$f is a regular file? $r" +done +for d in docs /docs; do + test -d "$d" && r=true || r=false + echo "$d is a directory? $r" +done diff --git a/Task/Check-that-file-exists/VBScript/check-that-file-exists.vbscript b/Task/Check-that-file-exists/VBScript/check-that-file-exists.vbscript new file mode 100644 index 0000000000..c40d6b023d --- /dev/null +++ b/Task/Check-that-file-exists/VBScript/check-that-file-exists.vbscript @@ -0,0 +1,24 @@ +Set FSO=CreateObject("Scripting.FileSystemObject") +Function FileExists(strFile) +if FSO.fileExists(strFile) then +FileExists=true +else +FileExists=false +end if +end function + +Function folderExists(strFolder) +if FSO.folderExists(strFolder) then +folderExists=true +else +folderexists=false +end if +end function + +'''''usage (apostrophes indicate comments-this section will not be run)''''' +'if fileExists("C:\test.txt") then +'msgbox"It Exists!" +'else +'msgbox"awww" +'end if +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' diff --git a/Task/Check-that-file-exists/Vedit-macro-language/check-that-file-exists.vedit b/Task/Check-that-file-exists/Vedit-macro-language/check-that-file-exists.vedit new file mode 100644 index 0000000000..fcb3c94db3 --- /dev/null +++ b/Task/Check-that-file-exists/Vedit-macro-language/check-that-file-exists.vedit @@ -0,0 +1,7 @@ +// In current directory +if (File_Exist("input.txt")) { M("input.txt exists\n") } else { M("input.txt does not exist\n") } +if (File_Exist("docs/nul", NOERR)) { M("docs exists\n") } else { M("docs does not exist\n") } + +// In the root directory +if (File_Exist("/input.txt")) { M("/input.txt exists\n") } else { M("/input.txt does not exist\n") } +if (File_Exist("/docs/nul", NOERR)) { M("/docs exists\n") } else { M("/docs does not exist\n") } diff --git a/Task/Check-that-file-exists/Visual-Basic-.NET/check-that-file-exists.visual b/Task/Check-that-file-exists/Visual-Basic-.NET/check-that-file-exists.visual new file mode 100644 index 0000000000..a2a26e4761 --- /dev/null +++ b/Task/Check-that-file-exists/Visual-Basic-.NET/check-that-file-exists.visual @@ -0,0 +1,13 @@ +'Current Directory +Console.WriteLine(If(IO.Directory.Exists("docs"), "directory exists", "directory doesn't exists")) +Console.WriteLine(If(IO.Directory.Exists("output.txt"), "file exists", "file doesn't exists")) + +'Root +Console.WriteLine(If(IO.Directory.Exists("\docs"), "directory exists", "directory doesn't exists")) +Console.WriteLine(If(IO.Directory.Exists("\output.txt"), "file exists", "file doesn't exists")) + +'Root, platform independent +Console.WriteLine(If(IO.Directory.Exists(IO.Path.DirectorySeparatorChar & "docs"), _ + "directory exists", "directory doesn't exists")) +Console.WriteLine(If(IO.Directory.Exists(IO.Path.DirectorySeparatorChar & "output.txt"), _ + "file exists", "file doesn't exists")) diff --git a/Task/Checkpoint-synchronization/PureBasic/checkpoint-synchronization.purebasic b/Task/Checkpoint-synchronization/PureBasic/checkpoint-synchronization.purebasic new file mode 100644 index 0000000000..08070b52c4 --- /dev/null +++ b/Task/Checkpoint-synchronization/PureBasic/checkpoint-synchronization.purebasic @@ -0,0 +1,87 @@ +#MaxWorktime=8000 ; "Workday" in msec + +; Structure that each thread uses +Structure MyIO + ThreadID.i + Semaphore_Joining.i + Semaphore_Release.i + Semaphore_Deliver.i + Semaphore_Leaving.i +EndStructure + +; Array of used threads +Global Dim Comm.MyIO(0) + +; Master loop synchronizing the threads via semaphores +Procedure CheckPoint() + Protected i, j, maxthreads=ArraySize(Comm()) + Protected Worker_count, Deliver_count + Repeat + For i=1 To maxthreads + With Comm(i) + If TrySemaphore(\Semaphore_Leaving) + Worker_count-1 + ElseIf TrySemaphore(\Semaphore_Deliver) + Deliver_count+1 + If Deliver_count=Worker_count + PrintN("All Workers reported in, starting next task.") + Deliver_count=0 + For j=1 To maxthreads + SignalSemaphore(Comm(j)\Semaphore_Release) + Next j + EndIf + ElseIf TrySemaphore(\Semaphore_Joining) + PrintN("A new Worker joined the force.") + Worker_count+1: SignalSemaphore(\Semaphore_Release) + ElseIf Worker_count=0 + ProcedureReturn + EndIf + Next i + EndWith + ForEver + StartAll=0 +EndProcedure + +; A worker thread, all orchestrated by the Checkpoint() routine +Procedure Worker(ID) + Protected EndTime=ElapsedMilliseconds()+#MaxWorktime, n + With Comm(ID) + SignalSemaphore(\Semaphore_Joining) + Repeat + Repeat ; Use a non-blocking semaphore check to avoid dead-locking at shutdown. + If ElapsedMilliseconds()>EndTime + SignalSemaphore(\Semaphore_Leaving) + PrintN("Thread #"+Str(ID)+" is done.") + ProcedureReturn + EndIf + Delay(1) + Until TrySemaphore(\Semaphore_Release) + n=Random(1000) + PrintN("Thread #"+Str(ID)+" will work for "+Str(n)+" msec.") + Delay(n): PrintN("Thread #"+Str(ID)+" delivering") + SignalSemaphore(\Semaphore_Deliver) + ForEver + EndWith +EndProcedure + +; User IO & init +If OpenConsole() + Define i, j + Repeat + Print("Enter number of workers to use [2-2000]: ") + j=Val(Input()) + Until j>=2 And j<=2000 + ReDim Comm(j) + For i=1 To j + With Comm(i) + \Semaphore_Release =CreateSemaphore() + \Semaphore_Joining =CreateSemaphore() + \Semaphore_Deliver =CreateSemaphore() + \Semaphore_Leaving =CreateSemaphore() + \ThreadID = CreateThread(@Worker(),i) + EndWith + Next + PrintN("Work started, "+Str(j)+" workers has been called.") + CheckPoint() + Print("Press ENTER to exit"): Input() +EndIf diff --git a/Task/Cholesky-decomposition/Mathematica/cholesky-decomposition.mathematica b/Task/Cholesky-decomposition/Mathematica/cholesky-decomposition.math similarity index 100% rename from Task/Cholesky-decomposition/Mathematica/cholesky-decomposition.mathematica rename to Task/Cholesky-decomposition/Mathematica/cholesky-decomposition.math diff --git a/Task/Cholesky-decomposition/OCaml/cholesky-decomposition.ocaml b/Task/Cholesky-decomposition/OCaml/cholesky-decomposition.ocaml new file mode 100644 index 0000000000..332eec2fa7 --- /dev/null +++ b/Task/Cholesky-decomposition/OCaml/cholesky-decomposition.ocaml @@ -0,0 +1,30 @@ +let cholesky inp = + let n = Array.length inp in + let res = Array.make_matrix n n 0.0 in + let factor i k = + let rec sum j = + if j = k then 0.0 else + res.(i).(j) *. res.(k).(j) +. sum (j+1) in + inp.(i).(k) -. sum 0 in + for col = 0 to n-1 do + res.(col).(col) <- sqrt (factor col col); + for row = col+1 to n-1 do + res.(row).(col) <- (factor row col) /. res.(col).(col) + done + done; + res + +let pr_vec v = Array.iter (Printf.printf " %9.5f") v; print_newline() +let show = Array.iter pr_vec +let test a = + print_endline "\nin:"; show a; + print_endline "out:"; show (cholesky a) + +let _ = + test [| [|25.0; 15.0; -5.0|]; + [|15.0; 18.0; 0.0|]; + [|-5.0; 0.0; 11.0|] |]; + test [| [|18.0; 22.0; 54.0; 42.0|]; + [|22.0; 70.0; 86.0; 62.0|]; + [|54.0; 86.0; 174.0; 134.0|]; + [|42.0; 62.0; 134.0; 106.0|] |]; diff --git a/Task/Cholesky-decomposition/Objeck/cholesky-decomposition.objeck b/Task/Cholesky-decomposition/Objeck/cholesky-decomposition.objeck new file mode 100644 index 0000000000..be0c42714e --- /dev/null +++ b/Task/Cholesky-decomposition/Objeck/cholesky-decomposition.objeck @@ -0,0 +1,43 @@ +class Cholesky { + function : Main(args : String[]) ~ Nil { + n := 3; + m1 := [25.0, 15.0, -5.0, 15.0, 18.0, 0.0, -5.0, 0.0, 11.0]; + c1 := Cholesky(m1, n); + ShowMatrix(c1, n); + + IO.Console->PrintLine(); + + n := 4; + m2 := [18.0, 22.0, 54.0, 42.0, 22.0, 70.0, 86.0, 62.0, + 54.0, 86.0, 174.0, 134.0, 42.0, 62.0, 134.0, 106.0]; + c2 := Cholesky(m2, n); + ShowMatrix(c2, n); + } + + function : ShowMatrix(A : Float[], n : Int) ~ Nil { + for (i := 0; i < n; i+=1;) { + for (j := 0; j < n; j+=1;) { + IO.Console->Print(A[i * n + j])->Print('\t'); + }; + IO.Console->PrintLine(); + }; + } + + function : Cholesky(A : Float[], n : Int) ~ Float[] { + L := Float->New[n * n]; + + for (i := 0; i < n; i+=1;) { + for (j := 0; j < (i+1); j+=1;) { + s := 0.0; + for (k := 0; k < j; k+=1;) { + s += L[i * n + k] * L[j * n + k]; + }; + L[i * n + j] := (i = j) ? + (A[i * n + i] - s)->SquareRoot() : + (1.0 / L[j * n + j] * (A[i * n + j] - s)); + }; + }; + + return L; + } +} diff --git a/Task/Cholesky-decomposition/Pascal/cholesky-decomposition.pascal b/Task/Cholesky-decomposition/Pascal/cholesky-decomposition.pascal new file mode 100644 index 0000000000..1068394da8 --- /dev/null +++ b/Task/Cholesky-decomposition/Pascal/cholesky-decomposition.pascal @@ -0,0 +1,64 @@ +Program Cholesky; + +type + D2Array = array of array of double; + +function cholesky(const A: D2Array): D2Array; + var + i, j, k: integer; + s: double; + begin + setlength(cholesky, length(A), length(A)); + for i := low(cholesky) to high(cholesky) do + for j := 0 to i do + begin + s := 0; + for k := 0 to j - 1 do + s := s + cholesky[i][k] * cholesky[j][k]; + if i = j then + cholesky[i][j] := sqrt(A[i][i] - s) + else + cholesky[i][j] := (A[i][j] - s) / cholesky[j][j]; // save one multiplication compared to the original + end; + end; + +procedure printM(const A: D2Array); + var + i, j: integer; + begin + for i := low(A) to high(A) do + begin + for j := low(A) to high(A) do + write(A[i,j]:8:5); + writeln; + end; + end; + +const + m1: array[0..2,0..2] of double = ((25, 15, -5), + (15, 18, 0), + (-5, 0, 11)); + m2: array[0..3,0..3] of double = ((18, 22, 54, 42), + (22, 70, 86, 62), + (54, 86, 174, 134), + (42, 62, 134, 106)); +var + index: integer; + cIn, cOut: D2Array; + +begin + setlength(cIn, length(m1), length(m1)); + for index := low(m1) to high(m1) do + cIn[index] := m1[index]; + cOut := cholesky(cIn); + printM(cOut); + + writeln; + + setlength(cIn, length(m2), length(m2)); + for index := low(m2) to high(m2) do + cIn[index] := m2[index]; + cOut := cholesky(cIn); + printM(cOut); + +end. diff --git a/Task/Cholesky-decomposition/Perl-6/cholesky-decomposition.pl6 b/Task/Cholesky-decomposition/Perl-6/cholesky-decomposition.pl6 new file mode 100644 index 0000000000..62b1811cf6 --- /dev/null +++ b/Task/Cholesky-decomposition/Perl-6/cholesky-decomposition.pl6 @@ -0,0 +1,23 @@ +sub cholesky(@A) { + my @L = @A »*» 0; + for ^@A -> $i { + for 0..$i -> $j { + @L[$i][$j] = ($i == $j ?? &sqrt !! 1/@L[$j][$j] * * )( + @A[$i][$j] - [+] (@L[$i] Z* @L[$j])[0..$j] + ); + } + } + return @L; +} +.say for cholesky [ + [25], + [15, 18], + [-5, 0, 11], +]; + +.say for cholesky [ + [18, 22, 54, 42], + [22, 70, 86, 62], + [54, 86, 174, 134], + [42, 62, 134, 106], +]; diff --git a/Task/Cholesky-decomposition/VBA/cholesky-decomposition.vba b/Task/Cholesky-decomposition/VBA/cholesky-decomposition.vba new file mode 100644 index 0000000000..1f8b789b0e --- /dev/null +++ b/Task/Cholesky-decomposition/VBA/cholesky-decomposition.vba @@ -0,0 +1,52 @@ +Function Cholesky(Mat As Range) As Variant + +Dim A() As Double, L() As Double, sum As Double, sum2 As Double +Dim m As Byte, i As Byte, j As Byte, k As Byte + +'Ensure matrix is square + If Mat.Rows.Count <> Mat.Columns.Count Then + MsgBox ("Correlation matrix is not square") + Exit Function + End If + + m = Mat.Rows.Count + +'Initialize and populate matrix A of values and matrix L which will be the lower Cholesky + ReDim A(0 To m - 1, 0 To m - 1) + ReDim L(0 To m - 1, 0 To m - 1) + For i = 0 To m - 1 + For j = 0 To m - 1 + A(i, j) = Mat(i + 1, j + 1).Value2 + L(i, j) = 0 + Next j + Next i + +'Handle the simple cases explicitly to save time + Select Case m + Case Is = 1 + L(0, 0) = Sqr(A(0, 0)) + + Case Is = 2 + L(0, 0) = Sqr(A(0, 0)) + L(1, 0) = A(1, 0) / L(0, 0) + L(1, 1) = Sqr(A(1, 1) - L(1, 0) * L(1, 0)) + + Case Else + L(0, 0) = Sqr(A(0, 0)) + L(1, 0) = A(1, 0) / L(0, 0) + L(1, 1) = Sqr(A(1, 1) - L(1, 0) * L(1, 0)) + For i = 2 To m - 1 + sum2 = 0 + For k = 0 To i - 1 + sum = 0 + For j = 0 To k + sum = sum + L(i, j) * L(k, j) + Next j + L(i, k) = (A(i, k) - sum) / L(k, k) + sum2 = sum2 + L(i, k) * L(i, k) + Next k + L(i, i) = Sqr(A(i, i) - sum2) + Next i + End Select + Cholesky = L +End Function diff --git a/Task/Classes/BASIC/classes.bas b/Task/Classes/BASIC/classes.basic similarity index 100% rename from Task/Classes/BASIC/classes.bas rename to Task/Classes/BASIC/classes.basic diff --git a/Task/Classes/CoffeeScript/classes.coffee b/Task/Classes/CoffeeScript/classes.coffeescript similarity index 100% rename from Task/Classes/CoffeeScript/classes.coffee rename to Task/Classes/CoffeeScript/classes.coffeescript diff --git a/Task/Classes/NetRexx/classes.netrexx b/Task/Classes/NetRexx/classes.netrexx new file mode 100644 index 0000000000..f74476d585 --- /dev/null +++ b/Task/Classes/NetRexx/classes.netrexx @@ -0,0 +1,31 @@ +class ClassExample + + properties private -- class scope + foo = int + + properties public -- publicly visible + bar = boolean + + properties indirect -- generates bean patterns + baz = String() + + method main(args=String[]) static -- main method + clsex = ClassExample() -- instantiate + clsex.foo = 42 + clsex.baz = 'forty-two' + clsex.bar = 0 -- boolean false + clsex.test(clsex.foo) + clsex.test(clsex.bar) + clsex.test(clsex.baz) + + method test(s=int) + aap = 1 -- local (stack) variable + say s aap + + method test(s=String) + noot = 2 + say s noot + + method test(s=boolean) + mies = 3 + say s mies diff --git a/Task/Classes/OCaml/classes.ocaml b/Task/Classes/OCaml/classes.ocaml new file mode 100644 index 0000000000..481fde206e --- /dev/null +++ b/Task/Classes/OCaml/classes.ocaml @@ -0,0 +1,5 @@ +class my_class = + object (self) + val mutable variable = 0 + method some_method = variable <- 1 + end diff --git a/Task/Classes/Oberon-2/classes.oberon-2 b/Task/Classes/Oberon-2/classes.oberon-2 new file mode 100644 index 0000000000..3bed87e3b4 --- /dev/null +++ b/Task/Classes/Oberon-2/classes.oberon-2 @@ -0,0 +1,22 @@ +MODULE M; + + TYPE + T = POINTER TO TDesc; + TDesc = RECORD + x: INTEGER + END; + + PROCEDURE New*(): T; + VAR t: T; + BEGIN + NEW(t); t.x := 0; + RETURN t + END New; + + + PROCEDURE (t: T) Increment*; + BEGIN + INC(t.x) + END Increment; + +END M. diff --git a/Task/Classes/Objeck/classes.objeck b/Task/Classes/Objeck/classes.objeck new file mode 100644 index 0000000000..77435dc3c8 --- /dev/null +++ b/Task/Classes/Objeck/classes.objeck @@ -0,0 +1,33 @@ +bundle Default { + class MyClass { + @var : Int; + + New() { + } + + method : public : SomeMethod() ~ Nil { + @var := 1; + } + + method : public : SetVar(var : Int) ~ Nil { + @var := var; + } + + method : public : GetVar() ~ Int { + return @var; + } + } + + class Test { + function : Main(args : String[]) ~ Nil { + inst := MyClass->New(); + inst->GetVar()->PrintLine(); + + inst->SomeMethod(); + inst->GetVar()->PrintLine(); + + inst->SetVar(15); + inst->GetVar()->PrintLine(); + } + } +} diff --git a/Task/Classes/Object-Pascal/classes.object b/Task/Classes/Object-Pascal/classes.object new file mode 100644 index 0000000000..580a65f02f --- /dev/null +++ b/Task/Classes/Object-Pascal/classes.object @@ -0,0 +1,35 @@ +type + MyClass = object + variable: integer; + constructor init; + destructor done; + procedure someMethod; + end; + +constructor MyClass.init; + begin + variable := 0; + end; + +procedure MyClass.someMethod; + begin + variable := 1; + end; + +var + instance: MyClass; { as variable } + pInstance: ^MyClass; { on free store } + +begin + { create instances } + instance.init; + new(pInstance, init); { alternatively: pInstance := new(MyClass, init); } + + { call method } + instance.someMethod; + pInstance^.someMethod; + + { get rid of the objects } + instance.done; + dispose(pInstance, done); +end; diff --git a/Task/Classes/Objective-C/classes-1.m b/Task/Classes/Objective-C/classes-1.m new file mode 100644 index 0000000000..b495189c08 --- /dev/null +++ b/Task/Classes/Objective-C/classes-1.m @@ -0,0 +1,11 @@ +// There are no class variables, so static variables are used. +static int myClassVariable = 0; + +@interface MyClass : NSObject +{ + int variable; // instance variable +} + +- (int)variable; // Typical accessor - you should use the same name as the variable + +@end diff --git a/Task/Classes/Objective-C/classes-2.m b/Task/Classes/Objective-C/classes-2.m new file mode 100644 index 0000000000..e5c754559b --- /dev/null +++ b/Task/Classes/Objective-C/classes-2.m @@ -0,0 +1,16 @@ +@implementation MyClass + +// Was not declared because init is defined in NSObject +- init +{ + if (self = [super init]) + variable = 0; + return self; +} + +- (int)variable +{ + return variable; +} + +@end diff --git a/Task/Classes/Objective-C/classes-3.m b/Task/Classes/Objective-C/classes-3.m new file mode 100644 index 0000000000..3af6f011c6 --- /dev/null +++ b/Task/Classes/Objective-C/classes-3.m @@ -0,0 +1,8 @@ +// Creating an instance +MyClass *mc = [[MyClass alloc] init]; + +// Sending a message +[mc variable]; + +// Releasing it. When its reference count goes to zero, it will be deallocated +[mc release]; diff --git a/Task/Classes/OxygenBasic/classes.oxy b/Task/Classes/OxygenBasic/classes.oxy new file mode 100644 index 0000000000..f7e2cd7992 --- /dev/null +++ b/Task/Classes/OxygenBasic/classes.oxy @@ -0,0 +1,74 @@ +class SuperString + +indexbase 1 + +union + bstring s + sys bs + sys *y + int *i + byte *b + float *f +end union + +method space(sys n) + s=space n +end method + +method delete() + freememory bs : bs=0 +end method + +method clear() + sys j, le=length + if le then + for j=1 to le : b[j]=0 : next + end if +end method + +method length() as sys + if bs then return i[0] +end method + +method resize(sys n) + sys le=length + if nle + s+=nuls n-le + end if +end method + +method fill(string f) + sys j, ls=length, lf=len f + for j=1 to ls step lf + mid s,j,f + next +end method + +method constructor() +end method + +method destructor + delete +end method + +end class + + +'#recordof SuperString + +'===== +'TESTS +'===== + +new SuperString ss +' +ss.space 100 +ss.resize 8 +ss.fill "abc" +' +print ss.s 'result abcabcab +print ss.b[3] 'result 99: ascii for 'c' +' +del ss diff --git a/Task/Classes/Oz/classes.oz b/Task/Classes/Oz/classes.oz new file mode 100644 index 0000000000..b1b209fe67 --- /dev/null +++ b/Task/Classes/Oz/classes.oz @@ -0,0 +1,24 @@ +declare + class Something + feat + name %% immutable, public attribute (called a "feature") + attr + count %% mutable, private attribute + + %% public method which is used as an initializer + meth init(N) + self.name = N + count := 0 + end + + %% public method + meth increase + count := @count + 1 + end + end +in + %% create an instance + Object = {New Something init("object")} + + %% call a method + {Object increase} diff --git a/Task/Classes/Perl-6/classes-1.pl6 b/Task/Classes/Perl-6/classes-1.pl6 new file mode 100644 index 0000000000..6bfb71feb3 --- /dev/null +++ b/Task/Classes/Perl-6/classes-1.pl6 @@ -0,0 +1,7 @@ +class Camel { has Int $.humps = 1; } + +my Camel $a .= new; +say $a.humps; # Automatically generated accessor method. + +my Camel $b .= new: humps => 2; +say $b.humps; diff --git a/Task/Classes/Perl-6/classes-2.pl6 b/Task/Classes/Perl-6/classes-2.pl6 new file mode 100644 index 0000000000..3eb0c571af --- /dev/null +++ b/Task/Classes/Perl-6/classes-2.pl6 @@ -0,0 +1,26 @@ +class Butterfly { + has Int $!age; # The ! twigil makes it private. + has Str $.name; + has Str $.color; + has Bool $.wings; + + submethod BUILD(:$!name = 'Camelia', :$!age = 2, :$!color = 'pink') { + # BUILD is called by bless. Its primary use is to to control + # object initialization. + $!wings = $!age > 1; + } + + method flap() { + say ($.wings + ?? 'Watch out for that hurricane!' + !! 'No wings to flap.'); + } +} + +my Butterfly $a .= new: age => 5; +say "Name: {$a.name}, Color: {$a.color}"; +$a.flap; + +my Butterfly $b .= new(name => 'Osgood', age => 4); +say "Name: {$b.name}, Color: {$b.color}"; +$b.flap; diff --git a/Task/Classes/Pop11/classes-1.pop11 b/Task/Classes/Pop11/classes-1.pop11 new file mode 100644 index 0000000000..6e72ceb53b --- /dev/null +++ b/Task/Classes/Pop11/classes-1.pop11 @@ -0,0 +1,4 @@ +uses objectclass; +define :class MyClass; + slot value = 1; +enddefine; diff --git a/Task/Classes/Pop11/classes-2.pop11 b/Task/Classes/Pop11/classes-2.pop11 new file mode 100644 index 0000000000..1839a4edcc --- /dev/null +++ b/Task/Classes/Pop11/classes-2.pop11 @@ -0,0 +1,13 @@ +;;; Construct instance with default slot values +lvars instance1 = newMyClass(); +;;; Construct instance with explicitely given slot values +lvars instance2 = consMyClass(15); +;;; Print slot value using dot notation +instance1.value => +instance2.value => +;;; Print slot value using funtional notation +value(instance1) => +;;; Change slot value +12 -> value(instance1); +;;; Print it +value(instance1) => diff --git a/Task/Classes/Pop11/classes-3.pop11 b/Task/Classes/Pop11/classes-3.pop11 new file mode 100644 index 0000000000..9b14ea3c59 --- /dev/null +++ b/Task/Classes/Pop11/classes-3.pop11 @@ -0,0 +1,6 @@ +define :method reset(x : MyClass); + 0 -> value(x); +enddefine; +reset(instance1); +;;; Print it +instance1 => diff --git a/Task/Classes/PureBasic/classes-1.purebasic b/Task/Classes/PureBasic/classes-1.purebasic new file mode 100644 index 0000000000..c5ce8ec193 --- /dev/null +++ b/Task/Classes/PureBasic/classes-1.purebasic @@ -0,0 +1,56 @@ +Interface OO_Interface ; Interface for any value of this type + Get.i() + Set(Value.i) + ToString.s() + Destroy() +EndInterface + +Structure OO_Structure ; The *VTable structure + Get.i + Set.i + ToString.i + Destroy.i +EndStructure + +Structure OO_Var + *VirtualTable.OO_Structure + Value.i +EndStructure + +Procedure OO_Get(*Self.OO_Var) + ProcedureReturn *Self\Value +EndProcedure + +Procedure OO_Set(*Self.OO_Var, n) + *Self\Value = n +EndProcedure + +Procedure.s OO_ToString(*Self.OO_Var) + ProcedureReturn Str(*Self\Value) +EndProcedure + +Procedure Create_OO() + *p.OO_Var=AllocateMemory(SizeOf(OO_Var)) + If *p + *p\VirtualTable=?VTable + EndIf + ProcedureReturn *p +EndProcedure + +Procedure OO_Destroy(*Self.OO_Var) + FreeMemory(*Self) +EndProcedure + +DataSection + VTable: + Data.i @OO_Get() + Data.i @OO_Set() + Data.i @OO_ToString() + Data.i @OO_Destroy() +EndDataSection + +;- Test the code +*Foo.OO_Interface = Create_OO() +*Foo\Set(341) +MessageRequester("Info", "Foo = " + *Foo\ToString() ) +*Foo\Destroy() diff --git a/Task/Classes/PureBasic/classes-2.purebasic b/Task/Classes/PureBasic/classes-2.purebasic new file mode 100644 index 0000000000..8580721429 --- /dev/null +++ b/Task/Classes/PureBasic/classes-2.purebasic @@ -0,0 +1,30 @@ +Class Foo + Private Value.i + + BeginPublic + Method Init() + ; Any needed code goes here + EndMethod + + Method Release() + ; Any code befoe freeing the object goes here + EndMethod + + Method Get() + MethodReturn This\Value + EndMethod + + Method Set(n) + This\Value = n + EndMethod + + Method.s ToString() + MethodReturn Str(This\Value) + EndMethod + EndPublic +EndClass + +;- Test the code +*Demo.foo = NewObject.foo() +*Demo\Set(4) +MessageRequester("Info", "Val= " + *Demo\ToString()) diff --git a/Task/Classes/REBOL/classes.rebol b/Task/Classes/REBOL/classes.rebol new file mode 100644 index 0000000000..43d12af41c --- /dev/null +++ b/Task/Classes/REBOL/classes.rebol @@ -0,0 +1,41 @@ +rebol [ + Title: "Classes" + Author: oofoe + Date: 2009-12-11 + URL: http://rosettacode.org/wiki/Classes +] + +; Objects are derived from the base 'object!' type. REBOL uses a +; prototyping object system, so any object can be treated as a class, +; from which to derive others. + +cowboy: make object! [ + name: "Tex" ; Instance variable. + hi: does [ ; Method. + print [self/name ": Howdy!"]] +] + +; I create two instances of the 'cowboy' class. + +tex: make cowboy [] +roy: make cowboy [ + name: "Roy" ; Override 'name' property. +] + +print "Say 'hello', boys:" tex/hi roy/hi +print "" + +; Now I'll subclass 'cowboy'. Subclassing looks a lot like instantiation: + +legend: make cowboy [ + deed: "..." + boast: does [ + print [self/name ": I once" self/deed "!"]] +] + +; Instancing the legend: + +pecos: make legend [name: "Pecos Bill" deed: "lassoed a twister"] + +print "Howdy, Pecos!" pecos/hi +print "Tell us about yourself?" pecos/boast diff --git a/Task/Classes/RapidQ/classes.rapidq b/Task/Classes/RapidQ/classes.rapidq new file mode 100644 index 0000000000..b4b0f3ce15 --- /dev/null +++ b/Task/Classes/RapidQ/classes.rapidq @@ -0,0 +1,17 @@ +TYPE MyClass EXTENDS QObject + Variable AS INTEGER + + CONSTRUCTOR + Variable = 0 + END CONSTRUCTOR + + SUB someMethod + MyClass.Variable = 1 + END SUB +END TYPE + +' create an instance +DIM instance AS MyClass + +' invoke the method +instance.someMethod diff --git a/Task/Classes/Raven/classes-1.raven b/Task/Classes/Raven/classes-1.raven new file mode 100644 index 0000000000..d81e620272 --- /dev/null +++ b/Task/Classes/Raven/classes-1.raven @@ -0,0 +1,7 @@ +class Alpha + 'I am Alpha.' as greeting + define say_hello + greeting print + +class Beta extend Alpha + 'I am Beta!' as greeting diff --git a/Task/Classes/Raven/classes-2.raven b/Task/Classes/Raven/classes-2.raven new file mode 100644 index 0000000000..d71ae69fcc --- /dev/null +++ b/Task/Classes/Raven/classes-2.raven @@ -0,0 +1,2 @@ +Alpha as alpha +Beta as beta diff --git a/Task/Classes/Raven/classes-3.raven b/Task/Classes/Raven/classes-3.raven new file mode 100644 index 0000000000..9547bfb598 --- /dev/null +++ b/Task/Classes/Raven/classes-3.raven @@ -0,0 +1,2 @@ +alpha.say_hello +beta.say_hello diff --git a/Task/Classes/Raven/classes-4.raven b/Task/Classes/Raven/classes-4.raven new file mode 100644 index 0000000000..1345edc80f --- /dev/null +++ b/Task/Classes/Raven/classes-4.raven @@ -0,0 +1,2 @@ +I am Alpha. +I am Beta! diff --git a/Task/Classes/Slate/classes.slate b/Task/Classes/Slate/classes.slate new file mode 100644 index 0000000000..d463397894 --- /dev/null +++ b/Task/Classes/Slate/classes.slate @@ -0,0 +1,12 @@ +prototypes define: #MyPrototype &parents: {Cloneable} &slots: #(instanceVar). +MyPrototype traits addSlot: #classVar. + +x@(MyPrototype traits) new +[ + x clone `>> [instanceVar: 0. ] +]. + +x@(MyPrototype traits) someMethod +[ + x instanceVar = 1 /\ (x classVar = 3) +]. diff --git a/Task/Classes/SuperCollider/classes.supercollider b/Task/Classes/SuperCollider/classes.supercollider new file mode 100644 index 0000000000..39b9cc917e --- /dev/null +++ b/Task/Classes/SuperCollider/classes.supercollider @@ -0,0 +1,22 @@ +MyClass { + classvar someVar, thirdVar; // Class variables. + var <>something, <>somethingElse; // Instance variables. + // Note: variables are private by default. In the above, "<" enables getting, ">" enables setting + + *new { + ^super.new.init // constructor is a class method. typically calls some instance method to set up, here "init" + } + + init { + something = thirdVar.squared; + somethingElse = this.class.name; + } + + *aClassMethod { + ^ someVar + thirdVar // The "^" means to return the result. If not specified, then the object itself will be returned ("^this") + } + + anInstanceMethod { + something = something + 1; + } +} diff --git a/Task/Classes/TIScript/classes.tiscript b/Task/Classes/TIScript/classes.tiscript new file mode 100644 index 0000000000..df4d9cb8bf --- /dev/null +++ b/Task/Classes/TIScript/classes.tiscript @@ -0,0 +1,35 @@ +class Car +{ + //Constructor function. + function this(brand, weight, price = 0) { + this.brand = brand; + this.weight = weight || 1000; // Resort to default value (with 'or' notation). + this._price = price; + } + property price(v) // computable property, special kind of member function + { + get { return this._price; } // getter section + set { this._price = v; } // setter section + } + function toString() { // member function, method of a Car. + return String.printf("<%s>",this.brand); + } +} + +class Truck : Car +{ + function this(brand, size) { + super(brand, 2000); // Call of constructor of super class (Car here) + this.size = size; // Custom property for just this object. + } +} + +var cars = [ // Some example car objects. + new Car("Mazda"), + new Truck("Volvo", 2, 30000) +]; +for (var (i,car) in cars) // TIScript allows enumerate indexes and values +{ + stdout.printf("#%d %s $%d %v %v, %v %v", i, car.brand, car.price, car.weight, car.size, + car instanceof Car, car instanceof Truck); +} diff --git a/Task/Classes/VBA/classes-1.vba b/Task/Classes/VBA/classes-1.vba new file mode 100644 index 0000000000..9bf5c14eb7 --- /dev/null +++ b/Task/Classes/VBA/classes-1.vba @@ -0,0 +1,31 @@ +Private Const m_default = 10 +Private m_bar As Integer + +Private Sub Class_Initialize() + 'constructor, can be used to set default values + m_bar = m_default +End Sub + +Private Sub Class_Terminate() + 'destructor, can be used to do some cleaning up + 'here we just print a message + Debug.Print "---object destroyed---" +End Sub +Property Let Bar(value As Integer) + m_bar = value +End Property + +Property Get Bar() As Integer + Bar = m_bar +End Property + +Function DoubleBar() + m_bar = m_bar * 2 +End Function + +Function MultiplyBar(x As Integer) + 'another method + MultiplyBar = m_bar * x + 'Note: instead of using the instance variable m_bar we could refer to the Bar property of this object using the special word "Me": + ' MultiplyBar = Me.Bar * x +End Function diff --git a/Task/Classes/VBA/classes-2.vba b/Task/Classes/VBA/classes-2.vba new file mode 100644 index 0000000000..f60222cc5f --- /dev/null +++ b/Task/Classes/VBA/classes-2.vba @@ -0,0 +1,37 @@ +Public Sub foodemo() +'declare and create separately +Dim f As Foo +Dim f0 As Foo + +Set f = New Foo + +'set property +f.Bar = 25 +'call method +f.DoubleBar +'alternative +Call f.DoubleBar +Debug.Print "f.Bar is "; f.Bar +Debug.Print "Five times f.Bar is "; f.MultiplyBar(5) + +'declare and create at the same time +Dim f2 As New Foo +Debug.Print "f2.Bar is "; f2.Bar 'prints default value + +'destroy an object +Set f = Nothing + +'create an object or not, depending on a random number: +If Rnd() < 0.5 Then + Set f0 = New Foo +End If +'check if object actually exists +If f0 Is Nothing Then + Debug.Print "object f0 does not exist" +Else + Debug.Print "object f0 was created" +End If +'at the end of execution all remaining objects created in this sub will be released. +'this will trigger one or two "object destroyed" messages +'depending on whether f0 was created... +End Sub diff --git a/Task/Classes/Visual-Basic-.NET/classes-1.visual b/Task/Classes/Visual-Basic-.NET/classes-1.visual new file mode 100644 index 0000000000..09658d50c4 --- /dev/null +++ b/Task/Classes/Visual-Basic-.NET/classes-1.visual @@ -0,0 +1,29 @@ +Class Foo + Private m_Bar As Integer + + Public Sub New() + + End Sub + + Public Sub New(ByVal bar As Integer) + m_Bar = bar + End Sub + + Public Property Bar() As Integer + Get + Return m_Bar + End Get + Set(ByVal value As Integer) + m_Bar = value + End Set + End Property + + Public Sub DoubleBar() + m_Bar *= 2 + End Sub + + Public Function MultiplyBar(ByVal x As Integer) As Integer + Return x * Bar + End Function + +End Class diff --git a/Task/Classes/Visual-Basic-.NET/classes-2.visual b/Task/Classes/Visual-Basic-.NET/classes-2.visual new file mode 100644 index 0000000000..2319cc46f9 --- /dev/null +++ b/Task/Classes/Visual-Basic-.NET/classes-2.visual @@ -0,0 +1,22 @@ +'Declare and create separately +Dim foo1 As Foo +foo1 = New Foo + +'Declare and create at the same time +Dim foo2 As New Foo + +'... while passing constructor parameters +Dim foo3 As New Foo(5) + +'... and them immediately set properties +Dim foo4 As New Foo With {.Bar = 10} + +'Calling a method that returns a value +Console.WriteLine(foo4.MultiplyBar(20)) + +'Calling a method that performs an action +foo4.DoubleBar() + +'Reading/writing properties +Console.WriteLine(foo4.Bar) +foo4.Bar = 1000 diff --git a/Task/Closest-pair-problem/Mathematica/closest-pair-problem.mathematica b/Task/Closest-pair-problem/Mathematica/closest-pair-problem.math similarity index 100% rename from Task/Closest-pair-problem/Mathematica/closest-pair-problem.mathematica rename to Task/Closest-pair-problem/Mathematica/closest-pair-problem.math diff --git a/Task/Closest-pair-problem/OCaml/closest-pair-problem.ocaml b/Task/Closest-pair-problem/OCaml/closest-pair-problem.ocaml new file mode 100644 index 0000000000..ae8c405080 --- /dev/null +++ b/Task/Closest-pair-problem/OCaml/closest-pair-problem.ocaml @@ -0,0 +1,122 @@ +type point = { x : float; y : float } + + +let cmpPointX (a : point) (b : point) = compare a.x b.x +let cmpPointY (a : point) (b : point) = compare a.y b.y + + +let distSqrd (seg : (point * point) option) = + match seg with + | None -> max_float + | Some(line) -> + let a = fst line in + let b = snd line in + + let dx = a.x -. b.x in + let dy = a.y -. b.y in + + dx*.dx +. dy*.dy + + +let dist seg = + sqrt (distSqrd seg) + + +let shortest l1 l2 = + if distSqrd l1 < distSqrd l2 then + l1 + else + l2 + + +let halve l = + let n = List.length l in + BatList.split_at (n/2) l + + +let rec closestBoundY from maxY (ptsByY : point list) = + match ptsByY with + | [] -> None + | hd :: tl -> + if hd.y > maxY then + None + else + let toHd = Some(from, hd) in + let bestToRest = closestBoundY from maxY tl in + shortest toHd bestToRest + + +let rec closestInRange ptsByY maxDy = + match ptsByY with + | [] -> None + | hd :: tl -> + let fromHd = closestBoundY hd (hd.y +. maxDy) tl in + let fromRest = closestInRange tl maxDy in + shortest fromHd fromRest + + +let rec closestPairByX (ptsByX : point list) = + if List.length ptsByX < 2 then + None + else + let (left, right) = halve ptsByX in + let leftResult = closestPairByX left in + let rightResult = closestPairByX right in + + let bestInHalf = shortest leftResult rightResult in + let bestLength = dist bestInHalf in + + let divideX = (List.hd right).x in + let inBand = List.filter(fun(p) -> abs_float(p.x -. divideX) < bestLength) ptsByX in + + let byY = List.sort cmpPointY inBand in + let bestCross = closestInRange byY bestLength in + shortest bestInHalf bestCross + + +let closestPair pts = + let ptsByX = List.sort cmpPointX pts in + closestPairByX ptsByX + + +let parsePoint str = + let sep = Str.regexp_string "," in + let tokens = Str.split sep str in + let xStr = List.nth tokens 0 in + let yStr = List.nth tokens 1 in + + let xVal = (float_of_string xStr) in + let yVal = (float_of_string yStr) in + + { x = xVal; y = yVal } + + +let loadPoints filename = + let ic = open_in filename in + let result = ref [] in + try + while true do + let s = input_line ic in + if s <> "" then + let p = parsePoint s in + result := p :: !result; + done; + !result + with End_of_file -> + close_in ic; + !result +;; + +let loaded = (loadPoints "Points.txt") in +let start = Sys.time() in +let c = closestPair loaded in +let taken = Sys.time() -. start in +Printf.printf "Took %f [s]\n" taken; + +match c with +| None -> Printf.printf "No closest pair\n" +| Some(seg) -> + let a = fst seg in + let b = snd seg in + + Printf.printf "(%f, %f) (%f, %f) Dist %f\n" a.x a.y b.x b.y (dist c) diff --git a/Task/Closest-pair-problem/Oz/closest-pair-problem.oz b/Task/Closest-pair-problem/Oz/closest-pair-problem.oz new file mode 100644 index 0000000000..7f42e97a53 --- /dev/null +++ b/Task/Closest-pair-problem/Oz/closest-pair-problem.oz @@ -0,0 +1,99 @@ +declare + fun {Distance X1#Y1 X2#Y2} + {Sqrt {Pow X2-X1 2.0} + {Pow Y2-Y1 2.0}} + end + + %% brute force + fun {BFClosestPair Points=P1|P2|_} + Ps = {List.toTuple unit Points} %% for efficient random access + N = {Width Ps} + MinDist = {NewCell {Distance P1 P2}} + MinPoints = {NewCell P1#P2} + in + for I in 1..N-1 do + for J in I+1..N do + IJDist = {Distance Ps.I Ps.J} + in + if IJDist < @MinDist then + MinDist := IJDist + MinPoints := Ps.I#Ps.J + end + end + end + @MinPoints + end + + %% divide and conquer + fun {ClosestPair Points} + case {ClosestPair2 + {Sort Points {LessThanBy X}} + {Sort Points {LessThanBy Y}}} + of Distance#Pair then + Pair + end + end + + %% XP: points sorted by X, YP: sorted by Y + %% returns a pair Distance#Pair + fun {ClosestPair2 XP YP} + N = {Length XP} = {Length YP} + in + if N =< 3 then + P = {BFClosestPair XP} + in + {Distance P.1 P.2}#P + else + XL XR + {List.takeDrop XP (N div 2) ?XL ?XR} + XM = {Nth XP (N div 2)}.X + YL YR + {List.partition YP fun {$ P} P.X =< XM end ?YL ?YR} + DL#PairL = {ClosestPair2 XL YL} + DR#PairR = {ClosestPair2 XR YR} + DMin#PairMin = if DL < DR then DL#PairL else DR#PairR end + YSList = {Filter YP fun {$ P} {Abs XM-P.X} < DMin end} + YS = {List.toTuple unit YSList} %% for efficient random access + NS = {Width YS} + Closest = {NewCell DMin} + ClosestPair = {NewCell PairMin} + in + for I in 1..NS-1 do + for K in I+1..NS while:YS.K.Y - YS.I.Y < DMin do + DistKI = {Distance YS.K YS.I} + in + if DistKI < @Closest then + Closest := DistKI + ClosestPair := YS.K#YS.I + end + end + end + @Closest#@ClosestPair + end + end + + %% To access components when points are represented as pairs + X = 1 + Y = 2 + + %% returns a less-than predicate that accesses feature F + fun {LessThanBy F} + fun {$ A B} + A.F < B.F + end + end + + fun {Random Min Max} + Min + + {Int.toFloat {OS.rand}} * (Max-Min) + / {Int.toFloat {OS.randLimits _}} + end + + fun {RandomPoint} + {Random 0.0 100.0}#{Random 0.0 100.0} + end + + Points = {MakeList 5} +in + {ForAll Points RandomPoint} + {Show Points} + {Show {ClosestPair Points}} diff --git a/Task/Closest-pair-problem/PARI-GP/closest-pair-problem.pari b/Task/Closest-pair-problem/PARI-GP/closest-pair-problem.pari new file mode 100644 index 0000000000..f41ae6f72a --- /dev/null +++ b/Task/Closest-pair-problem/PARI-GP/closest-pair-problem.pari @@ -0,0 +1,12 @@ +closestPair(v)={ + my(r=norml2(v[1]-v[2]),at=[1,2]); + for(a=1,#v-1, + for(b=a+1,#v, + if(norml2(v[a]-v[b]) 0 then + if distance < min_distance then + do; + min_distance = distance; + ii = i; jj = j; + end; + end; + end; + put skip edit ('The minimum distance ', min_distance, + ' is between the points [', P.x(ii), + ',', P.y(ii), '] and [', P.x(jj), ',', P.y(jj), ']' ) + (a, f(6,2)); + end; +end closest; diff --git a/Task/Closest-pair-problem/Perl-6/closest-pair-problem.pl6 b/Task/Closest-pair-problem/Perl-6/closest-pair-problem.pl6 new file mode 100644 index 0000000000..b87c283417 --- /dev/null +++ b/Task/Closest-pair-problem/Perl-6/closest-pair-problem.pl6 @@ -0,0 +1,77 @@ +sub MAIN ($N = 5000) { + my @points = (^$N).map: { [rand * 20 - 10, rand * 20 - 10] } + + my ($af, $bf, $df) = closest_pair(@points); + say "fast $df at [$af], [$bf]"; + + my ($as, $bs, $ds) = closest_pair_simple(@points); + say "slow $ds at [$as], [$bs]"; +} + +sub dist-squared($a,$b) { + ($a[0] - $b[0]) ** 2 + + ($a[1] - $b[1]) ** 2; +} + +sub closest_pair_simple(@arr is copy) { + return Inf if @arr < 2; + my ($a, $b, $d) = @arr[0,1], dist-squared(|@arr[0,1]); + while @arr { + my $p = pop @arr; + for @arr -> $l { + my $t = dist-squared($p, $l); + ($a, $b, $d) = $p, $l, $t if $t < $d; + } + } + return $a, $b, sqrt $d; +} + +sub closest_pair(@r) { + my @ax = @r.sort: { .[0] } + my @ay = @r.sort: { .[1] } + return closest_pair_real(@ax, @ay); +} + +sub closest_pair_real(@rx, @ry) { + return closest_pair_simple(@rx) if @rx <= 3; + + my @xP = @rx; + my @yP = @ry; + my $N = @xP; + + my $midx = ceiling($N/2)-1; + + my @PL = @xP[0 .. $midx]; + my @PR = @xP[$midx+1 ..^ $N]; + + my $xm = @xP[$midx][0]; + + my @yR; + my @yL; + push ($_[0] <= $xm ?? @yR !! @yL), $_ for @yP; + + my ($al, $bl, $dL) = closest_pair_real(@PL, @yR); + my ($ar, $br, $dR) = closest_pair_real(@PR, @yL); + + my ($m1, $m2, $dmin) = $dR < $dL + ?? ($ar, $br, $dR) + !! ($al, $bl, $dL); + + my @yS = @yP.grep: { abs($xm - .[0]) < $dmin } + + if @yS { + my ($w1, $w2, $closest) = $m1, $m2, $dmin; + for 0 ..^ @yS.end -> $i { + for $i+1 ..^ @yS -> $k { + last unless @yS[$k][1] - @yS[$i][1] < $dmin; + my $d = sqrt dist-squared(@yS[$k], @yS[$i]); + ($w1, $w2, $closest) = @yS[$k], @yS[$i], $d if $d < $closest; + } + + } + return $w1, $w2, $closest; + + } else { + return $m1, $m2, $dmin; + } +} diff --git a/Task/Closest-pair-problem/PureBasic/closest-pair-problem-1.purebasic b/Task/Closest-pair-problem/PureBasic/closest-pair-problem-1.purebasic new file mode 100644 index 0000000000..ca2b8bec92 --- /dev/null +++ b/Task/Closest-pair-problem/PureBasic/closest-pair-problem-1.purebasic @@ -0,0 +1,19 @@ +Procedure.d bruteForceClosestPair(Array P.coordinate(1)) + Protected N=ArraySize(P()), i, j + Protected mindistance.f=Infinity(), t.d + Shared a, b + If N<2 + a=0: b=0 + Else + For i=0 To N-1 + For j=i+1 To N + t=Pow(Pow(P(i)\x-P(j)\x,2)+Pow(P(i)\y-P(j)\y,2),0.5) + If mindistance>t + mindistance=t + a=i: b=j + EndIf + Next + Next + EndIf + ProcedureReturn mindistance +EndProcedure diff --git a/Task/Closest-pair-problem/PureBasic/closest-pair-problem-2.purebasic b/Task/Closest-pair-problem/PureBasic/closest-pair-problem-2.purebasic new file mode 100644 index 0000000000..b3305dcf92 --- /dev/null +++ b/Task/Closest-pair-problem/PureBasic/closest-pair-problem-2.purebasic @@ -0,0 +1,29 @@ +Structure coordinate + x.d + y.d +EndStructure + +Dim DataSet.coordinate(9) +Define i, x.d, y.d, a, b + +;- Load data from datasection +Restore DataPoints +For i=0 To 9 + Read.d x: Read.d y + DataSet(i)\x=x + DataSet(i)\y=y +Next i + +If OpenConsole() + PrintN("Mindistance= "+StrD(bruteForceClosestPair(DataSet()),6)) + PrintN("Point 1= "+StrD(DataSet(a)\x,6)+": "+StrD(DataSet(a)\y,6)) + PrintN("Point 2= "+StrD(DataSet(b)\x,6)+": "+StrD(DataSet(b)\y,6)) + Print(#CRLF$+"Press ENTER to quit"): Input() +EndIf + +DataSection + DataPoints: + Data.d 0.654682, 0.925557, 0.409382, 0.619391, 0.891663, 0.888594 + Data.d 0.716629, 0.996200, 0.477721, 0.946355, 0.925092, 0.818220 + Data.d 0.624291, 0.142924, 0.211332, 0.221507, 0.293786, 0.691701, 0.839186, 0.72826 +EndDataSection diff --git a/Task/Closest-pair-problem/Run-BASIC/closest-pair-problem.run b/Task/Closest-pair-problem/Run-BASIC/closest-pair-problem.run new file mode 100644 index 0000000000..084246c539 --- /dev/null +++ b/Task/Closest-pair-problem/Run-BASIC/closest-pair-problem.run @@ -0,0 +1,41 @@ +n =10 ' 10 data points input +dim x(n) +dim y(n) + +pt1 = 0 ' 1st point +pt2 = 0 ' 2nd point + +for i =1 to n ' read in data + read x(i) + read y(i) +next i + +minDist = 1000000 + +for i =1 to n -1 + for j =i +1 to n + distXsq =(x(i) -x(j))^2 + disYsq =(y(i) -y(j))^2 + d =abs((dxSq +disYsq)^0.5) + if d Infinity then + result := [] (points[savei], points[savej]); + end if; + end func; diff --git a/Task/Closest-pair-problem/Ursala/closest-pair-problem-1.ursala b/Task/Closest-pair-problem/Ursala/closest-pair-problem-1.ursala new file mode 100644 index 0000000000..63a498e757 --- /dev/null +++ b/Task/Closest-pair-problem/Ursala/closest-pair-problem-1.ursala @@ -0,0 +1,3 @@ +#import flo + +clop = @iiK0 fleq$-&l+ *EZF ^\~& plus+ sqr~~+ minus~~bbI diff --git a/Task/Closest-pair-problem/Ursala/closest-pair-problem-2.ursala b/Task/Closest-pair-problem/Ursala/closest-pair-problem-2.ursala new file mode 100644 index 0000000000..9267191228 --- /dev/null +++ b/Task/Closest-pair-problem/Ursala/closest-pair-problem-2.ursala @@ -0,0 +1,8 @@ +#import std +#import flo + +clop = + +^(fleq-<&l,fleq-<&r); @blrNCCS ~&lrbhthPX2X+ ~&a^& fleq$-&l+ leql/8?al\^(eudist,~&)*altK33htDSL -+ + ^C/~&rr ^(eudist,~&)*tK33htDSL+ @rlrlPXPlX ~| fleq^\~&lr abs+ minus@llPrhPX, + ^/~&ar @farlK30K31XPGbrlrjX3J ^/~&arlhh @W lesser fleq@bl+- diff --git a/Task/Closest-pair-problem/Ursala/closest-pair-problem-3.ursala b/Task/Closest-pair-problem/Ursala/closest-pair-problem-3.ursala new file mode 100644 index 0000000000..713ad72693 --- /dev/null +++ b/Task/Closest-pair-problem/Ursala/closest-pair-problem-3.ursala @@ -0,0 +1,23 @@ +test_data = + +< + (1.547290e+00,3.313053e+00), + (5.250805e-01,-7.300260e+00), + (7.062114e-02,1.220251e-02), + (-4.473024e+00,-5.393712e+00), + (-2.563714e+00,-3.595341e+00), + (-2.132372e+00,2.358850e+00), + (2.366238e+00,-9.678425e+00), + (-1.745694e+00,3.276434e+00), + (8.066843e+00,-9.101268e+00), + (-8.256901e+00,-8.717900e+00), + (7.397744e+00,-5.366434e+00), + (2.060291e-01,2.840891e+00), + (-6.935319e+00,-5.192438e+00), + (9.690418e+00,-9.175753e+00), + (3.448993e+00,2.119052e+00), + (-7.769218e+00,4.647406e-01)> + +#cast %eeWWA + +example = clop test_data diff --git a/Task/Closest-pair-problem/XPL0/closest-pair-problem.xpl0 b/Task/Closest-pair-problem/XPL0/closest-pair-problem.xpl0 new file mode 100644 index 0000000000..f073aa7eee --- /dev/null +++ b/Task/Closest-pair-problem/XPL0/closest-pair-problem.xpl0 @@ -0,0 +1,37 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations + +proc ClosestPair(P, N); \Show closest pair of points in array P +real P; int N; +real Dist2, MinDist2; +int I, J, SI, SJ; +[MinDist2:= 1e300; +for I:= 0 to N-2 do + [for J:= I+1 to N-1 do + [Dist2:= sq(P(I,0)-P(J,0)) + sq(P(I,1)-P(J,1)); + if Dist2 < MinDist2 then \squared distances are sufficient for compares + [MinDist2:= Dist2; + SI:= I; SJ:= J; + ]; + ]; + ]; +IntOut(0, SI); Text(0, " -- "); IntOut(0, SJ); CrLf(0); +RlOut(0, P(SI,0)); Text(0, ","); RlOut(0, P(SI,1)); +Text(0, " -- "); +RlOut(0, P(SJ,0)); Text(0, ","); RlOut(0, P(SJ,1)); +CrLf(0); +]; + +real Data; +[Format(1, 6); +Data:= [[0.654682, 0.925557], \0 test data from BASIC examples + [0.409382, 0.619391], \1 + [0.891663, 0.888594], \2 + [0.716629, 0.996200], \3 + [0.477721, 0.946355], \4 + [0.925092, 0.818220], \5 + [0.624291, 0.142924], \6 + [0.211332, 0.221507], \7 + [0.293786, 0.691701], \8 + [0.839186, 0.728260]]; \9 +ClosestPair(Data, 10); +] diff --git a/Task/Collections/Mathematica/collections.mathematica b/Task/Collections/Mathematica/collections.math similarity index 100% rename from Task/Collections/Mathematica/collections.mathematica rename to Task/Collections/Mathematica/collections.math diff --git a/Task/Collections/NetRexx/collections.netrexx b/Task/Collections/NetRexx/collections.netrexx new file mode 100644 index 0000000000..5bdfe3fa0c --- /dev/null +++ b/Task/Collections/NetRexx/collections.netrexx @@ -0,0 +1,16 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +myVals = [ 'zero', 'one', 'two', 'three', 'four', 'five' ] +mySet = Set +mySet = HashSet() + +loop val over myVals + mySet.add(val) + end val + +loop val over mySet + say val + end val + +return diff --git a/Task/Collections/OCaml/collections-1.ocaml b/Task/Collections/OCaml/collections-1.ocaml new file mode 100644 index 0000000000..c7a73a4771 --- /dev/null +++ b/Task/Collections/OCaml/collections-1.ocaml @@ -0,0 +1 @@ +[1; 2; 3; 4; 5] diff --git a/Task/Collections/OCaml/collections-2.ocaml b/Task/Collections/OCaml/collections-2.ocaml new file mode 100644 index 0000000000..348f33ce59 --- /dev/null +++ b/Task/Collections/OCaml/collections-2.ocaml @@ -0,0 +1 @@ +1 :: [2; 3; 4; 5] diff --git a/Task/Collections/OCaml/collections-3.ocaml b/Task/Collections/OCaml/collections-3.ocaml new file mode 100644 index 0000000000..fdead9c299 --- /dev/null +++ b/Task/Collections/OCaml/collections-3.ocaml @@ -0,0 +1 @@ +[1; 2] @ [3; 4; 5] diff --git a/Task/Collections/OCaml/collections-4.ocaml b/Task/Collections/OCaml/collections-4.ocaml new file mode 100644 index 0000000000..077fac1e71 --- /dev/null +++ b/Task/Collections/OCaml/collections-4.ocaml @@ -0,0 +1,2 @@ +# List.flatten [[1; 2]; [3; 4]; [5; 6; 7]] ;; +- : int list = [1; 2; 3; 4; 5; 6; 7] diff --git a/Task/Collections/OCaml/collections-5.ocaml b/Task/Collections/OCaml/collections-5.ocaml new file mode 100644 index 0000000000..681001ee42 --- /dev/null +++ b/Task/Collections/OCaml/collections-5.ocaml @@ -0,0 +1 @@ +[| 1; 2; 3; 4; 5 |] diff --git a/Task/Collections/Objeck/collections-1.objeck b/Task/Collections/Objeck/collections-1.objeck new file mode 100644 index 0000000000..b870f59e76 --- /dev/null +++ b/Task/Collections/Objeck/collections-1.objeck @@ -0,0 +1,4 @@ +values := IntVector->New(); +values->AddBack(7); +values->AddBack(3); +values->AddBack(10); diff --git a/Task/Collections/Objeck/collections-2.objeck b/Task/Collections/Objeck/collections-2.objeck new file mode 100644 index 0000000000..6f5b1f63fc --- /dev/null +++ b/Task/Collections/Objeck/collections-2.objeck @@ -0,0 +1,4 @@ +values := IntList->New(); +values->AddBack(7); +values->AddBack(3); +values->AddBack(10); diff --git a/Task/Collections/Objeck/collections-3.objeck b/Task/Collections/Objeck/collections-3.objeck new file mode 100644 index 0000000000..9d7c826f1b --- /dev/null +++ b/Task/Collections/Objeck/collections-3.objeck @@ -0,0 +1,4 @@ +values := StringHash->New(); +values->Insert("seven", IntHolder->New(7)); +values->Insert("three", IntHolder->New(3)); +values->Insert("ten", IntHolder->New(10)); diff --git a/Task/Collections/Objeck/collections-4.objeck b/Task/Collections/Objeck/collections-4.objeck new file mode 100644 index 0000000000..1fc4080f3d --- /dev/null +++ b/Task/Collections/Objeck/collections-4.objeck @@ -0,0 +1,4 @@ +values := IntStack->New(); +values->Push(7); +values->Push(3); +values->Push(10); diff --git a/Task/Collections/Objective-C/collections.m b/Task/Collections/Objective-C/collections.m new file mode 100644 index 0000000000..90b8fde42c --- /dev/null +++ b/Task/Collections/Objective-C/collections.m @@ -0,0 +1,60 @@ +#import + +void show_collection(id coll) +{ + id el; + NSEnumerator *en; + if ( [coll respondsToSelector: @selector(keyEnumerator)] ) { + en = [coll keyEnumerator]; + } else { + en = [coll objectEnumerator]; + } + while( (el = [en nextObject]) != nil) + { + if ( [coll respondsToSelector: @selector(countForObject:)] ) { + NSLog(@"%@ appears %d times", el, [coll countForObject: el]); + } else if ( [coll isKindOfClass: [NSDictionary class]] ) { + NSLog(@"%@ -> %@", el, [coll valueForKey: el]); + } else { + NSLog(@"%@", el); + } + } + printf("\n"); +} + +int main() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + // create an empty set + NSMutableSet *set = [[NSMutableSet alloc] init]; + // populate it + [set addObject: @"one"]; + [set addObject: [NSNumber numberWithInt: 10]]; + [set addObjectsFromArray: [NSArray arrayWithObjects: @"one", + [NSNumber numberWithInt: 20], + [NSNumber numberWithInt: 10], + @"two", nil] ]; + // let's show it + show_collection(set); + + // create an empty counted set (a bag) + NSCountedSet *cset = [[NSCountedSet alloc] init]; + // populate it + [cset addObject: @"one"]; + [cset addObject: @"one"]; + [cset addObject: @"two"]; + // show it + show_collection(cset); + + // create a dictionary + NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; + // populate it + [dict setValue: [NSNumber numberWithInt: 4] forKey: @"four"]; + [dict setValue: [NSNumber numberWithInt: 8] forKey: @"eight"]; + // show it + show_collection(dict); + + [pool release]; + return EXIT_SUCCESS; +} diff --git a/Task/Collections/Oz/collections.oz b/Task/Collections/Oz/collections.oz new file mode 100644 index 0000000000..c9b9b09115 --- /dev/null +++ b/Task/Collections/Oz/collections.oz @@ -0,0 +1,25 @@ +declare + %% Lists (immutable, recursive) + Xs = [1 2 3 4] + %% Add element at the front (cons) + Xs0 = 0|Xs + {Show {Length Xs}} %% output: 4 + + %% Records (immutable maps with a label) + Rec = label(1:2 symbol:3) + {Show Rec} %% output: label(2 symbol:3) + {Show Rec.1} %% output: 2 + %% create a new record with an added field + Rec2 = {AdjoinAt Rec 2 value} + {Show Rec2} %% output: label(2 value symbol:3) + + %% Dictionaries (mutable maps) + Dict = {Dictionary.new} + Dict.1 := 1 + Dict.symbol := 3 + {Show Dict.1} %% output: 1 + + %% Arrays (mutable with integer keys) + Arr = {Array.new 1 10 initValue} + Arr.1 := 3 + {Show Arr.1} %% output: 3 diff --git a/Task/Collections/PARI-GP/collections-1.pari b/Task/Collections/PARI-GP/collections-1.pari new file mode 100644 index 0000000000..9f466035e7 --- /dev/null +++ b/Task/Collections/PARI-GP/collections-1.pari @@ -0,0 +1,8 @@ +v = vector(0); +v = []; +cv = vectorv(0); +cv = []~; +m = matrix(1,1); +s = Set(v); +l = List(v); +vs = vectorsmall(0); diff --git a/Task/Collections/PARI-GP/collections-2.pari b/Task/Collections/PARI-GP/collections-2.pari new file mode 100644 index 0000000000..5d446db9c1 --- /dev/null +++ b/Task/Collections/PARI-GP/collections-2.pari @@ -0,0 +1,3 @@ +listput(l, "hello world") +v=concat(v, [1,2,3]); +v=concat(v, 4); diff --git a/Task/Collections/PL-I/collections.pli b/Task/Collections/PL-I/collections.pli new file mode 100644 index 0000000000..eab87b979d --- /dev/null +++ b/Task/Collections/PL-I/collections.pli @@ -0,0 +1,4 @@ + declare countries character (20) varying controlled; + allocate countries initial ('Britain'); + allocate countries initial ('America'); + allocate countries initial ('Argentina'); diff --git a/Task/Collections/Pascal/collections-1.pascal b/Task/Collections/Pascal/collections-1.pascal new file mode 100644 index 0000000000..0df088d979 --- /dev/null +++ b/Task/Collections/Pascal/collections-1.pascal @@ -0,0 +1,5 @@ +var + MyArray: array[1..5] of real; +begin + MyArray[1] := 4.35; +end; diff --git a/Task/Collections/Pascal/collections-2.pascal b/Task/Collections/Pascal/collections-2.pascal new file mode 100644 index 0000000000..f543f975c3 --- /dev/null +++ b/Task/Collections/Pascal/collections-2.pascal @@ -0,0 +1,6 @@ +var + MyArray: array of integer; +begin + setlength (MyArray, 10); + MyArray[4] := 99; +end; diff --git a/Task/Collections/Pascal/collections-3.pascal b/Task/Collections/Pascal/collections-3.pascal new file mode 100644 index 0000000000..e6369c0f07 --- /dev/null +++ b/Task/Collections/Pascal/collections-3.pascal @@ -0,0 +1,11 @@ +var + MyRecord: record + x, y, z: real; + presence: boolean; + end; +begin + MyRecord.x := 0.3; + MyRecord.y := 3.2; + MyRecord.z := -4.0; + MyRecord.presence := true; +end; diff --git a/Task/Collections/Pascal/collections-4.pascal b/Task/Collections/Pascal/collections-4.pascal new file mode 100644 index 0000000000..54b3b222a9 --- /dev/null +++ b/Task/Collections/Pascal/collections-4.pascal @@ -0,0 +1,9 @@ +type + days = (Mon, Tue, Wed, Thu, Fri, Sat, Sun); +var + workDays, week, weekendDays: set of days; +begin + workdays := [Mon, Tue, Wed, Thu, Fri]; + week := workdays + [Sat, Sun]; + weekendDays := week - workdays; +end; diff --git a/Task/Collections/Pascal/collections-5.pascal b/Task/Collections/Pascal/collections-5.pascal new file mode 100644 index 0000000000..844c11efe2 --- /dev/null +++ b/Task/Collections/Pascal/collections-5.pascal @@ -0,0 +1,5 @@ +var + MyString: String; +begin + MyString:= 'Some Text'; +end; diff --git a/Task/Collections/Pascal/collections-6.pascal b/Task/Collections/Pascal/collections-6.pascal new file mode 100644 index 0000000000..a63b4b5362 --- /dev/null +++ b/Task/Collections/Pascal/collections-6.pascal @@ -0,0 +1,19 @@ +program ListDemo; +uses + classes; +var + MyList: TList; + a, b, c: integer; + i: integer; +begin + a := 1; + b := 2; + c := 3; + MyList := TList.Create; + MyList.Add(@a); + MyList.Add(@c); + MyList.Insert(1, @b); + for i := MyList.IndexOf(MyList.First) to MyList.IndexOf(MyList.Last) do + writeln (integer(MyList.Items[i]^)); + MyList.Destroy; +end. diff --git a/Task/Collections/Pascal/collections-7.pascal b/Task/Collections/Pascal/collections-7.pascal new file mode 100644 index 0000000000..4a16ee256f --- /dev/null +++ b/Task/Collections/Pascal/collections-7.pascal @@ -0,0 +1,34 @@ +Program ex34; + +{ Program to demonstrate the TCollection.AtInsert method } + +Uses Objects, MyObject; { For TMyObject definition and registration } + +Var C : PCollection; + M : PMyObject; + I : Longint; + +Procedure PrintField (Dummy : Pointer; P : PMyObject); + +begin + Writeln ('Field : ',P^.GetField); +end; + +begin + Randomize; + C:=New(PCollection, Init(120, 10)); + Writeln ('Inserting 100 records at random places.'); + For I:=1 to 100 do + begin + M:=New(PMyObject, Init); + M^.SetField(I-1); + If I=1 then + C^.Insert(M) + else + With C^ do + AtInsert(Random(Count), M); + end; + Writeln ('Values : '); + C^.Foreach(@PrintField); + Dispose(C, Done); +end. diff --git a/Task/Collections/Perl-6/collections-1.pl6 b/Task/Collections/Perl-6/collections-1.pl6 new file mode 100644 index 0000000000..c6476167c0 --- /dev/null +++ b/Task/Collections/Perl-6/collections-1.pl6 @@ -0,0 +1,2 @@ +my @array = 1,2,3; +@array.push: 4,5,6; diff --git a/Task/Collections/Perl-6/collections-2.pl6 b/Task/Collections/Perl-6/collections-2.pl6 new file mode 100644 index 0000000000..7b0a46d99b --- /dev/null +++ b/Task/Collections/Perl-6/collections-2.pl6 @@ -0,0 +1,3 @@ +my %hash = a => 1, b => 2; +%hash = 3,4; +%hash.push: e => 5, f => 6; diff --git a/Task/Collections/Perl-6/collections-3.pl6 b/Task/Collections/Perl-6/collections-3.pl6 new file mode 100644 index 0000000000..dbd2269cb4 --- /dev/null +++ b/Task/Collections/Perl-6/collections-3.pl6 @@ -0,0 +1,2 @@ +my @list := 1,2,3; +my @newlist := @list, 4,5,6; diff --git a/Task/Collections/Perl-6/collections-4.pl6 b/Task/Collections/Perl-6/collections-4.pl6 new file mode 100644 index 0000000000..3d1ba6c065 --- /dev/null +++ b/Task/Collections/Perl-6/collections-4.pl6 @@ -0,0 +1,2 @@ +my $set = set ; +my $newset = $set ∪ ; diff --git a/Task/Collections/Perl-6/collections-5.pl6 b/Task/Collections/Perl-6/collections-5.pl6 new file mode 100644 index 0000000000..6cbaff4448 --- /dev/null +++ b/Task/Collections/Perl-6/collections-5.pl6 @@ -0,0 +1,2 @@ +my $s = KeySet.new: ; +$s ∪= ; diff --git a/Task/Collections/Perl-6/collections-6.pl6 b/Task/Collections/Perl-6/collections-6.pl6 new file mode 100644 index 0000000000..7aa1952364 --- /dev/null +++ b/Task/Collections/Perl-6/collections-6.pl6 @@ -0,0 +1,2 @@ +my $bag = bag ; +my $newbag = $bag ∪ ; diff --git a/Task/Collections/Perl-6/collections-7.pl6 b/Task/Collections/Perl-6/collections-7.pl6 new file mode 100644 index 0000000000..fee571b488 --- /dev/null +++ b/Task/Collections/Perl-6/collections-7.pl6 @@ -0,0 +1,2 @@ +my $b = KeySet.new: ; +$b ∪= ; diff --git a/Task/Collections/Perl-6/collections-8.pl6 b/Task/Collections/Perl-6/collections-8.pl6 new file mode 100644 index 0000000000..5ee9da14e8 --- /dev/null +++ b/Task/Collections/Perl-6/collections-8.pl6 @@ -0,0 +1,2 @@ +my $tail = d => e => f => Nil; +my $new = a => b => c => $tail; diff --git a/Task/Collections/Perl-6/collections-9.pl6 b/Task/Collections/Perl-6/collections-9.pl6 new file mode 100644 index 0000000000..54e6ff9d1f --- /dev/null +++ b/Task/Collections/Perl-6/collections-9.pl6 @@ -0,0 +1,2 @@ +my $obj = Something.new: foo => 1, bar => 2; +my $newobj = $obj but role { has $.baz = 3 } # anonymous mixin diff --git a/Task/Collections/PureBasic/collections-1.purebasic b/Task/Collections/PureBasic/collections-1.purebasic new file mode 100644 index 0000000000..667992a3d9 --- /dev/null +++ b/Task/Collections/PureBasic/collections-1.purebasic @@ -0,0 +1,4 @@ +Dim Text.s(9) + +Text(3)="Hello" +Text(7)="World!" diff --git a/Task/Collections/PureBasic/collections-2.purebasic b/Task/Collections/PureBasic/collections-2.purebasic new file mode 100644 index 0000000000..bdcd66e5b7 --- /dev/null +++ b/Task/Collections/PureBasic/collections-2.purebasic @@ -0,0 +1,4 @@ +NewList Cars.s() + +AddElement(Cars()): Cars()="Volvo" +AddElement(Cars()): Cars()="BMV" diff --git a/Task/Collections/PureBasic/collections-3.purebasic b/Task/Collections/PureBasic/collections-3.purebasic new file mode 100644 index 0000000000..bc41bb155c --- /dev/null +++ b/Task/Collections/PureBasic/collections-3.purebasic @@ -0,0 +1,4 @@ +NewMap Capitals.s() + +Capitals("USA") = "Washington" +Capitals("Sweden")= "Stockholm" diff --git a/Task/Collections/Raven/collections-1.raven b/Task/Collections/Raven/collections-1.raven new file mode 100644 index 0000000000..d2494f6f96 --- /dev/null +++ b/Task/Collections/Raven/collections-1.raven @@ -0,0 +1,8 @@ +[ 1 2 3 'abc' ] as a_list +a_list print + +list (4 items) + 0 => 1 + 1 => 2 + 2 => 3 + 3 => "abc" diff --git a/Task/Collections/Raven/collections-2.raven b/Task/Collections/Raven/collections-2.raven new file mode 100644 index 0000000000..98cb52738e --- /dev/null +++ b/Task/Collections/Raven/collections-2.raven @@ -0,0 +1,6 @@ +{ 'a' 1 'b' 2 } as a_hash +a_hash print + +hash (2 items) + a => 1 + b => 2 diff --git a/Task/Collections/Raven/collections-3.raven b/Task/Collections/Raven/collections-3.raven new file mode 100644 index 0000000000..65c3f5ef4e --- /dev/null +++ b/Task/Collections/Raven/collections-3.raven @@ -0,0 +1,3 @@ +17 a_list 1 set # set second item +42 a_hash 'b' set # set item with key 'b' +42 a_hash:b # shorthand diff --git a/Task/Collections/Raven/collections-4.raven b/Task/Collections/Raven/collections-4.raven new file mode 100644 index 0000000000..e03917513b --- /dev/null +++ b/Task/Collections/Raven/collections-4.raven @@ -0,0 +1,3 @@ +a_list 1 get # get second item +a_hash 'b' get # get item with key 'b' +a_hash.b # shorthand diff --git a/Task/Collections/Raven/collections-5.raven b/Task/Collections/Raven/collections-5.raven new file mode 100644 index 0000000000..d063810b03 --- /dev/null +++ b/Task/Collections/Raven/collections-5.raven @@ -0,0 +1,6 @@ +42 a_list push # append an item +a_list pop # remove last item +42 a_list shove # prepend an item +a_list shift # remove first item +42 a_list 1 insert # insert item second, shuffling others down +a_list 1 remove # retrieve second item, shuffling others up diff --git a/Task/Collections/Seed7/collections-1.seed7 b/Task/Collections/Seed7/collections-1.seed7 new file mode 100644 index 0000000000..84a24a7d08 --- /dev/null +++ b/Task/Collections/Seed7/collections-1.seed7 @@ -0,0 +1,12 @@ +$ include "seed7_05.s7i"; + +enable_output(set of string); + +const proc: main is func + local + var set of string: aSet is {"iron", "copper"}; + begin + writeln(aSet); + incl(aSet, "silver"); + writeln(aSet); + end func; diff --git a/Task/Collections/Seed7/collections-2.seed7 b/Task/Collections/Seed7/collections-2.seed7 new file mode 100644 index 0000000000..71128bdcd7 --- /dev/null +++ b/Task/Collections/Seed7/collections-2.seed7 @@ -0,0 +1,17 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var array string: anArray is [] ("iron", "copper"); + var string: element is ""; + begin + for element range anArray do + write(element <& " "); + end for; + writeln; + anArray &:= "silver"; + for element range anArray do + write(element <& " "); + end for; + writeln; + end func; diff --git a/Task/Collections/Seed7/collections-3.seed7 b/Task/Collections/Seed7/collections-3.seed7 new file mode 100644 index 0000000000..ba69c66926 --- /dev/null +++ b/Task/Collections/Seed7/collections-3.seed7 @@ -0,0 +1,16 @@ +$ include "seed7_05.s7i"; + +const type: aHashType is hash [string] string; + +const proc: main is func + local + var aHashType: aHash is aHashType.value; + var string: aValue is ""; + var string: aKey is ""; + begin + aHash @:= ["gold"] "metal"; + aHash @:= ["helium"] "noble gas"; + for aValue key aKey range aHash do + writeln(aKey <& ": " <& aValue); + end for; + end func; diff --git a/Task/Collections/Slate/collections.slate b/Task/Collections/Slate/collections.slate new file mode 100644 index 0000000000..8e50900409 --- /dev/null +++ b/Task/Collections/Slate/collections.slate @@ -0,0 +1,4 @@ +{1. 2. 3. 4. 5} collect: [|:x| x + 1]. "--> {2. 3. 4. 5. 6}" +{1. 2. 3. 4. 5} select: #isOdd `er. "--> {1. 3. 5}" +({3. 2. 7} collect: #+ `er <- 3) sort. "--> {"SortedArray traitsWindow" 5. 6. 10}" +ExtensibleArray new `>> [addLast: 3. addFirst: 4. ]. "--> {"ExtensibleArray traitsWindow" 4. 3}" diff --git a/Task/Collections/TUSCRIPT/collections.tuscript b/Task/Collections/TUSCRIPT/collections.tuscript new file mode 100644 index 0000000000..75069071bd --- /dev/null +++ b/Task/Collections/TUSCRIPT/collections.tuscript @@ -0,0 +1,13 @@ +$$ MODE TUSCRIPT + +collection=* +DATA apple +DATA banana +DATA orange + +morestuff=* +DATA peaches +DATA apple + +collection=APPEND(collection,morestuff) +TRACE *collection diff --git a/Task/Collections/Ursala/collections-1.ursala b/Task/Collections/Ursala/collections-1.ursala new file mode 100644 index 0000000000..36b51e843c --- /dev/null +++ b/Task/Collections/Ursala/collections-1.ursala @@ -0,0 +1,3 @@ +x = <1,5,6> +y = <'foo','bar'> +z = 3:<6,8> diff --git a/Task/Collections/Ursala/collections-2.ursala b/Task/Collections/Ursala/collections-2.ursala new file mode 100644 index 0000000000..a43b854440 --- /dev/null +++ b/Task/Collections/Ursala/collections-2.ursala @@ -0,0 +1 @@ +foo ("newhead","existing-list") = "newhead":"existing-list" diff --git a/Task/Collections/Ursala/collections-3.ursala b/Task/Collections/Ursala/collections-3.ursala new file mode 100644 index 0000000000..746161ff97 --- /dev/null +++ b/Task/Collections/Ursala/collections-3.ursala @@ -0,0 +1,3 @@ +x = {'a','b'} +y = {'b','a'} +z = {'a','b','a'} diff --git a/Task/Collections/Ursala/collections-4.ursala b/Task/Collections/Ursala/collections-4.ursala new file mode 100644 index 0000000000..62869fc877 --- /dev/null +++ b/Task/Collections/Ursala/collections-4.ursala @@ -0,0 +1 @@ +m = <'foo': 1,'bar': 2,'baz': 3> diff --git a/Task/Collections/Ursala/collections-5.ursala b/Task/Collections/Ursala/collections-5.ursala new file mode 100644 index 0000000000..c58b111a8c --- /dev/null +++ b/Task/Collections/Ursala/collections-5.ursala @@ -0,0 +1,9 @@ +x = + +'z'^: < + 'x'^: < + '7'^: <>, + '?'^: <'D'^: <>>>, + 'a'^: <'E'^: <>,'j'^: <>>, + 'b'^: <'i'^: <>>, + 'c'^: <>> diff --git a/Task/Collections/Ursala/collections-6.ursala b/Task/Collections/Ursala/collections-6.ursala new file mode 100644 index 0000000000..fdfa0e589c --- /dev/null +++ b/Task/Collections/Ursala/collections-6.ursala @@ -0,0 +1,8 @@ +x = + +[ + 4:0: 'foo', + 4:1: 'bar', + 4:2: 'baz', + 4:3: 'volta', + 4:4: 'pramim'] diff --git a/Task/Collections/Ursala/collections-7.ursala b/Task/Collections/Ursala/collections-7.ursala new file mode 100644 index 0000000000..12165e62d1 --- /dev/null +++ b/Task/Collections/Ursala/collections-7.ursala @@ -0,0 +1,23 @@ +g = + +< + [0:0: -9.483639e+00^: <4:10,4:14>], + [ + 4:14: -9.681900e+00^: <4:15>, + 4:10: 2.237330e+00^: <4:7>], + [ + 4:15: -2.007562e+00^: <5:5>, + 4:7: 2.419021e+00^: <5:5,5:15>], + [ + 5:15: 8.215451e+00^: <11:118>, + 5:5: 4.067704e+00^: <11:741>], + [ + 11:741: -7.608967e+00^: <8:68>, + 11:118: -1.552837e+00^: <8:68,8:208>], + [ + 8:208: 5.348115e+00^: <4:7,4:9,4:12>, + 8:68: -9.066821e+00^: <4:9,4:12>], + [ + 4:12: -3.460494e+00^: <>, + 4:9: 2.840319e+00^: <>, + 4:7: -2.181140e+00^: <>]> diff --git a/Task/Collections/V/collections.v b/Task/Collections/V/collections.v new file mode 100644 index 0000000000..2284233fd7 --- /dev/null +++ b/Task/Collections/V/collections.v @@ -0,0 +1,2 @@ +[4 3 2 1] 5 swap cons +=[5 4 3 2 1] diff --git a/Task/Collections/Visual-Basic-.NET/collections.visual b/Task/Collections/Visual-Basic-.NET/collections.visual new file mode 100644 index 0000000000..da0860d296 --- /dev/null +++ b/Task/Collections/Visual-Basic-.NET/collections.visual @@ -0,0 +1,4 @@ +Dim toys As New List(Of String) +toys.Add("Car") +toys.Add("Boat") +toys.Add("Train") diff --git a/Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-1.bas b/Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-1.applesoft similarity index 100% rename from Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-1.bas rename to Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-1.applesoft diff --git a/Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-2.bas b/Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-2.applesoft similarity index 100% rename from Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-2.bas rename to Task/Color-of-a-screen-pixel/Applesoft-BASIC/color-of-a-screen-pixel-2.applesoft diff --git a/Task/Color-of-a-screen-pixel/BASIC/color-of-a-screen-pixel.bas b/Task/Color-of-a-screen-pixel/BASIC/color-of-a-screen-pixel.basic similarity index 100% rename from Task/Color-of-a-screen-pixel/BASIC/color-of-a-screen-pixel.bas rename to Task/Color-of-a-screen-pixel/BASIC/color-of-a-screen-pixel.basic diff --git a/Task/Color-of-a-screen-pixel/Locomotive-Basic/color-of-a-screen-pixel.bas b/Task/Color-of-a-screen-pixel/Locomotive-Basic/color-of-a-screen-pixel.locomotive similarity index 100% rename from Task/Color-of-a-screen-pixel/Locomotive-Basic/color-of-a-screen-pixel.bas rename to Task/Color-of-a-screen-pixel/Locomotive-Basic/color-of-a-screen-pixel.locomotive diff --git a/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-1.purebasic b/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-1.purebasic new file mode 100644 index 0000000000..e7714239eb --- /dev/null +++ b/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-1.purebasic @@ -0,0 +1 @@ +Color = Point(x, y) diff --git a/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-2.purebasic b/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-2.purebasic new file mode 100644 index 0000000000..c1dcf33b53 --- /dev/null +++ b/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-2.purebasic @@ -0,0 +1,3 @@ +hDC = GetDC_(0) +Color = GetPixel_(hDC, x, y) +ReleaseDC_(0, hDC) diff --git a/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-3.purebasic b/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-3.purebasic new file mode 100644 index 0000000000..c07db2d584 --- /dev/null +++ b/Task/Color-of-a-screen-pixel/PureBasic/color-of-a-screen-pixel-3.purebasic @@ -0,0 +1,23 @@ +poz.point +If OpenWindow(0,0,0,100,45,"Get pixel color at cursor position",#PB_Window_MinimizeGadget) + TextGadget(0,0,0,50,12,"Red: ") + TextGadget(1,0,15,50,12,"Green: ") + TextGadget(2,0,30,50,12,"Blue: ") + TextGadget(3,50,0,50,12,"") + TextGadget(4,50,15,50,12,"") + TextGadget(5,50,30,50,12,"") + hDC = GetDC_(0) + Repeat + oldx=poz\x + oldy=poz\y +GetCursorPos_(@poz) +Color = GetPixel_(hDC, poz\x, poz\y) +If poz\x<>oldx Or poz\y<>oldy + SetGadgetText(3,Str(Red(color))) + SetGadgetText(4,Str(Green(color))) + SetGadgetText(5,Str(Blue(color))) +EndIf +event=WaitWindowEvent(200) +Until event=#PB_Event_CloseWindow +ReleaseDC_(0, hDC) +EndIf diff --git a/Task/Color-of-a-screen-pixel/TI-89-BASIC/color-of-a-screen-pixel.ti-89 b/Task/Color-of-a-screen-pixel/TI-89-BASIC/color-of-a-screen-pixel.ti-89 new file mode 100644 index 0000000000..a020c6e0c7 --- /dev/null +++ b/Task/Color-of-a-screen-pixel/TI-89-BASIC/color-of-a-screen-pixel.ti-89 @@ -0,0 +1 @@ +pxlTest(y, x) © returns boolean diff --git a/Task/Color-of-a-screen-pixel/Visual-Basic-.NET/color-of-a-screen-pixel.visual b/Task/Color-of-a-screen-pixel/Visual-Basic-.NET/color-of-a-screen-pixel.visual new file mode 100644 index 0000000000..a7696c86fa --- /dev/null +++ b/Task/Color-of-a-screen-pixel/Visual-Basic-.NET/color-of-a-screen-pixel.visual @@ -0,0 +1,10 @@ + Private Function GetPixelColor(ByVal Location As Point) As Color + + Dim b As New Bitmap(1, 1) + Dim g As Graphics = Graphics.FromImage(b) + + g.CopyFromScreen(Location, Point.Empty, New Size(1, 1)) + + Return b.GetPixel(0, 0) + + End Function diff --git a/Task/Color-of-a-screen-pixel/XPL0/color-of-a-screen-pixel.xpl0 b/Task/Color-of-a-screen-pixel/XPL0/color-of-a-screen-pixel.xpl0 new file mode 100644 index 0000000000..f9bc97087a --- /dev/null +++ b/Task/Color-of-a-screen-pixel/XPL0/color-of-a-screen-pixel.xpl0 @@ -0,0 +1,3 @@ +code ReadPix=44; +int Color, X, Y; +Color:= ReadPix(X, Y); diff --git a/Task/Color-quantization/Mathematica/color-quantization.mathematica b/Task/Color-quantization/Mathematica/color-quantization.math similarity index 100% rename from Task/Color-quantization/Mathematica/color-quantization.mathematica rename to Task/Color-quantization/Mathematica/color-quantization.math diff --git a/Task/Color-quantization/OCaml/color-quantization.ocaml b/Task/Color-quantization/OCaml/color-quantization.ocaml new file mode 100644 index 0000000000..dab2524aa6 --- /dev/null +++ b/Task/Color-quantization/OCaml/color-quantization.ocaml @@ -0,0 +1,101 @@ +let rem_from rem from = + List.filter ((<>) rem) from + +let float_rgb (r,g,b) = (* prevents int overflow *) + (float r, float g, float b) + +let round x = + int_of_float (floor (x +. 0.5)) + +let int_rgb (r,g,b) = + (round r, round g, round b) + +let rgb_add (r1,g1,b1) (r2,g2,b2) = + (r1 +. r2, + g1 +. g2, + b1 +. b2) + +let rgb_mean px_list = + let n = float (List.length px_list) in + let r, g, b = List.fold_left rgb_add (0.0, 0.0, 0.0) px_list in + (r /. n, g /. n, b /. n) + +let extrems lst = + let min_rgb = (infinity, infinity, infinity) + and max_rgb = (neg_infinity, neg_infinity, neg_infinity) in + List.fold_left (fun ((sr,sg,sb), (mr,mg,mb)) (r,g,b) -> + ((min sr r), (min sg g), (min sb b)), + ((max mr r), (max mg g), (max mb b)) + ) (min_rgb, max_rgb) lst + +let volume_and_dims lst = + let (sr,sg,sb), (br,bg,bb) = extrems lst in + let dr, dg, db = (br -. sr), (bg -. sg), (bb -. sb) in + (dr *. dg *. db), + (dr, dg, db) + +let make_cluster pixel_list = + let vol, dims = volume_and_dims pixel_list in + let len = float (List.length pixel_list) in + (rgb_mean pixel_list, len *. vol, dims, pixel_list) + +type axis = R | G | B +let largest_axis (r,g,b) = + match compare r g, compare r b with + | 1, 1 -> R + | -1, 1 -> G + | 1, -1 -> B + | _ -> + match compare g b with + | 1 -> G + | _ -> B + +let subdivide ((mr,mg,mb), n_vol_prod, vol, pixels) = + let part_func = + match largest_axis vol with + | R -> (fun (r,_,_) -> r < mr) + | G -> (fun (_,g,_) -> g < mg) + | B -> (fun (_,_,b) -> b < mb) + in + let px1, px2 = List.partition part_func pixels in + (make_cluster px1, make_cluster px2) + +let color_quant img n = + let width, height = get_dims img in + let clusters = + let lst = ref [] in + for x = 0 to pred width do + for y = 0 to pred height do + let rgb = float_rgb (get_pixel_unsafe img x y) in + lst := rgb :: !lst + done; + done; + ref [make_cluster !lst] + in + while (List.length !clusters) < n do + let dumb = (0.0,0.0,0.0) in + let unused = (dumb, neg_infinity, dumb, []) in + let select ((_,v1,_,_) as c1) ((_,v2,_,_) as c2) = + if v1 > v2 then c1 else c2 + in + let cl = List.fold_left (fun c1 c2 -> select c1 c2) unused !clusters in + let cl1, cl2 = subdivide cl in + clusters := cl1 :: cl2 :: (rem_from cl !clusters) + done; + let module PxMap = Map.Make + (struct type t = float * float * float let compare = compare end) in + let m = + List.fold_left (fun m (mean, _, _, pixel_list) -> + let int_mean = int_rgb mean in + List.fold_left (fun m px -> PxMap.add px int_mean m) m pixel_list + ) PxMap.empty !clusters + in + let res = new_img ~width ~height in + for y = 0 to pred height do + for x = 0 to pred width do + let rgb = float_rgb (get_pixel_unsafe img x y) in + let mean_rgb = PxMap.find rgb m in + put_pixel_unsafe res mean_rgb x y; + done; + done; + (res) diff --git a/Task/Color-quantization/PureBasic/color-quantization.purebasic b/Task/Color-quantization/PureBasic/color-quantization.purebasic new file mode 100644 index 0000000000..8419eb4ac8 --- /dev/null +++ b/Task/Color-quantization/PureBasic/color-quantization.purebasic @@ -0,0 +1,220 @@ +; ColorQuantization.pb + +Structure bestA_ ; table for our histogram +nn.i ; 16,32,... +rc.i ; red count within (0,1,...,255)/(number of colors) +gc.i ; green count within (0,1,...,255)/(number of colors) +bc.i ; blue count within (0,1,...,255)/(number of colors) +EndStructure + +; these two functions appear to be rather self-explanatory +UsePNGImageDecoder() +UsePNGImageEncoder() + +Procedure.i ColorQuantization(Filename$,ncol) +Protected x,y,c + +; load our original image or leave the procedure +If not LoadImage(0,Filename$) :ProcedureReturn 0:endif + +; we are not going to actually draw on the original image... +; but we need to use the drawing library to load up +; the pixel information into our arrays... +; if we can't do that, what's the point of going any further? +; so then we would be wise to just leave the procedure [happy fred?] +If not StartDrawing(ImageOutput(0)):ProcedureReturn 0:endif + +iw=ImageWidth(0) +ih=ImageHeight(0) + +dim cA(iw,ih) ; color array to hold at a given (x,y) +dim rA(iw,ih) ; red array to hold at a given (x,y) +dim gA(iw,ih) ; green array to hold at a given (x,y) +dim bA(iw,ih) ; blue array to hold at a given (x,y) +dim tA(iw,ih) ; temp array to hold at a given (x,y) + +; map each pixel from the original image to our arrays +; don't overrun the ranges ie. use {ih-1,iw-1} +for y=0 to ih-1 + for x=0 to iw-1 + c = Point(x,y) + cA(x,y)=c + rA(x,y)=Red(c) + gA(x,y)=Green(c) + bA(x,y)=Blue(c) + next +next + +StopDrawing() ; don't forget to... StopDrawing() + +N=ih*iw +; N is the total number if pixels +if not N:ProcedureReturn 0:endif ; to avoid a division by zero + +; stuctured array ie. a table to hold the frequency distribution +dim bestA.bestA_(ncol) + +; the "best" red,green,blue based upon frequency +dim rbestA(ncol/3) +dim gbestA(ncol/3) +dim bbestA(ncol/3) + +; split the (0..255) range up +xoff=256/ncol ;256/16=16 +xrng=xoff ;xrng=16 + +; store these values in our table: bestA(i)\nn= 16,32,... +for i=1 to ncol +xrng+xoff +bestA(i)\nn=xrng +next + +; scan by row [y] +for y=0 to ih-1 +; scan by col [x] +for x=0 to iw-1 + +; retrieve the rgb values from each pixel +r=rA(x,y) +g=gA(x,y) +b=bA(x,y) + +; sum up the numbers that fall within our subdivisions of (0..255) +for i=1 to ncol +if r>=bestA(i)\nn and r=bestA(i)\nn and g=bestA(i)\nn and b + let x1 = bar_width *. (float i) in + let x2 = bar_width *. (float (succ i)) in + set_color color; + fill_rect (round x1) 0 (round x2) rows; + ) colors; + ignore (read_key ()); +;; diff --git a/Task/Colour-bars-Display/PureBasic/colour-bars-display-1.purebasic b/Task/Colour-bars-Display/PureBasic/colour-bars-display-1.purebasic new file mode 100644 index 0000000000..9b35d9fe22 --- /dev/null +++ b/Task/Colour-bars-Display/PureBasic/colour-bars-display-1.purebasic @@ -0,0 +1,31 @@ +Dim color(7) +color(0) = RGB($00, $00, $00) ;black +color(1) = RGB($FF, $00, $00) ;red +color(2) = RGB($00, $FF, $00) ;green +color(3) = RGB($00, $00, $FF) ;blue +color(4) = RGB($FF, $00, $FF) ;magenta +color(5) = RGB($00, $FF, $FF) ;cyan +color(6) = RGB($FF, $FF, $00) ;yellow +color(7) = RGB($FF, $FF, $FF) ;white + +If Not InitKeyboard(): End: EndIf ;can't init keyboard +If Not InitSprite(): End: EndIf ;can't init sprite/screen library +If Not ExamineDesktops(): End: EndIf ;can't retrieve information about desktop + +height = DesktopHeight(0) +width = DesktopWidth(0) +depth = DesktopDepth(0) +If OpenScreen(width, height, depth, "Press ENTER to exit") + StartDrawing(ScreenOutput()) + For c = 0 To 7 + Box((width * c) / 8, 0, width / 8, height, color(c)) + Next + StopDrawing() + FlipBuffers() + + Repeat + Delay(10) + ExamineKeyboard() + Until KeyboardPushed(#PB_Key_Escape) Or KeyboardPushed(#PB_Key_Return) + CloseScreen() +EndIf diff --git a/Task/Colour-bars-Display/PureBasic/colour-bars-display-2.purebasic b/Task/Colour-bars-Display/PureBasic/colour-bars-display-2.purebasic new file mode 100644 index 0000000000..e3cde4b7fd --- /dev/null +++ b/Task/Colour-bars-Display/PureBasic/colour-bars-display-2.purebasic @@ -0,0 +1,24 @@ +DataSection + ;Black, Red, Green, Blue, Magenta, Cyan, Yellow, White + Data.i 0, 12, 10, 9, 13, 11, 14, 15 +EndDataSection + +Dim colors(7) +For c = 0 To 7 + Read.i colors(c) +Next + +If OpenConsole() + ;The console display is 80 columns wide by 25 rows + For r = 0 To 24 + For c = 0 To 7 + ConsoleColor(colors(c), colors(c)) + Print(Space(80 / 8)) + Next + Next + EnableGraphicalConsole(1) + ConsoleLocate(0, 0) + + ConsoleTitle("Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Colour-bars-Display/Run-BASIC/colour-bars-display.run b/Task/Colour-bars-Display/Run-BASIC/colour-bars-display.run new file mode 100644 index 0000000000..3e484752df --- /dev/null +++ b/Task/Colour-bars-Display/Run-BASIC/colour-bars-display.run @@ -0,0 +1,6 @@ +colors$ = "black,red,green,blue,magenta,cyan,yellow,white" +html "" +for i = 1 to 8 + html "
" +next i +html "
" diff --git a/Task/Colour-bars-Display/XPL0/colour-bars-display-1.xpl0 b/Task/Colour-bars-Display/XPL0/colour-bars-display-1.xpl0 new file mode 100644 index 0000000000..2179c96410 --- /dev/null +++ b/Task/Colour-bars-Display/XPL0/colour-bars-display-1.xpl0 @@ -0,0 +1,12 @@ +include c:\cxpl\codes; \intrinsic code declarations +int W, X0, X1, Y, C; +[SetVid($13); \320x200x8 graphics +W:= 320/8; \width of color bar (pixels) +for C:= 0 to 8-1 do + [X0:= W*C; X1:= X0+W-1; + for Y:= 0 to 200-1 do + [Move(X0, Y); Line(X1, Y, C)]; + ]; +C:= ChIn(1); \wait for keystroke +SetVid(3); \restore normal text mode +] diff --git a/Task/Colour-bars-Display/XPL0/colour-bars-display-2.xpl0 b/Task/Colour-bars-Display/XPL0/colour-bars-display-2.xpl0 new file mode 100644 index 0000000000..3c8e3a3d25 --- /dev/null +++ b/Task/Colour-bars-Display/XPL0/colour-bars-display-2.xpl0 @@ -0,0 +1,8 @@ +10 REM The ZX Spectrum display is 32 columns wide, so we have 8 columns of 4 spaces +20 FOR r=0 TO 20: REM There are 21 rows +30 FOR c=0 TO 7: REM We use the native colour sequence here +40 PAPER c: REM set the background colour for the spaces to be printed +50 PRINT " ";: REM four spaces, the semicolon prevents newline +60 NEXT c +70 REM at this point the cursor has wrapped, so we don't need a newline +80 NEXT r diff --git a/Task/Colour-pinstripe-Display/OCaml/colour-pinstripe-display.ocaml b/Task/Colour-pinstripe-Display/OCaml/colour-pinstripe-display.ocaml new file mode 100644 index 0000000000..f4e72f5937 --- /dev/null +++ b/Task/Colour-pinstripe-Display/OCaml/colour-pinstripe-display.ocaml @@ -0,0 +1,17 @@ +open Graphics + +let () = + open_graph ""; + let width = size_x () + and height = size_y () in + let colors = [| black; red; green; blue; magenta; cyan; yellow; white |] in + let num_colors = Array.length colors in + let h = height / 4 in + for i = 1 to 4 do + let j = 4 - i in + for x = 0 to pred width do + set_color colors.((x / i) mod num_colors); + moveto x (j * h); lineto x (j * h + h); + done + done; + ignore(read_key()) diff --git a/Task/Colour-pinstripe-Display/PureBasic/colour-pinstripe-display.purebasic b/Task/Colour-pinstripe-Display/PureBasic/colour-pinstripe-display.purebasic new file mode 100644 index 0000000000..f3ab9c0c19 --- /dev/null +++ b/Task/Colour-pinstripe-Display/PureBasic/colour-pinstripe-display.purebasic @@ -0,0 +1,43 @@ +;Create a Pinstripe image with a pattern of vertical stripe colors +Procedure PinstripeDisplay(width, height, Array psColors(1), numColors = 0) + Protected x, imgID, psHeight = height / 4, psWidth = 1, psTop, horzBand, curColor + + If numColors < 1: numColors = ArraySize(psColors()) + 1: EndIf + + imgID = CreateImage(#PB_Any, width, height) + If imgID + StartDrawing(ImageOutput(imgID)) + Repeat + x = 0 + curColor = 0 + Repeat + Box(x, psTop, psWidth, psHeight, psColors(curColor)) + curColor = (curColor + 1) % numColors + x + psWidth + Until x >= width + psWidth + 1 + horzBand + 1 + psTop = horzBand * height / 4 ;move to the top of next horizontal band of image + Until psTop >= height + StopDrawing() + EndIf + ProcedureReturn imgID +EndProcedure + +;Open a window and display the pinstripe +If OpenWindow(0, 0, 0, 1, 1,"PureBasic Pinstripe", #PB_Window_Maximize | #PB_Window_SystemMenu) + Dim psColors(7) + psColors(0) = RGB($00, $00, $00) ;black + psColors(1) = RGB($FF, $00, $00) ;red + psColors(2) = RGB($00, $FF, $00) ;green + psColors(3) = RGB($00, $00, $FF) ;blue + psColors(4) = RGB($FF, $00, $FF) ;magenta + psColors(5) = RGB($00, $FF, $FF) ;cyan + psColors(6) = RGB($FF, $FF, $00) ;yellow + psColors(7) = RGB($FF, $FF, $FF) ;white + + PicID = PinstripeDisplay(WindowWidth(0), WindowHeight(0), psColors()) + ImageGadget(0, 0, 0, WindowWidth(0), WindowHeight(0), ImageID(PicID)) + While WaitWindowEvent() <> #PB_Event_CloseWindow + Wend +EndIf diff --git a/Task/Colour-pinstripe-Display/XPL0/colour-pinstripe-display.xpl0 b/Task/Colour-pinstripe-Display/XPL0/colour-pinstripe-display.xpl0 new file mode 100644 index 0000000000..c310fe1eeb --- /dev/null +++ b/Task/Colour-pinstripe-Display/XPL0/colour-pinstripe-display.xpl0 @@ -0,0 +1,14 @@ +code ChIn=7, Point=41, SetVid=45; +int X, Y, W, C; +[SetVid($13); \set 320x200 graphics mode in 256 colors +for Y:= 0 to 200-1 do \for all the scan lines... + [W:= Y/50 + 1; \width of stripe = 1, 2, 3, 4 + C:= 0; \set color to black so first pixel becomes blue + for X:= 0 to 320-1 do \for all the pixels on a scan line... + [if rem(X/W) = 0 then C:= C+1; \cycle through all system colors + Point(X, Y, C); \set pixel at X,Y to color C + ]; + ]; +X:= ChIn(1); \wait for keystroke +SetVid(3); \restore normal text mode display +] diff --git a/Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-1.coffee b/Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-1.coffeescript similarity index 100% rename from Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-1.coffee rename to Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-1.coffeescript diff --git a/Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-2.coffee b/Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-2.coffeescript similarity index 100% rename from Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-2.coffee rename to Task/Combinations-with-repetitions/CoffeeScript/combinations-with-repetitions-2.coffeescript diff --git a/Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-1.mathematica b/Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-1.math similarity index 100% rename from Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-1.mathematica rename to Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-1.math diff --git a/Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-2.mathematica b/Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-2.math similarity index 100% rename from Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-2.mathematica rename to Task/Combinations-with-repetitions/Mathematica/combinations-with-repetitions-2.math diff --git a/Task/Combinations-with-repetitions/OCaml/combinations-with-repetitions-1.ocaml b/Task/Combinations-with-repetitions/OCaml/combinations-with-repetitions-1.ocaml new file mode 100644 index 0000000000..f35f3a3c8a --- /dev/null +++ b/Task/Combinations-with-repetitions/OCaml/combinations-with-repetitions-1.ocaml @@ -0,0 +1,7 @@ +let rec combs_with_rep k xxs = + match k, xxs with + | 0, _ -> [[]] + | _, [] -> [] + | k, x::xs -> + List.map (fun ys -> x::ys) (combs_with_rep (k-1) xxs) + @ combs_with_rep k xs diff --git a/Task/Combinations-with-repetitions/OCaml/combinations-with-repetitions-2.ocaml b/Task/Combinations-with-repetitions/OCaml/combinations-with-repetitions-2.ocaml new file mode 100644 index 0000000000..ff7dacb731 --- /dev/null +++ b/Task/Combinations-with-repetitions/OCaml/combinations-with-repetitions-2.ocaml @@ -0,0 +1,7 @@ +# combs_with_rep 2 ["iced"; "jam"; "plain"] ;; +- : string list list = +[["iced"; "iced"]; ["iced"; "jam"]; ["iced"; "plain"]; ["jam"; "jam"]; + ["jam"; "plain"]; ["plain"; "plain"]] + +# List.length (combs_with_rep 3 [1;2;3;4;5;6;7;8;9;10]) ;; +- : int = 220 diff --git a/Task/Combinations-with-repetitions/PARI-GP/combinations-with-repetitions.pari b/Task/Combinations-with-repetitions/PARI-GP/combinations-with-repetitions.pari new file mode 100644 index 0000000000..2cf378c014 --- /dev/null +++ b/Task/Combinations-with-repetitions/PARI-GP/combinations-with-repetitions.pari @@ -0,0 +1,9 @@ +ways(k,v,s=[])={ + if(k==0,return([])); + if(k==1,return(vector(#v,i,concat(s,[v[i]])))); + if(#v==1,return(ways(k-1,v,concat(s,v)))); + my(u=vecextract(v,2^#v-2)); + concat(ways(k-1,v,concat(s,[v[1]])),ways(k,u,s)) +}; +xc(k,v)=binomial(#v+k-1,k); +ways(2, ["iced","jam","plain"]) diff --git a/Task/Combinations-with-repetitions/Perl-6/combinations-with-repetitions.pl6 b/Task/Combinations-with-repetitions/Perl-6/combinations-with-repetitions.pl6 new file mode 100644 index 0000000000..7ac9bd306a --- /dev/null +++ b/Task/Combinations-with-repetitions/Perl-6/combinations-with-repetitions.pl6 @@ -0,0 +1,17 @@ +proto combs_with_rep (Int, @) {*} + +multi combs_with_rep (0, @) { [] } +multi combs_with_rep ($, []) { () } +multi combs_with_rep ($n, [$head, *@tail]) { + map( { [$head, @^others] }, + combs_with_rep($n - 1, [$head, @tail]) ), + combs_with_rep($n, @tail); +} + +.perl.say for combs_with_rep( 2, [< iced jam plain >] ); + +# Extra credit: +sub postfix: { [*] 1..$^n } +sub combs_with_rep_count ($k, $n) { ($n + $k - 1)! / $k! / ($n - 1)! } + +say combs_with_rep_count( 3, 10 ); diff --git a/Task/Combinations-with-repetitions/PureBasic/combinations-with-repetitions.purebasic b/Task/Combinations-with-repetitions/PureBasic/combinations-with-repetitions.purebasic new file mode 100644 index 0000000000..6df06870fb --- /dev/null +++ b/Task/Combinations-with-repetitions/PureBasic/combinations-with-repetitions.purebasic @@ -0,0 +1,69 @@ +Procedure nextCombination(Array combIndex(1), elementCount) + ;combIndex() must be dimensioned to 'k' - 1, elementCount equals 'n' - 1 + ;combination produced includes repetition of elements and is represented by the array combIndex() + Protected i, indexValue, combSize = ArraySize(combIndex()), curIndex + + ;update indexes + curIndex = combSize + Repeat + combIndex(curIndex) + 1 + If combIndex(curIndex) > elementCount + + curIndex - 1 + If curIndex < 0 + For i = 0 To combSize + combIndex(i) = 0 + Next + ProcedureReturn #False ;array reset to first combination + EndIf + + ElseIf curIndex < combSize + + indexValue = combIndex(curIndex) + Repeat + curIndex + 1 + combIndex(curIndex) = indexValue + Until curIndex = combSize + + EndIf + Until curIndex = combSize + + ProcedureReturn #True ;array contains next combination +EndProcedure + +Procedure.s display(Array combIndex(1), Array dougnut.s(1)) + Protected i, elementCount = ArraySize(combIndex()), output.s = " " + For i = 0 To elementCount + output + dougnut(combIndex(i)) + " + " + Next + ProcedureReturn Left(output, Len(output) - 3) +EndProcedure + +DataSection + Data.s "iced", "jam", "plain" +EndDataSection + +If OpenConsole() + Define n = 3, k = 2, i, combinationCount + Dim combIndex(k - 1) + Dim dougnut.s(n - 1) + For i = 0 To n - 1: Read.s dougnut(i): Next + + PrintN("Combinations of " + Str(k) + " dougnuts taken " + Str(n) + " at a time with repetitions.") + combinationCount = 0 + Repeat + PrintN(display(combIndex(), dougnut())) + combinationCount + 1 + Until Not nextCombination(combIndex(), n - 1) + PrintN("Total combination count: " + Str(combinationCount)) + + ;extra credit + n = 10: k = 3 + Dim combIndex(k - 1) + combinationCount = 0 + Repeat: combinationCount + 1: Until Not nextCombination(combIndex(), n - 1) + PrintN(#CRLF$ + "Ways to select " + Str(k) + " items from " + Str(n) + " types: " + Str(combinationCount)) + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Combinations-with-repetitions/UNIX-Shell/combinations-with-repetitions.sh b/Task/Combinations-with-repetitions/UNIX-Shell/combinations-with-repetitions.sh new file mode 100644 index 0000000000..cebb3baa13 --- /dev/null +++ b/Task/Combinations-with-repetitions/UNIX-Shell/combinations-with-repetitions.sh @@ -0,0 +1,2 @@ +$ echo {iced,jam,plain}-{iced,jam,plain} # trick question??? +iced-iced iced-jam iced-plain jam-iced jam-jam jam-plain plain-iced plain-jam plain-plain diff --git a/Task/Combinations-with-repetitions/Ursala/combinations-with-repetitions.ursala b/Task/Combinations-with-repetitions/Ursala/combinations-with-repetitions.ursala new file mode 100644 index 0000000000..e208086433 --- /dev/null +++ b/Task/Combinations-with-repetitions/Ursala/combinations-with-repetitions.ursala @@ -0,0 +1,8 @@ +#import std +#import nat + +cwr = ~&s+ -<&*+ ~&K0=>&^|DlS/~& iota # takes a set and a selection size + +#cast %gLSnX + +main = ^|(~&,length) cwr~~/(<'iced','jam','plain'>,2) ('1234567890',3) diff --git a/Task/Combinations-with-repetitions/XPL0/combinations-with-repetitions.xpl0 b/Task/Combinations-with-repetitions/XPL0/combinations-with-repetitions.xpl0 new file mode 100644 index 0000000000..d1f384d89e --- /dev/null +++ b/Task/Combinations-with-repetitions/XPL0/combinations-with-repetitions.xpl0 @@ -0,0 +1,28 @@ +code ChOut=8, CrLf=9, IntOut=11, Text=12; +int Count, Array(10); + +proc Combos(D, S, K, N, Names); \Generate all size K combinations of N objects +int D, S, K, N, Names; \depth of recursion, starting value of N, etc. +int I; +[if D m_max) then + begin + for i := 1 to m_max do + write (combination[i], ' '); + writeln; + end + else + for n := 1 to n_max do + if ((m = 1) or (n > combination[m-1])) then + begin + combination[m] := n; + generate(m + 1); + end; + end; + +begin + generate(1); +end. diff --git a/Task/Combinations/Perl-6/combinations.pl6 b/Task/Combinations/Perl-6/combinations.pl6 new file mode 100644 index 0000000000..f626d331bb --- /dev/null +++ b/Task/Combinations/Perl-6/combinations.pl6 @@ -0,0 +1,11 @@ +proto combine (Int, @) {*} + +multi combine (0, @) { [] } +multi combine ($, []) { () } +multi combine ($n, [$head, *@tail]) { + map( { [$head, @^others] }, + combine($n-1, @tail) ), + combine($n, @tail); +} + +.say for combine(3, [^5]); diff --git a/Task/Combinations/Pop11/combinations.pop11 b/Task/Combinations/Pop11/combinations.pop11 new file mode 100644 index 0000000000..a16c0fa913 --- /dev/null +++ b/Task/Combinations/Pop11/combinations.pop11 @@ -0,0 +1,17 @@ +define comb(n, m); + lvars ress = []; + define do_combs(l, m, el_lst); + lvars i; + if m = 0 then + cons(rev(el_lst), ress) -> ress; + else + for i from l to n - m do + do_combs(i + 1, m - 1, cons(i, el_lst)); + endfor; + endif; + enddefine; + do_combs(0, m, []); + rev(ress); +enddefine; + +comb(5, 3) ==> diff --git a/Task/Combinations/Pure/combinations.pure b/Task/Combinations/Pure/combinations.pure new file mode 100644 index 0000000000..720ff430a7 --- /dev/null +++ b/Task/Combinations/Pure/combinations.pure @@ -0,0 +1,7 @@ +comb m n = comb m (0..n-1) with + comb 0 _ = [[]]; + comb _ [] = []; + comb m (x:xs) = [x:xs | xs = comb (m-1) xs] + comb m xs; +end; + +comb 3 5; diff --git a/Task/Combinations/PureBasic/combinations.purebasic b/Task/Combinations/PureBasic/combinations.purebasic new file mode 100644 index 0000000000..8aa14a3420 --- /dev/null +++ b/Task/Combinations/PureBasic/combinations.purebasic @@ -0,0 +1,34 @@ +Procedure.s Combinations(amount, choose) + NewList comb.s() + ; all possible combinations with {amount} Bits + For a = 0 To 1 << amount + count = 0 + ; count set bits + For x = 0 To amount + If (1 << x)&a + count + 1 + EndIf + Next + ; if set bits are equal to combination length + ; we generate a String representing our combination and add it to list + If count = choose + string$ = "" + For x = 0 To amount + If (a >> x)&1 + ; replace x by x+1 to start counting with 1 + String$ + Str(x) + " " + EndIf + Next + AddElement(comb()) + comb() = string$ + EndIf + Next + ; now we sort our list and format it for output as string + SortList(comb(), #PB_Sort_Ascending) + ForEach comb() + out$ + ", [ " + comb() + "]" + Next + ProcedureReturn Mid(out$, 3) +EndProcedure + +Debug Combinations(5, 3) diff --git a/Task/Combinations/SETL/combinations.setl b/Task/Combinations/SETL/combinations.setl new file mode 100644 index 0000000000..ef26bc8a89 --- /dev/null +++ b/Task/Combinations/SETL/combinations.setl @@ -0,0 +1 @@ +print({0..4} npow 3); diff --git a/Task/Combinations/Seed7/combinations.seed7 b/Task/Combinations/Seed7/combinations.seed7 new file mode 100644 index 0000000000..1f46f18573 --- /dev/null +++ b/Task/Combinations/Seed7/combinations.seed7 @@ -0,0 +1,35 @@ +$ include "seed7_05.s7i"; + +const type: combinations is array array integer; + +const func combinations: comb (in array integer: arr, in integer: k) is func + result + var combinations: combResult is combinations.value; + local + var integer: x is 0; + var integer: i is 0; + var array integer: suffix is 0 times 0; + begin + if k = 0 then + combResult := 1 times 0 times 0; + else + for x key i range arr do + for suffix range comb(arr[succ(i) ..], pred(k)) do + combResult &:= [] (x) & suffix; + end for; + end for; + end if; + end func; + +const proc: main is func + local + var array integer: aCombination is 0 times 0; + var integer: element is 0; + begin + for aCombination range comb([] (0, 1, 2, 3, 4), 3) do + for element range aCombination do + write(element lpad 3); + end for; + writeln; + end for; + end func; diff --git a/Task/Combinations/Standard-ML/combinations.ml b/Task/Combinations/Standard-ML/combinations.ml new file mode 100644 index 0000000000..3632e2c9c6 --- /dev/null +++ b/Task/Combinations/Standard-ML/combinations.ml @@ -0,0 +1,6 @@ +fun comb (0, _ ) = [[]] + | comb (_, [] ) = [] + | comb (m, x::xs) = map (fn y => x :: y) (comb (m-1, xs)) @ + comb (m, xs) +; +comb (3, [0,1,2,3,4]); diff --git a/Task/Combinations/Ursala/combinations-1.ursala b/Task/Combinations/Ursala/combinations-1.ursala new file mode 100644 index 0000000000..cf4d5c276f --- /dev/null +++ b/Task/Combinations/Ursala/combinations-1.ursala @@ -0,0 +1 @@ +choices = ^(iota@r,~&l); leql@a^& ~&al?\&! ~&arh2fabt2RDfalrtPXPRT diff --git a/Task/Combinations/Ursala/combinations-2.ursala b/Task/Combinations/Ursala/combinations-2.ursala new file mode 100644 index 0000000000..51b3be3ccc --- /dev/null +++ b/Task/Combinations/Ursala/combinations-2.ursala @@ -0,0 +1,4 @@ +#import std +#import nat + +combinations = @rlX choices^|(iota,~&); -< @p nleq+ ==-~rh diff --git a/Task/Combinations/Ursala/combinations-3.ursala b/Task/Combinations/Ursala/combinations-3.ursala new file mode 100644 index 0000000000..b675adb8ba --- /dev/null +++ b/Task/Combinations/Ursala/combinations-3.ursala @@ -0,0 +1,3 @@ +#cast %nLL + +example = combinations(3,5) diff --git a/Task/Combinations/V/combinations-1.v b/Task/Combinations/V/combinations-1.v new file mode 100644 index 0000000000..dbd033a257 --- /dev/null +++ b/Task/Combinations/V/combinations-1.v @@ -0,0 +1,6 @@ +[comb [m lst] let + [ [m zero?] [[[]]] + [lst null?] [[]] + [true] [m pred lst rest comb [lst first swap cons] map + m lst rest comb concat] + ] when]. diff --git a/Task/Combinations/V/combinations-2.v b/Task/Combinations/V/combinations-2.v new file mode 100644 index 0000000000..a75186201f --- /dev/null +++ b/Task/Combinations/V/combinations-2.v @@ -0,0 +1,6 @@ +[comb + [ [pop zero?] [pop pop [[]]] + [null?] [pop pop []] + [true] [ [m lst : [m pred lst rest comb [lst first swap cons] map + m lst rest comb concat]] view i ] + ] when]. diff --git a/Task/Combinations/V/combinations-3.v b/Task/Combinations/V/combinations-3.v new file mode 100644 index 0000000000..7219301d3f --- /dev/null +++ b/Task/Combinations/V/combinations-3.v @@ -0,0 +1,8 @@ +[comb + [2dup [a b : a b a b] view]. + [2pop pop pop]. + + [ [pop zero?] [2pop [[]]] + [null?] [2pop []] + [true] [2dup [pred] dip uncons swapd comb [cons] map popd rollup rest comb concat] + ] when]. diff --git a/Task/Combinations/XPL0/combinations.xpl0 b/Task/Combinations/XPL0/combinations.xpl0 new file mode 100644 index 0000000000..947f6442dc --- /dev/null +++ b/Task/Combinations/XPL0/combinations.xpl0 @@ -0,0 +1,19 @@ +code ChOut=8, CrLf=9, IntOut=11; +def M=3, N=5; +int A(N-1); + +proc Combos(D, S); \Display all size M combinations of N in sorted order +int D, S; \depth of recursion, starting value of N +int I; +[if D somebool := true), ": set somebool to true"); + ("-s", Arg.String (fun s -> somestr := s), ": what follows -s sets some string"); + ("-d", Arg.Int (fun d -> someint := d), ": some int parameter"); + ] + +let () = + (* Read the arguments *) + Arg.parse + speclist + (fun x -> raise (Arg.Bad ("Bad argument : " ^ x))) + usage; + + Printf.printf " %b %d '%s'\n" !somebool !someint !somestr; +;; diff --git a/Task/Command-line-arguments/Objeck/command-line-arguments.objeck b/Task/Command-line-arguments/Objeck/command-line-arguments.objeck new file mode 100644 index 0000000000..c97e502339 --- /dev/null +++ b/Task/Command-line-arguments/Objeck/command-line-arguments.objeck @@ -0,0 +1,9 @@ +bundle Default { + class Line { + function : Main(args : String[]) ~ Nil { + each(i : args) { + args[i]->PrintLine(); + }; + } + } +} diff --git a/Task/Command-line-arguments/Objective-C/command-line-arguments.m b/Task/Command-line-arguments/Objective-C/command-line-arguments.m new file mode 100644 index 0000000000..c3d0de071a --- /dev/null +++ b/Task/Command-line-arguments/Objective-C/command-line-arguments.m @@ -0,0 +1,6 @@ +NSArray *args = [[NSProcessInfo processInfo] arguments]; +NSLog(@"This program is named %@.", [args objectAtIndex:0]); +NSLog(@"There are %d arguments.", [args count] - 1); +for (i = 1; i < [args count]; ++i){ + NSLog(@"the argument #%d is %@", i, [args objectAtIndex:i]); +} diff --git a/Task/Command-line-arguments/Oz/command-line-arguments-1.oz b/Task/Command-line-arguments/Oz/command-line-arguments-1.oz new file mode 100644 index 0000000000..97893e3992 --- /dev/null +++ b/Task/Command-line-arguments/Oz/command-line-arguments-1.oz @@ -0,0 +1,7 @@ +functor +import Application System +define + ArgList = {Application.getArgs plain} + {ForAll ArgList System.showInfo} + {Application.exit 0} +end diff --git a/Task/Command-line-arguments/Oz/command-line-arguments-2.oz b/Task/Command-line-arguments/Oz/command-line-arguments-2.oz new file mode 100644 index 0000000000..3c4dd0ff17 --- /dev/null +++ b/Task/Command-line-arguments/Oz/command-line-arguments-2.oz @@ -0,0 +1,17 @@ +functor +import Application System +define + ArgSpec = + record( + c(type:string single %% option "--c" expects a string, may only occur once, + optional:false char:&c) %% is not optional and has a shortcut "-c" + + h(type:string single %% option "--h" expects a string, may only occur once, + default:"default h" %% is optional and has a default value if not given + char:&h) %% and has a shortcut "-h" + ) + Args = {Application.getArgs ArgSpec} + {System.showInfo Args.c} + {System.showInfo Args.h} + {Application.exit 0} +end diff --git a/Task/Command-line-arguments/PL-I/command-line-arguments.pli b/Task/Command-line-arguments/PL-I/command-line-arguments.pli new file mode 100644 index 0000000000..be15986aaf --- /dev/null +++ b/Task/Command-line-arguments/PL-I/command-line-arguments.pli @@ -0,0 +1,8 @@ +/* The entire command line except the command word itself is passed */ +/* to the parameter variable in PL/I. */ +program: procedure (command_line) options (main); + declare command_line character (100) varying; + +... + +end program; diff --git a/Task/Command-line-arguments/Perl-6/command-line-arguments.pl6 b/Task/Command-line-arguments/Perl-6/command-line-arguments.pl6 new file mode 100644 index 0000000000..a61918aae1 --- /dev/null +++ b/Task/Command-line-arguments/Perl-6/command-line-arguments.pl6 @@ -0,0 +1,8 @@ +# with arguments supplied +$ perl6 -e 'sub MAIN($x, $y) { say $x + $y }' 3 5 +8 + +# missing argument: +$ perl6 -e 'sub MAIN($x, $y) { say $x + $y }' 3 +Usage: +-e '...' x y diff --git a/Task/Command-line-arguments/Pop11/command-line-arguments.pop11 b/Task/Command-line-arguments/Pop11/command-line-arguments.pop11 new file mode 100644 index 0000000000..39391ce1dd --- /dev/null +++ b/Task/Command-line-arguments/Pop11/command-line-arguments.pop11 @@ -0,0 +1,4 @@ +lvars arg; +for arg in poparglist do + printf(arg, '->%s<-\n'); +endfor; diff --git a/Task/Command-line-arguments/PowerBASIC/command-line-arguments-1.powerbasic b/Task/Command-line-arguments/PowerBASIC/command-line-arguments-1.powerbasic new file mode 100644 index 0000000000..416e778b67 --- /dev/null +++ b/Task/Command-line-arguments/PowerBASIC/command-line-arguments-1.powerbasic @@ -0,0 +1 @@ +? "args: '"; COMMAND$; "'" diff --git a/Task/Command-line-arguments/PowerBASIC/command-line-arguments-2.powerbasic b/Task/Command-line-arguments/PowerBASIC/command-line-arguments-2.powerbasic new file mode 100644 index 0000000000..a7eeef23c1 --- /dev/null +++ b/Task/Command-line-arguments/PowerBASIC/command-line-arguments-2.powerbasic @@ -0,0 +1,8 @@ +'these two both return ALL args +? COMMAND$ +? COMMAND$(0) + +DO WHILE(LEN(COMMAND$(i))) + PRINT "The argument "; i; " is "; COMMAND$(i) + i = i + 1 +LOOP diff --git a/Task/Command-line-arguments/PowerShell/command-line-arguments.psh b/Task/Command-line-arguments/PowerShell/command-line-arguments.psh new file mode 100644 index 0000000000..4d0224c2db --- /dev/null +++ b/Task/Command-line-arguments/PowerShell/command-line-arguments.psh @@ -0,0 +1,4 @@ +$i = 0 +foreach ($s in $args) { + Write-Host Argument (++$i) is $s +} diff --git a/Task/Command-line-arguments/Pure/command-line-arguments.pure b/Task/Command-line-arguments/Pure/command-line-arguments.pure new file mode 100644 index 0000000000..92652bb1b0 --- /dev/null +++ b/Task/Command-line-arguments/Pure/command-line-arguments.pure @@ -0,0 +1,4 @@ +using system; + +printf "There are %d command line argumants\n" argc; +puts "They are " $$ map (puts) argv; diff --git a/Task/Command-line-arguments/PureBasic/command-line-arguments-1.purebasic b/Task/Command-line-arguments/PureBasic/command-line-arguments-1.purebasic new file mode 100644 index 0000000000..aef4c7a7b2 --- /dev/null +++ b/Task/Command-line-arguments/PureBasic/command-line-arguments-1.purebasic @@ -0,0 +1,11 @@ +If OpenConsole() + Define n=CountProgramParameters() + PrintN("Reading all parameters") + While n + PrintN(ProgramParameter()) + n-1 + Wend + Print(#CRLF$+"Press Enter") + Input() + CloseConsole() +EndIf diff --git a/Task/Command-line-arguments/PureBasic/command-line-arguments-2.purebasic b/Task/Command-line-arguments/PureBasic/command-line-arguments-2.purebasic new file mode 100644 index 0000000000..3858a86c17 --- /dev/null +++ b/Task/Command-line-arguments/PureBasic/command-line-arguments-2.purebasic @@ -0,0 +1,10 @@ +If OpenConsole() + Define n + PrintN("Reading specific pameters") + For n=0 To CountProgramParameters() + PrintN(ProgramParameter(n)) + Next + Print(#CRLF$+"Press Enter") + Input() + CloseConsole() +EndIf diff --git a/Task/Command-line-arguments/REALbasic/command-line-arguments.realbasic b/Task/Command-line-arguments/REALbasic/command-line-arguments.realbasic new file mode 100644 index 0000000000..8cf17f0791 --- /dev/null +++ b/Task/Command-line-arguments/REALbasic/command-line-arguments.realbasic @@ -0,0 +1,5 @@ +Function Run(args() as String) As Integer + For each arg As String In args + Stdout.WriteLine(arg) + Next +End Function diff --git a/Task/Command-line-arguments/RapidQ/command-line-arguments.rapidq b/Task/Command-line-arguments/RapidQ/command-line-arguments.rapidq new file mode 100644 index 0000000000..339dc86a89 --- /dev/null +++ b/Task/Command-line-arguments/RapidQ/command-line-arguments.rapidq @@ -0,0 +1,4 @@ +PRINT "This program is named "; Command$(0) +FOR i=1 TO CommandCount + PRINT "The argument "; i; " is "; Command$(i) +NEXT i diff --git a/Task/Command-line-arguments/Raven/command-line-arguments.raven b/Task/Command-line-arguments/Raven/command-line-arguments.raven new file mode 100644 index 0000000000..5f7c2122a7 --- /dev/null +++ b/Task/Command-line-arguments/Raven/command-line-arguments.raven @@ -0,0 +1,9 @@ +ARGS print + +stack (6 items) + 0 => "raven" + 1 => "myprogram" + 2 => "-c" + 3 => "alpha beta" + 4 => "-h" + 5 => "gamma" diff --git a/Task/Command-line-arguments/Seed7/command-line-arguments.seed7 b/Task/Command-line-arguments/Seed7/command-line-arguments.seed7 new file mode 100644 index 0000000000..98e4f2343b --- /dev/null +++ b/Task/Command-line-arguments/Seed7/command-line-arguments.seed7 @@ -0,0 +1,11 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: i is 0; + begin + writeln("This program is named " <& name(PROGRAM) <& "."); + for i range 1 to length(argv(PROGRAM)) do + writeln("The argument #" <& i <& " is " <& argv(PROGRAM)[i]); + end for; + end func; diff --git a/Task/Command-line-arguments/Slate/command-line-arguments.slate b/Task/Command-line-arguments/Slate/command-line-arguments.slate new file mode 100644 index 0000000000..504e2bdc61 --- /dev/null +++ b/Task/Command-line-arguments/Slate/command-line-arguments.slate @@ -0,0 +1 @@ +StartupArguments do: [| :arg | inform: arg] diff --git a/Task/Command-line-arguments/Standard-ML/command-line-arguments.ml b/Task/Command-line-arguments/Standard-ML/command-line-arguments.ml new file mode 100644 index 0000000000..136e24d29b --- /dev/null +++ b/Task/Command-line-arguments/Standard-ML/command-line-arguments.ml @@ -0,0 +1,5 @@ +print ("This program is named " ^ CommandLine.name () ^ ".\n"); +val args = CommandLine.arguments (); +Array.appi + (fn (i, x) => print ("the argument #" ^ Int.toString (i+1) ^ " is " ^ x ^ "\n")) + (Array.fromList args); diff --git a/Task/Command-line-arguments/TXR/command-line-arguments.txr b/Task/Command-line-arguments/TXR/command-line-arguments.txr new file mode 100644 index 0000000000..deded82f2b --- /dev/null +++ b/Task/Command-line-arguments/TXR/command-line-arguments.txr @@ -0,0 +1,7 @@ +@(next :args) +@(collect) +@arg +@(end) +@(output) +My args are: {@(rep)@arg, @(last)@arg@(end)} +@(end) diff --git a/Task/Command-line-arguments/Toka/command-line-arguments.toka b/Task/Command-line-arguments/Toka/command-line-arguments.toka new file mode 100644 index 0000000000..ba6a9ba411 --- /dev/null +++ b/Task/Command-line-arguments/Toka/command-line-arguments.toka @@ -0,0 +1,3 @@ +[ arglist array.get type cr ] is show-arg +[ dup . char: = emit space ] is #= +1 #args [ i #= show-arg ] countedLoop diff --git a/Task/Command-line-arguments/UNIX-Shell/command-line-arguments-1.sh b/Task/Command-line-arguments/UNIX-Shell/command-line-arguments-1.sh new file mode 100644 index 0000000000..2331a3bfd1 --- /dev/null +++ b/Task/Command-line-arguments/UNIX-Shell/command-line-arguments-1.sh @@ -0,0 +1 @@ +WHOLELIST="$@" diff --git a/Task/Command-line-arguments/UNIX-Shell/command-line-arguments-2.sh b/Task/Command-line-arguments/UNIX-Shell/command-line-arguments-2.sh new file mode 100644 index 0000000000..6d48170ef0 --- /dev/null +++ b/Task/Command-line-arguments/UNIX-Shell/command-line-arguments-2.sh @@ -0,0 +1,2 @@ +SECOND=$2 +FIFTH=$5 diff --git a/Task/Command-line-arguments/Ursala/command-line-arguments.ursala b/Task/Command-line-arguments/Ursala/command-line-arguments.ursala new file mode 100644 index 0000000000..78745b06f6 --- /dev/null +++ b/Task/Command-line-arguments/Ursala/command-line-arguments.ursala @@ -0,0 +1,5 @@ +#import std + +#executable ('parameterized','') + +clarg = <.file$[contents: --<''>+ _option%LP]>+ ~command.options diff --git a/Task/Command-line-arguments/V/command-line-arguments.v b/Task/Command-line-arguments/V/command-line-arguments.v new file mode 100644 index 0000000000..1988376436 --- /dev/null +++ b/Task/Command-line-arguments/V/command-line-arguments.v @@ -0,0 +1,4 @@ +$stack puts + +./args.v a b c +=[args.v a b c] diff --git a/Task/Command-line-arguments/Visual-Basic-.NET/command-line-arguments.visual b/Task/Command-line-arguments/Visual-Basic-.NET/command-line-arguments.visual new file mode 100644 index 0000000000..10e3b8205c --- /dev/null +++ b/Task/Command-line-arguments/Visual-Basic-.NET/command-line-arguments.visual @@ -0,0 +1,5 @@ +Sub Main(ByVal args As String()) + For Each token In args + Console.WriteLine(token) + Next +End Sub diff --git a/Task/Command-line-arguments/Visual-Basic/command-line-arguments.vb b/Task/Command-line-arguments/Visual-Basic/command-line-arguments.vb new file mode 100644 index 0000000000..f2e771c09c --- /dev/null +++ b/Task/Command-line-arguments/Visual-Basic/command-line-arguments.vb @@ -0,0 +1,3 @@ +Sub Main + MsgBox Command$ +End Sub diff --git a/Task/Comments/CoffeeScript/comments.coffee b/Task/Comments/CoffeeScript/comments.coffeescript similarity index 100% rename from Task/Comments/CoffeeScript/comments.coffee rename to Task/Comments/CoffeeScript/comments.coffeescript diff --git a/Task/Comments/GW-BASIC/comments.bas b/Task/Comments/GW-BASIC/comments.gw-basic similarity index 100% rename from Task/Comments/GW-BASIC/comments.bas rename to Task/Comments/GW-BASIC/comments.gw-basic diff --git a/Task/Comments/Golfscript/comments.golf b/Task/Comments/Golfscript/comments.golfscript similarity index 100% rename from Task/Comments/Golfscript/comments.golf rename to Task/Comments/Golfscript/comments.golfscript diff --git a/Task/Comments/KonsolScript/comments.konso b/Task/Comments/KonsolScript/comments.konsolscript similarity index 100% rename from Task/Comments/KonsolScript/comments.konso rename to Task/Comments/KonsolScript/comments.konsolscript diff --git a/Task/Comments/Lilypond/comments.lilypond b/Task/Comments/Lilypond/comments.lily similarity index 100% rename from Task/Comments/Lilypond/comments.lilypond rename to Task/Comments/Lilypond/comments.lily diff --git a/Task/Comments/LotusScript/comments-1.lotus b/Task/Comments/LotusScript/comments-1.lotusscript similarity index 100% rename from Task/Comments/LotusScript/comments-1.lotus rename to Task/Comments/LotusScript/comments-1.lotusscript diff --git a/Task/Comments/LotusScript/comments-2.lotus b/Task/Comments/LotusScript/comments-2.lotusscript similarity index 100% rename from Task/Comments/LotusScript/comments-2.lotus rename to Task/Comments/LotusScript/comments-2.lotusscript diff --git a/Task/Comments/MAXScript/comments.max b/Task/Comments/MAXScript/comments.maxscript similarity index 100% rename from Task/Comments/MAXScript/comments.max rename to Task/Comments/MAXScript/comments.maxscript diff --git a/Task/Comments/Mathematica/comments-1.mathematica b/Task/Comments/Mathematica/comments-1.math similarity index 100% rename from Task/Comments/Mathematica/comments-1.mathematica rename to Task/Comments/Mathematica/comments-1.math diff --git a/Task/Comments/Mathematica/comments-2.mathematica b/Task/Comments/Mathematica/comments-2.math similarity index 100% rename from Task/Comments/Mathematica/comments-2.mathematica rename to Task/Comments/Mathematica/comments-2.math diff --git a/Task/Comments/Mathematica/comments-3.mathematica b/Task/Comments/Mathematica/comments-3.math similarity index 100% rename from Task/Comments/Mathematica/comments-3.mathematica rename to Task/Comments/Mathematica/comments-3.math diff --git a/Task/Comments/NSIS/comments.nsis b/Task/Comments/NSIS/comments.nsis new file mode 100644 index 0000000000..75363c13e2 --- /dev/null +++ b/Task/Comments/NSIS/comments.nsis @@ -0,0 +1,6 @@ +# This is a comment that goes from the # to the end of the line. +; This is a comment that goes from the ; to the end of the + +/* This is a +multi-line +comment */ diff --git a/Task/Comments/Nemerle/comments.nemerle b/Task/Comments/Nemerle/comments.nemerle new file mode 100644 index 0000000000..6f996cb767 --- /dev/null +++ b/Task/Comments/Nemerle/comments.nemerle @@ -0,0 +1,6 @@ +// This comment goes up to the end of the line +/* This +is +a +multiline +comment */ diff --git a/Task/Comments/NetRexx/comments.netrexx b/Task/Comments/NetRexx/comments.netrexx new file mode 100644 index 0000000000..c0638ee59b --- /dev/null +++ b/Task/Comments/NetRexx/comments.netrexx @@ -0,0 +1,7 @@ +/* + + NetRexx comment block + +*/ + +-- NetRexx line comment diff --git a/Task/Comments/NewLISP/comments.newlisp b/Task/Comments/NewLISP/comments.newlisp new file mode 100644 index 0000000000..8b2be0f66b --- /dev/null +++ b/Task/Comments/NewLISP/comments.newlisp @@ -0,0 +1 @@ +; This is a comment diff --git a/Task/Comments/OCaml/comments.ocaml b/Task/Comments/OCaml/comments.ocaml new file mode 100644 index 0000000000..b2708f78eb --- /dev/null +++ b/Task/Comments/OCaml/comments.ocaml @@ -0,0 +1,5 @@ +(* This a comment + (* containing nested comment *) + *) + +(** This an OCamldoc documentation comment *) diff --git a/Task/Comments/Objeck/comments.objeck b/Task/Comments/Objeck/comments.objeck new file mode 100644 index 0000000000..fe98bd8497 --- /dev/null +++ b/Task/Comments/Objeck/comments.objeck @@ -0,0 +1,8 @@ +#This is a comment. +# This is other comment. + +#~ This is a comment too. ~# + +#~ This is a +multi-line +comment ~# diff --git a/Task/Comments/Octave/comments.octave b/Task/Comments/Octave/comments.octave new file mode 100644 index 0000000000..4cc72c42b5 --- /dev/null +++ b/Task/Comments/Octave/comments.octave @@ -0,0 +1,7 @@ +# I am a comment till the end of line +% I am a comment till the end of line + +%{ + This comment spans + multiple lines +%} diff --git a/Task/Comments/Openscad/comments.scad b/Task/Comments/Openscad/comments.scad new file mode 100644 index 0000000000..333c587b12 --- /dev/null +++ b/Task/Comments/Openscad/comments.scad @@ -0,0 +1,6 @@ +// This is a single line comment + +/* + This comment spans + multiple lines +*/ diff --git a/Task/Comments/OxygenBasic/comments.oxy b/Task/Comments/OxygenBasic/comments.oxy new file mode 100644 index 0000000000..3904784ee6 --- /dev/null +++ b/Task/Comments/OxygenBasic/comments.oxy @@ -0,0 +1,4 @@ +' Basic line comment +; Assembly code line comment +// C line comment +/* C block comment */ diff --git a/Task/Comments/Oz/comments.oz b/Task/Comments/Oz/comments.oz new file mode 100644 index 0000000000..9cfb2bba59 --- /dev/null +++ b/Task/Comments/Oz/comments.oz @@ -0,0 +1,7 @@ +% one line comment + +%% often with double "%" because then the indentation is correct in Emacs + +/* multi line + comment +*/ diff --git a/Task/Comments/PASM/comments.pasm b/Task/Comments/PASM/comments.pasm new file mode 100644 index 0000000000..82ca9bcc8d --- /dev/null +++ b/Task/Comments/PASM/comments.pasm @@ -0,0 +1,3 @@ +# This is a comment +print "Hello\n" # This is also a comment +end diff --git a/Task/Comments/PL-I/comments.pli b/Task/Comments/PL-I/comments.pli new file mode 100644 index 0000000000..bfa35aac33 --- /dev/null +++ b/Task/Comments/PL-I/comments.pli @@ -0,0 +1 @@ +/* This is a comment. */ diff --git a/Task/Comments/PL-SQL/comments-1.sql b/Task/Comments/PL-SQL/comments-1.sql new file mode 100644 index 0000000000..f15f6fbf1c --- /dev/null +++ b/Task/Comments/PL-SQL/comments-1.sql @@ -0,0 +1 @@ +--this is a single line comment diff --git a/Task/Comments/PL-SQL/comments-2.sql b/Task/Comments/PL-SQL/comments-2.sql new file mode 100644 index 0000000000..299fcf83f4 --- /dev/null +++ b/Task/Comments/PL-SQL/comments-2.sql @@ -0,0 +1,4 @@ +/* +this is a multiline +comment +*/ diff --git a/Task/Comments/PL-SQL/comments-3.sql b/Task/Comments/PL-SQL/comments-3.sql new file mode 100644 index 0000000000..877be70146 --- /dev/null +++ b/Task/Comments/PL-SQL/comments-3.sql @@ -0,0 +1 @@ +v_var number; --this is an end of line comment diff --git a/Task/Comments/Pascal/comments.pascal b/Task/Comments/Pascal/comments.pascal new file mode 100644 index 0000000000..1ec8c65dd8 --- /dev/null +++ b/Task/Comments/Pascal/comments.pascal @@ -0,0 +1,10 @@ +(* This is a comment. + It may extend across multiple lines. *) + +{ Alternatively curly braces + can be used. } + +(* This is a valid comment in Standard Pascal, + but not valid in [[Turbo Pascal]]. } + +{ The same is true in this case *) diff --git a/Task/Comments/Perl-6/comments.pl6 b/Task/Comments/Perl-6/comments.pl6 new file mode 100644 index 0000000000..b97906a183 --- /dev/null +++ b/Task/Comments/Perl-6/comments.pl6 @@ -0,0 +1,28 @@ +my $x = 2; # Single-line comment. + +#`( + Comments beginning with a backtick and one or more + opening bracketing characters are embedded comments. + They can span more than one line… +) + +my $y = #`{ …or only part of a line. } 3; + +#`{{ + Using more than one bracketing character lets you include + an unmatched close bracket, like this: } +}} + +#`⁅ Synopsis 2: "Bracketing characters are defined as any + Unicode characters with either bidirectional mirrorings or + Ps/Pe/Pi/Pf properties." ⁆ + +=begin comment + +Pod is the successor to Perl 5's POD. This is the simplest way +to use it for multi-line comments. For more about Pod, see +Synopsis 26: + +http://perlcabal.org/syn/S26.html + +=end comment diff --git a/Task/Comments/Pike/comments.pike b/Task/Comments/Pike/comments.pike new file mode 100644 index 0000000000..2684073fc5 --- /dev/null +++ b/Task/Comments/Pike/comments.pike @@ -0,0 +1,7 @@ +// This is a comment. +/* This is a + multi + line + comment */ + +int e = 3; // end-of-statement comment. diff --git a/Task/Comments/Pop11/comments-1.pop11 b/Task/Comments/Pop11/comments-1.pop11 new file mode 100644 index 0000000000..34a69e6cdf --- /dev/null +++ b/Task/Comments/Pop11/comments-1.pop11 @@ -0,0 +1 @@ +;;; This is a comment diff --git a/Task/Comments/Pop11/comments-2.pop11 b/Task/Comments/Pop11/comments-2.pop11 new file mode 100644 index 0000000000..f22b21829b --- /dev/null +++ b/Task/Comments/Pop11/comments-2.pop11 @@ -0,0 +1,2 @@ +/* First line + Second line */ diff --git a/Task/Comments/Pop11/comments-3.pop11 b/Task/Comments/Pop11/comments-3.pop11 new file mode 100644 index 0000000000..1061911382 --- /dev/null +++ b/Task/Comments/Pop11/comments-3.pop11 @@ -0,0 +1 @@ +/* This is a comment /* containing nested comment */ */ diff --git a/Task/Comments/Pop11/comments-4.pop11 b/Task/Comments/Pop11/comments-4.pop11 new file mode 100644 index 0000000000..76665ed94c --- /dev/null +++ b/Task/Comments/Pop11/comments-4.pop11 @@ -0,0 +1,3 @@ +#_IF false +some code +#_ENDIF diff --git a/Task/Comments/Pop11/comments-5.pop11 b/Task/Comments/Pop11/comments-5.pop11 new file mode 100644 index 0000000000..43b47d68ca --- /dev/null +++ b/Task/Comments/Pop11/comments-5.pop11 @@ -0,0 +1,3 @@ +#_IF false +This w'ont work +#_ENDIF diff --git a/Task/Comments/PostScript/comments.ps b/Task/Comments/PostScript/comments.ps new file mode 100644 index 0000000000..2fbc5b6742 --- /dev/null +++ b/Task/Comments/PostScript/comments.ps @@ -0,0 +1 @@ +%This is a legal comment in PostScript diff --git a/Task/Comments/PowerShell/comments-1.psh b/Task/Comments/PowerShell/comments-1.psh new file mode 100644 index 0000000000..44d0be8cac --- /dev/null +++ b/Task/Comments/PowerShell/comments-1.psh @@ -0,0 +1 @@ +# single-line comment diff --git a/Task/Comments/PowerShell/comments-2.psh b/Task/Comments/PowerShell/comments-2.psh new file mode 100644 index 0000000000..5a44be4e50 --- /dev/null +++ b/Task/Comments/PowerShell/comments-2.psh @@ -0,0 +1,2 @@ +<# multi-line + comment #> diff --git a/Task/Comments/ProDOS/comments.dos b/Task/Comments/ProDOS/comments.dos new file mode 100644 index 0000000000..d1c77698ac --- /dev/null +++ b/Task/Comments/ProDOS/comments.dos @@ -0,0 +1 @@ +IGNORELINE your text here diff --git a/Task/Comments/Protium/comments.protium b/Task/Comments/Protium/comments.protium new file mode 100644 index 0000000000..5cee1c62b6 --- /dev/null +++ b/Task/Comments/Protium/comments.protium @@ -0,0 +1,3 @@ +<@ OMT>This is a +multiline +comment diff --git a/Task/Comments/PureBasic/comments.purebasic b/Task/Comments/PureBasic/comments.purebasic new file mode 100644 index 0000000000..1aa2de2a2d --- /dev/null +++ b/Task/Comments/PureBasic/comments.purebasic @@ -0,0 +1,3 @@ +;comments come after an unquoted semicolon and last until the end of the line +foo = 5 ;This is a comment +c$ = ";This is not a comment" ;This is also a comment diff --git a/Task/Comments/REALbasic/comments.realbasic b/Task/Comments/REALbasic/comments.realbasic new file mode 100644 index 0000000000..ad6c79cb75 --- /dev/null +++ b/Task/Comments/REALbasic/comments.realbasic @@ -0,0 +1,3 @@ +//Comments are denoted by a preceding double slash or or single quote +'and continue to the end of the line. There are no multi-line comment blocks +Dim foo As Integer //Comments can also occupy the ends of code lines diff --git a/Task/Comments/REBOL/comments-1.rebol b/Task/Comments/REBOL/comments-1.rebol new file mode 100644 index 0000000000..534e2829fc --- /dev/null +++ b/Task/Comments/REBOL/comments-1.rebol @@ -0,0 +1,5 @@ +; This is a line comment. + +{ Multi-line strings can + be used as comments + if you like } diff --git a/Task/Comments/REBOL/comments-2.rebol b/Task/Comments/REBOL/comments-2.rebol new file mode 100644 index 0000000000..1acff74fe6 --- /dev/null +++ b/Task/Comments/REBOL/comments-2.rebol @@ -0,0 +1,6 @@ +plus2: func [ + "Adds two to a number." + n [number!] "The number to increase." +][ + n + 2 +] diff --git a/Task/Comments/RLaB/comments.rlab b/Task/Comments/RLaB/comments.rlab new file mode 100644 index 0000000000..079eae60db --- /dev/null +++ b/Task/Comments/RLaB/comments.rlab @@ -0,0 +1,4 @@ +x = "code" # I am a comment +x = "code" // Here I comment thee +# matlab-like document line +// C++ like document line diff --git a/Task/Comments/Raven/comments.raven b/Task/Comments/Raven/comments.raven new file mode 100644 index 0000000000..0bf28d3a6e --- /dev/null +++ b/Task/Comments/Raven/comments.raven @@ -0,0 +1 @@ + # this is a comment diff --git a/Task/Comments/Retro/comments.retro b/Task/Comments/Retro/comments.retro new file mode 100644 index 0000000000..9243183183 --- /dev/null +++ b/Task/Comments/Retro/comments.retro @@ -0,0 +1 @@ +( comments are placed between parentheses. A space must follow the opening parenthesis. ) diff --git a/Task/Comments/Run-BASIC/comments.run b/Task/Comments/Run-BASIC/comments.run new file mode 100644 index 0000000000..67525e1c5c --- /dev/null +++ b/Task/Comments/Run-BASIC/comments.run @@ -0,0 +1,5 @@ +'This is a comment +REM This is a comment + +print "Notice comment at the end of the line." 'This is a comment +print "Also notice this comment at the end of the line." : REM This is a comment diff --git a/Task/Comments/SAS/comments.sas b/Task/Comments/SAS/comments.sas new file mode 100644 index 0000000000..e67b7d8c84 --- /dev/null +++ b/Task/Comments/SAS/comments.sas @@ -0,0 +1,8 @@ +/* comment */ + +*another comment; + +* both + may + be + multiline; diff --git a/Task/Comments/SNOBOL4/comments.sno b/Task/Comments/SNOBOL4/comments.sno new file mode 100644 index 0000000000..28d98473cd --- /dev/null +++ b/Task/Comments/SNOBOL4/comments.sno @@ -0,0 +1,19 @@ +* An asterisk in column 1 is the standard Snobol comment +* mechanism, marking the entire line as a comment. There +* are no block or multiline comments. + +* Comments may begin at +* any position on the line. + +- A hyphen in column 1 begins a control statement. +- Unrecognized control statements are ignored and +- may also mark comment lines. Not recommended. + + ;* The semicolon statement separator + output = 'FOO' ;* begins a new statement. This idiom + output = 'BAR' ;* simulates an asterisk in the first + ;* column, allowing end of line comments. + +END + +Any text after the required END label is ignored. diff --git a/Task/Comments/Seed7/comments.seed7 b/Task/Comments/Seed7/comments.seed7 new file mode 100644 index 0000000000..a3dad3c5ca --- /dev/null +++ b/Task/Comments/Seed7/comments.seed7 @@ -0,0 +1,7 @@ +# A single line comment + +(* A multi-line + comment *) + +(* In Seed7, +(* comments can be nested. *) *) diff --git a/Task/Comments/Slate/comments.slate b/Task/Comments/Slate/comments.slate new file mode 100644 index 0000000000..cea6dfeb19 --- /dev/null +++ b/Task/Comments/Slate/comments.slate @@ -0,0 +1 @@ +"basically the same as smalltalk" diff --git a/Task/Comments/Standard-ML/comments.ml b/Task/Comments/Standard-ML/comments.ml new file mode 100644 index 0000000000..eef0f83eb3 --- /dev/null +++ b/Task/Comments/Standard-ML/comments.ml @@ -0,0 +1,3 @@ +(* This a comment + (* containing nested comment *) + *) diff --git a/Task/Comments/TI-83-BASIC/comments-1.ti-83 b/Task/Comments/TI-83-BASIC/comments-1.ti-83 new file mode 100644 index 0000000000..90ef9cae04 --- /dev/null +++ b/Task/Comments/TI-83-BASIC/comments-1.ti-83 @@ -0,0 +1 @@ +:"THIS IS A COMMENT diff --git a/Task/Comments/TI-83-BASIC/comments-2.ti-83 b/Task/Comments/TI-83-BASIC/comments-2.ti-83 new file mode 100644 index 0000000000..320ebdccad --- /dev/null +++ b/Task/Comments/TI-83-BASIC/comments-2.ti-83 @@ -0,0 +1,2 @@ +:If 0 +:THIS IS A COMMENT diff --git a/Task/Comments/TI-89-BASIC/comments.ti-89 b/Task/Comments/TI-89-BASIC/comments.ti-89 new file mode 100644 index 0000000000..cdb80a6d88 --- /dev/null +++ b/Task/Comments/TI-89-BASIC/comments.ti-89 @@ -0,0 +1 @@ +© This is a comment. Everything from © to the end of the line is ignored. diff --git a/Task/Comments/TPP/comments.tpp b/Task/Comments/TPP/comments.tpp new file mode 100644 index 0000000000..d4553ab49b --- /dev/null +++ b/Task/Comments/TPP/comments.tpp @@ -0,0 +1 @@ +--## comments are prefixed with a long handed double paintbrush diff --git a/Task/Comments/TUSCRIPT/comments.tuscript b/Task/Comments/TUSCRIPT/comments.tuscript new file mode 100644 index 0000000000..b264c2d25e --- /dev/null +++ b/Task/Comments/TUSCRIPT/comments.tuscript @@ -0,0 +1,2 @@ +$$ MODE TUSCRIPT +- This is a comment diff --git a/Task/Comments/TXR/comments.txr b/Task/Comments/TXR/comments.txr new file mode 100644 index 0000000000..911adb98e6 --- /dev/null +++ b/Task/Comments/TXR/comments.txr @@ -0,0 +1,4 @@ +@# old-style comment to end of line +@; new-style comment to end of line +@(bind a ; comment within expression + "foo") diff --git a/Task/Comments/Toka/comments-1.toka b/Task/Comments/Toka/comments-1.toka new file mode 100644 index 0000000000..0367db21f9 --- /dev/null +++ b/Task/Comments/Toka/comments-1.toka @@ -0,0 +1 @@ +#! Everything on this line (after the shebang to the left) will be ignored. diff --git a/Task/Comments/Toka/comments-2.toka b/Task/Comments/Toka/comments-2.toka new file mode 100644 index 0000000000..c2322b8e54 --- /dev/null +++ b/Task/Comments/Toka/comments-2.toka @@ -0,0 +1,2 @@ +[ ( a b -- c ) + ... ] is myword diff --git a/Task/Comments/Toka/comments-3.toka b/Task/Comments/Toka/comments-3.toka new file mode 100644 index 0000000000..8172bd2ba0 --- /dev/null +++ b/Task/Comments/Toka/comments-3.toka @@ -0,0 +1,3 @@ +( This is a + simple, multi-line + comment ) diff --git a/Task/Comments/Toka/comments-4.toka b/Task/Comments/Toka/comments-4.toka new file mode 100644 index 0000000000..de09d2d728 --- /dev/null +++ b/Task/Comments/Toka/comments-4.toka @@ -0,0 +1,3 @@ +... code .... +end. +Nothing following the end. will be evaluated by Toka. diff --git a/Task/Comments/UNIX-Shell/comments-1.sh b/Task/Comments/UNIX-Shell/comments-1.sh new file mode 100644 index 0000000000..4f3f954524 --- /dev/null +++ b/Task/Comments/UNIX-Shell/comments-1.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# A leading hash symbol begins a comment. +echo "Hello" # Comments can appear after a statement. + +# The hash symbol must be at the beginning of a word. +echo This_Is#Not_A_Comment +#Comment diff --git a/Task/Comments/UNIX-Shell/comments-2.sh b/Task/Comments/UNIX-Shell/comments-2.sh new file mode 100644 index 0000000000..e9c8fb9f76 --- /dev/null +++ b/Task/Comments/UNIX-Shell/comments-2.sh @@ -0,0 +1,6 @@ +#!/bin/csh -f + +# C Shell has a similar comment syntax, but only allows comments in a +# script file, not in terminal input. + +echo Hello#With C Shell, the hash can also be in the middle of a word. diff --git a/Task/Comments/UNIX-Shell/comments-3.sh b/Task/Comments/UNIX-Shell/comments-3.sh new file mode 100644 index 0000000000..b21e600cd0 --- /dev/null +++ b/Task/Comments/UNIX-Shell/comments-3.sh @@ -0,0 +1,3 @@ +# Comments in es (extensible shell) look like those of other shells. + +echo Hello#With es, the hash can also be in the middle of a word. diff --git a/Task/Comments/Ursala/comments-1.ursala b/Task/Comments/Ursala/comments-1.ursala new file mode 100644 index 0000000000..2ea751c57d --- /dev/null +++ b/Task/Comments/Ursala/comments-1.ursala @@ -0,0 +1,17 @@ +# this is single line a comment + +# this is a\ +continued comment + +(# this is a +multi-line comment #) + +(# comments in (# this form #) can (# +be (# arbitrarily #) #) nested #) + +---- this is also a comment\ +and can be continued + +### +The whole rest of the file after three hashes +is a comment. diff --git a/Task/Comments/Ursala/comments-2.ursala b/Task/Comments/Ursala/comments-2.ursala new file mode 100644 index 0000000000..cec3eff728 --- /dev/null +++ b/Task/Comments/Ursala/comments-2.ursala @@ -0,0 +1 @@ +x = <1,## 2,3> diff --git a/Task/Comments/Ursala/comments-3.ursala b/Task/Comments/Ursala/comments-3.ursala new file mode 100644 index 0000000000..1132a121f6 --- /dev/null +++ b/Task/Comments/Ursala/comments-3.ursala @@ -0,0 +1,10 @@ +a = + +< + 'to', + ## < + 'be', + 'or'>, + 'not', + 'to', + ## 'be'> diff --git a/Task/Comments/Ursala/comments-4.ursala b/Task/Comments/Ursala/comments-4.ursala new file mode 100644 index 0000000000..0a7af8d917 --- /dev/null +++ b/Task/Comments/Ursala/comments-4.ursala @@ -0,0 +1,7 @@ +foo = 1 + +## + +bar = 2 + +baz = 3 diff --git a/Task/Comments/Ursala/comments-5.ursala b/Task/Comments/Ursala/comments-5.ursala new file mode 100644 index 0000000000..96361e7887 --- /dev/null +++ b/Task/Comments/Ursala/comments-5.ursala @@ -0,0 +1,5 @@ +#comment -[ +I document the source text but will also be embedded in +the output library or executable file.]- + +#comment gpl'3' diff --git a/Task/Comments/Ursala/comments-6.ursala b/Task/Comments/Ursala/comments-6.ursala new file mode 100644 index 0000000000..4b989458c6 --- /dev/null +++ b/Task/Comments/Ursala/comments-6.ursala @@ -0,0 +1 @@ +my_input_type%C f diff --git a/Task/Comments/Ursala/comments-7.ursala b/Task/Comments/Ursala/comments-7.ursala new file mode 100644 index 0000000000..b8355ef4a0 --- /dev/null +++ b/Task/Comments/Ursala/comments-7.ursala @@ -0,0 +1 @@ +my_input_type%Ck f diff --git a/Task/Comments/Ursala/comments-8.ursala b/Task/Comments/Ursala/comments-8.ursala new file mode 100644 index 0000000000..07f40044eb --- /dev/null +++ b/Task/Comments/Ursala/comments-8.ursala @@ -0,0 +1,3 @@ +#depend is (parsed)* but { + otherwise, + ignored} diff --git a/Task/Comments/VHDL/comments.vhdl b/Task/Comments/VHDL/comments.vhdl new file mode 100644 index 0000000000..50aeaeaf41 --- /dev/null +++ b/Task/Comments/VHDL/comments.vhdl @@ -0,0 +1 @@ +-- Single line commment in VHDL diff --git a/Task/Comments/Verilog/comments.v b/Task/Comments/Verilog/comments.v new file mode 100644 index 0000000000..3cf6cd4fb6 --- /dev/null +++ b/Task/Comments/Verilog/comments.v @@ -0,0 +1,7 @@ +// Single line commment. + +/* + Multiple + line + comment. +*/ diff --git a/Task/Comments/Visual-Basic-.NET/comments.visual b/Task/Comments/Visual-Basic-.NET/comments.visual new file mode 100644 index 0000000000..90bac7f4b8 --- /dev/null +++ b/Task/Comments/Visual-Basic-.NET/comments.visual @@ -0,0 +1,4 @@ +' This is a comment +REM This is also a comment +Dim comment as string ' You can also append comments to statements +Dim comment2 as string REM You can append comments to statements diff --git a/Task/Comments/Visual-Basic/comments.vb b/Task/Comments/Visual-Basic/comments.vb new file mode 100644 index 0000000000..ed17cda075 --- /dev/null +++ b/Task/Comments/Visual-Basic/comments.vb @@ -0,0 +1,7 @@ +'comment +Rem comment +#If 0 + Technically not a comment; the compiler may or may not ignore this, but the + IDE won't. Note the somewhat odd formatting seen here; the IDE will likely + just mark the entire line(s) as errors. +#End If diff --git a/Task/Comments/Vorpal/comments.vorpal b/Task/Comments/Vorpal/comments.vorpal new file mode 100644 index 0000000000..be697a0aa5 --- /dev/null +++ b/Task/Comments/Vorpal/comments.vorpal @@ -0,0 +1 @@ +# single line comment diff --git a/Task/Comments/XPL0/comments-1.xpl0 b/Task/Comments/XPL0/comments-1.xpl0 new file mode 100644 index 0000000000..df89099672 --- /dev/null +++ b/Task/Comments/XPL0/comments-1.xpl0 @@ -0,0 +1 @@ +Text(0, \comment\ "Hello \not a comment\ World!"); \comment diff --git a/Task/Comments/XPL0/comments-2.xpl0 b/Task/Comments/XPL0/comments-2.xpl0 new file mode 100644 index 0000000000..47174670a2 --- /dev/null +++ b/Task/Comments/XPL0/comments-2.xpl0 @@ -0,0 +1,2 @@ + Text(0, "Hello World"); \comment +\Text(0, "Hello World"); \\comment diff --git a/Task/Comments/XPL0/comments-3.xpl0 b/Task/Comments/XPL0/comments-3.xpl0 new file mode 100644 index 0000000000..b143fc29a7 --- /dev/null +++ b/Task/Comments/XPL0/comments-3.xpl0 @@ -0,0 +1 @@ +\\Text(0, \comment\ "Hello \not a comment\ World"); \comment diff --git a/Task/Comments/XPL0/comments-4.xpl0 b/Task/Comments/XPL0/comments-4.xpl0 new file mode 100644 index 0000000000..d257d184d9 --- /dev/null +++ b/Task/Comments/XPL0/comments-4.xpl0 @@ -0,0 +1,4 @@ +cond false; +Text(0, "Hello World"); \comment +CrLf(0); +cond true; diff --git a/Task/Comments/XQuery/comments.xquery b/Task/Comments/XQuery/comments.xquery new file mode 100644 index 0000000000..076d06a036 --- /dev/null +++ b/Task/Comments/XQuery/comments.xquery @@ -0,0 +1 @@ +(: This is a XQuery comment :) diff --git a/Task/Comments/XSLT/comments.xslt b/Task/Comments/XSLT/comments.xslt new file mode 100644 index 0000000000..41821a809f --- /dev/null +++ b/Task/Comments/XSLT/comments.xslt @@ -0,0 +1 @@ + diff --git a/Task/Comments/XUL/comments.xul b/Task/Comments/XUL/comments.xul new file mode 100644 index 0000000000..41821a809f --- /dev/null +++ b/Task/Comments/XUL/comments.xul @@ -0,0 +1 @@ + diff --git a/Task/Compile-time-calculation/BASIC/compile-time-calculation-1.bas b/Task/Compile-time-calculation/BASIC/compile-time-calculation-1.basic similarity index 100% rename from Task/Compile-time-calculation/BASIC/compile-time-calculation-1.bas rename to Task/Compile-time-calculation/BASIC/compile-time-calculation-1.basic diff --git a/Task/Compile-time-calculation/BASIC/compile-time-calculation-2.bas b/Task/Compile-time-calculation/BASIC/compile-time-calculation-2.basic similarity index 100% rename from Task/Compile-time-calculation/BASIC/compile-time-calculation-2.bas rename to Task/Compile-time-calculation/BASIC/compile-time-calculation-2.basic diff --git a/Task/Compile-time-calculation/Mathematica/compile-time-calculation-1.mathematica b/Task/Compile-time-calculation/Mathematica/compile-time-calculation-1.math similarity index 100% rename from Task/Compile-time-calculation/Mathematica/compile-time-calculation-1.mathematica rename to Task/Compile-time-calculation/Mathematica/compile-time-calculation-1.math diff --git a/Task/Compile-time-calculation/Mathematica/compile-time-calculation-2.mathematica b/Task/Compile-time-calculation/Mathematica/compile-time-calculation-2.math similarity index 100% rename from Task/Compile-time-calculation/Mathematica/compile-time-calculation-2.mathematica rename to Task/Compile-time-calculation/Mathematica/compile-time-calculation-2.math diff --git a/Task/Compile-time-calculation/Nimrod/compile-time-calculation-1.nimrod b/Task/Compile-time-calculation/Nimrod/compile-time-calculation-1.nimrod new file mode 100644 index 0000000000..4fcde79ead --- /dev/null +++ b/Task/Compile-time-calculation/Nimrod/compile-time-calculation-1.nimrod @@ -0,0 +1,7 @@ +proc fact(x: int): int = + result = 1 + for i in 2..x: + result = result * i + +const fact10 = fact(10) +echo(fact10) diff --git a/Task/Compile-time-calculation/Nimrod/compile-time-calculation-2.nimrod b/Task/Compile-time-calculation/Nimrod/compile-time-calculation-2.nimrod new file mode 100644 index 0000000000..20754dab1b --- /dev/null +++ b/Task/Compile-time-calculation/Nimrod/compile-time-calculation-2.nimrod @@ -0,0 +1,3 @@ +... +STRING_LITERAL(TMP122, "3628800", 7); +... diff --git a/Task/Compile-time-calculation/OCaml/compile-time-calculation-1.ocaml b/Task/Compile-time-calculation/OCaml/compile-time-calculation-1.ocaml new file mode 100644 index 0000000000..f7acc0ac60 --- /dev/null +++ b/Task/Compile-time-calculation/OCaml/compile-time-calculation-1.ocaml @@ -0,0 +1,4 @@ +let days_to_seconds n = + let conv = 24 * 60 * 60 in + (n * conv) +;; diff --git a/Task/Compile-time-calculation/OCaml/compile-time-calculation-2.ocaml b/Task/Compile-time-calculation/OCaml/compile-time-calculation-2.ocaml new file mode 100644 index 0000000000..95cca5c0a7 --- /dev/null +++ b/Task/Compile-time-calculation/OCaml/compile-time-calculation-2.ocaml @@ -0,0 +1,5 @@ +let conv = 24 * 60 * 60 + +let days_to_seconds n = + (n * conv) +;; diff --git a/Task/Compile-time-calculation/Objeck/compile-time-calculation.objeck b/Task/Compile-time-calculation/Objeck/compile-time-calculation.objeck new file mode 100644 index 0000000000..62363bcf91 --- /dev/null +++ b/Task/Compile-time-calculation/Objeck/compile-time-calculation.objeck @@ -0,0 +1,7 @@ +bundle Default { + class CompileTime { + function : Main(args : String[]) ~ Nil { + (10*9*8*7*6*5*4*3*2*1)->PrintLine(); + } + } +} diff --git a/Task/Compile-time-calculation/OxygenBasic/compile-time-calculation.oxy b/Task/Compile-time-calculation/OxygenBasic/compile-time-calculation.oxy new file mode 100644 index 0000000000..ee9fd9d927 --- /dev/null +++ b/Task/Compile-time-calculation/OxygenBasic/compile-time-calculation.oxy @@ -0,0 +1,52 @@ +'LIBRARY CALLS +'============= + +extern lib "../../oxygen.dll" + +declare o2_basic (string src) +declare o2_exec (optional sys p) as sys +declare o2_errno () as sys +declare o2_error () as string + +extern lib "kernel32.dll" + +declare QueryPerformanceFrequency(quad*freq) +declare QueryPerformanceCounter(quad*count) + +end extern + +'EMBEDDED SOURCE CODE +'==================== + +src=quote + +===Source=== + +def Pling10 2*3*4*5*6*7*8*9*10 + +byte a[pling10] 'Pling10 is resolved to a number here at compile time + +print pling10 + +===Source=== + + +'TIMER +'===== + +quad ts,tc,freq +QueryPerformanceFrequency freq +QueryPerformanceCounter ts + +'COMPILE/EXECUTE +'=============== + +o2_basic src + +if o2_errno then + print o2_error +else + QueryPerformanceCounter tc + print "Compile time: " str((tc-ts)*1000/freq, 1) " MilliSeconds" + o2_exec 'Run the program +end if diff --git a/Task/Compile-time-calculation/Oz/compile-time-calculation.oz b/Task/Compile-time-calculation/Oz/compile-time-calculation.oz new file mode 100644 index 0000000000..35ae64b1cd --- /dev/null +++ b/Task/Compile-time-calculation/Oz/compile-time-calculation.oz @@ -0,0 +1,12 @@ +functor +import + System Application +prepare + fun {Fac N} + {FoldL {List.number 1 N 1} Number.'*' 1} + end + Fac10 = {Fac 10} +define + {System.showInfo "10! = "#Fac10} + {Application.exit 0} +end diff --git a/Task/Compile-time-calculation/PL-I/compile-time-calculation-1.pli b/Task/Compile-time-calculation/PL-I/compile-time-calculation-1.pli new file mode 100644 index 0000000000..048157c9f7 --- /dev/null +++ b/Task/Compile-time-calculation/PL-I/compile-time-calculation-1.pli @@ -0,0 +1,26 @@ +/* Factorials using the pre-processor. */ +test: procedure options (main); + + + +%factorial: procedure (N) returns (fixed); + declare N fixed; + declare (i, k) fixed; + + k = 1; + do i = 2 to N; + k = k*i; + end; + return (k); + +%end factorial; + +%activate factorial; + + declare (x, y) fixed decimal; + x = factorial (4); + put ('factorial 4 is ', x); + y = factorial (6); + put skip list ('factorial 6 is ', y); + +end test; diff --git a/Task/Compile-time-calculation/PL-I/compile-time-calculation-2.pli b/Task/Compile-time-calculation/PL-I/compile-time-calculation-2.pli new file mode 100644 index 0000000000..c4117780d8 --- /dev/null +++ b/Task/Compile-time-calculation/PL-I/compile-time-calculation-2.pli @@ -0,0 +1,8 @@ +/* Factorials using the pre-processor. */ +test: procedure options (main); + declare (x, y) fixed decimal; + x = 24; + put ('factorial 4 is ', x); + y = 720; + put skip list ('factorial 6 is ', y); +end test; diff --git a/Task/Compile-time-calculation/PL-I/compile-time-calculation-3.pli b/Task/Compile-time-calculation/PL-I/compile-time-calculation-3.pli new file mode 100644 index 0000000000..ea118dea71 --- /dev/null +++ b/Task/Compile-time-calculation/PL-I/compile-time-calculation-3.pli @@ -0,0 +1,2 @@ +factorial 4 is 24 +factorial 6 is 720 diff --git a/Task/Compile-time-calculation/Pascal/compile-time-calculation.pascal b/Task/Compile-time-calculation/Pascal/compile-time-calculation.pascal new file mode 100644 index 0000000000..a7f4ab66b5 --- /dev/null +++ b/Task/Compile-time-calculation/Pascal/compile-time-calculation.pascal @@ -0,0 +1,11 @@ +program in out; + +const + +X = 10*9*8*7*6*5*4*3*2*1 ; + +begin + +writeln(x); + +end; diff --git a/Task/Compile-time-calculation/Perl-6/compile-time-calculation-1.pl6 b/Task/Compile-time-calculation/Perl-6/compile-time-calculation-1.pl6 new file mode 100644 index 0000000000..3c4f424bd2 --- /dev/null +++ b/Task/Compile-time-calculation/Perl-6/compile-time-calculation-1.pl6 @@ -0,0 +1,2 @@ +constant $tenfact = [*] 2..10; +say $tenfact; diff --git a/Task/Compile-time-calculation/Perl-6/compile-time-calculation-2.pl6 b/Task/Compile-time-calculation/Perl-6/compile-time-calculation-2.pl6 new file mode 100644 index 0000000000..2fcd6de3a4 --- /dev/null +++ b/Task/Compile-time-calculation/Perl-6/compile-time-calculation-2.pl6 @@ -0,0 +1 @@ + say(BEGIN [*] 2..10); diff --git a/Task/Compile-time-calculation/PureBasic/compile-time-calculation.purebasic b/Task/Compile-time-calculation/PureBasic/compile-time-calculation.purebasic new file mode 100644 index 0000000000..1e72d0acb3 --- /dev/null +++ b/Task/Compile-time-calculation/PureBasic/compile-time-calculation.purebasic @@ -0,0 +1 @@ +a=1*2*3*4*5*6*7*8*9*10 diff --git a/Task/Compile-time-calculation/Seed7/compile-time-calculation.seed7 b/Task/Compile-time-calculation/Seed7/compile-time-calculation.seed7 new file mode 100644 index 0000000000..01d1fe4122 --- /dev/null +++ b/Task/Compile-time-calculation/Seed7/compile-time-calculation.seed7 @@ -0,0 +1,8 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + const integer: factorial is !10; + begin + writeln(factorial); + end func; diff --git a/Task/Compile-time-calculation/Ursala/compile-time-calculation.ursala b/Task/Compile-time-calculation/Ursala/compile-time-calculation.ursala new file mode 100644 index 0000000000..ce21e85abc --- /dev/null +++ b/Task/Compile-time-calculation/Ursala/compile-time-calculation.ursala @@ -0,0 +1,7 @@ +#import nat + +x = factorial 10 + +#executable& + +comcal = ! (%nP x)--<''> diff --git a/Task/Compile-time-calculation/XPL0/compile-time-calculation.xpl0 b/Task/Compile-time-calculation/XPL0/compile-time-calculation.xpl0 new file mode 100644 index 0000000000..04a011d448 --- /dev/null +++ b/Task/Compile-time-calculation/XPL0/compile-time-calculation.xpl0 @@ -0,0 +1,2 @@ +code IntOut=11; +IntOut(0, 10*9*8*7*6*5*4*3*2); diff --git a/Task/Compound-data-type/BASIC/compound-data-type.bas b/Task/Compound-data-type/BASIC/compound-data-type.basic similarity index 100% rename from Task/Compound-data-type/BASIC/compound-data-type.bas rename to Task/Compound-data-type/BASIC/compound-data-type.basic diff --git a/Task/Compound-data-type/CoffeeScript/compound-data-type.coffee b/Task/Compound-data-type/CoffeeScript/compound-data-type.coffeescript similarity index 100% rename from Task/Compound-data-type/CoffeeScript/compound-data-type.coffee rename to Task/Compound-data-type/CoffeeScript/compound-data-type.coffeescript diff --git a/Task/Compound-data-type/KonsolScript/compound-data-type-1.konso b/Task/Compound-data-type/KonsolScript/compound-data-type-1.konsolscript similarity index 100% rename from Task/Compound-data-type/KonsolScript/compound-data-type-1.konso rename to Task/Compound-data-type/KonsolScript/compound-data-type-1.konsolscript diff --git a/Task/Compound-data-type/KonsolScript/compound-data-type-2.konso b/Task/Compound-data-type/KonsolScript/compound-data-type-2.konsolscript similarity index 100% rename from Task/Compound-data-type/KonsolScript/compound-data-type-2.konso rename to Task/Compound-data-type/KonsolScript/compound-data-type-2.konsolscript diff --git a/Task/Compound-data-type/MAXScript/compound-data-type-1.max b/Task/Compound-data-type/MAXScript/compound-data-type-1.maxscript similarity index 100% rename from Task/Compound-data-type/MAXScript/compound-data-type-1.max rename to Task/Compound-data-type/MAXScript/compound-data-type-1.maxscript diff --git a/Task/Compound-data-type/MAXScript/compound-data-type-2.max b/Task/Compound-data-type/MAXScript/compound-data-type-2.maxscript similarity index 100% rename from Task/Compound-data-type/MAXScript/compound-data-type-2.max rename to Task/Compound-data-type/MAXScript/compound-data-type-2.maxscript diff --git a/Task/Compound-data-type/Mathematica/compound-data-type-1.mathematica b/Task/Compound-data-type/Mathematica/compound-data-type-1.math similarity index 100% rename from Task/Compound-data-type/Mathematica/compound-data-type-1.mathematica rename to Task/Compound-data-type/Mathematica/compound-data-type-1.math diff --git a/Task/Compound-data-type/Mathematica/compound-data-type-2.mathematica b/Task/Compound-data-type/Mathematica/compound-data-type-2.math similarity index 100% rename from Task/Compound-data-type/Mathematica/compound-data-type-2.mathematica rename to Task/Compound-data-type/Mathematica/compound-data-type-2.math diff --git a/Task/Compound-data-type/NetRexx/compound-data-type.netrexx b/Task/Compound-data-type/NetRexx/compound-data-type.netrexx new file mode 100644 index 0000000000..4939741fa8 --- /dev/null +++ b/Task/Compound-data-type/NetRexx/compound-data-type.netrexx @@ -0,0 +1,22 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +class RCompoundDataType + method main(args = String[]) public static + pp = Point(2, 4) + say pp + return + +class RCompoundDataType.Point -- inner class "Point" + properties indirect -- have NetRexx create getters & setters + x = Integer + y = Integer + + method Point(x_ = 0, y_ = 0) public -- providing default values for x_ & y_ lets NetRexx generate intermediate constructors Point() & Point(x_) + this.x = Integer(x_) + this.y = Integer(y_) + return + + method toString() public returns String + res = 'X='getX()',Y='getY() + return res diff --git a/Task/Compound-data-type/OCaml/compound-data-type-1.ocaml b/Task/Compound-data-type/OCaml/compound-data-type-1.ocaml new file mode 100644 index 0000000000..ddc97f9536 --- /dev/null +++ b/Task/Compound-data-type/OCaml/compound-data-type-1.ocaml @@ -0,0 +1,5 @@ +type tree = Empty + | Leaf of int + | Node of tree * tree + +let t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3)) diff --git a/Task/Compound-data-type/OCaml/compound-data-type-2.ocaml b/Task/Compound-data-type/OCaml/compound-data-type-2.ocaml new file mode 100644 index 0000000000..04315a63cf --- /dev/null +++ b/Task/Compound-data-type/OCaml/compound-data-type-2.ocaml @@ -0,0 +1 @@ +type point = { x : int; y : int } diff --git a/Task/Compound-data-type/OCaml/compound-data-type-3.ocaml b/Task/Compound-data-type/OCaml/compound-data-type-3.ocaml new file mode 100644 index 0000000000..be6e924169 --- /dev/null +++ b/Task/Compound-data-type/OCaml/compound-data-type-3.ocaml @@ -0,0 +1 @@ +let p = { x = 4; y = 5 } diff --git a/Task/Compound-data-type/OCaml/compound-data-type-4.ocaml b/Task/Compound-data-type/OCaml/compound-data-type-4.ocaml new file mode 100644 index 0000000000..1f903df37c --- /dev/null +++ b/Task/Compound-data-type/OCaml/compound-data-type-4.ocaml @@ -0,0 +1 @@ +p.x (* evaluates to 4 *) diff --git a/Task/Compound-data-type/OCaml/compound-data-type-5.ocaml b/Task/Compound-data-type/OCaml/compound-data-type-5.ocaml new file mode 100644 index 0000000000..adae5300b3 --- /dev/null +++ b/Task/Compound-data-type/OCaml/compound-data-type-5.ocaml @@ -0,0 +1 @@ +type mutable_point = { mutable x2 : int; mutable y2 : int } diff --git a/Task/Compound-data-type/OCaml/compound-data-type-6.ocaml b/Task/Compound-data-type/OCaml/compound-data-type-6.ocaml new file mode 100644 index 0000000000..9f8b5fd101 --- /dev/null +++ b/Task/Compound-data-type/OCaml/compound-data-type-6.ocaml @@ -0,0 +1,3 @@ +let p2 = { x2 = 4; y2 = 5 } in + p2.x2 <- 6; + p2 (* evaluates to { x2 = 6; y2 = 5 } *) diff --git a/Task/Compound-data-type/OCaml/compound-data-type-7.ocaml b/Task/Compound-data-type/OCaml/compound-data-type-7.ocaml new file mode 100644 index 0000000000..4a7a2a68d0 --- /dev/null +++ b/Task/Compound-data-type/OCaml/compound-data-type-7.ocaml @@ -0,0 +1 @@ +let p = (2,3) diff --git a/Task/Compound-data-type/Objeck/compound-data-type.objeck b/Task/Compound-data-type/Objeck/compound-data-type.objeck new file mode 100644 index 0000000000..16c63f22d4 --- /dev/null +++ b/Task/Compound-data-type/Objeck/compound-data-type.objeck @@ -0,0 +1,35 @@ +class Point { + @x : Int; + @y : Int; + + New() { + @x := 0; + @y := 0; + } + + New(x : Int, y : Int) { + @x := x; + @y := y; + } + + New(p : Point) { + @x := p->GetX(); + @y := p->GetY(); + } + + method : public : GetX() ~ Int { + return @x; + } + + method : public : GetY() ~ Int { + return @y; + } + + method : public : SetX(x : Int) ~ Nil { + @x := x; + } + + method : public : SetY(y : Int) ~ Nil { + @y := y; + } +} diff --git a/Task/Compound-data-type/OpenEdge-Progress/compound-data-type.openedge b/Task/Compound-data-type/OpenEdge-Progress/compound-data-type.openedge new file mode 100644 index 0000000000..86ff70e556 --- /dev/null +++ b/Task/Compound-data-type/OpenEdge-Progress/compound-data-type.openedge @@ -0,0 +1,4 @@ +def temp-table point + field x as int + field y as int + . diff --git a/Task/Compound-data-type/OxygenBasic/compound-data-type.oxy b/Task/Compound-data-type/OxygenBasic/compound-data-type.oxy new file mode 100644 index 0000000000..07734b25f1 --- /dev/null +++ b/Task/Compound-data-type/OxygenBasic/compound-data-type.oxy @@ -0,0 +1,8 @@ +'SHORT FORM +type point float x,y + +'FULL FORM +type point + float x + float y +end type diff --git a/Task/Compound-data-type/Oz/compound-data-type-1.oz b/Task/Compound-data-type/Oz/compound-data-type-1.oz new file mode 100644 index 0000000000..08f4f5cbbf --- /dev/null +++ b/Task/Compound-data-type/Oz/compound-data-type-1.oz @@ -0,0 +1 @@ +P = point(x:1 y:2) diff --git a/Task/Compound-data-type/Oz/compound-data-type-2.oz b/Task/Compound-data-type/Oz/compound-data-type-2.oz new file mode 100644 index 0000000000..42aae8de17 --- /dev/null +++ b/Task/Compound-data-type/Oz/compound-data-type-2.oz @@ -0,0 +1,4 @@ +case P of point(x:X y:Y) then + {Show X} + {Show Y} +end diff --git a/Task/Compound-data-type/PARI-GP/compound-data-type.pari b/Task/Compound-data-type/PARI-GP/compound-data-type.pari new file mode 100644 index 0000000000..994f8bd647 --- /dev/null +++ b/Task/Compound-data-type/PARI-GP/compound-data-type.pari @@ -0,0 +1,2 @@ +point.x=1; +point.y=2; diff --git a/Task/Compound-data-type/PL-I/compound-data-type.pli b/Task/Compound-data-type/PL-I/compound-data-type.pli new file mode 100644 index 0000000000..944a1463b0 --- /dev/null +++ b/Task/Compound-data-type/PL-I/compound-data-type.pli @@ -0,0 +1,4 @@ +define structure + 1 point, + 2 x float, + 2 y float; diff --git a/Task/Compound-data-type/Pascal/compound-data-type.pascal b/Task/Compound-data-type/Pascal/compound-data-type.pascal new file mode 100644 index 0000000000..634f7ed7d6 --- /dev/null +++ b/Task/Compound-data-type/Pascal/compound-data-type.pascal @@ -0,0 +1,3 @@ +type point = record + x, y: integer; + end; diff --git a/Task/Compound-data-type/Perl-6/compound-data-type-1.pl6 b/Task/Compound-data-type/Perl-6/compound-data-type-1.pl6 new file mode 100644 index 0000000000..25c78fa45d --- /dev/null +++ b/Task/Compound-data-type/Perl-6/compound-data-type-1.pl6 @@ -0,0 +1 @@ +my @point = 3, 8; diff --git a/Task/Compound-data-type/Perl-6/compound-data-type-2.pl6 b/Task/Compound-data-type/Perl-6/compound-data-type-2.pl6 new file mode 100644 index 0000000000..369d4d6da6 --- /dev/null +++ b/Task/Compound-data-type/Perl-6/compound-data-type-2.pl6 @@ -0,0 +1 @@ +my %point = x => 3, y => 8; diff --git a/Task/Compound-data-type/Perl-6/compound-data-type-3.pl6 b/Task/Compound-data-type/Perl-6/compound-data-type-3.pl6 new file mode 100644 index 0000000000..92cd6b10a1 --- /dev/null +++ b/Task/Compound-data-type/Perl-6/compound-data-type-3.pl6 @@ -0,0 +1,2 @@ +class Point { has $.x is rw; has $.y is rw; } +my Point $point .= new(x => 3, y => 8); diff --git a/Task/Compound-data-type/Pop11/compound-data-type.pop11 b/Task/Compound-data-type/Pop11/compound-data-type.pop11 new file mode 100644 index 0000000000..6d291af661 --- /dev/null +++ b/Task/Compound-data-type/Pop11/compound-data-type.pop11 @@ -0,0 +1,5 @@ +uses objectclass; +define :class Point; + slot x = 0; + slot y = 0; +enddefine; diff --git a/Task/Compound-data-type/PureBasic/compound-data-type-1.purebasic b/Task/Compound-data-type/PureBasic/compound-data-type-1.purebasic new file mode 100644 index 0000000000..520001c3be --- /dev/null +++ b/Task/Compound-data-type/PureBasic/compound-data-type-1.purebasic @@ -0,0 +1,4 @@ +Structure MyPoint + X.i + Y.i +EndStructure diff --git a/Task/Compound-data-type/PureBasic/compound-data-type-2.purebasic b/Task/Compound-data-type/PureBasic/compound-data-type-2.purebasic new file mode 100644 index 0000000000..bd0023ed6b --- /dev/null +++ b/Task/Compound-data-type/PureBasic/compound-data-type-2.purebasic @@ -0,0 +1,7 @@ +Structure MyFileDate + name.s + StructureUnion + Date_as_txt.s + Date_in_Ticks.l + EndStructureUnion +EndStructure diff --git a/Task/Compound-data-type/SIMPOL/compound-data-type-1.simpol b/Task/Compound-data-type/SIMPOL/compound-data-type-1.simpol new file mode 100644 index 0000000000..44a175bde3 --- /dev/null +++ b/Task/Compound-data-type/SIMPOL/compound-data-type-1.simpol @@ -0,0 +1,5 @@ +type mypoint + embed + integer x + integer y +end type diff --git a/Task/Compound-data-type/SIMPOL/compound-data-type-2.simpol b/Task/Compound-data-type/SIMPOL/compound-data-type-2.simpol new file mode 100644 index 0000000000..146a8b6072 --- /dev/null +++ b/Task/Compound-data-type/SIMPOL/compound-data-type-2.simpol @@ -0,0 +1,10 @@ +type mypoint + embed + integer x + integer y +end type + +function mypoint.new(mypoint me, integer x, integer y) + me.x = x + me.y = y +end function me diff --git a/Task/Compound-data-type/SNOBOL4/compound-data-type.sno b/Task/Compound-data-type/SNOBOL4/compound-data-type.sno new file mode 100644 index 0000000000..0846a071d4 --- /dev/null +++ b/Task/Compound-data-type/SNOBOL4/compound-data-type.sno @@ -0,0 +1,6 @@ + data('point(x,y)') + p1 = point(10,20) + p2 = point(10,40) + output = "Point 1 (" x(p1) "," y(p1) ")" + output = "Point 2 (" x(p2) "," y(p2) ")" +end diff --git a/Task/Compound-data-type/Seed7/compound-data-type.seed7 b/Task/Compound-data-type/Seed7/compound-data-type.seed7 new file mode 100644 index 0000000000..9a81f77181 --- /dev/null +++ b/Task/Compound-data-type/Seed7/compound-data-type.seed7 @@ -0,0 +1,4 @@ +const type: Point is new struct + var integer: x is 0; + var integer: y is 0; + end struct; diff --git a/Task/Compound-data-type/Standard-ML/compound-data-type-1.ml b/Task/Compound-data-type/Standard-ML/compound-data-type-1.ml new file mode 100644 index 0000000000..10d44d1172 --- /dev/null +++ b/Task/Compound-data-type/Standard-ML/compound-data-type-1.ml @@ -0,0 +1,5 @@ +datatype tree = Empty + | Leaf of int + | Node of tree * tree + +val t1 = Node (Leaf 1, Node (Leaf 2, Leaf 3)) diff --git a/Task/Compound-data-type/Standard-ML/compound-data-type-2.ml b/Task/Compound-data-type/Standard-ML/compound-data-type-2.ml new file mode 100644 index 0000000000..8e97da4a4a --- /dev/null +++ b/Task/Compound-data-type/Standard-ML/compound-data-type-2.ml @@ -0,0 +1 @@ +val p = (2,3) diff --git a/Task/Compound-data-type/Standard-ML/compound-data-type-3.ml b/Task/Compound-data-type/Standard-ML/compound-data-type-3.ml new file mode 100644 index 0000000000..5473dc84a9 --- /dev/null +++ b/Task/Compound-data-type/Standard-ML/compound-data-type-3.ml @@ -0,0 +1 @@ +val p = { x = 4, y = 5 } diff --git a/Task/Compound-data-type/Ursala/compound-data-type-1.ursala b/Task/Compound-data-type/Ursala/compound-data-type-1.ursala new file mode 100644 index 0000000000..179b8de271 --- /dev/null +++ b/Task/Compound-data-type/Ursala/compound-data-type-1.ursala @@ -0,0 +1 @@ +point :: x y diff --git a/Task/Compound-data-type/Ursala/compound-data-type-2.ursala b/Task/Compound-data-type/Ursala/compound-data-type-2.ursala new file mode 100644 index 0000000000..875e40f08f --- /dev/null +++ b/Task/Compound-data-type/Ursala/compound-data-type-2.ursala @@ -0,0 +1 @@ +p = point[x: 'foo',y: 'bar'] diff --git a/Task/Compound-data-type/Ursala/compound-data-type-3.ursala b/Task/Compound-data-type/Ursala/compound-data-type-3.ursala new file mode 100644 index 0000000000..1d4ce325dd --- /dev/null +++ b/Task/Compound-data-type/Ursala/compound-data-type-3.ursala @@ -0,0 +1 @@ +f = point$[x: g,y: h] diff --git a/Task/Compound-data-type/Ursala/compound-data-type-4.ursala b/Task/Compound-data-type/Ursala/compound-data-type-4.ursala new file mode 100644 index 0000000000..edb864dab7 --- /dev/null +++ b/Task/Compound-data-type/Ursala/compound-data-type-4.ursala @@ -0,0 +1,2 @@ +t = ~x p +u = ~y p diff --git a/Task/Compound-data-type/Visual-Basic-.NET/compound-data-type-1.visual b/Task/Compound-data-type/Visual-Basic-.NET/compound-data-type-1.visual new file mode 100644 index 0000000000..e439483ed9 --- /dev/null +++ b/Task/Compound-data-type/Visual-Basic-.NET/compound-data-type-1.visual @@ -0,0 +1,3 @@ +Structure Simple_Point + Public X, Y As Integer +End Structure diff --git a/Task/Compound-data-type/Visual-Basic-.NET/compound-data-type-2.visual b/Task/Compound-data-type/Visual-Basic-.NET/compound-data-type-2.visual new file mode 100644 index 0000000000..1de8939abe --- /dev/null +++ b/Task/Compound-data-type/Visual-Basic-.NET/compound-data-type-2.visual @@ -0,0 +1,22 @@ +Structure Immutable_Point + Private m_X As Integer + Private m_Y As Integer + + Public Sub New(ByVal x As Integer, ByVal y As Integer) + m_X = x + m_Y = y + End Sub + + Public ReadOnly Property X() As Integer + Get + Return m_X + End Get + End Property + + Public ReadOnly Property Y() As Integer + Get + Return m_Y + End Get + End Property + +End Structure diff --git a/Task/Compound-data-type/XSLT/compound-data-type-1.xslt b/Task/Compound-data-type/XSLT/compound-data-type-1.xslt new file mode 100644 index 0000000000..a1939fc45f --- /dev/null +++ b/Task/Compound-data-type/XSLT/compound-data-type-1.xslt @@ -0,0 +1,4 @@ + + + +Point = , diff --git a/Task/Compound-data-type/XSLT/compound-data-type-2.xslt b/Task/Compound-data-type/XSLT/compound-data-type-2.xslt new file mode 100644 index 0000000000..3fa3a0b7e0 --- /dev/null +++ b/Task/Compound-data-type/XSLT/compound-data-type-2.xslt @@ -0,0 +1,9 @@ + + + 20 + 30 + + 10 + + + diff --git a/Task/Concurrent-computing/CoffeeScript/concurrent-computing.coffee b/Task/Concurrent-computing/CoffeeScript/concurrent-computing.coffeescript similarity index 100% rename from Task/Concurrent-computing/CoffeeScript/concurrent-computing.coffee rename to Task/Concurrent-computing/CoffeeScript/concurrent-computing.coffeescript diff --git a/Task/Concurrent-computing/Mathematica/concurrent-computing.mathematica b/Task/Concurrent-computing/Mathematica/concurrent-computing.math similarity index 100% rename from Task/Concurrent-computing/Mathematica/concurrent-computing.mathematica rename to Task/Concurrent-computing/Mathematica/concurrent-computing.math diff --git a/Task/Concurrent-computing/OCaml/concurrent-computing.ocaml b/Task/Concurrent-computing/OCaml/concurrent-computing.ocaml new file mode 100644 index 0000000000..42e7e9bc81 --- /dev/null +++ b/Task/Concurrent-computing/OCaml/concurrent-computing.ocaml @@ -0,0 +1,14 @@ +#directory "+threads" +#load "unix.cma" +#load "threads.cma" + +let sleepy_print msg = + Unix.sleep (Random.int 4); + print_endline msg + +let threads = + List.map (Thread.create sleepy_print) ["Enjoy"; "Rosetta"; "Code"] + +let () = + Random.self_init (); + List.iter (Thread.join) threads diff --git a/Task/Concurrent-computing/Objeck/concurrent-computing.objeck b/Task/Concurrent-computing/Objeck/concurrent-computing.objeck new file mode 100644 index 0000000000..865b18f361 --- /dev/null +++ b/Task/Concurrent-computing/Objeck/concurrent-computing.objeck @@ -0,0 +1,27 @@ +bundle Default { + class MyThread from Thread { + New(name : String) { + Parent(name); + } + + method : public : Run(param : Base) ~ Nil { + string := param->As(String); + string->PrintLine(); + } + } + + class Concurrent { + New() { + } + + function : Main(args : System.String[]) ~ Nil { + t0 := MyThread->New("t0"); + t1 := MyThread->New("t1"); + t2 := MyThread->New("t2"); + + t0->Execute("Enjoy"->As(Base)); + t1->Execute("Rosetta"->As(Base)); + t2->Execute("Code"->As(Base)); + } + } +} diff --git a/Task/Concurrent-computing/Oz/concurrent-computing.oz b/Task/Concurrent-computing/Oz/concurrent-computing.oz new file mode 100644 index 0000000000..45dd095b9e --- /dev/null +++ b/Task/Concurrent-computing/Oz/concurrent-computing.oz @@ -0,0 +1,5 @@ +for Msg in ["Enjoy" "Rosetta" "Code"] do + thread + {System.showInfo Msg} + end +end diff --git a/Task/Concurrent-computing/PARI-GP/concurrent-computing.pari b/Task/Concurrent-computing/PARI-GP/concurrent-computing.pari new file mode 100644 index 0000000000..5bb4e57f62 --- /dev/null +++ b/Task/Concurrent-computing/PARI-GP/concurrent-computing.pari @@ -0,0 +1,17 @@ +void +foo() +{ + if (pari_daemon()) { + // Original + if (pari_daemon()) { + // Original + pari_printf("Enjoy\n"); + } else { + // Daemon #2 + pari_printf("Code\n"); + } + } else { + // Daemon #1 + pari_printf("Rosetta\n"); + } +} diff --git a/Task/Concurrent-computing/Perl-6/concurrent-computing-1.pl6 b/Task/Concurrent-computing/Perl-6/concurrent-computing-1.pl6 new file mode 100644 index 0000000000..743e55cabc --- /dev/null +++ b/Task/Concurrent-computing/Perl-6/concurrent-computing-1.pl6 @@ -0,0 +1,2 @@ +my @words = ; +@words».say diff --git a/Task/Concurrent-computing/Perl-6/concurrent-computing-2.pl6 b/Task/Concurrent-computing/Perl-6/concurrent-computing-2.pl6 new file mode 100644 index 0000000000..23f1504aff --- /dev/null +++ b/Task/Concurrent-computing/Perl-6/concurrent-computing-2.pl6 @@ -0,0 +1,3 @@ +Rosetta +Code +Enjoy diff --git a/Task/Concurrent-computing/Pike/concurrent-computing-1.pike b/Task/Concurrent-computing/Pike/concurrent-computing-1.pike new file mode 100644 index 0000000000..949e3fd34b --- /dev/null +++ b/Task/Concurrent-computing/Pike/concurrent-computing-1.pike @@ -0,0 +1,11 @@ +int main() { + // Start threads and wait for them to finish + ({ + Thread.Thread(write, "Enjoy\n"), + Thread.Thread(write, "Rosetta\n"), + Thread.Thread(write, "Code\n") + })->wait(); + + // Exit program + exit(0); +} diff --git a/Task/Concurrent-computing/Pike/concurrent-computing-2.pike b/Task/Concurrent-computing/Pike/concurrent-computing-2.pike new file mode 100644 index 0000000000..18b32b1ffc --- /dev/null +++ b/Task/Concurrent-computing/Pike/concurrent-computing-2.pike @@ -0,0 +1,8 @@ +int main(int argc, array argv) +{ + call_out(write, random(1.0), "Enjoy\n"); + call_out(write, random(1.0), "Rosetta\n"); + call_out(write, random(1.0), "Code\n"); + call_out(exit, 1, 0); + return -1; // return -1 starts the backend which makes Pike run until exit() is called. +} diff --git a/Task/Concurrent-computing/PureBasic/concurrent-computing.purebasic b/Task/Concurrent-computing/PureBasic/concurrent-computing.purebasic new file mode 100644 index 0000000000..71ee616c00 --- /dev/null +++ b/Task/Concurrent-computing/PureBasic/concurrent-computing.purebasic @@ -0,0 +1,26 @@ +Global mutex = CreateMutex() + +Procedure Printer(*str) + LockMutex(mutex) + PrintN( PeekS(*str) ) + UnlockMutex(mutex) +EndProcedure + +If OpenConsole() + LockMutex(mutex) + thread1 = CreateThread(@Printer(), @"Enjoy") + thread2 = CreateThread(@Printer(), @"Rosetta") + thread3 = CreateThread(@Printer(), @"Code") + UnlockMutex(mutex) + + WaitThread(thread1) + WaitThread(thread2) + WaitThread(thread3) + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + + CloseConsole() +EndIf + +FreeMutex(mutex) diff --git a/Task/Concurrent-computing/Raven/concurrent-computing.raven b/Task/Concurrent-computing/Raven/concurrent-computing.raven new file mode 100644 index 0000000000..bc6ebb21cc --- /dev/null +++ b/Task/Concurrent-computing/Raven/concurrent-computing.raven @@ -0,0 +1,10 @@ +[ 'Enjoy' 'Rosetta' 'Code' ] as $words + +thread talker + $words pop "%s\n" + repeat dup print + 500 choose ms + +talker as a +talker as b +talker as c diff --git a/Task/Concurrent-computing/Rhope/concurrent-computing.rhope b/Task/Concurrent-computing/Rhope/concurrent-computing.rhope new file mode 100644 index 0000000000..3562b18098 --- /dev/null +++ b/Task/Concurrent-computing/Rhope/concurrent-computing.rhope @@ -0,0 +1,6 @@ +Main(0,0) +|: + Print["Enjoy"] + Print["Rosetta"] + Print["Code"] +:| diff --git a/Task/Concurrent-computing/UnixPipes/concurrent-computing.unixpipes b/Task/Concurrent-computing/UnixPipes/concurrent-computing.unixpipes new file mode 100644 index 0000000000..7d2966e281 --- /dev/null +++ b/Task/Concurrent-computing/UnixPipes/concurrent-computing.unixpipes @@ -0,0 +1 @@ +(echo "Enjoy" & echo "Rosetta"& echo "Code"&) diff --git a/Task/Concurrent-computing/Visual-Basic-.NET/concurrent-computing.visual b/Task/Concurrent-computing/Visual-Basic-.NET/concurrent-computing.visual new file mode 100644 index 0000000000..3929198b20 --- /dev/null +++ b/Task/Concurrent-computing/Visual-Basic-.NET/concurrent-computing.visual @@ -0,0 +1,26 @@ +Imports System.Threading + +Module Module1 + Public rnd As New Random + + Sub Main() + Dim t1 As New Thread(AddressOf Foo) + Dim t2 As New Thread(AddressOf Foo) + Dim t3 As New Thread(AddressOf Foo) + + t1.Start("Enjoy") + t2.Start("Rosetta") + t3.Start("Code") + + t1.Join() + t2.Join() + t3.Join() + + End Sub + + Sub Foo(ByVal state As Object) + Thread.Sleep(rnd.Next(1000)) + Console.WriteLine(state) + End Sub + +End Module diff --git a/Task/Conditional-structures/BASIC/conditional-structures-1.bas b/Task/Conditional-structures/BASIC/conditional-structures-1.basic similarity index 100% rename from Task/Conditional-structures/BASIC/conditional-structures-1.bas rename to Task/Conditional-structures/BASIC/conditional-structures-1.basic diff --git a/Task/Conditional-structures/BASIC/conditional-structures-2.bas b/Task/Conditional-structures/BASIC/conditional-structures-2.basic similarity index 100% rename from Task/Conditional-structures/BASIC/conditional-structures-2.bas rename to Task/Conditional-structures/BASIC/conditional-structures-2.basic diff --git a/Task/Conditional-structures/BASIC/conditional-structures-3.bas b/Task/Conditional-structures/BASIC/conditional-structures-3.basic similarity index 100% rename from Task/Conditional-structures/BASIC/conditional-structures-3.bas rename to Task/Conditional-structures/BASIC/conditional-structures-3.basic diff --git a/Task/Conditional-structures/BASIC/conditional-structures-4.bas b/Task/Conditional-structures/BASIC/conditional-structures-4.basic similarity index 100% rename from Task/Conditional-structures/BASIC/conditional-structures-4.bas rename to Task/Conditional-structures/BASIC/conditional-structures-4.basic diff --git a/Task/Conditional-structures/BASIC/conditional-structures-5.bas b/Task/Conditional-structures/BASIC/conditional-structures-5.basic similarity index 100% rename from Task/Conditional-structures/BASIC/conditional-structures-5.bas rename to Task/Conditional-structures/BASIC/conditional-structures-5.basic diff --git a/Task/Conditional-structures/BASIC/conditional-structures-6.bas b/Task/Conditional-structures/BASIC/conditional-structures-6.basic similarity index 100% rename from Task/Conditional-structures/BASIC/conditional-structures-6.bas rename to Task/Conditional-structures/BASIC/conditional-structures-6.basic diff --git a/Task/Conditional-structures/BASIC/conditional-structures-7.bas b/Task/Conditional-structures/BASIC/conditional-structures-7.basic similarity index 100% rename from Task/Conditional-structures/BASIC/conditional-structures-7.bas rename to Task/Conditional-structures/BASIC/conditional-structures-7.basic diff --git a/Task/Conditional-structures/CoffeeScript/conditional-structures-1.coffee b/Task/Conditional-structures/CoffeeScript/conditional-structures-1.coffeescript similarity index 100% rename from Task/Conditional-structures/CoffeeScript/conditional-structures-1.coffee rename to Task/Conditional-structures/CoffeeScript/conditional-structures-1.coffeescript diff --git a/Task/Conditional-structures/CoffeeScript/conditional-structures-2.coffee b/Task/Conditional-structures/CoffeeScript/conditional-structures-2.coffeescript similarity index 100% rename from Task/Conditional-structures/CoffeeScript/conditional-structures-2.coffee rename to Task/Conditional-structures/CoffeeScript/conditional-structures-2.coffeescript diff --git a/Task/Conditional-structures/CoffeeScript/conditional-structures-3.coffee b/Task/Conditional-structures/CoffeeScript/conditional-structures-3.coffeescript similarity index 100% rename from Task/Conditional-structures/CoffeeScript/conditional-structures-3.coffee rename to Task/Conditional-structures/CoffeeScript/conditional-structures-3.coffeescript diff --git a/Task/Conditional-structures/MAXScript/conditional-structures-1.max b/Task/Conditional-structures/MAXScript/conditional-structures-1.maxscript similarity index 100% rename from Task/Conditional-structures/MAXScript/conditional-structures-1.max rename to Task/Conditional-structures/MAXScript/conditional-structures-1.maxscript diff --git a/Task/Conditional-structures/MAXScript/conditional-structures-2.max b/Task/Conditional-structures/MAXScript/conditional-structures-2.maxscript similarity index 100% rename from Task/Conditional-structures/MAXScript/conditional-structures-2.max rename to Task/Conditional-structures/MAXScript/conditional-structures-2.maxscript diff --git a/Task/Conditional-structures/MAXScript/conditional-structures-3.max b/Task/Conditional-structures/MAXScript/conditional-structures-3.maxscript similarity index 100% rename from Task/Conditional-structures/MAXScript/conditional-structures-3.max rename to Task/Conditional-structures/MAXScript/conditional-structures-3.maxscript diff --git a/Task/Conditional-structures/Nemerle/conditional-structures-1.nemerle b/Task/Conditional-structures/Nemerle/conditional-structures-1.nemerle new file mode 100644 index 0000000000..b6227abbb3 --- /dev/null +++ b/Task/Conditional-structures/Nemerle/conditional-structures-1.nemerle @@ -0,0 +1,3 @@ +if (the_answer == 42) FindQuestion() else Foo(); +when (stock.price < buy_order) stock.Buy(); +unless (text < "") Write(text); diff --git a/Task/Conditional-structures/Nemerle/conditional-structures-2.nemerle b/Task/Conditional-structures/Nemerle/conditional-structures-2.nemerle new file mode 100644 index 0000000000..77a91512a4 --- /dev/null +++ b/Task/Conditional-structures/Nemerle/conditional-structures-2.nemerle @@ -0,0 +1,6 @@ +match(x) +{ + |1 => "x is one" + |x when (x < 5) => "x is less than five" + |_ => "x is at least five" +} diff --git a/Task/Conditional-structures/NetRexx/conditional-structures-1.netrexx b/Task/Conditional-structures/NetRexx/conditional-structures-1.netrexx new file mode 100644 index 0000000000..115c7d418e --- /dev/null +++ b/Task/Conditional-structures/NetRexx/conditional-structures-1.netrexx @@ -0,0 +1,34 @@ +-- simple construct +if logicalCondition then conditionWasTrue() + else conditionWasFalse() + +-- multi-line is ok too +if logicalCondition +then + conditionWasTrue() +else + conditionWasFalse() + +-- using block stuctures +if logicalCondition then do + conditionWasTrue() + ... + end +else do + conditionWasFalse() + ... + end + +-- if/else if... +if logicalCondition1 then do + condition1WasTrue() + ... + end +else if logicalCondition2 then do + condition2WasTrue() + ... + end +else do + conditionsWereFalse() + ... + end diff --git a/Task/Conditional-structures/NetRexx/conditional-structures-2.netrexx b/Task/Conditional-structures/NetRexx/conditional-structures-2.netrexx new file mode 100644 index 0000000000..c7a1011f05 --- /dev/null +++ b/Task/Conditional-structures/NetRexx/conditional-structures-2.netrexx @@ -0,0 +1,16 @@ +-- simple construct +select + when logicalCondition1 then condition1() + when logicalCondition2 then condition2() + otherwise conditionDefault() + end + +-- set up a catch block to intercept missing OTHERWISE clause +do + select + when logicalCondition1 then condition1() + when logicalCondition2 then condition2() + end +catch ex1 = NoOtherwiseException + ex1.printStackTrace() +end diff --git a/Task/Conditional-structures/NetRexx/conditional-structures-3.netrexx b/Task/Conditional-structures/NetRexx/conditional-structures-3.netrexx new file mode 100644 index 0000000000..ae2bef8a07 --- /dev/null +++ b/Task/Conditional-structures/NetRexx/conditional-structures-3.netrexx @@ -0,0 +1,6 @@ +-- simple construct +select case cc + when 'A' then say 'the case is A' + when 'B' then say 'the case is B' + otherwise say 'selection not recognized' + end diff --git a/Task/Conditional-structures/NetRexx/conditional-structures-4.netrexx b/Task/Conditional-structures/NetRexx/conditional-structures-4.netrexx new file mode 100644 index 0000000000..266e35aad7 --- /dev/null +++ b/Task/Conditional-structures/NetRexx/conditional-structures-4.netrexx @@ -0,0 +1,4 @@ +select + when cc == 'A' then ... + when cc == 'B' then ... + ... diff --git a/Task/Conditional-structures/NetRexx/conditional-structures-5.netrexx b/Task/Conditional-structures/NetRexx/conditional-structures-5.netrexx new file mode 100644 index 0000000000..6c8249d7b4 --- /dev/null +++ b/Task/Conditional-structures/NetRexx/conditional-structures-5.netrexx @@ -0,0 +1,20 @@ +select label sl protect cc case cc + when 'A' then do + say 'the case is A' + if logicalCondition then leave sl -- just to use the lable + say '...' + end + when 'B' then do + say 'the case is B' + say '...' + end + otherwise + say 'selection not recognized' + say '...' + catch exs = RuntimeException + say 'Gronk!' + exs.printStackTrace() + finally + say 'selection done' + say 'TTFN' + end sl diff --git a/Task/Conditional-structures/OCaml/conditional-structures-1.ocaml b/Task/Conditional-structures/OCaml/conditional-structures-1.ocaml new file mode 100644 index 0000000000..0bf266768a --- /dev/null +++ b/Task/Conditional-structures/OCaml/conditional-structures-1.ocaml @@ -0,0 +1,6 @@ +let condition = true + +if condition then + 1 (* evaluate something *) +else + 2 (* evaluate something *) diff --git a/Task/Conditional-structures/OCaml/conditional-structures-2.ocaml b/Task/Conditional-structures/OCaml/conditional-structures-2.ocaml new file mode 100644 index 0000000000..9d12f9f90e --- /dev/null +++ b/Task/Conditional-structures/OCaml/conditional-structures-2.ocaml @@ -0,0 +1,8 @@ +if condition then begin + (); (* evaluate things for side effects *) + 5 +end +else begin + (); (* evaluate things for side effects *) + 42 +end diff --git a/Task/Conditional-structures/OCaml/conditional-structures-3.ocaml b/Task/Conditional-structures/OCaml/conditional-structures-3.ocaml new file mode 100644 index 0000000000..80e619e59f --- /dev/null +++ b/Task/Conditional-structures/OCaml/conditional-structures-3.ocaml @@ -0,0 +1,5 @@ +match expression with +| 0 -> () (* evaluate something *) +| 1 -> () (* evaluate something *) +| n when n mod 2 = 0 -> () (* evaluate something *) +| _ -> () (* evaluate something *) diff --git a/Task/Conditional-structures/Objeck/conditional-structures-1.objeck b/Task/Conditional-structures/Objeck/conditional-structures-1.objeck new file mode 100644 index 0000000000..b9e43de777 --- /dev/null +++ b/Task/Conditional-structures/Objeck/conditional-structures-1.objeck @@ -0,0 +1,10 @@ +a := GetValue(); +if(a < 5) { + "less than 5"->PrintLine(); +} +else if(a > 5) { + "greater than 5"->PrintLine(); +} +else { + "equal to 5"->PrintLine(); +}; diff --git a/Task/Conditional-structures/Objeck/conditional-structures-2.objeck b/Task/Conditional-structures/Objeck/conditional-structures-2.objeck new file mode 100644 index 0000000000..55612275ee --- /dev/null +++ b/Task/Conditional-structures/Objeck/conditional-structures-2.objeck @@ -0,0 +1,14 @@ +a := GetValue(); +select(a) { + label 5: { + "equal to 5"->PrintLine(); + } + + label 7: { + "equal to 7"->PrintLine(); + } + + other: { + "another value"->PrintLine(); + } +}; diff --git a/Task/Conditional-structures/Octave/conditional-structures-1.octave b/Task/Conditional-structures/Octave/conditional-structures-1.octave new file mode 100644 index 0000000000..ddeeed4808 --- /dev/null +++ b/Task/Conditional-structures/Octave/conditional-structures-1.octave @@ -0,0 +1,17 @@ +if (condition) + % body +endif + +if (condition) + % body +else + % otherwise body +endif + +if (condition1) + % body +elseif (condition2) + % body 2 +else + % otherwise body +endif diff --git a/Task/Conditional-structures/Octave/conditional-structures-2.octave b/Task/Conditional-structures/Octave/conditional-structures-2.octave new file mode 100644 index 0000000000..191135acf4 --- /dev/null +++ b/Task/Conditional-structures/Octave/conditional-structures-2.octave @@ -0,0 +1,8 @@ +switch( expression ) + case label1 + % code for label1 + case label2 + % code for label2 + otherwise + % none of the previous +endswitch diff --git a/Task/Conditional-structures/Octave/conditional-structures-3.octave b/Task/Conditional-structures/Octave/conditional-structures-3.octave new file mode 100644 index 0000000000..7af1abc1d7 --- /dev/null +++ b/Task/Conditional-structures/Octave/conditional-structures-3.octave @@ -0,0 +1,8 @@ +switch ( x ) + case 1 + disp("it is 1"); + case { 5,6,7 } + disp("it is 5, or 6 or 7"); + otherwise + disp("unknown!"); +endswitch diff --git a/Task/Conditional-structures/OxygenBasic/conditional-structures.oxy b/Task/Conditional-structures/OxygenBasic/conditional-structures.oxy new file mode 100644 index 0000000000..8935489a72 --- /dev/null +++ b/Task/Conditional-structures/OxygenBasic/conditional-structures.oxy @@ -0,0 +1,20 @@ +if a then b=c else b=d + +if a=0 + b=c +elseif a<0 + b=d +else + b=e +end if + +select case a + case 'A' + v=21 +case 'B' + v=22 +case 1 to 64 + v=a+300 +case else + v=0 +end select diff --git a/Task/Conditional-structures/Oz/conditional-structures-1.oz b/Task/Conditional-structures/Oz/conditional-structures-1.oz new file mode 100644 index 0000000000..5c1ee436fa --- /dev/null +++ b/Task/Conditional-structures/Oz/conditional-structures-1.oz @@ -0,0 +1,9 @@ +proc {PrintParity X} + if {IsEven X} then + {Show even} + elseif {IsOdd X} then + {Show odd} + else + {Show 'should not happen'} + end +end diff --git a/Task/Conditional-structures/Oz/conditional-structures-2.oz b/Task/Conditional-structures/Oz/conditional-structures-2.oz new file mode 100644 index 0000000000..44681643fa --- /dev/null +++ b/Task/Conditional-structures/Oz/conditional-structures-2.oz @@ -0,0 +1,3 @@ +fun {Max X Y} + if X > Y then X else Y end +end diff --git a/Task/Conditional-structures/Oz/conditional-structures-3.oz b/Task/Conditional-structures/Oz/conditional-structures-3.oz new file mode 100644 index 0000000000..3033cf5094 --- /dev/null +++ b/Task/Conditional-structures/Oz/conditional-structures-3.oz @@ -0,0 +1,5 @@ +fun {Fac X} + case X of 0 then 1 + [] _ then X * {Fac X-1} + end +end diff --git a/Task/Conditional-structures/PARI-GP/conditional-structures.pari b/Task/Conditional-structures/PARI-GP/conditional-structures.pari new file mode 100644 index 0000000000..9baba72627 --- /dev/null +++ b/Task/Conditional-structures/PARI-GP/conditional-structures.pari @@ -0,0 +1 @@ +if(condition, do_if_true, do_if_false) diff --git a/Task/Conditional-structures/PL-I/conditional-structures-1.pli b/Task/Conditional-structures/PL-I/conditional-structures-1.pli new file mode 100644 index 0000000000..baa8844565 --- /dev/null +++ b/Task/Conditional-structures/PL-I/conditional-structures-1.pli @@ -0,0 +1,14 @@ +if condition then + statement; +else + statement; + +if condition then + do; + statement-1; + . + . + statement-n; + end; +else + statement; diff --git a/Task/Conditional-structures/PL-I/conditional-structures-2.pli b/Task/Conditional-structures/PL-I/conditional-structures-2.pli new file mode 100644 index 0000000000..af670d4a9e --- /dev/null +++ b/Task/Conditional-structures/PL-I/conditional-structures-2.pli @@ -0,0 +1,16 @@ +select (i); /* select on value of variable */ + when (1,4,9) + do; + statement(s) + end; + + when (11, 42) + do; + statement(s) + end; + + other /* everything else */ + do; + statement(s) + end; +end; diff --git a/Task/Conditional-structures/PL-I/conditional-structures-3.pli b/Task/Conditional-structures/PL-I/conditional-structures-3.pli new file mode 100644 index 0000000000..a5a9418e2a --- /dev/null +++ b/Task/Conditional-structures/PL-I/conditional-structures-3.pli @@ -0,0 +1,21 @@ +select; /* select first matching condition */ + when (i = 4); + do; + statement(s) + end; + + when (this = that) + do; + statement(s) + end; + + when (string = 'ABCDE') + do; + statement(s) + end; + + other + do; + statement(s) + end; +end; diff --git a/Task/Conditional-structures/Pascal/conditional-structures-1.pascal b/Task/Conditional-structures/Pascal/conditional-structures-1.pascal new file mode 100644 index 0000000000..64d9a3dc91 --- /dev/null +++ b/Task/Conditional-structures/Pascal/conditional-structures-1.pascal @@ -0,0 +1,23 @@ +IF condition1 THEN + procedure1 +ELSE + procedure3; + +IF condition1 THEN + BEGIN + procedure1; + procedure2; + END +ELSE + procedure3; + +IF condition 1 THEN + BEGIN + procedure1; + procedure2; + END +ELSE + BEGIN + procedure3; + procedure4; + END; diff --git a/Task/Conditional-structures/Pascal/conditional-structures-2.pascal b/Task/Conditional-structures/Pascal/conditional-structures-2.pascal new file mode 100644 index 0000000000..3c439c0e70 --- /dev/null +++ b/Task/Conditional-structures/Pascal/conditional-structures-2.pascal @@ -0,0 +1,10 @@ +case i of + 1,4,9: { executed if i is 1, 4 or 9 } + DoSomething; + 11, 13 .. 17: { executed if i is 11, 13, 14, 15, 16 or 17 } + DoSomethingElse; + 42: { executed only if i is 42 } + DoSomeOtherThing; + else + DoYetAnotherThing; +end; diff --git a/Task/Conditional-structures/Pascal/conditional-structures-3.pascal b/Task/Conditional-structures/Pascal/conditional-structures-3.pascal new file mode 100644 index 0000000000..0a45a0bead --- /dev/null +++ b/Task/Conditional-structures/Pascal/conditional-structures-3.pascal @@ -0,0 +1,7 @@ +Case X of + 'A' : statement ; + 'B' : statement ; + in ['C'..'W'] : statement ; +else + Statement ; +end; diff --git a/Task/Conditional-structures/Perl-6/conditional-structures-1.pl6 b/Task/Conditional-structures/Perl-6/conditional-structures-1.pl6 new file mode 100644 index 0000000000..c7a07c0729 --- /dev/null +++ b/Task/Conditional-structures/Perl-6/conditional-structures-1.pl6 @@ -0,0 +1,3 @@ +if won() -> $prize { + say "You won $prize."; +} diff --git a/Task/Conditional-structures/Perl-6/conditional-structures-2.pl6 b/Task/Conditional-structures/Perl-6/conditional-structures-2.pl6 new file mode 100644 index 0000000000..9989e8556b --- /dev/null +++ b/Task/Conditional-structures/Perl-6/conditional-structures-2.pl6 @@ -0,0 +1,5 @@ +given lc prompt("Done? ") { + when 'yes' { return } + when 'no' { next } + default { say "Please answer either yes or not." } +} diff --git a/Task/Conditional-structures/Perl-6/conditional-structures-3.pl6 b/Task/Conditional-structures/Perl-6/conditional-structures-3.pl6 new file mode 100644 index 0000000000..6499b83412 --- /dev/null +++ b/Task/Conditional-structures/Perl-6/conditional-structures-3.pl6 @@ -0,0 +1 @@ +$expression ?? do_something !! do_fallback diff --git a/Task/Conditional-structures/Pop11/conditional-structures-1.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-1.pop11 new file mode 100644 index 0000000000..8941dacad6 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-1.pop11 @@ -0,0 +1,3 @@ +if condition then + ;;; Action +endif; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-10.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-10.pop11 new file mode 100644 index 0000000000..e3cd0f3252 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-10.pop11 @@ -0,0 +1,7 @@ +#_IF condition1 +/* Variant 1 */ +#_ELSEIF condition2 +/* Variant 2 */ +#_ELSE +/* Variant 3 */ +#_ENDIF diff --git a/Task/Conditional-structures/Pop11/conditional-structures-2.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-2.pop11 new file mode 100644 index 0000000000..cf530e904d --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-2.pop11 @@ -0,0 +1,5 @@ +if condition then + ;;; Action1 +else + ;;; Alternative action +endif; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-3.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-3.pop11 new file mode 100644 index 0000000000..e5d9d2f631 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-3.pop11 @@ -0,0 +1,11 @@ +if condition1 then + ;;; Action1 +elseif condition2 then + ;;; Action1 +elseif condition2 then + ;;; Action2 +elseif condition3 then + ;;; Action3 +else + ;;; Alternative action +endif; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-4.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-4.pop11 new file mode 100644 index 0000000000..3e7bb298a8 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-4.pop11 @@ -0,0 +1 @@ +unless condition then /* Action */ endunless; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-5.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-5.pop11 new file mode 100644 index 0000000000..35ef9e2d21 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-5.pop11 @@ -0,0 +1 @@ +if not(condition) then /* Action */ endif; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-6.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-6.pop11 new file mode 100644 index 0000000000..a25db5b121 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-6.pop11 @@ -0,0 +1,7 @@ +if condition1 then + ;;; Action1 +elseunless condition2 then + ;;; Action2 +endif; + ;;; Action2 +endif; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-7.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-7.pop11 new file mode 100644 index 0000000000..85caa027c0 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-7.pop11 @@ -0,0 +1,5 @@ +if condition1 then + ;;; Action1 +elseif not(condition2) then + ;;; Action2 +endif; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-8.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-8.pop11 new file mode 100644 index 0000000000..67b0f4f629 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-8.pop11 @@ -0,0 +1 @@ +if x > 0 then 1 elseif x < 0 then -1 else 0 endif -> sign_x ; diff --git a/Task/Conditional-structures/Pop11/conditional-structures-9.pop11 b/Task/Conditional-structures/Pop11/conditional-structures-9.pop11 new file mode 100644 index 0000000000..ab828328b7 --- /dev/null +++ b/Task/Conditional-structures/Pop11/conditional-structures-9.pop11 @@ -0,0 +1,7 @@ +switchon(x) + case .isstring then printf('A1'); + notcase .isinteger then printf('A2'); + case = 2 orcase = 3 then printf('A3'); + case > 4 andcase < 15 then printf('A4'); + else printf('A5'); +endswitchon; diff --git a/Task/Conditional-structures/PostScript/conditional-structures-1.ps b/Task/Conditional-structures/PostScript/conditional-structures-1.ps new file mode 100644 index 0000000000..2320c482ac --- /dev/null +++ b/Task/Conditional-structures/PostScript/conditional-structures-1.ps @@ -0,0 +1 @@ +9 10 lt {(9 is less than 10) show} if diff --git a/Task/Conditional-structures/PostScript/conditional-structures-2.ps b/Task/Conditional-structures/PostScript/conditional-structures-2.ps new file mode 100644 index 0000000000..30bf43b3ef --- /dev/null +++ b/Task/Conditional-structures/PostScript/conditional-structures-2.ps @@ -0,0 +1 @@ +/a 5 lt {(yeah)} {(nope)} ifelse show diff --git a/Task/Conditional-structures/PowerShell/conditional-structures-1.psh b/Task/Conditional-structures/PowerShell/conditional-structures-1.psh new file mode 100644 index 0000000000..6c006e87bf --- /dev/null +++ b/Task/Conditional-structures/PowerShell/conditional-structures-1.psh @@ -0,0 +1,20 @@ +# standard if +if (condition) { + # ... +} + +# if-then-else +if (condition) { + # ... +} else { + # ... +} + +# if-then-elseif-else +if (condition) { + # ... +} elseif (condition2) { + # ... +} else { + # ... +} diff --git a/Task/Conditional-structures/PowerShell/conditional-structures-2.psh b/Task/Conditional-structures/PowerShell/conditional-structures-2.psh new file mode 100644 index 0000000000..172501bdf6 --- /dev/null +++ b/Task/Conditional-structures/PowerShell/conditional-structures-2.psh @@ -0,0 +1,30 @@ +# standard switch +switch ($var) { + 1 { "Value was 1" } + 2 { "Value was 2" } + default { "Value was something else" } +} + +# switch with wildcard matching +switch -Wildcard ($var) { + "a*" { "Started with a" } + "*x" { "Ended with x" } +} + +# switch with regular expression matching +switch -Regex ($var) { + "[aeiou]" { "Contained a consonant" } + "(.)\1" { "Contained a character twice in a row" } +} + +# switch allows for scriptblocks too +switch ($var) { + { $_ % 2 -eq 0 } { "Number was even" } + { $_ -gt 100 } { "Number was greater than 100" } +} + +# switch allows for handling a file +switch -Regex -File somefile.txt { + "\d+" { "Line started with a number" } + "\s+" { "Line started with whitespace" } +} diff --git a/Task/Conditional-structures/PureBasic/conditional-structures-1.purebasic b/Task/Conditional-structures/PureBasic/conditional-structures-1.purebasic new file mode 100644 index 0000000000..287bf6343b --- /dev/null +++ b/Task/Conditional-structures/PureBasic/conditional-structures-1.purebasic @@ -0,0 +1,10 @@ +If a = 0 + Debug "a = 0" + +ElseIf a > 0 + Debug "a > 0" + +Else + Debug "a < 0" + +EndIf diff --git a/Task/Conditional-structures/PureBasic/conditional-structures-2.purebasic b/Task/Conditional-structures/PureBasic/conditional-structures-2.purebasic new file mode 100644 index 0000000000..0ca45f42f7 --- /dev/null +++ b/Task/Conditional-structures/PureBasic/conditional-structures-2.purebasic @@ -0,0 +1,15 @@ +Variable = 2 + +Select Variable + Case 0 + Debug "Variable = 0" + + Case 10, 11, 99 + Debug "Variable is 10, 11 or 99" + + Case 20 To 30 + Debug "Variable >= 20 And Variable <= 30" + + Default + Debug "Variable = something else..." +EndSelect diff --git a/Task/Conditional-structures/PureBasic/conditional-structures-3.purebasic b/Task/Conditional-structures/PureBasic/conditional-structures-3.purebasic new file mode 100644 index 0000000000..ef95b60933 --- /dev/null +++ b/Task/Conditional-structures/PureBasic/conditional-structures-3.purebasic @@ -0,0 +1,5 @@ +CompilerIf #PB_Compiler_OS = #PB_OS_Linux And #PB_Compiler_Processor = #PB_Processor_x86 + Debug "Compiled on x86 Linux" +CompilerElse + Debug "Compiled on something else" +CompilerEndIf diff --git a/Task/Conditional-structures/PureBasic/conditional-structures-4.purebasic b/Task/Conditional-structures/PureBasic/conditional-structures-4.purebasic new file mode 100644 index 0000000000..3e85e61acb --- /dev/null +++ b/Task/Conditional-structures/PureBasic/conditional-structures-4.purebasic @@ -0,0 +1,10 @@ +CompilerSelect #PB_Compiler_OS + CompilerCase #PB_OS_Linux + Debug "Compiled on Linux" + CompilerCase #PB_OS_Windows + Debug "Compiled on Windows" + CompilerCase #PB_OS_MacOS + Debug "Compiled on Mac OS" + CompilerDefault + Debug "Compiled on something else" +CompilerEndIf diff --git a/Task/Conditional-structures/RLaB/conditional-structures-1.rlab b/Task/Conditional-structures/RLaB/conditional-structures-1.rlab new file mode 100644 index 0000000000..4b51c4c786 --- /dev/null +++ b/Task/Conditional-structures/RLaB/conditional-structures-1.rlab @@ -0,0 +1,4 @@ +if (x==1) +{ + // do something +} diff --git a/Task/Conditional-structures/RLaB/conditional-structures-2.rlab b/Task/Conditional-structures/RLaB/conditional-structures-2.rlab new file mode 100644 index 0000000000..5612779440 --- /dev/null +++ b/Task/Conditional-structures/RLaB/conditional-structures-2.rlab @@ -0,0 +1,8 @@ +if (x==1) +{ + // do something if x is 1 + y = const.pi; +else + // do something if x is not 1 + y = sin(const.pi*(1-x)) / (1-x); +} diff --git a/Task/Conditional-structures/RLaB/conditional-structures-3.rlab b/Task/Conditional-structures/RLaB/conditional-structures-3.rlab new file mode 100644 index 0000000000..8aaa141c82 --- /dev/null +++ b/Task/Conditional-structures/RLaB/conditional-structures-3.rlab @@ -0,0 +1,12 @@ +if (x==1) +{ + // do something if x is 1 + y = const.pi; +else if (x == 2) +{ + // do something if x is 2 + y = sin(const.pi*(1-x)) / (1-x); +else + // do something in all the other cases + y = rand(); +}} diff --git a/Task/Conditional-structures/Retro/conditional-structures-1.retro b/Task/Conditional-structures/Retro/conditional-structures-1.retro new file mode 100644 index 0000000000..ad5ce754fb --- /dev/null +++ b/Task/Conditional-structures/Retro/conditional-structures-1.retro @@ -0,0 +1,3 @@ +( condition ) [ ( true statements ) ] ifTrue +( condition ) [ ( false statements ) ] ifFalse +( condition ) [ ( true statements ) ] [ ( false statements ) ] if diff --git a/Task/Conditional-structures/Retro/conditional-structures-2.retro b/Task/Conditional-structures/Retro/conditional-structures-2.retro new file mode 100644 index 0000000000..0be611bdee --- /dev/null +++ b/Task/Conditional-structures/Retro/conditional-structures-2.retro @@ -0,0 +1,5 @@ +: foo ( n- ) + [ 1 = ] [ drop ( if quote evaluates to true ) ] when + [ 2 = ] [ drop ( if quote evaluates to true ) ] when + [ 3 = ] [ drop ( if quote evaluates to true ) ] when + drop ( default action ) ; diff --git a/Task/Conditional-structures/Rhope/conditional-structures.rhope b/Task/Conditional-structures/Rhope/conditional-structures.rhope new file mode 100644 index 0000000000..176aba7b79 --- /dev/null +++ b/Task/Conditional-structures/Rhope/conditional-structures.rhope @@ -0,0 +1,6 @@ +If[cond] +|: + Do Something[] +:||: + Do Something Else[] +:| diff --git a/Task/Conditional-structures/Run-BASIC/conditional-structures.run b/Task/Conditional-structures/Run-BASIC/conditional-structures.run new file mode 100644 index 0000000000..5de78db6c1 --- /dev/null +++ b/Task/Conditional-structures/Run-BASIC/conditional-structures.run @@ -0,0 +1,80 @@ +' Boolean Evaluations +' +' > Greater Than +' < Less Than +' >= Greater Than Or Equal To +' <= Less Than Or Equal To +' = Equal to + +x = 0 + +if x = 0 then print "Zero" + +' -------------------------- +' if/then/else +if x = 0 then +print "Zero" +else +print "Nonzero" +end if + +' -------------------------- +' not +if x then +print "x has a value." +end if +if not(x) then +print "x has no value." +end if + +' -------------------------- +' if .. end if +if x = 0 then +print "Zero" +goto [surprise] +end if +wait + +if x = 0 then goto [surprise] +print "No surprise." +wait + +[surprise] +print "Surprise!" +wait + +' -------------------------- +' case numeric +num = 3 + +select case num +case 1 +print "one" + +case 2 +print "two" + +case 3 +print "three" + +case else +print "other number" + +end select + +' -------------------------- +' case character +var$="blue" + +select case var$ + +case "red" +print "red" + +case "green" +print "green" + +case else +print "color unknown" + +end select diff --git a/Task/Conditional-structures/SIMPOL/conditional-structures-1.simpol b/Task/Conditional-structures/SIMPOL/conditional-structures-1.simpol new file mode 100644 index 0000000000..f311b8f080 --- /dev/null +++ b/Task/Conditional-structures/SIMPOL/conditional-structures-1.simpol @@ -0,0 +1,7 @@ +if x == 1 + foo() +else if x == 2 + bar() +else + foobar() +end if diff --git a/Task/Conditional-structures/SIMPOL/conditional-structures-2.simpol b/Task/Conditional-structures/SIMPOL/conditional-structures-2.simpol new file mode 100644 index 0000000000..f7777b4ca0 --- /dev/null +++ b/Task/Conditional-structures/SIMPOL/conditional-structures-2.simpol @@ -0,0 +1 @@ +.if(x == 1, "hello", "world") diff --git a/Task/Conditional-structures/SNOBOL4/conditional-structures.sno b/Task/Conditional-structures/SNOBOL4/conditional-structures.sno new file mode 100644 index 0000000000..3f5c336224 --- /dev/null +++ b/Task/Conditional-structures/SNOBOL4/conditional-structures.sno @@ -0,0 +1,14 @@ + A = "true" +* "if-then-else" +if A "true" :s(goTrue)f(goFalse) +goTrue output = "A is TRUE" :(fi) +goFalse output = "A is not TRUE" :(fi) +fi + +* "switch" +switch A ("true" | "false") . switch :s($("case" switch))f(default) +casetrue output = "A is TRUE" :(esac) +casefalse output = "A is FALSE" :(esac) +default output = "A is neither FALSE nor TRUE" +esac +end diff --git a/Task/Conditional-structures/SQL/conditional-structures-1.sql b/Task/Conditional-structures/SQL/conditional-structures-1.sql new file mode 100644 index 0000000000..b2e88f5f37 --- /dev/null +++ b/Task/Conditional-structures/SQL/conditional-structures-1.sql @@ -0,0 +1,9 @@ +case when a then b else c end + +declare @n int +set @n=124 +print case when @n=123 then 'equal' else 'not equal' end + +--If/ElseIf expression +set @n=5 +print case when @n=3 then 'Three' when @n=4 then 'Four' else 'Other' end diff --git a/Task/Conditional-structures/SQL/conditional-structures-2.sql b/Task/Conditional-structures/SQL/conditional-structures-2.sql new file mode 100644 index 0000000000..987bf53e97 --- /dev/null +++ b/Task/Conditional-structures/SQL/conditional-structures-2.sql @@ -0,0 +1,9 @@ +declare @n int +set @n=123 +if @n=123 + BEGIN --begin/end needed if more than one statement inside + print 'one two three' + END +ELSE + if @n=124 print 'one two four' + else print 'other' diff --git a/Task/Conditional-structures/Seed7/conditional-structures-1.seed7 b/Task/Conditional-structures/Seed7/conditional-structures-1.seed7 new file mode 100644 index 0000000000..b3ad9e2886 --- /dev/null +++ b/Task/Conditional-structures/Seed7/conditional-structures-1.seed7 @@ -0,0 +1,23 @@ +if condition then + statement +end if; + +if condition then + statement1 +else + statement2; +end if; + +if condition1 then + statement1 +elsif condition2 then + statement2; +end if; + +if condition1 then + statement1 +elsif condition2 then + statement2; +else + statement3; +end if; diff --git a/Task/Conditional-structures/Seed7/conditional-structures-2.seed7 b/Task/Conditional-structures/Seed7/conditional-structures-2.seed7 new file mode 100644 index 0000000000..da3909f41c --- /dev/null +++ b/Task/Conditional-structures/Seed7/conditional-structures-2.seed7 @@ -0,0 +1,10 @@ +case i of + when {1, 4, 9}: # Executed if i is 1, 4 or 9 + statement1; + when {11} | {13 .. 17}: # Executed if i is 11, 13, 14, 15, 16 or 17 + statement2; + when {42}: # Executed only if i is 42 + statement3; + otherwise: + statement4; +end case; diff --git a/Task/Conditional-structures/Slate/conditional-structures-1.slate b/Task/Conditional-structures/Slate/conditional-structures-1.slate new file mode 100644 index 0000000000..458dd770f2 --- /dev/null +++ b/Task/Conditional-structures/Slate/conditional-structures-1.slate @@ -0,0 +1,4 @@ +"Conditionals in Slate are really messages sent to Boolean objects. Like Smalltalk. (But the compiler might optimize some cases)" + balance > 0 + ifTrue: [inform: 'still sitting pretty!'.] + ifFalse: [inform: 'No money till payday!'.]. diff --git a/Task/Conditional-structures/Slate/conditional-structures-2.slate b/Task/Conditional-structures/Slate/conditional-structures-2.slate new file mode 100644 index 0000000000..6fd8b91391 --- /dev/null +++ b/Task/Conditional-structures/Slate/conditional-structures-2.slate @@ -0,0 +1,15 @@ +c@(Net URLPathEncoder traits) convert +[ | byte1 byte2 byte3 digit1 digit2| + [c in isAtEnd] whileFalse: + [byte1: c in next. + byte1 caseOf: { + $+ -> [c out nextPut: $\s]. + $% -> [byte2: c in next. + byte3: c in next. + digit1: (byte2 toDigit: 16). + digit2: (byte3 toDigit: 16). + digit1 isNil \/ [digit2 isNil] ifTrue: [error: 'Error reading hex sequence after %']. + c out nextPut: (digit1 * 16 + digit2 as: c out elementType)]. + } otherwise: [c out nextPut: byte1]. + ]. +]. diff --git a/Task/Conditional-structures/Slate/conditional-structures-3.slate b/Task/Conditional-structures/Slate/conditional-structures-3.slate new file mode 100644 index 0000000000..0234f60594 --- /dev/null +++ b/Task/Conditional-structures/Slate/conditional-structures-3.slate @@ -0,0 +1 @@ +[p isAtEnd] whileFalse: [p next evaluate]]. diff --git a/Task/Conditional-structures/TUSCRIPT/conditional-structures-1.tuscript b/Task/Conditional-structures/TUSCRIPT/conditional-structures-1.tuscript new file mode 100644 index 0000000000..7a6aa83b5a --- /dev/null +++ b/Task/Conditional-structures/TUSCRIPT/conditional-structures-1.tuscript @@ -0,0 +1,10 @@ +$$ MODE TUSCRIPT + +condition="c" +IF (condition=="a") THEN + ---> do something +ELSEIF (condition=="b") THEN + ---> do something +ELSE + ---> do something +ENDIF diff --git a/Task/Conditional-structures/TUSCRIPT/conditional-structures-2.tuscript b/Task/Conditional-structures/TUSCRIPT/conditional-structures-2.tuscript new file mode 100644 index 0000000000..15c23f3c13 --- /dev/null +++ b/Task/Conditional-structures/TUSCRIPT/conditional-structures-2.tuscript @@ -0,0 +1,14 @@ +$$ MODE TUSCRIPT + +days="Monday'Tuesday'Wednesday'Thursday'Friday'Saturday'Sunday" +dayofweek=DATE (today,day,month,year,number) +day=SELECT (days,#dayofweek) + +SELECT day +CASE "Monday" + ---> do something +CASE "Saturday","Sunday" + ---> do something +DEFAULT + ---> do something +ENDSELECT diff --git a/Task/Conditional-structures/TXR/conditional-structures-1.txr b/Task/Conditional-structures/TXR/conditional-structures-1.txr new file mode 100644 index 0000000000..e4b8d20a23 --- /dev/null +++ b/Task/Conditional-structures/TXR/conditional-structures-1.txr @@ -0,0 +1,7 @@ +@(choose :shortest x) +@x:@y +@(or) +@x<--@y +@(or) +@x+@y +@(end) diff --git a/Task/Conditional-structures/TXR/conditional-structures-2.txr b/Task/Conditional-structures/TXR/conditional-structures-2.txr new file mode 100644 index 0000000000..5cdb1a4189 --- /dev/null +++ b/Task/Conditional-structures/TXR/conditional-structures-2.txr @@ -0,0 +1,8 @@ +@(all) +@x:y@ +@z<-@w +@(and) +@(output) +We have a match: (x, y, z, w) = (@x, @y, @z, @w). +@(end) +@(end) diff --git a/Task/Conditional-structures/TXR/conditional-structures-3.txr b/Task/Conditional-structures/TXR/conditional-structures-3.txr new file mode 100644 index 0000000000..960cf91bad --- /dev/null +++ b/Task/Conditional-structures/TXR/conditional-structures-3.txr @@ -0,0 +1,8 @@ +@# match a line which contains some piece of text x +@# after the rightmost occurence of : such that the same piece +@# of text also occurs at the start of the line preceded by --> +@(all) +@*junk:@x +@(and) +-->@x@/.*/ +@(end) diff --git a/Task/Conditional-structures/Toka/conditional-structures-1.toka b/Task/Conditional-structures/Toka/conditional-structures-1.toka new file mode 100644 index 0000000000..662b55502b --- /dev/null +++ b/Task/Conditional-structures/Toka/conditional-structures-1.toka @@ -0,0 +1,2 @@ +100 100 = [ ." True\n" ] ifTrue +100 200 = [ ." True\n" ] ifTrue diff --git a/Task/Conditional-structures/Toka/conditional-structures-2.toka b/Task/Conditional-structures/Toka/conditional-structures-2.toka new file mode 100644 index 0000000000..3a0fc18a73 --- /dev/null +++ b/Task/Conditional-structures/Toka/conditional-structures-2.toka @@ -0,0 +1,2 @@ +100 100 = [ ." True\n" ] ifFalse +100 200 = [ ." True\n" ] ifFalse diff --git a/Task/Conditional-structures/Toka/conditional-structures-3.toka b/Task/Conditional-structures/Toka/conditional-structures-3.toka new file mode 100644 index 0000000000..2267ee9c4d --- /dev/null +++ b/Task/Conditional-structures/Toka/conditional-structures-3.toka @@ -0,0 +1,2 @@ +100 100 = [ ." Equal\n" ] [ ." Not Equal\n" ] ifTrueFalse +100 200 = [ ." Equal\n" ] [ ." Not Equal\n" ] ifTrueFalse diff --git a/Task/Conditional-structures/TorqueScript/conditional-structures-1.torquescript b/Task/Conditional-structures/TorqueScript/conditional-structures-1.torquescript new file mode 100644 index 0000000000..69449f47f8 --- /dev/null +++ b/Task/Conditional-structures/TorqueScript/conditional-structures-1.torquescript @@ -0,0 +1,27 @@ +// numbers and objects +if(%num == 1) +{ + foo(); +} +else if(%obj == MyObject.getID()) +{ + bar(); +} +else +{ + deusEx(); +} + +// strings +if(%str $= "Hello World") +{ + foo(); +} +else if(%str $= "Bye World") +{ + bar(); +} +else +{ + deusEx(); +} diff --git a/Task/Conditional-structures/TorqueScript/conditional-structures-2.torquescript b/Task/Conditional-structures/TorqueScript/conditional-structures-2.torquescript new file mode 100644 index 0000000000..6ef5ae6880 --- /dev/null +++ b/Task/Conditional-structures/TorqueScript/conditional-structures-2.torquescript @@ -0,0 +1,29 @@ +// numbers and objects +switch(%num) +{ + case 1: + one(); + case 2: + twoThreeOrFour(); + case 3: + twoThreeOrFour(); + case 4: + twoThreeOrFour(); + case 5: + five(); + case MyObject.getID(): + anObject(); + default: + everythingElse(); +} + +// strings +switch$(%str) +{ + case "Hello": + arrival(); + case "Goodbye": + departure(); + default: + somethingElse(); +} diff --git a/Task/Conditional-structures/TorqueScript/conditional-structures-3.torquescript b/Task/Conditional-structures/TorqueScript/conditional-structures-3.torquescript new file mode 100644 index 0000000000..105c520d38 --- /dev/null +++ b/Task/Conditional-structures/TorqueScript/conditional-structures-3.torquescript @@ -0,0 +1 @@ +%formatted = %str @ ((getSubStr(%str,strLen(%str) - 1,1) $= "s") ? "'" : "'s"); diff --git a/Task/Conditional-structures/Trith/conditional-structures-1.trith b/Task/Conditional-structures/Trith/conditional-structures-1.trith new file mode 100644 index 0000000000..4145495e85 --- /dev/null +++ b/Task/Conditional-structures/Trith/conditional-structures-1.trith @@ -0,0 +1 @@ +true ["yes" print] ["no" print] branch diff --git a/Task/Conditional-structures/Trith/conditional-structures-2.trith b/Task/Conditional-structures/Trith/conditional-structures-2.trith new file mode 100644 index 0000000000..330e73c65e --- /dev/null +++ b/Task/Conditional-structures/Trith/conditional-structures-2.trith @@ -0,0 +1 @@ +true ["yes" print] when diff --git a/Task/Conditional-structures/Trith/conditional-structures-3.trith b/Task/Conditional-structures/Trith/conditional-structures-3.trith new file mode 100644 index 0000000000..e2ea5cc8f4 --- /dev/null +++ b/Task/Conditional-structures/Trith/conditional-structures-3.trith @@ -0,0 +1 @@ +false ["no" print] unless diff --git a/Task/Conditional-structures/UNIX-Shell/conditional-structures-1.sh b/Task/Conditional-structures/UNIX-Shell/conditional-structures-1.sh new file mode 100644 index 0000000000..c4b3df6e23 --- /dev/null +++ b/Task/Conditional-structures/UNIX-Shell/conditional-structures-1.sh @@ -0,0 +1 @@ +if test 3 -lt 5; then echo '3 is less than 5'; fi diff --git a/Task/Conditional-structures/UNIX-Shell/conditional-structures-2.sh b/Task/Conditional-structures/UNIX-Shell/conditional-structures-2.sh new file mode 100644 index 0000000000..ad1158aacc --- /dev/null +++ b/Task/Conditional-structures/UNIX-Shell/conditional-structures-2.sh @@ -0,0 +1,7 @@ +if test 4 -ge 6; then + echo '4 is greater than or equal to 6' +elif test 4 -lt 6; then + echo '4 is less than 6' +else + echo '4 compares not to 6' +fi diff --git a/Task/Conditional-structures/UNIX-Shell/conditional-structures-3.sh b/Task/Conditional-structures/UNIX-Shell/conditional-structures-3.sh new file mode 100644 index 0000000000..a936f03ca6 --- /dev/null +++ b/Task/Conditional-structures/UNIX-Shell/conditional-structures-3.sh @@ -0,0 +1,8 @@ +case value in + choicea) + foo + ;; + choiceb) + bar + ;; +esac diff --git a/Task/Conditional-structures/UNIX-Shell/conditional-structures-4.sh b/Task/Conditional-structures/UNIX-Shell/conditional-structures-4.sh new file mode 100644 index 0000000000..b598dad182 --- /dev/null +++ b/Task/Conditional-structures/UNIX-Shell/conditional-structures-4.sh @@ -0,0 +1,2 @@ +test 3 -lt 5 && echo '3 is less than 5' +test 4 -ge 6 || echo '4 is not greater than or equal to 6' diff --git a/Task/Conditional-structures/UNIX-Shell/conditional-structures-5.sh b/Task/Conditional-structures/UNIX-Shell/conditional-structures-5.sh new file mode 100644 index 0000000000..1d5bf16421 --- /dev/null +++ b/Task/Conditional-structures/UNIX-Shell/conditional-structures-5.sh @@ -0,0 +1,11 @@ +# This is a while loop +l=1 +while [ l -le 5 ]; do + echo $l +done + +# This is an until loop +l=1 +until [ l -eq 5 ]; do + echo $l +done diff --git a/Task/Conditional-structures/UNIX-Shell/conditional-structures-6.sh b/Task/Conditional-structures/UNIX-Shell/conditional-structures-6.sh new file mode 100644 index 0000000000..e6082522a2 --- /dev/null +++ b/Task/Conditional-structures/UNIX-Shell/conditional-structures-6.sh @@ -0,0 +1,2 @@ +if (3 < 5) echo '3 is less than 5' +if ({ grep -q ^root: /etc/passwd }) echo 'passwd has root' diff --git a/Task/Conditional-structures/UNIX-Shell/conditional-structures-7.sh b/Task/Conditional-structures/UNIX-Shell/conditional-structures-7.sh new file mode 100644 index 0000000000..b5eb536f0f --- /dev/null +++ b/Task/Conditional-structures/UNIX-Shell/conditional-structures-7.sh @@ -0,0 +1,7 @@ +if (4 >= 6) then + echo '4 is greater than or equal to 6' +else if (4 < 6) then + echo '4 is less than 6' +else + echo '4 compares not to 6' +endif diff --git a/Task/Conditional-structures/V/conditional-structures-1.v b/Task/Conditional-structures/V/conditional-structures-1.v new file mode 100644 index 0000000000..1b1d1ec212 --- /dev/null +++ b/Task/Conditional-structures/V/conditional-structures-1.v @@ -0,0 +1,6 @@ +[true] + ['is true' puts] + ['is false' puts] +ifte + +=is true diff --git a/Task/Conditional-structures/V/conditional-structures-2.v b/Task/Conditional-structures/V/conditional-structures-2.v new file mode 100644 index 0000000000..8db2ce73d7 --- /dev/null +++ b/Task/Conditional-structures/V/conditional-structures-2.v @@ -0,0 +1,4 @@ +[true] + ['is true' puts] +if +=is true diff --git a/Task/Conditional-structures/V/conditional-structures-3.v b/Task/Conditional-structures/V/conditional-structures-3.v new file mode 100644 index 0000000000..1b7714c86c --- /dev/null +++ b/Task/Conditional-structures/V/conditional-structures-3.v @@ -0,0 +1,8 @@ +3 [ + [1 =] [1 *] + [2 =] [10 *] + [3 =] [100 *] + [4 =] [1000 *] +] when + +=300 diff --git a/Task/Conditional-structures/V/conditional-structures-4.v b/Task/Conditional-structures/V/conditional-structures-4.v new file mode 100644 index 0000000000..5723b5ec71 --- /dev/null +++ b/Task/Conditional-structures/V/conditional-structures-4.v @@ -0,0 +1,11 @@ +true + 1 2 +choice + +=1 + +false + 1 2 +choice + +=2 diff --git a/Task/Conditional-structures/VBScript/conditional-structures.vbscript b/Task/Conditional-structures/VBScript/conditional-structures.vbscript new file mode 100644 index 0000000000..d0dce66648 --- /dev/null +++ b/Task/Conditional-structures/VBScript/conditional-structures.vbscript @@ -0,0 +1,5 @@ +if (condition) then + result = "met" +else + Result = "not met" +end if diff --git a/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-1.visual b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-1.visual new file mode 100644 index 0000000000..311f1342f4 --- /dev/null +++ b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-1.visual @@ -0,0 +1,7 @@ +Dim result As String, a As String = "pants", b As String = "glasses" + +If a = b Then + result = "passed" +Else + result = "failed" +End If diff --git a/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-2.visual b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-2.visual new file mode 100644 index 0000000000..b81289d9b3 --- /dev/null +++ b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-2.visual @@ -0,0 +1,13 @@ +Dim result As String, a As String = "pants", b As String = "glasses" + +If a = b Then result = "passed" Else result = "failed" + +If a = b Then + result = "passed" +Else : result = "failed" +End If + +If a = b Then : result = "passed" +Else + result = "failed" +End If diff --git a/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-3.visual b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-3.visual new file mode 100644 index 0000000000..1882c40d62 --- /dev/null +++ b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-3.visual @@ -0,0 +1,9 @@ +Dim result As String, a As String = "pants", b As String = "glasses" + +If a = b Then + result = "passed" +ElseIf a <> b Then + result = "failed" +Else + result = "impossible" +End If diff --git a/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-4.visual b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-4.visual new file mode 100644 index 0000000000..a4260d2458 --- /dev/null +++ b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-4.visual @@ -0,0 +1,9 @@ +Dim result As String, a As String = "pants", b As String = "glasses" + +Select Case a + Case b + result = "match" + Case a : result = "duh" + Case Else + result = "impossible" +End Select diff --git a/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-5.visual b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-5.visual new file mode 100644 index 0000000000..8e7dab5b7e --- /dev/null +++ b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-5.visual @@ -0,0 +1,7 @@ +Imports Microsoft.VisualBasic + +... + +Dim result As String = CType(IIf("pants" = "glasses", "passed", "failed"), String) 'VB 1-8 + +Dim result As String = If("pants" = "glasses", "passed", "failed") 'VB 9 diff --git a/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-6.visual b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-6.visual new file mode 100644 index 0000000000..1c5469923b --- /dev/null +++ b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-6.visual @@ -0,0 +1,11 @@ +Imports Microsoft.VisualBasic + +... + +Function IIf2(Of T)(ByVal condition As Boolean, ByVal truepart As T, ByVal falsepart As T) As T + If condition Then Return truepart Else Return falsepart +End Function + +... + +Dim result As String = IIf2("pants" = "glasses", "passed", "failed") ' type is inferred diff --git a/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-7.visual b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-7.visual new file mode 100644 index 0000000000..faab523c5a --- /dev/null +++ b/Task/Conditional-structures/Visual-Basic-.NET/conditional-structures-7.visual @@ -0,0 +1 @@ +Dim result As String = If("pants" = "glasses", "passed", "failed") ' type is inferred diff --git a/Task/Conditional-structures/Vorpal/conditional-structures.vorpal b/Task/Conditional-structures/Vorpal/conditional-structures.vorpal new file mode 100644 index 0000000000..ba2b303472 --- /dev/null +++ b/Task/Conditional-structures/Vorpal/conditional-structures.vorpal @@ -0,0 +1,6 @@ +if(condition){ + result = 'met' +} +else{ + result = 'not met' +} diff --git a/Task/Conditional-structures/Wrapl/conditional-structures-1.wrapl b/Task/Conditional-structures/Wrapl/conditional-structures-1.wrapl new file mode 100644 index 0000000000..f2f8a4e449 --- /dev/null +++ b/Task/Conditional-structures/Wrapl/conditional-structures-1.wrapl @@ -0,0 +1,3 @@ +condition => success // failure +condition => success +condition // failure diff --git a/Task/Conditional-structures/Wrapl/conditional-structures-2.wrapl b/Task/Conditional-structures/Wrapl/conditional-structures-2.wrapl new file mode 100644 index 0000000000..abd328e5d0 --- /dev/null +++ b/Task/Conditional-structures/Wrapl/conditional-structures-2.wrapl @@ -0,0 +1 @@ +condition & success diff --git a/Task/Conditional-structures/Wrapl/conditional-structures-3.wrapl b/Task/Conditional-structures/Wrapl/conditional-structures-3.wrapl new file mode 100644 index 0000000000..1a46056507 --- /dev/null +++ b/Task/Conditional-structures/Wrapl/conditional-structures-3.wrapl @@ -0,0 +1 @@ +condition | failure diff --git a/Task/Conditional-structures/X86-Assembly/conditional-structures-1.x86 b/Task/Conditional-structures/X86-Assembly/conditional-structures-1.x86 new file mode 100644 index 0000000000..4042f0ed5d --- /dev/null +++ b/Task/Conditional-structures/X86-Assembly/conditional-structures-1.x86 @@ -0,0 +1,4 @@ +if(i>1) + DoSomething + +FailedSoContinueCodeExecution. diff --git a/Task/Conditional-structures/X86-Assembly/conditional-structures-2.x86 b/Task/Conditional-structures/X86-Assembly/conditional-structures-2.x86 new file mode 100644 index 0000000000..41b51a8816 --- /dev/null +++ b/Task/Conditional-structures/X86-Assembly/conditional-structures-2.x86 @@ -0,0 +1,3 @@ +cmp i, 1 +jg _DoSomething +FailedSoContinueCodeExecution diff --git a/Task/Conditional-structures/X86-Assembly/conditional-structures-3.x86 b/Task/Conditional-structures/X86-Assembly/conditional-structures-3.x86 new file mode 100644 index 0000000000..602550c2aa --- /dev/null +++ b/Task/Conditional-structures/X86-Assembly/conditional-structures-3.x86 @@ -0,0 +1,5 @@ +if(i>1) + DoSomething +else if(i<=1) + DoSomethingElse +FailedSoContinueCodeExecution diff --git a/Task/Conditional-structures/X86-Assembly/conditional-structures-4.x86 b/Task/Conditional-structures/X86-Assembly/conditional-structures-4.x86 new file mode 100644 index 0000000000..ceea31ff1a --- /dev/null +++ b/Task/Conditional-structures/X86-Assembly/conditional-structures-4.x86 @@ -0,0 +1,4 @@ +cmp i, 1 +jg _DoSomething +jle _DoSomethingElse +FailedSoContinueCodeExecution diff --git a/Task/Conditional-structures/X86-Assembly/conditional-structures-5.x86 b/Task/Conditional-structures/X86-Assembly/conditional-structures-5.x86 new file mode 100644 index 0000000000..ce53d49b19 --- /dev/null +++ b/Task/Conditional-structures/X86-Assembly/conditional-structures-5.x86 @@ -0,0 +1,5 @@ +if(i==1) + DoSomething +else + DoSomethingElse +FailedSoContinueExecution diff --git a/Task/Conditional-structures/X86-Assembly/conditional-structures-6.x86 b/Task/Conditional-structures/X86-Assembly/conditional-structures-6.x86 new file mode 100644 index 0000000000..96b11bc0d4 --- /dev/null +++ b/Task/Conditional-structures/X86-Assembly/conditional-structures-6.x86 @@ -0,0 +1,4 @@ +cmp i, 1 +je _DoSomething +jne _DoSomethingElse +FailedSoContinueExecution diff --git a/Task/Conditional-structures/XSLT/conditional-structures-1.xslt b/Task/Conditional-structures/XSLT/conditional-structures-1.xslt new file mode 100644 index 0000000000..2cfca56241 --- /dev/null +++ b/Task/Conditional-structures/XSLT/conditional-structures-1.xslt @@ -0,0 +1,3 @@ + + + diff --git a/Task/Conditional-structures/XSLT/conditional-structures-2.xslt b/Task/Conditional-structures/XSLT/conditional-structures-2.xslt new file mode 100644 index 0000000000..954cf6379e --- /dev/null +++ b/Task/Conditional-structures/XSLT/conditional-structures-2.xslt @@ -0,0 +1,12 @@ + + + + + + + + <-- etc. --> + + + + diff --git a/Task/Conditional-structures/XSLT/conditional-structures-3.xslt b/Task/Conditional-structures/XSLT/conditional-structures-3.xslt new file mode 100644 index 0000000000..26592bb1e5 --- /dev/null +++ b/Task/Conditional-structures/XSLT/conditional-structures-3.xslt @@ -0,0 +1,4 @@ +@attrib = 'false' +position() != last() +not( false() ) +boolean( $param ) diff --git a/Task/Constrained-genericity/OCaml/constrained-genericity-1.ocaml b/Task/Constrained-genericity/OCaml/constrained-genericity-1.ocaml new file mode 100644 index 0000000000..26ed86433c --- /dev/null +++ b/Task/Constrained-genericity/OCaml/constrained-genericity-1.ocaml @@ -0,0 +1,4 @@ +module type Eatable = sig + type t + val eat : t -> unit +end diff --git a/Task/Constrained-genericity/OCaml/constrained-genericity-2.ocaml b/Task/Constrained-genericity/OCaml/constrained-genericity-2.ocaml new file mode 100644 index 0000000000..26026b78cc --- /dev/null +++ b/Task/Constrained-genericity/OCaml/constrained-genericity-2.ocaml @@ -0,0 +1,5 @@ +module MakeFoodBox(A : Eatable) = struct + type elt = A.t + type t = F of elt list + let make_box_from_list xs = F xs +end diff --git a/Task/Constrained-genericity/OCaml/constrained-genericity-3.ocaml b/Task/Constrained-genericity/OCaml/constrained-genericity-3.ocaml new file mode 100644 index 0000000000..164ddd3e98 --- /dev/null +++ b/Task/Constrained-genericity/OCaml/constrained-genericity-3.ocaml @@ -0,0 +1,6 @@ +type banana = Foo (* a dummy type *) + +module Banana : Eatable with type t = banana = struct + type t = banana + let eat _ = print_endline "I'm eating a banana" +end diff --git a/Task/Constrained-genericity/OCaml/constrained-genericity-4.ocaml b/Task/Constrained-genericity/OCaml/constrained-genericity-4.ocaml new file mode 100644 index 0000000000..4f3d691028 --- /dev/null +++ b/Task/Constrained-genericity/OCaml/constrained-genericity-4.ocaml @@ -0,0 +1,4 @@ +module EatFloat : Eatable with type t = float = struct + type t = float + let eat f = Printf.printf "I'm eating %f\n%!" f +end diff --git a/Task/Constrained-genericity/OCaml/constrained-genericity-5.ocaml b/Task/Constrained-genericity/OCaml/constrained-genericity-5.ocaml new file mode 100644 index 0000000000..fb6113aa6f --- /dev/null +++ b/Task/Constrained-genericity/OCaml/constrained-genericity-5.ocaml @@ -0,0 +1,5 @@ +module BananaBox = MakeFoodBox (Banana) +module FloatBox = MakeFoodBox (EatFloat) + +let my_box = BananaBox.make_box_from_list [Foo] +let your_box = FloatBox.make_box_from_list [2.3; 4.5] diff --git a/Task/Constrained-genericity/OxygenBasic/constrained-genericity.oxy b/Task/Constrained-genericity/OxygenBasic/constrained-genericity.oxy new file mode 100644 index 0000000000..14123aecd1 --- /dev/null +++ b/Task/Constrained-genericity/OxygenBasic/constrained-genericity.oxy @@ -0,0 +1,85 @@ +macro Gluttony(vartype, capacity, foodlist) +'========================================== + +typedef vartype physical + +enum food foodlist + +type ActualFood + sys name + physical size + physical quantity +end type + +Class foodbox +'============ +has ActualFood Item[capacity] +sys max + +method put(sys f, physical s,q) + max++ + Item[max]<=f,s,q +end method + +method GetNext(ActualFood *Stuff) + if max then + copy @stuff,@Item[max], sizeof Item + max-- + end if +end method + +end class + +Class Gourmand +'============= +physical WeightGain, SleepTime + +method eats(ActualFood *stuff) + WeightGain+=stuff.size*stuff.quantity*0.75 + stuff.size=0 + stuff.quantity=0 +end method + +end class + +end macro + + +'IMPLEMENTATION +'============== + + +Gluttony ( +double,100,{ +oyster,trout,bloater, +chocolate,truffles, +cheesecake,cream,pudding,pie +}) + +% small 1 +% medium 2 +% large 3 +% huge 7 + +% none 0 +% single 1 +% few 3 +% several 7 +% many 12 + +'INSTANCE +'======== + +FoodBox Hamper +Gourmand MrG + +'TEST +'==== + +Hamper.put food.pudding,large,several +Hamper.put food.pie,huge,few +ActualFood Course +Hamper.GetNext Course +MrG.eats Course + +print MrG.WeightGain 'result 15.75 diff --git a/Task/Constrained-genericity/Perl-6/constrained-genericity-1.pl6 b/Task/Constrained-genericity/Perl-6/constrained-genericity-1.pl6 new file mode 100644 index 0000000000..5f8318c8c2 --- /dev/null +++ b/Task/Constrained-genericity/Perl-6/constrained-genericity-1.pl6 @@ -0,0 +1,13 @@ +subset Eatable of Any where { .^can('eat') }; + +class Cake { method eat() {...} } + +role FoodBox[Eatable ::T] { + has T %.foodbox; +} + +class Yummy does FoodBox[Cake] { } # composes correctly +# class Yucky does FoodBox[Int] { } # fails to compose + +my Yummy $foodbox .= new; +say $foodbox.perl; diff --git a/Task/Constrained-genericity/Perl-6/constrained-genericity-2.pl6 b/Task/Constrained-genericity/Perl-6/constrained-genericity-2.pl6 new file mode 100644 index 0000000000..c344a3bbe1 --- /dev/null +++ b/Task/Constrained-genericity/Perl-6/constrained-genericity-2.pl6 @@ -0,0 +1 @@ +Yummy.new(foodbox => {}) diff --git a/Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-1.coffee b/Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-1.coffeescript similarity index 100% rename from Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-1.coffee rename to Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-1.coffeescript diff --git a/Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-2.coffee b/Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-2.coffeescript similarity index 100% rename from Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-2.coffee rename to Task/Constrained-random-points-on-a-circle/CoffeeScript/constrained-random-points-on-a-circle-2.coffeescript diff --git a/Task/Constrained-random-points-on-a-circle/Locomotive-Basic/constrained-random-points-on-a-circle.bas b/Task/Constrained-random-points-on-a-circle/Locomotive-Basic/constrained-random-points-on-a-circle.locomotive similarity index 100% rename from Task/Constrained-random-points-on-a-circle/Locomotive-Basic/constrained-random-points-on-a-circle.bas rename to Task/Constrained-random-points-on-a-circle/Locomotive-Basic/constrained-random-points-on-a-circle.locomotive diff --git a/Task/Constrained-random-points-on-a-circle/Mathematica/constrained-random-points-on-a-circle.mathematica b/Task/Constrained-random-points-on-a-circle/Mathematica/constrained-random-points-on-a-circle.math similarity index 100% rename from Task/Constrained-random-points-on-a-circle/Mathematica/constrained-random-points-on-a-circle.mathematica rename to Task/Constrained-random-points-on-a-circle/Mathematica/constrained-random-points-on-a-circle.math diff --git a/Task/Constrained-random-points-on-a-circle/OCaml/constrained-random-points-on-a-circle.ocaml b/Task/Constrained-random-points-on-a-circle/OCaml/constrained-random-points-on-a-circle.ocaml new file mode 100644 index 0000000000..5d6daea651 --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/OCaml/constrained-random-points-on-a-circle.ocaml @@ -0,0 +1,22 @@ +let p x y = + let d = sqrt(x ** 2.0 +. y ** 2.0) in + 10.0 <= d && d <= 15.0 + +let () = + Random.self_init(); + let rec aux i acc = + if i >= 100 then acc else + let x = (Random.float 40.0) -. 20.0 + and y = (Random.float 40.0) -. 20.0 in + if (p x y) + then aux (succ i) ((x,y)::acc) + else aux i acc + in + let points = aux 0 [] in + let g = Array.init 40 (fun _ -> String.make 40 ' ') in + List.iter (fun (x,y) -> + let x = (int_of_float x) + 20 + and y = (int_of_float y) + 20 in + g.(y).[x] <- 'o' + ) points; + Array.iter print_endline g diff --git a/Task/Constrained-random-points-on-a-circle/PARI-GP/constrained-random-points-on-a-circle.pari b/Task/Constrained-random-points-on-a-circle/PARI-GP/constrained-random-points-on-a-circle.pari new file mode 100644 index 0000000000..405e3f9006 --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/PARI-GP/constrained-random-points-on-a-circle.pari @@ -0,0 +1,24 @@ +crpc()={ + my(v=vector(404),t=0,i=0,vx=vy=vector(100)); + for(x=1,14,for(y=1,14, + t=x^2+y^2; + if(t>99&t<226, + v[i++]=[x,y]; + v[i++]=[x,-y]; + v[i++]=[-x,y]; + v[i++]=[-x,-y] + ) + )); + for(x=10,15, + v[i++]=[x,0]; + v[i++]=[-x,0]; + v[i++]=[0,x]; + v[i++]=[0,-x] + ); + for(i=1,#vx, + t=v[random(#v)+1]; + vx[i]=t[1]; + vy[i]=t[2]; + ); + plothraw(vx,vy) +}; diff --git a/Task/Constrained-random-points-on-a-circle/PL-I/constrained-random-points-on-a-circle.pli b/Task/Constrained-random-points-on-a-circle/PL-I/constrained-random-points-on-a-circle.pli new file mode 100644 index 0000000000..f450904749 --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/PL-I/constrained-random-points-on-a-circle.pli @@ -0,0 +1,27 @@ +constrain: procedure options (main); + declare 1 point (100), + 2 x fixed binary, + 2 y fixed binary; + declare (i, j, a, b, c) fixed binary; + + j = 0; + do i = 1 to 100; + a = 30*random()-15; b = 30*random()-15; + c = sqrt(a**2 + b**2); + if abs(c) >= 10 & abs(c) <= 15 then + do; j = j + 1; x(j) = a; y(j) = b; end; + end; + + /* PLOT */ + declare table(-15:15, -15:15) character (1); + table = ' '; + do i = 1 to j; + table(x(i), y(i)) = '*'; + end; + do i = -15 to 15; + put skip; + do j = -15 to 15; + put edit (table(i,j)) (a); + end; + end; +end constrain; diff --git a/Task/Constrained-random-points-on-a-circle/Perl-6/constrained-random-points-on-a-circle-1.pl6 b/Task/Constrained-random-points-on-a-circle/Perl-6/constrained-random-points-on-a-circle-1.pl6 new file mode 100644 index 0000000000..69eca96fc0 --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/Perl-6/constrained-random-points-on-a-circle-1.pl6 @@ -0,0 +1,12 @@ +my @range = -15..16; + +my @points = gather for @range X @range -> $x, $y { + take [$x,$y] if 10 <= sqrt($x*$x+$y*$y) <= 15 +} +my @samples = @points.roll(100); # or .pick(100) to get distinct points + +# format and print +my %matrix; +for @range X @range -> $x, $y { %matrix{$y}{$x} = ' ' } +%matrix{$_[1]}{$_[0]} = '*' for @samples; +%matrix{$_}{@range}.join(' ').say for @range; diff --git a/Task/Constrained-random-points-on-a-circle/Perl-6/constrained-random-points-on-a-circle-2.pl6 b/Task/Constrained-random-points-on-a-circle/Perl-6/constrained-random-points-on-a-circle-2.pl6 new file mode 100644 index 0000000000..b25aed61ac --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/Perl-6/constrained-random-points-on-a-circle-2.pl6 @@ -0,0 +1,5 @@ +(say ~.map: { $_ // ' ' } for my @matrix) given do + -> [$x, $y] { @matrix[$x][$y] = '*' } for pick 100, do + for ^32 X ^32 -> $x, $y { + [$x,$y] when 100..225 given [+] ($x,$y X- 15) X** 2; + } diff --git a/Task/Constrained-random-points-on-a-circle/PureBasic/constrained-random-points-on-a-circle.purebasic b/Task/Constrained-random-points-on-a-circle/PureBasic/constrained-random-points-on-a-circle.purebasic new file mode 100644 index 0000000000..771a083fa8 --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/PureBasic/constrained-random-points-on-a-circle.purebasic @@ -0,0 +1,17 @@ +CreateImage(0,31,31) +StartDrawing(ImageOutput(0)) + For i=1 To 100 + Repeat + x=Random(30)-15 + y=Random(30)-15 + R.f=Sqr(x*x+y*y) + Until 10<=R And R<=15 + Plot(x+15,y+15,#Red) + Next +StopDrawing() + +Title$="PureBasic Plot" +Flags=#PB_Window_SystemMenu +OpenWindow(0,#PB_Ignore,#PB_Ignore,ImageWidth(0),ImageHeight(0),Title$,Flags) +ImageGadget(0,0,0,ImageWidth(0),ImageHeight(0),ImageID(0)) +Repeat: Until WaitWindowEvent()=#PB_Event_CloseWindow diff --git a/Task/Constrained-random-points-on-a-circle/Run-BASIC/constrained-random-points-on-a-circle.run b/Task/Constrained-random-points-on-a-circle/Run-BASIC/constrained-random-points-on-a-circle.run new file mode 100644 index 0000000000..989dbaeaa6 --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/Run-BASIC/constrained-random-points-on-a-circle.run @@ -0,0 +1,25 @@ +w = 320 +h = 320 +dim canvas(w,h) +for pts = 1 to 1000 + x = (rnd(1) * 31) - 15 + y = (rnd(1) * 31) - 15 + r = x * x + y * y + if (r > 100) and (r < 225) then + x = int(x * 10 + w/2) + y = int(y * 10 + h/2) + canvas(x,y) = 1 + end if +next pts + +' ----------------------------- +' display the graphic +' ----------------------------- +graphic #g, w,h +for x = 1 to w + for y = 1 to h + if canvas(x,y) = 1 then #g "color green ; set "; x; " "; y else #g "color blue ; set "; x; " "; y + next y +next x +render #g +#g "flush" diff --git a/Task/Constrained-random-points-on-a-circle/SystemVerilog/constrained-random-points-on-a-circle.v b/Task/Constrained-random-points-on-a-circle/SystemVerilog/constrained-random-points-on-a-circle.v new file mode 100644 index 0000000000..9477fa3bea --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/SystemVerilog/constrained-random-points-on-a-circle.v @@ -0,0 +1,26 @@ +program main; + + bit [39:0] bitmap [40]; + + class Point; + rand bit signed [4:0] x; + rand bit signed [4:0] y; + + constraint on_circle_edge { + (10*10) <= (x*x + y*y); + (x*x + y*y) <= (15*15); + }; + + function void do_point(); + randomize; + bitmap[x+20][y+20] = 1; + endfunction + endclass + + initial begin + Point p = new; + repeat (100) p.do_point; + foreach (bitmap[row]) $display( "%b", bitmap[row]); + end + +endprogram diff --git a/Task/Constrained-random-points-on-a-circle/XPL0/constrained-random-points-on-a-circle.xpl0 b/Task/Constrained-random-points-on-a-circle/XPL0/constrained-random-points-on-a-circle.xpl0 new file mode 100644 index 0000000000..d77d55803f --- /dev/null +++ b/Task/Constrained-random-points-on-a-circle/XPL0/constrained-random-points-on-a-circle.xpl0 @@ -0,0 +1,13 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +int X, Y, C, R2; +[SetVid($13); \set 320x200x8 graphics mode +C:= 0; \initialize point counter +repeat X:= Ran(31)-15; \range -15..+15 + Y:= Ran(31)-15; + R2:= X*X + Y*Y; + if R2>=10*10 & R2<=15*15 then + [Point(X+160, Y+100, $F); C:= C+1]; +until C >= 100; +C:= ChIn(1); \wait for keystroke +SetVid(3); \restore normal text mode +] diff --git a/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Mathematica/continued-fraction-arithmetic-construct-from-rational-number.mathematica b/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Mathematica/continued-fraction-arithmetic-construct-from-rational-number.math similarity index 100% rename from Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Mathematica/continued-fraction-arithmetic-construct-from-rational-number.mathematica rename to Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Mathematica/continued-fraction-arithmetic-construct-from-rational-number.math diff --git a/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Perl-6/continued-fraction-arithmetic-construct-from-rational-number-1.pl6 b/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Perl-6/continued-fraction-arithmetic-construct-from-rational-number-1.pl6 new file mode 100644 index 0000000000..b10889dda4 --- /dev/null +++ b/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Perl-6/continued-fraction-arithmetic-construct-from-rational-number-1.pl6 @@ -0,0 +1,9 @@ +sub r2cf(Rat $x is copy) { + gather loop { + $x -= take $x.floor; + last unless $x > 0; + $x = 1 / $x; + } +} + +say r2cf(.Rat) for <1/2 3 23/8 13/11 22/7 1.41 1.4142136>; diff --git a/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Perl-6/continued-fraction-arithmetic-construct-from-rational-number-2.pl6 b/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Perl-6/continued-fraction-arithmetic-construct-from-rational-number-2.pl6 new file mode 100644 index 0000000000..58fd7820c5 --- /dev/null +++ b/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Perl-6/continued-fraction-arithmetic-construct-from-rational-number-2.pl6 @@ -0,0 +1 @@ +sub r2cf(Rat $x is copy) { gather $x [R/]= 1 while ($x -= take $x.floor) > 0 } diff --git a/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/XPL0/continued-fraction-arithmetic-construct-from-rational-number.xpl0 b/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/XPL0/continued-fraction-arithmetic-construct-from-rational-number.xpl0 new file mode 100644 index 0000000000..ebd11112a6 --- /dev/null +++ b/Task/Continued-fraction-Arithmetic-Construct-from-rational-number/XPL0/continued-fraction-arithmetic-construct-from-rational-number.xpl0 @@ -0,0 +1,25 @@ +include c:\cxpl\codes; +real Val; + +proc R2CF(N1, N2, Lev); \Output continued fraction for N1/N2 +int N1, N2, Lev; +int Quot, Rem; +[if Lev=0 then Val:= 0.0; +Quot:= N1/N2; +Rem:= rem(0); +IntOut(0, Quot); +if Rem then [ChOut(0, if Lev then ^, else ^;); R2CF(N2, Rem, Lev+1)]; +Val:= Val + float(Quot); \generate value from continued fraction +if Lev then Val:= 1.0/Val; +]; + +int I, Data; +[Data:= [1,2, 3,1, 23,8, 13,11, 22,7, 0]; +Format(0, 15); +I:= 0; +while Data(I) do + [IntOut(0, Data(I)); ChOut(0, ^/); IntOut(0, Data(I+1)); ChOut(0, 9\tab\); + ChOut(0, ^[); R2CF(Data(I), Data(I+1), 0); ChOut(0, ^]); ChOut(0, 9\tab\); + RlOut(0, Val); CrLf(0); + I:= I+2]; +] diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/0DESCRIPTION b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/0DESCRIPTION deleted file mode 100644 index b340488f7a..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/0DESCRIPTION +++ /dev/null @@ -1,41 +0,0 @@ -This task investigates mathmatical operations that can be performed on a single continued fraction. This requires only a baby version of NG: -: \begin{bmatrix} - a_1 & a \\ - b_1 & b -\end{bmatrix} -I may perform perform the following operations: -:Input the next term of N1 -:Output a term of the continued fraction resulting from the operation. - -I output a term if the integer parts of \frac{a}{b} and \frac{a_1}{b_1} are equal. Otherwise I input a term from N. If I need a term from N but N has no more terms I inject \infty. - -When I input a term t my internal state: \begin{bmatrix} - a_1 & a \\ - b_1 & b -\end{bmatrix} is transposed thus \begin{bmatrix} a + a_1 * t & a_1 \\ - b + b_1 * t & b_1 -\end{bmatrix} - -When I output a term t my internal state: \begin{bmatrix} - a_1 & a \\ - b_1 & b -\end{bmatrix} is transposed thus \begin{bmatrix} b_1 & b \\ - a_1 - b_1 * t & a - b * t -\end{bmatrix} - -When I need a term t but there are no more my internal state: \begin{bmatrix} - a_1 & a \\ - b_1 & b -\end{bmatrix} is transposed thus \begin{bmatrix} a_1 & a_1 \\ - b_1 & b_1 -\end{bmatrix} - -I am done when b1 and b are zero. - -Demonstrate your solution by calculating: -:[1;5,2] + 1/2 -:[3;7] + 1/2 -:[3;7] divided by 4 -Using a generator for \sqrt{2} (e.g., from [[Continued fraction]]) calculate \frac{1}{\sqrt{2}}. You are now at the starting line for using Continued Fractions to implement [[Arithmetic-geometric mean]] without ulps and epsilons. - -The first step in implementing [[Arithmetic-geometric mean]] is to calculate \frac{1 + \frac{1}{\sqrt{2}}}{2} do this now to cross the starting line and begin the race. diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.cpp deleted file mode 100644 index 959b0d4a00..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* Interface for all matrixNG classes - Nigel Galloway, February 10th., 2013. -*/ -class matrixNG { - private: - virtual void consumeTerm(){} - virtual void consumeTerm(int n){} - virtual const bool needTerm(){} - protected: int cfn = 0, thisTerm; - bool haveTerm = false; - friend class NG; -}; -/* Implement the babyNG matrix - Nigel Galloway, February 10th., 2013. -*/ -class NG_4 : public matrixNG { - private: int a1, a, b1, b, t; - const bool needTerm() { - if (b1==0 and b==0) return false; - if (b1==0 or b==0) return true; else thisTerm = a/b; - if (thisTerm==(int)(a1/b1)){ - t=a; a=b; b=t-b*thisTerm; t=a1; a1=b1; b1=t-b1*thisTerm; - haveTerm=true; return false; - } - return true; - } - void consumeTerm(){a=a1; b=b1;} - void consumeTerm(int n){t=a; a=a1; a1=t+a1*n; t=b; b=b1; b1=t+b1*n;} - public: - NG_4(int a1, int a, int b1, int b): a1(a1), a(a), b1(b1), b(b){} -}; -/* Implement a Continued Fraction which returns the result of an arithmetic operation on - 1 or more Continued Fractions (Currently 1 or 2). - Nigel Galloway, February 10th., 2013. -*/ -class NG : public ContinuedFraction { - private: - matrixNG* ng; - ContinuedFraction* n[2]; - public: - NG(NG_4* ng, ContinuedFraction* n1): ng(ng){n[0] = n1;} - NG(NG_8* ng, ContinuedFraction* n1, ContinuedFraction* n2): ng(ng){n[0] = n1; n[1] = n2;} - const int nextTerm() {ng->haveTerm = false; return ng->thisTerm;} - const bool moreTerms(){ - while(ng->needTerm()) if(n[ng->cfn]->moreTerms()) ng->consumeTerm(n[ng->cfn]->nextTerm()); else ng->consumeTerm(); - return ng->haveTerm; - } -}; diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.cpp deleted file mode 100644 index 92efe9aad1..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int main() { - NG_4 a1(2,1,0,2); - r2cf n1(13,11); - for(NG n(&a1, &n1); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-3.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-3.cpp deleted file mode 100644 index a61cbb03ee..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-3.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int main() { - NG_4 a2(7,0,0,22); - r2cf n2(22,7); - for(NG n(&a2, &n2); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-4.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-4.cpp deleted file mode 100644 index 7fdd5c4895..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-4.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int main() { - NG_4 a3(2,1,0,2); - r2cf n3(22,7); - for(NG n(&a3, &n3); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-5.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-5.cpp deleted file mode 100644 index 2bbf9f7773..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-5.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int main() { - NG_4 a4(1,0,0,4); - r2cf n4(22,7); - for(NG n(&a4, &n4); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-6.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-6.cpp deleted file mode 100644 index 5db15ac3c3..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-6.cpp +++ /dev/null @@ -1,10 +0,0 @@ -int main() { - NG_4 a5(0,1,1,0); - SQRT2 n5; - int i = 0; - for(NG n(&a5, &n5); n.moreTerms() and i++ < 20; std::cout << n.nextTerm() << " "); - std::cout << "..." << std::endl; - for(r2cf cf(10000000, 14142136); cf.moreTerms(); std::cout << cf.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-7.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-7.cpp deleted file mode 100644 index 142d7f771d..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-7.cpp +++ /dev/null @@ -1,10 +0,0 @@ -int main() { - int i = 0; - NG_4 a6(1,1,0,2); - SQRT2 n6; - for(NG n(&a6, &n6); n.moreTerms() and i++ < 20; std::cout << n.nextTerm() << " "); - std::cout << "..." << std::endl; - for(r2cf cf(24142136, 20000000); cf.moreTerms(); std::cout << cf.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.rb b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.rb deleted file mode 100644 index eb2389dc7c..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.rb +++ /dev/null @@ -1,29 +0,0 @@ -=begin - I define a class to implement baby NG - Nigel Galloway February 6th., 2013 -=end -class NG - def initialize(a1, a, b1, b) - @a1 = a1; @a = a; @b1 = b1; @b = b; - end - def ingress(n) - t=@a; @a=@a1; @a1=t + @a1 * n; t=@b; @b=@b1; @b1=t + @b1 * n; - end - def needterm? - return true if @b1 == 0 or @b == 0 - return true unless @a/@b == @a1/@b1 - return false - end - def egress - n = @a/@b - t=@a; @a=@b; @b=t - @b * n; t=@a1; @a1=@b1; @b1=t - @b1 * n; - return n - end - def egress_done - if needterm? then @a=@a1; @b=@b1 end - return egress - end - def done? - if @b1 == 0 and @b == 0 then return true else return false end - end -end diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.rb b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.rb deleted file mode 100644 index 6c93599a81..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.rb +++ /dev/null @@ -1,3 +0,0 @@ -op = NG.new(2,1,0,2) -r2cf(13,11) {|n| if op.needterm? then op.ingress(n) else print "#{op.egress} "; op.ingress(n) end} -while not op.done? do print "#{op.egress_done} " end diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-3.rb b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-3.rb deleted file mode 100644 index 24ac7eb6c5..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-3.rb +++ /dev/null @@ -1,3 +0,0 @@ -op = NG.new(2,1,0,2) -r2cf(22,7) {|n| if op.needterm? then op.ingress(n) else print "#{op.egress} "; op.ingress(n) end} -while not op.done? do print "#{op.egress_done} " end diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-4.rb b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-4.rb deleted file mode 100644 index c6556761ea..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Ruby/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-4.rb +++ /dev/null @@ -1,3 +0,0 @@ -op = NG.new(1,0,0,4) -r2cf(22,7) {|n| if op.needterm? then op.ingress(n) else print "#{op.egress} "; op.ingress(n) end} -while not op.done? do print "#{op.egress_done} " end diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.tcl b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.tcl deleted file mode 100644 index 472d3b0ded..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-1.tcl +++ /dev/null @@ -1,50 +0,0 @@ -# The single-operand version of the NG operator, using our little generator framework -oo::class create NG1 { - superclass Generator - - variable a1 a b1 b cf - constructor args { - next - lassign $args a1 a b1 b - } - method Ingress n { - lassign [list [expr {$a + $a1*$n}] $a1 [expr {$b + $b1*$n}] $b1] \ - a1 a b1 b - } - method NeedTerm? {} { - expr {$b1 == 0 || $b == 0 || $a/$b != $a1/$b1} - } - method Egress {} { - set n [expr {$a/$b}] - lassign [list $b1 $b [expr {$a1 - $b1*$n}] [expr {$a - $b*$n}]] \ - a1 a b1 b - return $n - } - method EgressDone {} { - if {[my NeedTerm?]} { - set a $a1 - set b $b1 - } - tailcall my Egress - } - method Done? {} { - expr {$b1 == 0 && $b == 0} - } - - method operand {N} { - set cf $N - return [self] - } - method Produce {} { - while 1 { - set n [$cf] - if {![my NeedTerm?]} { - yield [my Egress] - } - my Ingress $n - } - while {![my Done?]} { - yield [my EgressDone] - } - } -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.tcl b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.tcl deleted file mode 100644 index 966e9d0ec7..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n)-2.tcl +++ /dev/null @@ -1,29 +0,0 @@ -# The square root of 2 as a continued fraction in the framework -oo::class create Root2 { - superclass Generator - method apply {} { - yield 1 - while {[self] ne ""} { - yield 2 - } - } -} - -set op [[NG1 new 2 1 0 2] operand [R2CF new 13/11]] -printcf "\[1;5,2\] + 1/2" $op - -set op [[NG1 new 7 0 0 22] operand [R2CF new 22/7]] -printcf "\[3;7\] * 7/22" $op - -set op [[NG1 new 2 1 0 2] operand [R2CF new 22/7]] -printcf "\[3;7\] + 1/2" $op - -set op [[NG1 new 1 0 0 4] operand [R2CF new 22/7]] -printcf "\[3;7\] / 4" $op - -set op [[NG1 new 0 1 1 0] operand [Root2 new]] -printcf "1/\u221a2" $op 20 - -set op [[NG1 new 1 1 0 2] operand [Root2 new]] -printcf "(1+\u221a2)/2" $op 20 -printcf "approx val" [R2CF new 24142136 20000000] diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/0DESCRIPTION b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/0DESCRIPTION deleted file mode 100644 index 6901180101..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/0DESCRIPTION +++ /dev/null @@ -1,59 +0,0 @@ -This task performs the basic mathematical functions on 2 continued fractions. This requires the full version of matrix NG: -: \begin{bmatrix} - a_{12} & a_1 & a_2 & a \\ - b_{12} & b_1 & b_2 & b -\end{bmatrix} -I may perform perform the following operations: -:Input the next term of continued fraction N1 -:Input the next term of continued fraction N2 -:Output a term of the continued fraction resulting from the operation. - -I output a term if the integer parts of \frac{a}{b} and \frac{a_1}{b_1} and \frac{a_2}{b_2} and \frac{a_{12}}{b_{12}} are equal. Otherwise I input a term from continued fraction N1 or continued fraction N2. If I need a term from N but N has no more terms I inject \infty. - -When I input a term t from continued fraction N1 I change my internal state: -: \begin{bmatrix} - a_{12} & a_1 & a_2 & a \\ - b_{12} & b_1 & b_2 & b \end{bmatrix} is transposed thus \begin{bmatrix} a_2+a_{12}*t & a+a_1*t & a_{12} & a_1 \\ - b_2+b_{12}*t & b+b_1*t & b_{12} & b_1 -\end{bmatrix} - -When I need a term from exhausted continued fraction N1 I change my internal state: -: \begin{bmatrix} - a_{12} & a_1 & a_2 & a \\ - b_{12} & b_1 & b_2 & b \end{bmatrix} is transposed thus \begin{bmatrix} - a_{12} & a_1 & a_{12} & a_1 \\ - b_{12} & b_1 & b_{12} & b_1 -\end{bmatrix} - -When I input a term t from continued fraction N2 I change my internal state: -: \begin{bmatrix} - a_{12} & a_1 & a_2 & a \\ - b_{12} & b_1 & b_2 & b \end{bmatrix} is transposed thus \begin{bmatrix} - a_1+a_{12}*t & a_{12} & a+a_2*t & a_2 \\ - b_1+b_{12}*t & b_{12} & b+b_2*t & b_2 -\end{bmatrix} - -When I need a term from exhausted continued fraction N2 I change my internal state: -: \begin{bmatrix} - a_{12} & a_1 & a_2 & a \\ - b_{12} & b_1 & b_2 & b \end{bmatrix} is transposed thus \begin{bmatrix} - a_{12} & a_{12} & a_2 & a_2 \\ - b_{12} & b_{12} & b_2 & b_2 -\end{bmatrix} - -When I output a term t I change my internal state: -: \begin{bmatrix} - a_{12} & a_1 & a_2 & a \\ - b_{12} & b_1 & b_2 & b \end{bmatrix} is transposed thus \begin{bmatrix} - b_{12} & b_1 & b_2 & b \\ - a_{12}-b_{12}*t & a_1-b_1*t & a_2-b_2*t & a-b*t -\end{bmatrix} - -When I need to choose to input from N1 or N2 I act: -: if b and b2 are zero I choose N1 -: if b is zero I choose N2 -: if b2 is zero I choose N2 -: if abs(\frac{a_1}{b_1}-\frac{a}{b}) is greater than abs(\frac{a_2}{b_2}-\frac{a}{b}) I choose N1 -: otherwise I choose N2 - -When performing arithmetic operation on two potentially infinite continued fractions it is possible to generate a rational number. eg \sqrt{2} * \sqrt{2} should produce 2. This will require either that I determine that my internal state is approaching infinity, or limiting the number of terms I am willing to input without producing any output. diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/1META.yaml b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/1META.yaml deleted file mode 100644 index 1e81690bbc..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/1META.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -note: Matrices diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-1.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-1.cpp deleted file mode 100644 index af0c45b771..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-1.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* Implement matrix NG - Nigel Galloway, February 12., 2013 -*/ -class NG_8 : public matrixNG { - private: int a12, a1, a2, a, b12, b1, b2, b, t; - double ab, a1b1, a2b2, a12b12; - const int chooseCFN(){return fabs(a1b1-ab) > fabs(a2b2-ab)? 0 : 1;} - const bool needTerm() { - if (b1==0 and b==0 and b2==0 and b12==0) return false; - if (b==0){cfn = b2==0? 0:1; return true;} else ab = ((double)a)/b; - if (b2==0){cfn = 1; return true;} else a2b2 = ((double)a2)/b2; - if (b1==0){cfn = 0; return true;} else a1b1 = ((double)a1)/b1; - if (b12==0){cfn = chooseCFN(); return true;} else a12b12 = ((double)a12)/b12; - thisTerm = (int)ab; - if (thisTerm==(int)a1b1 and thisTerm==(int)a2b2 and thisTerm==(int)a12b12){ - t=a; a=b; b=t-b*thisTerm; t=a1; a1=b1; b1=t-b1*thisTerm; t=a2; a2=b2; b2=t-b2*thisTerm; t=a12; a12=b12; b12=t-b12*thisTerm; - haveTerm = true; return false; - } - cfn = chooseCFN(); - return true; - } - void consumeTerm(){if(cfn==0){a=a1; a2=a12; b=b1; b2=b12;} else{a=a2; a1=a12; b=b2; b1=b12;}} - void consumeTerm(int n){ - if(cfn==0){t=a; a=a1; a1=t+a1*n; t=a2; a2=a12; a12=t+a12*n; t=b; b=b1; b1=t+b1*n; t=b2; b2=b12; b12=t+b12*n;} - else{t=a; a=a2; a2=t+a2*n; t=a1; a1=a12; a12=t+a12*n; t=b; b=b2; b2=t+b2*n; t=b1; b1=b12; b12=t+b12*n;} - } - public: - NG_8(int a12, int a1, int a2, int a, int b12, int b1, int b2, int b): a12(a12), a1(a1), a2(a2), a(a), b12(b12), b1(b1), b2(b2), b(b){ -}}; diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-2.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-2.cpp deleted file mode 100644 index 81a4368335..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-2.cpp +++ /dev/null @@ -1,13 +0,0 @@ -int main() { - NG_8 a(0,1,1,0,0,0,0,1); - r2cf n2(22,7); - r2cf n1(1,2); - for(NG n(&a, &n1, &n2); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - - NG_4 a3(2,1,0,2); - r2cf n3(22,7); - for(NG n(&a3, &n3); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-3.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-3.cpp deleted file mode 100644 index d5415ded47..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-3.cpp +++ /dev/null @@ -1,12 +0,0 @@ -int main() { - NG_8 b(1,0,0,0,0,0,0,1); - r2cf b1(13,11); - r2cf b2(22,7); - for(NG n(&b, &b1, &b2); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - for(NG n(&a, &b2, &b1); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - for(r2cf cf(286,77); cf.moreTerms(); std::cout << cf.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-4.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-4.cpp deleted file mode 100644 index a17b50ed3f..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-4.cpp +++ /dev/null @@ -1,10 +0,0 @@ -int main() { - NG_8 c(0,1,-1,0,0,0,0,1); - r2cf c1(13,11); - r2cf c2(22,7); - for(NG n(&c, &c1, &c2); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - for(r2cf cf(-151,77); cf.moreTerms(); std::cout << cf.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-5.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-5.cpp deleted file mode 100644 index 88f73675f3..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-5.cpp +++ /dev/null @@ -1,8 +0,0 @@ -int main() { - NG_8 d(0,1,0,0,0,0,1,0); - r2cf d1(22*22,7*7); - r2cf d2(22,7); - for(NG n(&d, &d1, &d2); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-6.cpp b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-6.cpp deleted file mode 100644 index 53cc109416..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/C++/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-6.cpp +++ /dev/null @@ -1,20 +0,0 @@ -int main() { - r2cf a1(2,7); - r2cf a2(13,11); - NG_8 na(0,1,1,0,0,0,0,1); - NG A(&na, &a1, &a2); //[0;3,2] + [1;5,2] - r2cf b1(2,7); - r2cf b2(13,11); - NG_8 nb(0,1,-1,0,0,0,0,1); - NG B(&nb, &b1, &b2); //[0;3,2] - [1;5,2] - NG_8 nc(1,0,0,0,0,0,0,1); //A*B - for(NG n(&nc, &A, &B); n.moreTerms(); std::cout << n.nextTerm() << " "); - std::cout << std::endl; - for(r2cf cf(2,7); cf.moreTerms(); std::cout << cf.nextTerm() << " "); - std::cout << std::endl; - for(r2cf cf(13,11); cf.moreTerms(); std::cout << cf.nextTerm() << " "); - std::cout << std::endl; - for(r2cf cf(-7797,5929); cf.moreTerms(); std::cout << cf.nextTerm() << " "); - std::cout << std::endl; - return 0; -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-1.tcl b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-1.tcl deleted file mode 100644 index cb40e68678..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-1.tcl +++ /dev/null @@ -1,101 +0,0 @@ -oo::class create NG2 { - variable a b a1 b1 a2 b2 a12 b12 cf1 cf2 - superclass Generator - constructor {args} { - lassign $args a12 a1 a2 a b12 b1 b2 b - next - } - method operands {N1 N2} { - set cf1 $N1 - set cf2 $N2 - return [self] - } - - method Ingress1 t { - lassign [list [expr {$a2+$a12*$t}] [expr {$a+$a1*$t}] $a12 $a1 \ - [expr {$b2+$b12*$t}] [expr {$b+$b1*$t}] $b12 $b1] \ - a12 a1 a2 a b12 b1 b2 b - } - method Exhaust1 {} { - lassign [list $a12 $a1 $a12 $a1 $b12 $b1 $b12 $b1] \ - a12 a1 a2 a b12 b1 b2 b - } - method Ingress2 t { - lassign [list [expr {$a1+$a12*$t}] $a12 [expr {$a+$a2*$t}] $a2 \ - [expr {$b1+$b12*$t}] $b12 [expr {$b+$b2*$t}] $b2] \ - a12 a1 a2 a b12 b1 b2 b - } - method Exhaust2 {} { - lassign [list $a12 $a12 $a2 $a2 $b12 $b12 $b2 $b2] \ - a12 a1 a2 a b12 b1 b2 b - } - method Egress {} { - set t [expr {$a/$b}] - lassign [list $b12 $b1 $b2 $b \ - [expr {$a12 - $b12*$t}] [expr {$a1 - $b1*$t}] \ - [expr {$a2 - $b2*$t}] [expr {$a - $b*$t}]] \ - a12 a1 a2 a b12 b1 b2 b - return $t - } - - method DoIngress1 {} { - try {tailcall my Ingress1 [$cf1]} on break {} {} - oo::objdefine [self] forward DoIngress1 my Exhaust1 - set cf1 "" - tailcall my Exhaust1 - } - method DoIngress2 {} { - try {tailcall my Ingress2 [$cf2]} on break {} {} - oo::objdefine [self] forward DoIngress2 my Exhaust2 - set cf2 "" - tailcall my Exhaust2 - } - method Ingress {} { - if {$b==0} { - if {$b2 == 0} { - tailcall my DoIngress1 - } else { - tailcall my DoIngress2 - } - } - if {!$b2} { - tailcall my DoIngress2 - } - if {!$b1} { - tailcall my DoIngress1 - } - if {[my FirstSource?]} { - tailcall my DoIngress1 - } else { - tailcall my DoIngress2 - } - } - - method FirstSource? {} { - expr {abs($a1*$b*$b2 - $a*$b1*$b2) > abs($a2*$b*$b1 - $a*$b1*$b2)} - } - method NeedTerm? {} { - expr { - ($b*$b1*$b2*$b12==0) || - !($a/$b == $a1/$b1 && $a/$b == $a2/$b2 && $a/$b == $a12/$b12) - } - } - method Done? {} { - expr {$b==0 && $b1==0 && $b2==0 && $b12==0} - } - - method Produce {} { - # Until we've drained both continued fractions... - while {$cf1 ne "" || $cf2 ne ""} { - if {[my NeedTerm?]} { - my Ingress - } else { - yield [my Egress] - } - } - # Drain our internal state - while {![my Done?]} { - yield [my Egress] - } - } -} diff --git a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-2.tcl b/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-2.tcl deleted file mode 100644 index 1638d7b354..0000000000 --- a/Task/Continued-fraction-Arithmetic-G(matrix-NG,-Contined-Fraction-N1,-Contined-Fraction-N2)/Tcl/continued-fraction-arithmetic-g(matrix-ng,-contined-fraction-n1,-contined-fraction-n2)-2.tcl +++ /dev/null @@ -1,16 +0,0 @@ -set op [[NG2 new 0 1 1 0 0 0 0 1] operands [R2CF new 1/2] [R2CF new 22/7]] -printcf "\[3;7\] + \[0;2\]" $op - -set op [[NG2 new 1 0 0 0 0 0 0 1] operands [R2CF new 13/11] [R2CF new 22/7]] -printcf "\[1:5,2\] * \[3;7\]" $op - -set op [[NG2 new 0 1 -1 0 0 0 0 1] operands [R2CF new 13/11] [R2CF new 22/7]] -printcf "\[1:5,2\] - \[3;7\]" $op - -set op [[NG2 new 0 1 0 0 0 0 1 0] operands [R2CF new 484/49] [R2CF new 22/7]] -printcf "div test" $op - -set op1 [[NG2 new 0 1 1 0 0 0 0 1] operands [R2CF new 2/7] [R2CF new 13/11]] -set op2 [[NG2 new 0 1 -1 0 0 0 0 1] operands [R2CF new 2/7] [R2CF new 13/11]] -set op3 [[NG2 new 1 0 0 0 0 0 0 1] operands $op1 $op2] -printcf "layered test" $op3 diff --git a/Task/Continued-fraction/CoffeeScript/continued-fraction.coffee b/Task/Continued-fraction/CoffeeScript/continued-fraction.coffeescript similarity index 100% rename from Task/Continued-fraction/CoffeeScript/continued-fraction.coffee rename to Task/Continued-fraction/CoffeeScript/continued-fraction.coffeescript diff --git a/Task/Continued-fraction/Mathematica/continued-fraction.mathematica b/Task/Continued-fraction/Mathematica/continued-fraction.math similarity index 100% rename from Task/Continued-fraction/Mathematica/continued-fraction.mathematica rename to Task/Continued-fraction/Mathematica/continued-fraction.math diff --git a/Task/Continued-fraction/NetRexx/continued-fraction.netrexx b/Task/Continued-fraction/NetRexx/continued-fraction.netrexx new file mode 100644 index 0000000000..8d25c4fc32 --- /dev/null +++ b/Task/Continued-fraction/NetRexx/continued-fraction.netrexx @@ -0,0 +1,53 @@ +/* REXX *************************************************************** +* Derived from REXX ... Derived from PL/I with a little "massage" +* SQRT2= 1.41421356237309505 <- PL/I Result +* 1.41421356237309504880168872421 <- NetRexx Result 30 digits +* NAPIER= 2.71828182845904524 +* 2.71828182845904523536028747135 +* PI= 3.14159262280484695 +* 3.14159262280484694855146925223 +* 07.09.2012 Walter Pachl +* 08.09.2012 Walter Pachl simplified (with the help of a friend) +**********************************************************************/ +options replace format comments java crossref savelog symbols + class CFB public + +properties static + Numeric Digits 30 + Sqrt2 =1 + napier=2 + pi =3 + a =0 + b =0 + +method main(args = String[]) public static + Say 'SQRT2='.left(7) calc(sqrt2, 200) + Say 'NAPIER='.left(7) calc(napier, 200) + Say 'PI='.left(7) calc(pi, 200) + Return + +method get_Coeffs(form,n) public static + select + when form=Sqrt2 Then do + if n > 0 then a = 2; else a = 1 + b = 1 + end + when form=Napier Then do + if n > 0 then a = n; else a = 2 + if n > 1 then b = n - 1; else b = 1 + end + when form=pi Then do + if n > 0 then a = 6; else a = 3 + b = (2*n - 1)**2 + end + end + Return + +method calc(form,n) public static + temp=0 + loop ni = n to 1 by -1 + Get_Coeffs(form,ni) + temp = b/(a + temp) + end + Get_Coeffs(form,0) + return (a + temp) diff --git a/Task/Continued-fraction/OCaml/continued-fraction.ocaml b/Task/Continued-fraction/OCaml/continued-fraction.ocaml new file mode 100644 index 0000000000..5c981ad919 --- /dev/null +++ b/Task/Continued-fraction/OCaml/continued-fraction.ocaml @@ -0,0 +1,14 @@ +let pi = 3, fun n -> ((2*n-1)*(2*n-1), 6) +and nap = 2, fun n -> (max 1 (n-1), n) +and root2 = 1, fun n -> (1, 2) in + +let eval (i,f) k = + let rec frac n = + let a, b = f n in + float a /. (float b +. + if n >= k then 0.0 else frac (n+1)) in + float i +. frac 1 in + +Printf.printf "sqrt(2)\t= %.15f\n" (eval root2 1000); +Printf.printf "e\t= %.15f\n" (eval nap 1000); +Printf.printf "pi\t= %.15f\n" (eval pi 1000); diff --git a/Task/Continued-fraction/PARI-GP/continued-fraction.pari b/Task/Continued-fraction/PARI-GP/continued-fraction.pari new file mode 100644 index 0000000000..126b20380b --- /dev/null +++ b/Task/Continued-fraction/PARI-GP/continued-fraction.pari @@ -0,0 +1,2 @@ +back(v)=my(t=contfracpnqn(v));t[1,1]/t[2,1]*1. +back(vector(100,i,2-(i==1))) diff --git a/Task/Continued-fraction/PL-I/continued-fraction-1.pli b/Task/Continued-fraction/PL-I/continued-fraction-1.pli new file mode 100644 index 0000000000..9bdcbded52 --- /dev/null +++ b/Task/Continued-fraction/PL-I/continued-fraction-1.pli @@ -0,0 +1,14 @@ +/* Version for SQRT(2) */ +test: proc options (main); + declare n fixed; + +denom: procedure (n) recursive returns (float (18)); + declare n fixed; + n = n + 1; + if n > 100 then return (2); + return (2 + 1/denom(n)); +end denom; + + put (1 + 1/denom(2)); + +end test; diff --git a/Task/Continued-fraction/PL-I/continued-fraction-2.pli b/Task/Continued-fraction/PL-I/continued-fraction-2.pli new file mode 100644 index 0000000000..55abbf22b7 --- /dev/null +++ b/Task/Continued-fraction/PL-I/continued-fraction-2.pli @@ -0,0 +1,13 @@ +test: proc options (main); + declare n fixed; + +denom: procedure (n) recursive returns (float (18)); + declare n fixed; + n = n + 1; + if n > 100 then return (n); + return (n + n/denom(n)); +end denom; + + put (2 + 1/denom(0)); + +end test; diff --git a/Task/Continued-fraction/PL-I/continued-fraction-3.pli b/Task/Continued-fraction/PL-I/continued-fraction-3.pli new file mode 100644 index 0000000000..b906b9a5c0 --- /dev/null +++ b/Task/Continued-fraction/PL-I/continued-fraction-3.pli @@ -0,0 +1,44 @@ +/* Derived from continued fraction in Wiki Ada program */ + +continued_fractions: /* 6 Sept. 2012 */ + procedure options (main); + declare (Sqrt2 initial (1), napier initial (2), pi initial (3)) fixed (1); + +Get_Coeffs: procedure (form, n, coefA, coefB); + declare form fixed (1), n fixed, (coefA, coefB) float (18); + + select (form); + when (Sqrt2) do; + if n > 0 then coefA = 2; else coefA = 1; + coefB = 1; + end; + when (Napier) do; + if n > 0 then coefA = n; else coefA = 2; + if n > 1 then coefB = n - 1; else coefB = 1; + end; + when (Pi) do; + if n > 0 then coefA = 6; else coefA = 3; + coefB = (2*n - 1)**2; + end; + end; + end Get_Coeffs; + + Calc: procedure (form, n) returns (float (18)); + declare form fixed (1), n fixed; + declare (A, B) float (18); + declare Temp float (18) initial (0); + declare ni fixed; + + do ni = n to 1 by -1; + call Get_Coeffs (form, ni, A, B); + Temp = B/(A + Temp); + end; + call Get_Coeffs (form, 0, A, B); + return (A + Temp); + end Calc; + + put edit ('SQRT2=', calc(sqrt2, 200)) (a(10), f(20,17)); + put skip edit ('NAPIER=', calc(napier, 200)) (a(10), f(20,17)); + put skip edit ('PI=', calc(pi, 99999)) (a(10), f(20,17)); + +end continued_fractions; diff --git a/Task/Continued-fraction/Perl-6/continued-fraction-1.pl6 b/Task/Continued-fraction/Perl-6/continued-fraction-1.pl6 new file mode 100644 index 0000000000..7a4a66afe9 --- /dev/null +++ b/Task/Continued-fraction/Perl-6/continued-fraction-1.pl6 @@ -0,0 +1,10 @@ +sub continued-fraction(:@a, :@b, Int :$n = 100) +{ + my $x = @a[$n - 1]; + $x = @a[$_ - 1] + @b[$_] / $x for reverse 1 ..^ $n; + $x; +} + +printf "√2 ≈ %.9f\n", continued-fraction(:a(1, 2 xx *), :b(*, 1 xx *)); +printf "e ≈ %.9f\n", continued-fraction(:a(2, 1 .. *), :b(*, 1, 1 .. *)); +printf "π ≈ %.9f\n", continued-fraction(:a(3, 6 xx *), :b(*, [\+] 1, (8, 16 ... *)), :n(1000)); diff --git a/Task/Continued-fraction/Perl-6/continued-fraction-2.pl6 b/Task/Continued-fraction/Perl-6/continued-fraction-2.pl6 new file mode 100644 index 0000000000..a50be7943b --- /dev/null +++ b/Task/Continued-fraction/Perl-6/continued-fraction-2.pl6 @@ -0,0 +1,8 @@ +sub infix:<⚬>(&f, &g) { -> $x { &f(&g($x)) } } +sub continued-fraction(@a, @b) { + [\⚬] map { @a[$_] + @b[$_] / * }, 0 .. * +} + +printf "√2 ≈ %.9f\n", continued-fraction((1, 2 xx *), (1 xx *))[10](Inf); +printf "e ≈ %.9f\n", continued-fraction((2, 1 .. *), (1, 1 .. *))[10](Inf); +printf "π ≈ %.9f\n", continued-fraction((3, 6 xx *), ((1, 3, 5 ... *) X** 2))[1000](Inf); diff --git a/Task/Continued-fraction/XPL0/continued-fraction.xpl0 b/Task/Continued-fraction/XPL0/continued-fraction.xpl0 new file mode 100644 index 0000000000..d3d4356441 --- /dev/null +++ b/Task/Continued-fraction/XPL0/continued-fraction.xpl0 @@ -0,0 +1,25 @@ +include c:\cxpl\codes; +int N; +real A, B, F; +[Format(1, 15); +A:= 2.0; B:= 1.0; N:= 16; +IntOut(0, N); CrLf(0); +F:= 0.0; +while N>=1 do [F:= B/(A+F); N:= N-1]; +RlOut(0, 1.0+F); CrLf(0); +RlOut(0, sqrt(2.0)); CrLf(0); + +N:= 13; +IntOut(0, N); CrLf(0); +F:= 0.0; +while N>=2 do [F:= float(N-1)/(float(N)+F); N:= N-1]; +RlOut(0, 2.0 + 1.0/(1.0+F)); CrLf(0); +RlOut(0, Exp(1.0)); CrLf(0); + +N:= 10000; +IntOut(0, N); CrLf(0); +F:= 0.0; +while N>=1 do [F:= float(sq(2*N-1))/(6.0+F); N:= N-1]; +RlOut(0, 3.0+F); CrLf(0); +RlOut(0, ACos(-1.0)); CrLf(0); +] diff --git a/Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-1.mathematica b/Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-1.math similarity index 100% rename from Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-1.mathematica rename to Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-1.math diff --git a/Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-2.mathematica b/Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-2.math similarity index 100% rename from Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-2.mathematica rename to Task/Conways-Game-of-Life/Mathematica/conways-game-of-life-2.math diff --git a/Task/Conways-Game-of-Life/OCaml/conways-game-of-life-1.ocaml b/Task/Conways-Game-of-Life/OCaml/conways-game-of-life-1.ocaml new file mode 100644 index 0000000000..f5ea20d5cd --- /dev/null +++ b/Task/Conways-Game-of-Life/OCaml/conways-game-of-life-1.ocaml @@ -0,0 +1,47 @@ +let get g x y = + try g.(x).(y) + with _ -> 0 + +let neighbourhood g x y = + (get g (x-1) (y-1)) + + (get g (x-1) (y )) + + (get g (x-1) (y+1)) + + (get g (x ) (y-1)) + + (get g (x ) (y+1)) + + (get g (x+1) (y-1)) + + (get g (x+1) (y )) + + (get g (x+1) (y+1)) + +let next_cell g x y = + let n = neighbourhood g x y in + match g.(x).(y), n with + | 1, 0 | 1, 1 -> 0 (* lonely *) + | 1, 4 | 1, 5 | 1, 6 | 1, 7 | 1, 8 -> 0 (* overcrowded *) + | 1, 2 | 1, 3 -> 1 (* lives *) + | 0, 3 -> 1 (* get birth *) + | _ (* 0, (0|1|2|4|5|6|7|8) *) -> 0 (* barren *) + +let copy g = Array.map Array.copy g + +let next g = + let width = Array.length g + and height = Array.length g.(0) + and new_g = copy g in + for x = 0 to pred width do + for y = 0 to pred height do + new_g.(x).(y) <- (next_cell g x y) + done + done; + (new_g) + +let print g = + let width = Array.length g + and height = Array.length g.(0) in + for x = 0 to pred width do + for y = 0 to pred height do + if g.(x).(y) = 0 + then print_char '.' + else print_char 'o' + done; + print_newline() + done diff --git a/Task/Conways-Game-of-Life/OCaml/conways-game-of-life-2.ocaml b/Task/Conways-Game-of-Life/OCaml/conways-game-of-life-2.ocaml new file mode 100644 index 0000000000..3330e6150d --- /dev/null +++ b/Task/Conways-Game-of-Life/OCaml/conways-game-of-life-2.ocaml @@ -0,0 +1,81 @@ +let alive = 0 +let dead = 0xFFFFFF + +let iteration ib ob m n = + let rule = function 3,_ | 2,true -> alive | _ -> dead in + let f x y = + if x >= 0 && x < m && y >= 0 && y < n && ib.(x).(y) = alive + then 1 else 0 in + let count b q = + let a, c, p, r = b-1, b+1, q-1, q+1 in + f a p + f a q + f a r + f b p + f b r + f c p + f c q + f c r in + for i = 0 to m-1 do + for j = 0 to n-1 do + ob.(i).(j) <- rule (count i j, ib.(i).(j) = alive) + done + done + +let make_random w h bd = + Random.self_init (); + for i = 0 to w-1 do + for j = 0 to h-1 do + bd.(i).(j) <- if Random.bool () then alive else dead + done + done + +let set_cells a b cells w h bd = + let w', h' = w/2 - a, h/2 - b in + List.iter (fun (i,j) -> bd.(i+w').(j+h') <- alive) cells + +let make_blinker = set_cells 1 1 [(1,0); (1,1); (1,2)] + +let make_acorn = + set_cells 1 3 [(0,1); (1,3); (2,0); (2,1); (2,4); (2,5); (2,6)] + +let make_growth = + set_cells 2 3 + [(0,6); (1,4); (1,6); (1,7); (2,4); (2,6); (3,4); (4,2); (5,0); (5,2)] + +let make_rabbits = + set_cells 1 3 + [(0,0); (0,4); (0,5); (0,6); (1,0); (1,1); (1,2); (1,5); (2,1)] + +let make_engine = + set_cells (-100) (-100) + [(0,1); (0,3); (1,0); (2,1); (2,4); (3,3); (3,4); (3,5); (4,26); (4,27); (5,26); (5,27)] + +let make_line w h bd = + let w', h', l = w/2, h/2, w/3 in + for i = -l to l do bd.(i+w').(h') <- alive done + +let () = + let argc = Array.length Sys.argv in + let init = + let default () = (print_endline "Using random start"; make_random) in + if argc < 2 then default () else + match Sys.argv.(1) with + | "acorn" -> make_acorn + | "blinker" -> make_blinker + | "growth" -> make_growth + | "engine" -> make_engine + | "line" -> make_line + | "rabbits" -> make_rabbits + | "random" -> make_random + | "-h" -> Printf.printf + "Usage: %s [acorn|growth|blinker|engine|line|rabbits|random] width height\n" Sys.argv.(0); + exit 0 + | _ -> default () in + let width = if argc > 2 then int_of_string Sys.argv.(2) else 300 in + let height = if argc > 3 then int_of_string Sys.argv.(3) else 300 in + let bd1 = Array.make_matrix width height dead in + let bd2 = Array.make_matrix width height dead in + let border = 5 in + let disp m = Graphics.draw_image (Graphics.make_image m) border border in + init width height bd1; + Graphics.open_graph (Printf.sprintf " %dx%d" (height+2*border) (width+2*border)); + while true do + disp bd1; + iteration bd1 bd2 width height; + disp bd2; + iteration bd2 bd1 width height + done diff --git a/Task/Conways-Game-of-Life/Oz/conways-game-of-life.oz b/Task/Conways-Game-of-Life/Oz/conways-game-of-life.oz new file mode 100644 index 0000000000..fbaa0c2221 --- /dev/null +++ b/Task/Conways-Game-of-Life/Oz/conways-game-of-life.oz @@ -0,0 +1,104 @@ +declare + Rules = [rule(c:1 n:[0 1] new:0) %% Lonely + rule(c:1 n:[4 5 6 7 8] new:0) %% Overcrowded + rule(c:1 n:[2 3] new:1) %% Lives + rule(c:0 n:[3] new:1) %% It takes three to give birth! + rule(c:0 n:[0 1 2 4 5 6 7 8] new:0) %% Barren + ] + + Blinker = ["..." + "###" + "..."] + + Toad = ["...." + ".###" + "###." + "...."] + + Glider = [".#.........." + "..#........." + "###........." + "............" + "............" + "............" + "............" + "............" + "............" + "............" + "............"] + + Init = Blinker + MaxGen = 2 + + %% G(i) -> G(i+1) + fun {Evolve Gi} + fun {Get X#Y} + Row = {CondSelect Gi Y unit} + in + {CondSelect Row X 0} %% cells beyond boundaries are dead (0) + end + fun {GetNeighbors X Y} + {Map [X-1#Y-1 X#Y-1 X+1#Y-1 + X-1#Y X+1#Y + X-1#Y+1 X#Y+1 X+1#Y+1] + Get} + end + in + {Record.mapInd Gi + fun {$ Y Row} + {Record.mapInd Row + fun {$ X C} + N = {Sum {GetNeighbors X Y}} + in + for Rule in Rules return:Return do + if C == Rule.c andthen {Member N Rule.n} then + {Return Rule.new} + end + end + end} + end} + end + + %% For example: [".#" + %% "#."] -> grid(1:row(1:0 2:1) 2:row(1:1 2:0)) + fun {ReadG LinesList} + {List.toTuple grid + {Map LinesList + fun {$ Line} + {List.toTuple row + {Map Line + fun {$ C} + if C == &. then 0 + elseif C == &# then 1 + end + end}} + end}} + end + + %% Inverse to ReadG + fun {ShowG G} + {Map {Record.toList G} + fun {$ Row} + {Map {Record.toList Row} + fun {$ C} + if C == 0 then &. + elseif C == 1 then &# + end + end} + end} + end + + %% Helpers + fun {Sum Xs} {FoldL Xs Number.'+' 0} end + fun lazy {Iterate F V} V|{Iterate F {F V}} end + + G0 = {ReadG Init} + Gn = {Iterate Evolve G0} +in + for + Gi in Gn + I in 0..MaxGen + do + {System.showInfo "\nGen. "#I} + {ForAll {ShowG Gi} System.showInfo} + end diff --git a/Task/Conways-Game-of-Life/PARI-GP/conways-game-of-life.pari b/Task/Conways-Game-of-Life/PARI-GP/conways-game-of-life.pari new file mode 100644 index 0000000000..bb80c2e833 --- /dev/null +++ b/Task/Conways-Game-of-Life/PARI-GP/conways-game-of-life.pari @@ -0,0 +1,10 @@ +step(M)={ + my(N=M,W=matsize(M)[1],L=#M,t); + for(l=1,W,for(w=1,L, + t=sum(i=l-1,l+1,sum(j=w-1,w+1,if(i<1||j<1||i>W||j>L,0,M[i,j]))); + N[l,w]=(t==3||(M[l,w]&&t==4)) + )); + N +}; +M=[0,1,0;0,1,0;0,1,0]; +for(i=1,3,print(M);M=step(M)) diff --git a/Task/Conways-Game-of-Life/Perl-6/conways-game-of-life-1.pl6 b/Task/Conways-Game-of-Life/Perl-6/conways-game-of-life-1.pl6 new file mode 100644 index 0000000000..cb3d1ce090 --- /dev/null +++ b/Task/Conways-Game-of-Life/Perl-6/conways-game-of-life-1.pl6 @@ -0,0 +1,47 @@ +class Grid { + has Int $.width; + has Int $.height; + has @!a; + + multi method new (@a) { + # Makes a new grid with @!a equal to @a. + Grid.bless(*, + width => @a[0].elems, height => @a.elems, + a => @a) + } + + multi method new (Str $s) { + # Interprets the string as a grid. + Grid.new(map + { [map { $^c eq '#' ?? True !! False }, split '', $^l] }, + grep /\N/, split "\n", $s) + } + + method clone { Grid.new(map { [$^x.clone] }, @!a) } + + method Str { + [~] map + { [~] map({ $^c ?? '#' !! '.' }, |$^row), "\n" }, + @!a + } + + method alive (Int $row, Int $col --> Bool) { + 0 <= $row < $.height and 0 <= $col < $.width + and @!a[$row][$col]; + } + + method nextgen { + my $prev = self.clone; + for ^$.height -> $row { + for ^$.width -> $col { + my $v = [+] + map({ $prev.alive($^r, $^c) }, + ($col - 1, $col, $col + 1 X + $row - 1, $row, $row + 1)), + -$prev.alive($row, $col); + @!a[$row][$col] = + $prev.alive($row, $col) && $v == 2 || $v == 3; + } + } + } +} diff --git a/Task/Conways-Game-of-Life/Perl-6/conways-game-of-life-2.pl6 b/Task/Conways-Game-of-Life/Perl-6/conways-game-of-life-2.pl6 new file mode 100644 index 0000000000..a6a8f86fb9 --- /dev/null +++ b/Task/Conways-Game-of-Life/Perl-6/conways-game-of-life-2.pl6 @@ -0,0 +1,14 @@ +my Grid $glider .= new ' +............ +............ +............ +.......###.. +.......#.... +........#... +............'; + +loop { + say $glider; + sleep 1; + $glider.nextgen; +} diff --git a/Task/Conways-Game-of-Life/PostScript/conways-game-of-life.ps b/Task/Conways-Game-of-Life/PostScript/conways-game-of-life.ps new file mode 100644 index 0000000000..48ea250d1c --- /dev/null +++ b/Task/Conways-Game-of-Life/PostScript/conways-game-of-life.ps @@ -0,0 +1,49 @@ +%!PS-Adobe-3.0 +%%BoundingBox: 0 0 400 400 + +/size 400 def + +realtime srand +/rand1 { rand 2147483647 div } def + +/m { moveto } bind def +/l { rlineto} bind def +/drawboard { + 0 1 n 1 sub { /y exch def + 0 1 n 1 sub { /x exch def + board x get y get 1 eq { + x c mul y c mul m + c 0 l 0 c l c neg 0 l + closepath fill + } if + } for } for +} def + +/r1n { dup 0 lt { n add } if dup n ge { n sub } if } def +/neighbors { /y exch def /x exch def 0 + y 1 sub 1 y 1 add { r1n /y1 exch def + x 1 sub 1 x 1 add { r1n /x1 exch def + board x1 get y1 get add + } for } for + board x get y get sub +} def + +/iter { + /board + [0 1 n 1 sub { /x exch def + [0 1 n 1 sub { /y exch def + x y neighbors + board x get y get + 0 eq { 3 eq {1}{0} ifelse } + { dup 2 eq exch 3 eq or {1}{0} ifelse } ifelse + } for ] + } for ] def +} def + +/n 200 def +/initprob .15 def +/c size n div def +/board [ n {[ n { rand1 initprob le {1}{0} ifelse } repeat]} repeat ] def + +1000 { drawboard showpage iter } repeat +%%EOF diff --git a/Task/Conways-Game-of-Life/PureBasic/conways-game-of-life.purebasic b/Task/Conways-Game-of-Life/PureBasic/conways-game-of-life.purebasic new file mode 100644 index 0000000000..3cbea8d8cb --- /dev/null +++ b/Task/Conways-Game-of-Life/PureBasic/conways-game-of-life.purebasic @@ -0,0 +1,56 @@ +EnableExplicit +Define.i x, y ,Xmax ,Ymax ,N +Xmax = 13 : Ymax = 20 +Dim world.i(Xmax+1,Ymax+1) +Dim Nextworld.i(Xmax+1,Ymax+1) + +; Glider test +;------------------------------------------ + world(1,1)=1 : world(1,2)=0 : world(1,3)=0 + world(2,1)=0 : world(2,2)=1 : world(2,3)=1 + world(3,1)=1 : world(3,2)=1 : world(3,3)=0 +;------------------------------------------ + +OpenConsole() +EnableGraphicalConsole(1) +ClearConsole() +Print("Press any key to interrupt") +Repeat + ConsoleLocate(0,2) + PrintN(LSet("", Xmax+2, "-")) + ;---------- endless world --------- + For y = 1 To Ymax + world(0,y)=world(Xmax,y) + world(Xmax+1,y)=world(1,y) + Next + For x = 1 To Xmax + world(x,0)=world(x,Ymax) + world(x,Ymax+1)=world(x,1) + Next + world(0 ,0 )=world(Xmax,Ymax) + world(Xmax+1,Ymax+1)=world(1 ,1 ) + world(Xmax+1,0 )=world(1 ,Ymax) + world( 0,Ymax+1)=world(Xmax,1 ) + ;---------- endless world --------- + For y = 1 To Ymax + Print("|") + For x = 1 To Xmax + Print(Chr(32+world(x,y)*3)) + N = world(x-1,y-1)+world(x-1,y)+world(x-1,y+1)+world(x,y-1) + N + world(x,y+1)+world(x+1,y-1)+world(x+1,y)+world(x+1,y+1) + If (world(x,y) And (N = 2 Or N = 3))Or (world(x,y)=0 And N = 3) + Nextworld(x,y)=1 + Else + Nextworld(x,y)=0 + EndIf + Next + PrintN("|") + Next + PrintN(LSet("", Xmax+2, "-")) + Delay(100) + ;Swap world() , Nextworld() ;PB <4.50 + CopyArray(Nextworld(), world());PB =>4.50 + Dim Nextworld.i(Xmax+1,Ymax+1) +Until Inkey() <> "" + +PrintN("Press any key to exit"): Repeat: Until Inkey() <> "" diff --git a/Task/Conways-Game-of-Life/Retro/conways-game-of-life.retro b/Task/Conways-Game-of-Life/Retro/conways-game-of-life.retro new file mode 100644 index 0000000000..deb5c2aec8 --- /dev/null +++ b/Task/Conways-Game-of-Life/Retro/conways-game-of-life.retro @@ -0,0 +1,78 @@ +create world + 20 20 * allot + +create next + 20 20 * allot + +create initial +( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ) +( 0 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 1 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , +( 2 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , +( 3 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , +( 4 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 5 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 6 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 7 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 8 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 9 ) 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 10 ) 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 11 ) 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 12 ) 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 13 ) 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 14 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , +( 15 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , +( 16 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , +( 17 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , +( 18 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , +( 19 ) 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , + +( Assumes anything outside the bounds is "dead" ) +{{ + variable surrounding + : get ( rc- ) + 2over [ 0 19 within ] bi@ and + [ world + [ 20 * ] dip + @ ] [ 2drop 0 ] if ; + : neighbor? ( rc- ) get +surrounding ; + : NW ( rc-rc ) 2over [ 1- ] bi@ neighbor? ; + : NN ( rc-rc ) 2over [ 1- ] dip neighbor? ; + : NE ( rc-rc ) 2over [ 1- ] dip 1+ neighbor? ; + : WW ( rc-rc ) 2over 1- neighbor? ; + : EE ( rc-rc ) 2over 1+ neighbor? ; + : SW ( rc-rc ) 2over [ 1+ ] dip 1- neighbor? ; + : SS ( rc-rc ) 2over [ 1+ ] dip neighbor? ; + : SE ( rc-rc ) 2over [ 1+ ] bi@ neighbor? ; + : count ( rc-rcn ) + 0 !surrounding + NW NN NE + WW EE + SW SS SE @surrounding ; + : alive ( rc-n ) + count + [ 0 1 within ] [ drop 0 ] when + [ 4 8 within ] [ drop 0 ] when + [ 2 3 within ] [ drop 1 ] when ; + : dead ( rc-n ) + count + [ 3 = ] [ drop 1 ] when + [ 0 2 within ] [ drop 0 ] when + [ 4 8 within ] [ drop 0 ] when ; + : newState ( rc-n ) + 2over get 1 = [ alive ] [ dead ] if ; + : set ( nrc- ) next + [ 20 * ] dip + ! ; + : cols ( r- ) + 20 [ over swap newState 2rot set ] iter drop ; + : output ( n- ) [ 'o ] [ '. ] if putc space ; +---reveal--- + : display ( - ) + cr world 20 [ 20 [ @+ output ] times cr ] times drop ; + : start ( - ) + initial world 20 20 * copy display ; + : gen ( - ) + 20 [ cols ] iter next world 20 20 * copy ; + : delay ( - ) time 1+ [ time over <= ] while drop ; + : run ( n- ) + [ delay clear gen display ] times ; +}} + +start 20 run diff --git a/Task/Conways-Game-of-Life/SETL/conways-game-of-life.setl b/Task/Conways-Game-of-Life/SETL/conways-game-of-life.setl new file mode 100644 index 0000000000..87f64e086d --- /dev/null +++ b/Task/Conways-Game-of-Life/SETL/conways-game-of-life.setl @@ -0,0 +1,35 @@ +program life; + +const + initialMatrix = + [".....", + "..#..", + "...#.", + ".###.", + "....."]; + +loop +init + s := initialLiveSet(); +do + output(s); + nm := {[[x+dx, y+dy], [x, y]]: [x, y] in s, dx in {-1..1}, dy in {-1..1}}; + s := {c: t = nm{c} | 3 in {#t, #(t less c)}}; +end; + +proc output(s); + system("clear"); + (for y in [0..24]) + (for x in [0..78]) + nprint(if [x, y] in s then "#" else " " end); + end; + print(); + end; + select([], 250); +end proc; + +proc initialLiveSet(); + return {[x,y]: row = initialMatrix(y), c = row(x) | c = '#'}; +end proc; + +end program; diff --git a/Task/Conways-Game-of-Life/SystemVerilog/conways-game-of-life.v b/Task/Conways-Game-of-Life/SystemVerilog/conways-game-of-life.v new file mode 100644 index 0000000000..442ff12d0f --- /dev/null +++ b/Task/Conways-Game-of-Life/SystemVerilog/conways-game-of-life.v @@ -0,0 +1,29 @@ +module gol; + + parameter NUM_ROWS = 20; + parameter NUM_COLS = 32; + + bit [NUM_COLS:1] cell[1:NUM_ROWS]; + bit clk; + + initial begin + cell[10][10:8] = 3'b111; + cell[11][10:8] = 3'b100; + cell[12][10:8] = 3'b010; + repeat(8) #5 clk = ~clk; + end + + always @(posedge clk) begin + foreach (cell[y,x]) begin + automatic int count = $countones({ cell[y-1][x-1+:3], cell[y][x-1], cell[y][x+1], cell[y+1][x-1+:3] }); + if (count == 3) cell[y][x] <= 1'b1; + else if (count != 2) cell[y][x] <= 1'b0; + end + end + + always @(negedge clk) begin + $display("--"); + foreach (cell[y]) $display( " %b", cell[y] ); + end + +endmodule diff --git a/Task/Conways-Game-of-Life/TI-83-BASIC/conways-game-of-life-1.ti-83 b/Task/Conways-Game-of-Life/TI-83-BASIC/conways-game-of-life-1.ti-83 new file mode 100644 index 0000000000..00c941336f --- /dev/null +++ b/Task/Conways-Game-of-Life/TI-83-BASIC/conways-game-of-life-1.ti-83 @@ -0,0 +1,21 @@ + PROGRAM:CONWAY +:While 1 +:For(X,2,9,1) +:For(Y,2,17,1) +:If [A](Y,X) +:Then +:Output(X-1,Y-1,"X") +:Else +:Output(X-1,Y-1," ") +:End +:[A](Y-1,X-1)+[A](Y,X-1)+[A](Y+1,X-1)+[A](Y-1,X)+[A](Y+1,X)+[A](Y-1,X+1)+[A](Y,X+1)+[A](Y+1,X+1)→N +:If ([A](Y,X) and (N=2 or N=3)) or (not([A](Y,X)) and N=3) +:Then +:1→[B](Y,X) +:Else +:0→[B](Y,X) +:End +:End +:End +:[B]→[A] +:End diff --git a/Task/Conways-Game-of-Life/TI-83-BASIC/conways-game-of-life-2.ti-83 b/Task/Conways-Game-of-Life/TI-83-BASIC/conways-game-of-life-2.ti-83 new file mode 100644 index 0000000000..b6f27a46b2 --- /dev/null +++ b/Task/Conways-Game-of-Life/TI-83-BASIC/conways-game-of-life-2.ti-83 @@ -0,0 +1,6 @@ +PROGRAM:PIC2LIFE +:For(I,0,17,1) +:For(J,0,9,1) +:pxl-Test(J,I)→[A](I+1,J+1) +:End +:End diff --git a/Task/Conways-Game-of-Life/TI-89-BASIC/conways-game-of-life.ti-89 b/Task/Conways-Game-of-Life/TI-89-BASIC/conways-game-of-life.ti-89 new file mode 100644 index 0000000000..3e6839ffc6 --- /dev/null +++ b/Task/Conways-Game-of-Life/TI-89-BASIC/conways-game-of-life.ti-89 @@ -0,0 +1,76 @@ +Define life(pattern) = Prgm + Local x,y,nt,count,save,xl,yl,xh,yh + Define nt(y,x) = when(pxlTest(y,x), 1, 0) + + {}→save + setGraph("Axes", "Off")→save[1] + setGraph("Grid", "Off")→save[2] + setGraph("Labels", "Off")→save[3] + FnOff + PlotOff + ClrDraw + + If pattern = "blinker" Then + 36→yl + 40→yh + 78→xl + 82→xh + PxlOn 36,80 + PxlOn 38,80 + PxlOn 40,80 + ElseIf pattern = "glider" Then + 30→yl + 40→yh + 76→xl + 88→xh + PxlOn 38,76 + PxlOn 36,78 + PxlOn 36,80 + PxlOn 38,80 + PxlOn 40,80 + ElseIf pattern = "r" Then + 38-5*2→yl + 38+5*2→yh + 80-5*2→xl + 80+5*2→xh + PxlOn 38,78 + PxlOn 36,82 + PxlOn 36,80 + PxlOn 38,80 + PxlOn 40,80 + EndIf + + While getKey() = 0 + © Expand upper-left corner to whole cell + For y,yl,yh,2 + For x,xl,xh,2 + If pxlTest(y,x) Then + PxlOn y+1,x + PxlOn y+1,x+1 + PxlOn y, x+1 + Else + PxlOff y+1,x + PxlOff y+1,x+1 + PxlOff y, x+1 + EndIf + EndFor + EndFor + + © Compute next generation + For y,yl,yh,2 + For x,xl,xh,2 + nt(y-1,x-1) + nt(y-1,x) + nt(y-1,x+2) + nt(y,x-1) + nt(y+1,x+2) + nt(y+2,x-1) + nt(y+2,x+1) + nt(y+2,x+2) → count + If count = 3 Then + PxlOn y,x + ElseIf count ≠ 2 Then + PxlOff y,x + EndIf + EndFor + EndFor + EndWhile + + © Restore changed options + setGraph("Axes", save[1]) + setGraph("Grid", save[2]) + setGraph("Labels", save[3]) +EndPrgm diff --git a/Task/Conways-Game-of-Life/Ursala/conways-game-of-life-1.ursala b/Task/Conways-Game-of-Life/Ursala/conways-game-of-life-1.ursala new file mode 100644 index 0000000000..b26ffc0e74 --- /dev/null +++ b/Task/Conways-Game-of-Life/Ursala/conways-game-of-life-1.ursala @@ -0,0 +1,8 @@ +#import std +#import nat + +rule = -: ^(~&,~&l?(~&r-={2,3},~&r-={3})^|/~& length@F)* pad0 iota512 + +neighborhoods = ~&thth3hthhttPCPthPTPTX**K7S+ swin3**+ swin3@hNSPiCihNCT+ --<0>*+ 0-* + +evolve "n" = next"n" rule**+ neighborhoods diff --git a/Task/Conways-Game-of-Life/Ursala/conways-game-of-life-2.ursala b/Task/Conways-Game-of-Life/Ursala/conways-game-of-life-2.ursala new file mode 100644 index 0000000000..12892b2b40 --- /dev/null +++ b/Task/Conways-Game-of-Life/Ursala/conways-game-of-life-2.ursala @@ -0,0 +1,19 @@ +blinker = + +(==`O)**t -[ ++++ +OOO ++++]- + +glider = + +(==`O)**t -[ ++O++++ +++O+++ +OOO+++ +++++++ +++++++]- + +#show+ + +examples = mat0 ~&?(`O!,`+!)*** evolve3(blinker)-- evolve5(glider) diff --git a/Task/Conways-Game-of-Life/Vedit-macro-language/conways-game-of-life-1.vedit b/Task/Conways-Game-of-Life/Vedit-macro-language/conways-game-of-life-1.vedit new file mode 100644 index 0000000000..c1f5784b3a --- /dev/null +++ b/Task/Conways-Game-of-Life/Vedit-macro-language/conways-game-of-life-1.vedit @@ -0,0 +1,58 @@ +IT("Generation 0 ") IN +IT(".O.") IN +IT(".O.") IN +IT(".O.") + +#9 = 2 // number of generations to calculate +#10 = Cur_Line +#11 = Cur_Col-1 +for (#2 = 1; #2 <= #9; #2++) { + Update() + Get_Key("Next gen...", STATLINE) + Call("calculate") + itoa(#2, 20, LEFT) + GL(1) GC(12) Reg_Ins(20, OVERWRITE) +} +EOF +Return + +// Calculate one generation +:calculate: +Goto_Line(2) +While (At_EOF == 0) { + Search("|A",ERRBREAK) // find next living cell + #3 = Cur_Line + #4 = #7 = #8 = Cur_Col + if (#4 > 1) { // increment cell at left + #7 = #4-1 + Goto_Col(#7) + Ins_Char(Cur_Char+1,OVERWRITE) + } + if (#4 < #11) { // increment cell at right + #8 = #4+1 + Goto_Col(#8) + Ins_Char(Cur_Char+1,OVERWRITE) + } + if (#3 > 2) { // increment 3 cells above + Goto_Line(#3-1) + Call("inc_3") + } + if (#3 < #10) { // increment 3 cells below + Goto_Line(#3+1) + Call("inc_3") + } + Goto_Line(#3) + Goto_Col(#4+1) +} + +Replace("[1QR]", "O", REGEXP+BEGIN+ALL) // these cells alive +Replace("[/-7P-X]", ".", REGEXP+BEGIN+ALL) // these cells dead +Return + +// increment values of 3 characters in a row +:inc_3: +for (#1 = #7; #1 <= #8; #1++) { + Goto_Col(#1) + Ins_Char(Cur_Char+1,OVERWRITE) +} +Return diff --git a/Task/Conways-Game-of-Life/Vedit-macro-language/conways-game-of-life-2.vedit b/Task/Conways-Game-of-Life/Vedit-macro-language/conways-game-of-life-2.vedit new file mode 100644 index 0000000000..b9fb8b7047 --- /dev/null +++ b/Task/Conways-Game-of-Life/Vedit-macro-language/conways-game-of-life-2.vedit @@ -0,0 +1,14 @@ +Generation 0 +.O. +.O. +.O. + +Generation 1 +... +OOO +... + +Generation 2 +.O. +.O. +.O. diff --git a/Task/Conways-Game-of-Life/XPL0/conways-game-of-life.xpl0 b/Task/Conways-Game-of-Life/XPL0/conways-game-of-life.xpl0 new file mode 100644 index 0000000000..4b94c6be54 --- /dev/null +++ b/Task/Conways-Game-of-Life/XPL0/conways-game-of-life.xpl0 @@ -0,0 +1,32 @@ +def M=3; \array size +char NowGen(M+2, M+2), \size with surrounding borders + NewGen(M+2, M+2); +int X, Y, I, J, N, Gen; +code ChOut=8, CrLf=9; + +[for Y:= 0 to M+1 do \set up initial state + for X:= 0 to M+1 do + [NowGen(X,Y):= ^ ; NewGen(X,Y):= ^ ]; +NowGen(1,2):= ^#; NowGen(2,2):= ^#; NowGen(3,2):= ^#; + +for Gen:= 1 to 3 do + [for Y:= 1 to M do \show current generation + [for X:= 1 to M do [ChOut(0, NowGen(X,Y)); ChOut(0,^ )]; + CrLf(0); + ]; + CrLf(0); + + for Y:= 1 to M do \determine next generation + for X:= 1 to M do + [N:= 0; \count adjacent live (#) cells + for J:= Y-1 to Y+1 do + for I:= X-1 to X+1 do + if NowGen(I,J) = ^# then N:= N+1; + if NowGen(X,Y) = ^# then N:= N-1; \don't count center + NewGen(X,Y):= ^ ; \assume death + if N=2 then NewGen(X,Y):= NowGen(X,Y) \actually no change + else if N=3 then NewGen(X,Y):= ^#; \actually birth + ]; + I:= NowGen; NowGen:= NewGen; NewGen:= I; \swap arrays + ]; +] diff --git a/Task/Conways-Game-of-Life/ZPL/conways-game-of-life.zpl b/Task/Conways-Game-of-Life/ZPL/conways-game-of-life.zpl new file mode 100644 index 0000000000..ac8ab4036b --- /dev/null +++ b/Task/Conways-Game-of-Life/ZPL/conways-game-of-life.zpl @@ -0,0 +1,28 @@ +program Life; + +config var + n : integer = 100; + +region + BigR = [0 .. n+1, 0 .. n+1]; + R = [1 .. n, 1 .. n ]; + +direction + nw = [-1, -1]; north = [-1, 0]; ne = [-1, 1]; + west = [ 0, -1]; east = [ 0, 1]; + sw = [ 1, -1]; south = [ 1, 0]; se = [ 1, 1]; + +var + TW : [BigR] boolean; -- The World + NN : [R] integer; -- Number of Neighbours + +procedure Life(); +begin + -- Initialize world + [R] repeat + NN := TW@nw + TW@north + TW@ne + + TW@west + TW@east + + TW@sw + TW@south + TW@se; + TW := (TW & NN = 2) | ( NN = 3); + until !(|<< TW); +end; diff --git a/Task/Count-in-factors/CoffeeScript/count-in-factors.coffee b/Task/Count-in-factors/CoffeeScript/count-in-factors.coffeescript similarity index 100% rename from Task/Count-in-factors/CoffeeScript/count-in-factors.coffee rename to Task/Count-in-factors/CoffeeScript/count-in-factors.coffeescript diff --git a/Task/Count-in-factors/Mathematica/count-in-factors.mathematica b/Task/Count-in-factors/Mathematica/count-in-factors.math similarity index 100% rename from Task/Count-in-factors/Mathematica/count-in-factors.mathematica rename to Task/Count-in-factors/Mathematica/count-in-factors.math diff --git a/Task/Count-in-factors/OCaml/count-in-factors.ocaml b/Task/Count-in-factors/OCaml/count-in-factors.ocaml new file mode 100644 index 0000000000..5fbabc3481 --- /dev/null +++ b/Task/Count-in-factors/OCaml/count-in-factors.ocaml @@ -0,0 +1,22 @@ +open Big_int + +let prime_decomposition x = + let rec inner c p = + if lt_big_int p (square_big_int c) then + [p] + else if eq_big_int (mod_big_int p c) zero_big_int then + c :: inner c (div_big_int p c) + else + inner (succ_big_int c) p + in + inner (succ_big_int (succ_big_int zero_big_int)) x + +let () = + let rec aux v = + let ps = prime_decomposition v in + print_string (string_of_big_int v); + print_string " = "; + print_endline (String.concat " x " (List.map string_of_big_int ps)); + aux (succ_big_int v) + in + aux unit_big_int diff --git a/Task/Count-in-factors/Octave/count-in-factors.octave b/Task/Count-in-factors/Octave/count-in-factors.octave new file mode 100644 index 0000000000..b036dc2498 --- /dev/null +++ b/Task/Count-in-factors/Octave/count-in-factors.octave @@ -0,0 +1,5 @@ +for (n = 1:20) + printf ("%i: ", n) + printf ("%i ", factor (n)) + printf ("\n") +endfor diff --git a/Task/Count-in-factors/PARI-GP/count-in-factors.pari b/Task/Count-in-factors/PARI-GP/count-in-factors.pari new file mode 100644 index 0000000000..9e322feacf --- /dev/null +++ b/Task/Count-in-factors/PARI-GP/count-in-factors.pari @@ -0,0 +1,14 @@ +fnice(n)={ + my(f,s="",s1); + if (n < 2, return(n)); + f = factor(n); + s = Str(s, f[1,1]); + if (f[1, 2] != 1, s=Str(s, "^", f[1,2])); + for(i=2,#f[,1], + s1 = Str(" * ", f[i, 1]); + if (f[i, 2] != 1, s1 = Str(s1, "^", f[i, 2])); + s = Str(s, s1) + ); + s +}; +n=0;while(n++, print(fnice(n))) diff --git a/Task/Count-in-factors/PL-I/count-in-factors.pli b/Task/Count-in-factors/PL-I/count-in-factors.pli new file mode 100644 index 0000000000..a9f6b2dbc3 --- /dev/null +++ b/Task/Count-in-factors/PL-I/count-in-factors.pli @@ -0,0 +1,24 @@ +cnt: procedure options (main); + declare (i, k, n) fixed binary; + declare first bit (1) aligned; + + do n = 1 to 40; + put skip list (n || ' ='); + k = n; first = '1'b; +repeat: + do i = 2 to k-1; + if mod(k, i) = 0 then + do; + k = k/i; + if ^first then put edit (' x ')(A); + first = '0'b; + put edit (trim(i)) (A); + go to repeat; + end; + + end; + if ^first then put edit (' x ')(A); + if n = 1 then i = 1; + put edit (trim(i)) (A); + end; +end cnt; diff --git a/Task/Count-in-factors/Pascal/count-in-factors.pascal b/Task/Count-in-factors/Pascal/count-in-factors.pascal new file mode 100644 index 0000000000..c7f41138f5 --- /dev/null +++ b/Task/Count-in-factors/Pascal/count-in-factors.pascal @@ -0,0 +1,45 @@ +program CountInFactors(output); + +type + TdynArray = array of integer; + +function factorize(number: integer): TdynArray; + var + k: integer; + begin + if number = 1 then + begin + setlength(factorize, 1); + factorize[0] := 1 + end + else + begin + k := 2; + while number > 1 do + begin + while number mod k = 0 do + begin + setlength(factorize, length(factorize) + 1); + factorize[high(factorize)] := k; + number := number div k; + end; + inc(k); + end; + end + end; + +var + i, j: integer; + fac: TdynArray; + +begin + for i := 1 to 22 do + begin + write(i, ': ' ); + fac := factorize(i); + write(fac[0]); + for j := 1 to high(fac) do + write(' * ', fac[j]); + writeln; + end; +end. diff --git a/Task/Count-in-factors/Perl-6/count-in-factors.pl6 b/Task/Count-in-factors/Perl-6/count-in-factors.pl6 new file mode 100644 index 0000000000..bb5f77333a --- /dev/null +++ b/Task/Count-in-factors/Perl-6/count-in-factors.pl6 @@ -0,0 +1,33 @@ +# Define a lazy list of primes. +# Uses the ... sequence operator with a lambda that calculates +# the next available prime by using some of the existing list +# as test divisors, so we rarely divide by anything that isn't +# known to be a prime already. This is quite fast. +my @primes := 2, 3, 5, -> $p { ($p+2, $p+4 ... &prime)[*-1] } ... *; +my @isprime = False,False; # 0 and 1 are not prime by definition +sub prime($i) { @isprime[$i] //= $i %% none @primes ...^ * > sqrt $i } + +# Finds the factors of the given argument. +multi factors(1) { 1 } +multi factors(Int $remainder is copy) { + gather for @primes -> $factor { + + # if remainder < factor², we're done + if $factor * $factor > $remainder { + take $remainder if $remainder > 1; + last; + } + + # How many times can we divide by this prime? + while $remainder %% $factor { + take $factor; + last if ($remainder div= $factor) === 1; + } + } +} + +# An infinite loop, from 1 incrementing upward. +# calls factor() with each of 1, 2, 3, etc., receives an +# array containing that number's factors, and then +# formats and displays them. +say "$_: ", factors($_).join(" × ") for 1..*; diff --git a/Task/Count-in-factors/PureBasic/count-in-factors.purebasic b/Task/Count-in-factors/PureBasic/count-in-factors.purebasic new file mode 100644 index 0000000000..678ba4c6b4 --- /dev/null +++ b/Task/Count-in-factors/PureBasic/count-in-factors.purebasic @@ -0,0 +1,38 @@ +Procedure Factorize(Number, List Factors()) + Protected I = 3, Max + ClearList(Factors()) + While Number % 2 = 0 + AddElement(Factors()) + Factors() = 2 + Number / 2 + Wend + Max = Number + While I <= Max And Number > 1 + While Number % I = 0 + AddElement(Factors()) + Factors() = I + Number / I + Wend + I + 2 + Wend +EndProcedure + +If OpenConsole() + NewList n() + For a=1 To 20 + text$=RSet(Str(a),2)+"= " + Factorize(a,n()) + If ListSize(n()) + ResetList(n()) + While NextElement(n()) + text$ + Str(n()) + If ListSize(n())-ListIndex(n())>1 + text$ + "*" + EndIf + Wend + Else + text$+Str(a) ; To handle the '1', which is not really a prime... + EndIf + PrintN(text$) + Next a +EndIf diff --git a/Task/Count-in-factors/Run-BASIC/count-in-factors.run b/Task/Count-in-factors/Run-BASIC/count-in-factors.run new file mode 100644 index 0000000000..a024fa5ac3 --- /dev/null +++ b/Task/Count-in-factors/Run-BASIC/count-in-factors.run @@ -0,0 +1,17 @@ +for i = 1000 to 1016 + print i;" = "; factorial$(i) +next +wait +function factorial$(num) + if num = 1 then factorial$ = "1" + fct = 2 + while fct <= num + if (num mod fct) = 0 then + factorial$ = factorial$ ; x$ ; fct + x$ = " x " + num = num / fct + else + fct = fct + 1 + end if + wend +end function diff --git a/Task/Count-in-factors/Seed7/count-in-factors.seed7 b/Task/Count-in-factors/Seed7/count-in-factors.seed7 new file mode 100644 index 0000000000..a3f5ef73f6 --- /dev/null +++ b/Task/Count-in-factors/Seed7/count-in-factors.seed7 @@ -0,0 +1,39 @@ +$ include "seed7_05.s7i"; + +const proc: writePrimeFactors (in var integer: number) is func + local + var boolean: laterElement is FALSE; + var integer: checker is 2; + begin + while checker * checker <= number do + if number rem checker = 0 then + if laterElement then + write(" * "); + end if; + laterElement := TRUE; + write(checker); + number := number div checker; + else + incr(checker); + end if; + end while; + if number <> 1 then + if laterElement then + write(" * "); + end if; + laterElement := TRUE; + write(number); + end if; + end func; + +const proc: main is func + local + var integer: number is 0; + begin + writeln("1: 1"); + for number range 2 to 2147483647 do + write(number <& ": "); + writePrimeFactors(number); + writeln; + end for; + end func; diff --git a/Task/Count-in-factors/Visual-Basic-.NET/count-in-factors.visual b/Task/Count-in-factors/Visual-Basic-.NET/count-in-factors.visual new file mode 100644 index 0000000000..1fc2a7597e --- /dev/null +++ b/Task/Count-in-factors/Visual-Basic-.NET/count-in-factors.visual @@ -0,0 +1,42 @@ +Module CountingInFactors + + Sub Main() + For i As Integer = 1 To 10 + Console.WriteLine("{0} = {1}", i, CountingInFactors(i)) + Next + + For i As Integer = 9991 To 10000 + Console.WriteLine("{0} = {1}", i, CountingInFactors(i)) + Next + End Sub + + Private Function CountingInFactors(ByVal n As Integer) As String + If n = 1 Then Return "1" + + Dim sb As New Text.StringBuilder() + + CheckFactor(2, n, sb) + If n = 1 Then Return sb.ToString() + + CheckFactor(3, n, sb) + If n = 1 Then Return sb.ToString() + + For i As Integer = 5 To n Step 2 + If i Mod 3 = 0 Then Continue For + + CheckFactor(i, n, sb) + If n = 1 Then Exit For + Next + + Return sb.ToString() + End Function + + Private Sub CheckFactor(ByVal mult As Integer, ByRef n As Integer, ByRef sb As Text.StringBuilder) + Do While n Mod mult = 0 + If sb.Length > 0 Then sb.Append(" x ") + sb.Append(mult) + n = n / mult + Loop + End Sub + +End Module diff --git a/Task/Count-in-factors/XPL0/count-in-factors.xpl0 b/Task/Count-in-factors/XPL0/count-in-factors.xpl0 new file mode 100644 index 0000000000..3df72d3417 --- /dev/null +++ b/Task/Count-in-factors/XPL0/count-in-factors.xpl0 @@ -0,0 +1,17 @@ +include c:\cxpl\codes; +int N0, N, F; +[N0:= 1; +repeat IntOut(0, N0); Text(0, " = "); + F:= 2; N:= N0; + repeat if rem(N/F) = 0 then + [if N # N0 then Text(0, " * "); + IntOut(0, F); + N:= N/F; + ] + else F:= F+1; + until F>N; + if N0=1 then IntOut(0, 1); \1 = 1 + CrLf(0); + N0:= N0+1; +until KeyHit; +] diff --git a/Task/Count-in-octal/BASIC/count-in-octal-1.bas b/Task/Count-in-octal/BASIC/count-in-octal-1.basic similarity index 100% rename from Task/Count-in-octal/BASIC/count-in-octal-1.bas rename to Task/Count-in-octal/BASIC/count-in-octal-1.basic diff --git a/Task/Count-in-octal/BASIC/count-in-octal-2.bas b/Task/Count-in-octal/BASIC/count-in-octal-2.basic similarity index 100% rename from Task/Count-in-octal/BASIC/count-in-octal-2.bas rename to Task/Count-in-octal/BASIC/count-in-octal-2.basic diff --git a/Task/Count-in-octal/CoffeeScript/count-in-octal.coffee b/Task/Count-in-octal/CoffeeScript/count-in-octal.coffeescript similarity index 100% rename from Task/Count-in-octal/CoffeeScript/count-in-octal.coffee rename to Task/Count-in-octal/CoffeeScript/count-in-octal.coffeescript diff --git a/Task/Count-in-octal/Mathematica/count-in-octal.mathematica b/Task/Count-in-octal/Mathematica/count-in-octal.math similarity index 100% rename from Task/Count-in-octal/Mathematica/count-in-octal.mathematica rename to Task/Count-in-octal/Mathematica/count-in-octal.math diff --git a/Task/Count-in-octal/NetRexx/count-in-octal.netrexx b/Task/Count-in-octal/NetRexx/count-in-octal.netrexx new file mode 100644 index 0000000000..5180b4697c --- /dev/null +++ b/Task/Count-in-octal/NetRexx/count-in-octal.netrexx @@ -0,0 +1,15 @@ +/* NetRexx */ +options replace format comments java crossref symbols binary + +import java.math.BigInteger + +-- allow an option to change the output radix. +parse arg radix . +if radix.length() == 0 then radix = 8 +k_ = BigInteger +k_ = BigInteger.ZERO + +loop forever + say k_.toString(int radix) + k_ = k_.add(BigInteger.ONE) + end diff --git a/Task/Count-in-octal/NewLISP/count-in-octal.newlisp b/Task/Count-in-octal/NewLISP/count-in-octal.newlisp new file mode 100644 index 0000000000..ff57c40519 --- /dev/null +++ b/Task/Count-in-octal/NewLISP/count-in-octal.newlisp @@ -0,0 +1,11 @@ +; file: ocount.lsp +; url: http://rosettacode.org/wiki/Count_in_octal +; author: oofoe 2012-01-29 + +; Although NewLISP itself uses a 64-bit integer representation, the +; format function relies on underlying C library's printf function, +; which can only handle a 32-bit octal number on this implementation. + +(for (i 0 (pow 2 32)) (println (format "%o" i))) + +(exit) diff --git a/Task/Count-in-octal/OCaml/count-in-octal.ocaml b/Task/Count-in-octal/OCaml/count-in-octal.ocaml new file mode 100644 index 0000000000..1cdb9045e1 --- /dev/null +++ b/Task/Count-in-octal/OCaml/count-in-octal.ocaml @@ -0,0 +1,4 @@ +let () = + for i = 0 to max_int do + Printf.printf "%o\n" i + done diff --git a/Task/Count-in-octal/PARI-GP/count-in-octal-1.pari b/Task/Count-in-octal/PARI-GP/count-in-octal-1.pari new file mode 100644 index 0000000000..d5c1e191db --- /dev/null +++ b/Task/Count-in-octal/PARI-GP/count-in-octal-1.pari @@ -0,0 +1,2 @@ +oct(n)=n=binary(n);if(#n%3,n=concat([[0,0],[0]][#n%3],n));forstep(i=1,#n,3,print1(4*n[i]+2*n[i+1]+n[i+2]));print; +n=0;while(1,oct(n);n++) diff --git a/Task/Count-in-octal/PARI-GP/count-in-octal-2.pari b/Task/Count-in-octal/PARI-GP/count-in-octal-2.pari new file mode 100644 index 0000000000..7921510d43 --- /dev/null +++ b/Task/Count-in-octal/PARI-GP/count-in-octal-2.pari @@ -0,0 +1 @@ +n=0;while(1,printf("%o\n",n);n++) diff --git a/Task/Count-in-octal/PL-I/count-in-octal.pli b/Task/Count-in-octal/PL-I/count-in-octal.pli new file mode 100644 index 0000000000..131da0d6e3 --- /dev/null +++ b/Task/Count-in-octal/PL-I/count-in-octal.pli @@ -0,0 +1,24 @@ +/* Do the actual counting in octal. */ +count: procedure options (main); + declare v(5) fixed(1) static initial ((5)0); + declare (i, k) fixed; + + do k = 1 to 999; + call inc; + put skip edit ( (v(i) do i = 1 to 5) ) (f(1)); + end; + +inc: proc; + declare (carry, i) fixed binary; + + carry = 1; + do i = 5 to 1 by -1; + v(i) = v(i) + carry; + if v(i) > 7 then + do; v(i) = v(i) - 8; if i = 1 then stop; carry = 1; end; + else + carry = 0; + end; +end inc; + +end count; diff --git a/Task/Count-in-octal/Perl-6/count-in-octal.pl6 b/Task/Count-in-octal/Perl-6/count-in-octal.pl6 new file mode 100644 index 0000000000..d96f612aaf --- /dev/null +++ b/Task/Count-in-octal/Perl-6/count-in-octal.pl6 @@ -0,0 +1 @@ +say .base(8) for ^Inf; diff --git a/Task/Count-in-octal/PureBasic/count-in-octal.purebasic b/Task/Count-in-octal/PureBasic/count-in-octal.purebasic new file mode 100644 index 0000000000..7ac47af3ff --- /dev/null +++ b/Task/Count-in-octal/PureBasic/count-in-octal.purebasic @@ -0,0 +1,27 @@ +Procedure.s octal(n.q) + Static Dim digits(20) + Protected i, j, result.s + For i = 0 To 20 + digits(i) = n % 8 + n / 8 + If n < 1 + For j = i To 0 Step -1 + result + Str(digits(j)) + Next + Break + EndIf + Next + + ProcedureReturn result +EndProcedure + +Define n.q +If OpenConsole() + While n >= 0 + PrintN(octal(n)) + n + 1 + Wend + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Count-in-octal/Retro/count-in-octal.retro b/Task/Count-in-octal/Retro/count-in-octal.retro new file mode 100644 index 0000000000..39a99d7a72 --- /dev/null +++ b/Task/Count-in-octal/Retro/count-in-octal.retro @@ -0,0 +1,2 @@ +octal +17777777777 [ putn cr ] iter diff --git a/Task/Count-in-octal/Run-BASIC/count-in-octal.run b/Task/Count-in-octal/Run-BASIC/count-in-octal.run new file mode 100644 index 0000000000..25d9fa3096 --- /dev/null +++ b/Task/Count-in-octal/Run-BASIC/count-in-octal.run @@ -0,0 +1,15 @@ +input "Begin number:";b +input " End number:";e + +for i = b to e + print i;" ";toBase$(8,i) +next i +end + +function toBase$(base,base10) +for i = 10 to 1 step -1 + toBase$ = str$(base10 mod base) +toBase$ + base10 = int(base10 / base) + if base10 < 1 then exit for +next i +end function diff --git a/Task/Count-in-octal/Salmon/count-in-octal-1.salmon b/Task/Count-in-octal/Salmon/count-in-octal-1.salmon new file mode 100644 index 0000000000..f9e951a924 --- /dev/null +++ b/Task/Count-in-octal/Salmon/count-in-octal-1.salmon @@ -0,0 +1,2 @@ +iterate (i; [0...+oo]) + printf("%o%\n", i);; diff --git a/Task/Count-in-octal/Salmon/count-in-octal-2.salmon b/Task/Count-in-octal/Salmon/count-in-octal-2.salmon new file mode 100644 index 0000000000..b2151ad2fa --- /dev/null +++ b/Task/Count-in-octal/Salmon/count-in-octal-2.salmon @@ -0,0 +1,2 @@ +for (i; 0; true) + printf("%o%\n", i);; diff --git a/Task/Count-in-octal/Salmon/count-in-octal-3.salmon b/Task/Count-in-octal/Salmon/count-in-octal-3.salmon new file mode 100644 index 0000000000..4d1e500f9a --- /dev/null +++ b/Task/Count-in-octal/Salmon/count-in-octal-3.salmon @@ -0,0 +1,6 @@ +variable i := 0; +while (true) + { + printf("%o%\n", i); + ++i; + }; diff --git a/Task/Count-in-octal/Seed7/count-in-octal.seed7 b/Task/Count-in-octal/Seed7/count-in-octal.seed7 new file mode 100644 index 0000000000..aa680a484f --- /dev/null +++ b/Task/Count-in-octal/Seed7/count-in-octal.seed7 @@ -0,0 +1,11 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: i is 0; + begin + repeat + writeln(str(i, 8)); + incr(i); + until FALSE; + end func; diff --git a/Task/Count-in-octal/UNIX-Shell/count-in-octal-1.sh b/Task/Count-in-octal/UNIX-Shell/count-in-octal-1.sh new file mode 100644 index 0000000000..75cb4fd282 --- /dev/null +++ b/Task/Count-in-octal/UNIX-Shell/count-in-octal-1.sh @@ -0,0 +1,6 @@ +#!/bin/sh +num=0 +while true; do + echo $num + num=`echo "obase=8;ibase=8;$num+1"|bc` +done diff --git a/Task/Count-in-octal/UNIX-Shell/count-in-octal-2.sh b/Task/Count-in-octal/UNIX-Shell/count-in-octal-2.sh new file mode 100644 index 0000000000..5b9121a5a1 --- /dev/null +++ b/Task/Count-in-octal/UNIX-Shell/count-in-octal-2.sh @@ -0,0 +1,6 @@ +#!/bin/sh +num=0 +while test 0 -le $num; do + printf '%o\n' $num + num=`expr $num + 1` +done diff --git a/Task/Count-in-octal/UNIX-Shell/count-in-octal-3.sh b/Task/Count-in-octal/UNIX-Shell/count-in-octal-3.sh new file mode 100644 index 0000000000..b091824e33 --- /dev/null +++ b/Task/Count-in-octal/UNIX-Shell/count-in-octal-3.sh @@ -0,0 +1,5 @@ +num=0 +while test 0 -le $num; do + printf '%o\n' $num + num=$((num + 1)) +done diff --git a/Task/Count-in-octal/Whitespace/count-in-octal-1.ws b/Task/Count-in-octal/Whitespace/count-in-octal-1.ws new file mode 100644 index 0000000000..09c0ba967e --- /dev/null +++ b/Task/Count-in-octal/Whitespace/count-in-octal-1.ws @@ -0,0 +1 @@ + diff --git a/Task/Count-in-octal/Whitespace/count-in-octal-2.ws b/Task/Count-in-octal/Whitespace/count-in-octal-2.ws new file mode 100644 index 0000000000..4fa2807541 --- /dev/null +++ b/Task/Count-in-octal/Whitespace/count-in-octal-2.ws @@ -0,0 +1,33 @@ +push 0 +; Increment indefinitely. +0: + push -1 ; Sentinel value so the printer knows when to stop. + copy 1 + call 1 + push 10 + ochr + push 1 + add + jump 0 +; Get the octal digits on the stack in reverse order. +1: + dup + push 8 + mod + swap + push 8 + div + push 0 + copy 1 + sub + jn 1 + pop +; Print them. +2: + dup + jn 3 ; Stop at the sentinel. + onum + jump 2 +3: + pop + ret diff --git a/Task/Count-in-octal/XPL0/count-in-octal.xpl0 b/Task/Count-in-octal/XPL0/count-in-octal.xpl0 new file mode 100644 index 0000000000..34781f3071 --- /dev/null +++ b/Task/Count-in-octal/XPL0/count-in-octal.xpl0 @@ -0,0 +1,17 @@ +include c:\cxpl\codes; \intrinsic code declarations + +proc OctOut(N); \Output N in octal +int N; +int R; +[R:= N&7; +N:= N>>3; +if N then OctOut(N); +ChOut(0, R+^0); +]; + +int I; +[I:= 0; +repeat OctOut(I); CrLf(0); + I:= I+1; +until KeyHit or I=0; +] diff --git a/Task/Count-occurrences-of-a-substring/BASIC/count-occurrences-of-a-substring.bas b/Task/Count-occurrences-of-a-substring/BASIC/count-occurrences-of-a-substring.basic similarity index 100% rename from Task/Count-occurrences-of-a-substring/BASIC/count-occurrences-of-a-substring.bas rename to Task/Count-occurrences-of-a-substring/BASIC/count-occurrences-of-a-substring.basic diff --git a/Task/Count-occurrences-of-a-substring/CoffeeScript/count-occurrences-of-a-substring.coffee b/Task/Count-occurrences-of-a-substring/CoffeeScript/count-occurrences-of-a-substring.coffeescript similarity index 100% rename from Task/Count-occurrences-of-a-substring/CoffeeScript/count-occurrences-of-a-substring.coffee rename to Task/Count-occurrences-of-a-substring/CoffeeScript/count-occurrences-of-a-substring.coffeescript diff --git a/Task/Count-occurrences-of-a-substring/Mathematica/count-occurrences-of-a-substring.mathematica b/Task/Count-occurrences-of-a-substring/Mathematica/count-occurrences-of-a-substring.math similarity index 100% rename from Task/Count-occurrences-of-a-substring/Mathematica/count-occurrences-of-a-substring.mathematica rename to Task/Count-occurrences-of-a-substring/Mathematica/count-occurrences-of-a-substring.math diff --git a/Task/Count-occurrences-of-a-substring/NetRexx/count-occurrences-of-a-substring.netrexx b/Task/Count-occurrences-of-a-substring/NetRexx/count-occurrences-of-a-substring.netrexx new file mode 100644 index 0000000000..f1a4eee677 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/NetRexx/count-occurrences-of-a-substring.netrexx @@ -0,0 +1,22 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method countSubstring(inStr, findStr) public static + return inStr.countstr(findStr) + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method main(args = String[]) public static + strings = '' + find = 'FIND' + ix = 0 + ix = ix + 1; strings[0] = ix; find[0] = ix; strings[ix] = 'the three truths'; strings[ix, find] = 'th' + ix = ix + 1; strings[0] = ix; find[0] = ix; strings[ix] = 'ababababab'; strings[ix, find] = 'abab' + + loop ix = 1 to strings[0] + str = strings[ix] + fnd = strings[ix, find] + say 'there are' countSubstring(str, fnd) 'occurences of "'fnd'" in "'str'"' + end ix + + return diff --git a/Task/Count-occurrences-of-a-substring/NewLISP/count-occurrences-of-a-substring.newlisp b/Task/Count-occurrences-of-a-substring/NewLISP/count-occurrences-of-a-substring.newlisp new file mode 100644 index 0000000000..914fbaf710 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/NewLISP/count-occurrences-of-a-substring.newlisp @@ -0,0 +1,43 @@ +; file: stringcount.lsp +; url: http://rosettacode.org/wiki/Count_occurrences_of_a_substring +; author: oofoe 2012-01-29 + +; Obvious (and non-destructive...) + +; Note that NewLISP performs an /implicit/ slice on a string or list +; with this form "(start# end# stringorlist)". If the end# is omitted, +; the slice will go to the end of the string. This is handy here to +; keep removing the front part of the string as it gets matched. + +(define (scount needle haystack) + (let ((h (copy haystack)) ; Copy of haystack string. + (i 0) ; Cursor. + (c 0)) ; Count of occurences. + + (while (setq i (find needle h)) + (inc c) + (setq h ((+ i (length needle)) h))) + + c)) ; Return count. + +; Tricky -- Uses functionality from replace function to find all +; non-overlapping occurrences, replace them, and return the count of +; items replaced in system variable $0. + +(define (rcount needle haystack) + (replace needle haystack "X") $0) + +; Test + +(define (test f needle haystack) + (println "Found " (f needle haystack) + " occurences of '" needle "' in '" haystack "'.")) + +(dolist (f (list scount rcount)) + (test f "glart" "hinkerpop") + (test f "abab" "ababababab") + (test f "th" "the three truths") + (println) + ) + +(exit) diff --git a/Task/Count-occurrences-of-a-substring/OCaml/count-occurrences-of-a-substring.ocaml b/Task/Count-occurrences-of-a-substring/OCaml/count-occurrences-of-a-substring.ocaml new file mode 100644 index 0000000000..eed202541b --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/OCaml/count-occurrences-of-a-substring.ocaml @@ -0,0 +1,17 @@ +let count_substring str sub = + let sub_len = String.length sub in + let len_diff = (String.length str) - sub_len + and reg = Str.regexp_string sub in + let rec aux i n = + if i > len_diff then n else + try + let pos = Str.search_forward reg str i in + aux (pos + sub_len) (succ n) + with Not_found -> n + in + aux 0 0 + +let () = + Printf.printf "count 1: %d\n" (count_substring "the three truth" "th"); + Printf.printf "count 2: %d\n" (count_substring "ababababab" "abab"); +;; diff --git a/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-1.m b/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-1.m new file mode 100644 index 0000000000..125a5593c0 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-1.m @@ -0,0 +1,20 @@ +@interface NSString (CountSubstrings) +- (NSUInteger)occurrencesOfSubstring:(NSString *)subStr; +@end + +@implementation NSString (CountSubstrings) +- (NSUInteger)occurrencesOfSubstring:(NSString *)subStr { + return [[self componentsSeparatedByString:subStr] count] - 1; +} +@end + +int main(int argc, const char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSLog(@"%lu", [@"the three truths" occurrencesOfSubstring:@"th"]); + NSLog(@"%lu", [@"ababababab" occurrencesOfSubstring:@"abab"]); + NSLog(@"%lu", [@"abaabba*bbaba*bbab" occurrencesOfSubstring:@"a*b"]); + + [pool release]; + return 0; +} diff --git a/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-2.m b/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-2.m new file mode 100644 index 0000000000..cdef2bd73a --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-2.m @@ -0,0 +1,20 @@ +@interface NSString (CountSubstrings) +- (NSUInteger)occurrencesOfSubstring:(NSString *)subStr; +@end + +@implementation NSString (CountSubstrings) +- (NSUInteger)occurrencesOfSubstring:(NSString *)subStr { + return ([self length] - [[self stringByReplacingOccurrencesOfString:subStr withString:@""] length]) / [subStr length]; +} +@end + +int main(int argc, const char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSLog(@"%lu", [@"the three truths" occurrencesOfSubstring:@"th"]); + NSLog(@"%lu", [@"ababababab" occurrencesOfSubstring:@"abab"]); + NSLog(@"%lu", [@"abaabba*bbaba*bbab" occurrencesOfSubstring:@"a*b"]); + + [pool release]; + return 0; +} diff --git a/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-3.m b/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-3.m new file mode 100644 index 0000000000..731a56ed12 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/Objective-C/count-occurrences-of-a-substring-3.m @@ -0,0 +1,26 @@ +@interface NSString (CountSubstrings) +- (NSUInteger)occurrencesOfSubstring:(NSString *)subStr; +@end + +@implementation NSString (CountSubstrings) +- (NSUInteger)occurrencesOfSubstring:(NSString *)subStr { + NSUInteger count = 0; + for (NSRange range = [self rangeOfString:subStr]; range.location != NSNotFound; + range.location += range.length, + range = [self rangeOfString:subStr options:0 + range:NSMakeRange(range.location, [self length] - range.location)]) + count++; + return count; +} +@end + +int main(int argc, const char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + NSLog(@"%lu", [@"the three truths" occurrencesOfSubstring:@"th"]); + NSLog(@"%lu", [@"ababababab" occurrencesOfSubstring:@"abab"]); + NSLog(@"%lu", [@"abaabba*bbaba*bbab" occurrencesOfSubstring:@"a*b"]); + + [pool release]; + return 0; +} diff --git a/Task/Count-occurrences-of-a-substring/PL-I/count-occurrences-of-a-substring.pli b/Task/Count-occurrences-of-a-substring/PL-I/count-occurrences-of-a-substring.pli new file mode 100644 index 0000000000..6e7f1ab99b --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/PL-I/count-occurrences-of-a-substring.pli @@ -0,0 +1,14 @@ +cnt: procedure options (main); + declare (i, tally) fixed binary; + declare (text, key) character (100) varying; + + get edit (text) (L); put skip data (text); + get edit (key) (L); put skip data (key); + + tally = 0; i = 1; + do until (i = 0); + i = index(text, key, i); + if i > 0 then do; tally = tally + 1; i = i + length(key); end; + end; + put skip list (tally); +end cnt; diff --git a/Task/Count-occurrences-of-a-substring/Perl-6/count-occurrences-of-a-substring.pl6 b/Task/Count-occurrences-of-a-substring/Perl-6/count-occurrences-of-a-substring.pl6 new file mode 100644 index 0000000000..49bbb4817f --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/Perl-6/count-occurrences-of-a-substring.pl6 @@ -0,0 +1,4 @@ +sub count-substring($big,$little) { +$big.comb: /$little/ } + +say count-substring("the three truths","th"); +say count-substring("ababababab","abab"); diff --git a/Task/Count-occurrences-of-a-substring/PowerBASIC/count-occurrences-of-a-substring.powerbasic b/Task/Count-occurrences-of-a-substring/PowerBASIC/count-occurrences-of-a-substring.powerbasic new file mode 100644 index 0000000000..801fab19f7 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/PowerBASIC/count-occurrences-of-a-substring.powerbasic @@ -0,0 +1,4 @@ +FUNCTION PBMAIN () AS LONG + PRINT "the three truths, th:", TALLY("the three truths", "th") + PRINT "ababababab, abab:", TALLY("ababababab", "abab") +END FUNCTION diff --git a/Task/Count-occurrences-of-a-substring/PureBasic/count-occurrences-of-a-substring.purebasic b/Task/Count-occurrences-of-a-substring/PureBasic/count-occurrences-of-a-substring.purebasic new file mode 100644 index 0000000000..600aff0b5c --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/PureBasic/count-occurrences-of-a-substring.purebasic @@ -0,0 +1,4 @@ +a = CountString("the three truths","th") +b = CountString("ababababab","abab") +; a = 3 +; b = 2 diff --git a/Task/Count-occurrences-of-a-substring/Run-BASIC/count-occurrences-of-a-substring.run b/Task/Count-occurrences-of-a-substring/Run-BASIC/count-occurrences-of-a-substring.run new file mode 100644 index 0000000000..f42f99fdb0 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/Run-BASIC/count-occurrences-of-a-substring.run @@ -0,0 +1,9 @@ +print countSubstring("the three truths","th") +print countSubstring("ababababab","abab") + +FUNCTION countSubstring(s$,find$) +WHILE instr(s$,find$,i) <> 0 + countSubstring = countSubstring + 1 + i = instr(s$,find$,i) + len(find$) +WEND +END FUNCTION diff --git a/Task/Count-occurrences-of-a-substring/SNOBOL4/count-occurrences-of-a-substring.sno b/Task/Count-occurrences-of-a-substring/SNOBOL4/count-occurrences-of-a-substring.sno new file mode 100644 index 0000000000..e0edab1285 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/SNOBOL4/count-occurrences-of-a-substring.sno @@ -0,0 +1,11 @@ + DEFINE("countSubstring(t,s)") + + OUTPUT = countSubstring("the three truths","th") + OUTPUT = countSubstring("ababababab","abab") + + :(END) +countSubstring t ARB s = :F(RETURN) + countSubstring = countSubstring + 1 :(countSubstring) +END +3 +2 diff --git a/Task/Count-occurrences-of-a-substring/Seed7/count-occurrences-of-a-substring.seed7 b/Task/Count-occurrences-of-a-substring/Seed7/count-occurrences-of-a-substring.seed7 new file mode 100644 index 0000000000..2bbafeed05 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/Seed7/count-occurrences-of-a-substring.seed7 @@ -0,0 +1,20 @@ +$ include "seed7_05.s7i"; + +const func integer: countSubstring (in string: stri, in string: searched) is func + result + var integer: count is 0; + local + var integer: offset is 0; + begin + offset := pos(stri, searched); + while offset <> 0 do + incr(count); + offset := pos(stri, searched, offset + length(searched)); + end while; + end func; + +const proc: main is func + begin + writeln(countSubstring("the three truths", "th")); + writeln(countSubstring("ababababab", "abab")); + end func; diff --git a/Task/Count-occurrences-of-a-substring/Standard-ML/count-occurrences-of-a-substring.ml b/Task/Count-occurrences-of-a-substring/Standard-ML/count-occurrences-of-a-substring.ml new file mode 100644 index 0000000000..98a31cdb04 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/Standard-ML/count-occurrences-of-a-substring.ml @@ -0,0 +1,18 @@ +fun count_substrings (str, sub) = + let + fun aux (str', count) = + let + val suff = #2 (Substring.position sub str') + in + if Substring.isEmpty suff then + count + else + aux (Substring.triml (size sub) suff, count + 1) + end + in + aux (Substring.full str, 0) + end; + +print (Int.toString (count_substrings ("the three truths", "th")) ^ "\n"); +print (Int.toString (count_substrings ("ababababab", "abab")) ^ "\n"); +print (Int.toString (count_substrings ("abaabba*bbaba*bbab", "a*b")) ^ "\n"); diff --git a/Task/Count-occurrences-of-a-substring/TUSCRIPT/count-occurrences-of-a-substring.tuscript b/Task/Count-occurrences-of-a-substring/TUSCRIPT/count-occurrences-of-a-substring.tuscript new file mode 100644 index 0000000000..89f3228cb9 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/TUSCRIPT/count-occurrences-of-a-substring.tuscript @@ -0,0 +1,4 @@ +$$ MODE TUSCRIPT, {} +occurences=COUNT ("the three truths", ":th:") +occurences=COUNT ("ababababab", ":abab:") +occurences=COUNT ("abaabba*bbaba*bbab",":a\*b:") diff --git a/Task/Count-occurrences-of-a-substring/TXR/count-occurrences-of-a-substring.txr b/Task/Count-occurrences-of-a-substring/TXR/count-occurrences-of-a-substring.txr new file mode 100644 index 0000000000..627767184a --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/TXR/count-occurrences-of-a-substring.txr @@ -0,0 +1,14 @@ +@(next :args) +@(do (defun count-occurrences (haystack needle) + (for* ((occurrences 0) + (old-pos 0) + (new-pos (search-str haystack needle old-pos nil))) + (new-pos occurrences) + ((inc occurrences) + (set old-pos (+ new-pos (length needle))) + (set new-pos (search-str haystack needle old-pos nil)))))) +@ndl +@hay +@(output) +@(count-occurrences hay ndl) occurrences(s) of @ndl inside @hay +@(end) diff --git a/Task/Count-occurrences-of-a-substring/XPL0/count-occurrences-of-a-substring.xpl0 b/Task/Count-occurrences-of-a-substring/XPL0/count-occurrences-of-a-substring.xpl0 new file mode 100644 index 0000000000..f95d5db0c1 --- /dev/null +++ b/Task/Count-occurrences-of-a-substring/XPL0/count-occurrences-of-a-substring.xpl0 @@ -0,0 +1,41 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +string 0; \use zero-terminated strings, instead of MSb terminated + + +func StrNCmp(A, B, N); \Compare string A to string B up to N bytes long +\This returns: +\ >0 if A > B +\ =0 if A = B +\ <0 if A < B +char A, B; \strings to be compared +int N; \number of bytes to compare +int I; +[for I:= 0 to N-1 do + if A(I) # B(I) then + return A(I) - B(I); +return 0; \they're equal +]; \StrNCmp + + +func StrLen(Str); \Return the number of characters in an ASCIIZ string +char Str; +int I; +for I:= 0 to -1>>1-1 do + if Str(I) = 0 then return I; + + +func SubStr(A, B); \Count number of times string B occurs in A +char A, B; +int LA, LB, C, I; +[LA:= StrLen(A); LB:= StrLen(B); +C:= 0; I:= 0; +while I < LA do + if StrNCmp(B, A+I, LB) = 0 then [C:= C+1; I:= I+LB] + else I:= I+1; +return C; +]; + + +[IntOut(0, SubStr("the three truths", "th")); CrLf(0); + IntOut(0, SubStr("ababababab", "abab")); CrLf(0); +] diff --git a/Task/Count-the-coins/Mathematica/count-the-coins.mathematica b/Task/Count-the-coins/Mathematica/count-the-coins.math similarity index 100% rename from Task/Count-the-coins/Mathematica/count-the-coins.mathematica rename to Task/Count-the-coins/Mathematica/count-the-coins.math diff --git a/Task/Count-the-coins/OCaml/count-the-coins.ocaml b/Task/Count-the-coins/OCaml/count-the-coins.ocaml new file mode 100644 index 0000000000..4220dbca06 --- /dev/null +++ b/Task/Count-the-coins/OCaml/count-the-coins.ocaml @@ -0,0 +1,14 @@ +let changes amount coins = + let ways = Array.make (amount + 1) 0L in + ways.(0) <- 1L; + List.iter (fun coin -> + for j = coin to amount do + ways.(j) <- Int64.add ways.(j) ways.(j - coin) + done + ) coins; + ways.(amount) + +let () = + Printf.printf "%Ld\n" (changes 1_00 [25; 10; 5; 1]); + Printf.printf "%Ld\n" (changes 1000_00 [100; 50; 25; 10; 5; 1]); +;; diff --git a/Task/Count-the-coins/PARI-GP/count-the-coins.pari b/Task/Count-the-coins/PARI-GP/count-the-coins.pari new file mode 100644 index 0000000000..58d84899b0 --- /dev/null +++ b/Task/Count-the-coins/PARI-GP/count-the-coins.pari @@ -0,0 +1,4 @@ +coins(v)=prod(i=1,#v,1/(1-'x^v[i])); +ways(v,n)=polcoeff(coins(v)+O('x^(n+1)),n); +ways([1,5,10,25],100) +ways([1,5,10,25,50,100],100000) diff --git a/Task/Count-the-coins/Perl-6/count-the-coins-1.pl6 b/Task/Count-the-coins/Perl-6/count-the-coins-1.pl6 new file mode 100644 index 0000000000..7c702f131b --- /dev/null +++ b/Task/Count-the-coins/Perl-6/count-the-coins-1.pl6 @@ -0,0 +1,13 @@ +sub ways-to-make-change($amount, @coins) { + my @cache = [1 xx @coins]; + + multi ways($n where $n >= 0, @now [$coin,*@later]) { + @cache[$n][+@later] //= ways($n - $coin, @now) + ways($n, @later); + } + multi ways($,@) { 0 } + + ways($amount, @coins.sort(-*)); # sort descending +} + +say ways-to-make-change 1_00, [1,5,10,25]; +say ways-to-make-change 1000_00, [1,5,10,25,50,100]; diff --git a/Task/Count-the-coins/Perl-6/count-the-coins-2.pl6 b/Task/Count-the-coins/Perl-6/count-the-coins-2.pl6 new file mode 100644 index 0000000000..9c0ff996db --- /dev/null +++ b/Task/Count-the-coins/Perl-6/count-the-coins-2.pl6 @@ -0,0 +1,13 @@ +sub ways-to-make-change-slowly(\n, @coins) { + my @table = [1 xx @coins], [0 xx @coins] xx n; + for 1..n X ^@coins -> \i, \j { + my \c = @coins[j]; + @table[i][j] = [+] + @table[i - c][j ] // 0, + @table[i ][j - 1] // 0; + } + @table[*-1][*-1]; +} + +say ways-to-make-change-slowly 1_00, [1,5,10,25]; +say ways-to-make-change-slowly 1000_00, [1,5,10,25,50,100]; diff --git a/Task/Count-the-coins/Run-BASIC/count-the-coins.run b/Task/Count-the-coins/Run-BASIC/count-the-coins.run new file mode 100644 index 0000000000..efc6cc6e58 --- /dev/null +++ b/Task/Count-the-coins/Run-BASIC/count-the-coins.run @@ -0,0 +1,13 @@ +for penny = 0 to 100 + for nickel = 0 to 20 + for dime = 0 to 10 + for quarter = 0 to 4 + if penny + nickel * 5 + dime * 10 + quarter * 25 = 100 then + print penny;" pennies ";nickel;" nickels "; dime;" dimes ";quarter;" quarters" + count = count + 1 + end if + next quarter + next dime + next nickel +next penny +print count;" ways to make a buck" diff --git a/Task/Count-the-coins/Seed7/count-the-coins.seed7 b/Task/Count-the-coins/Seed7/count-the-coins.seed7 new file mode 100644 index 0000000000..2a6c923f3d --- /dev/null +++ b/Task/Count-the-coins/Seed7/count-the-coins.seed7 @@ -0,0 +1,41 @@ +$ include "seed7_05.s7i"; + include "bigint.s7i"; + +const func bigInteger: changeCount (in integer: amountCents, in array integer: coins) is func + result + var bigInteger: waysToChange is 0_; + local + var array bigInteger: t is 0 times 0_; + var integer: pos is 0; + var integer: s is 0; + var integer: i is 0; + begin + t := length(coins) times 1_ & (length(coins) * amountCents) times 0_; + pos := length(coins) + 1; + for s range 1 to amountCents do + if coins[1] <= s then + t[pos] := t[pos - (length(coins) * coins[1])]; + end if; + incr(pos); + for i range 2 to length(coins) do + if coins[i] <= s then + t[pos] := t[pos - (length(coins) * coins[i])]; + end if; + t[pos] +:= t[pos - 1]; + incr(pos); + end for; + end for; + waysToChange := t[pos - 1]; + end func; + +const proc: main is func + local + const array integer: usCoins is [] (1, 5, 10, 25, 50, 100); + const array integer: euCoins is [] (1, 2, 5, 10, 20, 50, 100, 200); + begin + writeln(changeCount( 100, usCoins[.. 4])); + writeln(changeCount( 100000, usCoins)); + writeln(changeCount(1000000, usCoins)); + writeln(changeCount( 100000, euCoins)); + writeln(changeCount(1000000, euCoins)); + end func; diff --git a/Task/Create-a-file-on-magnetic-tape/TUSCRIPT/create-a-file-on-magnetic-tape.tuscript b/Task/Create-a-file-on-magnetic-tape/TUSCRIPT/create-a-file-on-magnetic-tape.tuscript new file mode 100644 index 0000000000..5a4c0ed999 --- /dev/null +++ b/Task/Create-a-file-on-magnetic-tape/TUSCRIPT/create-a-file-on-magnetic-tape.tuscript @@ -0,0 +1,3 @@ +$$ MODE TUSCRIPT +STATUS = CREATE ("tape.file",tape-o,-std-) +PRINT STATUS diff --git a/Task/Create-a-file-on-magnetic-tape/UNIX-Shell/create-a-file-on-magnetic-tape.sh b/Task/Create-a-file-on-magnetic-tape/UNIX-Shell/create-a-file-on-magnetic-tape.sh new file mode 100644 index 0000000000..401f7cced7 --- /dev/null +++ b/Task/Create-a-file-on-magnetic-tape/UNIX-Shell/create-a-file-on-magnetic-tape.sh @@ -0,0 +1,6 @@ +#!/bin/sh +cd # Make our home directory current +echo "Hello World!" > hello.jnk # Create a junk file +# tape rewind # Uncomment this to rewind the tape +tar c hello.jnk # Traditonal archivers use magnetic tape by default +# tar c hello.jnk > /dev/tape # With newer archivers redirection is needed diff --git a/Task/Create-a-file-on-magnetic-tape/ZX-Spectrum-Basic/create-a-file-on-magnetic-tape.zx b/Task/Create-a-file-on-magnetic-tape/ZX-Spectrum-Basic/create-a-file-on-magnetic-tape.zx new file mode 100644 index 0000000000..9db3fdebe4 --- /dev/null +++ b/Task/Create-a-file-on-magnetic-tape/ZX-Spectrum-Basic/create-a-file-on-magnetic-tape.zx @@ -0,0 +1 @@ +SAVE "TAPEFILE" CODE 16384,6912 diff --git a/Task/Create-a-file/BASIC/create-a-file.bas b/Task/Create-a-file/BASIC/create-a-file.basic similarity index 100% rename from Task/Create-a-file/BASIC/create-a-file.bas rename to Task/Create-a-file/BASIC/create-a-file.basic diff --git a/Task/Create-a-file/MAXScript/create-a-file.max b/Task/Create-a-file/MAXScript/create-a-file.maxscript similarity index 100% rename from Task/Create-a-file/MAXScript/create-a-file.max rename to Task/Create-a-file/MAXScript/create-a-file.maxscript diff --git a/Task/Create-a-file/Mathematica/create-a-file.mathematica b/Task/Create-a-file/Mathematica/create-a-file.math similarity index 100% rename from Task/Create-a-file/Mathematica/create-a-file.mathematica rename to Task/Create-a-file/Mathematica/create-a-file.math diff --git a/Task/Create-a-file/NetRexx/create-a-file.netrexx b/Task/Create-a-file/NetRexx/create-a-file.netrexx new file mode 100644 index 0000000000..140d7469ae --- /dev/null +++ b/Task/Create-a-file/NetRexx/create-a-file.netrexx @@ -0,0 +1,25 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +fName = ''; fName[0] = 2; fName[1] = '.' || File.separator || 'output.txt'; fName[2] = File.separator || 'output.txt' +dName = ''; dName[0] = 2; dName[1] = '.' || File.separator || 'docs'; dName[2] = File.separator || 'docs' + +do + loop i_ = 1 to fName[0] + say fName[i_] + fc = File(fName[i_]).createNewFile() + if fc then say 'File' fName[i_] 'created successfully.' + else say 'File' fName[i_] 'aleady exists.' + end i_ + + loop i_ = 1 to dName[0] + say dName[i_] + dc = File(dName[i_]).mkdir() + if dc then say 'Directory' dName[i_] 'created successfully.' + else say 'Directory' dName[i_] 'aleady exists.' + end i_ +catch iox = IOException + iox.printStackTrace +end + +return diff --git a/Task/Create-a-file/OCaml/create-a-file.ocaml b/Task/Create-a-file/OCaml/create-a-file.ocaml new file mode 100644 index 0000000000..22f21f1377 --- /dev/null +++ b/Task/Create-a-file/OCaml/create-a-file.ocaml @@ -0,0 +1,6 @@ +# let oc = open_out "output.txt" in + close_out oc;; +- : unit = () + +# Unix.mkdir "docs" 0o750 ;; (* rights 0o750 for rwxr-x--- *) +- : unit = () diff --git a/Task/Create-a-file/Objeck/create-a-file.objeck b/Task/Create-a-file/Objeck/create-a-file.objeck new file mode 100644 index 0000000000..d2582fb424 --- /dev/null +++ b/Task/Create-a-file/Objeck/create-a-file.objeck @@ -0,0 +1,16 @@ +use IO; + +bundle Default { + class FileExample { + function : Main(args : String[]) ~ Nil { + file := FileWriter->New("output.txt"); + file->Close(); + + file := FileWriter->New("/output.txt"); + file->Close(); + + Directory->Create("docs"); + Directory->Create("/docs"); + } + } +} diff --git a/Task/Create-a-file/Objective-C/create-a-file.m b/Task/Create-a-file/Objective-C/create-a-file.m new file mode 100644 index 0000000000..fc83fff575 --- /dev/null +++ b/Task/Create-a-file/Objective-C/create-a-file.m @@ -0,0 +1,7 @@ +NSFileManager *fm = [NSFileManager defaultManager]; + +[fm createFileAtPath:@"output.txt" contents:[NSData data] attributes:nil]; +// Pre-OS X 10.5 +[fm createDirectoryAtPath:@"docs" attributes:nil]; +// OS X 10.5+ +[fm createDirectoryAtPath:@"docs" withIntermediateDirectories:NO attributes:nil error:NULL]; diff --git a/Task/Create-a-file/Oz/create-a-file.oz b/Task/Create-a-file/Oz/create-a-file.oz new file mode 100644 index 0000000000..58b859640f --- /dev/null +++ b/Task/Create-a-file/Oz/create-a-file.oz @@ -0,0 +1,6 @@ +for Dir in ["/" "./"] do + File = {New Open.file init(name:Dir#"output.txt" flags:[create])} +in + {File close} + {OS.mkDir Dir#"docs" ['S_IRUSR' 'S_IWUSR' 'S_IXUSR' 'S_IXGRP']} +end diff --git a/Task/Create-a-file/PL-I/create-a-file.pli b/Task/Create-a-file/PL-I/create-a-file.pli new file mode 100644 index 0000000000..7febd8ded9 --- /dev/null +++ b/Task/Create-a-file/PL-I/create-a-file.pli @@ -0,0 +1,2 @@ +open file (output) title ('/OUTPUT.TXT,type(text),recsize(100)' ); +close file (output); diff --git a/Task/Create-a-file/Pascal/create-a-file.pascal b/Task/Create-a-file/Pascal/create-a-file.pascal new file mode 100644 index 0000000000..ed963e1cd8 --- /dev/null +++ b/Task/Create-a-file/Pascal/create-a-file.pascal @@ -0,0 +1,17 @@ +program in out; + +var + + f : textfile; + +begin + + assignFile(f,'/output.txt'); + rewrite(f); + close(f); + makedir('/docs'); + assignFile(f,'/docs/output.txt'); + rewrite(f); + close(f); + +end; diff --git a/Task/Create-a-file/Perl-6/create-a-file.pl6 b/Task/Create-a-file/Perl-6/create-a-file.pl6 new file mode 100644 index 0000000000..16f181b355 --- /dev/null +++ b/Task/Create-a-file/Perl-6/create-a-file.pl6 @@ -0,0 +1,4 @@ +for '.', '' -> $prefix { + mkdir "$prefix/docs"; + open "$prefix/output.txt", :w; +} diff --git a/Task/Create-a-file/Pike/create-a-file.pike b/Task/Create-a-file/Pike/create-a-file.pike new file mode 100644 index 0000000000..ca75d42654 --- /dev/null +++ b/Task/Create-a-file/Pike/create-a-file.pike @@ -0,0 +1,6 @@ +import Stdio; + +int main(){ + write_file("input.txt","",0100); + write_file("/input.txt","",0100); +} diff --git a/Task/Create-a-file/PowerShell/create-a-file.psh b/Task/Create-a-file/PowerShell/create-a-file.psh new file mode 100644 index 0000000000..366d66cad6 --- /dev/null +++ b/Task/Create-a-file/PowerShell/create-a-file.psh @@ -0,0 +1,4 @@ +New-Item output.txt -ItemType File +New-Item \output.txt -ItemType File +New-Item docs -ItemType Directory +New-Item \docs -ItemType Directory diff --git a/Task/Create-a-file/ProDOS/create-a-file.dos b/Task/Create-a-file/ProDOS/create-a-file.dos new file mode 100644 index 0000000000..05879a1afc --- /dev/null +++ b/Task/Create-a-file/ProDOS/create-a-file.dos @@ -0,0 +1,3 @@ +makedirectory docs +changedirectory docs +makenewfile output.txt diff --git a/Task/Create-a-file/PureBasic/create-a-file.purebasic b/Task/Create-a-file/PureBasic/create-a-file.purebasic new file mode 100644 index 0000000000..c89fc83d89 --- /dev/null +++ b/Task/Create-a-file/PureBasic/create-a-file.purebasic @@ -0,0 +1,4 @@ +CreateFile(0,"output.txt"):CloseFile(0) +CreateDirectory("docs") +CreateFile(0,"/output.txt"):CloseFile(0) +CreateDirectory("/docs") diff --git a/Task/Create-a-file/REBOL/create-a-file.rebol b/Task/Create-a-file/REBOL/create-a-file.rebol new file mode 100644 index 0000000000..87ca418884 --- /dev/null +++ b/Task/Create-a-file/REBOL/create-a-file.rebol @@ -0,0 +1,9 @@ +; Creating in current directory: + +write %output.txt "" +make-dir %docs/ + +; Creating in root directory: + +write %/output.txt "" +make-dir %/docs/ diff --git a/Task/Create-a-file/Raven/create-a-file.raven b/Task/Create-a-file/Raven/create-a-file.raven new file mode 100644 index 0000000000..d16b9ea591 --- /dev/null +++ b/Task/Create-a-file/Raven/create-a-file.raven @@ -0,0 +1,5 @@ +"" as str +str 'output.txt' write +str '/output.txt' write +'docs' mkdir +'/docs' mkdir diff --git a/Task/Create-a-file/Retro/create-a-file.retro b/Task/Create-a-file/Retro/create-a-file.retro new file mode 100644 index 0000000000..e47cc4ac51 --- /dev/null +++ b/Task/Create-a-file/Retro/create-a-file.retro @@ -0,0 +1,3 @@ +with files' +"output.txt" :w open close drop +"/output.txt" :w open close drop diff --git a/Task/Create-a-file/Run-BASIC/create-a-file.run b/Task/Create-a-file/Run-BASIC/create-a-file.run new file mode 100644 index 0000000000..f2c55ff2e7 --- /dev/null +++ b/Task/Create-a-file/Run-BASIC/create-a-file.run @@ -0,0 +1,8 @@ +open "output.txt" for output as #f +close #f + +dirOk = mkdir( "f:\doc") +if not(dirOk) then print "Directory not created!": end + +open "f:\doc\output.txt" for output as #f +close #f diff --git a/Task/Create-a-file/SNOBOL4/create-a-file.sno b/Task/Create-a-file/SNOBOL4/create-a-file.sno new file mode 100644 index 0000000000..ed429c4511 --- /dev/null +++ b/Task/Create-a-file/SNOBOL4/create-a-file.sno @@ -0,0 +1,8 @@ + output(.file,1,'output.txt'); endfile(1) ;* Macro Spitbol +* output(.file,1,,'output.txt'); endfile(1) ;* CSnobol + host(1,'mkdir docs') + + output(.file,1,'/output.txt'); endfile(1) ;* Macro Spitbol +* output(.file,1,,'/output.txt'); endfile(1) ;* CSnobol + host(1,'mkdir /docs') +end diff --git a/Task/Create-a-file/Seed7/create-a-file.seed7 b/Task/Create-a-file/Seed7/create-a-file.seed7 new file mode 100644 index 0000000000..755a9fcf51 --- /dev/null +++ b/Task/Create-a-file/Seed7/create-a-file.seed7 @@ -0,0 +1,14 @@ +$ include "seed7_05.s7i"; + include "osfiles.s7i"; + +const proc: main is func + local + var file: aFile is STD_NULL; + begin + aFile := open("output.txt", "w"); + close(aFile); + mkdir("docs"); + aFile := open("/output.txt", "w"); + close(aFile); + mkdir("/docs"); + end func; diff --git a/Task/Create-a-file/Slate/create-a-file-1.slate b/Task/Create-a-file/Slate/create-a-file-1.slate new file mode 100644 index 0000000000..af940b23c6 --- /dev/null +++ b/Task/Create-a-file/Slate/create-a-file-1.slate @@ -0,0 +1,2 @@ +(File newNamed: 'output.txt') touch. +(Directory current / 'output.txt') touch. diff --git a/Task/Create-a-file/Slate/create-a-file-2.slate b/Task/Create-a-file/Slate/create-a-file-2.slate new file mode 100644 index 0000000000..3e5cd5dc5f --- /dev/null +++ b/Task/Create-a-file/Slate/create-a-file-2.slate @@ -0,0 +1,2 @@ +(File newNamed: '/output.txt') touch. +(Directory root / 'output.txt') touch. diff --git a/Task/Create-a-file/Standard-ML/create-a-file.ml b/Task/Create-a-file/Standard-ML/create-a-file.ml new file mode 100644 index 0000000000..da5fde0710 --- /dev/null +++ b/Task/Create-a-file/Standard-ML/create-a-file.ml @@ -0,0 +1,5 @@ +let val out = TextIO.openOut "output.txt" in + TextIO.closeOut out +end; + +OS.FileSys.mkDir "docs"; diff --git a/Task/Create-a-file/TUSCRIPT/create-a-file.tuscript b/Task/Create-a-file/TUSCRIPT/create-a-file.tuscript new file mode 100644 index 0000000000..9b1659ddb4 --- /dev/null +++ b/Task/Create-a-file/TUSCRIPT/create-a-file.tuscript @@ -0,0 +1,5 @@ +$$ MODE TUSCRIPT +- create file +ERROR/STOP CREATE ("output.txt",FDF-o,-std-) +- create directory +ERROR/STOP CREATE ("docs",project,-std-) diff --git a/Task/Create-a-file/Toka/create-a-file.toka b/Task/Create-a-file/Toka/create-a-file.toka new file mode 100644 index 0000000000..74fc1b3bd8 --- /dev/null +++ b/Task/Create-a-file/Toka/create-a-file.toka @@ -0,0 +1,7 @@ +needs shell +" output.txt" "W" file.open file.close +" /output.txt" "W" file.open file.close + +( Create the directories with permissions set to 777) +" docs" &777 mkdir +" /docs" &777 mkdir diff --git a/Task/Create-a-file/UNIX-Shell/create-a-file-1.sh b/Task/Create-a-file/UNIX-Shell/create-a-file-1.sh new file mode 100644 index 0000000000..67270d68a6 --- /dev/null +++ b/Task/Create-a-file/UNIX-Shell/create-a-file-1.sh @@ -0,0 +1,3 @@ +touch output.txt /output.txt # create both output.txt and /output.txt +mkdir /docs +mkdir docs # create both /docs and docs diff --git a/Task/Create-a-file/UNIX-Shell/create-a-file-2.sh b/Task/Create-a-file/UNIX-Shell/create-a-file-2.sh new file mode 100644 index 0000000000..6e3f57b4d9 --- /dev/null +++ b/Task/Create-a-file/UNIX-Shell/create-a-file-2.sh @@ -0,0 +1,2 @@ +touch {/,}output.txt # create both /output.txt and output.txt +mkdir {/,}docs # create both /docs and docs diff --git a/Task/Create-a-file/Vedit-macro-language/create-a-file.vedit b/Task/Create-a-file/Vedit-macro-language/create-a-file.vedit new file mode 100644 index 0000000000..9be81473b5 --- /dev/null +++ b/Task/Create-a-file/Vedit-macro-language/create-a-file.vedit @@ -0,0 +1,7 @@ +// In current directory +File_Open("input.txt") Ins_Char(' ') Del_Char(-1) Buf_Close() +File_Mkdir("docs") + +// In the root directory +File_Open("/input.txt") Ins_Char(' ') Del_Char(-1) Buf_Close() +File_Mkdir("/docs") diff --git a/Task/Create-a-file/Visual-Basic-.NET/create-a-file.visual b/Task/Create-a-file/Visual-Basic-.NET/create-a-file.visual new file mode 100644 index 0000000000..567defb0d5 --- /dev/null +++ b/Task/Create-a-file/Visual-Basic-.NET/create-a-file.visual @@ -0,0 +1,11 @@ + 'Current Directory +IO.Directory.CreateDirectory("docs") +IO.File.Create("output.txt").Close() + + 'Root +IO.Directory.CreateDirectory("\docs") +IO.File.Create("\output.txt").Close() + + 'Root, platform independent +IO.Directory.CreateDirectory(IO.Path.DirectorySeparatorChar & "docs") +IO.File.Create(IO.Path.DirectorySeparatorChar & "output.txt").Close() diff --git a/Task/Create-a-file/X86-Assembly/create-a-file.x86 b/Task/Create-a-file/X86-Assembly/create-a-file.x86 new file mode 100644 index 0000000000..04309be5dd --- /dev/null +++ b/Task/Create-a-file/X86-Assembly/create-a-file.x86 @@ -0,0 +1,54 @@ +; syscall numbers for readability. :] + +%define sys_mkdir 39 +%define sys_creat 8 + +section .data + fName db 'doc/output.txt',0 + rfName db '/output.txt',0 + dName db 'doc',0 + + err_msg db "Something went wrong! :[",0xa + err_len equ $-err_msg + +section .text +global _start + +_start: + +nop + mov ebx, dName ; Directory name + mov eax, sys_mkdir ; Specify sys_mkdir call + mov ecx, 0750o ; permission (rwxr-x---) + int 0x80 ; Make kernel call + + mov ebx, fName ; File name + mov eax, sys_creat ; Specify sys_creat call + mov ecx, 0640o ; permission (rw-r-----) + int 0x80 ; Make kernel call + test eax, eax ; eax AND eax + js _ragequit ; If EAX is less than zero + ; THEN Display Message Error + + mov ebx, rfName ; File name Root + mov eax, sys_creat ; Specify sys_creat call + mov ecx, 0777o ; permission (rwxrwxrwx) + int 0x80 ; Make kernel call + cmp eax, 0 + jle _exit ; IF EAX is less or equal than zero + ; THEN jump to EXIT + ; ELSE Display Message Error + + _ragequit: + mov edx, err_len ; Pass offset of the message error + mov ecx, err_msg ; Pass the length of the message error + mov eax, 4 ; Specify sys_write call + mov ebx, 2 ; Specify File Descriptor 2: Error Output + int 0x80 ; Make kernel call + + _exit: + push 0x1 + mov eax, 1 ; Code for Exit Syscall + push eax + int 0x80 ; Make kernel call + ret diff --git a/Task/Create-a-file/ZX-Spectrum-Basic/create-a-file.zx b/Task/Create-a-file/ZX-Spectrum-Basic/create-a-file.zx new file mode 100644 index 0000000000..2f4b2d00f6 --- /dev/null +++ b/Task/Create-a-file/ZX-Spectrum-Basic/create-a-file.zx @@ -0,0 +1 @@ +SAVE "OUTPUT" CODE 16384,0 diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Component-Pascal/create-a-two-dimensional-array-at-runtime.pascal b/Task/Create-a-two-dimensional-array-at-runtime/Component-Pascal/create-a-two-dimensional-array-at-runtime.component similarity index 100% rename from Task/Create-a-two-dimensional-array-at-runtime/Component-Pascal/create-a-two-dimensional-array-at-runtime.pascal rename to Task/Create-a-two-dimensional-array-at-runtime/Component-Pascal/create-a-two-dimensional-array-at-runtime.component diff --git a/Task/Create-a-two-dimensional-array-at-runtime/MAXScript/create-a-two-dimensional-array-at-runtime.max b/Task/Create-a-two-dimensional-array-at-runtime/MAXScript/create-a-two-dimensional-array-at-runtime.maxscript similarity index 100% rename from Task/Create-a-two-dimensional-array-at-runtime/MAXScript/create-a-two-dimensional-array-at-runtime.max rename to Task/Create-a-two-dimensional-array-at-runtime/MAXScript/create-a-two-dimensional-array-at-runtime.maxscript diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Mathematica/create-a-two-dimensional-array-at-runtime.mathematica b/Task/Create-a-two-dimensional-array-at-runtime/Mathematica/create-a-two-dimensional-array-at-runtime.math similarity index 100% rename from Task/Create-a-two-dimensional-array-at-runtime/Mathematica/create-a-two-dimensional-array-at-runtime.mathematica rename to Task/Create-a-two-dimensional-array-at-runtime/Mathematica/create-a-two-dimensional-array-at-runtime.math diff --git a/Task/Create-a-two-dimensional-array-at-runtime/NetRexx/create-a-two-dimensional-array-at-runtime.netrexx b/Task/Create-a-two-dimensional-array-at-runtime/NetRexx/create-a-two-dimensional-array-at-runtime.netrexx new file mode 100644 index 0000000000..180ce47c20 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/NetRexx/create-a-two-dimensional-array-at-runtime.netrexx @@ -0,0 +1,12 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +say "give me the X and Y dimensions as two positive integers:" +parse ask xDim yDim +xPos = xDim % 2 -- integer divide to get close to the middle of the array +yPos = yDim % 2 + +arry = Rexx[xDim, yDim] +arry[xPos, yPos] = xDim / yDim -- make up a value... +say "arry["xPos","yPos"]:" arry[xPos, yPos] +return diff --git a/Task/Create-a-two-dimensional-array-at-runtime/OCaml/create-a-two-dimensional-array-at-runtime-1.ocaml b/Task/Create-a-two-dimensional-array-at-runtime/OCaml/create-a-two-dimensional-array-at-runtime-1.ocaml new file mode 100644 index 0000000000..7059fb41bd --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/OCaml/create-a-two-dimensional-array-at-runtime-1.ocaml @@ -0,0 +1,5 @@ +let nbr1 = read_int ();; +let nbr2 = read_int ();; +let array = Array.make_matrix nbr1 nbr2 0.0;; +array.(0).(0) <- 3.5;; +print_float array.(0).(0); print_newline ();; diff --git a/Task/Create-a-two-dimensional-array-at-runtime/OCaml/create-a-two-dimensional-array-at-runtime-2.ocaml b/Task/Create-a-two-dimensional-array-at-runtime/OCaml/create-a-two-dimensional-array-at-runtime-2.ocaml new file mode 100644 index 0000000000..e2f82f8912 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/OCaml/create-a-two-dimensional-array-at-runtime-2.ocaml @@ -0,0 +1,5 @@ +let nbr1 = read_int ();; +let nbr2 = read_int ();; +let arr = Bigarray.Array2.create Bigarray.float32 Bigarray.c_layout nbr1 nbr2 ;; +arr.{0,0} <- 3.5;; +print_float arr.{0,0}; print_newline ();; diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Objeck/create-a-two-dimensional-array-at-runtime.objeck b/Task/Create-a-two-dimensional-array-at-runtime/Objeck/create-a-two-dimensional-array-at-runtime.objeck new file mode 100644 index 0000000000..699f99fad9 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Objeck/create-a-two-dimensional-array-at-runtime.objeck @@ -0,0 +1,23 @@ +use IO; + +bundle Default { + class TwoDee { + function : Main(args : System.String[]) ~ Nil { + DoIt(); + } + + function : native : DoIt() ~ Nil { + Console->GetInstance()->Print("Enter x: "); + x := Console->GetInstance()->ReadString()->ToInt(); + + Console->GetInstance()->Print("Enter y: "); + y := Console->GetInstance()->ReadString()->ToInt(); + + if(x > 0 & y > 0) { + array : Int[,] := Int->New[x, y]; + array[0, 0] := 2; + array[0, 0]->PrintLine(); + }; + } + } +} diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Objective-C/create-a-two-dimensional-array-at-runtime.m b/Task/Create-a-two-dimensional-array-at-runtime/Objective-C/create-a-two-dimensional-array-at-runtime.m new file mode 100644 index 0000000000..022b18c387 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Objective-C/create-a-two-dimensional-array-at-runtime.m @@ -0,0 +1,28 @@ +#import + +int main() +{ + int num1, num2, i, j; + NSMutableArray *arr; + + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + scanf("%d %d", &num1, &num2); + + NSLog(@"%d %d", num1, num2); + + arr = [NSMutableArray arrayWithCapacity: (num1*num2)]; + // initialize it with 0s + for(i=0; i < (num1*num2); i++) [arr addObject: [NSNumber numberWithInt: 0]]; + + // replace 0s with something more interesting + for(i=0; i < num1; i++) { + for(j=0; j < num2; j++) { + [arr replaceObjectAtIndex: (i*num2+j) withObject: [NSNumber numberWithInt: (i*j)]]; + } + } + + // access a value: i*num2+j, where i,j are the indexes for the bidimensional array + NSLog(@"%@", [arr objectAtIndex: (1*num2+3)]); + [pool release]; + return 0; +} diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Oz/create-a-two-dimensional-array-at-runtime.oz b/Task/Create-a-two-dimensional-array-at-runtime/Oz/create-a-two-dimensional-array-at-runtime.oz new file mode 100644 index 0000000000..17fef9edca --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Oz/create-a-two-dimensional-array-at-runtime.oz @@ -0,0 +1,15 @@ +declare + %% Read width and height from stdin + class TextFile from Open.file Open.text end + StdIn = {New TextFile init(name:stdin)} + Width = {String.toInt {StdIn getS($)}} + Height = {String.toInt {StdIn getS($)}} + %% create array + Arr = {Array.new 1 Width unit} +in + for X in 1..Width do + Arr.X := {Array.new 1 Height 0} + end + %% set and read element + Arr.1.1 := 42 + {Show Arr.1.1} diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PARI-GP/create-a-two-dimensional-array-at-runtime.pari b/Task/Create-a-two-dimensional-array-at-runtime/PARI-GP/create-a-two-dimensional-array-at-runtime.pari new file mode 100644 index 0000000000..beeeeed003 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PARI-GP/create-a-two-dimensional-array-at-runtime.pari @@ -0,0 +1,5 @@ +tmp(m,n)={ + my(M=matrix(m,n,i,j,0)); + M[1,1]=1; + M[1,1] +}; diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-1.pli b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-1.pli new file mode 100644 index 0000000000..81b17114f1 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-1.pli @@ -0,0 +1,12 @@ +/* First way using a controlled variable: */ + +declare A(*,*) float controlled; +get list (m, n); +allocate A(m,n); +get list (A); +put skip list (A); + +/* The array remains allocated until the program terminates, */ +/* or until explicitly destroyed using a FREE statement. */ + +free A; diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-2.pli b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-2.pli new file mode 100644 index 0000000000..8b9a80b59e --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-2.pli @@ -0,0 +1,2 @@ + 6.00000E+0000 5.00000E+0000 4.00000E+0000 3.00000E+0000 2.00000E+0000 + 1.00000E+0000 diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-3.pli b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-3.pli new file mode 100644 index 0000000000..b3ef84f4b6 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-3.pli @@ -0,0 +1,10 @@ +/* Second way using a BEGIN block: */ + +get list (m, n); +begin; + declare A(m, n) float; + get list (A); + put skip list (A); +end; + +/* The array is automatically destroyed when the block terminates. */ diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-4.pli b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-4.pli new file mode 100644 index 0000000000..f161ca0e76 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-4.pli @@ -0,0 +1,3 @@ + 1.00000E+0000 2.00000E+0000 3.00000E+0000 4.00000E+0000 5.00000E+0000 + 6.00000E+0000 7.00000E+0000 8.00000E+0000 9.00000E+0000 1.00000E+0001 + 1.10000E+0001 1.20000E+0002 diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-5.pli b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-5.pli new file mode 100644 index 0000000000..bacebc8cb3 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-5.pli @@ -0,0 +1,11 @@ +/* Third way using a PROCEDURE block: */ + +get list (m, n); +call S (m, n); +S: procedure (m, n); + declare A(m, n) float; + get list (A); + put skip list (A); +end S; + +/* The array is automatically destroyed when the procedure terminates. */ diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-6.pli b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-6.pli new file mode 100644 index 0000000000..f278199a7a --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PL-I/create-a-two-dimensional-array-at-runtime-6.pli @@ -0,0 +1,4 @@ + 1.00000E+0000 2.00000E+0000 3.00000E+0000 4.00000E+0000 5.00000E+0000 + 6.00000E+0000 7.00000E+0000 8.00000E+0000 9.00000E+0000 1.00000E+0001 + 1.10000E+0001 1.20000E+0001 1.30000E+0001 1.40000E+0001 1.50000E+0001 + 1.60000E+0001 1.70000E+0001 1.80000E+0001 1.90000E+0001 2.00000E+0001 diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Pascal/create-a-two-dimensional-array-at-runtime.pascal b/Task/Create-a-two-dimensional-array-at-runtime/Pascal/create-a-two-dimensional-array-at-runtime.pascal new file mode 100644 index 0000000000..acbc330ffe --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Pascal/create-a-two-dimensional-array-at-runtime.pascal @@ -0,0 +1,26 @@ +program array2d(input, output); + +type + tArray2d(dim1, dim2: integer) = array[1 .. dim1, 1 .. dim2] of real; + pArray2D = ^tArray2D; + +var + d1, d2: integer; + data: pArray2D; + +begin + { read values } + readln(d1, d2); + + { create array } + new(data, d1, d2); + + { write element } + data^[1,1] := 3.5; + + { output element } + writeln(data^[1,1]); + + { get rid of array } + dispose(data); +end. diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Perl-6/create-a-two-dimensional-array-at-runtime-1.pl6 b/Task/Create-a-two-dimensional-array-at-runtime/Perl-6/create-a-two-dimensional-array-at-runtime-1.pl6 new file mode 100644 index 0000000000..afa1ea42d0 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Perl-6/create-a-two-dimensional-array-at-runtime-1.pl6 @@ -0,0 +1,4 @@ +my ($major,$minor) = prompt("Dimensions? ").comb(/\d+/); +my @array := [ for ^$major { [ for ^$minor {'@'} ] } ]; +@array[ pick 1, ^$major ][ pick 1, ^$minor ] = ' '; +.say for @array; diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Perl-6/create-a-two-dimensional-array-at-runtime-2.pl6 b/Task/Create-a-two-dimensional-array-at-runtime/Perl-6/create-a-two-dimensional-array-at-runtime-2.pl6 new file mode 100644 index 0000000000..51bd3eac13 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Perl-6/create-a-two-dimensional-array-at-runtime-2.pl6 @@ -0,0 +1,7 @@ +$ ./two-dee +Dimensions? 5x35 +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ +@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Pop11/create-a-two-dimensional-array-at-runtime.pop11 b/Task/Create-a-two-dimensional-array-at-runtime/Pop11/create-a-two-dimensional-array-at-runtime.pop11 new file mode 100644 index 0000000000..aad03a662f --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Pop11/create-a-two-dimensional-array-at-runtime.pop11 @@ -0,0 +1,12 @@ +vars itemrep; +incharitem(charin) -> itemrep; +;;; Read sizes +vars n1 = itemrep(), n2= itemrep(); +;;; Create 0 based array +vars ar = newarray([0 ^(n1 - 1) 0 ^(n2 - 1)], 0); +;;; Set element value +15 -> ar(0, 0); +;;; Print element value +ar(0,0) => +;;; Make sure array is unreferenced +0 -> ar; diff --git a/Task/Create-a-two-dimensional-array-at-runtime/PureBasic/create-a-two-dimensional-array-at-runtime.purebasic b/Task/Create-a-two-dimensional-array-at-runtime/PureBasic/create-a-two-dimensional-array-at-runtime.purebasic new file mode 100644 index 0000000000..e030dd4fee --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/PureBasic/create-a-two-dimensional-array-at-runtime.purebasic @@ -0,0 +1,17 @@ +If OpenConsole() + Define x, y + + Print("Input X-Size: ") + x = Val(Input()) + + Print("Input Y-Size: ") + y = Val(Input()) + + Dim a(x,y) ; Should really check if x & y are larger then 1, but that would be less fun.... + + a(1,1)=Random(1000) + PrintN("a(1,1)= " + Str(a(1,1)) ) + + PrintN("Press ENTER to exit"):Input() + End ; Close down and let PureBasic delete the Console and all variables. +EndIf diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Run-BASIC/create-a-two-dimensional-array-at-runtime.run b/Task/Create-a-two-dimensional-array-at-runtime/Run-BASIC/create-a-two-dimensional-array-at-runtime.run new file mode 100644 index 0000000000..3ac16df2af --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Run-BASIC/create-a-two-dimensional-array-at-runtime.run @@ -0,0 +1,9 @@ +print "Enter array 1 greater than 0"; : input a1 +print "Enter array 2 greater than 0"; : input a2 + +dim chrArray$(max(a1,1),max(a2,1)) +dim numArray(max(a1,1),max(a2,1)) + +chrArray$(1,1) = "Hello" +numArray(1,1) = 987.2 +print chrArray$(1,1);" ";numArray(1,1) diff --git a/Task/Create-a-two-dimensional-array-at-runtime/SNOBOL4/create-a-two-dimensional-array-at-runtime.sno b/Task/Create-a-two-dimensional-array-at-runtime/SNOBOL4/create-a-two-dimensional-array-at-runtime.sno new file mode 100644 index 0000000000..f25018f1d1 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/SNOBOL4/create-a-two-dimensional-array-at-runtime.sno @@ -0,0 +1,21 @@ +* # Get user X,Y dimensions + output = 'Enter X,Y:'; xy = trim(input) + xy break(',') . x ',' rem . y + +* # Define and create array, 1-based + arr = array(x ',' y) ;* Or arr = array(xy) + +* # Display array prototype + output = 'Prototype: ' prototype(arr) + +* # Assign elements, angle or square brackets +* # Same array can hold ints, strings, etc. + arr = 99; arr[1,1] = 'dog' + +* # Display elements + output = 'arr[' xy '] = ' arr[x,y] + output = 'arr[1,1] = ' arr[1,1] + +* # Release array for garbage collection + arr = +end diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Seed7/create-a-two-dimensional-array-at-runtime.seed7 b/Task/Create-a-two-dimensional-array-at-runtime/Seed7/create-a-two-dimensional-array-at-runtime.seed7 new file mode 100644 index 0000000000..c7ad9413fe --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Seed7/create-a-two-dimensional-array-at-runtime.seed7 @@ -0,0 +1,16 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: numRows is 0; + var integer: numCols is 0; + var array array integer: anArray is 0 times 0 times 0; + begin + write("Give me the numer of rows: "); + readln(numRows); + write("Give me the numer of columns: "); + readln(numCols); + anArray := numRows times numCols times 0; + anArray[1][1] := 3; + writeln("The number at place [1, 1] is " <& anArray[1][1]); + end func; diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Standard-ML/create-a-two-dimensional-array-at-runtime.ml b/Task/Create-a-two-dimensional-array-at-runtime/Standard-ML/create-a-two-dimensional-array-at-runtime.ml new file mode 100644 index 0000000000..6607b13bf6 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Standard-ML/create-a-two-dimensional-array-at-runtime.ml @@ -0,0 +1,5 @@ +val nbr1 = valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn); +val nbr2 = valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn); +val array = Array2.array (nbr1, nbr2, 0.0); +Array2.update (array, 0, 0, 3.5); +print (Real.toString (Array2.sub (array, 0, 0)) ^ "\n"); diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Toka/create-a-two-dimensional-array-at-runtime-1.toka b/Task/Create-a-two-dimensional-array-at-runtime/Toka/create-a-two-dimensional-array-at-runtime-1.toka new file mode 100644 index 0000000000..4a1a00e2b8 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Toka/create-a-two-dimensional-array-at-runtime-1.toka @@ -0,0 +1,14 @@ +[ ( x y -- address ) + cells malloc >r + dup cells >r + [ r> r> r> 2dup >r >r swap malloc swap i swap array.put >r ] iterate +r> r> nip +] is 2D-array + +[ ( a b address -- value ) + array.get array.get +] is 2D-get-element + +[ ( value a b address -- ) + array.get array.put +] is 2D-put-element diff --git a/Task/Create-a-two-dimensional-array-at-runtime/Toka/create-a-two-dimensional-array-at-runtime-2.toka b/Task/Create-a-two-dimensional-array-at-runtime/Toka/create-a-two-dimensional-array-at-runtime-2.toka new file mode 100644 index 0000000000..9015dbe7e7 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/Toka/create-a-two-dimensional-array-at-runtime-2.toka @@ -0,0 +1,4 @@ +5 5 2D-array >r #! Create an array and save the pointer to it +10 2 3 r@ 2D-put-element #! Set element 2,3 to 10 +2 3 r@ 2D-get-element #! Get the element at 2,3 +r> drop #! Discard the pointer to the array diff --git a/Task/Create-a-two-dimensional-array-at-runtime/XPL0/create-a-two-dimensional-array-at-runtime.xpl0 b/Task/Create-a-two-dimensional-array-at-runtime/XPL0/create-a-two-dimensional-array-at-runtime.xpl0 new file mode 100644 index 0000000000..1b9eba0893 --- /dev/null +++ b/Task/Create-a-two-dimensional-array-at-runtime/XPL0/create-a-two-dimensional-array-at-runtime.xpl0 @@ -0,0 +1,9 @@ +inc c:\cxpl\codes; \(command words can be abbreviated to first 3 letters) +def IntSize=4; \number of bytes in an integer (2 or 4 depending on version) +int X, Y, A, I; +[X:= IntIn(0); Y:= IntIn(0); \get 2 dimensions from user +A:= Reserve(X*IntSize); +for I:= 0 to X-1 do A(I):= Reserve(Y*IntSize); +A(X/2, Y/2):= X+Y; +IntOut(0, A(X/2, Y/2)); CrLf(0); +] diff --git a/Task/Create-an-HTML-table/CoffeeScript/create-an-html-table.coffee b/Task/Create-an-HTML-table/CoffeeScript/create-an-html-table.coffeescript similarity index 100% rename from Task/Create-an-HTML-table/CoffeeScript/create-an-html-table.coffee rename to Task/Create-an-HTML-table/CoffeeScript/create-an-html-table.coffeescript diff --git a/Task/Create-an-HTML-table/Mathematica/create-an-html-table.mathematica b/Task/Create-an-HTML-table/Mathematica/create-an-html-table.math similarity index 100% rename from Task/Create-an-HTML-table/Mathematica/create-an-html-table.mathematica rename to Task/Create-an-HTML-table/Mathematica/create-an-html-table.math diff --git a/Task/Create-an-HTML-table/NetRexx/create-an-html-table-1.netrexx b/Task/Create-an-HTML-table/NetRexx/create-an-html-table-1.netrexx new file mode 100644 index 0000000000..2e7a274fd6 --- /dev/null +++ b/Task/Create-an-HTML-table/NetRexx/create-an-html-table-1.netrexx @@ -0,0 +1,121 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +-- create some test data. Put the data in a Rexx indexed string +maxI = 1000 +rng = Random() +xyz = '' +xyz[0] = 1; xyz[1] = '. X Y Z' -- use a dot to indicate an empty cell +loop r_ = 1 for 5 + ra = r_ rng.nextInt(maxI) rng.nextInt(maxI) rng.nextInt(maxI) + xyz[0] = r_ + 1; xyz[r_ + 1] = ra + end r_ + +-- build an HTML string +html = htmlHeader() +html = html || htmlTable(xyz) +html = html || htmlFooter() + +-- display HTML at standard output device +say html + +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- HTML boilerplate header +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method htmlHeader() public static returns Rexx + html = '\n' - + || '\n' - + || '\n' - + || '\n' - + || '\n' - + || 'RCreateHTMLTable\n' - + || '\n' - + || '\n' - + || '\n' - + || '

Rosetta Code – NetRexx Sample Output

\n' - + || '
\n' - + || '' + + return html + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- HTML footer +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method htmlFooter() public static returns Rexx + html = '\n' - + || '\n' - + || '' + return html + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Create the table +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method htmlTable(rows, caption = '') public static returns Rexx + html = '\n' + if caption.length() > 0 then do + html = html - + || '\n' - + || '\n' - + || '' + end + html = html - + || htmlCsvTableRow(rows[1], 'th')'\n' - + || '\n' - + || '\n' - + || '' + loop r_ = 2 to rows[0] + html = html - + || htmlCsvTableRow(rows[r_]) + end r_ + html = html - + || '\n' - + || '
'caption'
\n' - + || '' + return html + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Add a row to the table +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method htmlCsvTableRow(row, tag = 'td', sep = ' ', emptyCell = '.') public static returns Rexx + if tag = null then tag = 'td' + row = row.strip('t') + -- replace HTML special characters with symbol entities + row = row.changestr('&', '&') -- need to do this one first to avoid double translation + row = row.changestr('"', '"') + row = row.changestr("'", ''') + row = row.changestr('<', '<') + row = row.changestr('>', '>') + elmts = '' + elmts[0] = 0 + e_ = 0 + loop while row.length() > 0 + parse row elmt (sep) row + if elmt == emptyCell then elmt = ' ' -- replace empy cells with non-breaking spaces + e_ = e_ + 1; elmts[0] = e_; elmts[e_] = elmt + end + html = '\n' - + || '' + loop e_ = 1 to elmts[0] + html = html - + || '<'tag'>'elmts[e_]'\n' - + || '' + end e_ + html = html - + || '\n' - + || '' + return html diff --git a/Task/Create-an-HTML-table/NetRexx/create-an-html-table-2.netrexx b/Task/Create-an-HTML-table/NetRexx/create-an-html-table-2.netrexx new file mode 100644 index 0000000000..a891a4fb6b --- /dev/null +++ b/Task/Create-an-HTML-table/NetRexx/create-an-html-table-2.netrexx @@ -0,0 +1,68 @@ + + + + + +RCreateHTMLTable + + + +

Rosetta Code – NetRexx Sample Output

+

Create an HTML table

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 XYZ
1626128386
2985568636
3639622591
4843268436
5132526251
+ + diff --git a/Task/Create-an-HTML-table/NewLISP/create-an-html-table.newlisp b/Task/Create-an-HTML-table/NewLISP/create-an-html-table.newlisp new file mode 100644 index 0000000000..55f15061cd --- /dev/null +++ b/Task/Create-an-HTML-table/NewLISP/create-an-html-table.newlisp @@ -0,0 +1,56 @@ +; file: html-table.lsp +; url: http://rosettacode.org/wiki/Create_an_HTML_table +; author: oofoe 2012-01-29 + +(seed (time-of-day)) ; Initialize random number generator. + +; The "tab" variable tracks the HTML indent. "pad" composes a line +; with the appropriate indent and a terminal newline. + +(setq tab 0) +(define (pad text) (string (dup " " tab) text "\n")) + +; NewLISP allows almost any character in an identifier, so I can name +; my functions after the HTML elements they invoke. This one formats a +; single table data cell. + +(define ( text) (pad (string "" text ""))) + +; "" will accept either a number of arguments, each one to be +; formatted as a table cell, or a single list argument, which is +; broken into table cells. For convenience, I format each list item +; with the "" function so I can feed it raw lists. + +(define () + (let ((data (args)) + (s (pad ""))) + + (if (list? (data 0)) (setq data (data 0))) + + (inc tab) + (dolist (el data) (extend s ( el))) + (dec tab) + + (extend s (pad "")) + s)) + +; By defining "" as a macro, I ensure that the rows won't be +; evaluated until I've got the table started, which preserves the +; formatting. + +(define-macro (
) + (let ((s (pad "
"))) + (inc tab) (doargs (row) (extend s (eval row))) (dec tab) + (extend s (pad "
")) + s + )) + +; Test + +(print ( ( "" "X" "Y" "Z") + ( (cons 0 (rand 1000 3))) + ( (cons 1 (rand 1000 3))) + ( (cons 2 (rand 1000 3))) + )) + +(exit) diff --git a/Task/Create-an-HTML-table/OCaml/create-an-html-table-1.ocaml b/Task/Create-an-HTML-table/OCaml/create-an-html-table-1.ocaml new file mode 100644 index 0000000000..c66221fe53 --- /dev/null +++ b/Task/Create-an-HTML-table/OCaml/create-an-html-table-1.ocaml @@ -0,0 +1,23 @@ +let () = + let buf = Buffer.create 1 in + let s = Buffer.add_string buf in + Random.self_init(); + s "
"; + s ""; + s ""; + List.iter (fun v -> + s ("") + ) ["X"; "Y"; "Z"]; + s ""; + s ""; + s ""; + for i = 0 to pred 3 do + s (""); + for j = 0 to pred 3 do + s (""); + done; + s ""; + done; + s ""; + s "
" ^ v ^ "
" ^ string_of_int i ^ "" ^ string_of_int (Random.int 1000) ^ "
"; + print_endline (Buffer.contents buf) diff --git a/Task/Create-an-HTML-table/OCaml/create-an-html-table-2.ocaml b/Task/Create-an-HTML-table/OCaml/create-an-html-table-2.ocaml new file mode 100644 index 0000000000..3d1514a4a7 --- /dev/null +++ b/Task/Create-an-HTML-table/OCaml/create-an-html-table-2.ocaml @@ -0,0 +1,39 @@ +open XHTML.M_01_01 + +let _td s = td [pcdata s] +let _th s = th [pcdata s] + +let my_table = + table ~a:[a_border 1] + (tr + (_th "") [ + (_th "X"); + (_th "Y"); + (_th "Z")] + ) + [ + (tr + (_td "1") [ + (_td "aa"); + (_td "bb"); + (_td "cc")] + ); + (tr + (_td "2") [ + (_td "dd"); + (_td "ee"); + (_td "ff")] + ); + ] + +let my_page = + html + (head (title (pcdata "My Page")) []) + (body + [ h1 [pcdata "My Table"]; + my_table; + ] + ) + +let () = + pretty_print ~width:80 print_string my_page diff --git a/Task/Create-an-HTML-table/OCaml/create-an-html-table-3.ocaml b/Task/Create-an-HTML-table/OCaml/create-an-html-table-3.ocaml new file mode 100644 index 0000000000..b67a95ee37 --- /dev/null +++ b/Task/Create-an-HTML-table/OCaml/create-an-html-table-3.ocaml @@ -0,0 +1,25 @@ +#use "topfind" +#require "tyxml" + +module X = XHTML.M_01_01 (* XHTML 1.1 *) +module P = XHTML.P_01_01 + +let make_table () = + let td1 = X.td [X.pcdata "1"] in + let td2 = X.td [X.pcdata "2"] in + let td3 = X.td [X.pcdata "3"] in + let my_tr = X.tr td1 [td2; td3] in + let my_table = X.table my_tr [] in + (my_table) + +let () = + let my_title = X.title (X.pcdata "My Page") in + let my_head = X.head my_title [] in + let my_h1 = X.h1 [X.pcdata "My Table"] in + + let my_table = make_table () in + + let my_body = X.body [my_h1; my_table] in + let my_html = X.html my_head my_body in + P.print print_endline my_html; +;; diff --git a/Task/Create-an-HTML-table/OCaml/create-an-html-table-4.ocaml b/Task/Create-an-HTML-table/OCaml/create-an-html-table-4.ocaml new file mode 100644 index 0000000000..b004f72461 --- /dev/null +++ b/Task/Create-an-HTML-table/OCaml/create-an-html-table-4.ocaml @@ -0,0 +1,11 @@ +let make_table () = + let br = X.a_border 1 in + let th s = X.th [X.pcdata s] in + let td s = X.td [X.pcdata s] in + let my_thead = X.thead (X.tr (th "") [th "X"; th "Y"; th "Z"]) [] in + let my_tr1 = X.tr (td "1") [td "AAA"; td "BBB"; td "CCC"] in + let my_tr2 = X.tr (td "2") [td "DDD"; td "EEE"; td "FFF"] in + let my_tr3 = X.tr (td "3") [td "GGG"; td "HHH"; td "III"] in + let my_tbody = X.tbody my_tr1 [my_tr2; my_tr3] in + let my_table = X.tablex ~thead:my_thead ~a:[br] my_tbody [] in + (my_table) diff --git a/Task/Create-an-HTML-table/Oz/create-an-html-table.oz b/Task/Create-an-HTML-table/Oz/create-an-html-table.oz new file mode 100644 index 0000000000..8d353080da --- /dev/null +++ b/Task/Create-an-HTML-table/Oz/create-an-html-table.oz @@ -0,0 +1,41 @@ +declare + +[Roads] = {Module.link ['x-ozlib://wmeyer/roads/Roads.ozf']} + +fun {Table Session} + html( + head(title("Show a table with row and column headings") + style(type:"text/css" + css(td 'text-align':center) + )) + body( + {TagFromList table + tr(th th("X") th("Y") th("Z")) + | + {CreateRows 3 5} + })) +end + +fun {CreateRows NumCols NumRows} + {List.map {List.number 1 NumRows 1} + fun {$ Row} + {TagFromList tr + td( {Int.toString Row} ) + | + {List.map {List.number 1 NumCols 1} + fun {$ Col} + SequentialNumber = (Row-1)*NumCols + Col + in + td( {Int.toString SequentialNumber} ) + end + }} + end + } +end + +TagFromList = List.toTuple + +in + +{Roads.registerFunction table Table} +{Roads.run} diff --git a/Task/Create-an-HTML-table/PARI-GP/create-an-html-table-1.pari b/Task/Create-an-HTML-table/PARI-GP/create-an-html-table-1.pari new file mode 100644 index 0000000000..1391aed062 --- /dev/null +++ b/Task/Create-an-HTML-table/PARI-GP/create-an-html-table-1.pari @@ -0,0 +1,9 @@ +html(n=3)={ + print("\n"); + for(i=1,n, + print1(""); + for(j=1,3,print1("")); + print("") + ); + print("
XYZ
"i""random(9999)"
") +}; diff --git a/Task/Create-an-HTML-table/PARI-GP/create-an-html-table-2.pari b/Task/Create-an-HTML-table/PARI-GP/create-an-html-table-2.pari new file mode 100644 index 0000000000..61f59cd536 --- /dev/null +++ b/Task/Create-an-HTML-table/PARI-GP/create-an-html-table-2.pari @@ -0,0 +1 @@ +printtex(matrix(4,4,i,j,if(i==1,if(j==1,"",Strchr(86+j)),if(j==1,i,random(9999))))) diff --git a/Task/Create-an-HTML-table/PL-I/create-an-html-table.pli b/Task/Create-an-HTML-table/PL-I/create-an-html-table.pli new file mode 100644 index 0000000000..ae6b4f6e35 --- /dev/null +++ b/Task/Create-an-HTML-table/PL-I/create-an-html-table.pli @@ -0,0 +1,44 @@ +/* Create an HTML table. 6/2011 */ + +create: procedure options (main); + + +create_table: procedure (headings, table_contents); + + declare headings(*) character (10) varying; + declare table_contents(*, *) fixed; + declare (i, row, col) fixed; + + put skip edit ('') (a); + /* Headings. */ + put skip edit (' ') (a); + /* For an empty column heading */ + do i = 1 to hbound(headings); + put edit (' ' ) (a); + end; + put edit ('') (a); + + /* Table contents. */ + + do row = 1 to hbound(table_contents, 1); + /* row number */ + put skip edit (' ') (a); + /* row contents */ + do col = 1 to hbound(table_contents, 2); + put edit (' ' ) (a); + end; + put edit ('') (a); + end; + put skip edit ('
', headings(i), '
', row, '', table_contents(row, col), '
' ) (a); +end create_table; + + declare headings (3) character (1) static initial ('X', 'Y', 'Z'); + + declare table_contents(3, 3) fixed static initial ( + 4, -3, 8, + 7, 2, -6, + 11, 1, 15); + + call create_table (headings, table_contents); + +end create; diff --git a/Task/Create-an-HTML-table/Perl-6/create-an-html-table.pl6 b/Task/Create-an-HTML-table/Perl-6/create-an-html-table.pl6 new file mode 100644 index 0000000000..e122912be8 --- /dev/null +++ b/Task/Create-an-HTML-table/Perl-6/create-an-html-table.pl6 @@ -0,0 +1,13 @@ +my @header = <  X Y Z>; +my $rows = 5; + +sub tag ($tag, $string, $param?) { return "<$tag" ~ ($param ?? " $param" !! '') ~ ">$string" ~ "" }; + +my $table = tag('tr', ( tag('th', $_) for @header)); + +for 1 .. $rows -> $row { + $table ~= tag('tr', ( tag('td', $row, 'align="right"') + ~ (tag('td', (^10000).pick, 'align="right"') for 1..^@header))); +} + +say tag('table', $table, 'cellspacing=4 style="text-align:right; border: 1px solid;"'); diff --git a/Task/Create-an-HTML-table/Protium/create-an-html-table.protium b/Task/Create-an-HTML-table/Protium/create-an-html-table.protium new file mode 100644 index 0000000000..45b01ab02e --- /dev/null +++ b/Task/Create-an-HTML-table/Protium/create-an-html-table.protium @@ -0,0 +1,17 @@ +<@ SDCLIT> + <@ DTBLIT> + <@ DTRLITLIT> + <@ DTDLITLIT>|[style]background-color:white + <@ DTD>X + <@ DTD>Y + <@ DTD>Z|[style]width:100%; background-color:brown;color:white; text-align:center + <@ ITEFORLIT>10| + <@ DTRLITCAP> + <@ DTDPOSFORLIT>...|[style]background-color:Brown; color:white; text-align:right + <@ DTDCAPLIT><@ SAYR!ILI2>1|9999|[style]width:50;text-align:right + <@ DTDCAPLIT><@ SAYR!ILI2>1|9999|[style]width:50;text-align:right + <@ DTDCAPLIT><@ SAYR!ILI2>1|9999|[style]width:50;text-align:right + |[style]background-color:white;color:black + + +|Number Table diff --git a/Task/Create-an-HTML-table/Rascal/create-an-html-table-1.rascal b/Task/Create-an-HTML-table/Rascal/create-an-html-table-1.rascal new file mode 100644 index 0000000000..6d7cfdfdd8 --- /dev/null +++ b/Task/Create-an-HTML-table/Rascal/create-an-html-table-1.rascal @@ -0,0 +1,18 @@ +import IO; +import util::Math; + +str html(str title, str content) = item("html", item("title", title) + item("body", content)); +str item(str op, str content) = "\<\>\\>"; +str table(str content) = item("table border=\"0\"", content); +str tr(str content) = item("tr", content); +str td(str content) = item("td", content); + +public str generateTable(int rows){ + int i(){return arbInt(10000);}; + rows = (tr(td("")+td("X")+td("Y")+td("Z")) + | it + tr(td("")+td("")+td("")+td("")) + | x <- [1..rows]); + writeFile(|file:///location|, + html("Rosetta Code Table", table(rows))); + return "written"; +} diff --git a/Task/Create-an-HTML-table/Rascal/create-an-html-table-2.rascal b/Task/Create-an-HTML-table/Rascal/create-an-html-table-2.rascal new file mode 100644 index 0000000000..fdfa2c4bb3 --- /dev/null +++ b/Task/Create-an-HTML-table/Rascal/create-an-html-table-2.rascal @@ -0,0 +1,2 @@ +rascal>generateTable(10) +str: "written" diff --git a/Task/Create-an-HTML-table/Rascal/create-an-html-table-3.rascal b/Task/Create-an-HTML-table/Rascal/create-an-html-table-3.rascal new file mode 100644 index 0000000000..edfcf8af1f --- /dev/null +++ b/Task/Create-an-HTML-table/Rascal/create-an-html-table-3.rascal @@ -0,0 +1 @@ +Rosetta Code Table
XYZ
125339883208
2315201447
374933791076
424132111848
5116056469
659912431189
774147092854
89184827160
94515726229
1095579709684
diff --git a/Task/Create-an-HTML-table/Retro/create-an-html-table.retro b/Task/Create-an-HTML-table/Retro/create-an-html-table.retro new file mode 100644 index 0000000000..4e29aca2ba --- /dev/null +++ b/Task/Create-an-HTML-table/Retro/create-an-html-table.retro @@ -0,0 +1,13 @@ +needs casket::html' +with casket::html' + +: rnd ( -$ ) random 1000 mod toString ; + +[ [ [ ] td [ "x" ] td [ "y" ] td [ "z" ] td ] tr + [ [ "1" ] td [ rnd ] td [ rnd ] td [ rnd ] td ] tr + [ [ "2" ] td [ rnd ] td [ rnd ] td [ rnd ] td ] tr + [ [ "3" ] td [ rnd ] td [ rnd ] td [ rnd ] td ] tr + [ [ "4" ] td [ rnd ] td [ rnd ] td [ rnd ] td ] tr + [ [ "5" ] td [ rnd ] td [ rnd ] td [ rnd ] td ] tr + [ [ "6" ] td [ rnd ] td [ rnd ] td [ rnd ] td ] tr +] table diff --git a/Task/Create-an-HTML-table/Run-BASIC/create-an-html-table.run b/Task/Create-an-HTML-table/Run-BASIC/create-an-html-table.run new file mode 100644 index 0000000000..7694a67c01 --- /dev/null +++ b/Task/Create-an-HTML-table/Run-BASIC/create-an-html-table.run @@ -0,0 +1,9 @@ +html "" +for i = 1 to 5 + html "" + for j = 1 to 4 + if j = 1 then html "" else html "" + next j +html "" +next i +html "
RowXYZ
";i;"";i;j;"
" diff --git a/Task/Create-an-HTML-table/Seed7/create-an-html-table.seed7 b/Task/Create-an-HTML-table/Seed7/create-an-html-table.seed7 new file mode 100644 index 0000000000..e8cfdca734 --- /dev/null +++ b/Task/Create-an-HTML-table/Seed7/create-an-html-table.seed7 @@ -0,0 +1,18 @@ +$ include "seed7_05.s7i"; + +const proc: main is func + local + var integer: line is 0; + var integer: column is 0; + begin + writeln(""); + writeln(""); + for line range 1 to 3 do + write(""); + for column range 1 to 3 do + write(""); + end for; + writeln(""); + end for; + writeln("
XYZ
" <& line <& "" <& rand(0, 9999) <& "
") + end func; diff --git a/Task/Create-an-HTML-table/TUSCRIPT/create-an-html-table.tuscript b/Task/Create-an-HTML-table/TUSCRIPT/create-an-html-table.tuscript new file mode 100644 index 0000000000..fef1c4bef1 --- /dev/null +++ b/Task/Create-an-HTML-table/TUSCRIPT/create-an-html-table.tuscript @@ -0,0 +1,20 @@ +$$ MODE TUSCRIPT +tablefile="table.html" +ERROR/STOP CREATE (tablefile,FDF-o,-std-) +ACCESS d: WRITE/ERASE/RECORDS/utf8 $tablefile s,tablecontent +tablecontent=* +WRITE d "" +WRITE d "create html table" +WRITE d "" +WRITE d "" +WRITE d "" +WRITE d "" +LOOP n=1,5 +x=RANDOM_NUMBERS (1,9999,1) +y=RANDOM_NUMBERS (1,9999,1) +z=RANDOM_NUMBERS (1,9999,1) +WRITE d "" +ENDLOOP +WRITE d "
 xyz
{n}{x}{y}{z}
" +ENDACCESS d +BROWSE $tablefile diff --git a/Task/Create-an-HTML-table/VBA/create-an-html-table.vba b/Task/Create-an-HTML-table/VBA/create-an-html-table.vba new file mode 100644 index 0000000000..7bdd4971f5 --- /dev/null +++ b/Task/Create-an-HTML-table/VBA/create-an-html-table.vba @@ -0,0 +1,54 @@ +Public Sub BuildHTMLTable() +'simple HTML table, represented as a string matrix "cells" +Const nRows = 6 +Const nCols = 4 +Dim cells(1 To nRows, 1 To nCols) As String +Dim HTML As String 'the HTML table +Dim temp As String +Dim attr As String + +' fill table +' first row with titles +cells(1, 1) = "" +cells(1, 2) = "X" +cells(1, 3) = "Y" +cells(1, 4) = "Z" +'next rows with index & random numbers +For i = 2 To nRows + cells(i, 1) = Format$(i - 1) + For j = 2 To nCols + cells(i, j) = Format$(Int(Rnd() * 10000)) + Next j +Next i + +'build the HTML +HTML = "" +For i = 1 To nRows + temp = "" + 'first row as header row + If i = 1 Then attr = "th" Else attr = "td" + For j = 1 To nCols + temp = temp & HTMLWrap(cells(i, j), attr) + Next j + HTML = HTML & HTMLWrap(temp, "tr") +Next i +HTML = HTMLWrap(HTML, "table", "style=""text-align:center; border: 1px solid""") +Debug.Print HTML +End Sub + +Public Function HTMLWrap(s As String, tag As String, ParamArray attributes()) As String + 'returns string s wrapped in HTML tag with optional "attribute=value" strings + 'ex.: HTMLWrap("Link text", "a", "href=""http://www.somesite.org""") + 'returns: Link text + + Dim sOpenTag As String + Dim sClosingTag As String + + sOpenTag = "<" & tag + For Each attr In attributes + sOpenTag = sOpenTag & " " & attr + Next + sOpenTag = sOpenTag & ">" + sClosingTag = "" + HTMLWrap = sOpenTag & s & sClosingTag +End Function diff --git a/Task/Create-an-object-at-a-given-address/PureBasic/create-an-object-at-a-given-address.purebasic b/Task/Create-an-object-at-a-given-address/PureBasic/create-an-object-at-a-given-address.purebasic new file mode 100644 index 0000000000..e845412e06 --- /dev/null +++ b/Task/Create-an-object-at-a-given-address/PureBasic/create-an-object-at-a-given-address.purebasic @@ -0,0 +1,21 @@ +; Allocate a 1Mb memory area work within to avoid conflicts, +; this address could be any number but it may then fail on some systems. +*a=AllocateMemory(1024*1024) + +; Write a int wit value "31415" at address +312, +; using pointer '*a' with a displacement. +PokeI(*a+312, 31415) + +; Write a float with value Pi at address +316, +; by creating a new pointer '*b' for this address +*b=*a+316 +PokeF(*b, #PI) + +;Now test it +For i=0 To 1024000 Step 4 + n=PeekI(*a+i) + If n + Debug "Int at +"+Str(i)+" = "+Str(n) + Debug "Float at +"+Str(i)+"= "+StrF(PeekF(*a+i)) + EndIf +Next diff --git a/Task/DNS-query/CoffeeScript/dns-query.coffee b/Task/DNS-query/CoffeeScript/dns-query.coffeescript similarity index 100% rename from Task/DNS-query/CoffeeScript/dns-query.coffee rename to Task/DNS-query/CoffeeScript/dns-query.coffeescript diff --git a/Task/DNS-query/OCaml/dns-query.ocaml b/Task/DNS-query/OCaml/dns-query.ocaml new file mode 100644 index 0000000000..d62940bd65 --- /dev/null +++ b/Task/DNS-query/OCaml/dns-query.ocaml @@ -0,0 +1,20 @@ +let dns_query ~host ~ai_family = + let opts = [ + Unix.AI_FAMILY ai_family; + Unix.AI_SOCKTYPE Unix.SOCK_DGRAM; + ] in + let addr_infos = Unix.getaddrinfo host "" opts in + match addr_infos with + | [] -> failwith "dns_query" + | ai :: _ -> + match ai.Unix.ai_addr with + | Unix.ADDR_INET (addr, _) -> (Unix.string_of_inet_addr addr) + | Unix.ADDR_UNIX addr -> failwith "addr_unix" + +let () = + let host = "www.kame.net" in + Printf.printf "primary addresses of %s are:\n" host; + + Printf.printf " IPv4 address: %s\n" (dns_query host Unix.PF_INET); + Printf.printf " IPv6 address: %s\n" (dns_query host Unix.PF_INET6); +;; diff --git a/Task/DNS-query/Seed7/dns-query.seed7 b/Task/DNS-query/Seed7/dns-query.seed7 new file mode 100644 index 0000000000..9e63073745 --- /dev/null +++ b/Task/DNS-query/Seed7/dns-query.seed7 @@ -0,0 +1,7 @@ +$ include "seed7_05.s7i"; + include "socket.s7i"; + +const proc: main is func + begin + writeln(numericAddress(inetSocketAddress("www.kame.net", 1024))); + end func; diff --git a/Task/Date-format/BASIC/date-format.bas b/Task/Date-format/BASIC/date-format.basic similarity index 100% rename from Task/Date-format/BASIC/date-format.bas rename to Task/Date-format/BASIC/date-format.basic diff --git a/Task/Date-format/CoffeeScript/date-format-1.coffee b/Task/Date-format/CoffeeScript/date-format-1.coffeescript similarity index 100% rename from Task/Date-format/CoffeeScript/date-format-1.coffee rename to Task/Date-format/CoffeeScript/date-format-1.coffeescript diff --git a/Task/Date-format/CoffeeScript/date-format-2.coffee b/Task/Date-format/CoffeeScript/date-format-2.coffeescript similarity index 100% rename from Task/Date-format/CoffeeScript/date-format-2.coffee rename to Task/Date-format/CoffeeScript/date-format-2.coffeescript diff --git a/Task/Date-format/Mathematica/date-format.mathematica b/Task/Date-format/Mathematica/date-format.math similarity index 100% rename from Task/Date-format/Mathematica/date-format.mathematica rename to Task/Date-format/Mathematica/date-format.math diff --git a/Task/Date-format/NetRexx/date-format.netrexx b/Task/Date-format/NetRexx/date-format.netrexx new file mode 100644 index 0000000000..0ab6167d7c --- /dev/null +++ b/Task/Date-format/NetRexx/date-format.netrexx @@ -0,0 +1,3 @@ +import java.text.SimpleDateFormat +say SimpleDateFormat("yyyy-MM-dd").format(Date()) +say SimpleDateFormat("EEEE, MMMM dd, yyyy").format(Date()) diff --git a/Task/Date-format/NewLISP/date-format.newlisp b/Task/Date-format/NewLISP/date-format.newlisp new file mode 100644 index 0000000000..27508f675f --- /dev/null +++ b/Task/Date-format/NewLISP/date-format.newlisp @@ -0,0 +1,34 @@ +; file: date-format.lsp +; url: http://rosettacode.org/wiki/Date_format +; author: oofoe 2012-02-01 + +; The "now" function returns the current time as a list. A time zone +; offset in minutes can be supplied. The example below is for Eastern +; Standard Time. NewLISP's implicit list indexing is used to extract +; the first three elements of the returned list (year, month and day). + +(setq n (now (* -5 60))) +(println "short: " (format "%04d-%02d-%02d" (n 0) (n 1) (n 2))) + +; The "date-value" function returns the time in seconds from the epoch +; when used without arguments. The "date" function converts the +; seconds into a time representation specified by the format string at +; the end. The offset argument ("0" in this example) specifies a +; time-zone offset in minutes. + +(println "short: " (date (date-value) 0 "%Y-%m-%d")) + +; The time formatting is supplied by the underlying C library, so +; there may be differences on certain platforms. Particularly, leading +; zeroes in day numbers can be suppressed with "%-d" on Linux and +; FreeBSD, "%e" on OpenBSD, SunOS/Solaris and Mac OS X. Use "%#d" for +; Windows. + +(println "long: " (date (date-value) 0 "%A, %B %#d, %Y")) + +; By setting the locale, the date will be displayed appropriately: + +(set-locale "japanese") +(println "long: " (date (date-value) 0 "%A, %B %#d, %Y")) + +(exit) diff --git a/Task/Date-format/Nimrod/date-format.nimrod b/Task/Date-format/Nimrod/date-format.nimrod new file mode 100644 index 0000000000..261c4675d4 --- /dev/null +++ b/Task/Date-format/Nimrod/date-format.nimrod @@ -0,0 +1,5 @@ +import times + +var t = getTime().getLocalTime() +echo(t.format("yyyy-MM-dd")) +echo(t.format("dddd',' MMMM d',' yyyy")) diff --git a/Task/Date-format/OCaml/date-format-1.ocaml b/Task/Date-format/OCaml/date-format-1.ocaml new file mode 100644 index 0000000000..97b16427e2 --- /dev/null +++ b/Task/Date-format/OCaml/date-format-1.ocaml @@ -0,0 +1,13 @@ +# #load "unix.cma";; +# open Unix;; + +# let t = time() ;; +val t : float = 1219997516. + +# let gmt = gmtime t ;; +val gmt : Unix.tm = + {tm_sec = 56; tm_min = 11; tm_hour = 8; tm_mday = 29; tm_mon = 7; + tm_year = 108; tm_wday = 5; tm_yday = 241; tm_isdst = false} + +# Printf.sprintf "%d-%02d-%02d" (1900 + gmt.tm_year) (1 + gmt.tm_mon) gmt.tm_mday ;; +- : string = "2008-08-29" diff --git a/Task/Date-format/OCaml/date-format-2.ocaml b/Task/Date-format/OCaml/date-format-2.ocaml new file mode 100644 index 0000000000..ff90f7353e --- /dev/null +++ b/Task/Date-format/OCaml/date-format-2.ocaml @@ -0,0 +1,12 @@ +let months = [| "January"; "February"; "March"; "April"; "May"; "June"; + "July"; "August"; "September"; "October"; "November"; "December" |] + +let days = [| "Sunday"; "Monday"; "Tuesday"; (* Sunday is 0 *) + "Wednesday"; "Thursday"; "Friday"; "Saturday" |] + +# Printf.sprintf "%s, %s %d, %d" + days.(gmt.tm_wday) + months.(gmt.tm_mon) + gmt.tm_mday + (1900 + gmt.tm_year) ;; +- : string = "Friday, August 29, 2008" diff --git a/Task/Date-format/Objeck/date-format.objeck b/Task/Date-format/Objeck/date-format.objeck new file mode 100644 index 0000000000..3690b58979 --- /dev/null +++ b/Task/Date-format/Objeck/date-format.objeck @@ -0,0 +1,15 @@ +use IO; +use Time; + +bundle Default { + class CurrentDate { + function : Main(args : String[]) ~ Nil { + t := Date->New(); + Console->Print(t->GetYear())->Print("-")->Print(t->GetMonth())->Print("-") + ->PrintLine(t->GetDay()); + Console->Print(t->GetDayName())->Print(", ")->Print(t->GetMonthName()) + ->Print(" ")->Print(t->GetDay())->Print(", ") + ->PrintLine(t->GetYear()); + } + } +} diff --git a/Task/Date-format/Objective-C/date-format-1.m b/Task/Date-format/Objective-C/date-format-1.m new file mode 100644 index 0000000000..f83b4a6f10 --- /dev/null +++ b/Task/Date-format/Objective-C/date-format-1.m @@ -0,0 +1,3 @@ +NSLog(@"%@", [NSDate date]); +NSLog(@"%@", [[NSDate date] descriptionWithCalendarFormat:@"%Y-%m-%d" timeZone:nil locale:nil]); +NSLog(@"%@", [[NSDate date] descriptionWithCalendarFormat:@"%A, %B %d, %Y" timeZone:nil locale:nil]); diff --git a/Task/Date-format/Objective-C/date-format-2.m b/Task/Date-format/Objective-C/date-format-2.m new file mode 100644 index 0000000000..b135bb74df --- /dev/null +++ b/Task/Date-format/Objective-C/date-format-2.m @@ -0,0 +1,7 @@ +NSLog(@"%@", [NSDate date]); +NSDateFormatter *dateFormatter = [[NSDateFormat alloc] init]; +[dateFormatter setDateFormat:@"yyyy-MM-dd"]; +NSLog(@"%@", [dateFormatter stringFromDate:[NSDate date]]); +[dateFormatter setDateFormat:@"EEEE, MMMM d, yyyy"]; +NSLog(@"%@", [dateFormatter stringFromDate:[NSDate date]]); +[dateFormatter release]; diff --git a/Task/Date-format/OxygenBasic/date-format.oxy b/Task/Date-format/OxygenBasic/date-format.oxy new file mode 100644 index 0000000000..f7e4cf4cdf --- /dev/null +++ b/Task/Date-format/OxygenBasic/date-format.oxy @@ -0,0 +1,31 @@ +extern lib "kernel32.dll" + +'http://msdn.microsoft.com/en-us/library/windows/desktop/ms724950(v=vs.85).aspx + +typedef struct _SYSTEMTIME { + WORD wYear; + WORD wMonth; + WORD wDayOfWeek; + WORD wDay; + WORD wHour; + WORD wMinute; + WORD wSecond; + WORD wMilliseconds; +} SYSTEMTIME, *PSYSTEMTIME; + +void GetSystemTime(SYSTEMTIME*t); +void GetLocalTime(SYSTEMTIME*t); + +end extern + +SYSTEMTIME t +'GetSystemTime t 'GMT (Greenwich Mean Time) +GetLocalTime t + +String WeekDay[7]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"} +String MonthName[12]={"January","February","March","April","May","June","July","August","September","October","November","December"} +String month=str t.wMonth : if len(month)<2 then month="0"+month +String day=str t.wDay : if len(day)<2 then day="0"+day +' +print "" t.wYear "-" month "-" day +print WeekDay[t.wDayOfWeek+1 and 7 ] " " MonthName[t.wMonth and 31] " " t.wDay " " t.wYear diff --git a/Task/Date-format/Oz/date-format.oz b/Task/Date-format/Oz/date-format.oz new file mode 100644 index 0000000000..dc65cd3881 --- /dev/null +++ b/Task/Date-format/Oz/date-format.oz @@ -0,0 +1,26 @@ +declare + WeekDays = unit(0:"Sunday" "Monday" "Tuesday" "Wednesday" + "Thursday" "Friday" "Saturday") + Months = unit(0:"January" "February" "March" "April" + "May" "June" "July" "August" "September" + "October" "November" "December") + + fun {DateISO Time} + Year = 1900 + Time.year + Month = Time.mon + 1 + in + Year#"-"#{Align Month}#"-"#{Align Time.mDay} + end + + fun {DateLong Time} + Year = 1900 + Time.year + in + WeekDays.(Time.wDay)#", "#Months.(Time.mon)#" "#Time.mDay#", "#Year + end + + fun {Align Num} + if Num < 10 then "0"#Num else Num end + end +in + {System.showInfo {DateISO {OS.localTime}}} + {System.showInfo {DateLong {OS.localTime}}} diff --git a/Task/Date-format/PL-I/date-format.pli b/Task/Date-format/PL-I/date-format.pli new file mode 100644 index 0000000000..e36f787b18 --- /dev/null +++ b/Task/Date-format/PL-I/date-format.pli @@ -0,0 +1,12 @@ +declare day_of_week(7) character (9) varying initial + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', + 'Thursday', 'Friday', 'Saturday'); +declare today character (8); + +today = datetime('YYYYMMDD'); +put edit (substr(today, 1, 4), '-', substr(today, 5, 2), '-', substr(today, 7) ) (A); + +today = datetime('MmmDDYYYY'); + +put skip edit (day_of_week(weekday(days())), ', ') (A); +put edit (substr(today, 1, 3), ' ', substr(today, 4, 2), ',', substr(today, 6, 4) ) (A); diff --git a/Task/Date-format/Pascal/date-format.pascal b/Task/Date-format/Pascal/date-format.pascal new file mode 100644 index 0000000000..650aa5cf19 --- /dev/null +++ b/Task/Date-format/Pascal/date-format.pascal @@ -0,0 +1,55 @@ +program dateform; +uses DOS; + +{ Format digit with leading zero } +function lz(w: word): string; +var + s: string; +begin + str(w,s); + if length(s) = 1 then + s := '0' + s; + lz := s +end; + +function m2s(mon: integer): string; +begin + case mon of + 1: m2s := 'January'; + 2: m2s := 'February'; + 3: m2s := 'March'; + 4: m2s := 'April'; + 5: m2s := 'May'; + 6: m2s := 'June'; + 7: m2s := 'July'; + 8: m2s := 'August'; + 9: m2s := 'September'; + 10: m2s := 'October'; + 11: m2s := 'November'; + 12: m2s := 'December' + end +end; + +function d2s(dow: integer): string; +begin + case dow of + 0: d2s := 'Sunday'; + 1: d2s := 'Monday'; + 2: d2s := 'Tueday'; + 3: d2s := 'Wednesday'; + 4: d2s := 'Thursday'; + 5: d2s := 'Friday'; + 6: d2s := 'Saturday' + end +end; + +var + yr,mo,dy,dow: word; + mname,dname: string; + +begin + GetDate(yr,mo,dy,dow); + writeln(yr,'-',lz(mo),'-',lz(dy)); + mname := m2s(mo); dname := d2s(dow); + writeln(dname,', ',mname,' ',dy,', ',yr) +end. diff --git a/Task/Date-format/Perl-6/date-format.pl6 b/Task/Date-format/Perl-6/date-format.pl6 new file mode 100644 index 0000000000..9bc573c13b --- /dev/null +++ b/Task/Date-format/Perl-6/date-format.pl6 @@ -0,0 +1,6 @@ +use DateTime::Utils; + +my $dt = DateTime.now; + +say strftime('%Y-%m-%d', $dt); +say strftime('%A, %B %d, %Y', $dt); diff --git a/Task/Date-format/Pike/date-format.pike b/Task/Date-format/Pike/date-format.pike new file mode 100644 index 0000000000..55f805b3ce --- /dev/null +++ b/Task/Date-format/Pike/date-format.pike @@ -0,0 +1,11 @@ +> write("%d-%02d-%02d\n", day->year_no(), day->month_no(), day->month_day()); +2011-11-05 + +> write("%s, %s %s, %s\n", day->week_day_name(), day->month_name(), day->month_day_name(), day->year_name()); +Saturday, November 5, 2011 + +> write(day->format_ymd()+"\n"); +2011-11-05 + +> write(day->format_ext_ymd()+"\n"); +Saturday, 5 November 2011 diff --git a/Task/Date-format/PowerShell/date-format.psh b/Task/Date-format/PowerShell/date-format.psh new file mode 100644 index 0000000000..3397271179 --- /dev/null +++ b/Task/Date-format/PowerShell/date-format.psh @@ -0,0 +1,2 @@ +"{0:yyyy-MM-dd}" -f (Get-Date) +"{0:dddd, MMMM d, yyyy}" -f (Get-Date) diff --git a/Task/Date-format/PureBasic/date-format.purebasic b/Task/Date-format/PureBasic/date-format.purebasic new file mode 100644 index 0000000000..a80226b01c --- /dev/null +++ b/Task/Date-format/PureBasic/date-format.purebasic @@ -0,0 +1,41 @@ +;Declare Procedures +Declare.s MonthInText() +Declare.s DayInText() + +;Output the requested strings +Debug FormatDate("%yyyy-%mm-%dd", Date()) +Debug DayInText() + ", " + MonthInText() + FormatDate(" %dd, %yyyy", Date()) + +;Used procedures +Procedure.s DayInText() + Protected d$ + Select DayOfWeek(Date()) + Case 1: d$="Monday" + Case 2: d$="Tuesday" + Case 3: d$="Wednesday" + Case 4: d$="Thursday" + Case 5: d$="Friday" + Case 6: d$="Saturday" + Default: d$="Sunday" + EndSelect + ProcedureReturn d$ +EndProcedure + +Procedure.s MonthInText() + Protected m$ + Select Month(Date()) + Case 1: m$="January" + Case 2: m$="February" + Case 3: m$="March" + Case 4: m$="April" + Case 5: m$="May" + Case 6: m$="June" + Case 7: m$="July" + Case 8: m$="August" + Case 9: m$="September" + Case 10:m$="October" + Case 11:m$="November" + Default:m$="December" + EndSelect + ProcedureReturn m$ +EndProcedure diff --git a/Task/Date-format/REBOL/date-format.rebol b/Task/Date-format/REBOL/date-format.rebol new file mode 100644 index 0000000000..8d79f278ce --- /dev/null +++ b/Task/Date-format/REBOL/date-format.rebol @@ -0,0 +1,25 @@ +REBOL [ + Title: "Date Formatting" + Author: oofoe + Date: 2009-12-06 + URL: http://rosettacode.org/wiki/Date_format +] + +; REBOL has no built-in pictured output. + +zeropad: func [pad n][ + n: to-string n + insert/dup n "0" (pad - length? n) + n +] +d02: func [n][zeropad 2 n] + +print now ; Native formatting. + +print rejoin [now/year "-" d02 now/month "-" d02 now/day] + +print rejoin [ + pick system/locale/days now/weekday ", " + pick system/locale/months now/month " " + now/day ", " now/year +] diff --git a/Task/Date-format/Raven/date-format-1.raven b/Task/Date-format/Raven/date-format-1.raven new file mode 100644 index 0000000000..d479e75b2c --- /dev/null +++ b/Task/Date-format/Raven/date-format-1.raven @@ -0,0 +1 @@ +time int as today diff --git a/Task/Date-format/Raven/date-format-2.raven b/Task/Date-format/Raven/date-format-2.raven new file mode 100644 index 0000000000..96a8aee3c2 --- /dev/null +++ b/Task/Date-format/Raven/date-format-2.raven @@ -0,0 +1 @@ +today '%Y-%m-%d' date diff --git a/Task/Date-format/Raven/date-format-3.raven b/Task/Date-format/Raven/date-format-3.raven new file mode 100644 index 0000000000..09b5bd18af --- /dev/null +++ b/Task/Date-format/Raven/date-format-3.raven @@ -0,0 +1 @@ +today '%A, %B %d, %Y' date diff --git a/Task/Date-format/Run-BASIC/date-format.run b/Task/Date-format/Run-BASIC/date-format.run new file mode 100644 index 0000000000..ff6b3d04d1 --- /dev/null +++ b/Task/Date-format/Run-BASIC/date-format.run @@ -0,0 +1,5 @@ +'Display the current date in the formats of "2007-11-10" and "Sunday, November 10, 2007". +print date$("yyyy-mm-dd") +print date$("dddd");", "; 'return full day of the week (eg. Wednesday +print date$("mmmm");" "; 'return full month name (eg. March) +print date$("dd, yyyy") 'return day, year diff --git a/Task/Date-format/Seed7/date-format.seed7 b/Task/Date-format/Seed7/date-format.seed7 new file mode 100644 index 0000000000..5d856f1b02 --- /dev/null +++ b/Task/Date-format/Seed7/date-format.seed7 @@ -0,0 +1,14 @@ +$ include "seed7_05.s7i"; + include "time.s7i"; + +const proc: main is func + local + const array string: months is [] ("January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December"); + const array string: days is [] ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); + var time: now is time.value; + begin + now := time(NOW); + writeln(strDate(now)); + writeln(days[dayOfWeek(now)] <& ", " <& months[now.month] <& " " <& now.day <& ", " <& now.year); + end func; diff --git a/Task/Date-format/Shiny/date-format.shiny b/Task/Date-format/Shiny/date-format.shiny new file mode 100644 index 0000000000..8601905022 --- /dev/null +++ b/Task/Date-format/Shiny/date-format.shiny @@ -0,0 +1,2 @@ +say time.format 'Y-m-d' time.now +say time.format 'l, F j, Y' time.now diff --git a/Task/Date-format/Standard-ML/date-format.ml b/Task/Date-format/Standard-ML/date-format.ml new file mode 100644 index 0000000000..dc5df5bb84 --- /dev/null +++ b/Task/Date-format/Standard-ML/date-format.ml @@ -0,0 +1,2 @@ +print (Date.fmt "%Y-%m-%d" (Date.fromTimeLocal (Time.now ())) ^ "\n"); +print (Date.fmt "%A, %B %d, %Y" (Date.fromTimeLocal (Time.now ())) ^ "\n"); diff --git a/Task/Date-format/Suneido/date-format.suneido b/Task/Date-format/Suneido/date-format.suneido new file mode 100644 index 0000000000..4d9ba9b0a5 --- /dev/null +++ b/Task/Date-format/Suneido/date-format.suneido @@ -0,0 +1,2 @@ +Date().Format('yyyy-MM-dd') --> "2010-03-16" +Date().LongDate() --> "Tuesday, March 16, 2010" diff --git a/Task/Date-format/TUSCRIPT/date-format.tuscript b/Task/Date-format/TUSCRIPT/date-format.tuscript new file mode 100644 index 0000000000..44d075cf31 --- /dev/null +++ b/Task/Date-format/TUSCRIPT/date-format.tuscript @@ -0,0 +1,27 @@ +$$ MODE TUSCRIPT +SET dayofweek = DATE (today,day,month,year,number) + +SET months=* +DATA January +DATA Februari +DATA March +DATA April +DATA Mai +DATA June +DATA July +DATA August +DATA September +DATA October +DATA November +DATA December + +SET days="Monday'Tuesday'Wendsday'Thursday'Fryday'Saturday'Sonday" + +SET nameofday =SELECT (days,#dayofweek) +SET nameofmonth=SELECT (months,#month) + +SET format1=JOIN (year,"-",month,day) +SET format2=CONCAT (nameofday,", ",nameofmonth," ",day, ", ",year) + +PRINT format1 +PRINT format2 diff --git a/Task/Date-format/UNIX-Shell/date-format.sh b/Task/Date-format/UNIX-Shell/date-format.sh new file mode 100644 index 0000000000..4f88af48a5 --- /dev/null +++ b/Task/Date-format/UNIX-Shell/date-format.sh @@ -0,0 +1,2 @@ +date +"%Y-%m-%d" +date +"%A, %B %d, %Y" diff --git a/Task/Date-format/Ursala/date-format.ursala b/Task/Date-format/Ursala/date-format.ursala new file mode 100644 index 0000000000..f862471452 --- /dev/null +++ b/Task/Date-format/Ursala/date-format.ursala @@ -0,0 +1,17 @@ +#import std +#import cli + +months = ~&p/block3'JanFebMarAprMayJunJulAugSepOctNovDec' block2'010203040506070809101112' + +completion = + +-:~& ~&pllrTXS/block3'SunMonTueWedThuFriSat'--(~&lS months) -- ( + --','* sep`, 'day,day,sday,nesday,rsday,day,urday', + sep`, 'uary,ruary,ch,il,,e,y,ust,tember,ober,ember,ember') + +text_form = sep` ; mat` + completion*+ <.~&hy,~&tth,--','@th,~&ttth> +numeric_form = sep` ; mat`-+ <.~&ttth,@tth -: months,~&th> + +#show+ + +main = <.text_form,numeric_form> now0 diff --git a/Task/Date-format/Vedit-macro-language/date-format-1.vedit b/Task/Date-format/Vedit-macro-language/date-format-1.vedit new file mode 100644 index 0000000000..324881bb1a --- /dev/null +++ b/Task/Date-format/Vedit-macro-language/date-format-1.vedit @@ -0,0 +1 @@ +Date(REVERSE+NOMSG+VALUE, '-') diff --git a/Task/Date-format/Vedit-macro-language/date-format-2.vedit b/Task/Date-format/Vedit-macro-language/date-format-2.vedit new file mode 100644 index 0000000000..161d25de28 --- /dev/null +++ b/Task/Date-format/Vedit-macro-language/date-format-2.vedit @@ -0,0 +1,31 @@ +// Get todays date into #1, #2, #3 and #7 +#1 = Date_Day +#2 = Date_Month +#3 = Date_Year +#7 = JDate() % 7 // #7 = weekday + +// Convert weekday number (in #7) into word in T-reg 1 +if (#7==0) { RS(1,"Sunday") } +if (#7==1) { RS(1,"Monday") } +if (#7==2) { RS(1,"Tuesday") } +if (#7==3) { RS(1,"Wednesday") } +if (#7==4) { RS(1,"Thursday") } +if (#7==5) { RS(1,"Friday") } +if (#7==6) { RS(1,"Saturday") } + +// Convert month number (in #2) into word in T-reg 2 +if (#2==1) { RS(2,"January") } +if (#2==2) { RS(2,"February") } +if (#2==3) { RS(2,"March") } +if (#2==4) { RS(2,"April") } +if (#2==5) { RS(2,"May") } +if (#2==6) { RS(2,"June") } +if (#2==7) { RS(2,"July") } +if (#2==8) { RS(2,"August") } +if (#2==9) { RS(2,"September") } +if (#2==10) { RS(2,"October") } +if (#2==11) { RS(2,"November") } +if (#2==12) { RS(2,"December") } + +// Display the date string +RT(1) M(", ") RT(2) M(" ") NT(#1, LEFT+NOCR) M(",") NT(#3) diff --git a/Task/Date-format/Vedit-macro-language/date-format-3.vedit b/Task/Date-format/Vedit-macro-language/date-format-3.vedit new file mode 100644 index 0000000000..574731f81a --- /dev/null +++ b/Task/Date-format/Vedit-macro-language/date-format-3.vedit @@ -0,0 +1 @@ +RI(1) IT(", ") RI(2) IT(" ") NI(#1, LEFT+NOCR) IT(",") NI(#3) diff --git a/Task/Date-format/XPL0/date-format.xpl0 b/Task/Date-format/XPL0/date-format.xpl0 new file mode 100644 index 0000000000..0fbdbd1f0d --- /dev/null +++ b/Task/Date-format/XPL0/date-format.xpl0 @@ -0,0 +1,19 @@ +include c:\cxpl\codes; +int CpuReg, Year, Month, Day, DName, MName, WDay; +[CpuReg:= GetReg; \access CPU registers +CpuReg(0):= $2A00; \DOS system call +SoftInt($21); +Year:= CpuReg(2); +Month:= CpuReg(3) >> 8; +Day:= CpuReg(3) & $FF; +WDay:= CpuReg(0) & $FF; +IntOut(0, Year); ChOut(0, ^-); +if Month<10 then ChOut(0, ^0); IntOut(0, Month); ChOut(0, ^-); +if Day<10 then ChOut(0, ^0); IntOut(0, Day); CrLf(0); +DName:= ["Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday"]; +MName:= [0, "January", "February", "March", "April", "May", "June", "July", + "August", "September", "October", "November", "December"]; +Text(0, DName(WDay)); Text(0, ", "); Text(0, MName(Month)); Text(0, " "); +IntOut(0, Day); Text(0, ", "); IntOut(0, Year); CrLf(0); +] diff --git a/Task/Date-manipulation/Mathematica/date-manipulation.mathematica b/Task/Date-manipulation/Mathematica/date-manipulation.math similarity index 100% rename from Task/Date-manipulation/Mathematica/date-manipulation.mathematica rename to Task/Date-manipulation/Mathematica/date-manipulation.math diff --git a/Task/Date-manipulation/NetRexx/date-manipulation.netrexx b/Task/Date-manipulation/NetRexx/date-manipulation.netrexx new file mode 100644 index 0000000000..e81fab7378 --- /dev/null +++ b/Task/Date-manipulation/NetRexx/date-manipulation.netrexx @@ -0,0 +1,29 @@ +/* NetRexx */ +options replace format comments java crossref symbols binary + +import java.text.SimpleDateFormat +import java.text.ParseException + +runSample(arg) +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method manipulateDate(sampleDate, dateFmt, dHours = 0) private static + formatter = SimpleDateFormat(dateFmt) + msHours = dHours * 60 * 60 * 1000 -- hours in milliseconds + day = formatter.parse(sampleDate) + day.setTime(day.getTime() + msHours) + formatted = formatter.format(day) + return formatted + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method runSample(arg) private static + do + sampleDate = 'March 7 2009 7:30pm EST' + dateFmt = "MMMM d yyyy h:mma z" + say sampleDate + say manipulateDate(sampleDate, dateFmt, 12) + catch ex = Exception + ex.printStackTrace() + end + return diff --git a/Task/Date-manipulation/PL-I/date-manipulation.pli b/Task/Date-manipulation/PL-I/date-manipulation.pli new file mode 100644 index 0000000000..c685dbb749 --- /dev/null +++ b/Task/Date-manipulation/PL-I/date-manipulation.pli @@ -0,0 +1,8 @@ +/* The PL/I date functions handle dates and time in 49 */ +/* different formats, but not that particular one. For any of the */ +/* standard formats, the following date manipulation will add */ +/* 12 hours to the current date/time. */ + +seconds = SECS(DATETIME()); +seconds = seconds + 12*60*60; +put list (SECSTODATE(secs)); diff --git a/Task/Date-manipulation/Pike/date-manipulation.pike b/Task/Date-manipulation/Pike/date-manipulation.pike new file mode 100644 index 0000000000..cde504c88f --- /dev/null +++ b/Task/Date-manipulation/Pike/date-manipulation.pike @@ -0,0 +1,2 @@ +> (Calendar.dwim_time("March 7 2009 7:30pm EST")+Calendar.Hour()*12)->set_timezone("CET")->format_ext_time(); +Result: "Saturday, 7 March 2009 12:30:00" diff --git a/Task/Date-manipulation/PowerShell/date-manipulation.psh b/Task/Date-manipulation/PowerShell/date-manipulation.psh new file mode 100644 index 0000000000..8c626e26c3 --- /dev/null +++ b/Task/Date-manipulation/PowerShell/date-manipulation.psh @@ -0,0 +1,4 @@ +$date = [DateTime]::Parse("March 7 2009 7:30pm -5" ) +write-host $date +write-host $date.AddHours(12) +write-host [TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($date.AddHours(12),"Vladivostok Standard Time") diff --git a/Task/Date-manipulation/REBOL/date-manipulation.rebol b/Task/Date-manipulation/REBOL/date-manipulation.rebol new file mode 100644 index 0000000000..7679959ecc --- /dev/null +++ b/Task/Date-manipulation/REBOL/date-manipulation.rebol @@ -0,0 +1,26 @@ +REBOL [ + Title: "Date Manipulation" + Author: oofoe + Date: 2009-12-06 + URL: http://rosettacode.org/wiki/Date_Manipulation +] + +; Only North American zones here -- feel free to extend for your area. + +zones: [ + NST -3:30 NDT -2:30 AST -4:00 ADT -3:00 EST -5:00 EDT -4:00 + CST -6:00 CDT -5:00 MST -7:00 MDT -6:00 PST -8:00 PDT -7:00 AKST -9:00 + AKDT -8:00 HAST -10:00 HADT -9:00] + +read-time: func [ + text + /local m d y t z +][ + parse load text [ + set m word! (m: index? find system/locale/months to-string m) + set d integer! set y integer! + set t time! set tz word!] + to-date reduce [y m d t zones/:tz] +] + +print 12:00 + read-time "March 7 2009 7:30pm EST" diff --git a/Task/Date-manipulation/Run-BASIC/date-manipulation.run b/Task/Date-manipulation/Run-BASIC/date-manipulation.run new file mode 100644 index 0000000000..3bae40d314 --- /dev/null +++ b/Task/Date-manipulation/Run-BASIC/date-manipulation.run @@ -0,0 +1,18 @@ +theDate$ = "March 7 2009 7:30pm EST" + +monthName$ = "January February March April May June July August September October November December" +for i = 1 to 12 + if word$(theDate$,1) = word$(monthName$,i) then monthNum = i ' turn month name to number +next i +d = val(date$(monthNum;"/";word$(theDate$,2);"/";word$(theDate$,3))) ' days since Jan 1 1901 +t$ = word$(theDate$,4) ' get time from theDate$ +t1$ = word$(t$,1,"pm") ' strip pm +t2$ = word$(t1$,1,":") + "." + word$(t1$,2,":") ' replace : with . +t = val(t2$) +if right$(t$,2) = "pm" then t = t + 12 +ap$ = "pm" +if t + 12 > 24 then + d = d + 1 ' if over 24 hours add 1 to days since 1/1/1901 + ap$ = "am" +end if +print date$(d);" ";t1$;ap$ diff --git a/Task/Date-manipulation/Seed7/date-manipulation.seed7 b/Task/Date-manipulation/Seed7/date-manipulation.seed7 new file mode 100644 index 0000000000..2c4d91f8f7 --- /dev/null +++ b/Task/Date-manipulation/Seed7/date-manipulation.seed7 @@ -0,0 +1,46 @@ +$ include "seed7_05.s7i"; + include "time.s7i"; + include "duration.s7i"; + +const func time: parseDate (in string: dateStri) is func + result + var time: result is time.value; + local + const array string: monthNames is [] ("January", "February", "March", "April", + "May", "June", "July", "August", "September", "October", "November", "December"); + var array string: dateParts is 0 times ""; + var integer: month is 0; + var string: timeStri is ""; + begin + dateParts := split(dateStri, ' '); + result.year := integer parse (dateParts[3]); + result.month := 1; + while monthNames[result.month] <> dateParts[1] do + incr(result.month); + end while; + result.day := integer parse (dateParts[2]); + timeStri := dateParts[4]; + if endsWith(timeStri, "am") then + result.hour := integer parse (timeStri[.. pred(pos(timeStri, ':'))]); + elsif endsWith(timeStri, "pm") then + result.hour := integer parse (timeStri[.. pred(pos(timeStri, ':'))]) + 12; + else + raise RANGE_ERROR; + end if; + result.minute := integer parse (timeStri[succ(pos(timeStri, ':')) .. length(timeStri) - 2]); + if dateParts[5] <> "UTC" then + result.timeZone := 60 * integer parse (dateParts[5][4 ..]); + end if; + end func; + +const proc: main is func + local + var time: aTime is time.value; + begin + aTime := parseDate("March 7 2009 7:30pm UTC-05"); + writeln("Given: " <& aTime); + aTime +:= 1 . DAYS; + writeln("A day later: " <& aTime); + aTime := toUTC(aTime); + writeln("In UTC: " <& aTime); + end func; diff --git a/Task/Date-manipulation/UNIX-Shell/date-manipulation.sh b/Task/Date-manipulation/UNIX-Shell/date-manipulation.sh new file mode 100644 index 0000000000..0d3871b06c --- /dev/null +++ b/Task/Date-manipulation/UNIX-Shell/date-manipulation.sh @@ -0,0 +1 @@ +date -d 'March 7 2009 7:30pm EST +12 hours' diff --git a/Task/Day-of-the-week/CoffeeScript/day-of-the-week-1.coffee b/Task/Day-of-the-week/CoffeeScript/day-of-the-week-1.coffeescript similarity index 100% rename from Task/Day-of-the-week/CoffeeScript/day-of-the-week-1.coffee rename to Task/Day-of-the-week/CoffeeScript/day-of-the-week-1.coffeescript diff --git a/Task/Day-of-the-week/CoffeeScript/day-of-the-week-2.coffee b/Task/Day-of-the-week/CoffeeScript/day-of-the-week-2.coffeescript similarity index 100% rename from Task/Day-of-the-week/CoffeeScript/day-of-the-week-2.coffee rename to Task/Day-of-the-week/CoffeeScript/day-of-the-week-2.coffeescript diff --git a/Task/Day-of-the-week/CoffeeScript/day-of-the-week-3.coffee b/Task/Day-of-the-week/CoffeeScript/day-of-the-week-3.coffeescript similarity index 100% rename from Task/Day-of-the-week/CoffeeScript/day-of-the-week-3.coffee rename to Task/Day-of-the-week/CoffeeScript/day-of-the-week-3.coffeescript diff --git a/Task/Day-of-the-week/Mathematica/day-of-the-week-1.mathematica b/Task/Day-of-the-week/Mathematica/day-of-the-week-1.math similarity index 100% rename from Task/Day-of-the-week/Mathematica/day-of-the-week-1.mathematica rename to Task/Day-of-the-week/Mathematica/day-of-the-week-1.math diff --git a/Task/Day-of-the-week/Mathematica/day-of-the-week-2.mathematica b/Task/Day-of-the-week/Mathematica/day-of-the-week-2.math similarity index 100% rename from Task/Day-of-the-week/Mathematica/day-of-the-week-2.mathematica rename to Task/Day-of-the-week/Mathematica/day-of-the-week-2.math diff --git a/Task/Day-of-the-week/NetRexx/day-of-the-week-1.netrexx b/Task/Day-of-the-week/NetRexx/day-of-the-week-1.netrexx new file mode 100644 index 0000000000..8cbc95058d --- /dev/null +++ b/Task/Day-of-the-week/NetRexx/day-of-the-week-1.netrexx @@ -0,0 +1,18 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols nobinary + +yearRanges = [int 2008, 2121] +searchday = '' +cal = Calendar + +loop year = yearRanges[0] to yearRanges[1] + cal = GregorianCalendar(year, Calendar.DECEMBER, 25) + dayIndex = cal.get(Calendar.DAY_OF_WEEK) + if dayIndex = Calendar.SUNDAY then searchday = searchday year + end year + +say 'Between' yearRanges[0] 'and' yearRanges[1]', Christmas day falls on a Sunday on the following years:' +searchday = searchday.strip.changestr(' ', ',') +say ' 'searchday + +return diff --git a/Task/Day-of-the-week/NetRexx/day-of-the-week-2.netrexx b/Task/Day-of-the-week/NetRexx/day-of-the-week-2.netrexx new file mode 100644 index 0000000000..bb915a2e62 --- /dev/null +++ b/Task/Day-of-the-week/NetRexx/day-of-the-week-2.netrexx @@ -0,0 +1,191 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols nobinary + +days = 'Monday Tuesday Wednesday Thursday Friday Saturday Sunday' +yearRanges = [int 2008, 2121] + +searchday = '' +searchday['index'] = days.wordpos('Sunday') +searchday[0] = 0 + +algorithmName = ['Java Calendar', 'Zeller[1]', 'Zeller[2]', 'Sakamoto', 'Gauss', 'Keith', 'Babwani'] + +loop alg = 0 to algorithmName.length - 1 + sd = searchday[0] + 1 + searchday[0] = sd + searchday['agorithm', sd] = algorithmName[alg] + loop year = yearRanges[0] to yearRanges[1] + select case alg + when 0 then dayIndex = getDaynumJavaLibrary(year, 12, 25) + when 1 then dayIndex = getDaynumZellersCongruenceMethod1(year, 12, 25) + when 2 then dayIndex = getDaynumZellersCongruenceMethod2(year, 12, 25) + when 3 then dayIndex = getDaynumSakamoto(year, 12, 25) + when 4 then dayIndex = getDaynumGauss(year, 12, 25) + when 5 then dayIndex = getDaynumKeith(year, 12, 25) + when 6 then dayIndex = getDaynumBabwani(year, 12, 25) + otherwise nop + end + if dayIndex = searchday['index'] then + searchday[sd] = searchday[sd] year + end year + end alg + +-- display results +say 'Between' yearRanges[0] 'and' yearRanges[1]', Christmas day falls on a Sunday in the following years:' +loop r_ = 1 to searchday[0] + searchday[r_] = searchday[r_].strip.changestr(' ', ',') + say searchday['agorithm', r_].right(20)':' searchday[r_] + end r_ + +return + +-- ----------------------------------------------------------------------------- +method getDaynumJavaLibrary(Year = int, Month = int, Day = int, iso = Rexx 'Y') public static binary returns int + -- The day-of-week is an integer value where 1 is Sunday, 2 is Monday, ..., and 7 is Saturday + -- For an ISO week date Day-of-Week d (1 = Monday to 7 = Sunday), use d = ((h - 1 + 6) mod 7) + 1 + + cal = Calendar + jmNumber = [ - + Calendar.JANUARY, Calendar.FEBRUARY, Calendar.MARCH, Calendar.APRIL - + , Calendar.MAY, Calendar.JUNE, Calendar.JULY, Calendar.AUGUST - + , Calendar.SEPTEMBER, Calendar.OCTOBER, Calendar.NOVEMBER, Calendar.DECEMBER - + ] + + mon = jmNumber[Month - 1] + cal = GregorianCalendar(Year, mon, Day) + h = cal.get(Calendar.DAY_OF_WEEK) + + if 'YES'.abbrev(iso.upper, 1) then w = ((h - 1 + 6) // 7) + 1 + else w = h + + return w + +-- ----------------------------------------------------------------------------- +method getDaynumZellersCongruenceMethod1(Year = int, Month = int, Day = int, iso = Rexx 'Y') public static returns int + -- DayNum results in an integer in the range 0-6 where 0 represents Monday etc. + -- For an ISO week date add 1 + + if Month = 1 | Month = 2 then do + Month = Month + 12 + Year = Year - 1 + end + + MonthFactor = 2 * Month + 3 * (Month + 1) % 5 + YearFactor = Year + Year % 4 - Year % 100 + Year % 400 + DayNum = (Day + MonthFactor + YearFactor) // 7 + + if 'YES'.abbrev(iso.upper, 1) then d = DayNum + 1 + else d = DayNum + + return d + +-- ----------------------------------------------------------------------------- +method getDaynumZellersCongruenceMethod2(Year = int, Month = int, Day = int, iso = Rexx 'Y') public static binary returns int + -- h is the day of the week (0 = Saturday, 1 = Sunday, 2 = Monday, ...) + -- For an ISO week date Day-of-Week d (1 = Monday to 7 = Sunday), use d = ((h + 5) mod 7) + 1 + + if Month < 3 then do + Month = Month + 12 + Year = Year - 1 + end + q = Day + m = Month + Y = Year + + h = (q + ((m + 1) * 26 % 10) + Y + (Y % 4) + 6 * (Y % 100) + (Y % 400)) // 7 + + if 'YES'.abbrev(iso.upper, 1) then d = ((h + 5) // 7) + 1 + else d = h + + return d + +-- ----------------------------------------------------------------------------- +method getDaynumSakamoto(y = int, m = int, d = int, iso = Rexx 'Y') public static binary returns int + -- h is the day of the week (0 = Sunday, 1 = Monday, 2 = Tuesday...) + -- For an ISO week date Day-of-Week d (1 = Monday to 7 = Sunday), use d = ((h + 6) mod 7) + 1 + + t = [int 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4] + y = y - (m < 3) + h = (y + y % 4 - y % 100 + y % 400 + t[m - 1] + d) // 7 + + if 'YES'.abbrev(iso.upper, 1) then d = ((h + 6) // 7) + 1 + else d = h + + return d + +-- ----------------------------------------------------------------------------- +method getDaynumGauss(Year = int, Month = int, Day = int, iso = Rexx 'Y') public static binary returns int + -- W is week day (0 = Sunday, ..., 6 = Saturday) + -- For an ISO week date Day-of-Week d (1 = Monday to 7 = Sunday), use d = ((h + 6) mod 7) + 1 + + Year = Year - (Month < 3) + k = double Day + C = double Year % 100 + Y = double Year // 100 + m = double ((Month + 9) // 12) + 1 + + W = modulo(int (k + Math.floor(2.6 * m - 0.2) + y + Math.floor(y / 4) + Math.floor(c / 4) - 2 * c), 7) + + if 'YES'.abbrev(iso.upper, 1) then h = ((W + 6) // 7) + 1 + else h = W + + return h + +-- ----------------------------------------------------------------------------- +method getDaynumKeith(y = int, m = int, d = int, iso = Rexx 'Y') public constant binary returns int + -- W is week day (0 = Sunday, ..., 6 = Saturday) + -- For an ISO week date Day-of-Week d (1 = Monday to 7 = Sunday), use d = ((h + 6) mod 7) + 1 + + if m < 3 then do + d = d + y + y = y - 1 + end + else do + d = d + y - 2 + end + + h = (23 * m % 9 + d + 4 + y % 4 - y % 100 + y % 400) // 7 + + if 'YES'.abbrev(iso.upper, 1) then W = ((h + 6) // 7) + 1 + else W = h + + return W + +-- ----------------------------------------------------------------------------- +method getDaynumBabwani(Year = int, Month = int, Day = int, iso = Rexx 'Y') public constant binary returns int + -- return dow = Day of week: 0 = Saturday, 1 = Sunday, ... 6 = Friday + -- For an ISO week date Day-of-Week W (1 = Monday to 7 = Sunday), use W = ((dow + 5) mod 7) + 1 + + y = Year + m = Month + d = Day + + dow = int -- dow stands for day of week + dowfg = double + fmonth = int + leap = int + + if ((y // 100 == 0) & (y // 400 \= 0)) then -- leap function 1 for leap & 0 for non-leap + leap = 0 + else if (y // 4 == 0) then + leap = 1 + else + leap = 0 + + fmonth = 3 + (2 - leap) * ((m + 2) % (2 * m)) + (5 * m + m % 9) % 2 -- f(m) formula + fmonth = fmonth // 7 -- f(m) is brought in range of 0 to 6 + + century = y % 100 + lastdigits = y // 100 + + dowfg = 1.25 * lastdigits + fmonth + d - 2 * (century // 4) -- function of weekday for Gregorian + dow = int dowfg // 7 -- remainder on division by 7 + + if 'YES'.abbrev(iso.upper, 1) then W = ((dow + 5) // 7) + 1 + else W = dow + + return W + +-- ----------------------------------------------------------------------------- +method modulo(N = int, D = int) inheritable static binary returns int + return (D + (N // D)) // D diff --git a/Task/Day-of-the-week/OCaml/day-of-the-week-1.ocaml b/Task/Day-of-the-week/OCaml/day-of-the-week-1.ocaml new file mode 100644 index 0000000000..532ba05a65 --- /dev/null +++ b/Task/Day-of-the-week/OCaml/day-of-the-week-1.ocaml @@ -0,0 +1,20 @@ +#load "unix.cma" +open Unix + +try + for i = 2008 to 2121 do + (* I'm lazy so we'll just borrow the current time + instead of having to set all the fields explicitly *) + let mytime = { (localtime (time ())) with + tm_year = i - 1900; + tm_mon = 11; + tm_mday = 25 } in + try + let _, mytime = mktime mytime in + if mytime.tm_wday = 0 then + Printf.printf "25 December %d is Sunday\n" i + with e -> + Printf.printf "%d is the last year we can specify\n" (i-1); + raise e + done +with _ -> () diff --git a/Task/Day-of-the-week/OCaml/day-of-the-week-2.ocaml b/Task/Day-of-the-week/OCaml/day-of-the-week-2.ocaml new file mode 100644 index 0000000000..7aec342915 --- /dev/null +++ b/Task/Day-of-the-week/OCaml/day-of-the-week-2.ocaml @@ -0,0 +1,18 @@ +open CalendarLib + +let list_make_seq first last = + let rec aux i acc = + if i < first then acc + else aux (pred i) (i::acc) + in + aux last [] + +let print_date (year, month, day) = + Printf.printf "%d-%02d-%02d\n" year month day + +let () = + let years = list_make_seq 2008 2121 in + let years = List.filter (fun year -> + Date.day_of_week (Date.make year 12 25) = Date.Sun) years in + print_endline "December 25 is a Sunday in:"; + List.iter (Printf.printf "%d\n") years diff --git a/Task/Day-of-the-week/Objective-C/day-of-the-week.m b/Task/Day-of-the-week/Objective-C/day-of-the-week.m new file mode 100644 index 0000000000..0d9ed52f52 --- /dev/null +++ b/Task/Day-of-the-week/Objective-C/day-of-the-week.m @@ -0,0 +1,25 @@ +#import + +int main() +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + NSUInteger i; + + for(i=2008; i<2121; i++) + { + NSCalendarDate *d = [[NSCalendarDate alloc] + initWithYear: i + month: 12 + day: 25 + hour: 0 minute: 0 second:0 + timeZone: [NSTimeZone timeZoneWithAbbreviation:@"CET"] ]; + if ( [d dayOfWeek] == 0 ) + { + printf("25 Dec %u is Sunday\n", i); + } + [d release]; + } + + [pool release]; + return 0; +} diff --git a/Task/Day-of-the-week/PL-I/day-of-the-week.pli b/Task/Day-of-the-week/PL-I/day-of-the-week.pli new file mode 100644 index 0000000000..afddaf6014 --- /dev/null +++ b/Task/Day-of-the-week/PL-I/day-of-the-week.pli @@ -0,0 +1,5 @@ +declare i picture '9999'; +do i = 2008 to 2121; + if weekday(days('25Dec' || i, 'DDMmmYYYY')) = 1 then + put skip list ('Christmas day ' || i || ' is a Sunday'); +end; diff --git a/Task/Day-of-the-week/Perl-6/day-of-the-week.pl6 b/Task/Day-of-the-week/Perl-6/day-of-the-week.pl6 new file mode 100644 index 0000000000..d8410e72f0 --- /dev/null +++ b/Task/Day-of-the-week/Perl-6/day-of-the-week.pl6 @@ -0,0 +1 @@ +say join ' ', grep { Date.new($_, 12, 25).day-of-week == 7 }, 2008 .. 2121; diff --git a/Task/Day-of-the-week/Pike/day-of-the-week.pike b/Task/Day-of-the-week/Pike/day-of-the-week.pike new file mode 100644 index 0000000000..5817a6937f --- /dev/null +++ b/Task/Day-of-the-week/Pike/day-of-the-week.pike @@ -0,0 +1 @@ +filter(Calendar.Year(2008)->range(Calendar.Year(2121))->years()->month(12)->day(25), lambda(object day){ return day->week_day()==7; })->year()->format_nice(); diff --git a/Task/Day-of-the-week/PowerShell/day-of-the-week.psh b/Task/Day-of-the-week/PowerShell/day-of-the-week.psh new file mode 100644 index 0000000000..44187d014f --- /dev/null +++ b/Task/Day-of-the-week/PowerShell/day-of-the-week.psh @@ -0,0 +1 @@ +2008..2121 | Where-Object { (Get-Date $_-12-25).DayOfWeek -eq "Sunday" } diff --git a/Task/Day-of-the-week/Protium/day-of-the-week-1.protium b/Task/Day-of-the-week/Protium/day-of-the-week-1.protium new file mode 100644 index 0000000000..238047e37b --- /dev/null +++ b/Task/Day-of-the-week/Protium/day-of-the-week-1.protium @@ -0,0 +1,9 @@ +<@ SAI> + <@ ITEFORLI3>2121|2008| + <@ LETVARCAP>Christmas Day|25-Dec-<@ SAYVALFOR>... + <@ TSTDOWVARLIT>Christmas Day|1 + <@ IFF> + <@ SAYCAP>Christmas Day <@ SAYVALFOR>... is a Sunday<@ SAYKEY>__Newline + + + diff --git a/Task/Day-of-the-week/Protium/day-of-the-week-2.protium b/Task/Day-of-the-week/Protium/day-of-the-week-2.protium new file mode 100644 index 0000000000..85ec282b61 --- /dev/null +++ b/Task/Day-of-the-week/Protium/day-of-the-week-2.protium @@ -0,0 +1,10 @@ +<# suppressimplicitoutput> + <# iterate foriteration literalstring3>2121|2008| + <# let variable capture>Christmas Day|25-Dec-<# say value foriteration>... + <# test dayofweek variable literal>Christmas Day|1 + <# if> + <# say capture>Christmas Day <# say value foriteration>... is a Sunday<# say keyword>__Newline + + + + diff --git a/Task/Day-of-the-week/PureBasic/day-of-the-week.purebasic b/Task/Day-of-the-week/PureBasic/day-of-the-week.purebasic new file mode 100644 index 0000000000..f0c7a05ba1 --- /dev/null +++ b/Task/Day-of-the-week/PureBasic/day-of-the-week.purebasic @@ -0,0 +1,5 @@ +For i=2008 To 2037 + If DayOfWeek(Date(i,12,25,0,0,0))=0 + PrintN(Str(i)) + EndIf +Next diff --git a/Task/Day-of-the-week/REBOL/day-of-the-week.rebol b/Task/Day-of-the-week/REBOL/day-of-the-week.rebol new file mode 100644 index 0000000000..c2adaf472f --- /dev/null +++ b/Task/Day-of-the-week/REBOL/day-of-the-week.rebol @@ -0,0 +1,11 @@ +REBOL [ + Title: "Yuletide Holiday" + Author: oofoe + Date: 2009-12-07 + URL: http://rosettacode.org/wiki/Yuletide_Holiday +] + +for y 2008 2121 1 [ + d: to-date reduce [y 12 25] + if 7 = d/weekday [prin [y ""]] +] diff --git a/Task/Day-of-the-week/Run-BASIC/day-of-the-week.run b/Task/Day-of-the-week/Run-BASIC/day-of-the-week.run new file mode 100644 index 0000000000..b32a778561 --- /dev/null +++ b/Task/Day-of-the-week/Run-BASIC/day-of-the-week.run @@ -0,0 +1,3 @@ +for year = 2008 to 2121 + if val(date$("12-25-";year)) mod 7 = 5 then print "For ";year;"xmas is Sunday" +next year diff --git a/Task/Day-of-the-week/SAS/day-of-the-week.sas b/Task/Day-of-the-week/SAS/day-of-the-week.sas new file mode 100644 index 0000000000..3cca1e2d62 --- /dev/null +++ b/Task/Day-of-the-week/SAS/day-of-the-week.sas @@ -0,0 +1,9 @@ +data _null_; +do y=2008 to 2121; +a=mdy(12,25,y); +if weekday(a)=1 then put y; +end; +run; + +/* 2011 2016 2022 2033 2039 2044 2050 2061 2067 + 2072 2078 2089 2095 2101 2107 2112 2118 */ diff --git a/Task/Day-of-the-week/Seed7/day-of-the-week.seed7 b/Task/Day-of-the-week/Seed7/day-of-the-week.seed7 new file mode 100644 index 0000000000..96d717c394 --- /dev/null +++ b/Task/Day-of-the-week/Seed7/day-of-the-week.seed7 @@ -0,0 +1,13 @@ +$ include "seed7_05.s7i"; + include "time.s7i"; + +const proc: main is func + local + var integer: year is 0; + begin + for year range 2008 to 2122 do + if dayOfWeek(date(year, 12, 25)) = 7 then + writeln("Christmas comes on a sunday in " <& year); + end if; + end for; + end func; diff --git a/Task/Day-of-the-week/Suneido/day-of-the-week.suneido b/Task/Day-of-the-week/Suneido/day-of-the-week.suneido new file mode 100644 index 0000000000..e75caeaadc --- /dev/null +++ b/Task/Day-of-the-week/Suneido/day-of-the-week.suneido @@ -0,0 +1,7 @@ +year = 2008 +while (year <= 2121) + { + if Date('#' $ year $ '1225').WeekDay() is 0 + Print(year) + ++year + } diff --git a/Task/Day-of-the-week/TI-83-BASIC/day-of-the-week.ti-83 b/Task/Day-of-the-week/TI-83-BASIC/day-of-the-week.ti-83 new file mode 100644 index 0000000000..26e010e4db --- /dev/null +++ b/Task/Day-of-the-week/TI-83-BASIC/day-of-the-week.ti-83 @@ -0,0 +1,5 @@ +:For(A, 2008,2121 +:dayofWk(A,12,25 +:If Ans=1 +:Disp A +:End diff --git a/Task/Day-of-the-week/TUSCRIPT/day-of-the-week.tuscript b/Task/Day-of-the-week/TUSCRIPT/day-of-the-week.tuscript new file mode 100644 index 0000000000..60745b9d08 --- /dev/null +++ b/Task/Day-of-the-week/TUSCRIPT/day-of-the-week.tuscript @@ -0,0 +1,6 @@ +$$ MODE TUSCRIPT +PRINT "25th of December will be a Sunday in the following years: " +LOOP year=2008,2121 +SET dayofweek = DATE (number,25,12,year,nummer) +IF (dayofweek==7) PRINT year +ENDLOOP diff --git a/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-1.sh b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-1.sh new file mode 100644 index 0000000000..b738537fe7 --- /dev/null +++ b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-1.sh @@ -0,0 +1,8 @@ +#! /bin/bash + +for (( i=2008; i<=2121; ++i )) +do + date -d "$i-12-25" +done |grep Sun + +exit 0 diff --git a/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-2.sh b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-2.sh new file mode 100644 index 0000000000..976d392058 --- /dev/null +++ b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-2.sh @@ -0,0 +1,5 @@ +Sun Dec 25 00:00:00 CET 2011 +Sun Dec 25 00:00:00 CET 2016 +Sun Dec 25 00:00:00 CET 2022 +Sun Dec 25 00:00:00 CET 2033 +date: invalid date `2038-12-25' diff --git a/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-3.sh b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-3.sh new file mode 100644 index 0000000000..134b2355eb --- /dev/null +++ b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-3.sh @@ -0,0 +1,28 @@ +bash-3.00$ date --version +date (coreutils) 5.2.1 +Written by David MacKenzie. + +Copyright (C) 2004 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +bash-3.00$ uname -a +Linux brslln01 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:56:44 EST 2007 x86_64 x86_64 x86_64 GNU/Linux +bash-3.00$ for((i=2009; i <= 2121; i++)); do date -d "$i-12-25" |egrep Sun; done +Sun Dec 25 00:00:00 GMT 2011 +Sun Dec 25 00:00:00 GMT 2016 +Sun Dec 25 00:00:00 GMT 2022 +Sun Dec 25 00:00:00 GMT 2033 +Sun Dec 25 00:00:00 GMT 2039 +Sun Dec 25 00:00:00 GMT 2044 +Sun Dec 25 00:00:00 GMT 2050 +Sun Dec 25 00:00:00 GMT 2061 +Sun Dec 25 00:00:00 GMT 2067 +Sun Dec 25 00:00:00 GMT 2072 +Sun Dec 25 00:00:00 GMT 2078 +Sun Dec 25 00:00:00 GMT 2089 +Sun Dec 25 00:00:00 GMT 2095 +Sun Dec 25 00:00:00 GMT 2101 +Sun Dec 25 00:00:00 GMT 2107 +Sun Dec 25 00:00:00 GMT 2112 +Sun Dec 25 00:00:00 GMT 2118 +bash-3.00$ diff --git a/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-4.sh b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-4.sh new file mode 100644 index 0000000000..a9d913ae89 --- /dev/null +++ b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-4.sh @@ -0,0 +1 @@ +seq 2008 2121 | xargs -IYEAR -n 1 date +%c -d 'Dec 25 YEAR' | grep Sun diff --git a/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-5.sh b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-5.sh new file mode 100644 index 0000000000..b3abe24695 --- /dev/null +++ b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-5.sh @@ -0,0 +1,5 @@ +y=2008 +while test $y -lt 2122; do + cal 12 $y | tail +3 | cut -c1-2 | grep -Fq 25 && echo 25 Dec $y + y=`expr $y + 1` +done diff --git a/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-6.sh b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-6.sh new file mode 100644 index 0000000000..fd1d6974d8 --- /dev/null +++ b/Task/Day-of-the-week/UNIX-Shell/day-of-the-week-6.sh @@ -0,0 +1,3 @@ +zmodload zsh/datetime +for (( year = 2010; year <= 2121; year++ )); + if [[ $(strftime '%A' $(strftime -r '%F' $year-12-25)) == Sunday ]] print $year diff --git a/Task/Day-of-the-week/Ursala/day-of-the-week.ursala b/Task/Day-of-the-week/Ursala/day-of-the-week.ursala new file mode 100644 index 0000000000..6665a3eae2 --- /dev/null +++ b/Task/Day-of-the-week/Ursala/day-of-the-week.ursala @@ -0,0 +1,9 @@ +#import std +#import nat +#import stt + +christmases = time_to_string* string_to_time*TS 'Dec 25 0:0:0 '-*@hS %nP* nrange/2008 2121 + +#show+ + +sunday_years = ~&zS sep` * =]'Sun'*~ christmases diff --git a/Task/Day-of-the-week/Vedit-macro-language/day-of-the-week.vedit b/Task/Day-of-the-week/Vedit-macro-language/day-of-the-week.vedit new file mode 100644 index 0000000000..5f845baea6 --- /dev/null +++ b/Task/Day-of-the-week/Vedit-macro-language/day-of-the-week.vedit @@ -0,0 +1,8 @@ +Buf_Switch(Buf_Free) +for (#3 = 2008; #3 < 2122; #3++) { + Reg_Set(10, "12/25/") + Num_Str(#3, 10, LEFT+APPEND) + if (JDate(@10) % 7 == 0) { + Num_Ins(#3, NOCR) + } +} diff --git a/Task/Day-of-the-week/XPL0/day-of-the-week.xpl0 b/Task/Day-of-the-week/XPL0/day-of-the-week.xpl0 new file mode 100644 index 0000000000..125ccaad68 --- /dev/null +++ b/Task/Day-of-the-week/XPL0/day-of-the-week.xpl0 @@ -0,0 +1,14 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations + +proc WeekDay(Year, Month, Day); \Return day of week (0=Sat 1=Sun..6=Fri) +int Year, Month, Day; +[if Month<=2 then [Month:= Month+12; Year:= Year-1]; +return rem((Day + (Month+1)*26/10 + Year + Year/4 + Year/100*6 + Year/400) / 7); +]; \WeekDay + + +int Year; +[for Year:= 2008 to 2121 do + if WeekDay(Year, 12, 25) = 1 then \25th of December is a Sunday + [IntOut(0, Year); CrLf(0)]; +] diff --git a/Task/Deal-cards-for-FreeCell/OCaml/deal-cards-for-freecell.ocaml b/Task/Deal-cards-for-FreeCell/OCaml/deal-cards-for-freecell.ocaml new file mode 100644 index 0000000000..7335bf6950 --- /dev/null +++ b/Task/Deal-cards-for-FreeCell/OCaml/deal-cards-for-freecell.ocaml @@ -0,0 +1,41 @@ +let srnd x = + (* since OCaml's built-in int type is at least 31 (note: not 32) bits wide, + and this problem takes mod 2^31, it is just enough if we treat it as + an unsigned integer, which means taking the logical right shift *) + let seed = ref x in + fun () -> + seed := (!seed * 214013 + 2531011) land 0x7fffffff; + !seed lsr 16 + +let deal s = + let rnd = srnd s in + let t = Array.init 52 (fun i -> i) in + let cards = + Array.init 52 (fun j -> + let n = 52 - j in + let i = rnd() mod n in + let this = t.(i) in + t.(i) <- t.(pred n); + this) + in + (cards) + +let show cards = + let suits = "CDHS" + and nums = "A23456789TJQK" in + Array.iteri (fun i card -> + Printf.printf "%c%c%c" + nums.[card / 4] + suits.[card mod 4] + (if (i mod 8) = 7 then '\n' else ' ') + ) cards; + print_newline() + +let () = + let s = + try int_of_string Sys.argv.(1) + with _ -> 11982 + in + Printf.printf "Deal %d:\n" s; + let cards = deal s in + show cards diff --git a/Task/Deal-cards-for-FreeCell/PARI-GP/deal-cards-for-freecell.pari b/Task/Deal-cards-for-FreeCell/PARI-GP/deal-cards-for-freecell.pari new file mode 100644 index 0000000000..9ac6e3c9b8 --- /dev/null +++ b/Task/Deal-cards-for-FreeCell/PARI-GP/deal-cards-for-freecell.pari @@ -0,0 +1,13 @@ +card(n)=concat(["A","2","3","4","5","6","7","8","9","T","J","Q","K"][n\4+1],["C","D","H","S"][n%4+1]); +nextrand()={ + (state=(214013*state+2531011)%2^31)>>16 +}; +deal(seed)={ + my(deck=vector(52,n,n-1),t); + local(state=seed); + forstep(last=52,1,-1, + t=nextrand()%last+1; + print1(card(deck[t]),if(last%8==5,"\n"," ")); + deck[t]=deck[last] + ) +}; diff --git a/Task/Deal-cards-for-FreeCell/Perl-6/deal-cards-for-freecell.pl6 b/Task/Deal-cards-for-FreeCell/Perl-6/deal-cards-for-freecell.pl6 new file mode 100644 index 0000000000..3780ade72d --- /dev/null +++ b/Task/Deal-cards-for-FreeCell/Perl-6/deal-cards-for-freecell.pl6 @@ -0,0 +1,18 @@ +my $game_number = @*ARGS.shift || 1; + +sub ms_lcg_method ($seed) { ( 214013 * $seed + 2531011 ) % 2**31 }; + +# lazy list of the random sequence +my @ms_lcg := gather take $_ +> 16 + for ( $game_number.&ms_lcg_method, -> $seed { $seed.&ms_lcg_method } ... * ); + +my @deck = X~ <♣ ♦ ♥ ♠>; + +my @game = gather while @deck { + my $index = @ms_lcg.shift % @deck; + take @deck[$index]; + @deck[$index] = @deck.pop; +} + +say "Game #$game_number"; +say @game.splice(0, min(@game.elems, 8)) while @game; diff --git a/Task/Deal-cards-for-FreeCell/PureBasic/deal-cards-for-freecell.purebasic b/Task/Deal-cards-for-FreeCell/PureBasic/deal-cards-for-freecell.purebasic new file mode 100644 index 0000000000..9ba5e61d86 --- /dev/null +++ b/Task/Deal-cards-for-FreeCell/PureBasic/deal-cards-for-freecell.purebasic @@ -0,0 +1,47 @@ +#MaxCardNum = 51 ;zero-based count of cards in a deck +Global deckSize +Global Dim cards(#MaxCardNum) ;card with highest index is at the top of deck + +Procedure RNG(seed.q = -1) + Static state.q + If seed >= 0 + state = seed + Else + state = (state * 214013 + 2531011) % (1 << 31) + ProcedureReturn state >> 16 + EndIf +EndProcedure + +Procedure makeDeck(hand) + Protected i, c + For i = 0 To #MaxCardNum: cards(i) = i: Next + + RNG(hand) ;set seed value + deckSize = #MaxCardNum + While deckSize + c = RNG() % (deckSize + 1) + Swap cards(c), cards(deckSize) + deckSize - 1 + Wend + deckSize = #MaxCardNum +EndProcedure + +Procedure showDeck(hand) + Protected i, c + PrintN("Hand #" + Str(hand)) + makeDeck(hand) + For i = 0 To #MaxCardNum + c = cards(#MaxCardNum - i) + Print(" " + Mid("A23456789TJQK", (c / 4) + 1, 1) + Mid("CDHS",(c % 4) + 1, 1)) + If (i + 1) % 8 = 0 Or i = #MaxCardNum: PrintN(""): EndIf + Next +EndProcedure + +If OpenConsole() + showDeck(1) + showDeck(617) + showDeck(11982) + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Deal-cards-for-FreeCell/Run-BASIC/deal-cards-for-freecell.run b/Task/Deal-cards-for-FreeCell/Run-BASIC/deal-cards-for-freecell.run new file mode 100644 index 0000000000..25d18a267f --- /dev/null +++ b/Task/Deal-cards-for-FreeCell/Run-BASIC/deal-cards-for-freecell.run @@ -0,0 +1,33 @@ +projectDir$ = "a_project" ' project directory +imageDir$ = DefaultDir$ + "\projects\" + projectDir$ + "\image\" ' directory of deck images +imagePath$ = "../";projectDir$;"/image/" ' path of deck images + +suite$ = "C,D,H,S" ' Club,Diamond,Hart,Spaces +card$ = "A,2,3,4,5,6,7,8,9,T,J,Q,K" ' Cards Ace to King + +dim n(55) ' make ordered deck +for i = 1 to 52 ' of 52 cards + n(i) = i +next i + +for i = 1 to 52 * 3 ' shuffle deck 3 times + i1 = int(rnd(1)*52) + 1 + i2 = int(rnd(1)*52) + 1 + h2 = n(i1) + n(i1) = n(i2) + n(i2) = h2 +next i + +for yy = 1 to 8 ' display 7 across and 8 down + for xx = 1 to 7 + card = card + 1 + s = (n(card) mod 4) + 1 ' determine suite + c = (n(card) mod 13) + 1 ' determine card + cardId$ = word$(card$,c,",");word$(suite$,s,",");".gif" + html "
" + html "" + html "
" + if card = 52 then end ' out of cards + next xx +next yy diff --git a/Task/Deal-cards-for-FreeCell/UNIX-Shell/deal-cards-for-freecell.sh b/Task/Deal-cards-for-FreeCell/UNIX-Shell/deal-cards-for-freecell.sh new file mode 100644 index 0000000000..99294c2331 --- /dev/null +++ b/Task/Deal-cards-for-FreeCell/UNIX-Shell/deal-cards-for-freecell.sh @@ -0,0 +1,22 @@ +test $# -gt 0 || set -- $((RANDOM % 32000)) +for seed; do + print Game $seed: + + # Shuffle deck. + deck=({A,{2..9},T,J,Q,K}{C,D,H,S}) + for i in {52..1}; do + ((seed = (214013 * seed + 2531011) & 0x7fffffff)) + ((j = (seed >> 16) % i + 1)) + t=$deck[$i] + deck[$i]=$deck[$j] + deck[$j]=$t + done + + # Deal cards. + print -n ' ' + for i in {52..1}; do + print -n ' '$deck[$i] + ((i % 8 == 5)) && print -n $'\n ' + done + print +done diff --git a/Task/Deal-cards-for-FreeCell/XPL0/deal-cards-for-freecell.xpl0 b/Task/Deal-cards-for-FreeCell/XPL0/deal-cards-for-freecell.xpl0 new file mode 100644 index 0000000000..d51615d0da --- /dev/null +++ b/Task/Deal-cards-for-FreeCell/XPL0/deal-cards-for-freecell.xpl0 @@ -0,0 +1,24 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +string 0; \use zero-terminated string convention +int RandState; + +func Rand; \Random number in range 0 to 32767 +[RandState:= (214013*RandState + 2531011) & $7FFF_FFFF; +return RandState >> 16; +]; + +int Card, Deck(52), Size; +char Suit, Rank; +[RandState:= IntIn(8); \seed RNG with number from command line +for Card:= 0 to 52-1 do Deck(Card):= Card; \create array of 52 cards +Rank:= "A23456789TJQK"; +Suit:= "CDHS"; +Size:= 52; +repeat Card:= rem(Rand/Size); \choose a random card + ChOut(0, Rank(Deck(Card)/4)); \deal it by showing it + ChOut(0, Suit(rem(0))); + if rem(Size/8)=5 then CrLf(0) else ChOut(0, ^ ); + Size:= Size-1; \one less card in deck + Deck(Card):= Deck(Size); \replace dealt card with last card +until Size = 0; \all cards have been dealt +] diff --git a/Task/Death-Star/Mathematica/death-star.mathematica b/Task/Death-Star/Mathematica/death-star.math similarity index 100% rename from Task/Death-Star/Mathematica/death-star.mathematica rename to Task/Death-Star/Mathematica/death-star.math diff --git a/Task/Death-Star/Openscad/death-star.scad b/Task/Death-Star/Openscad/death-star.scad new file mode 100644 index 0000000000..48948c0691 --- /dev/null +++ b/Task/Death-Star/Openscad/death-star.scad @@ -0,0 +1,19 @@ +// We are performing geometric subtraction + +difference() { + + // Create the primary sphere of radius 60 centred at the origin + + translate(v = [0,0,0]) { + sphere(60); + } + + /*Subtract an overlapping sphere with a radius of 40 + The resultant hole will be smaller than this, because we only + only catch the edge + */ + + translate(v = [0,90,0]) { + sphere(40); + } +} diff --git a/Task/Death-Star/POV-Ray/death-star.pov-ray b/Task/Death-Star/POV-Ray/death-star.pov-ray new file mode 100644 index 0000000000..7060b46550 --- /dev/null +++ b/Task/Death-Star/POV-Ray/death-star.pov-ray @@ -0,0 +1,17 @@ +camera { perspective location <0.0 , .8 ,-3.0> look_at 0 + aperture .1 blur_samples 20 variance 1/100000 focal_point 0} + +light_source{< 3,3,-3> color rgb 1} + +sky_sphere { pigment{ color rgb <0,.2,.5>}} + +plane {y,-5 pigment {color rgb .54} normal {hexagon} } + +difference { + sphere { 0,1 } + sphere { <-1,1,-1>,1 } + texture { + pigment{ granite } + finish { phong 1 reflection {0.10 metallic 0.5} } + } +} diff --git a/Task/Death-Star/Perl-6/death-star.pl6 b/Task/Death-Star/Perl-6/death-star.pl6 new file mode 100644 index 0000000000..edd584b3c7 --- /dev/null +++ b/Task/Death-Star/Perl-6/death-star.pl6 @@ -0,0 +1,86 @@ +class sphere { + has $.cx; # center x coordinate + has $.cy; # center y coordinate + has $.cz; # center z coordinate + has $.r; # radius +} + +my $depth = 255; # image color depth + +my $x = my $y = 255; # dimensions of generated .pgm; must be odd + +my $s = ($x - 1)/2; # scaled dimension to build geometry + +my @light = normalize([ 4, -1, -3 ]); + +# positive sphere at origin +my $pos = sphere.new( + cx => 0, + cy => 0, + cz => 0, + r => $s.Int +); + +# negative sphere offset to upper left +my $neg = sphere.new( + cx => (-$s*.90).Int, + cy => (-$s*.90).Int, + cz => (-$s*.3).Int, + r => ($s*.7).Int +); + +sub MAIN ($outfile = 'deathstar-perl6.pgm') { + my $out = open( $outfile, :w, :bin ) or die "$!\n"; + $out.say("P5\n$x $y\n$depth"); # .pgm header + say 'Calculating row:'; + $out.print( draw_ds(3, .15)».chrs ); + $out.close; +} + +sub draw_ds ( $k, $ambient ) { + my @pixels; + my $bs = "\b" x 8; + for ($pos.cy - $pos.r) .. ($pos.cy + $pos.r) -> $y { + note $bs, $y, ' '; # monitor progress + for ($pos.cx - $pos.r) .. ($pos.cx + $pos.r) -> $x { + # black if we don't hit positive sphere, ignore negative sphere + if not hit($pos, $x, $y, my $posz) { + @pixels.push(0); + next; + } + my @vec; + # is front of positive sphere inside negative sphere? + if hit($neg, $x, $y, my $negz) and $negz.min < $posz.min < $negz.max { + # make black if whole positive sphere eaten here + if $negz.min < $posz.max < $negz.max { @pixels.push(0); next; } + # render inside of negative sphere + @vec = normalize([$neg.cx - $x, $neg.cy - $y, -$negz.max - $neg.cz]); + } + else { + # render outside of positive sphere + @vec = normalize([$x - $pos.cx, $y - $pos.cy, $posz.max - $pos.cz]); + } + my $intensity = dot(@light, @vec) ** $k + $ambient; + @pixels.push( ($intensity * $depth).Int min $depth ); + } + } + say $bs, 'Writing file.'; + return @pixels; +} + +# normalize a vector +sub normalize (@vec) { return @vec »/» ([+] @vec Z* @vec).sqrt } + +# dot product of two vectors +sub dot (@x, @y) { return -([+] @x Z* @y) max 0 } + +# are the coordinates within the radius of the sphere? +sub hit ($sphere, $x is copy, $y is copy, $z is rw) { + $x -= $sphere.cx; + $y -= $sphere.cy; + my $z2 = $sphere.r * $sphere.r - $x * $x - $y * $y; + return 0 if $z2 < 0; + $z2 = $z2.sqrt; + $z = $sphere.cz - $z2 .. $sphere.cz + $z2; + return 1; +} diff --git a/Task/Deconvolution-1D/Mathematica/deconvolution-1d.mathematica b/Task/Deconvolution-1D/Mathematica/deconvolution-1d.math similarity index 100% rename from Task/Deconvolution-1D/Mathematica/deconvolution-1d.mathematica rename to Task/Deconvolution-1D/Mathematica/deconvolution-1d.math diff --git a/Task/Deconvolution-1D/Perl-6/deconvolution-1d.pl6 b/Task/Deconvolution-1D/Perl-6/deconvolution-1d.pl6 new file mode 100644 index 0000000000..edaec53b6e --- /dev/null +++ b/Task/Deconvolution-1D/Perl-6/deconvolution-1d.pl6 @@ -0,0 +1,79 @@ +sub deconvolve (@g, @f) { + my $h = 1 + @g - @f; + my @m; + @m[^@g]>>.[^$h] >>+=>> 0; + @m[^@g]>>.[$h] >>=<< @g; + for ^$h -> $j { for @f.kv -> $k, $v { @m[$j + $k][$j] = $v } } + return rref( @m )[^$h]>>.[$h]; +} + +sub convolve (@f, @h) { + my @g = 0 xx + @f + @h - 1; + @g[^@f X+ ^@h] >>+=<< (@f X* @h); + return @g; +} + +# Reduced Row Echelon Form simultaneous equation solver. +# Can handle over-specified systems of equations. +# (n unknowns in n + m equations) +sub rref ($m is rw) { + return unless $m; + my ($lead, $rows, $cols) = 0, +$m, +$m[0]; + + # Trim off over specified rows if they exist. + # Not strictly necessary, but can save a lot of + # redundant calculations. + if $rows >= $cols { + $m = trim_system($m); + $rows = +$m; + } + + for ^$rows -> $r { + $lead < $cols or return $m; + my $i = $r; + until $m[$i][$lead] { + ++$i == $rows or next; + $i = $r; + ++$lead == $cols and return $m; + } + $m[$i, $r] = $m[$r, $i] if $r != $i; + my $lv = $m[$r][$lead]; + $m[$r] >>/=>> $lv; + for ^$rows -> $n { + next if $n == $r; + $m[$n] >>-=>> $m[$r] >>*>> $m[$n][$lead]; + } + ++$lead; + } + return $m; + + # Reduce a system of equations to n equations with n unknowns. + # Looks for an equation with a true value for each position. + # If it can't find one, assumes that it has already taken one + # and pushes in the first equation it sees. This assumtion + # will alway be successful except in some cases where an + # under-specified system has been supplied, in which case, + # it would not have been able to reduce the system anyway. + sub trim_system ($m is rw) { + my ($vars, @t) = +$m[0]-1, (); + for ^$vars -> $lead { + for ^$m -> $row { + @t.push( $m.splice( $row, 1 ) ) and last if $m[$row][$lead]; + } + } + while (+@t < $vars) and +$m { @t.push( $m.splice( 0, 1 ) ) }; + return @t; + } +} + + +my @h = (-8,-9,-3,-1,-6,7); +my @f = (-3,-6,-1,8,-6,3,-1,-9,-9,3,-2,5,2,-2,-7,-1); +my @g = (24,75,71,-34,3,22,-45,23,245,25,52,25,-67,-96,96,31,55,36,29,-43,-7); + + +.say for ~@g, ~convolve(@f, @h),''; + +.say for ~@h, ~deconvolve(@g, @f),''; + +.say for ~@f, ~deconvolve(@g, @h),''; diff --git a/Task/Deconvolution-1D/Ursala/deconvolution-1d-1.ursala b/Task/Deconvolution-1D/Ursala/deconvolution-1d-1.ursala new file mode 100644 index 0000000000..5767ca9133 --- /dev/null +++ b/Task/Deconvolution-1D/Ursala/deconvolution-1d-1.ursala @@ -0,0 +1,6 @@ +#import std +#import nat + +band = pad0+ ~&rSS+ zipt^*D(~&r,^lrrSPT/~<K33tx zipt^/~&r ~&lSNyCK33+ zipp0)^/~&rx ~&B->NlNSPC ~&bt + +deconv = lapack..dgelsd^\~&l ~&||0.!**+ band diff --git a/Task/Deconvolution-1D/Ursala/deconvolution-1d-2.ursala b/Task/Deconvolution-1D/Ursala/deconvolution-1d-2.ursala new file mode 100644 index 0000000000..5b49030663 --- /dev/null +++ b/Task/Deconvolution-1D/Ursala/deconvolution-1d-2.ursala @@ -0,0 +1,11 @@ +h = <-8.,-9.,-3.,-1.,-6.,7.> +f = <-3.,-6.,-1.,8.,-6.,3.,-1.,-9.,-9.,3.,-2.,5.,2.,-2.,-7.,-1.> +g = <24.,75.,71.,-34.,3.,22.,-45.,23.,245.,25.,52.,25.,-67.,-96.,96.,31.,55.,36.,29.,-43.,-7.> + +#cast %eLm + +test = + +< + 'h': deconv(g,f), + 'f': deconv(g,h)> diff --git a/Task/Deconvolution-2D+/Mathematica/deconvolution-2d+.mathematica b/Task/Deconvolution-2D+/Mathematica/deconvolution-2d+.math similarity index 100% rename from Task/Deconvolution-2D+/Mathematica/deconvolution-2d+.mathematica rename to Task/Deconvolution-2D+/Mathematica/deconvolution-2d+.math diff --git a/Task/Deconvolution-2D+/Perl-6/deconvolution-2d+-1.pl6 b/Task/Deconvolution-2D+/Perl-6/deconvolution-2d+-1.pl6 new file mode 100644 index 0000000000..9af5aef5ba --- /dev/null +++ b/Task/Deconvolution-2D+/Perl-6/deconvolution-2d+-1.pl6 @@ -0,0 +1,134 @@ +# Deconvolution of N dimensional matricies. +sub deconv_ND ( @g, @f ) { + my @gsize = size_of @g; + my @fsize = size_of @f; + my @hsize = @gsize >>-<< @fsize >>+>> 1; + + my @toSolve = loopcoords(@gsize).map: + { [row(@g, @f, @gsize, $^coords, @fsize, @hsize)] }; + + my @solved = rref( @toSolve ); + + # Uncomment if you want to see the rref system of equations. + # pretty_print( @solved ); + + my @h; + my $index = 0; + insert(@h, $_, @solved[$index++][*-1]) for loopcoords(@hsize); + return @h; + + # Inserts a value in the correct spot in an N dimensional array. + sub insert ( $array is rw, @coords is copy, $value ) { + my $level = @coords.shift; + if +@coords { + insert( $array[$level], @coords, $value ); + } else { + $array[$level] = $value; + } + } +} + +# Returns a list containing the number of elements in +# each level of an N dimensional array. +sub size_of ( $m is copy ) { + my @size; + while $m ~~ Array { @size.push(+$m); $m = $m[0]; } + return @size; +} + +# Construct a row (equation) for each value in @g to be sent +# to the simultaneous equation solver. +# @Xsize = Dimensions of @X, # of elems per level. +# @Xcoords = Path to each element of @X given as a series of indicies. +sub row ( @g, @f, @gsize, @gcoords, @fsize, $hsize ) { + my @row; + for loopcoords( $hsize ) -> @hcoords { + my @fcoords; + for ^@hcoords -> $index { + my $window = @gcoords[$index] - @hcoords[$index]; + @fcoords.push($window) and next if 0 <= $window < @fsize[$index]; + last; + } + @row.push( +@fcoords == +@hcoords ?? fetch( @f, |@fcoords ) !! 0 ); + } + @row.push( fetch( @g, |@gcoords ) ); + return @row; + + # Returns the value found in @array with the + # coordinates given in the list of @indicies. + sub fetch (@array, *@indicies) { + my $index = @indicies.shift; + return @array[*-1] ~~ Array + ?? fetch( @array[$index], @indicies ) + !! @array[$index]; + } +} + +# Constructs an array of arrays of coordinates to each +# element in an N dimensional array. +sub loopcoords ( @hsize ) { + my @hcoords; + for ^([*] @hsize) -> $index { + my @coords; + my $j = $index; + for @hsize -> $dim { + @coords.push( $j % $dim ); + $j div= $dim; + } + @hcoords.push( [@coords] ); + } + return @hcoords; +} + +# Reduced Row Echelon Form simultaneous equation solver. +# Can handle over-specified systems of equations. +# (n unknowns in n + m equations) +sub rref ($m is rw) { + return unless $m; + my ($lead, $rows, $cols) = 0, +$m, +$m[0]; + + # Trim off over specified rows if they exist. + # Not strictly necessary, but can save a lot of + # redundant calculations. + if $rows >= $cols { + $m = trim_system($m); + $rows = +$m; + } + + for ^$rows -> $r { + $lead < $cols or return $m; + my $i = $r; + until $m[$i][$lead] { + ++$i == $rows or next; + $i = $r; + ++$lead == $cols and return $m; + } + $m[$i, $r] = $m[$r, $i] if $r != $i; + my $lv = $m[$r][$lead]; + $m[$r] >>/=>> $lv; + for ^$rows -> $n { + next if $n == $r; + $m[$n] >>-=>> $m[$r] >>*>> $m[$n][$lead]; + } + ++$lead; + } + return $m; + + # Reduce a system of equations to n equations with n unknowns. + # Looks for an equation with a true value for each position. + # If it can't find one, assumes that it has already taken one + # and pushes in the first equation it sees. This assumtion + # will alway be successful except in some cases where an + # under-specified system has been supplied, in which case, + # it would not have been able to reduce the system anyway. + sub trim_system ($m is rw) { + my ($vars, @t) = +$m[0]-1, (); + for ^$vars -> $lead { + for ^$m -> $row { + @t.push( $m.splice( $row, 1 ) ) and last if $m[$row][$lead]; + } + } + while (+@t < $vars) and +$m { @t.push( $m.splice( 0, 1 ) ) }; + return @t; + } +} diff --git a/Task/Deconvolution-2D+/Perl-6/deconvolution-2d+-2.pl6 b/Task/Deconvolution-2D+/Perl-6/deconvolution-2d+-2.pl6 new file mode 100644 index 0000000000..ab5fbc7417 --- /dev/null +++ b/Task/Deconvolution-2D+/Perl-6/deconvolution-2d+-2.pl6 @@ -0,0 +1,73 @@ +# Pretty printer for N dimensional arrays. Assumes that +# if the FIRST element in any particular level is an array, +# then ALL the elements at that level are arrays. +sub pretty_print ( @array, $indent = 0 ) { + my $tab = 2; + if @array[0] ~~ Array { + say ' ' x $indent,"["; + pretty_print( $_, $indent + $tab ) for @array; + say ' ' x $indent, "]{$indent??','!!''}"; + } else { + say ' ' x $indent, "[{say_it(@array)} ]{$indent??','!!''}"; + } + + sub say_it ( @array ) { + return join ",", @array>>.fmt("%4s"); + } +} + +my @f = ( + [ + [ -9, 5, -8 ], [ 3, 5, 1 ], + ], + [ + [ -1, -7, 2 ], [ -5, -6, 6 ], + ], + [ + [ 8, 5, 8 ], [ -2, -6, -4 ], + ] +); + +my @g = ( + [ + [ 54, 42, 53, -42, 85, -72 ], + [ 45,-170, 94, -36, 48, 73 ], + [ -39, 65,-112, -16, -78, -72 ], + [ 6, -11, -6, 62, 49, 8 ], + ], + [ + [ -57, 49, -23, 52,-135, 66 ], + [ -23, 127, -58, -5,-118, 64 ], + [ 87, -16, 121, 23, -41, -12 ], + [ -19, 29, 35,-148, -11, 45 ], + ], + [ + [ -55,-147,-146, -31, 55, 60 ], + [ -88, -45, -28, 46, -26,-144 ], + [ -12,-107, -34, 150, 249, 66 ], + [ 11, -15, -34, 27, -78, -50 ], + ], + [ + [ 56, 67, 108, 4, 2, -48 ], + [ 58, 67, 89, 32, 32, -8 ], + [ -42, -31,-103, -30, -23, -8 ], + [ 6, 4, -26, -10, 26, 12 ], + ] +); + +=begin skip_output + +say "g ="; +pretty_print( @g ); + +say '-' x 79; + +say "f ="; +pretty_print( @f ); + +say '-' x 79; +=end skip_output + +say "# {+size_of(@f)}D array:"; +say "h ="; +pretty_print( deconv_ND( @g, @f ) ); diff --git a/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-1.ursala b/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-1.ursala new file mode 100644 index 0000000000..fb4dd6dc64 --- /dev/null +++ b/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-1.ursala @@ -0,0 +1,14 @@ +#import std +#import nat + +break = ~&r**+ zipt*+ ~&lh*~+ ~&lzyCPrX|\+ -*^|\~&tK33 :^/~& 0!*t + +band = pad0+ ~&rSS+ zipt^*D(~&r,^lrrSPT/~<K33tx zipt^/~&r ~&lSNyCK33+ zipp0)^/~&rx ~&B->NlNSPC ~&bt + +deconv = # takes a natural number n to the n-dimensional deconvolution function + +~&?\math..div! iota; ~&!*; @h|\; (~&al^?\~&ar break@alh2faltPrXPRX)^^( + ~&B->NlC~&bt*++ gang@t+ ~~*, + lapack..dgelsd^^( + (~&||0.!**+ ~&B^?a\~&Y@a ^lriFhNSS2iDrlYSK7LS2SL2rQ/~&alt band@alh2faltPrDPMX)^|\~&+ gang, + @t =>~&l ~&L+@r)) diff --git a/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-2.ursala b/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-2.ursala new file mode 100644 index 0000000000..df58d3aae5 --- /dev/null +++ b/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-2.ursala @@ -0,0 +1,13 @@ +deconv = # takes a number n to the n-dimensional deconvolution function + +~&?\math..div! iota; ~&!*; @h|\; -+ + //+ ~&al^?\~&ar @alh2faltPrXPRX @liX ~&arr2arl2arrh3falrbt2XPRXlrhPCrtPCPNfallrrPXXPRCQNNCq, + ^^/-+~&B->NlC~&bt*+,gang@t,~~*+- (umf..di_a_trp^/~&DSLlrnPXrmPXS+num@lmS ^niK10mS/num@r ~&lnS)^^( + gang; ^|\~&; //+ -+ + ^niK10/~& @NnmlSPASX ~&r->lL @lrmK2K8SmtPK20PPPX ^/~&rrnS2lC ~&rnPrmPljASmF@rrmhPSPlD, + num+ ~&B^?a\~&Y@a -+ + ~&l?\~&r *=r ~&K7LS+ * (*D ^\~&rr sum@lrlPX)^*D\~&r product^|/~& successor@zhl, + ^/~&alt @alh2faltPrDPMX -+ + ~&rFS+ num*rSS+ zipt^*D/~&r ^lrrSPT/~<K33tx zipt^/~&r ~&lSNyCK33+ zipp0, + ^/~&rx ~&B->NlNSPC ~&bt+-+-+-, + @t =>~&l ~&L+@r)+- diff --git a/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-3.ursala b/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-3.ursala new file mode 100644 index 0000000000..d806a9ccba --- /dev/null +++ b/Task/Deconvolution-2D+/Ursala/deconvolution-2d+-3.ursala @@ -0,0 +1,34 @@ +h = <<<-6.,-8.,-5.,9.>,<-7.,9.,-6.,-8.>,<2.,-7.,9.,8.>>,<<7.,4.,4.,-6.>,<9.,9.,4.,-4.>,<-3.,7.,-2.,-3.>>> +f = <<<-9.,5.,-8.>,<3.,5.,1.>>,<<-1.,-7.,2.>,<-5.,-6.,6.>>,<<8.,5.,8.>,<-2.,-6.,-4.>>> + +g = + +< + < + <54.,42.,53.,-42.,85.,-72.>, + <45.,-170.,94.,-36.,48.,73.>, + <-39.,65.,-112.,-16.,-78.,-72.>, + <6.,-11.,-6.,62.,49.,8.>>, + < + <-57.,49.,-23.,52.,-135.,66.>, + <-23.,127.,-58.,-5.,-118.,64.>, + <87.,-16.,121.,23.,-41.,-12.>, + <-19.,29.,35.,-148.,-11.,45.>>, + < + <-55.,-147.,-146.,-31.,55.,60.>, + <-88.,-45.,-28.,46.,-26.,-144.>, + <-12.,-107.,-34.,150.,249.,66.>, + <11.,-15.,-34.,27.,-78.,-50.>>, + < + <56.,67.,108.,4.,2.,-48.>, + <58.,67.,89.,32.,32.,-8.>, + <-42.,-31.,-103.,-30.,-23.,-8.>, + <6.,4.,-26.,-10.,26.,12.>>> + +#cast %eLLLm + +test = + +< + 'h': deconv3(g,f), + 'f': deconv3(g,h)> diff --git a/Task/Deepcopy/OCaml/deepcopy-1.ocaml b/Task/Deepcopy/OCaml/deepcopy-1.ocaml new file mode 100644 index 0000000000..cb12281cc2 --- /dev/null +++ b/Task/Deepcopy/OCaml/deepcopy-1.ocaml @@ -0,0 +1,16 @@ +let rec copy t = + if Obj.is_int t then t else + let tag = Obj.tag t in + if tag = Obj.double_tag then t else + if tag = Obj.closure_tag then t else + if tag = Obj.string_tag then Obj.repr (String.copy (Obj.obj t)) else + if tag = 0 || tag = Obj.double_array_tag then begin + let size = Obj.size t in + let r = Obj.new_block tag size in + for i = 0 to pred size do + Obj.set_field r i (copy (Obj.field t i)) + done; + r + end else failwith "copy" ;; + +let copy (v : 'a) : 'a = Obj.obj (copy (Obj.repr v)) diff --git a/Task/Deepcopy/OCaml/deepcopy-2.ocaml b/Task/Deepcopy/OCaml/deepcopy-2.ocaml new file mode 100644 index 0000000000..1c7cd459ba --- /dev/null +++ b/Task/Deepcopy/OCaml/deepcopy-2.ocaml @@ -0,0 +1,3 @@ +let copy h = + { size = h.size; + data = Array.copy h.data } diff --git a/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-1.ocaml b/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-1.ocaml new file mode 100644 index 0000000000..c01c027fe5 --- /dev/null +++ b/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-1.ocaml @@ -0,0 +1,27 @@ +exception Out_of_bounds + +type 'a bounds = { min: 'a; max: 'a } + +type 'a bounded = { value: 'a; bounds: 'a bounds } + +let mk_bounds ~min ~max = { min=min; max=max } ;; +(** val mk_bounds : min:'a -> max:'a -> 'a bounds *) + +let check_bounds ~value ~bounds = + if value < bounds.min || value > bounds.max then + raise Out_of_bounds ;; +(** val check_bounds : value:'a -> bounds:'a bounds -> unit *) + +let mk_bounded ~value ~bounds = + check_bounds ~value ~bounds; + { value=value; bounds=bounds } ;; +(** val mk_bounded : value:'a -> bounds:'a bounds -> 'a bounded *) + +let op f a b = + let res = f a.value b.value in + if a.bounds <> b.bounds then + invalid_arg "different bounds"; + check_bounds res a.bounds; + (mk_bounded res a.bounds) + ;; +(** val op : ('a -> 'a -> 'a) -> 'a bounded -> 'a bounded -> 'a bounded *) diff --git a/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-2.ocaml b/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-2.ocaml new file mode 100644 index 0000000000..2e8dcb7a35 --- /dev/null +++ b/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-2.ocaml @@ -0,0 +1,14 @@ +# let range = mk_bounds 1 10 ;; +val range : int bounds = {min = 1; max = 10} + +# let a = mk_bounded 2 range ;; +val a : int bounded = {value = 2; bounds = {min = 1; max = 10}} + +# let b = mk_bounded 5 range ;; +val b : int bounded = {value = 5; bounds = {min = 1; max = 10}} + +# let c = mk_bounded 14 range ;; +Exception: Out_of_bounds. + +# op ( + ) a b ;; +- : int bounded = {value = 7; bounds = {min = 1; max = 10}} diff --git a/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-3.ocaml b/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-3.ocaml new file mode 100644 index 0000000000..626ef156a6 --- /dev/null +++ b/Task/Define-a-primitive-data-type/OCaml/define-a-primitive-data-type-3.ocaml @@ -0,0 +1,7 @@ +# let rf = mk_bounds 1.0 10.0 ;; +val rf : float bounds = {min = 1.; max = 10.} + +# let a = mk_bounded 2.2 rf + and b = mk_bounded 5.6 rf in + op ( +. ) a b ;; +- : float bounded = {value = 7.8; bounds = {min = 1.; max = 10.}} diff --git a/Task/Define-a-primitive-data-type/Oz/define-a-primitive-data-type.oz b/Task/Define-a-primitive-data-type/Oz/define-a-primitive-data-type.oz new file mode 100644 index 0000000000..57b9dda965 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Oz/define-a-primitive-data-type.oz @@ -0,0 +1,5 @@ +declare + I +in + I::1#10 + I = {Pow 2 4} diff --git a/Task/Define-a-primitive-data-type/Pascal/define-a-primitive-data-type.pascal b/Task/Define-a-primitive-data-type/Pascal/define-a-primitive-data-type.pascal new file mode 100644 index 0000000000..866b1d95ed --- /dev/null +++ b/Task/Define-a-primitive-data-type/Pascal/define-a-primitive-data-type.pascal @@ -0,0 +1,18 @@ +Program BoundInteger(output); + +{$RANGECHECKS ON} + +type + TPartialInteger = 1..10; + +var + testvar: TPartialInteger; + i: integer; + +begin + for i := 1 to 11 do + begin + writeln(i); + testvar := i; + end; +end. diff --git a/Task/Define-a-primitive-data-type/Perl-6/define-a-primitive-data-type-1.pl6 b/Task/Define-a-primitive-data-type/Perl-6/define-a-primitive-data-type-1.pl6 new file mode 100644 index 0000000000..8671ff92e6 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Perl-6/define-a-primitive-data-type-1.pl6 @@ -0,0 +1,4 @@ +subset OneToTen of Int where 1..10 + +my OneToTen $n = 5; +$n += 6; diff --git a/Task/Define-a-primitive-data-type/Perl-6/define-a-primitive-data-type-2.pl6 b/Task/Define-a-primitive-data-type/Perl-6/define-a-primitive-data-type-2.pl6 new file mode 100644 index 0000000000..b4f42a544b --- /dev/null +++ b/Task/Define-a-primitive-data-type/Perl-6/define-a-primitive-data-type-2.pl6 @@ -0,0 +1 @@ +subset Prime of Int where -> $n { $n > 1 and so $n %% none 2 .. $n.sqrt } diff --git a/Task/Define-a-primitive-data-type/Retro/define-a-primitive-data-type-1.retro b/Task/Define-a-primitive-data-type/Retro/define-a-primitive-data-type-1.retro new file mode 100644 index 0000000000..e7703cf373 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Retro/define-a-primitive-data-type-1.retro @@ -0,0 +1,7 @@ +{{ + variable update +---reveal--- + : .limited @update &! &@ if update off ; + : to dup 1 10 within [ update on ] [ drop "Out of bounds\n" puts ] if ; + : limited: create 1 , &.limited reclass ; +}} diff --git a/Task/Define-a-primitive-data-type/Retro/define-a-primitive-data-type-2.retro b/Task/Define-a-primitive-data-type/Retro/define-a-primitive-data-type-2.retro new file mode 100644 index 0000000000..7e151ddcd0 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Retro/define-a-primitive-data-type-2.retro @@ -0,0 +1,6 @@ +limited: foo +1 to foo +foo .s +51 to foo +foo .s +bye diff --git a/Task/Define-a-primitive-data-type/Toka/define-a-primitive-data-type.toka b/Task/Define-a-primitive-data-type/Toka/define-a-primitive-data-type.toka new file mode 100644 index 0000000000..58ffbc85c6 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Toka/define-a-primitive-data-type.toka @@ -0,0 +1,12 @@ +needs quotes +{ + variable update + [ update @ [ ! ] [ @ ] ifTrueFalse update off ] is action + [ dup >r 0 11 r> within [ update on ] [ drop ." Out of bounds\n " ] ifTrueFalse ] + [ ` [ invoke cell-size malloc # ` action compile ` ] invoke is ] +} is value:1-10: + is to + +value:1-10: foo +1 to foo +foo . diff --git a/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-1.ursala b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-1.ursala new file mode 100644 index 0000000000..364ef8fcf1 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-1.ursala @@ -0,0 +1,9 @@ +#import nat + +my_number :: + +the_number %n -|~bounds.&BZ,~&B+ nleq~~lrlXPrX@G+ ~/the_number bounds|-?(~the_number,<'out of bounds'>!%) +bounds %nW ~bounds.&B?(~bounds,(1,10)!) + +add = my_number$[the_number: sum+ ~the_number~~] +mul = my_number$[the_number: product+ ~the_number~~] diff --git a/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-2.ursala b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-2.ursala new file mode 100644 index 0000000000..2b66796750 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-2.ursala @@ -0,0 +1,3 @@ +#cast _my_number + +total = add(my_number[the_number: 3],my_number[the_number: 4]) diff --git a/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-3.ursala b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-3.ursala new file mode 100644 index 0000000000..550736857b --- /dev/null +++ b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-3.ursala @@ -0,0 +1,3 @@ +#cast _my_number + +total = mul(my_number[the_number: 3],my_number[the_number: 4]) diff --git a/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-4.ursala b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-4.ursala new file mode 100644 index 0000000000..4ddcdf65a9 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Ursala/define-a-primitive-data-type-4.ursala @@ -0,0 +1,7 @@ +#import nat + +#library+ + +#import + ^|A(~&,//+ nrange(1,10)?!%)* + ~&n-=<'sum','difference','product','quotient','remainder'>*~ %QI nat diff --git a/Task/Define-a-primitive-data-type/Visual-Basic-.NET/define-a-primitive-data-type.visual b/Task/Define-a-primitive-data-type/Visual-Basic-.NET/define-a-primitive-data-type.visual new file mode 100644 index 0000000000..9dff93b842 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Visual-Basic-.NET/define-a-primitive-data-type.visual @@ -0,0 +1,138 @@ +Structure LimitedInt + Implements IComparable(Of LimitedInt) + Implements IEquatable(Of LimitedInt) + + Private m_Value As Integer 'treat the default, 0 as being really 1 + + Public ReadOnly Property Value() As Integer + Get + Return If(m_Value = 0, 1, m_Value) + End Get + End Property + + Public Sub New(ByVal value As Integer) + If value < 1 Or value > 10 Then Throw New ArgumentOutOfRangeException("value") + m_Value = value + End Sub + + Public Function CompareTo(ByVal other As LimitedInt) As Integer Implements System.IComparable(Of LimitedInt).CompareTo + Return Me.Value - other.Value + End Function + + Public Overloads Function Equals(ByVal other As LimitedInt) As Boolean Implements System.IEquatable(Of LimitedInt).Equals + Return Me.Value = other.Value + End Function + + Public Overrides Function GetHashCode() As Integer + Return Value.GetHashCode + End Function + + Public Overrides Function Equals(ByVal obj As Object) As Boolean + If TypeOf obj Is LimitedInt Then Return CType(obj, LimitedInt) = Me + End Function + + Public Shared Operator =(ByVal left As LimitedInt, ByVal right As LimitedInt) As Boolean + Return left.Equals(right) + End Operator + + Public Shared Operator <>(ByVal left As LimitedInt, ByVal right As LimitedInt) As Boolean + Return Not (left = right) + End Operator + + Public Shared Operator +(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value + right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator -(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value - right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator *(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value * right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator /(ByVal left As LimitedInt, ByVal right As LimitedInt) As Double + Return left.Value / right.Value + End Operator + + Public Shared Operator \(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value \ right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator Mod(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value Mod right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator And(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value And right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator Or(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value Or right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator Xor(ByVal left As LimitedInt, ByVal right As LimitedInt) As LimitedInt + Dim temp As Integer = left.Value Xor right.Value + Select Case temp + Case 1 To 10 : Return New LimitedInt(temp) + Case Else : Throw New OverflowException + End Select + End Operator + + Public Shared Operator ^(ByVal left As LimitedInt, ByVal right As LimitedInt) As Double + Return left.Value ^ right.Value + End Operator + + Public Shared Operator <(ByVal left As LimitedInt, ByVal right As LimitedInt) As Boolean + Return left.Value < right.Value + End Operator + + Public Shared Operator >(ByVal left As LimitedInt, ByVal right As LimitedInt) As Boolean + Return left.Value > right.Value + End Operator + + Public Shared Operator <=(ByVal left As LimitedInt, ByVal right As LimitedInt) As Boolean + Return left.Value <= right.Value + End Operator + + Public Shared Operator >=(ByVal left As LimitedInt, ByVal right As LimitedInt) As Boolean + Return left.Value >= right.Value + End Operator + + Public Shared Widening Operator CType(ByVal left As LimitedInt) As Integer + Return left.Value + End Operator + + Public Shared Narrowing Operator CType(ByVal left As Integer) As LimitedInt + Return New LimitedInt(left) + End Operator + +End Structure diff --git a/Task/Define-a-primitive-data-type/Visual-Basic/define-a-primitive-data-type-1.vb b/Task/Define-a-primitive-data-type/Visual-Basic/define-a-primitive-data-type-1.vb new file mode 100644 index 0000000000..2eb15b12f8 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Visual-Basic/define-a-primitive-data-type-1.vb @@ -0,0 +1,18 @@ +Private mvarValue As Integer + +Public Property Let Value(ByVal vData As Integer) + If (vData > 10) Or (vData < 1) Then + Error 380 'Invalid property value; could also use 6, Overflow + Else + mvarValue = vData + End If +End Property + +Public Property Get Value() As Integer + Value = mvarValue +End Property + +Private Sub Class_Initialize() + 'vb defaults to 0 for numbers; let's change that... + mvarValue = 1 +End Sub diff --git a/Task/Define-a-primitive-data-type/Visual-Basic/define-a-primitive-data-type-2.vb b/Task/Define-a-primitive-data-type/Visual-Basic/define-a-primitive-data-type-2.vb new file mode 100644 index 0000000000..cd6d418090 --- /dev/null +++ b/Task/Define-a-primitive-data-type/Visual-Basic/define-a-primitive-data-type-2.vb @@ -0,0 +1,12 @@ +Public x As TinyInt + +Private Sub Form_Click() + '0-11, to give chance of errors; also not integers, because VB massages data to fit, if possible. + x = Rnd * 12 + Me.Print x +End Sub + +Private Sub Form_Load() + Randomize Timer + Set x = New TinyInt '"Set = New" REQUIRED +End Sub diff --git a/Task/Delegates/CoffeeScript/delegates-1.coffee b/Task/Delegates/CoffeeScript/delegates-1.coffeescript similarity index 100% rename from Task/Delegates/CoffeeScript/delegates-1.coffee rename to Task/Delegates/CoffeeScript/delegates-1.coffeescript diff --git a/Task/Delegates/CoffeeScript/delegates-2.coffee b/Task/Delegates/CoffeeScript/delegates-2.coffeescript similarity index 100% rename from Task/Delegates/CoffeeScript/delegates-2.coffee rename to Task/Delegates/CoffeeScript/delegates-2.coffeescript diff --git a/Task/Delegates/Objective-C/delegates.m b/Task/Delegates/Objective-C/delegates.m new file mode 100644 index 0000000000..38d53e37d5 --- /dev/null +++ b/Task/Delegates/Objective-C/delegates.m @@ -0,0 +1,76 @@ +#import + +@interface Delegator : NSObject { + + id delegate; +} + +- (id)delegate; +- (void)setDelegate:(id)obj; +- (NSString *)operation; + +@end + +@implementation Delegator + +- (id)delegate { + + return delegate; +} + +- (void)setDelegate:(id)obj { + + delegate = obj; // Weak reference +} + +- (NSString *)operation { + + if ([delegate respondsToSelector:@selector(thing)]) + return [delegate thing]; + + return @"default implementation"; +} + +@end + +// Any object may implement these +@interface NSObject (DelegatorDelegating) + +- (NSString *)thing; + +@end + +@interface Delegate : NSObject + +// Don't need to declare -thing because any NSObject has this method + +@end + +@implementation Delegate + +- (NSString *)thing { + + return @"delegate implementation"; +} + +@end + +// Example usage +// Memory management ignored for simplification +int main() { + + // Without a delegate: + Delegator *a = [[Delegator alloc] init]; + NSLog(@"%d\n", [[a operation] isEqualToString:@"default implementation"]); + + // With a delegate that does not implement thing: + [a setDelegate:@"A delegate may be any object"]; + NSLog(@"%d\n", [[a operation] isEqualToString:@"delegate implementation"]); + + // With a delegate that implements "thing": + Delegate *d = [[Delegate alloc] init]; + [a setDelegate:d]; + NSLog(@"%d\n", [[a operation] isEqualToString:@"delegate implementation"]); + + return 0; +} diff --git a/Task/Delegates/OxygenBasic/delegates.oxy b/Task/Delegates/OxygenBasic/delegates.oxy new file mode 100644 index 0000000000..b4a68d1cf4 --- /dev/null +++ b/Task/Delegates/OxygenBasic/delegates.oxy @@ -0,0 +1,44 @@ +class DelegateA 'not implmenting thing() +'============== +' +string message + +end class + +class DelegateB 'implementing thing() +'============== +' +string message + +method thing() as string +return message +end method +' +end class + + +Class Delegator +'============== +' +has DelegateA dgA +has DelegateB dgB +' +method operation() as DelegateB +dgB.message="Delegate Implementation" +return @dgB +end method + +method thing() as string +return "not using Delegate" +end method +' +end class + +'==== +'TEST +'==== + +Delegator dgr +let dg=dgr.operation +print dgr.thing 'result "not using Delegate" +print dg.thing 'result "Delegate Implementation" diff --git a/Task/Delegates/Oz/delegates.oz b/Task/Delegates/Oz/delegates.oz new file mode 100644 index 0000000000..9913f772c6 --- /dev/null +++ b/Task/Delegates/Oz/delegates.oz @@ -0,0 +1,43 @@ +declare + class Delegator from BaseObject + attr + delegate:unit + + meth set(DG) + {Object.is DG} = true %% assert: DG must be an object + delegate := DG + end + + meth operation($) + if @delegate == unit then + {self default($)} + else + try + {@delegate thing($)} + catch error(object(lookup ...) ...) then + %% the delegate did not understand the message + {self default($)} + end + end + end + + meth default($) + "default implementation" + end + end + + class Delegate from BaseObject + meth thing($) + "delegate Implementation" + end + end + + A = {New Delegator noop} +in + {System.showInfo {A operation($)}} + + {A set({New BaseObject noop})} + {System.showInfo {A operation($)}} + + {A set({New Delegate noop})} + {System.showInfo {A operation($)}} diff --git a/Task/Delegates/Perl-6/delegates.pl6 b/Task/Delegates/Perl-6/delegates.pl6 new file mode 100644 index 0000000000..d3916c1baa --- /dev/null +++ b/Task/Delegates/Perl-6/delegates.pl6 @@ -0,0 +1,28 @@ +class Non-Delegate { } + +class Delegate { + method thing { + return "delegate implementation" + } +} + +class Delegator { + has $.delegate is rw; + + method operation { + $.delegate.^can( 'thing' ) ?? $.delegate.thing + !! "default implementation" + } +} + +my Delegator $d .= new; + +say "empty: "~$d.operation; + +$d.delegate = Non-Delegate.new; + +say "Non-Delegate: "~$d.operation; + +$d.delegate = Delegate.new; + +say "Delegate: "~$d.operation; diff --git a/Task/Delegates/Pop11/delegates.pop11 b/Task/Delegates/Pop11/delegates.pop11 new file mode 100644 index 0000000000..e0db0b984b --- /dev/null +++ b/Task/Delegates/Pop11/delegates.pop11 @@ -0,0 +1,32 @@ +uses objectclass; +define :class Delegator; + slot delegate = false; +enddefine; + +define :class Delegate; +enddefine; + +define :method thing(x : Delegate); + 'delegate implementation' +enddefine; + +define :method operation(x : Delegator); +if delegate(x) and fail_safe(delegate(x), thing) then + ;;; Return value is on the stack +else + 'default implementation' +endif; +enddefine; + +;;; Default, without a delegate +lvars a = newDelegator(); +operation(a) => + +;;; a delegating to itself (works because Delegator does not +;;; implement thing) +a -> delegate(a); +operation(a) => + +;;; delegating to a freshly created Delegate +newDelegate() -> delegate(a); +operation(a) => diff --git a/Task/Delegates/Vorpal/delegates.vorpal b/Task/Delegates/Vorpal/delegates.vorpal new file mode 100644 index 0000000000..bfb62c921f --- /dev/null +++ b/Task/Delegates/Vorpal/delegates.vorpal @@ -0,0 +1,24 @@ +a = new() +a.f = method(){ + .x.print() +} + +c = new() +c.g = method(){ + (.x + 1).print() +} + +# array of delegates +b = new() +b.delegate = new() +b.delegate[0] = a +b.delegate[1] = c +b.x = 3 +b.f() +b.g() + +# single delegate +d = new() +d.delegate = a +d.x = 7 +d.f() diff --git a/Task/Delete-a-file/BASIC/delete-a-file-1.bas b/Task/Delete-a-file/BASIC/delete-a-file-1.basic similarity index 100% rename from Task/Delete-a-file/BASIC/delete-a-file-1.bas rename to Task/Delete-a-file/BASIC/delete-a-file-1.basic diff --git a/Task/Delete-a-file/BASIC/delete-a-file-2.bas b/Task/Delete-a-file/BASIC/delete-a-file-2.basic similarity index 100% rename from Task/Delete-a-file/BASIC/delete-a-file-2.bas rename to Task/Delete-a-file/BASIC/delete-a-file-2.basic diff --git a/Task/Delete-a-file/Locomotive-Basic/delete-a-file.bas b/Task/Delete-a-file/Locomotive-Basic/delete-a-file.locomotive similarity index 100% rename from Task/Delete-a-file/Locomotive-Basic/delete-a-file.bas rename to Task/Delete-a-file/Locomotive-Basic/delete-a-file.locomotive diff --git a/Task/Delete-a-file/MAXScript/delete-a-file.max b/Task/Delete-a-file/MAXScript/delete-a-file.maxscript similarity index 100% rename from Task/Delete-a-file/MAXScript/delete-a-file.max rename to Task/Delete-a-file/MAXScript/delete-a-file.maxscript diff --git a/Task/Delete-a-file/Mathematica/delete-a-file.mathematica b/Task/Delete-a-file/Mathematica/delete-a-file.math similarity index 100% rename from Task/Delete-a-file/Mathematica/delete-a-file.mathematica rename to Task/Delete-a-file/Mathematica/delete-a-file.math diff --git a/Task/Delete-a-file/Nimrod/delete-a-file.nimrod b/Task/Delete-a-file/Nimrod/delete-a-file.nimrod new file mode 100644 index 0000000000..23d6a846aa --- /dev/null +++ b/Task/Delete-a-file/Nimrod/delete-a-file.nimrod @@ -0,0 +1,5 @@ +import os +removeFile("input.txt") +removeFile("/input.txt") +removeDir("docs") +removeDir("/docs") diff --git a/Task/Delete-a-file/OCaml/delete-a-file-1.ocaml b/Task/Delete-a-file/OCaml/delete-a-file-1.ocaml new file mode 100644 index 0000000000..5a0096e2bc --- /dev/null +++ b/Task/Delete-a-file/OCaml/delete-a-file-1.ocaml @@ -0,0 +1,2 @@ +Sys.remove "input.txt";; +Sys.remove "/input.txt";; diff --git a/Task/Delete-a-file/OCaml/delete-a-file-2.ocaml b/Task/Delete-a-file/OCaml/delete-a-file-2.ocaml new file mode 100644 index 0000000000..bbaaf2b211 --- /dev/null +++ b/Task/Delete-a-file/OCaml/delete-a-file-2.ocaml @@ -0,0 +1,5 @@ +#load "unix.cma";; +Unix.unlink "input.txt";; +Unix.unlink "/input.txt";; +Unix.rmdir "docs";; +Unix.rmdir "/docs";; diff --git a/Task/Delete-a-file/Objeck/delete-a-file.objeck b/Task/Delete-a-file/Objeck/delete-a-file.objeck new file mode 100644 index 0000000000..920fc2f2f0 --- /dev/null +++ b/Task/Delete-a-file/Objeck/delete-a-file.objeck @@ -0,0 +1,13 @@ +use IO; + +bundle Default { + class FileExample { + function : Main(args : String[]) ~ Nil { + File->Delete("output.txt"); + File->Delete("/output.txt"); + + Directory->Delete("docs"); + Directory->Delete("/docs"); + } + } +} diff --git a/Task/Delete-a-file/Objective-C/delete-a-file.m b/Task/Delete-a-file/Objective-C/delete-a-file.m new file mode 100644 index 0000000000..eb8328aed0 --- /dev/null +++ b/Task/Delete-a-file/Objective-C/delete-a-file.m @@ -0,0 +1,13 @@ +NSFileManager *fm = [NSFileManager defaultManager]; + +// Pre-OS X 10.5 +[fm removeFileAtPath:@"input.txt" handler:nil]; +[fm removeFileAtPath:@"/input.txt" handler:nil]; +[fm removeFileAtPath:@"docs" handler:nil]; +[fm removeFileAtPath:@"/docs" handler:nil]; + +// OS X 10.5+ +[fm removeItemAtPath:@"input.txt" error:NULL]; +[fm removeItemAtPath:@"/input.txt" error:NULL]; +[fm removeItemAtPath:@"docs" error:NULL]; +[fm removeItemAtPath:@"/docs" error:NULL]; diff --git a/Task/Delete-a-file/Oz/delete-a-file.oz b/Task/Delete-a-file/Oz/delete-a-file.oz new file mode 100644 index 0000000000..f5686a9779 --- /dev/null +++ b/Task/Delete-a-file/Oz/delete-a-file.oz @@ -0,0 +1,6 @@ +for Dir in ["/" "./"] do + try {OS.unlink Dir#"output.txt"} + catch _ then {System.showInfo "File does not exist."} end + try {OS.rmDir Dir#"docs"} + catch _ then {System.showInfo "Directory does not exist."} end +end diff --git a/Task/Delete-a-file/PARI-GP/delete-a-file.pari b/Task/Delete-a-file/PARI-GP/delete-a-file.pari new file mode 100644 index 0000000000..85cc4817f9 --- /dev/null +++ b/Task/Delete-a-file/PARI-GP/delete-a-file.pari @@ -0,0 +1,4 @@ +system("rm -rf docs"); +system("rm input.txt"); +system("rm -rf /docs"); +system("rm /input.txt"); diff --git a/Task/Delete-a-file/Perl-6/delete-a-file.pl6 b/Task/Delete-a-file/Perl-6/delete-a-file.pl6 new file mode 100644 index 0000000000..88ead1b6a4 --- /dev/null +++ b/Task/Delete-a-file/Perl-6/delete-a-file.pl6 @@ -0,0 +1,4 @@ +unlink 'input.txt'; +unlink '/input.txt'; +rmdir 'docs'; +rmdir '/docs'; diff --git a/Task/Delete-a-file/Pike/delete-a-file.pike b/Task/Delete-a-file/Pike/delete-a-file.pike new file mode 100644 index 0000000000..5358178bcc --- /dev/null +++ b/Task/Delete-a-file/Pike/delete-a-file.pike @@ -0,0 +1,6 @@ +int main(){ + rm("input.txt"); + rm("/input.txt"); + rm("docs"); + rm("/docs"); +} diff --git a/Task/Delete-a-file/PowerShell/delete-a-file.psh b/Task/Delete-a-file/PowerShell/delete-a-file.psh new file mode 100644 index 0000000000..2ff0e5ae32 --- /dev/null +++ b/Task/Delete-a-file/PowerShell/delete-a-file.psh @@ -0,0 +1,6 @@ +# possible aliases for Remove-Item: rm, del, ri +Remove-Item input.txt +Remove-Item \input.txt # file system root + +Remove-Item -Recurse docs # recurse for deleting folders including content +Remove-Item -Recurse \docs diff --git a/Task/Delete-a-file/ProDOS/delete-a-file.dos b/Task/Delete-a-file/ProDOS/delete-a-file.dos new file mode 100644 index 0000000000..29f2f76d31 --- /dev/null +++ b/Task/Delete-a-file/ProDOS/delete-a-file.dos @@ -0,0 +1 @@ +deletedirectory docs diff --git a/Task/Delete-a-file/PureBasic/delete-a-file.purebasic b/Task/Delete-a-file/PureBasic/delete-a-file.purebasic new file mode 100644 index 0000000000..0996549e8e --- /dev/null +++ b/Task/Delete-a-file/PureBasic/delete-a-file.purebasic @@ -0,0 +1,6 @@ +DeleteFile("input.txt") +DeleteDirectory("docs","") ; needs to delete all included files +DeleteFile("/input.txt") +DeleteDirectory("/docs","*.*") ; deletes all files according to a pattern + +DeleteDirectory("/docs","",#PB_FileSystem_Recursive) ; deletes all files and directories recursive diff --git a/Task/Delete-a-file/REBOL/delete-a-file.rebol b/Task/Delete-a-file/REBOL/delete-a-file.rebol new file mode 100644 index 0000000000..42b1466d1e --- /dev/null +++ b/Task/Delete-a-file/REBOL/delete-a-file.rebol @@ -0,0 +1,7 @@ +; Local. +delete %input.txt +delete-dir %docs/ + +; Root. +delete %/input.txt +delete-dir %/docs/ diff --git a/Task/Delete-a-file/Raven/delete-a-file.raven b/Task/Delete-a-file/Raven/delete-a-file.raven new file mode 100644 index 0000000000..467badd115 --- /dev/null +++ b/Task/Delete-a-file/Raven/delete-a-file.raven @@ -0,0 +1,4 @@ +'input.txt' delete +'/input.txt' delete +'docs' rmdir +'/docs' rmdir diff --git a/Task/Delete-a-file/Retro/delete-a-file.retro b/Task/Delete-a-file/Retro/delete-a-file.retro new file mode 100644 index 0000000000..7e0f24dccc --- /dev/null +++ b/Task/Delete-a-file/Retro/delete-a-file.retro @@ -0,0 +1,3 @@ +with files' +"input.txt" delete +"/input.txt" delete diff --git a/Task/Delete-a-file/Run-BASIC/delete-a-file.run b/Task/Delete-a-file/Run-BASIC/delete-a-file.run new file mode 100644 index 0000000000..c7dc0b31b2 --- /dev/null +++ b/Task/Delete-a-file/Run-BASIC/delete-a-file.run @@ -0,0 +1,7 @@ +'------ delete input.txt ---------------- +kill "input.txt" ' this is where we are +kill "/input.txt" ' this is the root + +' ---- delete directory docs ---------- +result = rmdir("Docs") ' directory where we are +result = rmdir("/Docs") ' root directory diff --git a/Task/Delete-a-file/Slate/delete-a-file-1.slate b/Task/Delete-a-file/Slate/delete-a-file-1.slate new file mode 100644 index 0000000000..937e7efe5a --- /dev/null +++ b/Task/Delete-a-file/Slate/delete-a-file-1.slate @@ -0,0 +1,4 @@ +(File newNamed: 'input.txt') delete. +(File newNamed: '/input.txt') delete. +(Directory newNamed: 'docs') delete. +(Directory newNamed: '/docs') delete. diff --git a/Task/Delete-a-file/Slate/delete-a-file-2.slate b/Task/Delete-a-file/Slate/delete-a-file-2.slate new file mode 100644 index 0000000000..d807743fcc --- /dev/null +++ b/Task/Delete-a-file/Slate/delete-a-file-2.slate @@ -0,0 +1,2 @@ +(Directory current / 'input.txt') delete. +(Directory root / 'input.txt') delete. diff --git a/Task/Delete-a-file/Standard-ML/delete-a-file.ml b/Task/Delete-a-file/Standard-ML/delete-a-file.ml new file mode 100644 index 0000000000..071bb6de18 --- /dev/null +++ b/Task/Delete-a-file/Standard-ML/delete-a-file.ml @@ -0,0 +1,4 @@ +OS.FileSys.remove "input.txt"; +OS.FileSys.remove "/input.txt"; +OS.FileSys.rmDir "docs"; +OS.FileSys.rmDir "/docs"; diff --git a/Task/Delete-a-file/TUSCRIPT/delete-a-file.tuscript b/Task/Delete-a-file/TUSCRIPT/delete-a-file.tuscript new file mode 100644 index 0000000000..a5862d94d2 --- /dev/null +++ b/Task/Delete-a-file/TUSCRIPT/delete-a-file.tuscript @@ -0,0 +1,5 @@ +$$ MODE TUSCRIPT +- delete file +SET status = DELETE ("input.txt") +- delete directory +SET status = DELETE ("docs",-std-) diff --git a/Task/Delete-a-file/Toka/delete-a-file.toka b/Task/Delete-a-file/Toka/delete-a-file.toka new file mode 100644 index 0000000000..f26e699c8a --- /dev/null +++ b/Task/Delete-a-file/Toka/delete-a-file.toka @@ -0,0 +1,3 @@ +needs shell +" docs" remove +" input.txt" remove diff --git a/Task/Delete-a-file/UNIX-Shell/delete-a-file.sh b/Task/Delete-a-file/UNIX-Shell/delete-a-file.sh new file mode 100644 index 0000000000..8b7ad23040 --- /dev/null +++ b/Task/Delete-a-file/UNIX-Shell/delete-a-file.sh @@ -0,0 +1,4 @@ +rm -rf docs +rm input.txt +rm -rf /docs +rm /input.txt diff --git a/Task/Delete-a-file/VBScript/delete-a-file.vbscript b/Task/Delete-a-file/VBScript/delete-a-file.vbscript new file mode 100644 index 0000000000..a18a05092f --- /dev/null +++ b/Task/Delete-a-file/VBScript/delete-a-file.vbscript @@ -0,0 +1,21 @@ +Set oFSO = CreateObject( "Scripting.FileSystemObject" ) + +oFSO.DeleteFile "input.txt" +oFSO.DeleteFolder "docs" + +oFSO.DeleteFile "\input.txt" +oFSO.DeleteFolder "\docs" + +'Using Delete on file and folder objects + +dim fil, fld + +set fil = oFSO.GetFile( "input.txt" ) +fil.Delete +set fld = oFSO.GetFolder( "docs" ) +fld.Delete + +set fil = oFSO.GetFile( "\input.txt" ) +fil.Delete +set fld = oFSO.GetFolder( "\docs" ) +fld.Delete diff --git a/Task/Delete-a-file/Vedit-macro-language/delete-a-file.vedit b/Task/Delete-a-file/Vedit-macro-language/delete-a-file.vedit new file mode 100644 index 0000000000..e56c698c31 --- /dev/null +++ b/Task/Delete-a-file/Vedit-macro-language/delete-a-file.vedit @@ -0,0 +1,7 @@ +// In current directory +File_Delete("input.txt", OK) +File_Rmdir("docs") + +// In the root directory +File_Delete("/input.txt", OK) +File_Rmdir("/docs") diff --git a/Task/Delete-a-file/Visual-Basic-.NET/delete-a-file.visual b/Task/Delete-a-file/Visual-Basic-.NET/delete-a-file.visual new file mode 100644 index 0000000000..2e9082170e --- /dev/null +++ b/Task/Delete-a-file/Visual-Basic-.NET/delete-a-file.visual @@ -0,0 +1,12 @@ +'Current Directory +IO.Directory.Delete("docs") +IO.Directory.Delete("docs", True) 'also delete files and sub-directories +IO.File.Delete("output.txt") + +'Root +IO.Directory.Delete("\docs") +IO.File.Delete("\output.txt") + +'Root, platform independent +IO.Directory.Delete(IO.Path.DirectorySeparatorChar & "docs") +IO.File.Delete(IO.Path.DirectorySeparatorChar & "output.txt") diff --git a/Task/Delete-a-file/X86-Assembly/delete-a-file.x86 b/Task/Delete-a-file/X86-Assembly/delete-a-file.x86 new file mode 100644 index 0000000000..aa07800d76 --- /dev/null +++ b/Task/Delete-a-file/X86-Assembly/delete-a-file.x86 @@ -0,0 +1,45 @@ +;syscall numbers for readability. :] +%define sys_rmdir 40 +%define sys_unlink 10 + +section .text + global _start + + _start: + mov ebx, fn + mov eax, sys_unlink + int 0x80 + test eax, eax + js _ragequit + + mov ebx, dn + mov eax, sys_rmdir + int 0x80 + + mov ebx, rfn + mov eax, sys_unlink + int 0x80 + cmp eax, 0 + je _exit + + _ragequit: + mov edx, err_len + mov ecx, err_msg + mov ebx, 4 + mov eax ,1 + int 0x80 + + _exit: + push 0x1 + mov eax, 1 + push eax + int 0x80 + ret + +section .data +fn db 'inutput.txt',0 +rfn db '/input.txt',0 +dn db 'doc',0 + +err_msg db "Something went wrong! :[",0xa +err_len equ $-err_msg diff --git a/Task/Delete-a-file/Yorick/delete-a-file.yorick b/Task/Delete-a-file/Yorick/delete-a-file.yorick new file mode 100644 index 0000000000..efb171dcf8 --- /dev/null +++ b/Task/Delete-a-file/Yorick/delete-a-file.yorick @@ -0,0 +1,4 @@ +remove, "input.txt"; +remove, "/input.txt"; +rmdir, "docs"; +rmdir, "/docs"; diff --git a/Task/Detect-division-by-zero/Applesoft-BASIC/detect-division-by-zero.bas b/Task/Detect-division-by-zero/Applesoft-BASIC/detect-division-by-zero.applesoft similarity index 100% rename from Task/Detect-division-by-zero/Applesoft-BASIC/detect-division-by-zero.bas rename to Task/Detect-division-by-zero/Applesoft-BASIC/detect-division-by-zero.applesoft diff --git a/Task/Detect-division-by-zero/Locomotive-Basic/detect-division-by-zero.bas b/Task/Detect-division-by-zero/Locomotive-Basic/detect-division-by-zero.locomotive similarity index 100% rename from Task/Detect-division-by-zero/Locomotive-Basic/detect-division-by-zero.bas rename to Task/Detect-division-by-zero/Locomotive-Basic/detect-division-by-zero.locomotive diff --git a/Task/Detect-division-by-zero/MAXScript/detect-division-by-zero.max b/Task/Detect-division-by-zero/MAXScript/detect-division-by-zero.maxscript similarity index 100% rename from Task/Detect-division-by-zero/MAXScript/detect-division-by-zero.max rename to Task/Detect-division-by-zero/MAXScript/detect-division-by-zero.maxscript diff --git a/Task/Detect-division-by-zero/Mathematica/detect-division-by-zero.mathematica b/Task/Detect-division-by-zero/Mathematica/detect-division-by-zero.math similarity index 100% rename from Task/Detect-division-by-zero/Mathematica/detect-division-by-zero.mathematica rename to Task/Detect-division-by-zero/Mathematica/detect-division-by-zero.math diff --git a/Task/Detect-division-by-zero/NetLogo/detect-division-by-zero.netlogo b/Task/Detect-division-by-zero/NetLogo/detect-division-by-zero.netlogo new file mode 100644 index 0000000000..c3ac6d977c --- /dev/null +++ b/Task/Detect-division-by-zero/NetLogo/detect-division-by-zero.netlogo @@ -0,0 +1,23 @@ +;; Division by zero detection using CAREFULLY +;; The CAREFULLY clause exists in NetLogo since version 2.0 +;; In prior versions of NetLogo, you must examine the divisor prior to performing the division. +;; The variables result, a, and b must all be previously created global, local, or agent -own'd variables. +;; NetLogo variables are dynamically typed, so we are assuming that a and b contain numbers. +;; (All numbers in NetLogo are double-precision floating-point numbers.) +;; However, even if not numbers, the result is still the same: the carefully clause will +;; supress the run-time error and run the "commands if error" block, setting result to false. +;; this false value can be detected, to alter the rest of the course of the code +;; This behavior is consistent with other NetLogo primitives, such as POSTIION, that report +;; FALSE, rather than a number, if the operation fails. +carefully +[ ;; commands to try to run + set result a / b +] +[ ;; commands to run if an error occurs in the previous block. + set result false +] +ifelse is-number? result +[ output-print (word a " / " b " = " result) +] +[ output-print (word a " / " b " is not calculable" +] diff --git a/Task/Detect-division-by-zero/NetRexx/detect-division-by-zero.netrexx b/Task/Detect-division-by-zero/NetRexx/detect-division-by-zero.netrexx new file mode 100644 index 0000000000..82b41dea89 --- /dev/null +++ b/Task/Detect-division-by-zero/NetRexx/detect-division-by-zero.netrexx @@ -0,0 +1,23 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +method divide(dividend, divisor) public constant returns Rexx + do + quotient = dividend / divisor + catch exu = DivideException + exu.printStackTrace() + quotient = 'undefined' + catch exr = RuntimeException + exr.printStackTrace() + quotient = 'error' + end + return quotient + +method main(args = String[]) public static + -- process input arguments and set sensible defaults + arg = Rexx(args) + parse arg dividend .',' divisor . + if dividend.length() = 0 then dividend = 1 + if divisor.length() = 0 then divisor = 0 + say dividend '/' divisor '=' divide(dividend, divisor) + return diff --git a/Task/Detect-division-by-zero/OCaml/detect-division-by-zero-1.ocaml b/Task/Detect-division-by-zero/OCaml/detect-division-by-zero-1.ocaml new file mode 100644 index 0000000000..db3e5f9f5c --- /dev/null +++ b/Task/Detect-division-by-zero/OCaml/detect-division-by-zero-1.ocaml @@ -0,0 +1,6 @@ +let div_check x y = + try + ignore (x / y); + false + with Division_by_zero -> + true diff --git a/Task/Detect-division-by-zero/OCaml/detect-division-by-zero-2.ocaml b/Task/Detect-division-by-zero/OCaml/detect-division-by-zero-2.ocaml new file mode 100644 index 0000000000..ae34f766f3 --- /dev/null +++ b/Task/Detect-division-by-zero/OCaml/detect-division-by-zero-2.ocaml @@ -0,0 +1,2 @@ +let div_check x y = + classify_float (x /. y) = FP_infinite diff --git a/Task/Detect-division-by-zero/Octave/detect-division-by-zero.octave b/Task/Detect-division-by-zero/Octave/detect-division-by-zero.octave new file mode 100644 index 0000000000..4aad64321a --- /dev/null +++ b/Task/Detect-division-by-zero/Octave/detect-division-by-zero.octave @@ -0,0 +1,6 @@ +d = 5/0; +if ( isinf(d) ) + if ( index(lastwarn(), "division by zero") > 0 ) + error("division by zero") + endif +endif diff --git a/Task/Detect-division-by-zero/Oz/detect-division-by-zero.oz b/Task/Detect-division-by-zero/Oz/detect-division-by-zero.oz new file mode 100644 index 0000000000..ceb2cd8838 --- /dev/null +++ b/Task/Detect-division-by-zero/Oz/detect-division-by-zero.oz @@ -0,0 +1,5 @@ +try + {Show 42 div 0} +catch error(kernel(div0 ...) ...) then + {System.showInfo "Division by zero detected."} +end diff --git a/Task/Detect-division-by-zero/PARI-GP/detect-division-by-zero.pari b/Task/Detect-division-by-zero/PARI-GP/detect-division-by-zero.pari new file mode 100644 index 0000000000..edaa7add64 --- /dev/null +++ b/Task/Detect-division-by-zero/PARI-GP/detect-division-by-zero.pari @@ -0,0 +1 @@ +trap(,"division by 0",m/n) diff --git a/Task/Detect-division-by-zero/PL-I/detect-division-by-zero.pli b/Task/Detect-division-by-zero/PL-I/detect-division-by-zero.pli new file mode 100644 index 0000000000..65bf7aaa4f --- /dev/null +++ b/Task/Detect-division-by-zero/PL-I/detect-division-by-zero.pli @@ -0,0 +1,5 @@ +/* A function is not required to detect division by zero. */ +/* The following statement is executed anywhere prior to */ +/* executing the statement containing the division by zero. */ + +on zerodivide snap go to trap_zerodivide; diff --git a/Task/Detect-division-by-zero/PL-SQL/detect-division-by-zero-1.sql b/Task/Detect-division-by-zero/PL-SQL/detect-division-by-zero-1.sql new file mode 100644 index 0000000000..61b2e75c84 --- /dev/null +++ b/Task/Detect-division-by-zero/PL-SQL/detect-division-by-zero-1.sql @@ -0,0 +1,11 @@ +FUNCTION divide(n1 IN NUMBER, n2 IN NUMBER) +RETURN BOOLEAN +IS + result NUMBER; +BEGIN + result := n1/n2; + RETURN(FALSE); +EXCEPTION + WHEN ZERO_DIVIDE THEN + RETURN(true); +end divide; diff --git a/Task/Detect-division-by-zero/PL-SQL/detect-division-by-zero-2.sql b/Task/Detect-division-by-zero/PL-SQL/detect-division-by-zero-2.sql new file mode 100644 index 0000000000..e37ff77151 --- /dev/null +++ b/Task/Detect-division-by-zero/PL-SQL/detect-division-by-zero-2.sql @@ -0,0 +1,2 @@ +divide(0,1) --false +divide(1,0) --true, division by zero diff --git a/Task/Detect-division-by-zero/Perl-6/detect-division-by-zero-1.pl6 b/Task/Detect-division-by-zero/Perl-6/detect-division-by-zero-1.pl6 new file mode 100644 index 0000000000..f4812f133d --- /dev/null +++ b/Task/Detect-division-by-zero/Perl-6/detect-division-by-zero-1.pl6 @@ -0,0 +1,14 @@ +sub div($a, $b){ + my $r; + try { + $r = $a / $b; + CATCH { + say "tried to divide by zero !" if $! ~~ "Divide by zero"; + } + } + return $r // fail; +} + +say div(10,2); # 5 +say div(1,0); # Inf, 1/0 constants are substituted for Infinity +say div(1, sin(0)); # undef, and prints "tried to divide by zero" diff --git a/Task/Detect-division-by-zero/Perl-6/detect-division-by-zero-2.pl6 b/Task/Detect-division-by-zero/Perl-6/detect-division-by-zero-2.pl6 new file mode 100644 index 0000000000..5dfb692507 --- /dev/null +++ b/Task/Detect-division-by-zero/Perl-6/detect-division-by-zero-2.pl6 @@ -0,0 +1,7 @@ +multi div($a, $b){ return $a / $b } +multi div($a, $b where { $b == 0 }){ + say 'lolicheatsyou'; + return 1; +} + +say div(1, sin(0)); # prints "lolicheatsyou" newline "1" diff --git a/Task/Detect-division-by-zero/Pure/detect-division-by-zero-1.pure b/Task/Detect-division-by-zero/Pure/detect-division-by-zero-1.pure new file mode 100644 index 0000000000..e8077283b8 --- /dev/null +++ b/Task/Detect-division-by-zero/Pure/detect-division-by-zero-1.pure @@ -0,0 +1,2 @@ +> 1/0, -1/0, 0/0; +inf,-inf,nan diff --git a/Task/Detect-division-by-zero/Pure/detect-division-by-zero-2.pure b/Task/Detect-division-by-zero/Pure/detect-division-by-zero-2.pure new file mode 100644 index 0000000000..2d277f1e00 --- /dev/null +++ b/Task/Detect-division-by-zero/Pure/detect-division-by-zero-2.pure @@ -0,0 +1,3 @@ +> inf_or_nan x = infp x || nanp x; +> map inf_or_nan [1/0, -1/0, 0/0]; +[1,1,1] diff --git a/Task/Detect-division-by-zero/Pure/detect-division-by-zero-3.pure b/Task/Detect-division-by-zero/Pure/detect-division-by-zero-3.pure new file mode 100644 index 0000000000..f10507a3ac --- /dev/null +++ b/Task/Detect-division-by-zero/Pure/detect-division-by-zero-3.pure @@ -0,0 +1,5 @@ +> divide n m = catch (\_ -> "divide by 0") (n div m); +> divide 0 1; +0 +> divide 1 0; +"divide by 0" diff --git a/Task/Detect-division-by-zero/PureBasic/detect-division-by-zero-1.purebasic b/Task/Detect-division-by-zero/PureBasic/detect-division-by-zero-1.purebasic new file mode 100644 index 0000000000..663cc0755f --- /dev/null +++ b/Task/Detect-division-by-zero/PureBasic/detect-division-by-zero-1.purebasic @@ -0,0 +1,13 @@ +;Set up a Procedure to handle any Error +Procedure MyErrorHandler() + Define txt$="The following error happened."+#CRLF$+ ErrorMessage()+"at line "+Str(ErrorLine()) + MessageRequester("OnError test", txt$) +EndProcedure + +; Tell where to go if an Error happens +OnErrorCall(@MyErrorHandler()) + +;Now, do something very stupid so that we may see an Error... +Repeat + A=Random(100)/Random(100) +ForEver diff --git a/Task/Detect-division-by-zero/PureBasic/detect-division-by-zero-2.purebasic b/Task/Detect-division-by-zero/PureBasic/detect-division-by-zero-2.purebasic new file mode 100644 index 0000000000..16b33ba475 --- /dev/null +++ b/Task/Detect-division-by-zero/PureBasic/detect-division-by-zero-2.purebasic @@ -0,0 +1,2 @@ +Define.d a, b +Debug a/b diff --git a/Task/Detect-division-by-zero/REBOL/detect-division-by-zero.rebol b/Task/Detect-division-by-zero/REBOL/detect-division-by-zero.rebol new file mode 100644 index 0000000000..95d1c1d272 --- /dev/null +++ b/Task/Detect-division-by-zero/REBOL/detect-division-by-zero.rebol @@ -0,0 +1,29 @@ +REBOL [ + Title: "Detect Divide by Zero" + Date: 2009-12-16 + Author: oofoe + URL: http://rosettacode.org/wiki/Divide_by_Zero_Detection +] + +; The 'try' word returns an error object if the operation fails for +; whatever reason. The 'error?' word detects an error object and +; 'disarm' keeps it from triggering so I can analyze it to print the +; appropriate message. Otherwise, any reference to the error object +; will stop the program. + +div-check: func [ + "Attempt to divide two numbers, report result or errors as needed." + x y + /local result +] [ + either error? result: try [x / y][ + result: disarm result + print ["Caught" result/type "error:" result/id] + ] [ + print [x "/" y "=" result] + ] +] + +div-check 12 2 ; An ordinary calculation. +div-check 6 0 ; This will detect divide by zero. +div-check "7" 0.0001 ; Other errors can be caught as well. diff --git a/Task/Detect-division-by-zero/Run-BASIC/detect-division-by-zero.run b/Task/Detect-division-by-zero/Run-BASIC/detect-division-by-zero.run new file mode 100644 index 0000000000..61985e1dd3 --- /dev/null +++ b/Task/Detect-division-by-zero/Run-BASIC/detect-division-by-zero.run @@ -0,0 +1,7 @@ +on error goto [error] +a = 1 / 0 +wait + +[error] ' error 11 is division by zero err number +If err = 11 Then print "Division by Zero" +wait diff --git a/Task/Detect-division-by-zero/SNOBOL4/detect-division-by-zero.sno b/Task/Detect-division-by-zero/SNOBOL4/detect-division-by-zero.sno new file mode 100644 index 0000000000..8015e0bdbd --- /dev/null +++ b/Task/Detect-division-by-zero/SNOBOL4/detect-division-by-zero.sno @@ -0,0 +1,13 @@ + define('zdiv(x,y)') :(zdiv_end) +zdiv &errlimit = 1; setexit(.ztrap) + zdiv = x / y :(return) +ztrap zdiv = ?(&errtype ? (14 | 262)) 'Division by zero' :s(continue)f(abort) +zdiv_end + +* # Test and display + output = '1/1 = ' zdiv(1,1) ;* Integers non-zero + output = '1.0/1.0 = ' zdiv(1.0,1.0) ;* Reals non-zero + output = '1/0 = ' zdiv(1,0) ;* Integers zero + output = '1.0/0.0 = ' zdiv(1.0,0.0) ;* Reals zero + output = 'Zero checks complete' +end diff --git a/Task/Detect-division-by-zero/Seed7/detect-division-by-zero.seed7 b/Task/Detect-division-by-zero/Seed7/detect-division-by-zero.seed7 new file mode 100644 index 0000000000..89c0c83d3c --- /dev/null +++ b/Task/Detect-division-by-zero/Seed7/detect-division-by-zero.seed7 @@ -0,0 +1,32 @@ +$ include "seed7_05.s7i"; + include "float.s7i"; + +const proc: doDivide (in integer: numer, in integer: denom) is func + begin + block + writeln(numer <& " div " <& denom <& " = " <& numer div denom); + exception + catch NUMERIC_ERROR: + writeln("Division by zero detected."); + end block; + end func; + +const proc: doDivide (in float: numer, in float: denom) is func + local + var float: quotient is 0.0; + begin + quotient := numer / denom; + if quotient <> Infinity and quotient <> -Infinity then + writeln(numer <& " / " <& denom <& " = " <& quotient); + else + writeln("Division by zero detected."); + end if; + end func; + +const proc: main is func + begin + doDivide(10, 8); + doDivide(1, 0); + doDivide(10.0, 8.0); + doDivide(1.0, 0.0); + end func; diff --git a/Task/Detect-division-by-zero/Slate/detect-division-by-zero.slate b/Task/Detect-division-by-zero/Slate/detect-division-by-zero.slate new file mode 100644 index 0000000000..ef01f80e59 --- /dev/null +++ b/Task/Detect-division-by-zero/Slate/detect-division-by-zero.slate @@ -0,0 +1 @@ +[ 1 / 0 ] on: Error do: [|:err| err return: PositiveInfinity]. diff --git a/Task/Detect-division-by-zero/Standard-ML/detect-division-by-zero-1.ml b/Task/Detect-division-by-zero/Standard-ML/detect-division-by-zero-1.ml new file mode 100644 index 0000000000..7675517963 --- /dev/null +++ b/Task/Detect-division-by-zero/Standard-ML/detect-division-by-zero-1.ml @@ -0,0 +1,4 @@ +fun div_check (x, y) = ( + ignore (x div y); + false +) handle Div => true diff --git a/Task/Detect-division-by-zero/Standard-ML/detect-division-by-zero-2.ml b/Task/Detect-division-by-zero/Standard-ML/detect-division-by-zero-2.ml new file mode 100644 index 0000000000..4fc879b6cc --- /dev/null +++ b/Task/Detect-division-by-zero/Standard-ML/detect-division-by-zero-2.ml @@ -0,0 +1,2 @@ +fun div_check (x, y) = + not (Real.isFinite (x / y)) diff --git a/Task/Detect-division-by-zero/XPL0/detect-division-by-zero.xpl0 b/Task/Detect-division-by-zero/XPL0/detect-division-by-zero.xpl0 new file mode 100644 index 0000000000..58472f744a --- /dev/null +++ b/Task/Detect-division-by-zero/XPL0/detect-division-by-zero.xpl0 @@ -0,0 +1,6 @@ +include c:\cxpl\codes; +int A, B; +[Trap(false); \turn off error trapping +B:= 1234/(A-A); \(error not detected at compile time) +if GetErr then Text(0, "Divide by zero"); +] diff --git a/Task/Detect-division-by-zero/Yorick/detect-division-by-zero.yorick b/Task/Detect-division-by-zero/Yorick/detect-division-by-zero.yorick new file mode 100644 index 0000000000..0e2f015681 --- /dev/null +++ b/Task/Detect-division-by-zero/Yorick/detect-division-by-zero.yorick @@ -0,0 +1,6 @@ +func div_check(x, y) { + if(catch(0x01)) + return 1; + temp = x/y; + return 0; +} diff --git a/Task/Determine-if-a-string-is-numeric/BASIC/determine-if-a-string-is-numeric.bas b/Task/Determine-if-a-string-is-numeric/BASIC/determine-if-a-string-is-numeric.basic similarity index 100% rename from Task/Determine-if-a-string-is-numeric/BASIC/determine-if-a-string-is-numeric.bas rename to Task/Determine-if-a-string-is-numeric/BASIC/determine-if-a-string-is-numeric.basic diff --git a/Task/Determine-if-a-string-is-numeric/CoffeeScript/determine-if-a-string-is-numeric.coffee b/Task/Determine-if-a-string-is-numeric/CoffeeScript/determine-if-a-string-is-numeric.coffeescript similarity index 100% rename from Task/Determine-if-a-string-is-numeric/CoffeeScript/determine-if-a-string-is-numeric.coffee rename to Task/Determine-if-a-string-is-numeric/CoffeeScript/determine-if-a-string-is-numeric.coffeescript diff --git a/Task/Determine-if-a-string-is-numeric/MAXScript/determine-if-a-string-is-numeric.max b/Task/Determine-if-a-string-is-numeric/MAXScript/determine-if-a-string-is-numeric.maxscript similarity index 100% rename from Task/Determine-if-a-string-is-numeric/MAXScript/determine-if-a-string-is-numeric.max rename to Task/Determine-if-a-string-is-numeric/MAXScript/determine-if-a-string-is-numeric.maxscript diff --git a/Task/Determine-if-a-string-is-numeric/Mathematica/determine-if-a-string-is-numeric.mathematica b/Task/Determine-if-a-string-is-numeric/Mathematica/determine-if-a-string-is-numeric.math similarity index 100% rename from Task/Determine-if-a-string-is-numeric/Mathematica/determine-if-a-string-is-numeric.mathematica rename to Task/Determine-if-a-string-is-numeric/Mathematica/determine-if-a-string-is-numeric.math diff --git a/Task/Determine-if-a-string-is-numeric/Nemerle/determine-if-a-string-is-numeric.nemerle b/Task/Determine-if-a-string-is-numeric/Nemerle/determine-if-a-string-is-numeric.nemerle new file mode 100644 index 0000000000..897fa83e86 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Nemerle/determine-if-a-string-is-numeric.nemerle @@ -0,0 +1,19 @@ +using System; +using System.Console; + +module IsNumeric +{ + IsNumeric( input : string) : bool + { + mutable meh = 0.0; // I don't want it, not going to use it, why force me to declare it? + double.TryParse(input, out meh) + } + + Main() : void + { + def num = "-1.2345E6"; + def not = "abc45"; + WriteLine($"$num is numeric: $(IsNumeric(num))"); + WriteLine($"$not is numeric: $(IsNumeric(not))"); + } +} diff --git a/Task/Determine-if-a-string-is-numeric/NetRexx/determine-if-a-string-is-numeric.netrexx b/Task/Determine-if-a-string-is-numeric/NetRexx/determine-if-a-string-is-numeric.netrexx new file mode 100644 index 0000000000..e43c04c64b --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/NetRexx/determine-if-a-string-is-numeric.netrexx @@ -0,0 +1,37 @@ +/* NetRexx */ +options replace format comments java crossref symbols nobinary + +numeric digits 20 + +loop n_ over getTestData() + -- could have used n_.datatype('N') directly here... + if isNumeric(n_) then msg = 'numeric' + else msg = 'not numeric' + say ('"'n_'"').right(25)':' msg + end n_ + +return + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Pointless in NetRexx; the DATATYPE built-in-function is more powerful! +method isNumeric(testString) public static returns boolean + return testString.datatype('N') + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +method getTestData() private static returns Rexx[] + + -- Coercing numbers into the Rexx type has the effect of converting them to strings. + -- NetRexx will still perform arithmetic on Rexx strings if those strings represent numbers. + -- Notice that whitespace between the sign and the number are ignored even when inside a string constant + testData = [ Rexx - + ' one and a half', 1, 1.5, 1.5e+27, ' 1 ', ' 1.5 ', ' 1.5e+27 ', - + '-one and a half', - 1, - 1.5, - 1.5e-27, ' - 1 ', '- 1.5 ', '- 1.5e-27 ', - + '+one and a half', + 1, + 1.5, + 1.5e+27, ' + 1 ', '+ 1.5 ', '+ 1.5e+27 ', - + 'Math Constants', - + Math.PI, Math.E, - + -Math.PI, -Math.E, - + +Math.PI, +Math.E, - + 'Numeric Constants', - + Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY - + ] + return testData diff --git a/Task/Determine-if-a-string-is-numeric/OCaml/determine-if-a-string-is-numeric.ocaml b/Task/Determine-if-a-string-is-numeric/OCaml/determine-if-a-string-is-numeric.ocaml new file mode 100644 index 0000000000..5332b59ede --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/OCaml/determine-if-a-string-is-numeric.ocaml @@ -0,0 +1,9 @@ +let is_int s = + try ignore (int_of_string s); true + with _ -> false + +let is_float s = + try ignore (float_of_string s); true + with _ -> false + +let is_numeric s = is_int s || is_float s diff --git a/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-1.m b/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-1.m new file mode 100644 index 0000000000..fecd4e1e08 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-1.m @@ -0,0 +1,10 @@ +if( [[NSScanner scannerWithString:@"-123.4e5"] scanFloat:NULL] ) + NSLog( @"\"-123.4e5\" is numeric" ); +else + NSLog( @"\"-123.4e5\" is not numeric" ); +if( [[NSScanner scannerWithString:@"Not a number"] scanFloat:NULL] ) + NSLog( @"\"Not a number\" is numeric" ); +else + NSLog( @"\"Not a number\" is not numeric" ); +// prints: "-123.4e5" is numeric +// prints: "Not a number" is not numeric diff --git a/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-2.m b/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-2.m new file mode 100644 index 0000000000..f1f1e7e4e8 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-2.m @@ -0,0 +1,9 @@ +BOOL isNumeric(NSString *s) +{ + NSScanner *sc = [NSScanner scannerWithString: s]; + if ( [sc scanFloat:NULL] ) + { + return [sc isAtEnd]; + } + return NO; +} diff --git a/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-3.m b/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-3.m new file mode 100644 index 0000000000..c085684d6a --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Objective-C/determine-if-a-string-is-numeric-3.m @@ -0,0 +1,25 @@ +BOOL isNumericI(NSString *s) +{ + NSUInteger len = [s length]; + NSUInteger i; + BOOL status = NO; + + for(i=0; i < len; i++) + { + unichar singlechar = [s characterAtIndex: i]; + if ( (singlechar == ' ') && (!status) ) + { + continue; + } + if ( ( singlechar == '+' || + singlechar == '-' ) && (!status) ) { status=YES; continue; } + if ( ( singlechar >= '0' ) && + ( singlechar <= '9' ) ) + { + status = YES; + } else { + return NO; + } + } + return (i == len) && status; +} diff --git a/Task/Determine-if-a-string-is-numeric/Octave/determine-if-a-string-is-numeric-1.octave b/Task/Determine-if-a-string-is-numeric/Octave/determine-if-a-string-is-numeric-1.octave new file mode 100644 index 0000000000..510da66068 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Octave/determine-if-a-string-is-numeric-1.octave @@ -0,0 +1,15 @@ +function r = isnum(a) + if ( isnumeric(a) ) + r = 1; + else + o = str2num(a); + r = !isempty(o); + endif +endfunction + +% tests +disp(isnum(123)) % 1 +disp(isnum("123")) % 1 +disp(isnum("foo123")) % 0 +disp(isnum("123bar")) % 0 +disp(isnum("3.1415")) % 1 diff --git a/Task/Determine-if-a-string-is-numeric/Octave/determine-if-a-string-is-numeric-2.octave b/Task/Determine-if-a-string-is-numeric/Octave/determine-if-a-string-is-numeric-2.octave new file mode 100644 index 0000000000..14e4c293c4 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Octave/determine-if-a-string-is-numeric-2.octave @@ -0,0 +1,8 @@ +function r = isnum(a) + if ( isnumeric(a) ) + r = 1; + else + o = str2double(a); + r = !isnan(o); + endif +endfunction diff --git a/Task/Determine-if-a-string-is-numeric/Oz/determine-if-a-string-is-numeric.oz b/Task/Determine-if-a-string-is-numeric/Oz/determine-if-a-string-is-numeric.oz new file mode 100644 index 0000000000..b41a9b3da9 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Oz/determine-if-a-string-is-numeric.oz @@ -0,0 +1,3 @@ +fun {IsNumeric S} + {String.isInt S} orelse {String.isFloat S} +end diff --git a/Task/Determine-if-a-string-is-numeric/PARI-GP/determine-if-a-string-is-numeric.pari b/Task/Determine-if-a-string-is-numeric/PARI-GP/determine-if-a-string-is-numeric.pari new file mode 100644 index 0000000000..e32297c4e3 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/PARI-GP/determine-if-a-string-is-numeric.pari @@ -0,0 +1,4 @@ +isNumeric(s)={ + my(t=type(eval(s))); + t == "t_INT" || t == "T_REAL" +}; diff --git a/Task/Determine-if-a-string-is-numeric/PL-I/determine-if-a-string-is-numeric.pli b/Task/Determine-if-a-string-is-numeric/PL-I/determine-if-a-string-is-numeric.pli new file mode 100644 index 0000000000..ff871248f7 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/PL-I/determine-if-a-string-is-numeric.pli @@ -0,0 +1,12 @@ +is_numeric: procedure (text) returns (bit (1)); + declare text character (*); + declare x float; + + on conversion go to done; + + get string(text) edit (x) (E(length(text),0)); + return ('1'b); + +done: + return ('0'b); +end is_numeric; diff --git a/Task/Determine-if-a-string-is-numeric/PL-SQL/determine-if-a-string-is-numeric-1.sql b/Task/Determine-if-a-string-is-numeric/PL-SQL/determine-if-a-string-is-numeric-1.sql new file mode 100644 index 0000000000..2faab49c45 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/PL-SQL/determine-if-a-string-is-numeric-1.sql @@ -0,0 +1,11 @@ +FUNCTION IsNumeric( value IN VARCHAR2 ) +RETURN BOOLEAN +IS + help NUMBER; +BEGIN + help := to_number( value ); + return( TRUE ); +EXCEPTION + WHEN others THEN + return( FALSE ); +END; diff --git a/Task/Determine-if-a-string-is-numeric/PL-SQL/determine-if-a-string-is-numeric-2.sql b/Task/Determine-if-a-string-is-numeric/PL-SQL/determine-if-a-string-is-numeric-2.sql new file mode 100644 index 0000000000..c735d758d7 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/PL-SQL/determine-if-a-string-is-numeric-2.sql @@ -0,0 +1,5 @@ +Value VARCHAR2( 10 ) := '123'; +IF( IsNumeric( Value ) ) + THEN + NULL; +END IF; diff --git a/Task/Determine-if-a-string-is-numeric/Pascal/determine-if-a-string-is-numeric.pascal b/Task/Determine-if-a-string-is-numeric/Pascal/determine-if-a-string-is-numeric.pascal new file mode 100644 index 0000000000..70a6b70937 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Pascal/determine-if-a-string-is-numeric.pascal @@ -0,0 +1,17 @@ +function IsNumeric(Value: string; const AllowFloat: Boolean): Boolean; +var + ValueInt: Integer; + ValueFloat: Extended; + ErrCode: Integer; +begin +// Check for integer: Val only accepts integers when passed integer param +Value := SysUtils.Trim(Value); +Val(Value, ValueInt, ErrCode); +Result := ErrCode = 0; // Val sets error code 0 if OK +if not Result and AllowFloat then + begin + // Check for float: Val accepts floats when passed float param + Val(Value, ValueFloat, ErrCode); + Result := ErrCode = 0; // Val sets error code 0 if OK + end; +end; diff --git a/Task/Determine-if-a-string-is-numeric/Perl-6/determine-if-a-string-is-numeric.pl6 b/Task/Determine-if-a-string-is-numeric/Perl-6/determine-if-a-string-is-numeric.pl6 new file mode 100644 index 0000000000..e83b772e1c --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Perl-6/determine-if-a-string-is-numeric.pl6 @@ -0,0 +1,4 @@ +sub is-number( $term --> Bool ) { + $term ~~ /\d/ and +$term ~~ Numeric; +} +say "true" if is-number( 10111 ); diff --git a/Task/Determine-if-a-string-is-numeric/Pike/determine-if-a-string-is-numeric.pike b/Task/Determine-if-a-string-is-numeric/Pike/determine-if-a-string-is-numeric.pike new file mode 100644 index 0000000000..03e5c35d92 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Pike/determine-if-a-string-is-numeric.pike @@ -0,0 +1,12 @@ +int(0..1) is_number(string s) +{ + array test = array_sscanf(s, "%s%f%s"); + if (sizeof(test) == 3 && test[1] && !sizeof(test[0]) && !sizeof(test[2]) ) + return true; + else + return false; +} + +string num = "-1.234" +is_number(num); +-> true diff --git a/Task/Determine-if-a-string-is-numeric/PowerShell/determine-if-a-string-is-numeric-1.psh b/Task/Determine-if-a-string-is-numeric/PowerShell/determine-if-a-string-is-numeric-1.psh new file mode 100644 index 0000000000..b007fea05f --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/PowerShell/determine-if-a-string-is-numeric-1.psh @@ -0,0 +1,8 @@ +function isNumeric ($x) { + try { + 0 + $x | Out-Null + return $true + } catch { + return $false + } +} diff --git a/Task/Determine-if-a-string-is-numeric/PowerShell/determine-if-a-string-is-numeric-2.psh b/Task/Determine-if-a-string-is-numeric/PowerShell/determine-if-a-string-is-numeric-2.psh new file mode 100644 index 0000000000..9555399a2c --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/PowerShell/determine-if-a-string-is-numeric-2.psh @@ -0,0 +1,5 @@ +function isNumeric ($x) { + $x2 = 0 + $isNum = [System.Int32]::TryParse($x, [ref]$x2) + return $isNum +} diff --git a/Task/Determine-if-a-string-is-numeric/PureBasic/determine-if-a-string-is-numeric.purebasic b/Task/Determine-if-a-string-is-numeric/PureBasic/determine-if-a-string-is-numeric.purebasic new file mode 100644 index 0000000000..a44fc65110 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/PureBasic/determine-if-a-string-is-numeric.purebasic @@ -0,0 +1,54 @@ +Procedure IsNumeric(InString.s, DecimalCharacter.c = '.') + #NotNumeric = #False + #IsNumeric = #True + + InString = Trim(InString) + Protected IsDecimal, CaughtDecimal, CaughtE + Protected IsSignPresent, IsSignAllowed = #True, CountNumeric + Protected *CurrentChar.Character = @InString + + While *CurrentChar\c + Select *CurrentChar\c + Case '0' To '9' + CountNumeric + 1 + IsSignAllowed = #False + Case DecimalCharacter + If CaughtDecimal Or CaughtE Or CountNumeric = 0 + ProcedureReturn #NotNumeric + EndIf + + CountNumeric = 0 + CaughtDecimal = #True + IsDecimal = #True + Case '-', '+' + If IsSignPresent Or Not IsSignAllowed: ProcedureReturn #NotNumeric: EndIf + IsSignPresent = #True + Case 'E', 'e' + If CaughtE Or CountNumeric = 0 + ProcedureReturn #NotNumeric + EndIf + + CaughtE = #True + CountNumeric = 0 + CaughtDecimal = #False + IsSignPresent = #False + IsSignAllowed = #True + Default + ProcedureReturn #NotNumeric + EndSelect + *CurrentChar + SizeOf(Character) + Wend + + If CountNumeric = 0: ProcedureReturn #NotNumeric: EndIf + ProcedureReturn #IsNumeric +EndProcedure + +If OpenConsole() + PrintN("'+3183.31151E+321' = " + Str(IsNumeric("+3183.31151E+321"))) + PrintN("'-123456789' = " + Str(IsNumeric("-123456789"))) + PrintN("'123.45.6789+' = " + Str(IsNumeric("123.45.6789+"))) + PrintN("'-e' = " + Str(IsNumeric("-e"))) + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + CloseConsole() +EndIf diff --git a/Task/Determine-if-a-string-is-numeric/REBOL/determine-if-a-string-is-numeric.rebol b/Task/Determine-if-a-string-is-numeric/REBOL/determine-if-a-string-is-numeric.rebol new file mode 100644 index 0000000000..5a2f7a7a70 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/REBOL/determine-if-a-string-is-numeric.rebol @@ -0,0 +1,35 @@ +REBOL [ + Title: "Is Numeric?" + Author: oofoe + Date: 2009-12-04 + URL: http://rosettacode.org/wiki/IsNumeric +] + +; Built-in. + +numeric?: func [x][not error? try [to-decimal x]] + +; Parse dialect for numbers. + +sign: [0 1 "-"] +digit: charset "0123456789" +int: [some digit] +float: [int "." int] +number: [ + sign float ["e" | "E"] sign int | + sign int ["e" | "E"] sign int | + sign float | + sign int +] + +pnumeric?: func [x][parse x number] + +; Test cases. + +cases: parse { + 10 -99 + 10.43 -12.04 + 1e99 1.0e10 -10e3 -9.12e7 2e-4 -3.4E-5 + 3phase Garkenhammer e n3v3r phase3 +} none +foreach x cases [print [x numeric? x pnumeric? x]] diff --git a/Task/Determine-if-a-string-is-numeric/RapidQ/determine-if-a-string-is-numeric.rapidq b/Task/Determine-if-a-string-is-numeric/RapidQ/determine-if-a-string-is-numeric.rapidq new file mode 100644 index 0000000000..7c8da42498 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/RapidQ/determine-if-a-string-is-numeric.rapidq @@ -0,0 +1 @@ +isnumeric diff --git a/Task/Determine-if-a-string-is-numeric/Retro/determine-if-a-string-is-numeric.retro b/Task/Determine-if-a-string-is-numeric/Retro/determine-if-a-string-is-numeric.retro new file mode 100644 index 0000000000..338ce03809 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Retro/determine-if-a-string-is-numeric.retro @@ -0,0 +1 @@ +"123" isNumber? diff --git a/Task/Determine-if-a-string-is-numeric/Run-BASIC/determine-if-a-string-is-numeric.run b/Task/Determine-if-a-string-is-numeric/Run-BASIC/determine-if-a-string-is-numeric.run new file mode 100644 index 0000000000..eb5d742a66 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Run-BASIC/determine-if-a-string-is-numeric.run @@ -0,0 +1,24 @@ +print isNumeric("123") +print isNumeric("1ab") + +' ------------------------ +' Numeric Check +' 0 = bad +' 1 = good +' ------------------------ +FUNCTION isNumeric(f$) +isNumeric = 1 +f$ = trim$(f$) +if left$(f$,1) = "-" or left$(f$,1) = "+" then f$ = mid$(f$,2) +for i = 1 to len(f$) + if mid$(f$,i,1) = "." then + if dot$ = "." then isNumeric = 0 + dot$ = "." + goto [nxtDigit] + end if + if mid$(f$,i,1) = "," then goto [nxtDigit] + if mid$(f$,i,1) < "0" then isNumeric = 0 + if mid$(f$,i,1) > "9" then isNumeric = 0 +[nxtDigit] +next i +END FUNCTION diff --git a/Task/Determine-if-a-string-is-numeric/SNOBOL4/determine-if-a-string-is-numeric.sno b/Task/Determine-if-a-string-is-numeric/SNOBOL4/determine-if-a-string-is-numeric.sno new file mode 100644 index 0000000000..2f7109ac38 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/SNOBOL4/determine-if-a-string-is-numeric.sno @@ -0,0 +1,20 @@ + define('nchk(str)') :(nchk_end) +nchk convert(str,'real') :s(return)f(freturn) +nchk_end + +* # Wrapper for testing + define('isnum(str)') :(isnum_end) +isnum isnum = 'F'; isnum = nchk(str) 'T' + isnum = isnum ': ' str :(return) +isnum_end + +* # Test and display + output = isnum('123') + output = isnum('123.0') + output = isnum('123.') + output = isnum('-123') + output = isnum('3.14159') + output = isnum('1.2.3') + output = isnum('abc') + output = isnum('A440') +end diff --git a/Task/Determine-if-a-string-is-numeric/SQL/determine-if-a-string-is-numeric.sql b/Task/Determine-if-a-string-is-numeric/SQL/determine-if-a-string-is-numeric.sql new file mode 100644 index 0000000000..039bb1f2e8 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/SQL/determine-if-a-string-is-numeric.sql @@ -0,0 +1,7 @@ +declare @s varchar(10) +set @s = '1234.56' + +print isnumeric(@s) --prints 1 if numeric, 0 if not. + +if isnumeric(@s)=1 begin print 'Numeric' end +else print 'Non-numeric' diff --git a/Task/Determine-if-a-string-is-numeric/Standard-ML/determine-if-a-string-is-numeric.ml b/Task/Determine-if-a-string-is-numeric/Standard-ML/determine-if-a-string-is-numeric.ml new file mode 100644 index 0000000000..d32e56af82 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Standard-ML/determine-if-a-string-is-numeric.ml @@ -0,0 +1,10 @@ +(* this function only recognizes integers in decimal format *) +fun isInteger s = case Int.scan StringCvt.DEC Substring.getc (Substring.full s) of + SOME (_,subs) => Substring.isEmpty subs + | NONE => false + +fun isReal s = case Real.scan Substring.getc (Substring.full s) of + SOME (_,subs) => Substring.isEmpty subs + | NONE => false + +fun isNumeric s = isInteger s orelse isReal s diff --git a/Task/Determine-if-a-string-is-numeric/Toka/determine-if-a-string-is-numeric.toka b/Task/Determine-if-a-string-is-numeric/Toka/determine-if-a-string-is-numeric.toka new file mode 100644 index 0000000000..0acb15a011 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Toka/determine-if-a-string-is-numeric.toka @@ -0,0 +1,10 @@ +[ ( string -- flag ) + >number nip ] is isNumeric + +( Some tests ) +decimal +" 100" isNumeric . ( succeeds, 100 is a valid decimal integer ) +" 100.21" isNumeric . ( fails, 100.21 is not an integer) +" a" isNumeric . ( fails, 'a' is not a valid integer in the decimal base ) +" $a" isNumeric . ( succeeds, because $ is a valid override prefix ) + ( denoting that the following character is a hexadecimal number ) diff --git a/Task/Determine-if-a-string-is-numeric/VBScript/determine-if-a-string-is-numeric.vbscript b/Task/Determine-if-a-string-is-numeric/VBScript/determine-if-a-string-is-numeric.vbscript new file mode 100644 index 0000000000..532c3c8796 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/VBScript/determine-if-a-string-is-numeric.vbscript @@ -0,0 +1 @@ +IsNumeric(Expr) diff --git a/Task/Determine-if-a-string-is-numeric/Vedit-macro-language/determine-if-a-string-is-numeric.vedit b/Task/Determine-if-a-string-is-numeric/Vedit-macro-language/determine-if-a-string-is-numeric.vedit new file mode 100644 index 0000000000..376721ad11 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Vedit-macro-language/determine-if-a-string-is-numeric.vedit @@ -0,0 +1,6 @@ +:IS_NUMERIC: +if (Num_Eval(SUPPRESS)==0 && Cur_Char != '0') { + Return(FALSE) +} else { + Return(TRUE) +} diff --git a/Task/Determine-if-a-string-is-numeric/Visual-Basic-.NET/determine-if-a-string-is-numeric.visual b/Task/Determine-if-a-string-is-numeric/Visual-Basic-.NET/determine-if-a-string-is-numeric.visual new file mode 100644 index 0000000000..e37bec3b84 --- /dev/null +++ b/Task/Determine-if-a-string-is-numeric/Visual-Basic-.NET/determine-if-a-string-is-numeric.visual @@ -0,0 +1,5 @@ +Dim Value As String = "+123" + +If IsNumeric(Value) Then + PRINT "It is numeric." +End If diff --git a/Task/Determine-if-only-one-instance-is-running/Mathematica/determine-if-only-one-instance-is-running.mathematica b/Task/Determine-if-only-one-instance-is-running/Mathematica/determine-if-only-one-instance-is-running.math similarity index 100% rename from Task/Determine-if-only-one-instance-is-running/Mathematica/determine-if-only-one-instance-is-running.mathematica rename to Task/Determine-if-only-one-instance-is-running/Mathematica/determine-if-only-one-instance-is-running.math diff --git a/Task/Determine-if-only-one-instance-is-running/OCaml/determine-if-only-one-instance-is-running.ocaml b/Task/Determine-if-only-one-instance-is-running/OCaml/determine-if-only-one-instance-is-running.ocaml new file mode 100644 index 0000000000..cd75727023 --- /dev/null +++ b/Task/Determine-if-only-one-instance-is-running/OCaml/determine-if-only-one-instance-is-running.ocaml @@ -0,0 +1,11 @@ +open Sem + +let () = + let oflags = [Unix.O_CREAT; + Unix.O_EXCL] in + let sem = sem_open "MyUniqueName" ~oflags () in + (* here the real code of the app *) + Unix.sleep 20; + (* end of the app *) + sem_unlink "MyUniqueName"; + sem_close sem diff --git a/Task/Determine-if-only-one-instance-is-running/Oz/determine-if-only-one-instance-is-running.oz b/Task/Determine-if-only-one-instance-is-running/Oz/determine-if-only-one-instance-is-running.oz new file mode 100644 index 0000000000..a97162d5fe --- /dev/null +++ b/Task/Determine-if-only-one-instance-is-running/Oz/determine-if-only-one-instance-is-running.oz @@ -0,0 +1,22 @@ +functor +import Application Open System +define + fun {IsAlreadyRunning} + try + S = {New Open.socket init} + in + {S bind(takePort:12345)} + false + catch system(os(os "bind" ...) ...) then + true + end + end + + if {IsAlreadyRunning} then + {System.showInfo "Exiting because already running."} + {Application.exit 1} + end + {System.showInfo "Press enter to exit."} + {{New Open.file init(name:stdin)} read(list:_ size:1)} + {Application.exit 0} +end diff --git a/Task/Determine-if-only-one-instance-is-running/PureBasic/determine-if-only-one-instance-is-running.purebasic b/Task/Determine-if-only-one-instance-is-running/PureBasic/determine-if-only-one-instance-is-running.purebasic new file mode 100644 index 0000000000..edae63e7ba --- /dev/null +++ b/Task/Determine-if-only-one-instance-is-running/PureBasic/determine-if-only-one-instance-is-running.purebasic @@ -0,0 +1,11 @@ +#MyApp="MyLittleApp" +Mutex=CreateMutex_(0,1,#MyApp) +If GetLastError_()=#ERROR_ALREADY_EXISTS + MessageRequester(#MyApp,"One instance is already started.") + End +EndIf + +; Main code executes here + +ReleaseMutex_(Mutex) +End diff --git a/Task/Determine-if-only-one-instance-is-running/Run-BASIC/determine-if-only-one-instance-is-running.run b/Task/Determine-if-only-one-instance-is-running/Run-BASIC/determine-if-only-one-instance-is-running.run new file mode 100644 index 0000000000..28498eabfa --- /dev/null +++ b/Task/Determine-if-only-one-instance-is-running/Run-BASIC/determine-if-only-one-instance-is-running.run @@ -0,0 +1 @@ +if instr(shell$("tasklist"),"rbp.exe") <> 0 then print "Task is Running" diff --git a/Task/Determine-if-only-one-instance-is-running/UNIX-Shell/determine-if-only-one-instance-is-running.sh b/Task/Determine-if-only-one-instance-is-running/UNIX-Shell/determine-if-only-one-instance-is-running.sh new file mode 100644 index 0000000000..8fde4438d1 --- /dev/null +++ b/Task/Determine-if-only-one-instance-is-running/UNIX-Shell/determine-if-only-one-instance-is-running.sh @@ -0,0 +1,36 @@ +# (c) Copyright 2005 Mark Hobley +# +# This is free software. This file can be redistributed or modified +# under the terms of version 1.2 of the GNU Free Documentation Licence +# as published by the Free Software Foundation. +# + + singleinstance () + { + if [ -d $SRUNDIR ] ; then + if [ -w $SRUNDIR ] ; then + if [ -d $SRUNDIR/$APPNAME ] ; then + echo "Process Already Running" >& 2 + return 221 + else + mkdir $SRUNDIR/$APPNAME + if [ "$?" -ne 0 ] ; then + if [ -d $SRUNDIR/$APPNAME ] ; then + echo "Process Already Running" >& 2 + return 221 + else + echo "Unexpected Error" >& 2 + return 239 + fi + fi + return 0 ; # This is a unique instance + fi + else + echo "Permission Denied" >& 2 + return 210 + fi + else + echo "Missing Directory" >& 2 + return 199 + fi + } diff --git a/Task/Determine-if-only-one-instance-is-running/Visual-Basic/determine-if-only-one-instance-is-running.vb b/Task/Determine-if-only-one-instance-is-running/Visual-Basic/determine-if-only-one-instance-is-running.vb new file mode 100644 index 0000000000..66bb523285 --- /dev/null +++ b/Task/Determine-if-only-one-instance-is-running/Visual-Basic/determine-if-only-one-instance-is-running.vb @@ -0,0 +1,2 @@ +Dim onlyInstance as Boolean +onlyInstance = not App.PrevInstance diff --git a/Task/Digital-root/BASIC/digital-root.bas b/Task/Digital-root/BASIC/digital-root.basic similarity index 100% rename from Task/Digital-root/BASIC/digital-root.bas rename to Task/Digital-root/BASIC/digital-root.basic diff --git a/Task/Digital-root/Mathematica/digital-root.mathematica b/Task/Digital-root/Mathematica/digital-root.math similarity index 100% rename from Task/Digital-root/Mathematica/digital-root.mathematica rename to Task/Digital-root/Mathematica/digital-root.math diff --git a/Task/Digital-root/NetRexx/digital-root.netrexx b/Task/Digital-root/NetRexx/digital-root.netrexx new file mode 100644 index 0000000000..460895ab13 --- /dev/null +++ b/Task/Digital-root/NetRexx/digital-root.netrexx @@ -0,0 +1,34 @@ +/* NetRexx ************************************************************ +* Test digroot +**********************************************************************/ +Say 'number -> digital_root persistence' +test_digroot(7 ,7, 0) +test_digroot(627615 ,9, 2) +test_digroot(39390 ,6, 2) +test_digroot(588225 ,3, 2) +test_digroot(393900588225,9, 2) +test_digroot(393900588225,9, 3) /* test error case */ + +method test_digroot(n,dx,px) static +res=digroot(n) +Parse res d p +If d=dx & p=px Then tag='ok' + Else tag='expected:' dx px +Say n '->' d p tag + +method digroot(n) static +/********************************************************************** +* Compute the digital root and persistence of the given decimal number +* 19.08.2012 Walter Pachl derived from Rexx +**************************** Bottom of Data **************************/ +p=0 /* persistence */ +Loop While n.length()>1 /* more than one digit in n */ + s=0 /* initialize sum */ + p=p+1 /* increment persistence */ + Loop while n<>'' /* as long as there are digits */ + Parse n c +1 n /* pick the first one */ + s=s+c /* add to the new sum */ + End + n=s /* the 'new' number */ + End +return n p /* return root and persistence */ diff --git a/Task/Digital-root/PARI-GP/digital-root.pari b/Task/Digital-root/PARI-GP/digital-root.pari new file mode 100644 index 0000000000..c2bc6e78a3 --- /dev/null +++ b/Task/Digital-root/PARI-GP/digital-root.pari @@ -0,0 +1,3 @@ +dsum(n)=my(s); while(n, s+=n%10; n\=10); s +additivePersistence(n)=my(s); while(n>9, s++; n=dsum(n)); s +digitalRoot(n)=if(n, (n-1)%9+1, 0) diff --git a/Task/Digital-root/PL-I/digital-root.pli b/Task/Digital-root/PL-I/digital-root.pli new file mode 100644 index 0000000000..a9676b094e --- /dev/null +++ b/Task/Digital-root/PL-I/digital-root.pli @@ -0,0 +1,59 @@ + digrt: Proc Options(main); + /* REXX *************************************************************** + * Test digroot + **********************************************************************/ + + Call digrtst('7'); + Call digrtst('627615'); + Call digrtst('39390'); + Call digrtst('588225'); + Call digrtst('393900588225'); + + digrtst: Proc(n); + Dcl n Char(100) Var; + Dcl dr Pic'9'; + Dcl p Dec Fixed(5); + Call digroot(n,dr,p); + Put Edit(n,dr,p)(skip,a,col(20),f(1),f(3)); + End; + + digroot: Proc(n,dr,p); + /********************************************************************** + * Compute the digital root and persistence of the given decimal number + * 27.07.2012 Walter Pachl (derived from REXX) + **********************************************************************/ + Dcl n Char(100) Var; + Dcl dr Pic'9'; + Dcl p Dec Fixed(5); + Dcl s Pic'(14)Z9'; + Dcl v Char(100) Var; + p=0; + v=strip(n); /* copy the number */ + If length(v)=1 Then + dr=v; + Else Do; + Do While(length(v)>1); /* more than one digit in v */ + s=0; /* initialize sum */ + p+=1; /* increment persistence */ + Do i=1 To length(v); /* loop over all digits */ + dig=substr(v,i,1); /* pick a digit */ + s=s+dig; /* add to the new sum */ + End; + /*Put Skip Data(v,p,s);*/ + v=strip(s); /* the 'new' number */ + End; + dr=Decimal(s,1,0); + End; + Return; + End; + + strip: Proc(x) Returns(Char(100) Var); + Dcl x Char(*); + Dcl res Char(100) Var Init(''); + Do i=1 To length(x); + If substr(x,i,1)>' ' Then + res=res||substr(x,i,1); + End; + Return(res); + End; + End; diff --git a/Task/Digital-root/Perl-6/digital-root-1.pl6 b/Task/Digital-root/Perl-6/digital-root-1.pl6 new file mode 100644 index 0000000000..93d692a982 --- /dev/null +++ b/Task/Digital-root/Perl-6/digital-root-1.pl6 @@ -0,0 +1,23 @@ +sub digroot ($r, :$base = 10) { + my $root = $r.base($base); + my $persistence = 0; + while $root.chars > 1 { + $root = [+]($root.comb.map({:36($_)})).base($base); + $persistence++; + } + $root, $persistence; +} + +my @testnums = + 627615, + 39390, + 588225, + 393900588225, + 58142718981673030403681039458302204471300738980834668522257090844071443085937; + +for 10, 8, 16, 36 -> $b { + for @testnums -> $n { + printf ":$b\<%s>\ndigital root %s, persistence %s\n\n", + $n.base($b), digroot $n, :base($b); + } +} diff --git a/Task/Digital-root/Perl-6/digital-root-2.pl6 b/Task/Digital-root/Perl-6/digital-root-2.pl6 new file mode 100644 index 0000000000..be95608d15 --- /dev/null +++ b/Task/Digital-root/Perl-6/digital-root-2.pl6 @@ -0,0 +1,6 @@ +sub digroot ($r, :$base = 10) { + my &sum = { [+](.comb.map({:36($_)})).base($base) } + + return .[*-1], .elems-1 + given $r.base($base), &sum ... { .chars == 1 } +} diff --git a/Task/Digital-root/PureBasic/digital-root.purebasic b/Task/Digital-root/PureBasic/digital-root.purebasic new file mode 100644 index 0000000000..77ab1ad76d --- /dev/null +++ b/Task/Digital-root/PureBasic/digital-root.purebasic @@ -0,0 +1,49 @@ +; if you just want the DigitalRoot +; Procedure.q DigitalRoot(N.q) apparently will do +; i must have missed something because it seems too simple +; http://en.wikipedia.org/wiki/Digital_root#Congruence_formula + +Procedure.q DigitalRoot(N.q) +Protected M.q=N%9 +if M=0:ProcedureReturn 9 +Else :ProcedureReturn M:EndIf +EndProcedure + +; there appears to be a proof guarantying that Len(N$)<=1 for some X +; http://en.wikipedia.org/wiki/Digital_root#Proof_that_a_constant_value_exists + +Procedure.s DigitalRootandPersistance(N.q) +Protected r.s,t.s,X.q,M.q,persistance,N$=Str(N) +M=DigitalRoot(N.q) ; just a test to see if we get the same DigitalRoot via the Congruence_formula + +Repeat +X=0:Persistance+1 + +For i=1 to Len(N$) ; finding X as the sum of the digits of N +X+Val(Mid(N$,i,1)) +Next + +N$=Str(X) +If Len(N$)<=1:Break:EndIf ; If Len(N$)<=1:Break:EndIf +Forever + +If Not (X-M)=0:t.s=" Error in my logic":else:t.s=" ok":EndIf + +r.s=RSet(Str(N),15)+" has additive persistance "+Str(Persistance) +r.s+" and digital root of X(slow) ="+Str(X)+" M(fast) ="+Str(M)+t.s +ProcedureReturn r.s +EndProcedure + +NewList Nlist.q() +AddElement(Nlist()) : Nlist()=627615 +AddElement(Nlist()) : Nlist()=39390 +AddElement(Nlist()) : Nlist()=588225 +AddElement(Nlist()) : Nlist()=393900588225 + +FirstElement(Nlist()) + +ForEach Nlist() +N.q=Nlist() +; cw(DigitalRootandPersistance(N)) +Debug DigitalRootandPersistance(N) +Next diff --git a/Task/Digital-root/Run-BASIC/digital-root.run b/Task/Digital-root/Run-BASIC/digital-root.run new file mode 100644 index 0000000000..1f54665abb --- /dev/null +++ b/Task/Digital-root/Run-BASIC/digital-root.run @@ -0,0 +1,23 @@ +print "Digital root of 627615 is "; digitRoot$(627615, 10) +print "Digital root of 39390 is "; digitRoot$(39390, 10) +print "Digital root of 588225 is "; digitRoot$(588225, 10) +print "Digital root of 393900588225 is "; digitRoot$(393900588225, 10) +print "Digital root of 9992 is "; digitRoot$(9992, 10) +END + +function digitRoot$(n,b) +WHILE n >= b + c = c + 1 + n = digSum(n, b) +wend +digitRoot$ = n;" persistance is ";c +end function + +function digSum(n, b) +WHILE n <> 0 + q = INT(n / b) + s = s + n - q * b + n = q +wend +digSum = s +end function diff --git a/Task/Digital-root/XPL0/digital-root.xpl0 b/Task/Digital-root/XPL0/digital-root.xpl0 new file mode 100644 index 0000000000..bca339dd49 --- /dev/null +++ b/Task/Digital-root/XPL0/digital-root.xpl0 @@ -0,0 +1,26 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations + +func DRoot(N, B, P); \Return digital root and persistance P +real N, B; int P; +int S; +[P(0):= 0; +while N >= B do + [S:= 0; + repeat S:= S + fix(Mod(N,B)); \sum last digit + N:= N/B; \remove last digit + N:= N - Mod(N,1.); + until N < 0.1; \(beware of rounding errors) + P(0):= P(0)+1; \increment persistance + N:= float(S); + ]; +return fix(N); +]; + +real Tbl; +int I, Root, Pers; +[Tbl:= [627615., 39390., 588225., 393900588225.]; +for I:= 0 to 4-1 do + [Root:= DRoot(Tbl(I), 10., @Pers); + IntOut(0, Pers); ChOut(0, ^ ); IntOut(0, Root); CrLf(0); + ]; +] diff --git a/Task/Dinesmans-multiple-dwelling-problem/Mathematica/dinesmans-multiple-dwelling-problem.mathematica b/Task/Dinesmans-multiple-dwelling-problem/Mathematica/dinesmans-multiple-dwelling-problem.math similarity index 100% rename from Task/Dinesmans-multiple-dwelling-problem/Mathematica/dinesmans-multiple-dwelling-problem.mathematica rename to Task/Dinesmans-multiple-dwelling-problem/Mathematica/dinesmans-multiple-dwelling-problem.math diff --git a/Task/Dinesmans-multiple-dwelling-problem/Perl-6/dinesmans-multiple-dwelling-problem.pl6 b/Task/Dinesmans-multiple-dwelling-problem/Perl-6/dinesmans-multiple-dwelling-problem.pl6 new file mode 100644 index 0000000000..12f8f50dfc --- /dev/null +++ b/Task/Dinesmans-multiple-dwelling-problem/Perl-6/dinesmans-multiple-dwelling-problem.pl6 @@ -0,0 +1,26 @@ +sub next_perm ( @a is copy ) { + my $j = @a.end - 1; + return Nil if --$j < 0 while [>] @a[ $j, $j+1 ]; + + my $aj = @a[$j]; + my $k = @a.end; + $k-- while [>] $aj, @a[$k]; + @a[ $j, $k ] .= reverse; + + my $r = @a.end; + my $s = $j + 1; + @a[ $r--, $s++ ] .= reverse while $r > $s; + return @a; +} + +# Contains only five floors. 5! = 120 permutations. +for [1..5], &next_perm ...^ !* -> [ $b, $c, $f, $m, $s ] { + say "Baker=$b Cooper=$c Fletcher=$f Miller=$m Smith=$s" + if $b != 5 # Baker !live on top floor. + and $c != 1 # Cooper !live on bottom floor. + and $f != 1|5 # Fletcher !live on top or the bottom floor. + and $m > $c # Miller lives on a higher floor than Cooper. + and $s != $f-1|$f+1 # Smith !live adjacent to Fletcher + and $f != $c-1|$c+1 # Fletcher !live adjacent to Cooper + ; +} diff --git a/Task/Dinesmans-multiple-dwelling-problem/PureBasic/dinesmans-multiple-dwelling-problem.purebasic b/Task/Dinesmans-multiple-dwelling-problem/PureBasic/dinesmans-multiple-dwelling-problem.purebasic new file mode 100644 index 0000000000..4fc8ef29f9 --- /dev/null +++ b/Task/Dinesmans-multiple-dwelling-problem/PureBasic/dinesmans-multiple-dwelling-problem.purebasic @@ -0,0 +1,100 @@ +Prototype cond(Array t(1)) + +Enumeration #Null + #Baker + #Cooper + #Fletcher + #Miller + #Smith +EndEnumeration + +Procedure checkTenands(Array tenants(1), Array Condions.cond(1)) + Protected i, j + Protected.cond *f + j=ArraySize(Condions()) + For i=0 To j + *f=Condions(i) ; load the function pointer to the current condition + If *f(tenants()) = #False + ProcedureReturn #False + EndIf + Next + ProcedureReturn #True +EndProcedure + +Procedure C1(Array t(1)) + If Int(Abs(t(#Fletcher)-t(#Cooper)))<>1 + ProcedureReturn #True + EndIf +EndProcedure + +Procedure C2(Array t(1)) + If t(#Baker)<>5 + ProcedureReturn #True + EndIf +EndProcedure + +Procedure C3(Array t(1)) + If t(#Cooper)<>1 + ProcedureReturn #True + EndIf +EndProcedure + +Procedure C4(Array t(1)) + If t(#Miller) >= t(#Cooper) + ProcedureReturn #True + EndIf +EndProcedure + +Procedure C5(Array t(1)) + If t(#Fletcher)<>1 And t(#Fletcher)<>5 + ProcedureReturn #True + EndIf +EndProcedure + +Procedure C6(Array t(1)) + If Int(Abs(t(#Smith)-t(#Fletcher)))<>1 + ProcedureReturn #True + EndIf +EndProcedure + + +If OpenConsole() + Dim People(4) + Dim Conditions(5) + Define a, b, c, d, e, i + ; + ;- Load all conditions + Conditions(i)=@C1(): i+1 + Conditions(i)=@C2(): i+1 + Conditions(i)=@C3(): i+1 + Conditions(i)=@C4(): i+1 + Conditions(i)=@C5(): i+1 + Conditions(i)=@C6() + ; + ; generate and the all legal combinations + For a=1 To 5 + For b=1 To 5 + If a=b: Continue: EndIf + For c=1 To 5 + If a=c Or b=c: Continue: EndIf + For d=1 To 5 + If d=a Or d=b Or d=c : Continue: EndIf + For e=1 To 5 + If e=a Or e=b Or e=c Or e=d: Continue: EndIf + People(#Baker)=a + People(#Cooper)=b + People(#Fletcher)=c + People(#Miller)=d + People(#Smith)=e + If checkTenands(People(), Conditions()) + PrintN("Solution found;") + PrintN("Baker="+Str(a)+#CRLF$+"Cooper="+Str(b)+#CRLF$+"Fletcher="+Str(c)) + PrintN("Miller="+Str(d)+#CRLF$+"Smith="+Str(e)+#CRLF$) + EndIf + Next + Next + Next + Next + Next + Print("Press ENTER to exit"): Input() +EndIf diff --git a/Task/Dinesmans-multiple-dwelling-problem/Run-BASIC/dinesmans-multiple-dwelling-problem.run b/Task/Dinesmans-multiple-dwelling-problem/Run-BASIC/dinesmans-multiple-dwelling-problem.run new file mode 100644 index 0000000000..093624997f --- /dev/null +++ b/Task/Dinesmans-multiple-dwelling-problem/Run-BASIC/dinesmans-multiple-dwelling-problem.run @@ -0,0 +1,33 @@ +people$ = "Baler,Cooper,Fletcher,Miller,Smith" + +for baler = 1 to 4 ' can not be in room 5 + for cooper = 2 to 5 ' can not be in room 1 + for fletcher = 2 to 4 ' can not be in room 1 or 5 + for miller = 1 to 5 ' can be in any room + for smith = 1 to 5 ' can be in any room + if miller > cooper and abs(smith - fletcher) > 1 and abs(fletcher - cooper) > 1 then + if baler + cooper + fletcher + miller + smith = 15 then ' that is 1 + 2 + 3 + 4 + 5 + rooms$ = baler;cooper;fletcher;miller;smith + bad = 0 + for i = 1 to 5 ' make sure each room is unique + rm$ = chr$(i + 48) + r1 = instr(rooms$,rm$) + r2 = instr(rooms$,rm$,r1+1) + if r2 <> 0 then bad = 1 + next i + if bad = 0 then goto [roomAssgn] ' if it is not bad it is a good assignment + end if + end if + next smith + next miller + next fletcher + next cooper +next baler +print "Cam't assign rooms" ' print this if it can not find a solution +wait + +[roomAssgn] +Print "Room Assignment" +for i = 1 to 5 +print mid$(rooms$,i,1);" ";word$(people$,i,",");" "; ' print the room assignments +next i diff --git a/Task/Dinesmans-multiple-dwelling-problem/UNIX-Shell/dinesmans-multiple-dwelling-problem.sh b/Task/Dinesmans-multiple-dwelling-problem/UNIX-Shell/dinesmans-multiple-dwelling-problem.sh new file mode 100644 index 0000000000..2703a33864 --- /dev/null +++ b/Task/Dinesmans-multiple-dwelling-problem/UNIX-Shell/dinesmans-multiple-dwelling-problem.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +NAMES=(Baker Cooper Fletcher Miller Smith) + +CRITERIA=( + 'Baker != TOP' + 'Cooper != BOTTOM' + 'Fletcher != TOP' + 'Fletcher != BOTTOM' + 'Miller > Cooper' + '$(abs $(( Smith - Fletcher )) ) > 1' + '$(abs $(( Fletcher - Cooper )) ) > 1' +) + +# Code below here shouldn't need to change to vary parameters +let BOTTOM=0 +let TOP=${#NAMES[@]}-1 + +# Not available as a builtin +function abs { + let n=$1 + if (( n < 0 )); then let n=-n; fi + echo "$n" +} + +# Algorithm we use to iterate over the permutations +# requires that we start with the array sorted lexically +NAMES=($(printf "%s\n" "${NAMES[@]}" | sort)) +while true; do + # set each name to its position in the array + for (( i=BOTTOM; i<=TOP; ++i )); do + eval "${NAMES[i]}=$i" + done + + # check to see if we've solved the problem + let solved=1 + for criterion in "${CRITERIA[@]}"; do + if ! eval "(( $criterion ))"; then + let solved=0 + break + fi + done + if (( solved )); then + echo "From bottom to top: ${NAMES[@]}" + break + fi + + # Bump the names list to the next permutation + let j=TOP-1 + while (( j >= BOTTOM )) && ! [[ "${NAMES[j]}" < "${NAMES[j+1]}" ]]; do + let j-=1 + done + if (( j < BOTTOM )); then break; fi + let k=TOP + while (( k > j )) && [[ "${NAMES[k]}" < "${NAMES[j]}" ]]; do + let k-=1 + done + if (( k <= j )); then break; fi + t="${NAMES[j]}" + NAMES[j]="${NAMES[k]}" + NAMES[k]="$t" + for (( k=1; k<=(TOP-j); ++k )); do + a=BOTTOM+j+k + b=TOP-k+1 + if (( a < b )); then + t="${NAMES[a]}" + NAMES[a]="${NAMES[b]}" + NAMES[b]="$t" + fi + done +done diff --git a/Task/Dinesmans-multiple-dwelling-problem/XPL0/dinesmans-multiple-dwelling-problem.xpl0 b/Task/Dinesmans-multiple-dwelling-problem/XPL0/dinesmans-multiple-dwelling-problem.xpl0 new file mode 100644 index 0000000000..a6937cfd5f --- /dev/null +++ b/Task/Dinesmans-multiple-dwelling-problem/XPL0/dinesmans-multiple-dwelling-problem.xpl0 @@ -0,0 +1,17 @@ +include c:\cxpl\codes; +int B, C, F, M, S; +for B:= 1 to 4 do \Baker does not live on top (5th) floor + for C:= 2 to 5 do \Cooper does not live on bottom floor + if C#B then \Cooper & Baker live on different floors + for F:= 2 to 4 do \Fletcher doesn't live on top or bottom + if F#B & F#C & F#C-1 & F#C+1 then \ and she's not adjacent to Cooper + for M:= 1 to 5 do + if M#F & M#B & M>C then \Miller lives above Cooper + for S:= 1 to 5 do \Smith is not adjacent to Fletcher + if S#M & S#F & S#C & S#B & S#F-1 & S#F+1 then \show + [Text(0, "Baker "); IntOut(0, B); CrLf(0); \all + Text(0, "Cooper "); IntOut(0, C); CrLf(0); \possible + Text(0, "Fletcher "); IntOut(0, F); CrLf(0); \solutions + Text(0, "Miller "); IntOut(0, M); CrLf(0); + Text(0, "Smith "); IntOut(0, S); CrLf(0); + ] diff --git a/Task/Dining-philosophers/OxygenBasic/dining-philosophers.oxy b/Task/Dining-philosophers/OxygenBasic/dining-philosophers.oxy new file mode 100644 index 0000000000..807a2193c3 --- /dev/null +++ b/Task/Dining-philosophers/OxygenBasic/dining-philosophers.oxy @@ -0,0 +1,101 @@ +'========================= +class RoundTableWith5Seats +'========================= + + % hungry 0 + % beingUsed 1 + % putDown 0 + % empty 0 + + sys fork[5], plate[5],chair[5],philosopher[5] + sys first + + method AddPasta() as sys + function rand() as sys + static seed=0x12345678 + mov eax,seed + rol eax,7 + mul seed + xor eax,0x5335ABD9 + mov seed,eax + return seed + end function + return 4+(rand() and 15) + end method + + method dine() + first++ 'PRIORITY DINER + if first>5 then first-=5 + for i=1 to 5 + kl=first+i-1 + kr=first+i + if kl>5 then kl-=5 + if kr>5 then kr-=5 + if philosopher(kl) = hungry then + if not fork(kl) or fork(kr) = beingUsed then + plate(kl) = AddPasta() + fork(kl)=beingUsed + fork(kr)=beingUsed + end if + end if + ' + next + ' + for kl=1 to 5 + kr=kl+1 : if kr>5 then kr-=5 + if plate(kl) + philosopher(kl)+=1 'PHILOSOPHER DINING + --plate(kl) + if plate(kl)=empty + fork(kl)=PutDown + fork(kr)=PutDown + end if + else + if philosopher(kl)>0 + --philosopher(kl) 'PHILOSOPHER THINKING + end if + end if + next + ' + end method + + method show() as string + cr=chr(13)+chr(10) : tab=chr(9) + pr="philos" tab "activity" tab "plate" tab "fork L" tab "fork R" cr cr + for i=1 to 5 + j=i+1 : if j>5 then j-=5 + if plate(i)=0 then + if philosopher(i)=0 then + act="waiting" + else + act="thinks" + end if + else + act="dining" + end if + ' + pr+=i tab act tab plate(i) tab fork(i) tab fork(j) cr + next + return pr + end method + +end class + +'TEST +'==== + +RoundTableWith5Seats Sopho +for i=1 to 100 + Sopho.dine +next + +print Sopho.show +'putfile "s.txt",Sopho.show + +'philos action plate fork L fork R +' +'1 waiting 0 0 1 +'2 dining 8 1 1 +'3 thinks 0 1 1 +'4 dining 8 1 1 +'5 thinks 0 1 0 diff --git a/Task/Dining-philosophers/Oz/dining-philosophers.oz b/Task/Dining-philosophers/Oz/dining-philosophers.oz new file mode 100644 index 0000000000..d0b5de2536 --- /dev/null +++ b/Task/Dining-philosophers/Oz/dining-philosophers.oz @@ -0,0 +1,117 @@ +declare + Philosophers = [aristotle kant spinoza marx russell] + + proc {Start} + Forks = {MakeList {Length Philosophers}} + in + {ForAll Forks NewFork} + for + Name in Philosophers + LeftFork in Forks + RightFork in {RightShift Forks} + do + thread + {Philosopher Name LeftFork RightFork} + end + end + end + + proc {Philosopher Name LeftFork RightFork} + for do + {ShowInfo Name#" is hungry."} + + {TakeForks [LeftFork RightFork]} + {ShowInfo Name#" got forks."} + {WaitRandom} + {ReleaseFork LeftFork} + {ReleaseFork RightFork} + + {ShowInfo Name#" is thinking."} + {WaitRandom} + end + end + + proc {WaitRandom} + {Delay 1000 + {OS.rand} mod 4000} %% 1-5 seconds + end + + proc {TakeForks Forks} + {ForAll Forks WaitForFork} + case {TryAtomically proc {$} + {ForAll Forks TakeFork} + end} + of true then + {ForAll Forks InitForkNotifier} + [] false then + {TakeForks Forks} + end + end + + %% + %% Fork type + %% + + %% A fork is a mutable reference to a pair + fun {NewFork} + {NewCell + unit(taken:_ %% a fork is taken by setting this value to a unique value + notify:unit %% to wait for a taken fork + )} + end + + proc {TakeFork F} + (@F).taken = {NewName} + end + + proc {InitForkNotifier F} + %% we cannot do this in TakeFork + %% because side effect are not allowed in subordinate spaces + New Old + in + {Exchange F Old New} + New = unit(taken:Old.taken notify:_) + end + + proc {ReleaseFork F} + New Old + in + {Exchange F Old New} + New = unit(taken:_ notify:unit) + Old.notify = unit %% notify waiters + end + + proc {WaitForFork F} + {Wait (@F).notify} %% returns immediatly if fork is free, otherwise blocks + end + + %% + %% Helpers + %% + + %% Implements transactions on data flow variables + %% with computation spaces. Returns success. + fun {TryAtomically P} + try + S = {Space.new + proc {$ Sync} + {P} + Sync = unit + end} + in + {Space.askVerbose S} \= failed = true + {Wait {Space.merge S}} + true + catch _ then + false + end + end + + fun {RightShift Xs} %% circular + case Xs of nil then nil + else {Append Xs.2 [Xs.1]} + end + end + + ShowInfo = System.showInfo +in + {Start} diff --git a/Task/Dining-philosophers/Pike/dining-philosophers.pike b/Task/Dining-philosophers/Pike/dining-philosophers.pike new file mode 100644 index 0000000000..3ee6a625f4 --- /dev/null +++ b/Task/Dining-philosophers/Pike/dining-philosophers.pike @@ -0,0 +1,94 @@ +class Philosopher +{ + string name; + object left; + object right; + + void create(string _name, object _left, object _right) + { + name = _name; + left = _left; + right = _right; + } + + void take_forks() + { + if (left->take(this) && right->take(this)) + { + write("%s is EATING\n", name); + call_out(drop_forks, random(30)); + } + else + { + write("%s is WAITING\n", name); + if (random(10) >= 8) + drop_forks(); + call_out(take_forks, random(10)); + } + } + + void drop_forks() + { + left->drop(this); + right->drop(this); + write("%s is THINKING\n", name); + call_out(take_forks, random(30)); + } +} + +class Fork +{ + int number; + Philosopher user; + + void create(int _number) + { + number = _number; + } + + int take(object new_user) + { + if (!user) + { + write("%s takes fork %d\n", new_user->name, number); + user = new_user; + return 1; + } + else if (new_user == user) + { + write("%s has fork %d\n", new_user->name, number); + return 1; + } + else + write("%s tries to take fork %d from %s\n", new_user->name, number, user->name); + } + + void drop(object old_user) + { + if (old_user == user) + { + write("%s drops fork %d\n", old_user->name, number); + user = 0; + } + } +} + +int main(int argc, array argv) +{ + + array forks = ({ Fork(1), Fork(2), Fork(3), Fork(4), Fork(5) }); + array philosophers = ({ + Philosopher("einstein", forks[0], forks[1]), + Philosopher("plato", forks[1], forks[2]), + Philosopher("sokrates", forks[2], forks[3]), + Philosopher("chomsky", forks[3], forks[4]), + Philosopher("archimedes", forks[4], forks[0]), + }); + + call_out(philosophers[0]->take_forks, random(5)); + call_out(philosophers[1]->take_forks, random(5)); + call_out(philosophers[2]->take_forks, random(5)); + call_out(philosophers[3]->take_forks, random(5)); + call_out(philosophers[4]->take_forks, random(5)); + return -1; +} diff --git a/Task/Dining-philosophers/PureBasic/dining-philosophers.purebasic b/Task/Dining-philosophers/PureBasic/dining-philosophers.purebasic new file mode 100644 index 0000000000..459d614239 --- /dev/null +++ b/Task/Dining-philosophers/PureBasic/dining-philosophers.purebasic @@ -0,0 +1,117 @@ +Macro Tell(Mutex, Message) ; Make a macro to easy send info back to main thread + LockMutex(Mutex) + LastElement(Queue()) + AddElement(Queue()) + Queue() = Message + SignalSemaphore(Semaphore) + UnlockMutex(Mutex) +EndMacro + +;Set up a data structure to pass needed info into the threads +Structure Thread_Parameters + Name.s + fork1.i + fork2.i +EndStructure + +; Declare function to be used +Declare.i TryFork(n) +Declare PutDownFork(n) +Declare Invite(Namn.s, Fork1, Fork2) +Declare _philosophers(*arg.Thread_Parameters) + +Global Semaphore = CreateSemaphore() +Global Mutex1 = CreateMutex() ; Eg. fork 1 +Global Mutex2 = CreateMutex() ; Eg. fork 2 +Global Mutex3 = CreateMutex() ; Eg. fork 3 +Global Mutex4 = CreateMutex() ; Eg. fork 4 +Global Mutex5 = CreateMutex() ; Eg. fork 5 +Global Mutex_main = CreateMutex() ; locking communication with the main thread which do all output. +Global NewList Queue.s() + +If OpenConsole() + Invite("Aristotle",1,2) ; Get all Philosophers activated + Invite("Kant", 2,3) + Invite("Spinoza", 3,4) + Invite("Marx", 4,5) + Invite("Russell", 5,1) + CompilerIf #PB_Compiler_OS=#PB_OS_Windows + SetConsoleTitle_("Dining philosophers, by Jofur") ; Using a Windows-API here, so checking before + CompilerEndIf + ; Wait and see if any Philosophers want to tell me anything + Repeat + WaitSemaphore(Semaphore) + LockMutex(Mutex_main) + ForEach Queue() + PrintN( Queue() ) ; Print what the Philosopher(s) told me + i-1 + Next Queue() + ClearList(Queue()) + UnlockMutex(Mutex_main) + ForEver +EndIf + +Procedure TryFork(n) ; Se is fork #n is free and if so pick it up + Select n + Case 1: ProcedureReturn TryLockMutex(Mutex1) + Case 2: ProcedureReturn TryLockMutex(Mutex2) + Case 3: ProcedureReturn TryLockMutex(Mutex3) + Case 4: ProcedureReturn TryLockMutex(Mutex4) + Default:ProcedureReturn TryLockMutex(Mutex5) + EndSelect +EndProcedure + +Procedure PutDownFork(n) ; put down fork #n and free it to be used by neighbors. + Select n + Case 1: UnlockMutex(Mutex1) + Case 2: UnlockMutex(Mutex2) + Case 3: UnlockMutex(Mutex3) + Case 4: UnlockMutex(Mutex4) + Default:UnlockMutex(Mutex5) + EndSelect +EndProcedure + +Procedure Invite(Namn.s, Fork1, Fork2) + Protected *arg.Thread_Parameters ;create the structure containing the parameters + Protected Thread + *arg = AllocateMemory(SizeOf(Thread_Parameters)) + *arg\Name = Namn + *arg\fork1 = Fork1 + *arg\fork2 = Fork2 + Thread=CreateThread(@_philosophers(), *arg) ;send the thread a pointer to our structure + ProcedureReturn Thread +EndProcedure + +Procedure _philosophers(*arg.Thread_Parameters) + Protected Iam.s=*arg\Name, j=*arg\fork1, k=*arg\fork2 + Protected f1, f2 + ClearStructure(*arg, Thread_Parameters) + FreeMemory(*arg) + ; + Repeat + Tell(Mutex_main,Iam+": Going to the table") + Repeat ;Trying to get my two forks + f1=TryFork(j) + If f1 + f2=TryFork(k) + If Not f2 ; I got only one fork + PutDownFork(j) + f1=0 + EndIf + EndIf + If Not f2 + Delay(Random(100)) ; Take a short breath, then try the forks in the other order + Swap j,k + EndIf + Until f1 And f2 + Tell(Mutex_main,Iam+": I have fork #"+Str(j)+" & #"+Str(k)+" and I'm eating now") + Delay(Random(1500)+15) + Tell(Mutex_main,Iam+": release fork #"+Str(j)+" & #"+Str(k)+"") + Delay(Random(45)+15) + PutDownFork(j) + PutDownFork(k) + f1=0:f2=0 + Tell(Mutex_main,Iam+": Thinking about the nature of the universe...") + Delay(Random(2500)+25) + ForEver +EndProcedure diff --git a/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-1.visual b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-1.visual new file mode 100644 index 0000000000..de0a0cda38 --- /dev/null +++ b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-1.visual @@ -0,0 +1,50 @@ +Imports System.Threading +Module Module1 + Public rnd As New Random + + Sub Main() + 'Aristotle, Kant, Spinoza, Marx, and Russel + Dim f1 As New Fork(1) + Dim f2 As New Fork(2) + Dim f3 As New Fork(3) + Dim f4 As New Fork(4) + Dim f5 As New Fork(5) + + Console.WriteLine("1: Deadlock") + Console.WriteLine("2: Live lock") + Console.WriteLine("3: Working") + Select Console.ReadLine + Case "1" + Using _ + Aristotle As New SelfishPhilosopher("Aristotle", f1, f2), _ + Kant As New SelfishPhilosopher("Kant", f2, f3), _ + Spinoza As New SelfishPhilosopher("Spinoza", f3, f4), _ + Marx As New SelfishPhilosopher("Marx", f4, f5), _ + Russel As New SelfishPhilosopher("Russel", f5, f1) + + Console.ReadLine() + End Using + Case "2" + Using _ + Aristotle As New SelflessPhilosopher("Aristotle", f1, f2), _ + Kant As New SelflessPhilosopher("Kant", f2, f3), _ + Spinoza As New SelflessPhilosopher("Spinoza", f3, f4), _ + Marx As New SelflessPhilosopher("Marx", f4, f5), _ + Russel As New SelflessPhilosopher("Russel", f5, f1) + + Console.ReadLine() + End Using + Case "3" + Using _ + Aristotle As New WisePhilosopher("Aristotle", f1, f2), _ + Kant As New WisePhilosopher("Kant", f2, f3), _ + Spinoza As New WisePhilosopher("Spinoza", f3, f4), _ + Marx As New WisePhilosopher("Marx", f4, f5), _ + Russel As New WisePhilosopher("Russel", f5, f1) + + Console.ReadLine() + End Using + End Select + End Sub + +End Module diff --git a/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-2.visual b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-2.visual new file mode 100644 index 0000000000..88f345536c --- /dev/null +++ b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-2.visual @@ -0,0 +1,11 @@ +Class Fork + Private ReadOnly m_Number As Integer + Public Sub New(ByVal number As Integer) + m_Number = number + End Sub + Public ReadOnly Property Number() As Integer + Get + Return m_Number + End Get + End Property +End Class diff --git a/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-3.visual b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-3.visual new file mode 100644 index 0000000000..c4744f6dd7 --- /dev/null +++ b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-3.visual @@ -0,0 +1,31 @@ +MustInherit Class PhilosopherBase + Implements IDisposable + + Protected m_Disposed As Boolean + Protected ReadOnly m_Left As Fork + Protected ReadOnly m_Right As Fork + Protected ReadOnly m_Name As String + Public Sub New(ByVal name As String, ByVal right As Fork, ByVal left As Fork) + m_Name = name + m_Right = right + m_Left = left + Dim t As New Thread(AddressOf MainLoop) + t.IsBackground = True + t.Start() + End Sub + Protected Overridable Sub Dispose(ByVal disposing As Boolean) + m_Disposed = True + End Sub + + Public Sub Dispose() Implements IDisposable.Dispose + Dispose(True) + GC.SuppressFinalize(Me) + End Sub + Public ReadOnly Property Name() As String + Get + Return m_Name + End Get + End Property + + Public MustOverride Sub MainLoop() +End Class diff --git a/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-4.visual b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-4.visual new file mode 100644 index 0000000000..5e43b94bd5 --- /dev/null +++ b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-4.visual @@ -0,0 +1,31 @@ +Class SelfishPhilosopher + Inherits PhilosopherBase + Public Sub New(ByVal name As String, ByVal right As Fork, ByVal left As Fork) + MyBase.New(name, right, left) + End Sub + + Public Overrides Sub MainLoop() + Do + Console.WriteLine(Name & " sat down") + SyncLock m_Left + Console.WriteLine(Name & " picked up fork " & m_Left.Number) + + SyncLock m_Right + Console.WriteLine(Name & " picked up fork " & m_Right.Number) + + Console.WriteLine(Name & " ate!!!!") + + Console.WriteLine(Name & " put down fork " & m_Right.Number) + End SyncLock + + + Console.WriteLine(Name & " put down fork " & m_Left.Number) + End SyncLock + + Console.WriteLine(Name & " stood up") + + Thread.Sleep(rnd.Next(0, 10000)) + Loop Until m_Disposed + End Sub + +End Class diff --git a/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-5.visual b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-5.visual new file mode 100644 index 0000000000..004415e71d --- /dev/null +++ b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-5.visual @@ -0,0 +1,41 @@ +Class SelflessPhilosopher + Inherits PhilosopherBase + + Public Sub New(ByVal name As String, ByVal right As Fork, ByVal left As Fork) + MyBase.New(name, right, left) + End Sub + + Public Overrides Sub MainLoop() + Do + Console.WriteLine(Name & " sat down") + Dim needDelay = False +TryAgain: + If needDelay Then Thread.Sleep(rnd.Next(0, 10000)) + Try + Monitor.Enter(m_Left) + Console.WriteLine(Name & " picked up fork " & m_Left.Number) + + If Monitor.TryEnter(m_Right) Then + Console.WriteLine(Name & " picked up fork " & m_Right.Number) + + Console.WriteLine(Name & " ate!!!!!!") + + Console.WriteLine(Name & " put down fork " & m_Right.Number) + Monitor.Exit(m_Right) + Else + Console.WriteLine(Name & " is going to wait") + needDelay = True + GoTo TryAgain + End If + Finally + Console.WriteLine(Name & " put down fork " & m_Left.Number) + End Try + + Console.WriteLine(Name & " stood up") + + Thread.Sleep(rnd.Next(0, 10000)) + + Loop Until m_Disposed + End Sub + +End Class diff --git a/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-6.visual b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-6.visual new file mode 100644 index 0000000000..8b1e94d439 --- /dev/null +++ b/Task/Dining-philosophers/Visual-Basic-.NET/dining-philosophers-6.visual @@ -0,0 +1,41 @@ +Class WisePhilosopher + Inherits PhilosopherBase + Public Sub New(ByVal name As String, ByVal right As Fork, ByVal left As Fork) + MyBase.New(name, right, left) + End Sub + + Public Overrides Sub MainLoop() + Do + Console.WriteLine(Name & " sat down") + + Dim first As Fork, second As Fork + If m_Left.Number > m_Right.Number Then + first = m_Left + second = m_Right + Else + first = m_Right + second = m_Left + End If + + SyncLock first + Console.WriteLine(Name & " picked up fork " & m_Left.Number) + + SyncLock second + Console.WriteLine(Name & " picked up fork " & m_Right.Number) + + Console.WriteLine(Name & " ate!!!!") + + Console.WriteLine(Name & " put down fork " & m_Right.Number) + End SyncLock + + + Console.WriteLine(Name & " put down fork " & m_Left.Number) + End SyncLock + + Console.WriteLine(Name & " stood up") + + Thread.Sleep(rnd.Next(0, 10000)) + Loop Until m_Disposed + End Sub + +End Class diff --git a/Task/Discordian-date/BASIC/discordian-date.bas b/Task/Discordian-date/BASIC/discordian-date.basic similarity index 100% rename from Task/Discordian-date/BASIC/discordian-date.bas rename to Task/Discordian-date/BASIC/discordian-date.basic diff --git a/Task/Discordian-date/Mathematica/discordian-date.mathematica b/Task/Discordian-date/Mathematica/discordian-date.math similarity index 100% rename from Task/Discordian-date/Mathematica/discordian-date.mathematica rename to Task/Discordian-date/Mathematica/discordian-date.math diff --git a/Task/Discordian-date/Perl-6/discordian-date.pl6 b/Task/Discordian-date/Perl-6/discordian-date.pl6 new file mode 100644 index 0000000000..296def6cc6 --- /dev/null +++ b/Task/Discordian-date/Perl-6/discordian-date.pl6 @@ -0,0 +1,25 @@ +my @seasons = < Chaos Discord Confusion Bureaucracy >, 'The Aftermath'; +my @days = < Sweetmorn Boomtime Pungenday Prickle-Prickle >, 'Setting Orange'; +sub ordinal ( Int $n ) { $n ~ ( $n % 100 == 11|12|13 + ?? 'th' !! < th st nd rd th th th th th th >[$n % 10] ) } + +sub ddate ( Str $ymd ) { + my $d = DateTime.new: "{$ymd}T00:00:00Z" or die; + + my $yold = 'in the YOLD ' ~ $d.year + 1166; + + my $day_of_year0 = $d.day-of-year - 1; + + if $d.is-leap-year { + return "St. Tib's Day, $yold" if $d.month == 2 and $d.day == 29; + $day_of_year0-- if $day_of_year0 >= 60; # Compensate for St. Tib's Day + } + + my $weekday = @days[ $day_of_year0 mod 5 ]; + my $season = @seasons[ $day_of_year0 div 73 ]; + my $season_day = ordinal( $day_of_year0 mod 73 + 1 ); + + return "$weekday, the $season_day day of $season $yold"; +} + +say "$_ is {.&ddate}" for < 2010-07-22 2012-02-28 2012-02-29 2012-03-01 >; diff --git a/Task/Discordian-date/Pike/discordian-date.pike b/Task/Discordian-date/Pike/discordian-date.pike new file mode 100644 index 0000000000..39f9ae93b9 --- /dev/null +++ b/Task/Discordian-date/Pike/discordian-date.pike @@ -0,0 +1,8 @@ +> Calendar.Discordian.now()->format_ext_ymd(); + Result: "Pungenday, 59 Bureaucracy 3177" +> Calendar.Discordian.Day(Calendar.Day(2011,11,11))->format_ext_ymd(); + Result: "Setting Orange, 23 The Aftermath 3177" +> Calendar.Discordian.Day(Calendar.Badi.Day(168,13,9))->format_ext_ymd(); + Result: "Setting Orange, 23 The Aftermath 3177" +> Calendar.Day((Calendar.Discordian.Month()+1)->day(1)); + Result: Day(Thu 20 Oct 2011) diff --git a/Task/Discordian-date/PowerBASIC/discordian-date.powerbasic b/Task/Discordian-date/PowerBASIC/discordian-date.powerbasic new file mode 100644 index 0000000000..c4425367d0 --- /dev/null +++ b/Task/Discordian-date/PowerBASIC/discordian-date.powerbasic @@ -0,0 +1,65 @@ +#COMPILE EXE +#DIM ALL + +'change this for systems that use a different character +$DATESEP = "-" + +FUNCTION day(date AS STRING) AS LONG + 'date is same format as date$ + DIM tmpdash1 AS LONG, tmpdash2 AS LONG + tmpdash1 = INSTR(date, $DATESEP) + tmpdash2 = INSTR(-1, date, $DATESEP) + FUNCTION = VAL(MID$(date, tmpdash1 + 1, tmpdash2 - tmpdash1 - 1)) +END FUNCTION + +FUNCTION month(date AS STRING) AS LONG + 'date is same format as date$ + DIM tmpdash AS LONG + tmpdash = INSTR(date, $DATESEP) + FUNCTION = VAL(LEFT$(date, tmpdash - 1)) +END FUNCTION + +FUNCTION year(date AS STRING) AS LONG + 'date is same format as date$ + DIM tmpdash AS LONG + tmpdash = INSTR(-1, date, $DATESEP) + FUNCTION = VAL(MID$(date, tmpdash + 1)) +END FUNCTION + +FUNCTION julian(date AS STRING) AS LONG + 'date is same format as date$ + 'doesn't account for leap years (not needed for ddate) + 'days preceding 1st of month + ' jan feb mar apr may jun jul aug sep oct nov dec + DATA 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 + FUNCTION = VAL(READ$(month(date))) + day(date) +END FUNCTION + +FUNCTION PBMAIN () AS LONG + 'Season names + DATA "Chaos", "Discord", "Confusion", "Bureaucracy", "The Aftermath" + 'Weekdays + DATA "Setting Orange", "Sweetmorn", "Boomtime", "Pungenday", "Prickle-Prickle" + + DIM dyear AS LONG, dseason AS STRING, dday AS LONG, dweekday AS STRING + DIM tmpdate AS STRING, jday AS LONG, result AS STRING + + IF LEN(COMMAND$) THEN + tmpdate = COMMAND$ + ELSE + tmpdate = DATE$ + END IF + dyear = year(tmpdate) + 1166 + IF (2 = month(tmpdate)) AND (29 = day(tmpdate)) THEN + result = "Saint Tib's Day, " & STR$(dyear) & " YOLD" + ELSE + jday = julian(tmpdate) + dseason = READ$((jday \ 73) + 1) + dday = (jday MOD 73) + IF 0 = dday THEN dday = 73 + dweekday = READ$((jday MOD 5) + 6) + result = dweekday & ", " & dseason & " " & TRIM$(STR$(dday)) & ", " & TRIM$(STR$(dyear)) & " YOLD" + END IF + + ? result +END FUNCTION diff --git a/Task/Discordian-date/PureBasic/discordian-date.purebasic b/Task/Discordian-date/PureBasic/discordian-date.purebasic new file mode 100644 index 0000000000..d936dedf38 --- /dev/null +++ b/Task/Discordian-date/PureBasic/discordian-date.purebasic @@ -0,0 +1,14 @@ +Procedure.s Discordian_Date(Y, M, D) + Protected DoY=DayOfYear(Date(Y,M,D,0,0,0)), Yold$=Str(Y+1166) + Dim S.s(4) + S(0)="Chaos": S(1)="Discord": S(2)="Confusion": S(3)="Bureaucracy" + S(4)="The Aftermath" + If (Y%4=0 And Y%100) Or Y%400=0 + If M=2 And D=29 + ProcedureReturn "St. Tib's Day, YOLD " + Yold$ + ElseIf DoY>=2*30 + DoY-1 + EndIf + EndIf + ProcedureReturn S(DoY/73)+" "+Str(DoY%73)+", Yold "+Yold$ +EndProcedure diff --git a/Task/Distributed-programming/Mathematica/distributed-programming.mathematica b/Task/Distributed-programming/Mathematica/distributed-programming.math similarity index 100% rename from Task/Distributed-programming/Mathematica/distributed-programming.mathematica rename to Task/Distributed-programming/Mathematica/distributed-programming.math diff --git a/Task/Distributed-programming/OCaml/distributed-programming-1.ocaml b/Task/Distributed-programming/OCaml/distributed-programming-1.ocaml new file mode 100644 index 0000000000..6e1b43827c --- /dev/null +++ b/Task/Distributed-programming/OCaml/distributed-programming-1.ocaml @@ -0,0 +1,23 @@ +open Printf + +let create_logger () = + def log(text) & logs(l) = + printf "Logged: %s\n%!" text; + logs((text, Unix.gettimeofday ())::l) & reply to log + + or search(text) & logs(l) = + logs(l) & reply List.filter (fun (line, _) -> line = text) l to search + in + spawn logs([]); + (log, search) + +def wait() & finished() = reply to wait + +let register name service = Join.Ns.register Join.Ns.here name service + +let () = + let log, search = create_logger () in + register "log" log; + register "search" search; + Join.Site.listen (Unix.ADDR_INET (Join.Site.get_local_addr(), 12345)); + wait () diff --git a/Task/Distributed-programming/OCaml/distributed-programming-2.ocaml b/Task/Distributed-programming/OCaml/distributed-programming-2.ocaml new file mode 100644 index 0000000000..2d297bc2d3 --- /dev/null +++ b/Task/Distributed-programming/OCaml/distributed-programming-2.ocaml @@ -0,0 +1,21 @@ +open Printf + +let ns_there = Join.Ns.there (Unix.ADDR_INET (Join.Site.get_local_addr(), 12345)) + +let lookup name = Join.Ns.lookup ns_there name + +let log : string -> unit = lookup "log" +let search : string -> (string * float) list = lookup "search" + +let find txt = + printf "Looking for %s...\n" txt; + List.iter (fun (line, time) -> + printf "Found: '%s' at t = %f\n%!" (String.escaped line) time) + (search txt) + +let () = + log "bar"; + find "foo"; + log "foo"; + log "shoe"; + find "foo" diff --git a/Task/Distributed-programming/Objective-C/distributed-programming-1.m b/Task/Distributed-programming/Objective-C/distributed-programming-1.m new file mode 100644 index 0000000000..efc29bd907 --- /dev/null +++ b/Task/Distributed-programming/Objective-C/distributed-programming-1.m @@ -0,0 +1,6 @@ +#import +// our protocol allows "sending" "strings", but we can implement +// everything we could for a "local" object +@protocol ActionObjectProtocol +- (NSString *)sendMessage: (NSString *)msg; +@end diff --git a/Task/Distributed-programming/Objective-C/distributed-programming-2.m b/Task/Distributed-programming/Objective-C/distributed-programming-2.m new file mode 100644 index 0000000000..b2d9072585 --- /dev/null +++ b/Task/Distributed-programming/Objective-C/distributed-programming-2.m @@ -0,0 +1,6 @@ +#import +#import "ActionObjectProtocol.h" + +@interface ActionObject : NSObject + // we do not have much for this example! +@end diff --git a/Task/Distributed-programming/Objective-C/distributed-programming-3.m b/Task/Distributed-programming/Objective-C/distributed-programming-3.m new file mode 100644 index 0000000000..2f1c410a02 --- /dev/null +++ b/Task/Distributed-programming/Objective-C/distributed-programming-3.m @@ -0,0 +1,10 @@ +#import +#import "ActionObject.h" + +@implementation ActionObject +-(NSString *)sendMessage: (NSString *)msg +{ + NSLog(@"client sending message %@", msg); + return @"server answers ..."; +} +@end diff --git a/Task/Distributed-programming/Objective-C/distributed-programming-4.m b/Task/Distributed-programming/Objective-C/distributed-programming-4.m new file mode 100644 index 0000000000..feba6c858e --- /dev/null +++ b/Task/Distributed-programming/Objective-C/distributed-programming-4.m @@ -0,0 +1,40 @@ +#import +#import "ActionObject.h" + +int main (void) +{ + NSAutoreleasePool *pool; + ActionObject *action; + NSConnection *connect; + NSSocketPort *port; + + pool = [[NSAutoreleasePool alloc] init]; + + action = [[ActionObject alloc] init]; + + port = (NSSocketPort *)[NSSocketPort port]; + // initWithTCPPort: 1234 and other methods are not supported yet + // by GNUstep + connect = [NSConnection + connectionWithReceivePort: port + sendPort: port]; // or sendPort: nil + + [connect setRootObject: action]; + + /* "vend" the object ActionObject as DistributedAction; on GNUstep + the Name Server that allows the resolution of the registered name + is bound to port 538 */ + if ([connect registerName:@"DistributedAction" + withNameServer: [NSSocketPortNameServer sharedInstance] ] == NO) + { + NSLog(@"can't register the server DistributedAction"); + exit(EXIT_FAILURE); + } + + NSLog(@"waiting for messages..."); + + [[NSRunLoop currentRunLoop] run]; + + [pool release]; + return 0; +} diff --git a/Task/Distributed-programming/Objective-C/distributed-programming-5.m b/Task/Distributed-programming/Objective-C/distributed-programming-5.m new file mode 100644 index 0000000000..1a4de04c32 --- /dev/null +++ b/Task/Distributed-programming/Objective-C/distributed-programming-5.m @@ -0,0 +1,43 @@ +#import +#import "ActionObjectProtocol.h" + +int main(void) +{ + NSAutoreleasePool *pool; + NSArray *args; + id action; + NSString *msg, *backmsg; + + pool = [[NSAutoreleasePool alloc] init]; + + action = (id ) + [NSConnection + rootProxyForConnectionWithRegisteredName: @"DistributedAction" + host: @"localhost" + usingNameServer: [NSSocketPortNameServer sharedInstance] ]; + + if (action == nil) + { + NSLog(@"can't connect to the server"); + exit(EXIT_FAILURE); + } + + args = [[NSProcessInfo processInfo] arguments]; + + if ([args count] == 1) + { + NSLog(@"specify a message"); + exit(EXIT_FAILURE); + } + + msg = [args objectAtIndex: 1]; + + // "send" (call the selector "sendMessage:" of the (remote) object + // action) the first argument's text as msg, store the message "sent + // back" and then show it in the log + backmsg = [action sendMessage: msg]; + NSLog("%@", backmsg); + + [pool release]; + return 0; +} diff --git a/Task/Distributed-programming/Oz/distributed-programming.oz b/Task/Distributed-programming/Oz/distributed-programming.oz new file mode 100644 index 0000000000..f5a5a59676 --- /dev/null +++ b/Task/Distributed-programming/Oz/distributed-programming.oz @@ -0,0 +1,40 @@ +declare + functor ServerCode + export + port:Prt + define + Stream + Prt = {NewPort ?Stream} + thread + for Request#Reply in Stream do + case Request + of echo(Data) then Reply = Data + [] compute(Function) then Reply = {Function} + end + end + end + end + + %% create the server on some machine + %% (just change "localhost" to some machine + %% that you can use with a passwordless rsh login + %% and that has the same Mozart version installed) + RM = {New Remote.manager init(host:localhost)} + + %% execute the code encapsulated in the ServerCode functor + Server = {RM apply(ServerCode $)} + + %% Shortcut: send a message to Server and receive a reply + fun {Send X} + {Port.sendRecv Server.port X} + end +in + %% echo + {System.showInfo "Echo reply: "#{Send echo(hello)}} + + %% compute + {System.showInfo "Result of computation: "# + {Send compute(fun {$} 8 div 4 end)}} + + %% shut down server + {RM close} diff --git a/Task/Distributed-programming/UnixPipes/distributed-programming-1.unixpipes b/Task/Distributed-programming/UnixPipes/distributed-programming-1.unixpipes new file mode 100644 index 0000000000..58ce8bcbf0 --- /dev/null +++ b/Task/Distributed-programming/UnixPipes/distributed-programming-1.unixpipes @@ -0,0 +1,2 @@ +: >/tmp/buffer +tail -f /tmp/buffer | nc -l 127.0.0.1 1234 | sh >/tmp/buffer 2>&1 diff --git a/Task/Distributed-programming/UnixPipes/distributed-programming-2.unixpipes b/Task/Distributed-programming/UnixPipes/distributed-programming-2.unixpipes new file mode 100644 index 0000000000..5aaa0c119d --- /dev/null +++ b/Task/Distributed-programming/UnixPipes/distributed-programming-2.unixpipes @@ -0,0 +1 @@ +nc 127.0.0.1 1234 diff --git a/Task/Documentation/Mathematica/documentation.mathematica b/Task/Documentation/Mathematica/documentation.math similarity index 100% rename from Task/Documentation/Mathematica/documentation.mathematica rename to Task/Documentation/Mathematica/documentation.math diff --git a/Task/Documentation/Objective-C/documentation.m b/Task/Documentation/Objective-C/documentation.m new file mode 100644 index 0000000000..4c2234382a --- /dev/null +++ b/Task/Documentation/Objective-C/documentation.m @@ -0,0 +1,11 @@ +/*! + @function add + @abstract Adds two numbers + @discussion Use add to sum two numbers. + @param a an integer. + @param b another integer. + @return the sum of a and b + */ +int add(int a, int b) { + return a + b; +} diff --git a/Task/Documentation/PARI-GP/documentation.pari b/Task/Documentation/PARI-GP/documentation.pari new file mode 100644 index 0000000000..6116133c7c --- /dev/null +++ b/Task/Documentation/PARI-GP/documentation.pari @@ -0,0 +1 @@ +addhelp(funcName, "funcName(v, n): This is a description of the function named funcName."); diff --git a/Task/Documentation/Perl-6/documentation.pl6 b/Task/Documentation/Perl-6/documentation.pl6 new file mode 100644 index 0000000000..be45523c10 --- /dev/null +++ b/Task/Documentation/Perl-6/documentation.pl6 @@ -0,0 +1,11 @@ +#= it's yellow +sub marine { ... } +say &marine.WHY; # "it's yellow" + +#= a shaggy little thing +class Sheep { + #= not too scary + method roar { 'roar!' } +} +say Sheep.WHY; # "a shaggy little thing" +say Sheep.^find_method('roar').WHY; # "not too scary" diff --git a/Task/Documentation/PureBasic/documentation.purebasic b/Task/Documentation/PureBasic/documentation.purebasic new file mode 100644 index 0000000000..d681ef5a13 --- /dev/null +++ b/Task/Documentation/PureBasic/documentation.purebasic @@ -0,0 +1,35 @@ +; This is a small demo-code to demonstrate PureBasic’s internal +; documentation system. + +;- All Includes +; By starting the line with ‘;-‘ marks that specific line as a special comment, +; and this will be included in the overview, while normal comments will not. + +IncludeFile "MyLibs.pbi" +IncludeFile "Combustion_Data.pbi" + +;- +;- Start of functions and Macros +;- Engeneering stuff + +; A small function to calculate gas properties +Procedure.f CalcR( p.f, V.f, T.f) + ProcedureReturn p*V/T +EndProcedure + +; Example of a Macro +; These are indicated by '+' in the overview +Macro HalfPI() + (#PI/2) +EndMacro + +;- +;- - - - - - - - - - - +;- IO-Functions + +Procedure Write_and_Close( File, Text$) + If IsFile(File) + WriteString(File,Text$) + CloseFile(file) + EndIf +EndProcedure diff --git a/Task/Documentation/REBOL/documentation.rebol b/Task/Documentation/REBOL/documentation.rebol new file mode 100644 index 0000000000..7b42bab5cf --- /dev/null +++ b/Task/Documentation/REBOL/documentation.rebol @@ -0,0 +1,66 @@ +REBOL [ + Title: "Documentation" + Date: 2009-12-14 + Author: oofoe + URL: http://rosettacode.org/wiki/Documentation + Purpose: {To demonstrate documentation of REBOL pograms.} +] + +; Notice the fields in the program header. The header is required for +; valid REBOL programs, although the fields don't have to be filled +; in. Standard fields are defined (see 'system/script/header'), but +; I can also define other fields as I like and they'll be available +; there. + +; This is a comment. The semicolon can be inserted anywhere outside of +; a string and will escape to end of line. See the inline comments +; below. + +; Functions can have a documentation string as the first part of the +; argument definition block. Each argument can specify what types it +; will accept as well as a description. All typing/documentation +; entries are optional. Notice that local variables can be documented +; as well. + +sum: func [ + "Add numbers in block." + data [block! list!] "List of numbers to add together." + /average "Calculate average instead of sum." + /local + i "Iteration variable." + x "Variable to hold results." +] [ + x: 0 repeat i data [x: x + i] + either average [x / length? data][x] ; Functions return last result. +] + +print [sum [1 2 3 4 5 6] crlf sum/average [7 8 9 10] crlf] + +; The help message is constructed from the public information about +; the function. Internal variable information isn't shown. + +help sum print "" + +; The source command provides the source to any user functions, +; reconstructing the documentation strings if they're provided: + +source sum print "" + +; This is an object, describing a person, whose name is Bob. + +bob: make object! [ + name: "Bob Sorkopath" + age: 24 + hi: func ["Say hello."][print "Hello!"] +] + +; I can use the 'help' word to get a list of the fields of the object + +help bob print "" + +; If I want see the documentation or source for 'bob/hi', I have to +; get a little tricky to get it from the object's namespace: + +x: get in bob 'hi help x print "" + +probe get in bob 'hi diff --git a/Task/Documentation/Retro/documentation.retro b/Task/Documentation/Retro/documentation.retro new file mode 100644 index 0000000000..dc2866ae7b --- /dev/null +++ b/Task/Documentation/Retro/documentation.retro @@ -0,0 +1,15 @@ +doc{ +======== +Function: foo +======== + +Stack +---- +a1 a2 - b + +Usage +----- +Adds a1 to a2 returning b. +}doc + +: foo ( aa-b ) + ; diff --git a/Task/Documentation/ZX-Spectrum-Basic/documentation-1.zx b/Task/Documentation/ZX-Spectrum-Basic/documentation-1.zx new file mode 100644 index 0000000000..365669a8d6 --- /dev/null +++ b/Task/Documentation/ZX-Spectrum-Basic/documentation-1.zx @@ -0,0 +1,2 @@ + 10 LET a=10: REM a is the number of apples +1000 DEF FN s(q)=q*q: REM s is a function that takes a single numeric parameter and returns its square diff --git a/Task/Documentation/ZX-Spectrum-Basic/documentation-2.zx b/Task/Documentation/ZX-Spectrum-Basic/documentation-2.zx new file mode 100644 index 0000000000..955e3ddb2f --- /dev/null +++ b/Task/Documentation/ZX-Spectrum-Basic/documentation-2.zx @@ -0,0 +1,7 @@ +10 GOSUB 2000: REM call a subroutine to print the documentation +1999 STOP +2000 REM Print the documentation +2010 LPRINT "a is the number of apples" +2020 LPRINT "s is a function that takes a single numeric parameter and returns" +2030 LPRINT "its square" +2040 RETURN diff --git a/Task/Dot-product/CoffeeScript/dot-product.coffee b/Task/Dot-product/CoffeeScript/dot-product.coffeescript similarity index 100% rename from Task/Dot-product/CoffeeScript/dot-product.coffee rename to Task/Dot-product/CoffeeScript/dot-product.coffeescript diff --git a/Task/Dot-product/Mathematica/dot-product.mathematica b/Task/Dot-product/Mathematica/dot-product.math similarity index 100% rename from Task/Dot-product/Mathematica/dot-product.mathematica rename to Task/Dot-product/Mathematica/dot-product.math diff --git a/Task/Dot-product/Nemerle/dot-product.nemerle b/Task/Dot-product/Nemerle/dot-product.nemerle new file mode 100644 index 0000000000..20d267a13c --- /dev/null +++ b/Task/Dot-product/Nemerle/dot-product.nemerle @@ -0,0 +1,17 @@ +using System; +using System.Console; +using Nemerle.Collections.NCollectionsExtensions; + +module DotProduct +{ + DotProduct(x : array[int], y : array[int]) : int + { + $[(a * b)|(a, b) in ZipLazy(x, y)].FoldLeft(0, _+_); + } + + Main() : void + { + def arr1 = array[1, 3, -5]; def arr2 = array[4, -2, -1]; + WriteLine(DotProduct(arr1, arr2)); + } +} diff --git a/Task/Dot-product/NetRexx/dot-product.netrexx b/Task/Dot-product/NetRexx/dot-product.netrexx new file mode 100644 index 0000000000..db5940cd25 --- /dev/null +++ b/Task/Dot-product/NetRexx/dot-product.netrexx @@ -0,0 +1,21 @@ +/* NetRexx */ +options replace format comments java crossref savelog symbols binary + +whatsTheVectorVictor = [[double 1.0, 3.0, -5.0], [double 4.0, -2.0, -1.0]] +dotProduct = Rexx dotProduct(whatsTheVectorVictor) +say dotProduct.format(null, 2) + +return + +method dotProduct(vec1 = double[], vec2 = double[]) public constant returns double signals IllegalArgumentException + if vec1.length \= vec2.length then signal IllegalArgumentException('Vectors must be the same length') + + scalarProduct = double 0.0 + loop e_ = 0 to vec1.length - 1 + scalarProduct = vec1[e_] * vec2[e_] + scalarProduct + end e_ + + return scalarProduct + +method dotProduct(vecs = double[,]) public constant returns double signals IllegalArgumentException + return dotProduct(vecs[0], vecs[1]) diff --git a/Task/Dot-product/OCaml/dot-product-1.ocaml b/Task/Dot-product/OCaml/dot-product-1.ocaml new file mode 100644 index 0000000000..b9bc04d83e --- /dev/null +++ b/Task/Dot-product/OCaml/dot-product-1.ocaml @@ -0,0 +1,6 @@ +let dot = List.fold_left2 (fun z x y -> z +. x *. y) 0. + +(* +# dot [1.0; 3.0; -5.0] [4.0; -2.0; -1.0];; +- : float = 3. +*) diff --git a/Task/Dot-product/OCaml/dot-product-2.ocaml b/Task/Dot-product/OCaml/dot-product-2.ocaml new file mode 100644 index 0000000000..6d46a402a7 --- /dev/null +++ b/Task/Dot-product/OCaml/dot-product-2.ocaml @@ -0,0 +1,11 @@ +let dot v u = + if Array.length v <> Array.length u + then invalid_arg "Different array lengths"; + let times v u = + Array.mapi (fun i v_i -> v_i *. u.(i)) v + in Array.fold_left (+.) 0. (times v u) + +(* +# dot [| 1.0; 3.0; -5.0 |] [| 4.0; -2.0; -1.0 |];; +- : float = 3. +*) diff --git a/Task/Dot-product/Objeck/dot-product.objeck b/Task/Dot-product/Objeck/dot-product.objeck new file mode 100644 index 0000000000..8d7aa9416c --- /dev/null +++ b/Task/Dot-product/Objeck/dot-product.objeck @@ -0,0 +1,28 @@ +bundle Default { + class DotProduct { + function : Main(args : String[]) ~ Nil { + DotProduct([1, 3, -5], [4, -2, -1])->PrintLine(); + } + + function : DotProduct(array_a : Int[], array_b : Int[]) ~ Int { + if(array_a = Nil) { + return 0; + }; + + if(array_b = Nil) { + return 0; + }; + + if(array_a->Size() <> array_b->Size()) { + return 0; + }; + + val := 0; + for(x := 0; x < array_a->Size(); x += 1;) { + val += (array_a[x] * array_b[x]); + }; + + return val; + } + } +} diff --git a/Task/Dot-product/Objective-C/dot-product.m b/Task/Dot-product/Objective-C/dot-product.m new file mode 100644 index 0000000000..da76a7781f --- /dev/null +++ b/Task/Dot-product/Objective-C/dot-product.m @@ -0,0 +1,108 @@ +#import +#import +#import +#import +#import + +// this class exists to return a result between two +// vectors: if vectors have different "size", valid +// must be NO +@interface VResult : Object +{ + @private + double value; + BOOL valid; +} ++(id)new: (double)v isValid: (BOOL)y; +-(id)init: (double)v isValid: (BOOL)y; +-(BOOL)isValid; +-(double)value; +@end + +@implementation VResult ++(id)new: (double)v isValid: (BOOL)y +{ + id s = [super new]; + [s init: v isValid: y]; + return s; +} +-(id)init: (double)v isValid: (BOOL)y +{ + value = v; + valid = y; + return self; +} +-(BOOL)isValid { return valid; } +-(double)value { return value; } +@end + + +@interface RCVector : Object +{ + @private + double *vec; + uint32_t size; +} ++(id)newWithArray: (double *)v ofLength: (uint32_t)l; +-(id)initWithArray: (double *)v ofLength: (uint32_t)l; +-(VResult *)dotProductWith: (RCVector *)v; +-(uint32_t)size; +-(double *)array; +-(void)free; +@end + +@implementation RCVector ++(id)newWithArray: (double *)v ofLength: (uint32_t)l +{ + id s = [super new]; + [s initWithArray: v ofLength: l]; + return s; +} +-(id)initWithArray: (double *)v ofLength: (uint32_t)l +{ + size = l; + vec = malloc(sizeof(double) * l); + if ( vec != NULL ) { + memcpy(vec, v, sizeof(double)*l); + return self; + } + [super free]; + return nil; +} +-(void)free +{ + free(vec); + [super free]; +} +-(uint32_t)size { return size; } +-(double *)array { return vec; } +-(VResult *)dotProductWith: (RCVector *)v +{ + double r = 0.0; + uint32_t i, s; + double *v1; + if ( [self size] != [v size] ) return [VResult new: r isValid: NO]; + s = [self size]; + v1 = [v array]; + for(i = 0; i < s; i++) { + r += vec[i] * v1[i]; + } + return [VResult new: r isValid: YES]; +} +@end + +double val1[] = { 1, 3, -5 }; +double val2[] = { 4,-2, -1 }; + +int main() +{ + RCVector *v1 = [RCVector newWithArray: val1 ofLength: sizeof(val1)/sizeof(double)]; + RCVector *v2 = [RCVector newWithArray: val2 ofLength: sizeof(val1)/sizeof(double)]; + VResult *r = [v1 dotProductWith: v2]; + if ( [r isValid] ) { + printf("%lf\n", [r value]); + } else { + fprintf(stderr, "length of vectors differ\n"); + } + return 0; +} diff --git a/Task/Dot-product/Octave/dot-product.octave b/Task/Dot-product/Octave/dot-product.octave new file mode 100644 index 0000000000..ef3b4933c8 --- /dev/null +++ b/Task/Dot-product/Octave/dot-product.octave @@ -0,0 +1,3 @@ +a = [1, 3, -5] +b = [4, -2, -1] % or [4; -2; -1] and avoid transposition with ' +disp( a * b' ) % ' means transpose diff --git a/Task/Dot-product/Oz/dot-product.oz b/Task/Dot-product/Oz/dot-product.oz new file mode 100644 index 0000000000..3e7815a936 --- /dev/null +++ b/Task/Dot-product/Oz/dot-product.oz @@ -0,0 +1,7 @@ +declare + fun {DotProduct Xs Ys} + {Length Xs} = {Length Ys} %% assert + {List.foldL {List.zip Xs Ys Number.'*'} Number.'+' 0} + end +in + {Show {DotProduct [1 3 ~5] [4 ~2 ~1]}} diff --git a/Task/Dot-product/PARI-GP/dot-product.pari b/Task/Dot-product/PARI-GP/dot-product.pari new file mode 100644 index 0000000000..3ca49b041c --- /dev/null +++ b/Task/Dot-product/PARI-GP/dot-product.pari @@ -0,0 +1,3 @@ +dot(u,v)={ + sum(i=1,#u,u[i]*v[i]) +}; diff --git a/Task/Dot-product/PL-I/dot-product.pli b/Task/Dot-product/PL-I/dot-product.pli new file mode 100644 index 0000000000..5f80cfb88b --- /dev/null +++ b/Task/Dot-product/PL-I/dot-product.pli @@ -0,0 +1,10 @@ +get (n); +begin; + declare (A(n), B(n)) float; + declare dot_product float; + + get list (A); + get list (B); + dot_product = sum(a*b); + put (dot_product); +end; diff --git a/Task/Dot-product/Perl-6/dot-product.pl6 b/Task/Dot-product/Perl-6/dot-product.pl6 new file mode 100644 index 0000000000..51c83684df --- /dev/null +++ b/Task/Dot-product/Perl-6/dot-product.pl6 @@ -0,0 +1 @@ +say [+] (1, 3, -5) »*« (4, -2, -1); diff --git a/Task/Dot-product/PostScript/dot-product.ps b/Task/Dot-product/PostScript/dot-product.ps new file mode 100644 index 0000000000..fc44639591 --- /dev/null +++ b/Task/Dot-product/PostScript/dot-product.ps @@ -0,0 +1,17 @@ +/dotproduct{ +/x exch def +/y exch def +/sum 0 def +/i 0 def +x length y length eq %Check if both arrays have the same length +{ +x length{ +/sum x i get y i get mul sum add def +/i i 1 add def +}repeat +sum == +} +{ +-1 == +}ifelse +}def diff --git a/Task/Dot-product/PureBasic/dot-product.purebasic b/Task/Dot-product/PureBasic/dot-product.purebasic new file mode 100644 index 0000000000..afe7439157 --- /dev/null +++ b/Task/Dot-product/PureBasic/dot-product.purebasic @@ -0,0 +1,24 @@ +Procedure dotProduct(Array a(1),Array b(1)) + Protected i, sum, length = ArraySize(a()) + + If ArraySize(a()) = ArraySize(b()) + For i = 0 To length + sum + a(i) * b(i) + Next + EndIf + + ProcedureReturn sum +EndProcedure + +If OpenConsole() + Dim a(2) + Dim b(2) + + a(0) = 1 : a(1) = 3 : a(2) = -5 + b(0) = 4 : b(1) = -2 : b(2) = -1 + + PrintN(Str(dotProduct(a(),b()))) + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() + CloseConsole() +EndIf diff --git a/Task/Dot-product/RLaB/dot-product.rlab b/Task/Dot-product/RLaB/dot-product.rlab new file mode 100644 index 0000000000..06769a98b3 --- /dev/null +++ b/Task/Dot-product/RLaB/dot-product.rlab @@ -0,0 +1,3 @@ +x = rand(1,10); +y = rand(1,10); +s = sum( x .* y ); diff --git a/Task/Dot-product/Rascal/dot-product-1.rascal b/Task/Dot-product/Rascal/dot-product-1.rascal new file mode 100644 index 0000000000..9d5b677747 --- /dev/null +++ b/Task/Dot-product/Rascal/dot-product-1.rascal @@ -0,0 +1,16 @@ +import List; + +public int dotProduct(list[int] L, list[int] M){ + result = 0; + if(size(L) == size(M)) { + while(size(L) >= 1) { + result += (head(L) * head(M)); + L = tail(L); + M = tail(M); + } + return result; + } + else { + throw "vector sizes must match"; + } +} diff --git a/Task/Dot-product/Rascal/dot-product-2.rascal b/Task/Dot-product/Rascal/dot-product-2.rascal new file mode 100644 index 0000000000..47681b9931 --- /dev/null +++ b/Task/Dot-product/Rascal/dot-product-2.rascal @@ -0,0 +1,12 @@ +import Prelude; + +public real matrixDotproduct(rel[real x, real y, real v] column1, rel[real x, real y, real v] column2){ + return (0.0 | it + v1*v2 | <- column1, <- column2, y1==y2); +} + +//a matrix, given by a relation of x-coordinate, y-coordinate, value. +public rel[real x, real y, real v] matrixA = { +<0.0,0.0,12.0>, <0.0,1.0, 6.0>, <0.0,2.0,-4.0>, +<1.0,0.0,-51.0>, <1.0,1.0,167.0>, <1.0,2.0,24.0>, +<2.0,0.0,4.0>, <2.0,1.0,-68.0>, <2.0,2.0,-41.0> +}; diff --git a/Task/Dot-product/Run-BASIC/dot-product.run b/Task/Dot-product/Run-BASIC/dot-product.run new file mode 100644 index 0000000000..c1012ca0dd --- /dev/null +++ b/Task/Dot-product/Run-BASIC/dot-product.run @@ -0,0 +1,14 @@ +v1$ = "1, 3, -5" +v2$ = "4, -2, -1" + +print "DotProduct of ";v1$;" and "; v2$;" is ";dotProduct(v1$,v2$) +end + +function dotProduct(a$, b$) + while word$(a$,i + 1,",") <> "" + i = i + 1 + v1$=word$(a$,i,",") + v2$=word$(b$,i,",") + dotProduct = dotProduct + val(v1$) * val(v2$) + wend +end function diff --git a/Task/Dot-product/SNOBOL4/dot-product.sno b/Task/Dot-product/SNOBOL4/dot-product.sno new file mode 100644 index 0000000000..27f6560dfe --- /dev/null +++ b/Task/Dot-product/SNOBOL4/dot-product.sno @@ -0,0 +1,11 @@ + define("dotp(a,b)sum,i") :(dotp_end) +dotp i = 1; sum = 0 +loop sum = sum + (a * b) + i = i + 1 ?a :s(loop) + dotp = sum :(return) +dotp_end + + a = array(3); a<1> = 1; a<2> = 3; a<3> = -5; + b = array(3); b<1> = 4; b<2> = -2; b<3> = -1; + output = dotp(a,b) +end diff --git a/Task/Dot-product/SPARK/dot-product.spark b/Task/Dot-product/SPARK/dot-product.spark new file mode 100644 index 0000000000..4357568bd9 --- /dev/null +++ b/Task/Dot-product/SPARK/dot-product.spark @@ -0,0 +1,41 @@ +with Spark_IO; +--# inherit Spark_IO; +--# main_program; +procedure Dot_Product_Main +--# global in out Spark_IO.Outputs; +--# derives Spark_IO.Outputs from *; +is + Limit : constant := 1000; + type V_Elem is range -Limit .. Limit; + V_Size : constant := 100; + type V_Index is range 1 .. V_Size; + type Vector is array(V_Index range <>) of V_Elem; + + type V_Prod is range -(Limit**2)*V_Size .. (Limit**2)*V_Size; + --# assert V_Prod'Base is Integer; + + subtype Index3 is V_Index range 1 .. 3; + subtype Vector3 is Vector(Index3); + Vect1 : constant Vector3 := Vector3'(1, 3, -5); + Vect2 : constant Vector3 := Vector3'(4, -2, -1); + + function Dot_Product(V1, V2 : Vector) return V_Prod + --# pre V1'First = V2'First + --# and V1'Last = V2'Last; + is + Sum : V_Prod := 0; + begin + for I in V_Index range V1'Range + --# assert Sum in -(Limit**2)*V_Prod(I-1) .. (Limit**2)*V_Prod(I-1); + loop + Sum := Sum + V_Prod(V1(I)) * V_Prod(V2(I)); + end loop; + return Sum; + end Dot_Product; + +begin + Spark_IO.Put_Integer(File => Spark_IO.Standard_Output, + Item => Integer(Dot_Product(Vect1, Vect2)), + Width => 6, + Base => 10); +end Dot_Product_Main; diff --git a/Task/Dot-product/SQL/dot-product.sql b/Task/Dot-product/SQL/dot-product.sql new file mode 100644 index 0000000000..33d74952bc --- /dev/null +++ b/Task/Dot-product/SQL/dot-product.sql @@ -0,0 +1,3 @@ +select i, k, sum(A.N*B.N) as N + from A inner join B on A.j=B.j + group by i, k diff --git a/Task/Dot-product/Seed7/dot-product.seed7 b/Task/Dot-product/Seed7/dot-product.seed7 new file mode 100644 index 0000000000..a957e3b663 --- /dev/null +++ b/Task/Dot-product/Seed7/dot-product.seed7 @@ -0,0 +1,23 @@ +$ include "seed7_05.s7i"; + +$ syntax expr: .().dot.() is -> 6; # priority of dot operator + +const func integer: (in array integer: a) dot (in array integer: b) is func + result + var integer: sum is 0; + local + var integer: index is 0; + begin + if length(a) <> length(b) then + raise RANGE_ERROR; + else + for index range 1 to length(a) do + sum +:= a[index] * b[index]; + end for; + end if; + end func; + +const proc: main is func + begin + writeln([](1, 3, -5) dot [](4, -2, -1)); + end func; diff --git a/Task/Dot-product/Slate/dot-product.slate b/Task/Dot-product/Slate/dot-product.slate new file mode 100644 index 0000000000..82e7f9da00 --- /dev/null +++ b/Task/Dot-product/Slate/dot-product.slate @@ -0,0 +1,6 @@ +v@(Vector traits) w@(Vector traits) +"Dot-product." +[ + (0 below: (v size min: w size)) inject: 0 into: + [| :sum :index | sum + ((v at: index) * (w at: index))] +]. diff --git a/Task/Dot-product/Standard-ML/dot-product-1.ml b/Task/Dot-product/Standard-ML/dot-product-1.ml new file mode 100644 index 0000000000..2cba6b2fc2 --- /dev/null +++ b/Task/Dot-product/Standard-ML/dot-product-1.ml @@ -0,0 +1,6 @@ +val dot = ListPair.foldlEq Real.*+ 0.0 + +(* +- dot ([1.0, 3.0, ~5.0], [4.0, ~2.0, ~1.0]); +val it = 3.0 : real +*) diff --git a/Task/Dot-product/Standard-ML/dot-product-2.ml b/Task/Dot-product/Standard-ML/dot-product-2.ml new file mode 100644 index 0000000000..ef3c1a414e --- /dev/null +++ b/Task/Dot-product/Standard-ML/dot-product-2.ml @@ -0,0 +1,11 @@ +fun dot (v, u) = ( + if Vector.length v <> Vector.length u then + raise ListPair.UnequalLengths + else (); + Vector.foldli (fn (i, v_i, z) => v_i * Vector.sub (u, i) + z) 0.0 v + ) + +(* +- dot (#[1.0, 3.0, ~5.0], #[4.0, ~2.0, ~1.0]); +val it = 3.0 : real +*) diff --git a/Task/Dot-product/Ursala/dot-product.ursala b/Task/Dot-product/Ursala/dot-product.ursala new file mode 100644 index 0000000000..a172aae3ce --- /dev/null +++ b/Task/Dot-product/Ursala/dot-product.ursala @@ -0,0 +1,7 @@ +#import int + +dot = sum:-0+ product*p + +#cast %z + +test = dot(<1,3,-5>,<4,-2,-1>) diff --git a/Task/Dot-product/XPL0/dot-product.xpl0 b/Task/Dot-product/XPL0/dot-product.xpl0 new file mode 100644 index 0000000000..595c11ed59 --- /dev/null +++ b/Task/Dot-product/XPL0/dot-product.xpl0 @@ -0,0 +1,13 @@ +include c:\cxpl\codes; + +func DotProd(U, V, L); +int U, V, L; +int S, I; +[S:= 0; +for I:= 0 to L-1 do S:= S + U(I)*V(I); +return S; +]; + +[IntOut(0, DotProd([1, 3, -5], [4, -2, -1], 3)); +CrLf(0); +] diff --git a/Task/Doubly-linked-list-Definition/PL-I/doubly-linked-list-definition.pli b/Task/Doubly-linked-list-Definition/PL-I/doubly-linked-list-definition.pli new file mode 100644 index 0000000000..21059a8a28 --- /dev/null +++ b/Task/Doubly-linked-list-Definition/PL-I/doubly-linked-list-definition.pli @@ -0,0 +1,5 @@ +define structure + 1 Node, + 2 value fixed decimal, + 2 back_pointer handle(Node), + 2 fwd_pointer handle(Node); diff --git a/Task/Doubly-linked-list-Definition/Perl-6/doubly-linked-list-definition.pl6 b/Task/Doubly-linked-list-Definition/Perl-6/doubly-linked-list-definition.pl6 new file mode 100644 index 0000000000..5ee1919518 --- /dev/null +++ b/Task/Doubly-linked-list-Definition/Perl-6/doubly-linked-list-definition.pl6 @@ -0,0 +1,60 @@ +role DLElem[::T] { + has DLElem[T] $.prev is rw; + has DLElem[T] $.next is rw; + has T $.payload = T; + + method pre-insert(T $payload) { + die "Can't insert before beginning" unless $!prev; + my $elem = ::?CLASS.new(:$payload); + $!prev.next = $elem; + $elem.prev = $!prev; + $elem.next = self; + $!prev = $elem; + $elem; + } + + method post-insert(T $payload) { + die "Can't insert after end" unless $!next; + my $elem = ::?CLASS.new(:$payload); + $!next.prev = $elem; + $elem.next = $!next; + $elem.prev = self; + $!next = $elem; + $elem; + } + + method delete { + die "Can't delete a sentinel" unless $!prev and $!next; + $!next.prev = $!prev; + $!prev.next = $!next; # conveniently returns next element + } +} + +role DLList[::DLE] { + has DLE $.first; + has DLE $.last; + + submethod BUILD { + $!first = DLE.new; + $!last = DLE.new; + $!first.next = $!last; + $!last.prev = $!first; + } + + method list { ($!first.next, *.next ...^ !*.next).map: *.payload } + method reverse { ($!last.prev, *.prev ...^ !*.prev).map: *.payload } +} + +class DLElem_Int does DLElem[Int] {} +class DLList_Int does DLList[DLElem_Int] {} + +my $dll = DLList_Int.new; + +$dll.first.post-insert(1).post-insert(2).post-insert(3); +$dll.first.post-insert(0); + +$dll.last.pre-insert(41).pre-insert(40).prev.delete; # (deletes 3) +$dll.last.pre-insert(42); + +say $dll.list; # 0 1 2 40 41 42 +say $dll.reverse; # 42 41 40 2 1 0 diff --git a/Task/Doubly-linked-list-Definition/PureBasic/doubly-linked-list-definition.purebasic b/Task/Doubly-linked-list-Definition/PureBasic/doubly-linked-list-definition.purebasic new file mode 100644 index 0000000000..5904409f2f --- /dev/null +++ b/Task/Doubly-linked-list-Definition/PureBasic/doubly-linked-list-definition.purebasic @@ -0,0 +1,68 @@ +DataSection + ;the list of words that will be added to the list + words: + Data.s "One", "Two", "Three", "Four", "Five", "Six", "EndOfData" +EndDataSection + + +Procedure displayList(List x.s(), title$) + ;display all elements from list of strings + Print(title$) + ForEach x() + Print(x() + " ") + Next + PrintN("") +EndProcedure + + +OpenConsole() + +NewList a.s() ;create a new list of strings + +;add words to the head of list +Restore words +Repeat + Read.s a$ + If a$ <> "EndOfData" + ResetList(a()) ;Move to head of list + AddElement(a()) + a() = a$ + EndIf +Until a$ = "EndOfData" +displayList(a(),"Insertion at Head: ") + + +ClearList(a()) +;add words to the tail of list +Restore words +LastElement(a()) ;Move to the tail of the list +Repeat + Read.s a$ + If a$ <> "EndOfData" + AddElement(a()) ;after insertion the new position is still at the tail + a() = a$ + EndIf +Until a$ = "EndOfData" +displayList(a(),"Insertion at Tail: ") + + +ClearList(a()) +;add words to the middle of list +Restore words +ResetList(a()) ;Move to the tail of the list +Repeat + Read.s a$ + If a$ <> "EndOfData" + c = CountList(a()) + If c > 1 + SelectElement(a(),Random(c - 2)) ;insert after a random element but before tail + Else + FirstElement(a()) + EndIf + AddElement(a()) + a() = a$ + EndIf +Until a$ = "EndOfData" +displayList(a(),"Insertion in Middle: ") + +Repeat: Until Inkey() <> "" diff --git a/Task/Doubly-linked-list-Definition/Visual-Basic-.NET/doubly-linked-list-definition.visual b/Task/Doubly-linked-list-Definition/Visual-Basic-.NET/doubly-linked-list-definition.visual new file mode 100644 index 0000000000..0701fa1195 --- /dev/null +++ b/Task/Doubly-linked-list-Definition/Visual-Basic-.NET/doubly-linked-list-definition.visual @@ -0,0 +1,128 @@ +Public Class DoubleLinkList(Of T) + Private m_Head As Node(Of T) + Private m_Tail As Node(Of T) + + Public Sub AddHead(ByVal value As T) + Dim node As New Node(Of T)(Me, value) + + If m_Head Is Nothing Then + m_Head = Node + m_Tail = m_Head + Else + node.Next = m_Head + m_Head = node + End If + + End Sub + + Public Sub AddTail(ByVal value As T) + Dim node As New Node(Of T)(Me, value) + + If m_Tail Is Nothing Then + m_Head = node + m_Tail = m_Head + Else + node.Previous = m_Tail + m_Tail = node + End If + End Sub + + Public ReadOnly Property Head() As Node(Of T) + Get + Return m_Head + End Get + End Property + + Public ReadOnly Property Tail() As Node(Of T) + Get + Return m_Tail + End Get + End Property + + Public Sub RemoveTail() + If m_Tail Is Nothing Then Return + + If m_Tail.Previous Is Nothing Then 'empty + m_Head = Nothing + m_Tail = Nothing + Else + m_Tail = m_Tail.Previous + m_Tail.Next = Nothing + End If + End Sub + + Public Sub RemoveHead() + If m_Head Is Nothing Then Return + + If m_Head.Next Is Nothing Then 'empty + m_Head = Nothing + m_Tail = Nothing + Else + m_Head = m_Head.Next + m_Head.Previous = Nothing + End If + End Sub + +End Class + +Public Class Node(Of T) + Private ReadOnly m_Value As T + Private m_Next As Node(Of T) + Private m_Previous As Node(Of T) + Private ReadOnly m_Parent As DoubleLinkList(Of T) + + Public Sub New(ByVal parent As DoubleLinkList(Of T), ByVal value As T) + m_Parent = parent + m_Value = value + End Sub + + Public Property [Next]() As Node(Of T) + Get + Return m_Next + End Get + Friend Set(ByVal value As Node(Of T)) + m_Next = value + End Set + End Property + + Public Property Previous() As Node(Of T) + Get + Return m_Previous + End Get + Friend Set(ByVal value As Node(Of T)) + m_Previous = value + End Set + End Property + + Public ReadOnly Property Value() As T + Get + Return m_Value + End Get + End Property + + Public Sub InsertAfter(ByVal value As T) + If m_Next Is Nothing Then + m_Parent.AddTail(value) + ElseIf m_Previous Is Nothing Then + m_Parent.AddHead(value) + Else + Dim node As New Node(Of T)(m_Parent, value) + node.Previous = Me + node.Next = Me.Next + Me.Next.Previous = node + Me.Next = node + End If + End Sub + + Public Sub Remove() + If m_Next Is Nothing Then + m_Parent.RemoveTail() + ElseIf m_Previous Is Nothing Then + m_Parent.RemoveHead() + Else + m_Previous.Next = Me.Next + m_Next.Previous = Me.Previous + End If + End Sub + +End Class diff --git a/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-1.ocaml b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-1.ocaml new file mode 100644 index 0000000000..2999484498 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-1.ocaml @@ -0,0 +1,42 @@ +type 'a dlink = { + mutable data: 'a; + mutable next: 'a dlink option; + mutable prev: 'a dlink option; +} + +let dlink_of_list li = + let f prev_dlink x = + let dlink = { + data = x; + prev = None; + next = prev_dlink } + in + begin match prev_dlink with + | None -> () + | Some prev_dlink -> + prev_dlink.prev <- Some dlink + end; + Some dlink + in + List.fold_left f None (List.rev li) +;; + +let list_of_dlink = + let rec aux acc = function + | None -> List.rev acc + | Some{ data = d; + prev = _; + next = next } -> aux (d::acc) next + in + aux [] +;; + +let iter_forward_dlink f = + let rec aux = function + | None -> () + | Some{ data = d; + prev = _; + next = next } -> f d; aux next + in + aux +;; diff --git a/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-2.ocaml b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-2.ocaml new file mode 100644 index 0000000000..1b5f802058 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-2.ocaml @@ -0,0 +1,8 @@ +# let dl = dlink_of_list [1;2;3;4;5] in + iter_forward_dlink (Printf.printf "%d\n") dl ;; +1 +2 +3 +4 +5 +- : unit = () diff --git a/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-3.ocaml b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-3.ocaml new file mode 100644 index 0000000000..5553e61311 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-3.ocaml @@ -0,0 +1 @@ +type 'a nav_list = 'a list * 'a * 'a list diff --git a/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-4.ocaml b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-4.ocaml new file mode 100644 index 0000000000..d1ac869ccf --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-4.ocaml @@ -0,0 +1,18 @@ +let nav_list_of_list = function + | hd::tl -> [], hd, tl + | [] -> invalid_arg "empty list" + +let current = function + | _, item, _ -> item + +let next = function + | prev, item, next::next_tl -> + item::prev, next, next_tl + | _ -> + failwith "end of nav_list reached" + +let prev = function + | prev::prev_tl, item, next -> + prev_tl, prev, item::next + | _ -> + failwith "begin of nav_list reached" diff --git a/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-5.ocaml b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-5.ocaml new file mode 100644 index 0000000000..601c9b8dbb --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/OCaml/doubly-linked-list-element-definition-5.ocaml @@ -0,0 +1,9 @@ +# let nl = nav_list_of_list [1;2;3;4;5] ;; +val nl : 'a list * int * int list = ([], 1, [2; 3; 4; 5]) +# let nl = next nl ;; +val nl : int list * int * int list = ([1], 2, [3; 4; 5]) +# let nl = next nl ;; +val nl : int list * int * int list = ([2; 1], 3, [4; 5]) + +# current nl ;; +- : int = 3 diff --git a/Task/Doubly-linked-list-Element-definition/Oz/doubly-linked-list-element-definition.oz b/Task/Doubly-linked-list-Element-definition/Oz/doubly-linked-list-element-definition.oz new file mode 100644 index 0000000000..b2c33bcaa7 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/Oz/doubly-linked-list-element-definition.oz @@ -0,0 +1,5 @@ +fun {CreateNewNode Value} + node(prev:{NewCell _} + next:{NewCell _} + value:Value) +end diff --git a/Task/Doubly-linked-list-Element-definition/PL-I/doubly-linked-list-element-definition.pli b/Task/Doubly-linked-list-Element-definition/PL-I/doubly-linked-list-element-definition.pli new file mode 100644 index 0000000000..38c6552383 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/PL-I/doubly-linked-list-element-definition.pli @@ -0,0 +1,14 @@ +define structure + 1 Node, + 2 value fixed decimal, + 2 back_pointer handle(Node), + 2 fwd_pointer handle(Node); + +P = NEW(: Node :); /* Creates a node, and lets P point at it. */ +get (P => value); /* Reads in a value to the node we just created. */ + +/* Assuming that back_pointer and fwd_pointer point at other nodes, */ +/* we can say ... */ +P = P => fwd_pointer; /* P now points at the next node. */ +... +P = P => back_pointer; /* P now points at the previous node. */ diff --git a/Task/Doubly-linked-list-Element-definition/Pascal/doubly-linked-list-element-definition.pascal b/Task/Doubly-linked-list-Element-definition/Pascal/doubly-linked-list-element-definition.pascal new file mode 100644 index 0000000000..be9d8fc3e7 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/Pascal/doubly-linked-list-element-definition.pascal @@ -0,0 +1,7 @@ +type link_ptr = ^link; + data_ptr = ^data; (* presumes that type 'data' is defined above *) + link = record + prev: link_ptr; + next: link_ptr; + data: data_ptr; + end; diff --git a/Task/Doubly-linked-list-Element-definition/Perl-6/doubly-linked-list-element-definition.pl6 b/Task/Doubly-linked-list-Element-definition/Perl-6/doubly-linked-list-element-definition.pl6 new file mode 100644 index 0000000000..c0093db228 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/Perl-6/doubly-linked-list-element-definition.pl6 @@ -0,0 +1,31 @@ +role DLElem[::T] { + has DLElem[T] $.prev is rw; + has DLElem[T] $.next is rw; + has T $.payload = T; + + method pre-insert(T $payload) { + die "Can't insert before beginning" unless $!prev; + my $elem = ::?CLASS.new(:$payload); + $!prev.next = $elem; + $elem.prev = $!prev; + $elem.next = self; + $!prev = $elem; + $elem; + } + + method post-insert(T $payload) { + die "Can't insert after end" unless $!next; + my $elem = ::?CLASS.new(:$payload); + $!next.prev = $elem; + $elem.next = $!next; + $elem.prev = self; + $!next = $elem; + $elem; + } + + method delete { + die "Can't delete a sentinel" unless $!prev and $!next; + $!next.prev = $!prev; + $!prev.next = $!next; # conveniently returns next element + } +} diff --git a/Task/Doubly-linked-list-Element-definition/Pop11/doubly-linked-list-element-definition.pop11 b/Task/Doubly-linked-list-Element-definition/Pop11/doubly-linked-list-element-definition.pop11 new file mode 100644 index 0000000000..1250186441 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/Pop11/doubly-linked-list-element-definition.pop11 @@ -0,0 +1,6 @@ +uses objectclass; +define :class Link; + slot next = []; + slot prev = []; + slot data = []; +enddefine; diff --git a/Task/Doubly-linked-list-Element-definition/PureBasic/doubly-linked-list-element-definition.purebasic b/Task/Doubly-linked-list-Element-definition/PureBasic/doubly-linked-list-element-definition.purebasic new file mode 100644 index 0000000000..c47872eafd --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/PureBasic/doubly-linked-list-element-definition.purebasic @@ -0,0 +1,5 @@ +Structure node + *prev.node + *next.node + value.i +EndStructure diff --git a/Task/Doubly-linked-list-Element-definition/Visual-Basic-.NET/doubly-linked-list-element-definition.visual b/Task/Doubly-linked-list-Element-definition/Visual-Basic-.NET/doubly-linked-list-element-definition.visual new file mode 100644 index 0000000000..5c2dafa5a0 --- /dev/null +++ b/Task/Doubly-linked-list-Element-definition/Visual-Basic-.NET/doubly-linked-list-element-definition.visual @@ -0,0 +1,5 @@ +Public Class Node(Of T) + Public Value As T + Public [Next] As Node(Of T) + Public Previous As Node(Of T) +End Class diff --git a/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-1.ocaml b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-1.ocaml new file mode 100644 index 0000000000..ceaf6f1f40 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-1.ocaml @@ -0,0 +1,16 @@ +(* val _insert : 'a dlink -> 'a dlink -> unit *) +let _insert anchor newlink = + newlink.next <- anchor.next; + newlink.prev <- Some anchor; + begin match newlink.next with + | None -> () + | Some next -> + next.prev <-Some newlink; + end; + anchor.next <- Some newlink;; + +(* val insert : 'a dlink option -> 'a -> unit *) +let insert dl v = + match dl with + | (Some anchor) -> _insert anchor {data=v; prev=None; next=None} + | None -> invalid_arg "dlink empty";; diff --git a/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-2.ocaml b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-2.ocaml new file mode 100644 index 0000000000..1ff9e6499c --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-2.ocaml @@ -0,0 +1,7 @@ +# type t = A | B | C ;; +type t = A | B | C + +# let dl = dlink_of_list [A; B] in + insert dl C; + list_of_dlink dl ;; +- : t list = [A; C; B] diff --git a/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-3.ocaml b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-3.ocaml new file mode 100644 index 0000000000..c8ca9d8854 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-3.ocaml @@ -0,0 +1,2 @@ +(* val insert : 'a nav_list -> 'a -> 'a nav_list *) +let insert (prev, cur, next) v = (prev, cur, v::next) diff --git a/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-4.ocaml b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-4.ocaml new file mode 100644 index 0000000000..457b0bd774 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/OCaml/doubly-linked-list-element-insertion-4.ocaml @@ -0,0 +1,8 @@ +# type t = A | B | C ;; +type t = A | B | C + +# let nl = nav_list_of_list [A; B] ;; +val nl : 'a list * t * t list = ([], A, [B]) + +# insert nl C ;; +- : 'a list * t * t list = ([], A, [C; B]) diff --git a/Task/Doubly-linked-list-Element-insertion/Oz/doubly-linked-list-element-insertion.oz b/Task/Doubly-linked-list-Element-insertion/Oz/doubly-linked-list-element-insertion.oz new file mode 100644 index 0000000000..d3d8a6213a --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/Oz/doubly-linked-list-element-insertion.oz @@ -0,0 +1,25 @@ +declare + fun {CreateNewNode Value} + node(prev:{NewCell nil} + next:{NewCell nil} + value:Value) + end + + proc {InsertAfter Node NewNode} + Next = Node.next + in + (NewNode.next) := @Next + (NewNode.prev) := Node + case @Next of nil then skip + [] node(prev:NextPrev ...) then + NextPrev := NewNode + end + Next := NewNode + end + + A = {CreateNewNode a} + B = {CreateNewNode b} + C = {CreateNewNode c} +in + {InsertAfter A B} + {InsertAfter A C} diff --git a/Task/Doubly-linked-list-Element-insertion/PL-I/doubly-linked-list-element-insertion.pli b/Task/Doubly-linked-list-Element-insertion/PL-I/doubly-linked-list-element-insertion.pli new file mode 100644 index 0000000000..b62058f62f --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/PL-I/doubly-linked-list-element-insertion.pli @@ -0,0 +1,19 @@ +define structure + 1 Node, + 2 value fixed decimal, + 2 back_pointer handle(Node), + 2 fwd_pointer handle(Node); + +/* Given that 'Current" points at some node in the linked list : */ + +P = NEW (: Node :); /* Create a node. */ +get (P => value); +P => fwd_pointer = Current => fwd_pointer; + /* Points the new node at the next one. */ +Current => fwd_pinter = P; + /* Points the current node at the new one. */ +P => back_pointer = Current; + /* Points the new node back at the current one. */ +Q = P => fwd_pointer; +Q => back_pointer = P; + /* Points the next node to the new one. */ diff --git a/Task/Doubly-linked-list-Element-insertion/Pascal/doubly-linked-list-element-insertion-1.pascal b/Task/Doubly-linked-list-Element-insertion/Pascal/doubly-linked-list-element-insertion-1.pascal new file mode 100644 index 0000000000..24e02805dd --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/Pascal/doubly-linked-list-element-insertion-1.pascal @@ -0,0 +1,7 @@ +procedure insert_link( a, b, c: link_ptr ); +begin + a^.next := c; + if b <> nil then b^.prev := c; + c^.next := b; + c^.prev := a; +end; diff --git a/Task/Doubly-linked-list-Element-insertion/Pascal/doubly-linked-list-element-insertion-2.pascal b/Task/Doubly-linked-list-Element-insertion/Pascal/doubly-linked-list-element-insertion-2.pascal new file mode 100644 index 0000000000..25ae4dd589 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/Pascal/doubly-linked-list-element-insertion-2.pascal @@ -0,0 +1,7 @@ +procedure realistic_insert_link( a, c: link_ptr ); +begin + if a^.next <> nil then a^.next^.prev := c; (* 'a^.next^' is another way of saying 'b', if b exists *) + c^.next := a^.next; + a^.next := c; + c^.prev := a; +end; diff --git a/Task/Doubly-linked-list-Element-insertion/Perl-6/doubly-linked-list-element-insertion.pl6 b/Task/Doubly-linked-list-Element-insertion/Perl-6/doubly-linked-list-element-insertion.pl6 new file mode 100644 index 0000000000..68489a2808 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/Perl-6/doubly-linked-list-element-insertion.pl6 @@ -0,0 +1,7 @@ +class DLElem_Str does DLElem[Str] {} +class DLList_Str does DLList[DLElem_Str] {} + +my $sdll = DLList_Str.new; +my $b = $sdll.first.post-insert('A').post-insert('B'); +$b.pre-insert('C'); +say $sdll.list; # A C B diff --git a/Task/Doubly-linked-list-Element-insertion/Pop11/doubly-linked-list-element-insertion.pop11 b/Task/Doubly-linked-list-Element-insertion/Pop11/doubly-linked-list-element-insertion.pop11 new file mode 100644 index 0000000000..63bd542b39 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/Pop11/doubly-linked-list-element-insertion.pop11 @@ -0,0 +1,23 @@ +define insert_double(list, element); + lvars tmp; + if list == [] then + ;;; Insertion into empty list, return element + element + else + next(list) -> tmp; + list -> prev(element); + tmp -> next(element); + element -> next(list); + if tmp /= [] then + element -> prev(tmp) + endif; + ;;; return original list + list + endif; +enddefine; + +lvars A = newLink(), B = newLink(), C = newLink(); +;;; Build the list of A and B +insert_double(A, B) -> _; +;;; insert C between A and b +insert_double(A, C) -> _; diff --git a/Task/Doubly-linked-list-Element-insertion/PureBasic/doubly-linked-list-element-insertion.purebasic b/Task/Doubly-linked-list-Element-insertion/PureBasic/doubly-linked-list-element-insertion.purebasic new file mode 100644 index 0000000000..aa0133e975 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/PureBasic/doubly-linked-list-element-insertion.purebasic @@ -0,0 +1,41 @@ +Structure node + *prev.node + *next.node + value.c ;use character type for elements in this example +EndStructure + +Procedure insertAfter(element.c, *c.node) + ;insert new node *n after node *c and set it's value to element + Protected *n.node = AllocateMemory(SizeOf(node)) + If *n + *n\value = element + *n\prev = *c + If *c + *n\next = *c\next + *c\next = *n + EndIf + EndIf + ProcedureReturn *n +EndProcedure + +Procedure displayList(*dl.node) + Protected *n.node = *dl + Repeat + Print(Chr(*n\Value) + " ") + *n = *n\next + Until *n = #Null +EndProcedure + +If OpenConsole() + Define dl.node, *n.node + + *n = insertAfter('A',dl) + insertAfter('B',*n) + insertAfter('C',*n) + + displayList(dl) + + Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") + Input() + CloseConsole() +EndIf diff --git a/Task/Doubly-linked-list-Element-insertion/Visual-Basic-.NET/doubly-linked-list-element-insertion.visual b/Task/Doubly-linked-list-Element-insertion/Visual-Basic-.NET/doubly-linked-list-element-insertion.visual new file mode 100644 index 0000000000..0a2049b449 --- /dev/null +++ b/Task/Doubly-linked-list-Element-insertion/Visual-Basic-.NET/doubly-linked-list-element-insertion.visual @@ -0,0 +1,7 @@ +Public Sub Insert(ByVal a As Node(Of T), ByVal b As Node(Of T), ByVal c As T) + Dim node As New Node(Of T)(value) + a.Next = node + node.Previous = a + b.Previous = node + node.Next = b +End Sub diff --git a/Task/Doubly-linked-list-Traversal/Objeck/doubly-linked-list-traversal.objeck b/Task/Doubly-linked-list-Traversal/Objeck/doubly-linked-list-traversal.objeck new file mode 100644 index 0000000000..bccd476f18 --- /dev/null +++ b/Task/Doubly-linked-list-Traversal/Objeck/doubly-linked-list-traversal.objeck @@ -0,0 +1,24 @@ +class Traverse { + function : Main(args : String[]) ~ Nil { + list := Collection.IntList->New(); + list->Insert(100); + list->Insert(50); + list->Insert(25); + list->Insert(10); + list->Insert(5); + + "-- forward --"->PrintLine(); + list->Rewind(); + while(list->More()) { + list->Get()->PrintLine(); + list->Next(); + }; + + "-- backward --"->PrintLine(); + list->Forward(); + while(list->More()) { + list->Get()->PrintLine(); + list->Previous(); + }; + } +} diff --git a/Task/Doubly-linked-list-Traversal/Oz/doubly-linked-list-traversal.oz b/Task/Doubly-linked-list-Traversal/Oz/doubly-linked-list-traversal.oz new file mode 100644 index 0000000000..671c8c0403 --- /dev/null +++ b/Task/Doubly-linked-list-Traversal/Oz/doubly-linked-list-traversal.oz @@ -0,0 +1,54 @@ +declare + proc {Walk Node Action} + case Node of nil then skip + [] node(value:V next:N ...) then + {Action V} + {Walk @N Action} + end + end + + proc {WalkBackwards Node Action} + Tail = {GetLast Node} + proc {Loop N} + case N of nil then skip + [] node(value:V prev:P ...) then + {Action V} + {Loop @P} + end + end + in + {Loop Tail} + end + + fun {GetLast Node} + case @(Node.next) of nil then Node + [] NextNode=node(...) then {GetLast NextNode} + end + end + + fun {CreateNewNode Value} + node(prev:{NewCell nil} + next:{NewCell nil} + value:Value) + end + + proc {InsertAfter Node NewNode} + Next = Node.next + in + (NewNode.next) := @Next + (NewNode.prev) := Node + case @Next of nil then skip + [] node(prev:NextPrev ...) then + NextPrev := NewNode + end + Next := NewNode + end + + A = {CreateNewNode a} + B = {CreateNewNode b} + C = {CreateNewNode c} +in + {InsertAfter A B} + {InsertAfter A C} + {Walk A Show} + {WalkBackwards A Show} diff --git a/Task/Doubly-linked-list-Traversal/PL-I/doubly-linked-list-traversal.pli b/Task/Doubly-linked-list-Traversal/PL-I/doubly-linked-list-traversal.pli new file mode 100644 index 0000000000..47a68ac50e --- /dev/null +++ b/Task/Doubly-linked-list-Traversal/PL-I/doubly-linked-list-traversal.pli @@ -0,0 +1,57 @@ +/* To implement a doubly-linked list -- i.e., a 2-way linked list. */ +doubly_linked_list: proc options (main); + + define structure + 1 node, + 2 value fixed, + 2 fwd_pointer handle(node), + 2 back_pointer handle(node); + + declare (head, tail, t) handle (node); + declare null builtin; + declare i fixed binary; + + head, tail = bind(:node, null:); + + do i = 1 to 10; /* Add ten items to the tail of the queue. */ + if head = bind(:node, null:) then + do; + head,tail = new(:node:); + get list (head => value); + put skip list (head => value); + head => back_pointer, + head => fwd_pointer = bind(:node, null:); /* A NULL link */ + end; + else + do; + t = new(:node:); + t => back_pointer = tail; /* Point the new tail back to the old */ + /* tail. */ + tail => fwd_pointer = t; /* Point the tail to the new node. */ + t => back_pointer = tail; /* Point the new tail back to the old */ + /* tail. */ + tail = t; /* Point at teh new tail. */ + tail => fwd_pointer = bind(:node, null:); + /* Set the tail link to NULL */ + get list (tail => value) copy; + put skip list (tail => value); + end; + end; + + if head = bind(:node, null:) then return; /* Empty list. */ + + /* Traverse the list from the head. */ + put skip list ('In a forwards direction, the list has:'); + t = head; + do while (t ^= bind(:node, null:)); + put skip list (t => value); + t = t => fwd_pointer; + end; + /* Traverse the list from the tail to the head. */ + put skip list ('In the reverse direction, the list has:'); + t = tail; + do while (t ^= bind(:node, null:)); + put skip list (t => value); + t = t => back_pointer; + end; +end doubly_linked_list; diff --git a/Task/Doubly-linked-list-Traversal/Perl-6/doubly-linked-list-traversal.pl6 b/Task/Doubly-linked-list-Traversal/Perl-6/doubly-linked-list-traversal.pl6 new file mode 100644 index 0000000000..af2233c05b --- /dev/null +++ b/Task/Doubly-linked-list-Traversal/Perl-6/doubly-linked-list-traversal.pl6 @@ -0,0 +1,2 @@ +say $dll.list; +say $dll.reverse; diff --git a/Task/Doubly-linked-list-Traversal/PureBasic/doubly-linked-list-traversal.purebasic b/Task/Doubly-linked-list-Traversal/PureBasic/doubly-linked-list-traversal.purebasic new file mode 100644 index 0000000000..041428b0e4 --- /dev/null +++ b/Task/Doubly-linked-list-Traversal/PureBasic/doubly-linked-list-traversal.purebasic @@ -0,0 +1,19 @@ +NewList MyData.i() ; Create a double linked list holding a single value (integer) + +;Set up a randomly long linked list in the range 25-125 elements +For i=0 To (Random(100)+25) + AddElement(MyData()) ; Create a new tailing element + MyData()=Random(314) ; Inert a vale into it +Next +; +;Traverse from the beginning of a doubly-linked list to the end. +FirstElement(MyData()) +Repeat + Debug MyData() ; Present the value in the current cell +Until Not NextElement(MyData()) +; +;Traverse from the end to the beginning. +LastElement(MyData()) +Repeat + Debug MyData() ; Present the value in the current cell +Until Not PreviousElement(MyData()) diff --git a/Task/Doubly-linked-list-Traversal/Salmon/doubly-linked-list-traversal-1.salmon b/Task/Doubly-linked-list-Traversal/Salmon/doubly-linked-list-traversal-1.salmon new file mode 100644 index 0000000000..365fa124ee --- /dev/null +++ b/Task/Doubly-linked-list-Traversal/Salmon/doubly-linked-list-traversal-1.salmon @@ -0,0 +1,42 @@ +class item(init_data) + { + variable next, + previous, + data := init_data; + }; + +function prepend(tail, new_data) + { + immutable result := item(new_data); + result.next := tail; + result.previous := null; + if (tail != null) + tail.previous := result;; + return result; + }; + +variable my_list := null; +my_list := prepend(my_list, "R"); +my_list := prepend(my_list, "o"); +my_list := prepend(my_list, "s"); +my_list := prepend(my_list, "e"); +my_list := prepend(my_list, "t"); +my_list := prepend(my_list, "t"); +my_list := prepend(my_list, "a"); + +"Items in the list going forward:"! +variable follow := my_list; +while (true) + { + follow.data! + if (follow.next == null) + break;; + } +step + follow := follow.next;; + +"Items in the list going backward:"! +while (follow != null) + follow.data! +step + follow := follow.previous;; diff --git a/Task/Doubly-linked-list-Traversal/Salmon/doubly-linked-list-traversal-2.salmon b/Task/Doubly-linked-list-Traversal/Salmon/doubly-linked-list-traversal-2.salmon new file mode 100644 index 0000000000..5600a4bf78 --- /dev/null +++ b/Task/Doubly-linked-list-Traversal/Salmon/doubly-linked-list-traversal-2.salmon @@ -0,0 +1,42 @@ +class item(init_data : string) + { + variable next: item | {null}, + previous : item | {null}, + data : string := init_data; + }; + +function prepend(tail : item | {null}, new_data : string) returns item + { + immutable result := item(new_data); + result.next := tail; + result.previous := null; + if (tail != null) + tail.previous := result;; + return result; + }; + +variable my_list : item | {null} := null; +my_list := prepend(my_list, "R"); +my_list := prepend(my_list, "o"); +my_list := prepend(my_list, "s"); +my_list := prepend(my_list, "e"); +my_list := prepend(my_list, "t"); +my_list := prepend(my_list, "t"); +my_list := prepend(my_list, "a"); + +"Items in the list going forward:"! +variable follow : item | {null} := my_list; +while (true) + { + follow.data! + if (follow.next == null) + break;; + } +step + follow := follow.next;; + +"Items in the list going backward:"! +while (follow != null) + follow.data! +step + follow := follow.previous;; diff --git a/Task/Draw-a-cuboid/Mathematica/draw-a-cuboid.mathematica b/Task/Draw-a-cuboid/Mathematica/draw-a-cuboid.math similarity index 100% rename from Task/Draw-a-cuboid/Mathematica/draw-a-cuboid.mathematica rename to Task/Draw-a-cuboid/Mathematica/draw-a-cuboid.math diff --git a/Task/Draw-a-cuboid/Openscad/draw-a-cuboid.scad b/Task/Draw-a-cuboid/Openscad/draw-a-cuboid.scad new file mode 100644 index 0000000000..35dbee5228 --- /dev/null +++ b/Task/Draw-a-cuboid/Openscad/draw-a-cuboid.scad @@ -0,0 +1,2 @@ +// This will produce a simple cuboid +cube([2,3,4]) diff --git a/Task/Draw-a-cuboid/POV-Ray/draw-a-cuboid.pov-ray b/Task/Draw-a-cuboid/POV-Ray/draw-a-cuboid.pov-ray new file mode 100644 index 0000000000..f38a137256 --- /dev/null +++ b/Task/Draw-a-cuboid/POV-Ray/draw-a-cuboid.pov-ray @@ -0,0 +1,15 @@ +camera { perspective location <2.6,2.2,-4.2> look_at <0,-.5,0> + aperture .05 blur_samples 100 variance 1/100000 focal_point <2,1,-2>} + +light_source{< 60,20,-20> color rgb 2} + +sky_sphere { pigment{ gradient z color_map{[0 rgb 0.3][.1 rgb <.7,.8,1>][1 rgb .2]} }} + +box { <0,0,0> <3,2,4> + texture { + pigment{ agate } + normal { checker } + finish { reflection {0.20 metallic 0.2} } + } + translate <-1,-.5,-2> +} diff --git a/Task/Draw-a-cuboid/Pascal/draw-a-cuboid.pascal b/Task/Draw-a-cuboid/Pascal/draw-a-cuboid.pascal new file mode 100644 index 0000000000..faa05ee49f --- /dev/null +++ b/Task/Draw-a-cuboid/Pascal/draw-a-cuboid.pascal @@ -0,0 +1,69 @@ +program Cuboid_Demo(output); + +procedure DoCuboid(sWidth, sHeight, Depth: integer); + const + widthScale = 4; + heightScale = 3; + type + TPage = array of array of char; + var + Cuboid: TPage; + i, j: integer; + Width, Height: integer; + totalWidth, totalHeight: integer; + begin + Width := widthScale * sWidth; + Height := heightScale * sHeight; + totalWidth := 2 * Width + Depth + 3; + totalHeight := Height + Depth + 3; + setlength (Cuboid, totalHeight + 1); + for i := 1 to totalHeight do + setlength (Cuboid[i], totalwidth + 1); + // points + for i := low(Cuboid) to high(Cuboid) do + for j := low(Cuboid[i]) to high(Cuboid[i]) do + Cuboid[i,j] := ' '; + Cuboid [1, 1] := '+'; + Cuboid [Height + 2, 1] := '+'; + Cuboid [1, 2 * Width + 2] := '+'; + Cuboid [Height + 2, 2 * Width + 2] := '+'; + Cuboid [totalHeight, Depth + 2] := '+'; + Cuboid [Depth + 2, totalWidth] := '+'; + Cuboid [totalHeight, totalWidth] := '+'; + // width lines + for I := 1 to 2 * Width do + begin + Cuboid [1, I + 1] := '-'; + Cuboid [Height + 2, I + 1] := '-'; + Cuboid [totalHeight, Depth + I + 2] := '-'; + end; + // height lines + for I := 1 to Height do + begin + Cuboid [I + 1, 1] := '|'; + Cuboid [I + 1, 2 * Width + 2] := '|'; + Cuboid [Depth + I + 2, totalWidth] := '|'; + end; + // depth lines + for I := 1 to Depth do + begin + Cuboid [Height + 2 + I, 1 + I] := '/'; + Cuboid [1 + I, 2 * Width + 2 + I] := '/'; + Cuboid [Height + 2 + I, 2 * Width + 2 + I] := '/'; + end; + for i := high(Cuboid) downto 1 do + begin + for j := 1 to high(Cuboid[i]) do + write (Cuboid[i,j]); + writeln; + end; + end; + +begin + writeln('1, 1, 1:'); + DoCuboid(1, 1, 1); + writeln('2, 3, 4:'); + DoCuboid(2, 3, 4); + writeln('6, 2, 1:'); + DoCuboid(6, 2, 1); +end. diff --git a/Task/Draw-a-cuboid/Perl-6/draw-a-cuboid.pl6 b/Task/Draw-a-cuboid/Perl-6/draw-a-cuboid.pl6 new file mode 100644 index 0000000000..bdc53af666 --- /dev/null +++ b/Task/Draw-a-cuboid/Perl-6/draw-a-cuboid.pl6 @@ -0,0 +1,44 @@ +sub braille-graphics (%a) { + my ($ylo, $yhi, $xlo, $xhi); + for %a.keys -> $y { + $ylo min= +$y; $yhi max= +$y; + for %a{$y}.keys -> $x { + $xlo min= +$x; $xhi max= +$x; + } + } + + for $ylo, $ylo + 4 ...^ * > $yhi -> \y { + for $xlo, $xlo + 2 ...^ * > $xhi -> \x { + my $cell = 0x2800; + $cell += 1 if %a{y + 0}{x + 0}; + $cell += 2 if %a{y + 1}{x + 0}; + $cell += 4 if %a{y + 2}{x + 0}; + $cell += 8 if %a{y + 0}{x + 1}; + $cell += 16 if %a{y + 1}{x + 1}; + $cell += 32 if %a{y + 2}{x + 1}; + $cell += 64 if %a{y + 3}{x + 0}; + $cell += 128 if %a{y + 3}{x + 1}; + print chr($cell); + } + print "\n"; + } +} + +sub cuboid ( [$x, $y, $z] ) { + my \x = $x * 4; + my \y = $y * 4; + my \z = $z * 2; + my Bool %t; + sub horz ($X, $Y) { %t{$Y }{$X + $_} = True for 0 .. x } + sub vert ($X, $Y) { %t{$Y + $_}{$X } = True for 0 .. y } + sub diag ($X, $Y) { %t{$Y - $_}{$X + $_} = True for 0 .. z } + + horz(0, z); horz(z, 0); horz( 0, z+y); + vert(0, z); vert(x, z); vert(z+x, 0); + diag(0, z); diag(x, z); diag( x, z+y); + + say "[$x, $y, $z]"; + braille-graphics %t; +} + +cuboid $_ for [2,3,4], [3,4,2], [4,2,3], [1,1,1], [8,1,1], [1,8,1], [1,1,8]; diff --git a/Task/Draw-a-cuboid/PureBasic/draw-a-cuboid.purebasic b/Task/Draw-a-cuboid/PureBasic/draw-a-cuboid.purebasic new file mode 100644 index 0000000000..6c3ed338fd --- /dev/null +++ b/Task/Draw-a-cuboid/PureBasic/draw-a-cuboid.purebasic @@ -0,0 +1,66 @@ +Procedure Draw_a_Cuboid(Window, X,Y,Z) + w=WindowWidth(Window) + h=WindowHeight(Window) + diag.f=1.9 + If Not (w And h): ProcedureReturn: EndIf + xscale.f = w/(x+z/diag)*0.98 + yscale.f = h/(y+z/diag)*0.98 + If xscale [ '| ] [ '+ ] if ; +: slice ( n- ) '/ putc @w 2 * spaces '/ putc @d swap - dup spaces ? putc cr ; +: |...|/ ( - ) @h [ '| putc @w 2 * spaces '| putc 1- spaces '/ putc cr ] iterd ; +: face ( - ) + --- @w 1+ spaces '/ putc cr + |...|/ + --- cr ; + +: cuboid ( whd- ) + !d !h !w cr + @d 1+ spaces --- cr + @d [ dup spaces slice ] iterd + face ; + +2 3 4 cuboid diff --git a/Task/Draw-a-cuboid/Retro/draw-a-cuboid-2.retro b/Task/Draw-a-cuboid/Retro/draw-a-cuboid-2.retro new file mode 100644 index 0000000000..4609441bf0 --- /dev/null +++ b/Task/Draw-a-cuboid/Retro/draw-a-cuboid-2.retro @@ -0,0 +1,10 @@ + +----+ + / /| + / / | + / / | + / / + ++----+ / +| | / +| | / +| |/ ++----+ diff --git a/Task/Draw-a-cuboid/XPL0/draw-a-cuboid.xpl0 b/Task/Draw-a-cuboid/XPL0/draw-a-cuboid.xpl0 new file mode 100644 index 0000000000..4af13feb9c --- /dev/null +++ b/Task/Draw-a-cuboid/XPL0/draw-a-cuboid.xpl0 @@ -0,0 +1,30 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +real X, Y, Z, Farthest; \arrays: 3D coordinates of vertices +int I, J, K, SI, Segment; +def Size=50.0, Sz=0.008, Sx=-0.013; \drawing size and tumbling speeds +[X:= [-2.0, +2.0, +2.0, -2.0, -2.0, +2.0, +2.0, -2.0]; + Y:= [-1.5, -1.5, +1.5, +1.5, -1.5, -1.5, +1.5, +1.5]; + Z:= [-1.0, -1.0, -1.0, -1.0, +1.0, +1.0, +1.0, +1.0]; +Segment:= [0,1, 1,2, 2,3, 3,0, 4,5, 5,6, 6,7, 7,4, 0,4, 1,5, 2,6, 3,7]; +SetVid($101); \set 640x480 graphics with 256 colors +repeat Farthest:= 0.0; \find the farthest vertex + for I:= 0 to 8-1 do + if Z(I) > Farthest then [Farthest:= Z(I); SI:= I]; + Clear; \erase screen + for I:= 0 to 2*12-1 do \for all the vertices... + [J:= Segment(I); I:= I+1; \get vertex number + Move(fix(X(J)*Size)+640/2, fix(Y(J)*Size)+480/2); + K:= Segment(I); + Line(fix(X(K)*Size)+640/2, fix(Y(K)*Size)+480/2, + if J=SI ! K=SI then $F009 \dashed blue\ else $C \red\); + ]; + Sound(0, 1, 1); \delay 1/18 second to prevent flicker + for I:= 0 to 8-1 do + [X(I):= X(I) + Y(I)*Sz; \rotate vertices in X-Y plane + Y(I):= Y(I) - X(I)*Sz; + Y(I):= Y(I) + Z(I)*Sx; \rotate vertices in Y-Z plane + Z(I):= Z(I) - Y(I)*Sx; + ]; +until KeyHit; \run until a key is struck +SetVid(3); \restore normal text mode (for DOS) +] diff --git a/Task/Draw-a-sphere/BASIC/draw-a-sphere-1.bas b/Task/Draw-a-sphere/BASIC/draw-a-sphere-1.basic similarity index 100% rename from Task/Draw-a-sphere/BASIC/draw-a-sphere-1.bas rename to Task/Draw-a-sphere/BASIC/draw-a-sphere-1.basic diff --git a/Task/Draw-a-sphere/BASIC/draw-a-sphere-2.bas b/Task/Draw-a-sphere/BASIC/draw-a-sphere-2.basic similarity index 100% rename from Task/Draw-a-sphere/BASIC/draw-a-sphere-2.bas rename to Task/Draw-a-sphere/BASIC/draw-a-sphere-2.basic diff --git a/Task/Draw-a-sphere/Mathematica/draw-a-sphere.mathematica b/Task/Draw-a-sphere/Mathematica/draw-a-sphere.math similarity index 100% rename from Task/Draw-a-sphere/Mathematica/draw-a-sphere.mathematica rename to Task/Draw-a-sphere/Mathematica/draw-a-sphere.math diff --git a/Task/Draw-a-sphere/Openscad/draw-a-sphere.scad b/Task/Draw-a-sphere/Openscad/draw-a-sphere.scad new file mode 100644 index 0000000000..78b877becb --- /dev/null +++ b/Task/Draw-a-sphere/Openscad/draw-a-sphere.scad @@ -0,0 +1,2 @@ +// This will produce a sphere of radius 5 +sphere(5); diff --git a/Task/Draw-a-sphere/POV-Ray/draw-a-sphere.pov-ray b/Task/Draw-a-sphere/POV-Ray/draw-a-sphere.pov-ray new file mode 100644 index 0000000000..7c5120def1 --- /dev/null +++ b/Task/Draw-a-sphere/POV-Ray/draw-a-sphere.pov-ray @@ -0,0 +1,15 @@ +camera { location <0.0 , .8 ,-3.0> look_at 0} + +light_source{< 3,3,-3> color rgb 1} + +sky_sphere { pigment{ gradient <0,1,0> color_map {[0 color rgb <.2,.1,0>][.5 color rgb 1]} scale 2}} + +plane {y,-2 pigment { hexagon color rgb .7 color rgb .5 color rgb .6 }} + +sphere { 0,1 + texture { + pigment{ color rgbft <.8,1,1,.4,.4> } + finish { phong 1 reflection {0.40 metallic 0.5} } + } + interior { ior 1.5} +} diff --git a/Task/Draw-a-sphere/Perl-6/draw-a-sphere.pl6 b/Task/Draw-a-sphere/Perl-6/draw-a-sphere.pl6 new file mode 100644 index 0000000000..66900dcd8f --- /dev/null +++ b/Task/Draw-a-sphere/Perl-6/draw-a-sphere.pl6 @@ -0,0 +1,35 @@ +my $x = my $y = 255; +$x +|= 1; # must be odd + +my @light = normalize([ 3, 2, -5 ]); + +my $depth = 255; + +sub MAIN ($outfile = 'sphere-perl6.pgm') { + my $out = open( $outfile, :w, :bin ) or die "$!\n"; + $out.say("P5\n$x $y\n$depth"); # .pgm header + $out.print( draw_sphere( ($x-1)/2, .9, .2)».chrs ); + $out.close; +} + +sub normalize (@vec) { return @vec »/» ([+] @vec Z* @vec).sqrt } + +sub dot (@x, @y) { return -([+] @x Z* @y) max 0 } + +sub draw_sphere ( $rad, $k, $ambient ) { + my @pixels; + my $r2 = $rad * $rad; + my @range = -$rad .. $rad; + for @range X @range -> $x, $y { + if (my $x2 = $x * $x) + (my $y2 = $y * $y) < $r2 { + my @vector = normalize([$x, $y, ($r2 - $x2 - $y2).sqrt]); + my $intensity = dot(@light, @vector) ** $k + $ambient; + my $pixel = (0 max ($intensity * $depth).Int) min $depth; + @pixels.push($pixel); + } + else { + @pixels.push(0); + } + } + return @pixels; +} diff --git a/Task/Draw-a-sphere/PostScript/draw-a-sphere.ps b/Task/Draw-a-sphere/PostScript/draw-a-sphere.ps new file mode 100644 index 0000000000..349c341731 --- /dev/null +++ b/Task/Draw-a-sphere/PostScript/draw-a-sphere.ps @@ -0,0 +1,23 @@ +%!PS-Adobe-3.0 +%%BoundingBox 0 0 300 300 + +150 150 translate 0 0 130 0 360 arc + +/Pattern setcolorspace +<< /PatternType 2 + /Shading << + /ShadingType 3 + /ColorSpace /DeviceRGB + /Coords [-60 60 0 0 0 100] + /Function << + /FunctionType 2 + /Domain [0 1] + /C0 [1 1 1] + /C1 [0 0 0] + /N 2 + >> + >> +>> matrix makepattern setcolor fill + +showpage +%%EOF diff --git a/Task/Draw-a-sphere/PureBasic/draw-a-sphere.purebasic b/Task/Draw-a-sphere/PureBasic/draw-a-sphere.purebasic new file mode 100644 index 0000000000..62ec5d717d --- /dev/null +++ b/Task/Draw-a-sphere/PureBasic/draw-a-sphere.purebasic @@ -0,0 +1,251 @@ +; Original by Comtois @ 28/03/06 +; +; Updated/Formated by Fluid Byte @ March.24,2009 +; +; http://www.purebasic.fr/english/viewtopic.php?p=281258#p281258 + +Declare CreateSphere(M,P) +Declare UpdateMesh() + +#_SIZEVERT = 36 +#_SIZETRIS = 6 +#FULLSCREEN = 0 + +Structure VECTOR + X.f + Y.f + Z.f +EndStructure + +Structure VERTEX + X.f + Y.f + Z.f + NX.f + NY.f + NZ.f + Color.l + U.f + V.f +EndStructure + +Structure TRIANGLE + V1.w + V2.w + V3.w +EndStructure + +Macro CALC_NORMALS + *PtrV\NX = *PtrV\X + *PtrV\NY = *PtrV\Y + *PtrV\NZ = *PtrV\Z +EndMacro + +Global *VBuffer, *IBuffer +Global Meridian = 50, Parallele = 50, PasLength = 4, Length + +Define EventID, i, NbSommet, CameraMode, Angle.f, Pas.f = 0.5 + +InitEngine3D() : InitSprite() : InitKeyboard() + +Add3DArchive(GetTemporaryDirectory(),#PB_3DArchive_FileSystem) +Add3DArchive(#PB_Compiler_Home + "Examples\Sources\Data\",#PB_3DArchive_FileSystem) + +If #FULLSCREEN + OpenScreen(800,600,32,"Sphere 3D") +Else + OpenWindow(0,0,0,800,600,"Sphere 3D",#PB_Window_SystemMenu | 1) + OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0) +EndIf + +;-Texture +CreateImage(0,128,128) +StartDrawing(ImageOutput(0)) +For i = 0 To 127 Step 4 + Box(0,i,ImageWidth(0),2,RGB(255,255,255)) + Box(0,i + 2,ImageWidth(0),2,RGB(0,0,155)) +Next i +StopDrawing() +SaveImage(0,GetTemporaryDirectory() + "temp.bmp") : FreeImage(0) + +;-Material +CreateMaterial(0,LoadTexture(0,"temp.bmp")) +RotateMaterial(0,0.1,#PB_Material_Animated) + +;-Mesh +CreateSphere(Meridian,Parallele) + +;-Entity +CreateEntity(0,MeshID(0),MaterialID(0)) +ScaleEntity(0,60,60,60) + +;-Camera +CreateCamera(0,0,0,100,100) +MoveCamera(0,0,0,-200) +CameraLookAt(0,EntityX(0),EntityY(0),EntityZ(0)) + +;-Light +AmbientColor(RGB(105, 105, 105)) +CreateLight(0, RGB(255, 255, 55), EntityX(0) + 150, EntityY(0) , EntityZ(0)) +CreateLight(1, RGB( 55, 255, 255), EntityX(0) - 150, EntityY(0) , EntityZ(0)) +CreateLight(2, RGB( 55, 55, 255), EntityX(0) , EntityY(0) + 150, EntityZ(0)) +CreateLight(3, RGB(255, 55, 255), EntityX(0) , EntityY(0) - 150, EntityZ(0)) + +; ---------------------------------------------------------------------------------------------------- +; MAINLOOP +; ---------------------------------------------------------------------------------------------------- + +Repeat + If #FULLSCREEN = 0 + Repeat + EventID = WindowEvent() + + Select EventID + Case #PB_Event_CloseWindow : End + EndSelect + Until EventID = 0 + EndIf + + Angle + Pas + RotateEntity(0, Angle, Angle,Angle) + + If PasLength > 0 : UpdateMesh() : EndIf + + If ExamineKeyboard() + If KeyboardReleased(#PB_Key_F1) + CameraMode = 1 - CameraMode + CameraRenderMode(0, CameraMode) + EndIf + EndIf + + RenderWorld() + FlipBuffers() +Until KeyboardPushed(#PB_Key_Escape) + +; ---------------------------------------------------------------------------------------------------- +; FUNCTIONS +; ---------------------------------------------------------------------------------------------------- + +Procedure CreateSphere(M,P) + ; M = Meridian + ; P = Parallele + ; The radius is 1. Front to remove it later, it's just for the demo. + + If M < 3 Or P < 2 : ProcedureReturn 0 : EndIf + + Protected Normale.VECTOR, NbSommet, i, j, Theta.f, cTheta.f, sTheta.f + Protected Alpha.f, cAlpha.f, sAlpha.f, *PtrV.VERTEX, *PtrF.TRIANGLE, NbTriangle + + NbSommet = 2 + ((M + 1) * P) + *VBuffer = AllocateMemory(#_SIZEVERT * Nbsommet) + + For i = 0 To M + Theta = i * #PI * 2.0 / M + cTheta = Cos(theta) + sTheta = Sin(theta) + + For j = 1 To P + Alpha = j * #PI / (P + 1) + cAlpha = Cos(Alpha) + sAlpha = Sin(Alpha) + *PtrV = *VBuffer + #_SIZEVERT * ((i * P) + (j - 1)) + *PtrV\X = sAlpha * cTheta + *PtrV\Y = sAlpha * sTheta + *PtrV\Z = cAlpha + *PtrV\U = Theta / (2.0 * #PI) + *PtrV\V = Alpha / #PI + CALC_NORMALS + Next j + Next i + + ; Southpole + *PtrV = *VBuffer + #_SIZEVERT * ((M + 1) * P) + *PtrV\X = 0 + *PtrV\Y = 0 + *PtrV\Z = -1 + *PtrV\U = 0 + *PtrV\V = 0 + CALC_NORMALS + + ; Northpole + *PtrV + #_SIZEVERT + *PtrV\X = 0 + *PtrV\Y = 0 + *PtrV\Z = 1 + *PtrV\U = 0 + *PtrV\V = 0 + CALC_NORMALS + + ; Les facettes + NbTriangle = 4 * M * P + *IBuffer = AllocateMemory(#_SIZETRIS * NbTriangle) + *PtrF = *IBuffer + + For i = 0 To M - 1 + For j = 1 To P - 1 + *PtrF\V1 = ((i + 1) * P) + j + *PtrF\V2 = ((i + 1) * P) + (j - 1) + *PtrF\V3 = (i * P) + (j - 1) + *PtrF + #_SIZETRIS + *PtrF\V3 = ((i + 1) * P) + j ;Recto + *PtrF\V2 = ((i + 1) * P) + (j - 1) ;Recto + *PtrF\V1 = (i * P) + (j - 1) ;Recto + *PtrF + #_SIZETRIS + *PtrF\V1 = i * P + j + *PtrF\V2 = ((i + 1) * P) + j + *PtrF\V3 = (i * P) + (j - 1) + *PtrF + #_SIZETRIS + *PtrF\V3 = i * P + j ;Recto + *PtrF\V2 = ((i + 1) * P) + j ;Recto + *PtrF\V1 = (i * P) + (j - 1) ;Recto + *PtrF + #_SIZETRIS + Next j + Next i + + ; The Poles + For i = 0 To M - 1 + *PtrF\V3 = (M + 1) * P + 1 + *PtrF\V2 = (i + 1) * P + *PtrF\V1 = i * P + *PtrF + #_SIZETRIS + *PtrF\V1 = (M + 1) * P + 1 ;Recto + *PtrF\V2 = (i + 1) * P ;Recto + *PtrF\V3 = i * P ;Recto + *PtrF + #_SIZETRIS + Next i + + For i = 0 To M - 1 + *PtrF\V3 = (M + 1) * P + *PtrF\V2 = i * P + (P - 1) + *PtrF\V1 = (i + 1) * P + (P - 1) + *PtrF + #_SIZETRIS + *PtrF\V1 = (M + 1) * P ;Recto + *PtrF\V2 = i * P + (P - 1) ;Recto + *PtrF\V3 = (i + 1) * P + (P - 1) ;Recto + *PtrF + #_SIZETRIS + Next i + + If CreateMesh(0,100) + Protected Flag = #PB_Mesh_Vertex | #PB_Mesh_Normal | #PB_Mesh_UVCoordinate | #PB_Mesh_Color + SetMeshData(0,Flag,*VBuffer,NbSommet) + SetMeshData(0,#PB_Mesh_Face,*IBuffer,NbTriangle) + ProcedureReturn 1 + EndIf + + ProcedureReturn 0 +EndProcedure + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +Procedure UpdateMesh() + Protected NbTriangle = 4 * Meridian * Parallele + + Length + PasLength + + If Length >= NbTriangle + PasLength = 0 + Length = Nbtriangle + EndIf + + SetMeshData(0,#PB_Mesh_Face,*IBuffer,Length) +EndProcedure diff --git a/Task/Draw-a-sphere/Run-BASIC/draw-a-sphere.run b/Task/Draw-a-sphere/Run-BASIC/draw-a-sphere.run new file mode 100644 index 0000000000..9050322206 --- /dev/null +++ b/Task/Draw-a-sphere/Run-BASIC/draw-a-sphere.run @@ -0,0 +1,4 @@ +graphic #g, 300, 300 'create a graphic object +#g place(100,100) 'place the drawing pen at 100,100 +#g circle(75) 'make a circle with radius 75 +render #g 'show it diff --git a/Task/Draw-a-sphere/XPL0/draw-a-sphere.xpl0 b/Task/Draw-a-sphere/XPL0/draw-a-sphere.xpl0 new file mode 100644 index 0000000000..e099108def --- /dev/null +++ b/Task/Draw-a-sphere/XPL0/draw-a-sphere.xpl0 @@ -0,0 +1,18 @@ +include c:\cxpl\codes; \intrinsic 'code' declarations +def R=100, R2=R*R; \radius, in pixels; radius squared +def X0=640/2, Y0=480/2; \coordinates of center of screen +int X, Y, Z, C, D2; \coords, color, distance from center squared +[SetVid($112); \set 640x480x24 graphics mode +for Y:= -R to +R do \for all the coordinates near the circle + for X:= -R to +R do \ which is under the sphere + [D2:= X*X + Y*Y; + C:= 0; \default color is black + if D2 <= R2 then \coordinate is inside circle under sphere + [Z:= sqrt(R2-D2); \height of point on surface of sphere above X,Y + C:= Z-(X+Y)/2+130; \color is proportional; offset X and Y, and + ]; \ shift color to upper limit of its range + Point(X+X0, Y+Y0, C<<8+C); \green + blue = cyan + ]; +repeat until KeyHit; \wait for keystroke +SetVid($03); \restore normal text mode +] diff --git a/Task/Dutch-national-flag-problem/Mathematica/dutch-national-flag-problem.mathematica b/Task/Dutch-national-flag-problem/Mathematica/dutch-national-flag-problem.math similarity index 100% rename from Task/Dutch-national-flag-problem/Mathematica/dutch-national-flag-problem.mathematica rename to Task/Dutch-national-flag-problem/Mathematica/dutch-national-flag-problem.math diff --git a/Task/Dutch-national-flag-problem/PARI-GP/dutch-national-flag-problem.pari b/Task/Dutch-national-flag-problem/PARI-GP/dutch-national-flag-problem.pari new file mode 100644 index 0000000000..880661810b --- /dev/null +++ b/Task/Dutch-national-flag-problem/PARI-GP/dutch-national-flag-problem.pari @@ -0,0 +1,14 @@ +compare(a,b)={ + if (a==b, + 0 + , + if(a=="red" || b=="blue", -1, 1) + ) +}; +r(n)=vector(n,i,if(random(3),if(random(2),"red","white"),"blue")); +inorder(v)=for(i=2,#v,if(compare(v[i-1],v[i])>0,return(0)));1; + +v=r(10); +while(inorder(v), v=r(10)); +v=vecsort(v,compare); +inorder(v) diff --git a/Task/Dutch-national-flag-problem/Perl-6/dutch-national-flag-problem.pl6 b/Task/Dutch-national-flag-problem/Perl-6/dutch-national-flag-problem.pl6 new file mode 100644 index 0000000000..2ef861b1d3 --- /dev/null +++ b/Task/Dutch-national-flag-problem/Perl-6/dutch-national-flag-problem.pl6 @@ -0,0 +1,30 @@ +enum NL ; +my @colors; + +sub how'bout (&this-way) { + sub show { + say @colors; + say "Ordered: ", [<=] @colors; + } + + @colors = NL.roll(20); + show; + this-way; + show; + say ''; +} + +say "Using functional sort"; +how'bout { @colors = sort *.value, @colors } + +say "Using in-place sort"; +how'bout { @colors .= sort: *.value } + +say "Using a Bag"; +how'bout { @colors = red, white, blue Zxx bag(@colors».key) } + +say "Using the classify method"; +how'bout { @colors = (.list for %(@colors.classify: *.value){0,1,2}) } + +say "Using multiple greps"; +how'bout { @colors = (.grep(red), .grep(white), .grep(blue) given @colors) } diff --git a/Task/Dutch-national-flag-problem/UNIX-Shell/dutch-national-flag-problem-1.sh b/Task/Dutch-national-flag-problem/UNIX-Shell/dutch-national-flag-problem-1.sh new file mode 100644 index 0000000000..e879ce7a0c --- /dev/null +++ b/Task/Dutch-national-flag-problem/UNIX-Shell/dutch-national-flag-problem-1.sh @@ -0,0 +1,58 @@ +COLORS=(red white blue) + +# to go from name to number, we make variables out of the color names (e.g. the +# variable "$red" has value "1"). +for (( i=0; i<${#COLORS[@]}; ++i )); do + eval ${COLORS[i]}=$i +done + +# Make a random list +function random_balls { + local -i n="$1" + local -i i + local balls=() + for (( i=0; i < n; ++i )); do + balls+=("${COLORS[RANDOM%${#COLORS[@]}]}") + done + echo "${balls[@]}" +} + +# Test for Dutchness +function dutch? { + if (( $# < 2 )); then + return 0 + else + local first="$1" + shift + if eval "(( $first > $1 ))"; then + return 1 + else + dutch? "$@" + fi + fi +} + +# Sort into order +function dutch { + local -i lo=-1 hi=$# i=0 + local a=("$@") + while (( i < hi )); do + case "${a[i]}" in + red) + let lo+=1 + local t="${a[lo]}" + a[lo]="${a[i]}" + a[i]="$t" + let i+=1 + ;; + white) let i+=1;; + blue) + let hi-=1 + local t="${a[hi]}" + a[hi]="${a[i]}" + a[i]="$t" + ;; + esac + done + echo "${a[@]}" +} diff --git a/Task/Dutch-national-flag-problem/UNIX-Shell/dutch-national-flag-problem-2.sh b/Task/Dutch-national-flag-problem/UNIX-Shell/dutch-national-flag-problem-2.sh new file mode 100644 index 0000000000..93bcb415a2 --- /dev/null +++ b/Task/Dutch-national-flag-problem/UNIX-Shell/dutch-national-flag-problem-2.sh @@ -0,0 +1,8 @@ +declare -i len=${1:-10} +balls=() +while (( ${#balls[@]} < len )) || dutch? "${balls[@]}"; do + balls=($(random_balls "$len")) +done +echo "Initial list: ${balls[@]}" +balls=($(dutch "${balls[@]}")) +echo "Sorted: ${balls[@]}" diff --git a/Task/Dynamic-variable-names/BASIC/dynamic-variable-names.bas b/Task/Dynamic-variable-names/BASIC/dynamic-variable-names.basic similarity index 100% rename from Task/Dynamic-variable-names/BASIC/dynamic-variable-names.bas rename to Task/Dynamic-variable-names/BASIC/dynamic-variable-names.basic diff --git a/Task/Dynamic-variable-names/Mathematica/dynamic-variable-names.mathematica b/Task/Dynamic-variable-names/Mathematica/dynamic-variable-names.math similarity index 100% rename from Task/Dynamic-variable-names/Mathematica/dynamic-variable-names.mathematica rename to Task/Dynamic-variable-names/Mathematica/dynamic-variable-names.math diff --git a/Task/Dynamic-variable-names/Octave/dynamic-variable-names.octave b/Task/Dynamic-variable-names/Octave/dynamic-variable-names.octave new file mode 100644 index 0000000000..1b53139bd6 --- /dev/null +++ b/Task/Dynamic-variable-names/Octave/dynamic-variable-names.octave @@ -0,0 +1,3 @@ +varname = input ("Enter variable name: ", "s"); +value = input ("Enter value: ", "s"); +eval([varname,"=",value]); diff --git a/Task/Dynamic-variable-names/PARI-GP/dynamic-variable-names.pari b/Task/Dynamic-variable-names/PARI-GP/dynamic-variable-names.pari new file mode 100644 index 0000000000..84fcc5fd92 --- /dev/null +++ b/Task/Dynamic-variable-names/PARI-GP/dynamic-variable-names.pari @@ -0,0 +1 @@ +eval(Str(input(), "=34")) diff --git a/Task/Dynamic-variable-names/Perl-6/dynamic-variable-names.pl6 b/Task/Dynamic-variable-names/Perl-6/dynamic-variable-names.pl6 new file mode 100644 index 0000000000..0e892a5cd0 --- /dev/null +++ b/Task/Dynamic-variable-names/Perl-6/dynamic-variable-names.pl6 @@ -0,0 +1,3 @@ +my $vname = prompt 'Variable name: '; +$GLOBAL::($vname) = 42; +say $GLOBAL::($vname); diff --git a/Task/Dynamic-variable-names/PowerShell/dynamic-variable-names.psh b/Task/Dynamic-variable-names/PowerShell/dynamic-variable-names.psh new file mode 100644 index 0000000000..459c364c03 --- /dev/null +++ b/Task/Dynamic-variable-names/PowerShell/dynamic-variable-names.psh @@ -0,0 +1,3 @@ +$variableName = Read-Host +New-Variable $variableName 'Foo' +Get-Variable $variableName diff --git a/Task/Dynamic-variable-names/ProDOS/dynamic-variable-names.dos b/Task/Dynamic-variable-names/ProDOS/dynamic-variable-names.dos new file mode 100644 index 0000000000..d84b5d3628 --- /dev/null +++ b/Task/Dynamic-variable-names/ProDOS/dynamic-variable-names.dos @@ -0,0 +1,3 @@ +editvar /newvar /value=a /userinput=1 /title=Enter a variable name: +editvar /newvar /value=b /userinput=1 /title=Enter a variable title: +editvar /newvar /value=-a- /title=-b- diff --git a/Task/Dynamic-variable-names/REBOL/dynamic-variable-names.rebol b/Task/Dynamic-variable-names/REBOL/dynamic-variable-names.rebol new file mode 100644 index 0000000000..bb16bf73dd --- /dev/null +++ b/Task/Dynamic-variable-names/REBOL/dynamic-variable-names.rebol @@ -0,0 +1,16 @@ +REBOL [ + Title: "Dynamic Variable Name" + Author: oofoe + Date: 2009-12-28 + URL: http://rosettacode.org/wiki/Dynamic_variable_names +] + +; Here, I ask the user for a name, then convert it to a word and +; assign the value "Hello!" to it. To read this phrase, realize that +; REBOL collects terms from right to left, so "Hello!" is stored for +; future use, then the prompt string "Variable name? " is used as the +; argument to ask (prompts user for input). The result of ask is +; converted to a word so it can be an identifier, then the 'set' word +; accepts the new word and the string ("Hello!") to be assigned. + +set to-word ask "Variable name? " "Hello!" diff --git a/Task/Dynamic-variable-names/RLaB/dynamic-variable-names.rlab b/Task/Dynamic-variable-names/RLaB/dynamic-variable-names.rlab new file mode 100644 index 0000000000..b1e5666d32 --- /dev/null +++ b/Task/Dynamic-variable-names/RLaB/dynamic-variable-names.rlab @@ -0,0 +1,5 @@ +>> s = "myusername" +myusername +>> $$.[s] = 10; +>> myusername + 10 diff --git a/Task/Dynamic-variable-names/Retro/dynamic-variable-names-1.retro b/Task/Dynamic-variable-names/Retro/dynamic-variable-names-1.retro new file mode 100644 index 0000000000..72b289a348 --- /dev/null +++ b/Task/Dynamic-variable-names/Retro/dynamic-variable-names-1.retro @@ -0,0 +1,4 @@ +: newVariable: ( "- ) + getToken header 0 , ; + +newVariable: foo diff --git a/Task/Dynamic-variable-names/Retro/dynamic-variable-names-2.retro b/Task/Dynamic-variable-names/Retro/dynamic-variable-names-2.retro new file mode 100644 index 0000000000..dfd4be9dd6 --- /dev/null +++ b/Task/Dynamic-variable-names/Retro/dynamic-variable-names-2.retro @@ -0,0 +1,4 @@ +: newVariable: ( "- ) + create 0 , ; + +newVariable: foo diff --git a/Task/Dynamic-variable-names/SNOBOL4/dynamic-variable-names.sno b/Task/Dynamic-variable-names/SNOBOL4/dynamic-variable-names.sno new file mode 100644 index 0000000000..609164d3c4 --- /dev/null +++ b/Task/Dynamic-variable-names/SNOBOL4/dynamic-variable-names.sno @@ -0,0 +1,11 @@ +* # Get var name from user + output = 'Enter variable name:' + invar = trim(input) + +* # Get value from user, assign + output = 'Enter value:' + $invar = trim(input) + +* Display + output = invar ' == ' $invar +end diff --git a/Task/Dynamic-variable-names/Slate/dynamic-variable-names.slate b/Task/Dynamic-variable-names/Slate/dynamic-variable-names.slate new file mode 100644 index 0000000000..918d1be64b --- /dev/null +++ b/Task/Dynamic-variable-names/Slate/dynamic-variable-names.slate @@ -0,0 +1,3 @@ +define: #name -> (query: 'Enter a variable name: ') intern. "X" +define: name -> 42. +X print. diff --git a/Task/Dynamic-variable-names/TI-89-BASIC/dynamic-variable-names.ti-89 b/Task/Dynamic-variable-names/TI-89-BASIC/dynamic-variable-names.ti-89 new file mode 100644 index 0000000000..e1f24fd69c --- /dev/null +++ b/Task/Dynamic-variable-names/TI-89-BASIC/dynamic-variable-names.ti-89 @@ -0,0 +1,4 @@ +Local varName,value +InputStr "Variable name", varName +Prompt value +value → #varName diff --git a/Task/Dynamic-variable-names/TUSCRIPT/dynamic-variable-names.tuscript b/Task/Dynamic-variable-names/TUSCRIPT/dynamic-variable-names.tuscript new file mode 100644 index 0000000000..9d69c2c196 --- /dev/null +++ b/Task/Dynamic-variable-names/TUSCRIPT/dynamic-variable-names.tuscript @@ -0,0 +1,6 @@ +$$ MODE TUSCRIPT +ASK "Enter variablename": name="" +ASK "Enter value": value="" +TRACE +@name +@name=$value +PRINT @name diff --git a/Task/Echo-server/CoffeeScript/echo-server.coffee b/Task/Echo-server/CoffeeScript/echo-server.coffeescript similarity index 100% rename from Task/Echo-server/CoffeeScript/echo-server.coffee rename to Task/Echo-server/CoffeeScript/echo-server.coffeescript diff --git a/Task/Echo-server/Objeck/echo-server.objeck b/Task/Echo-server/Objeck/echo-server.objeck new file mode 100644 index 0000000000..7a34f95c63 --- /dev/null +++ b/Task/Echo-server/Objeck/echo-server.objeck @@ -0,0 +1,36 @@ +use Net; +use Concurrency; + +bundle Default { + class SocketServer { + id : static : Int; + + function : Main(args : String[]) ~ Nil { + server := TCPSocketServer->New(12321); + if(server->Listen(5)) { + while(true) { + client := server->Accept(); + service := Service->New(id->ToString()); + service->Execute(client); + id += 1; + }; + }; + server->Close(); + } + } + + class Service from Thread { + New(name : String) { + Parent(name); + } + + method : public : Run(param : Base) ~ Nil { + client := param->As(TCPSocket); + line := client->ReadString(); + while(line->Size() > 0) { + line->PrintLine(); + line := client->ReadString(); + }; + } + } +} diff --git a/Task/Echo-server/Oz/echo-server-1.oz b/Task/Echo-server/Oz/echo-server-1.oz new file mode 100644 index 0000000000..d43a76ce52 --- /dev/null +++ b/Task/Echo-server/Oz/echo-server-1.oz @@ -0,0 +1,36 @@ +declare + ServerSocket = {New Open.socket init} + + proc {Echo Socket} + case {Socket getS($)} of false then skip + [] Line then + {System.showInfo "Received line: "#Line} + {Socket write(vs:Line#"\n")} + {Echo Socket} + end + end + + class TextSocket from Open.socket Open.text end +in + {ServerSocket bind(takePort:12321)} + {System.showInfo "Socket bound."} + + {ServerSocket listen} + {System.showInfo "Started listening."} + + for do + ClientHost ClientPort + ClientSocket = {ServerSocket accept(accepted:$ + acceptClass:TextSocket + host:?ClientHost + port:?ClientPort + )} + in + {System.showInfo "Connection accepted from "#ClientHost#":"#ClientPort#"."} + thread + {Echo ClientSocket} + + {System.showInfo "Connection lost: "#ClientHost#":"#ClientPort#"."} + {ClientSocket close} + end + end diff --git a/Task/Echo-server/Oz/echo-server-2.oz b/Task/Echo-server/Oz/echo-server-2.oz new file mode 100644 index 0000000000..9e44b8ca0c --- /dev/null +++ b/Task/Echo-server/Oz/echo-server-2.oz @@ -0,0 +1,7 @@ +declare + Socket = {New class $ from Open.socket Open.text end init} +in + {Socket connect(port:12321)} + {Socket write(vs:"Hello\n")} + {System.showInfo "Client received: "#{Socket getS($)}} + {Socket close} diff --git a/Task/Echo-server/Perl-6/echo-server.pl6 b/Task/Echo-server/Perl-6/echo-server.pl6 new file mode 100644 index 0000000000..56dbfb4e03 --- /dev/null +++ b/Task/Echo-server/Perl-6/echo-server.pl6 @@ -0,0 +1,15 @@ +my $socket = IO::Socket::INET.new: + localhost => 'localhost', + localport => 12321, + listen => 1; + +while $socket.accept -> $conn { + say "Accepted connection"; + async { + while $conn.recv -> $stuff { + say "Echoing $stuff"; + $conn.send($stuff); + } + $conn.close; + } +} diff --git a/Task/Echo-server/PureBasic/echo-server.purebasic b/Task/Echo-server/PureBasic/echo-server.purebasic new file mode 100644 index 0000000000..81a7210a7a --- /dev/null +++ b/Task/Echo-server/PureBasic/echo-server.purebasic @@ -0,0 +1,31 @@ +NewMap RecData.s() +OpenWindow(0, 100, 200, 200, 100, "Echo Server", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget ) +InitNetwork() +CreateNetworkServer(1, 12321) + +Repeat + Event = NetworkServerEvent() + ClientID = EventClient() + + If Event = #PB_NetworkEvent_Connect ; When a new client has been connected... + AddMapElement(RecData(), Str(ClientID)) + + ElseIf Event = #PB_NetworkEvent_Data + *Buffer = AllocateMemory(20000) + count = ReceiveNetworkData(ClientID, *Buffer, 20000) + For i = 1 To count + RecData(Str(ClientID)) + Mid( PeekS(*Buffer, count), i , 1) + If Right( RecData(Str(ClientID)), 2) = #CRLF$ + SendNetworkString (ClientID, RecData(Str(ClientID))) + Debug IPString(GetClientIP(ClientID)) + ":" + Str(GetClientPort(ClientID)) + " " + RecData(Str(ClientID)) + RecData(Str(ClientID)) = "" + EndIf + Next + FreeMemory(*Buffer) + + ElseIf Event = #PB_NetworkEvent_Disconnect ; When a client has closed the connection... + DeleteMapElement(RecData(), Str(ClientID)) + EndIf + + Event = WaitWindowEvent(10) +Until Event = #PB_Event_CloseWindow diff --git a/Task/Echo-server/REBOL/echo-server.rebol b/Task/Echo-server/REBOL/echo-server.rebol new file mode 100644 index 0000000000..c7dc9c8143 --- /dev/null +++ b/Task/Echo-server/REBOL/echo-server.rebol @@ -0,0 +1,10 @@ +server-port: open/lines tcp://:12321 +forever [ + connection-port: first server-port + until [ + wait connection-port + error? try [insert connection-port first connection-port] + ] + close connection-port +] +close server-port diff --git a/Task/Element-wise-operations/Mathematica/element-wise-operations.mathematica b/Task/Element-wise-operations/Mathematica/element-wise-operations.math similarity index 100% rename from Task/Element-wise-operations/Mathematica/element-wise-operations.mathematica rename to Task/Element-wise-operations/Mathematica/element-wise-operations.math diff --git a/Task/Element-wise-operations/PARI-GP/element-wise-operations-1.pari b/Task/Element-wise-operations/PARI-GP/element-wise-operations-1.pari new file mode 100644 index 0000000000..4d3e45d867 --- /dev/null +++ b/Task/Element-wise-operations/PARI-GP/element-wise-operations-1.pari @@ -0,0 +1,3 @@ +multMM(A,B)=matrix(#A[,1],#A,i,j,A[i,j]*B[i,j]); +divMM(A,B)=matrix(#A[,1],#A,i,j,A[i,j]/B[i,j]); +powMM(A,B)=matrix(#A[,1],#A,i,j,A[i,j]^B[i,j]); diff --git a/Task/Element-wise-operations/PARI-GP/element-wise-operations-2.pari b/Task/Element-wise-operations/PARI-GP/element-wise-operations-2.pari new file mode 100644 index 0000000000..baa5be156d --- /dev/null +++ b/Task/Element-wise-operations/PARI-GP/element-wise-operations-2.pari @@ -0,0 +1,3 @@ +addMs(A,s)=A+matrix(#A[,1],#A,i,j,s); +subMs(A,s)=A-matrix(#A[,1],#A,i,j,s); +powMs(A,s)=matrix(#A[,1],#A,i,j,A[i,j]^s); diff --git a/Task/Element-wise-operations/PL-I/element-wise-operations.pli b/Task/Element-wise-operations/PL-I/element-wise-operations.pli new file mode 100644 index 0000000000..9c1024ff10 --- /dev/null +++ b/Task/Element-wise-operations/PL-I/element-wise-operations.pli @@ -0,0 +1,9 @@ +declare (matrix(3,3), vector(3), scalar) fixed; +declare (m(3,3), v(3) fixed; + +m = scalar * matrix; +m = vector * matrix; +m = matrix * matrix; + +v = scalar * vector; +v = vector * vector; diff --git a/Task/Element-wise-operations/Perl-6/element-wise-operations.pl6 b/Task/Element-wise-operations/Perl-6/element-wise-operations.pl6 new file mode 100644 index 0000000000..4300da9473 --- /dev/null +++ b/Task/Element-wise-operations/Perl-6/element-wise-operations.pl6 @@ -0,0 +1,22 @@ +my @a = + [1,2,3], + [4,5,6], + [7,8,9]; + +sub msay(@x) { + .perl.say for @x; + say ''; +} + +msay @a «+» @a; +msay @a «-» @a; +msay @a «*» @a; +msay @a «/» @a; +msay @a «+» [1,2,3]; +msay @a «-» [1,2,3]; +msay @a «*» [1,2,3]; +msay @a «/» [1,2,3]; +msay @a «+» 2; +msay @a «-» 2; +msay @a «*» 2; +msay @a «/» 2; diff --git a/Task/Empty-directory/CoffeeScript/empty-directory.coffee b/Task/Empty-directory/CoffeeScript/empty-directory.coffeescript similarity index 100% rename from Task/Empty-directory/CoffeeScript/empty-directory.coffee rename to Task/Empty-directory/CoffeeScript/empty-directory.coffeescript diff --git a/Task/Empty-directory/Mathematica/empty-directory.mathematica b/Task/Empty-directory/Mathematica/empty-directory.math similarity index 100% rename from Task/Empty-directory/Mathematica/empty-directory.mathematica rename to Task/Empty-directory/Mathematica/empty-directory.math diff --git a/Task/Empty-directory/OCaml/empty-directory.ocaml b/Task/Empty-directory/OCaml/empty-directory.ocaml new file mode 100644 index 0000000000..fda234416a --- /dev/null +++ b/Task/Empty-directory/OCaml/empty-directory.ocaml @@ -0,0 +1,2 @@ +let is_dir_empty d = + Sys.readdir d = [| |] diff --git a/Task/Empty-directory/Perl-6/empty-directory.pl6 b/Task/Empty-directory/Perl-6/empty-directory.pl6 new file mode 100644 index 0000000000..8574c91283 --- /dev/null +++ b/Task/Empty-directory/Perl-6/empty-directory.pl6 @@ -0,0 +1 @@ +sub dir-is-empty ($d) { not dir $d } diff --git a/Task/Empty-directory/PureBasic/empty-directory.purebasic b/Task/Empty-directory/PureBasic/empty-directory.purebasic new file mode 100644 index 0000000000..c696ecaf58 --- /dev/null +++ b/Task/Empty-directory/PureBasic/empty-directory.purebasic @@ -0,0 +1,29 @@ +Procedure isDirEmpty(path$) + If Right(path$, 1) <> "\": path$ + "\": EndIf + Protected dirID = ExamineDirectory(#PB_Any, path$, "*.*") + Protected result + + If dirID + result = 1 + While NextDirectoryEntry(dirID) + If DirectoryEntryType(dirID) = #PB_DirectoryEntry_File Or (DirectoryEntryName(dirID) <> "." And DirectoryEntryName(dirID) <> "..") + result = 0 + Break + EndIf + Wend + FinishDirectory(dirID) + EndIf + ProcedureReturn result +EndProcedure + +Define path$, result$ + +path$ = PathRequester("Choose a path", "C:\") +If path$ + If isDirEmpty(path$) + result$ = " is empty." + Else + result$ = " is not empty." + EndIf + MessageRequester("Empty directory test", #DQUOTE$ + path$ + #DQUOTE$ + result$) +EndIf diff --git a/Task/Empty-directory/Run-BASIC/empty-directory.run b/Task/Empty-directory/Run-BASIC/empty-directory.run new file mode 100644 index 0000000000..ef39b10bc0 --- /dev/null +++ b/Task/Empty-directory/Run-BASIC/empty-directory.run @@ -0,0 +1,4 @@ +files #f, DefaultDir$ + "\*.*" ' open some directory. + +print "hasanswer: ";#f HASANSWER() ' if it has an answer it is not MT +print "rowcount: ";#f ROWCOUNT() ' if not MT, how many files? diff --git a/Task/Empty-directory/Seed7/empty-directory.seed7 b/Task/Empty-directory/Seed7/empty-directory.seed7 new file mode 100644 index 0000000000..b9c6161b55 --- /dev/null +++ b/Task/Empty-directory/Seed7/empty-directory.seed7 @@ -0,0 +1,10 @@ +$ include "seed7_05.s7i"; + include "osfiles.s7i"; + +const func boolean: dirEmpty (in string: dirName) is + return fileType(dirName) = FILE_DIR and length(readDir(dirName)) = 0; + +const proc: main is func + begin + writeln(dirEmpty("somedir")); + end func; diff --git a/Task/Empty-directory/UNIX-Shell/empty-directory.sh b/Task/Empty-directory/UNIX-Shell/empty-directory.sh new file mode 100644 index 0000000000..99c5b5d778 --- /dev/null +++ b/Task/Empty-directory/UNIX-Shell/empty-directory.sh @@ -0,0 +1,3 @@ +#!/bin/sh +DIR=/tmp/foo +[ `ls -a $DIR|wc -l` -gt 2 ] && echo $DIR is NOT empty || echo $DIR is empty diff --git a/Task/Empty-program/BASIC/empty-program-1.bas b/Task/Empty-program/BASIC/empty-program-1.basic similarity index 100% rename from Task/Empty-program/BASIC/empty-program-1.bas rename to Task/Empty-program/BASIC/empty-program-1.basic diff --git a/Task/Empty-program/BASIC/empty-program-2.bas b/Task/Empty-program/BASIC/empty-program-2.basic similarity index 100% rename from Task/Empty-program/BASIC/empty-program-2.bas rename to Task/Empty-program/BASIC/empty-program-2.basic diff --git a/Task/Empty-program/Lisp/empty-program.lisp b/Task/Empty-program/CoffeeScript/empty-program.coffeescript similarity index 100% rename from Task/Empty-program/Lisp/empty-program.lisp rename to Task/Empty-program/CoffeeScript/empty-program.coffeescript diff --git a/Task/Empty-program/KonsolScript/empty-program.konso b/Task/Empty-program/KonsolScript/empty-program.konsolscript similarity index 100% rename from Task/Empty-program/KonsolScript/empty-program.konso rename to Task/Empty-program/KonsolScript/empty-program.konsolscript diff --git a/Task/Empty-program/Lilypond/empty-program-1.lilypond b/Task/Empty-program/Lilypond/empty-program-1.lily similarity index 100% rename from Task/Empty-program/Lilypond/empty-program-1.lilypond rename to Task/Empty-program/Lilypond/empty-program-1.lily diff --git a/Task/Empty-program/Lilypond/empty-program-2.lilypond b/Task/Empty-program/Lilypond/empty-program-2.lily similarity index 100% rename from Task/Empty-program/Lilypond/empty-program-2.lilypond rename to Task/Empty-program/Lilypond/empty-program-2.lily diff --git a/Task/Empty-program/Mathematica/empty-program.mathematica b/Task/Empty-program/Lisp/empty-program.l similarity index 100% rename from Task/Empty-program/Mathematica/empty-program.mathematica rename to Task/Empty-program/Lisp/empty-program.l diff --git a/Task/Empty-program/Mathematica/empty-program.math b/Task/Empty-program/Mathematica/empty-program.math new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/Nemerle/empty-program-1.nemerle b/Task/Empty-program/Nemerle/empty-program-1.nemerle new file mode 100644 index 0000000000..19765bd501 --- /dev/null +++ b/Task/Empty-program/Nemerle/empty-program-1.nemerle @@ -0,0 +1 @@ +null diff --git a/Task/Empty-program/Nemerle/empty-program-2.nemerle b/Task/Empty-program/Nemerle/empty-program-2.nemerle new file mode 100644 index 0000000000..e0896f3b9f --- /dev/null +++ b/Task/Empty-program/Nemerle/empty-program-2.nemerle @@ -0,0 +1,6 @@ +module Program +{ + Main() : void + { + } +} diff --git a/Task/Empty-program/NetRexx/empty-program-1.netrexx b/Task/Empty-program/NetRexx/empty-program-1.netrexx new file mode 100644 index 0000000000..a3ae068117 --- /dev/null +++ b/Task/Empty-program/NetRexx/empty-program-1.netrexx @@ -0,0 +1 @@ +class empty diff --git a/Task/Empty-program/NetRexx/empty-program-2.netrexx b/Task/Empty-program/NetRexx/empty-program-2.netrexx new file mode 100644 index 0000000000..fb1a024f8d --- /dev/null +++ b/Task/Empty-program/NetRexx/empty-program-2.netrexx @@ -0,0 +1 @@ +method main(args = String[]) static diff --git a/Task/Empty-program/NewLISP/empty-program.newlisp b/Task/Empty-program/NewLISP/empty-program.newlisp new file mode 100644 index 0000000000..092bc2b041 --- /dev/null +++ b/Task/Empty-program/NewLISP/empty-program.newlisp @@ -0,0 +1 @@ +; diff --git a/Task/Empty-program/OCaml/empty-program.ocaml b/Task/Empty-program/OCaml/empty-program.ocaml new file mode 100644 index 0000000000..33fbefc934 --- /dev/null +++ b/Task/Empty-program/OCaml/empty-program.ocaml @@ -0,0 +1 @@ +;; diff --git a/Task/Empty-program/Objeck/empty-program.objeck b/Task/Empty-program/Objeck/empty-program.objeck new file mode 100644 index 0000000000..9dee10fd95 --- /dev/null +++ b/Task/Empty-program/Objeck/empty-program.objeck @@ -0,0 +1,5 @@ +bundle Default { + class Empty { + function : Main(args : String[]) ~ Nil { + } +} diff --git a/Task/Empty-program/Objective-C/empty-program-1.m b/Task/Empty-program/Objective-C/empty-program-1.m new file mode 100644 index 0000000000..231a72bde3 --- /dev/null +++ b/Task/Empty-program/Objective-C/empty-program-1.m @@ -0,0 +1,3 @@ +int main(int argc, const char **argv) { + return 0; +} diff --git a/Task/Empty-program/Objective-C/empty-program-2.m b/Task/Empty-program/Objective-C/empty-program-2.m new file mode 100644 index 0000000000..a874b81c9f --- /dev/null +++ b/Task/Empty-program/Objective-C/empty-program-2.m @@ -0,0 +1,12 @@ +#import + +int main( int argc, const char *argv[] ) +{ + NSAutoreleasePool *pool; + + pool = [[NSAutoreleasePool alloc] init]; + NSApp = [NSApplication sharedApplication]; + + [pool release]; + return 0; +} diff --git a/Task/Empty-program/OxygenBasic/empty-program.oxy b/Task/Empty-program/OxygenBasic/empty-program.oxy new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/Oz/empty-program-1.oz b/Task/Empty-program/Oz/empty-program-1.oz new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/Oz/empty-program-2.oz b/Task/Empty-program/Oz/empty-program-2.oz new file mode 100644 index 0000000000..47b23a20fc --- /dev/null +++ b/Task/Empty-program/Oz/empty-program-2.oz @@ -0,0 +1 @@ +unit diff --git a/Task/Empty-program/Oz/empty-program-3.oz b/Task/Empty-program/Oz/empty-program-3.oz new file mode 100644 index 0000000000..ea82901629 --- /dev/null +++ b/Task/Empty-program/Oz/empty-program-3.oz @@ -0,0 +1,4 @@ +functor +define + skip +end diff --git a/Task/Empty-program/PARI-GP/empty-program.pari b/Task/Empty-program/PARI-GP/empty-program.pari new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/PL-I/empty-program.pli b/Task/Empty-program/PL-I/empty-program.pli new file mode 100644 index 0000000000..50d308744a --- /dev/null +++ b/Task/Empty-program/PL-I/empty-program.pli @@ -0,0 +1,2 @@ +s: proc options (main); +end; diff --git a/Task/Empty-program/PL-SQL/empty-program.sql b/Task/Empty-program/PL-SQL/empty-program.sql new file mode 100644 index 0000000000..3dd6591a7e --- /dev/null +++ b/Task/Empty-program/PL-SQL/empty-program.sql @@ -0,0 +1,3 @@ +BEGIN + NULL; +END; diff --git a/Task/Empty-program/PSQL/empty-program.psql b/Task/Empty-program/PSQL/empty-program.psql new file mode 100644 index 0000000000..e5a6076e76 --- /dev/null +++ b/Task/Empty-program/PSQL/empty-program.psql @@ -0,0 +1,4 @@ +EXECUTE BLOCK +AS +BEGIN +END diff --git a/Task/Empty-program/Pascal/empty-program-1.pascal b/Task/Empty-program/Pascal/empty-program-1.pascal new file mode 100644 index 0000000000..fec342d345 --- /dev/null +++ b/Task/Empty-program/Pascal/empty-program-1.pascal @@ -0,0 +1,4 @@ +program ProgramName; + +begin +end. diff --git a/Task/Empty-program/Pascal/empty-program-2.pascal b/Task/Empty-program/Pascal/empty-program-2.pascal new file mode 100644 index 0000000000..e27f1f2ec2 --- /dev/null +++ b/Task/Empty-program/Pascal/empty-program-2.pascal @@ -0,0 +1 @@ +begin end. diff --git a/Task/Empty-program/Perl-6/empty-program-1.pl6 b/Task/Empty-program/Perl-6/empty-program-1.pl6 new file mode 100644 index 0000000000..96a23abc8a --- /dev/null +++ b/Task/Empty-program/Perl-6/empty-program-1.pl6 @@ -0,0 +1 @@ +use v6; diff --git a/Task/Empty-program/Perl-6/empty-program-2.pl6 b/Task/Empty-program/Perl-6/empty-program-2.pl6 new file mode 100644 index 0000000000..f24da357ac --- /dev/null +++ b/Task/Empty-program/Perl-6/empty-program-2.pl6 @@ -0,0 +1 @@ +v6; diff --git a/Task/Empty-program/Perl-6/empty-program-3.pl6 b/Task/Empty-program/Perl-6/empty-program-3.pl6 new file mode 100644 index 0000000000..f75e10d7ce --- /dev/null +++ b/Task/Empty-program/Perl-6/empty-program-3.pl6 @@ -0,0 +1 @@ +6; diff --git a/Task/Empty-program/Pike/empty-program.pike b/Task/Empty-program/Pike/empty-program.pike new file mode 100644 index 0000000000..979a1cd784 --- /dev/null +++ b/Task/Empty-program/Pike/empty-program.pike @@ -0,0 +1 @@ +int main(){} diff --git a/Task/Empty-program/Pop11/empty-program-1.pop11 b/Task/Empty-program/Pop11/empty-program-1.pop11 new file mode 100644 index 0000000000..b429a0034c --- /dev/null +++ b/Task/Empty-program/Pop11/empty-program-1.pop11 @@ -0,0 +1 @@ +;;; This is a valid Pop11 program that does absolutely nothing. diff --git a/Task/Empty-program/Pop11/empty-program-2.pop11 b/Task/Empty-program/Pop11/empty-program-2.pop11 new file mode 100644 index 0000000000..30540fbcef --- /dev/null +++ b/Task/Empty-program/Pop11/empty-program-2.pop11 @@ -0,0 +1,6 @@ +compile_mode :pop11 +strict; +define entry_point(); +enddefine; + +#_TERMIN_IF DEF POPC_COMPILING +entry_point(); diff --git a/Task/Empty-program/PostScript/empty-program-1.ps b/Task/Empty-program/PostScript/empty-program-1.ps new file mode 100644 index 0000000000..8b8dd3e124 --- /dev/null +++ b/Task/Empty-program/PostScript/empty-program-1.ps @@ -0,0 +1 @@ +%!PS diff --git a/Task/Empty-program/PostScript/empty-program-2.ps b/Task/Empty-program/PostScript/empty-program-2.ps new file mode 100644 index 0000000000..a8c826331f --- /dev/null +++ b/Task/Empty-program/PostScript/empty-program-2.ps @@ -0,0 +1,4 @@ +%!PS-2.0 +% ...or... +%!PS-3.0 +% etc diff --git a/Task/Empty-program/ProDOS/empty-program-1.dos b/Task/Empty-program/ProDOS/empty-program-1.dos new file mode 100644 index 0000000000..e7b2324fdc --- /dev/null +++ b/Task/Empty-program/ProDOS/empty-program-1.dos @@ -0,0 +1 @@ +IGNORELINE diff --git a/Task/Empty-program/ProDOS/empty-program-2.dos b/Task/Empty-program/ProDOS/empty-program-2.dos new file mode 100644 index 0000000000..092bc2b041 --- /dev/null +++ b/Task/Empty-program/ProDOS/empty-program-2.dos @@ -0,0 +1 @@ +; diff --git a/Task/Empty-program/PureBasic/empty-program.purebasic b/Task/Empty-program/PureBasic/empty-program.purebasic new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/REBOL/empty-program.rebol b/Task/Empty-program/REBOL/empty-program.rebol new file mode 100644 index 0000000000..2da1ad13ea --- /dev/null +++ b/Task/Empty-program/REBOL/empty-program.rebol @@ -0,0 +1 @@ +REBOL [] diff --git a/Task/Empty-program/Retro/empty-program-1.retro b/Task/Empty-program/Retro/empty-program-1.retro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/Retro/empty-program-2.retro b/Task/Empty-program/Retro/empty-program-2.retro new file mode 100644 index 0000000000..7c961d8a2f --- /dev/null +++ b/Task/Empty-program/Retro/empty-program-2.retro @@ -0,0 +1 @@ +&bye is boot diff --git a/Task/Empty-program/SNOBOL4/empty-program.sno b/Task/Empty-program/SNOBOL4/empty-program.sno new file mode 100644 index 0000000000..a6a9baf65e --- /dev/null +++ b/Task/Empty-program/SNOBOL4/empty-program.sno @@ -0,0 +1 @@ +end diff --git a/Task/Empty-program/Seed7/empty-program.seed7 b/Task/Empty-program/Seed7/empty-program.seed7 new file mode 100644 index 0000000000..8d1606c6ce --- /dev/null +++ b/Task/Empty-program/Seed7/empty-program.seed7 @@ -0,0 +1,3 @@ +$ include "seed7_05.s7i"; + +const proc: main is noop; diff --git a/Task/Empty-program/Slate/empty-program.slate b/Task/Empty-program/Slate/empty-program.slate new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/Standard-ML/empty-program.ml b/Task/Empty-program/Standard-ML/empty-program.ml new file mode 100644 index 0000000000..092bc2b041 --- /dev/null +++ b/Task/Empty-program/Standard-ML/empty-program.ml @@ -0,0 +1 @@ +; diff --git a/Task/Empty-program/Suneido/empty-program.suneido b/Task/Empty-program/Suneido/empty-program.suneido new file mode 100644 index 0000000000..e166d91e54 --- /dev/null +++ b/Task/Empty-program/Suneido/empty-program.suneido @@ -0,0 +1 @@ +function () { } diff --git a/Task/Empty-program/TUSCRIPT/empty-program.tuscript b/Task/Empty-program/TUSCRIPT/empty-program.tuscript new file mode 100644 index 0000000000..5e8c560bda --- /dev/null +++ b/Task/Empty-program/TUSCRIPT/empty-program.tuscript @@ -0,0 +1 @@ +$$ MODE TUSCRIPT diff --git a/Task/Empty-program/Trith/empty-program.trith b/Task/Empty-program/Trith/empty-program.trith new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Task/Empty-program/UNIX-Shell/empty-program-1.sh b/Task/Empty-program/UNIX-Shell/empty-program-1.sh new file mode 100644 index 0000000000..1a2485251c --- /dev/null +++ b/Task/Empty-program/UNIX-Shell/empty-program-1.sh @@ -0,0 +1 @@ +#!/bin/sh diff --git a/Task/Empty-program/UNIX-Shell/empty-program-2.sh b/Task/Empty-program/UNIX-Shell/empty-program-2.sh new file mode 100644 index 0000000000..a9bf588e2f --- /dev/null +++ b/Task/Empty-program/UNIX-Shell/empty-program-2.sh @@ -0,0 +1 @@ +#!/bin/bash diff --git a/Task/Empty-program/VBScript/empty-program.vbscript b/Task/Empty-program/VBScript/empty-program.vbscript new file mode 100644 index 0000000000..eef843b537 --- /dev/null +++ b/Task/Empty-program/VBScript/empty-program.vbscript @@ -0,0 +1 @@ +' diff --git a/Task/Empty-program/VHDL/empty-program.vhdl b/Task/Empty-program/VHDL/empty-program.vhdl new file mode 100644 index 0000000000..330df4833e --- /dev/null +++ b/Task/Empty-program/VHDL/empty-program.vhdl @@ -0,0 +1,6 @@ +entity dummy is +end; + +architecture empty of dummy is +begin +end; diff --git a/Task/Empty-program/Visual-Basic-.NET/empty-program.visual b/Task/Empty-program/Visual-Basic-.NET/empty-program.visual new file mode 100644 index 0000000000..e5d7c88210 --- /dev/null +++ b/Task/Empty-program/Visual-Basic-.NET/empty-program.visual @@ -0,0 +1,4 @@ +Module General + Sub Main() + End Sub +End Module diff --git a/Task/Empty-program/X86-Assembly/empty-program-1.x86 b/Task/Empty-program/X86-Assembly/empty-program-1.x86 new file mode 100644 index 0000000000..c2a17810d5 --- /dev/null +++ b/Task/Empty-program/X86-Assembly/empty-program-1.x86 @@ -0,0 +1,7 @@ +section .text + global _start + + _start: + mov eax, 1 + int 0x80 + ret diff --git a/Task/Empty-program/X86-Assembly/empty-program-2.x86 b/Task/Empty-program/X86-Assembly/empty-program-2.x86 new file mode 100644 index 0000000000..205469a209 --- /dev/null +++ b/Task/Empty-program/X86-Assembly/empty-program-2.x86 @@ -0,0 +1,8 @@ +.386 +.model flat, stdcall +option casemap:none + +.code +start: +ret +end start diff --git a/Task/Empty-program/XQuery/empty-program.xquery b/Task/Empty-program/XQuery/empty-program.xquery new file mode 100644 index 0000000000..9c558e357c --- /dev/null +++ b/Task/Empty-program/XQuery/empty-program.xquery @@ -0,0 +1 @@ +. diff --git a/Task/Empty-program/XSLT/empty-program-1.xslt b/Task/Empty-program/XSLT/empty-program-1.xslt new file mode 100644 index 0000000000..39852d8e6d --- /dev/null +++ b/Task/Empty-program/XSLT/empty-program-1.xslt @@ -0,0 +1,4 @@ + + + + diff --git a/Task/Empty-program/XSLT/empty-program-2.xslt b/Task/Empty-program/XSLT/empty-program-2.xslt new file mode 100644 index 0000000000..dfd2b598c9 --- /dev/null +++ b/Task/Empty-program/XSLT/empty-program-2.xslt @@ -0,0 +1 @@ + diff --git a/Task/Empty-program/XSLT/empty-program-3.xslt b/Task/Empty-program/XSLT/empty-program-3.xslt new file mode 100644 index 0000000000..5ff5d71956 --- /dev/null +++ b/Task/Empty-program/XSLT/empty-program-3.xslt @@ -0,0 +1,3 @@ + +

Create an HTML table