==Documentation==
-''InterSystems Documentation''
+''InterSystems Documentation Overview Page''
http://docs.intersystems.com
-''InterSystems Class Reference (Caché 2012.2)''
-http://docs.intersystems.com/cache20122/csp/documatic/%25CSP.Documatic.cls
\ No newline at end of file
+''InterSystems Product Documentation (Caché and Ensemble)''
+http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls
+
+''InterSystems Class Reference (Caché and Ensemble system, library, and sample classes)''
+http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls
\ No newline at end of file
diff --git a/Lang/Clojure/Almost-prime b/Lang/Clojure/Almost-prime
new file mode 120000
index 0000000000..645dae3ffc
--- /dev/null
+++ b/Lang/Clojure/Almost-prime
@@ -0,0 +1 @@
+../../Task/Almost-prime/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Arithmetic-geometric-mean b/Lang/Clojure/Arithmetic-geometric-mean
new file mode 120000
index 0000000000..aad55e7b86
--- /dev/null
+++ b/Lang/Clojure/Arithmetic-geometric-mean
@@ -0,0 +1 @@
+../../Task/Arithmetic-geometric-mean/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Arithmetic-geometric-mean-Calculate-Pi b/Lang/Clojure/Arithmetic-geometric-mean-Calculate-Pi
new file mode 120000
index 0000000000..1dcc923dfc
--- /dev/null
+++ b/Lang/Clojure/Arithmetic-geometric-mean-Calculate-Pi
@@ -0,0 +1 @@
+../../Task/Arithmetic-geometric-mean-Calculate-Pi/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Average-loop-length b/Lang/Clojure/Average-loop-length
new file mode 120000
index 0000000000..b340c5b023
--- /dev/null
+++ b/Lang/Clojure/Average-loop-length
@@ -0,0 +1 @@
+../../Task/Average-loop-length/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Bernoulli-numbers b/Lang/Clojure/Bernoulli-numbers
new file mode 120000
index 0000000000..3c3647884b
--- /dev/null
+++ b/Lang/Clojure/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/CSV-to-HTML-translation b/Lang/Clojure/CSV-to-HTML-translation
new file mode 120000
index 0000000000..e5bd68bd17
--- /dev/null
+++ b/Lang/Clojure/CSV-to-HTML-translation
@@ -0,0 +1 @@
+../../Task/CSV-to-HTML-translation/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Check-Machin-like-formulas b/Lang/Clojure/Check-Machin-like-formulas
new file mode 120000
index 0000000000..6a96cd6f12
--- /dev/null
+++ b/Lang/Clojure/Check-Machin-like-formulas
@@ -0,0 +1 @@
+../../Task/Check-Machin-like-formulas/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Chinese-remainder-theorem b/Lang/Clojure/Chinese-remainder-theorem
new file mode 120000
index 0000000000..636957ed54
--- /dev/null
+++ b/Lang/Clojure/Chinese-remainder-theorem
@@ -0,0 +1 @@
+../../Task/Chinese-remainder-theorem/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Closures-Value-capture b/Lang/Clojure/Closures-Value-capture
new file mode 120000
index 0000000000..949e2f808e
--- /dev/null
+++ b/Lang/Clojure/Closures-Value-capture
@@ -0,0 +1 @@
+../../Task/Closures-Value-capture/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Continued-fraction b/Lang/Clojure/Continued-fraction
new file mode 120000
index 0000000000..965fec4ae7
--- /dev/null
+++ b/Lang/Clojure/Continued-fraction
@@ -0,0 +1 @@
+../../Task/Continued-fraction/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Count-in-factors b/Lang/Clojure/Count-in-factors
new file mode 120000
index 0000000000..885bf2a1ab
--- /dev/null
+++ b/Lang/Clojure/Count-in-factors
@@ -0,0 +1 @@
+../../Task/Count-in-factors/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Euler-method b/Lang/Clojure/Euler-method
new file mode 120000
index 0000000000..bd766c1af8
--- /dev/null
+++ b/Lang/Clojure/Euler-method
@@ -0,0 +1 @@
+../../Task/Euler-method/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Events b/Lang/Clojure/Events
new file mode 120000
index 0000000000..68ca18bfb1
--- /dev/null
+++ b/Lang/Clojure/Events
@@ -0,0 +1 @@
+../../Task/Events/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Extensible-prime-generator b/Lang/Clojure/Extensible-prime-generator
new file mode 120000
index 0000000000..cf5bc137df
--- /dev/null
+++ b/Lang/Clojure/Extensible-prime-generator
@@ -0,0 +1 @@
+../../Task/Extensible-prime-generator/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Factors-of-a-Mersenne-number b/Lang/Clojure/Factors-of-a-Mersenne-number
new file mode 120000
index 0000000000..ea3b31a35c
--- /dev/null
+++ b/Lang/Clojure/Factors-of-a-Mersenne-number
@@ -0,0 +1 @@
+../../Task/Factors-of-a-Mersenne-number/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Generate-Chess960-starting-position b/Lang/Clojure/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..d80352d843
--- /dev/null
+++ b/Lang/Clojure/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/I-before-E-except-after-C b/Lang/Clojure/I-before-E-except-after-C
new file mode 120000
index 0000000000..31640789f3
--- /dev/null
+++ b/Lang/Clojure/I-before-E-except-after-C
@@ -0,0 +1 @@
+../../Task/I-before-E-except-after-C/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Iterated-digits-squaring b/Lang/Clojure/Iterated-digits-squaring
new file mode 120000
index 0000000000..ab0a930b58
--- /dev/null
+++ b/Lang/Clojure/Iterated-digits-squaring
@@ -0,0 +1 @@
+../../Task/Iterated-digits-squaring/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Knapsack-problem-Bounded b/Lang/Clojure/Knapsack-problem-Bounded
new file mode 120000
index 0000000000..9b754c6ca6
--- /dev/null
+++ b/Lang/Clojure/Knapsack-problem-Bounded
@@ -0,0 +1 @@
+../../Task/Knapsack-problem-Bounded/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Left-factorials b/Lang/Clojure/Left-factorials
new file mode 120000
index 0000000000..0bc2d8d01d
--- /dev/null
+++ b/Lang/Clojure/Left-factorials
@@ -0,0 +1 @@
+../../Task/Left-factorials/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Longest-string-challenge b/Lang/Clojure/Longest-string-challenge
new file mode 120000
index 0000000000..ef8f9e5bd4
--- /dev/null
+++ b/Lang/Clojure/Longest-string-challenge
@@ -0,0 +1 @@
+../../Task/Longest-string-challenge/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Mad-Libs b/Lang/Clojure/Mad-Libs
new file mode 120000
index 0000000000..90cb120fc8
--- /dev/null
+++ b/Lang/Clojure/Mad-Libs
@@ -0,0 +1 @@
+../../Task/Mad-Libs/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Modular-inverse b/Lang/Clojure/Modular-inverse
new file mode 120000
index 0000000000..519b45c967
--- /dev/null
+++ b/Lang/Clojure/Modular-inverse
@@ -0,0 +1 @@
+../../Task/Modular-inverse/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Nth-root b/Lang/Clojure/Nth-root
new file mode 120000
index 0000000000..ddd4fd24cf
--- /dev/null
+++ b/Lang/Clojure/Nth-root
@@ -0,0 +1 @@
+../../Task/Nth-root/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Pernicious-numbers b/Lang/Clojure/Pernicious-numbers
new file mode 120000
index 0000000000..975cb67a78
--- /dev/null
+++ b/Lang/Clojure/Pernicious-numbers
@@ -0,0 +1 @@
+../../Task/Pernicious-numbers/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Pi b/Lang/Clojure/Pi
new file mode 120000
index 0000000000..93cdc5e28a
--- /dev/null
+++ b/Lang/Clojure/Pi
@@ -0,0 +1 @@
+../../Task/Pi/Clojure
\ No newline at end of file
diff --git a/Lang/Clojure/Sequence-of-primes-by-Trial-Division b/Lang/Clojure/Sequence-of-primes-by-Trial-Division
new file mode 120000
index 0000000000..a8495dea9e
--- /dev/null
+++ b/Lang/Clojure/Sequence-of-primes-by-Trial-Division
@@ -0,0 +1 @@
+../../Task/Sequence-of-primes-by-Trial-Division/Clojure
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Averages-Pythagorean-means b/Lang/CoffeeScript/Averages-Pythagorean-means
new file mode 120000
index 0000000000..e42e147812
--- /dev/null
+++ b/Lang/CoffeeScript/Averages-Pythagorean-means
@@ -0,0 +1 @@
+../../Task/Averages-Pythagorean-means/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Even-or-odd b/Lang/CoffeeScript/Even-or-odd
new file mode 120000
index 0000000000..b60ca3a855
--- /dev/null
+++ b/Lang/CoffeeScript/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Floyds-triangle b/Lang/CoffeeScript/Floyds-triangle
new file mode 120000
index 0000000000..b44b240c78
--- /dev/null
+++ b/Lang/CoffeeScript/Floyds-triangle
@@ -0,0 +1 @@
+../../Task/Floyds-triangle/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Hello-world-Newline-omission b/Lang/CoffeeScript/Hello-world-Newline-omission
new file mode 120000
index 0000000000..f584e81d8d
--- /dev/null
+++ b/Lang/CoffeeScript/Hello-world-Newline-omission
@@ -0,0 +1 @@
+../../Task/Hello-world-Newline-omission/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Heronian-triangles b/Lang/CoffeeScript/Heronian-triangles
new file mode 120000
index 0000000000..acb85e3390
--- /dev/null
+++ b/Lang/CoffeeScript/Heronian-triangles
@@ -0,0 +1 @@
+../../Task/Heronian-triangles/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Hofstadter-Figure-Figure-sequences b/Lang/CoffeeScript/Hofstadter-Figure-Figure-sequences
new file mode 120000
index 0000000000..13393f1fdf
--- /dev/null
+++ b/Lang/CoffeeScript/Hofstadter-Figure-Figure-sequences
@@ -0,0 +1 @@
+../../Task/Hofstadter-Figure-Figure-sequences/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Hofstadter-Q-sequence b/Lang/CoffeeScript/Hofstadter-Q-sequence
new file mode 120000
index 0000000000..b972831710
--- /dev/null
+++ b/Lang/CoffeeScript/Hofstadter-Q-sequence
@@ -0,0 +1 @@
+../../Task/Hofstadter-Q-sequence/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Kaprekar-numbers b/Lang/CoffeeScript/Kaprekar-numbers
new file mode 120000
index 0000000000..afb0bca23f
--- /dev/null
+++ b/Lang/CoffeeScript/Kaprekar-numbers
@@ -0,0 +1 @@
+../../Task/Kaprekar-numbers/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Loops-Break b/Lang/CoffeeScript/Loops-Break
new file mode 120000
index 0000000000..d7123b432a
--- /dev/null
+++ b/Lang/CoffeeScript/Loops-Break
@@ -0,0 +1 @@
+../../Task/Loops-Break/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Remove-duplicate-elements b/Lang/CoffeeScript/Remove-duplicate-elements
new file mode 120000
index 0000000000..25458632a5
--- /dev/null
+++ b/Lang/CoffeeScript/Remove-duplicate-elements
@@ -0,0 +1 @@
+../../Task/Remove-duplicate-elements/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/Reverse-words-in-a-string b/Lang/CoffeeScript/Reverse-words-in-a-string
new file mode 120000
index 0000000000..c73f1f0732
--- /dev/null
+++ b/Lang/CoffeeScript/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/CoffeeScript
\ No newline at end of file
diff --git a/Lang/CoffeeScript/String-append b/Lang/CoffeeScript/String-append
new file mode 120000
index 0000000000..ac83155f1f
--- /dev/null
+++ b/Lang/CoffeeScript/String-append
@@ -0,0 +1 @@
+../../Task/String-append/CoffeeScript
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Aliquot-sequence-classifications b/Lang/Common-Lisp/Aliquot-sequence-classifications
new file mode 120000
index 0000000000..3c1b8cde3a
--- /dev/null
+++ b/Lang/Common-Lisp/Aliquot-sequence-classifications
@@ -0,0 +1 @@
+../../Task/Aliquot-sequence-classifications/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Arithmetic-geometric-mean-Calculate-Pi b/Lang/Common-Lisp/Arithmetic-geometric-mean-Calculate-Pi
new file mode 120000
index 0000000000..470db0e19d
--- /dev/null
+++ b/Lang/Common-Lisp/Arithmetic-geometric-mean-Calculate-Pi
@@ -0,0 +1 @@
+../../Task/Arithmetic-geometric-mean-Calculate-Pi/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Combinations-and-permutations b/Lang/Common-Lisp/Combinations-and-permutations
new file mode 120000
index 0000000000..b6b324326e
--- /dev/null
+++ b/Lang/Common-Lisp/Combinations-and-permutations
@@ -0,0 +1 @@
+../../Task/Combinations-and-permutations/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Conjugate-transpose b/Lang/Common-Lisp/Conjugate-transpose
new file mode 120000
index 0000000000..cc47e34abe
--- /dev/null
+++ b/Lang/Common-Lisp/Conjugate-transpose
@@ -0,0 +1 @@
+../../Task/Conjugate-transpose/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Five-weekends b/Lang/Common-Lisp/Five-weekends
new file mode 120000
index 0000000000..605411d745
--- /dev/null
+++ b/Lang/Common-Lisp/Five-weekends
@@ -0,0 +1 @@
+../../Task/Five-weekends/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Function-frequency b/Lang/Common-Lisp/Function-frequency
new file mode 120000
index 0000000000..2c8acdd84b
--- /dev/null
+++ b/Lang/Common-Lisp/Function-frequency
@@ -0,0 +1 @@
+../../Task/Function-frequency/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Gaussian-elimination b/Lang/Common-Lisp/Gaussian-elimination
new file mode 120000
index 0000000000..8be2023690
--- /dev/null
+++ b/Lang/Common-Lisp/Gaussian-elimination
@@ -0,0 +1 @@
+../../Task/Gaussian-elimination/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/History-variables b/Lang/Common-Lisp/History-variables
new file mode 120000
index 0000000000..d2baab482e
--- /dev/null
+++ b/Lang/Common-Lisp/History-variables
@@ -0,0 +1 @@
+../../Task/History-variables/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Old-lady-swallowed-a-fly b/Lang/Common-Lisp/Old-lady-swallowed-a-fly
new file mode 120000
index 0000000000..281ebc242c
--- /dev/null
+++ b/Lang/Common-Lisp/Old-lady-swallowed-a-fly
@@ -0,0 +1 @@
+../../Task/Old-lady-swallowed-a-fly/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Parsing-RPN-to-infix-conversion b/Lang/Common-Lisp/Parsing-RPN-to-infix-conversion
new file mode 120000
index 0000000000..1247e345bf
--- /dev/null
+++ b/Lang/Common-Lisp/Parsing-RPN-to-infix-conversion
@@ -0,0 +1 @@
+../../Task/Parsing-RPN-to-infix-conversion/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Parsing-Shunting-yard-algorithm b/Lang/Common-Lisp/Parsing-Shunting-yard-algorithm
new file mode 120000
index 0000000000..a6f169a3de
--- /dev/null
+++ b/Lang/Common-Lisp/Parsing-Shunting-yard-algorithm
@@ -0,0 +1 @@
+../../Task/Parsing-Shunting-yard-algorithm/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Phrase-reversals b/Lang/Common-Lisp/Phrase-reversals
new file mode 120000
index 0000000000..53ea0f941c
--- /dev/null
+++ b/Lang/Common-Lisp/Phrase-reversals
@@ -0,0 +1 @@
+../../Task/Phrase-reversals/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Rep-string b/Lang/Common-Lisp/Rep-string
new file mode 120000
index 0000000000..054216379b
--- /dev/null
+++ b/Lang/Common-Lisp/Rep-string
@@ -0,0 +1 @@
+../../Task/Rep-string/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Sequence-of-primes-by-Trial-Division b/Lang/Common-Lisp/Sequence-of-primes-by-Trial-Division
new file mode 120000
index 0000000000..d859c3d9cb
--- /dev/null
+++ b/Lang/Common-Lisp/Sequence-of-primes-by-Trial-Division
@@ -0,0 +1 @@
+../../Task/Sequence-of-primes-by-Trial-Division/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/The-ISAAC-Cipher b/Lang/Common-Lisp/The-ISAAC-Cipher
new file mode 120000
index 0000000000..a21ea16850
--- /dev/null
+++ b/Lang/Common-Lisp/The-ISAAC-Cipher
@@ -0,0 +1 @@
+../../Task/The-ISAAC-Cipher/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/The-Twelve-Days-of-Christmas b/Lang/Common-Lisp/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..86d4599e3d
--- /dev/null
+++ b/Lang/Common-Lisp/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Unix-ls b/Lang/Common-Lisp/Unix-ls
new file mode 120000
index 0000000000..01dd8ff8e5
--- /dev/null
+++ b/Lang/Common-Lisp/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Common-Lisp/Word-wrap b/Lang/Common-Lisp/Word-wrap
new file mode 120000
index 0000000000..5b226cfa64
--- /dev/null
+++ b/Lang/Common-Lisp/Word-wrap
@@ -0,0 +1 @@
+../../Task/Word-wrap/Common-Lisp
\ No newline at end of file
diff --git a/Lang/Component-Pascal/Greyscale-bars-Display b/Lang/Component-Pascal/Greyscale-bars-Display
new file mode 120000
index 0000000000..01ddd1a11a
--- /dev/null
+++ b/Lang/Component-Pascal/Greyscale-bars-Display
@@ -0,0 +1 @@
+../../Task/Greyscale-bars-Display/Component-Pascal
\ No newline at end of file
diff --git a/Lang/D/00DESCRIPTION b/Lang/D/00DESCRIPTION
index e9941092f0..4fad299405 100644
--- a/Lang/D/00DESCRIPTION
+++ b/Lang/D/00DESCRIPTION
@@ -1,4 +1,5 @@
{{language|D
+|exec=machine
|strength=strong
|gc=yes
|safety=both
@@ -13,7 +14,7 @@
{{language programming paradigm|object-oriented}}
{{language programming paradigm|Functional}}
{{language programming paradigm|generic}}
-'''D''' is an [[object-oriented]], [[imperative programming|imperative]], multi-[[:Category:Programming Paradigms|paradigm]] system programming language by Walter Bright of Digital Mars. It originated as a re-engineering of [[C++]], but even though it is predominantly influenced by that language, it is not a variant of C++. D has redesigned some C++ features and has been influenced by concepts used in other programming languages, such as [[Python]], [[Java]], [[C sharp|C#]] and [[Eiffel]].
+'''D''' is an [[object-oriented]], [[imperative programming|imperative]], multi-[[:Category:Programming Paradigms|paradigm]] systems programming language designed by Walter Bright of Digital Mars. Although it originated as a re-engineering of [[C++]], and is thus predominantly influenced by that language, it is not a variant of C++. Rather, D redesigns some C++ features and is influenced by concepts from other programming languages such as [[Python]], [[Java]], [[C sharp|C#]] and [[Eiffel]].
==Citations==
* [[wp:D (programming language)|Wikipedia:D (programming language)]]
\ No newline at end of file
diff --git a/Lang/D/Chat-server b/Lang/D/Chat-server
new file mode 120000
index 0000000000..46db52c829
--- /dev/null
+++ b/Lang/D/Chat-server
@@ -0,0 +1 @@
+../../Task/Chat-server/D
\ No newline at end of file
diff --git a/Lang/D/Morse-code b/Lang/D/Morse-code
new file mode 120000
index 0000000000..b60d84fff9
--- /dev/null
+++ b/Lang/D/Morse-code
@@ -0,0 +1 @@
+../../Task/Morse-code/D
\ No newline at end of file
diff --git a/Lang/DWScript/Range-expansion b/Lang/DWScript/Range-expansion
new file mode 120000
index 0000000000..e5cede73b9
--- /dev/null
+++ b/Lang/DWScript/Range-expansion
@@ -0,0 +1 @@
+../../Task/Range-expansion/DWScript
\ No newline at end of file
diff --git a/Lang/DWScript/SHA-1 b/Lang/DWScript/SHA-1
new file mode 120000
index 0000000000..18dc243b4e
--- /dev/null
+++ b/Lang/DWScript/SHA-1
@@ -0,0 +1 @@
+../../Task/SHA-1/DWScript
\ No newline at end of file
diff --git a/Lang/DWScript/SHA-256 b/Lang/DWScript/SHA-256
new file mode 120000
index 0000000000..ed8a2e1ad5
--- /dev/null
+++ b/Lang/DWScript/SHA-256
@@ -0,0 +1 @@
+../../Task/SHA-256/DWScript
\ No newline at end of file
diff --git a/Lang/Dc/99-Bottles-of-Beer b/Lang/Dc/99-Bottles-of-Beer
new file mode 120000
index 0000000000..f29dc2b412
--- /dev/null
+++ b/Lang/Dc/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/Dc
\ No newline at end of file
diff --git a/Lang/Delphi/Morse-code b/Lang/Delphi/Morse-code
new file mode 120000
index 0000000000..8b9d013a23
--- /dev/null
+++ b/Lang/Delphi/Morse-code
@@ -0,0 +1 @@
+../../Task/Morse-code/Delphi
\ No newline at end of file
diff --git a/Lang/Delphi/Voronoi-diagram b/Lang/Delphi/Voronoi-diagram
new file mode 120000
index 0000000000..9c14fb8da4
--- /dev/null
+++ b/Lang/Delphi/Voronoi-diagram
@@ -0,0 +1 @@
+../../Task/Voronoi-diagram/Delphi
\ No newline at end of file
diff --git a/Lang/EC/00DESCRIPTION b/Lang/EC/00DESCRIPTION
index da088ab50c..475480e0c2 100644
--- a/Lang/EC/00DESCRIPTION
+++ b/Lang/EC/00DESCRIPTION
@@ -50,7 +50,6 @@ The Ecere SDK is completely free and includes a full-featured [[Ecere IDE|Integr
pen.color = ColorCMYK { 0, 100, 100, 0 };
==External links==
-*[http://www.ecere.com/technologies.html#eC Description of eC language on official web site]
-*[http://www.ecere.com/ Ecere Corporation's web site]
-*[http://zerotri.net/wiki/doku.php?id=ecere_review Review of eC language and SDK by zerotri]
+*[http://ec-lang.org/overview Description of eC language on official web site]
+*[http://ecere.ca/ Ecere Corporation's web site]
*[http://freshmeat.net/projects/ecere/ Ecere SDK project on FreshMeat]
\ No newline at end of file
diff --git a/Lang/Eiffel/00DESCRIPTION b/Lang/Eiffel/00DESCRIPTION
index bdfb45c236..3de80af8d0 100644
--- a/Lang/Eiffel/00DESCRIPTION
+++ b/Lang/Eiffel/00DESCRIPTION
@@ -1,7 +1,9 @@
-{{Stub}}{{language|Eiffel
+{{language|Eiffel
|strength=strong
|safety=safe
|compat=nominative
|checking=static
|gc=yes
-|LCT=yes}}
\ No newline at end of file
+|LCT=yes}}'''Eiffel''' is an [[ISO]]-standardized, [[object-oriented]] programming language designed by Bertrand Meyer and Eiffel Software. The design of the language is closely connected with the Eiffel programming method, a set of principles consisting of [[wp:Design_by_contract|design by contract]], [[wp:Command-query_separation|command query separation]], the [[wp:Uniform_access_principle|uniform access principle]], the [[wp:Single-choice_principle|single-choice principle]], the [[wp:Open-Closed_principle|open-closed principle]], and the [[wp:Option-operand_separation|option-operand separation principle]].
+
+Many concepts initially introduced by Eiffel later found their way into, among others, [[Java]] and [[C#]]. New language design ideas, particularly through the Ecma/ISO standardization process, continue to be incorporated into the Eiffel language.
\ No newline at end of file
diff --git a/Lang/Eiffel/Active-Directory-Search-for-a-user b/Lang/Eiffel/Active-Directory-Search-for-a-user
new file mode 120000
index 0000000000..2c1701fa7b
--- /dev/null
+++ b/Lang/Eiffel/Active-Directory-Search-for-a-user
@@ -0,0 +1 @@
+../../Task/Active-Directory-Search-for-a-user/Eiffel
\ No newline at end of file
diff --git a/Lang/Eiffel/Hello-world-Newbie b/Lang/Eiffel/Hello-world-Newbie
new file mode 120000
index 0000000000..7d3e045e04
--- /dev/null
+++ b/Lang/Eiffel/Hello-world-Newbie
@@ -0,0 +1 @@
+../../Task/Hello-world-Newbie/Eiffel
\ No newline at end of file
diff --git a/Lang/Ela/00DESCRIPTION b/Lang/Ela/00DESCRIPTION
index d60e29e01a..c1790d255a 100644
--- a/Lang/Ela/00DESCRIPTION
+++ b/Lang/Ela/00DESCRIPTION
@@ -10,5 +10,5 @@
|parampass=value
}}
{{language programming paradigm|functional}}
-Ela is a pure functional language. Ela supports both strict and non-strict evaluation but is strict by default. Ela has a layout based, [[Haskell]] style syntax. Features supported by Ela include first class functions, pattern matching, lazy evaluation, algebraic data types (including open algebraic data types), type classes.
+[http://elalang.net/ Ela] is a pure functional language. Ela supports both strict and non-strict evaluation but is strict by default. Ela has a layout-based, [[Haskell]]-style syntax. Features supported by Ela include first class functions, pattern matching, lazy evaluation, algebraic data types (including open algebraic data types), and type classes.
Ela runs on its own virtual machine but currently requires [[.NET]] or [[Mono]].
\ No newline at end of file
diff --git a/Lang/Ela/ABC-Problem b/Lang/Ela/ABC-Problem
new file mode 120000
index 0000000000..53482796d1
--- /dev/null
+++ b/Lang/Ela/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Abundant,-deficient-and-perfect-number-classifications b/Lang/Ela/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..7bbf5d31ad
--- /dev/null
+++ b/Lang/Ela/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Amicable-pairs b/Lang/Ela/Amicable-pairs
new file mode 120000
index 0000000000..ce00339d4a
--- /dev/null
+++ b/Lang/Ela/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Anagrams b/Lang/Ela/Anagrams
new file mode 120000
index 0000000000..429163611d
--- /dev/null
+++ b/Lang/Ela/Anagrams
@@ -0,0 +1 @@
+../../Task/Anagrams/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Array-concatenation b/Lang/Ela/Array-concatenation
new file mode 120000
index 0000000000..e5177bf108
--- /dev/null
+++ b/Lang/Ela/Array-concatenation
@@ -0,0 +1 @@
+../../Task/Array-concatenation/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Caesar-cipher b/Lang/Ela/Caesar-cipher
new file mode 120000
index 0000000000..321637f512
--- /dev/null
+++ b/Lang/Ela/Caesar-cipher
@@ -0,0 +1 @@
+../../Task/Caesar-cipher/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Exponentiation-operator b/Lang/Ela/Exponentiation-operator
new file mode 120000
index 0000000000..bc6cc02615
--- /dev/null
+++ b/Lang/Ela/Exponentiation-operator
@@ -0,0 +1 @@
+../../Task/Exponentiation-operator/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Literals-String b/Lang/Ela/Literals-String
new file mode 120000
index 0000000000..201fc1c491
--- /dev/null
+++ b/Lang/Ela/Literals-String
@@ -0,0 +1 @@
+../../Task/Literals-String/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Matrix-multiplication b/Lang/Ela/Matrix-multiplication
new file mode 120000
index 0000000000..b5b26e3f28
--- /dev/null
+++ b/Lang/Ela/Matrix-multiplication
@@ -0,0 +1 @@
+../../Task/Matrix-multiplication/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Prime-decomposition b/Lang/Ela/Prime-decomposition
new file mode 120000
index 0000000000..7ee0608b1f
--- /dev/null
+++ b/Lang/Ela/Prime-decomposition
@@ -0,0 +1 @@
+../../Task/Prime-decomposition/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Reverse-a-string b/Lang/Ela/Reverse-a-string
new file mode 120000
index 0000000000..bd3cffee2e
--- /dev/null
+++ b/Lang/Ela/Reverse-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-a-string/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Roman-numerals-Encode b/Lang/Ela/Roman-numerals-Encode
new file mode 120000
index 0000000000..ff04448c46
--- /dev/null
+++ b/Lang/Ela/Roman-numerals-Encode
@@ -0,0 +1 @@
+../../Task/Roman-numerals-Encode/Ela
\ No newline at end of file
diff --git a/Lang/Ela/String-concatenation b/Lang/Ela/String-concatenation
new file mode 120000
index 0000000000..bc4098de16
--- /dev/null
+++ b/Lang/Ela/String-concatenation
@@ -0,0 +1 @@
+../../Task/String-concatenation/Ela
\ No newline at end of file
diff --git a/Lang/Ela/Towers-of-Hanoi b/Lang/Ela/Towers-of-Hanoi
new file mode 120000
index 0000000000..878a930b77
--- /dev/null
+++ b/Lang/Ela/Towers-of-Hanoi
@@ -0,0 +1 @@
+../../Task/Towers-of-Hanoi/Ela
\ No newline at end of file
diff --git a/Lang/Elena/99-Bottles-of-Beer b/Lang/Elena/99-Bottles-of-Beer
new file mode 120000
index 0000000000..71a89c51f2
--- /dev/null
+++ b/Lang/Elena/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/Elena
\ No newline at end of file
diff --git a/Lang/Elena/ABC-Problem b/Lang/Elena/ABC-Problem
new file mode 120000
index 0000000000..1562790317
--- /dev/null
+++ b/Lang/Elena/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Call-an-object-method b/Lang/Elena/Call-an-object-method
new file mode 120000
index 0000000000..8ad79a81e1
--- /dev/null
+++ b/Lang/Elena/Call-an-object-method
@@ -0,0 +1 @@
+../../Task/Call-an-object-method/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Catamorphism b/Lang/Elena/Catamorphism
new file mode 120000
index 0000000000..8b765797e3
--- /dev/null
+++ b/Lang/Elena/Catamorphism
@@ -0,0 +1 @@
+../../Task/Catamorphism/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Check-that-file-exists b/Lang/Elena/Check-that-file-exists
new file mode 120000
index 0000000000..7ac12e2f9a
--- /dev/null
+++ b/Lang/Elena/Check-that-file-exists
@@ -0,0 +1 @@
+../../Task/Check-that-file-exists/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Classes b/Lang/Elena/Classes
new file mode 120000
index 0000000000..b285c44853
--- /dev/null
+++ b/Lang/Elena/Classes
@@ -0,0 +1 @@
+../../Task/Classes/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Closures-Value-capture b/Lang/Elena/Closures-Value-capture
new file mode 120000
index 0000000000..f783466276
--- /dev/null
+++ b/Lang/Elena/Closures-Value-capture
@@ -0,0 +1 @@
+../../Task/Closures-Value-capture/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Collections b/Lang/Elena/Collections
new file mode 120000
index 0000000000..41b1fbb479
--- /dev/null
+++ b/Lang/Elena/Collections
@@ -0,0 +1 @@
+../../Task/Collections/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Command-line-arguments b/Lang/Elena/Command-line-arguments
new file mode 120000
index 0000000000..5d0e538aa1
--- /dev/null
+++ b/Lang/Elena/Command-line-arguments
@@ -0,0 +1 @@
+../../Task/Command-line-arguments/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Comments b/Lang/Elena/Comments
new file mode 120000
index 0000000000..436f1473d3
--- /dev/null
+++ b/Lang/Elena/Comments
@@ -0,0 +1 @@
+../../Task/Comments/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Copy-a-string b/Lang/Elena/Copy-a-string
new file mode 120000
index 0000000000..b52c431536
--- /dev/null
+++ b/Lang/Elena/Copy-a-string
@@ -0,0 +1 @@
+../../Task/Copy-a-string/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Create-a-file b/Lang/Elena/Create-a-file
new file mode 120000
index 0000000000..753bec128e
--- /dev/null
+++ b/Lang/Elena/Create-a-file
@@ -0,0 +1 @@
+../../Task/Create-a-file/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Create-a-two-dimensional-array-at-runtime b/Lang/Elena/Create-a-two-dimensional-array-at-runtime
new file mode 120000
index 0000000000..5f53e44601
--- /dev/null
+++ b/Lang/Elena/Create-a-two-dimensional-array-at-runtime
@@ -0,0 +1 @@
+../../Task/Create-a-two-dimensional-array-at-runtime/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Delegates b/Lang/Elena/Delegates
new file mode 120000
index 0000000000..a721b9ccfa
--- /dev/null
+++ b/Lang/Elena/Delegates
@@ -0,0 +1 @@
+../../Task/Delegates/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Delete-a-file b/Lang/Elena/Delete-a-file
new file mode 120000
index 0000000000..e462856745
--- /dev/null
+++ b/Lang/Elena/Delete-a-file
@@ -0,0 +1 @@
+../../Task/Delete-a-file/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Dynamic-variable-names b/Lang/Elena/Dynamic-variable-names
new file mode 120000
index 0000000000..f818da2f7f
--- /dev/null
+++ b/Lang/Elena/Dynamic-variable-names
@@ -0,0 +1 @@
+../../Task/Dynamic-variable-names/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Empty-program b/Lang/Elena/Empty-program
new file mode 120000
index 0000000000..2daf5a38b8
--- /dev/null
+++ b/Lang/Elena/Empty-program
@@ -0,0 +1 @@
+../../Task/Empty-program/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Empty-string b/Lang/Elena/Empty-string
new file mode 120000
index 0000000000..9e5b1bc1ab
--- /dev/null
+++ b/Lang/Elena/Empty-string
@@ -0,0 +1 @@
+../../Task/Empty-string/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Evolutionary-algorithm b/Lang/Elena/Evolutionary-algorithm
new file mode 120000
index 0000000000..88ec177d81
--- /dev/null
+++ b/Lang/Elena/Evolutionary-algorithm
@@ -0,0 +1 @@
+../../Task/Evolutionary-algorithm/Elena
\ No newline at end of file
diff --git a/Lang/Elena/File-size b/Lang/Elena/File-size
new file mode 120000
index 0000000000..7692752791
--- /dev/null
+++ b/Lang/Elena/File-size
@@ -0,0 +1 @@
+../../Task/File-size/Elena
\ No newline at end of file
diff --git a/Lang/Elena/First-class-functions b/Lang/Elena/First-class-functions
new file mode 120000
index 0000000000..f367a12183
--- /dev/null
+++ b/Lang/Elena/First-class-functions
@@ -0,0 +1 @@
+../../Task/First-class-functions/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Identity-matrix b/Lang/Elena/Identity-matrix
new file mode 120000
index 0000000000..b48c4389dc
--- /dev/null
+++ b/Lang/Elena/Identity-matrix
@@ -0,0 +1 @@
+../../Task/Identity-matrix/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Inheritance-Multiple b/Lang/Elena/Inheritance-Multiple
new file mode 120000
index 0000000000..ca2810b38b
--- /dev/null
+++ b/Lang/Elena/Inheritance-Multiple
@@ -0,0 +1 @@
+../../Task/Inheritance-Multiple/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Inheritance-Single b/Lang/Elena/Inheritance-Single
new file mode 120000
index 0000000000..a345ab6b8b
--- /dev/null
+++ b/Lang/Elena/Inheritance-Single
@@ -0,0 +1 @@
+../../Task/Inheritance-Single/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Input-loop b/Lang/Elena/Input-loop
new file mode 120000
index 0000000000..1835658bcf
--- /dev/null
+++ b/Lang/Elena/Input-loop
@@ -0,0 +1 @@
+../../Task/Input-loop/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Integer-comparison b/Lang/Elena/Integer-comparison
new file mode 120000
index 0000000000..21a9ed38a1
--- /dev/null
+++ b/Lang/Elena/Integer-comparison
@@ -0,0 +1 @@
+../../Task/Integer-comparison/Elena
\ No newline at end of file
diff --git a/Lang/Elena/JSON b/Lang/Elena/JSON
new file mode 120000
index 0000000000..04fd798a61
--- /dev/null
+++ b/Lang/Elena/JSON
@@ -0,0 +1 @@
+../../Task/JSON/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Knuth-shuffle b/Lang/Elena/Knuth-shuffle
new file mode 120000
index 0000000000..7550749215
--- /dev/null
+++ b/Lang/Elena/Knuth-shuffle
@@ -0,0 +1 @@
+../../Task/Knuth-shuffle/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Knuths-algorithm-S b/Lang/Elena/Knuths-algorithm-S
new file mode 120000
index 0000000000..bc40671393
--- /dev/null
+++ b/Lang/Elena/Knuths-algorithm-S
@@ -0,0 +1 @@
+../../Task/Knuths-algorithm-S/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Literals-Integer b/Lang/Elena/Literals-Integer
new file mode 120000
index 0000000000..735b914c51
--- /dev/null
+++ b/Lang/Elena/Literals-Integer
@@ -0,0 +1 @@
+../../Task/Literals-Integer/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Literals-String b/Lang/Elena/Literals-String
new file mode 120000
index 0000000000..87aa50ee55
--- /dev/null
+++ b/Lang/Elena/Literals-String
@@ -0,0 +1 @@
+../../Task/Literals-String/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Loop-over-multiple-arrays-simultaneously b/Lang/Elena/Loop-over-multiple-arrays-simultaneously
new file mode 120000
index 0000000000..3fa086f4b9
--- /dev/null
+++ b/Lang/Elena/Loop-over-multiple-arrays-simultaneously
@@ -0,0 +1 @@
+../../Task/Loop-over-multiple-arrays-simultaneously/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Loops-For b/Lang/Elena/Loops-For
new file mode 120000
index 0000000000..a9f9bd4be5
--- /dev/null
+++ b/Lang/Elena/Loops-For
@@ -0,0 +1 @@
+../../Task/Loops-For/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Loops-For-with-a-specified-step b/Lang/Elena/Loops-For-with-a-specified-step
new file mode 120000
index 0000000000..cf11fe6e87
--- /dev/null
+++ b/Lang/Elena/Loops-For-with-a-specified-step
@@ -0,0 +1 @@
+../../Task/Loops-For-with-a-specified-step/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Loops-Foreach b/Lang/Elena/Loops-Foreach
new file mode 120000
index 0000000000..301ac47ddf
--- /dev/null
+++ b/Lang/Elena/Loops-Foreach
@@ -0,0 +1 @@
+../../Task/Loops-Foreach/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Loops-Infinite b/Lang/Elena/Loops-Infinite
new file mode 120000
index 0000000000..c12895de4b
--- /dev/null
+++ b/Lang/Elena/Loops-Infinite
@@ -0,0 +1 @@
+../../Task/Loops-Infinite/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Loops-While b/Lang/Elena/Loops-While
new file mode 120000
index 0000000000..d66e0b21d9
--- /dev/null
+++ b/Lang/Elena/Loops-While
@@ -0,0 +1 @@
+../../Task/Loops-While/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Man-or-boy-test b/Lang/Elena/Man-or-boy-test
new file mode 120000
index 0000000000..e8de7722dd
--- /dev/null
+++ b/Lang/Elena/Man-or-boy-test
@@ -0,0 +1 @@
+../../Task/Man-or-boy-test/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Number-reversal-game b/Lang/Elena/Number-reversal-game
new file mode 120000
index 0000000000..8b5e8cba8d
--- /dev/null
+++ b/Lang/Elena/Number-reversal-game
@@ -0,0 +1 @@
+../../Task/Number-reversal-game/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Old-lady-swallowed-a-fly b/Lang/Elena/Old-lady-swallowed-a-fly
new file mode 120000
index 0000000000..b8c858a153
--- /dev/null
+++ b/Lang/Elena/Old-lady-swallowed-a-fly
@@ -0,0 +1 @@
+../../Task/Old-lady-swallowed-a-fly/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Perfect-numbers b/Lang/Elena/Perfect-numbers
new file mode 120000
index 0000000000..c10dedf543
--- /dev/null
+++ b/Lang/Elena/Perfect-numbers
@@ -0,0 +1 @@
+../../Task/Perfect-numbers/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Pick-random-element b/Lang/Elena/Pick-random-element
new file mode 120000
index 0000000000..256d1dd9f7
--- /dev/null
+++ b/Lang/Elena/Pick-random-element
@@ -0,0 +1 @@
+../../Task/Pick-random-element/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Program-name b/Lang/Elena/Program-name
new file mode 120000
index 0000000000..6bbb1b6eb4
--- /dev/null
+++ b/Lang/Elena/Program-name
@@ -0,0 +1 @@
+../../Task/Program-name/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Queue-Usage b/Lang/Elena/Queue-Usage
new file mode 120000
index 0000000000..f419247e20
--- /dev/null
+++ b/Lang/Elena/Queue-Usage
@@ -0,0 +1 @@
+../../Task/Queue-Usage/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Read-a-file-line-by-line b/Lang/Elena/Read-a-file-line-by-line
new file mode 120000
index 0000000000..cccbcb415c
--- /dev/null
+++ b/Lang/Elena/Read-a-file-line-by-line
@@ -0,0 +1 @@
+../../Task/Read-a-file-line-by-line/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Repeat-a-string b/Lang/Elena/Repeat-a-string
new file mode 120000
index 0000000000..d68b3f5315
--- /dev/null
+++ b/Lang/Elena/Repeat-a-string
@@ -0,0 +1 @@
+../../Task/Repeat-a-string/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Reverse-a-string b/Lang/Elena/Reverse-a-string
new file mode 120000
index 0000000000..c02f3e21d0
--- /dev/null
+++ b/Lang/Elena/Reverse-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-a-string/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Reverse-words-in-a-string b/Lang/Elena/Reverse-words-in-a-string
new file mode 120000
index 0000000000..bf39d33709
--- /dev/null
+++ b/Lang/Elena/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Search-a-list b/Lang/Elena/Search-a-list
new file mode 120000
index 0000000000..f75aab8b69
--- /dev/null
+++ b/Lang/Elena/Search-a-list
@@ -0,0 +1 @@
+../../Task/Search-a-list/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Send-an-unknown-method-call b/Lang/Elena/Send-an-unknown-method-call
new file mode 120000
index 0000000000..262496dec7
--- /dev/null
+++ b/Lang/Elena/Send-an-unknown-method-call
@@ -0,0 +1 @@
+../../Task/Send-an-unknown-method-call/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Set-of-real-numbers b/Lang/Elena/Set-of-real-numbers
new file mode 120000
index 0000000000..8a15ef8698
--- /dev/null
+++ b/Lang/Elena/Set-of-real-numbers
@@ -0,0 +1 @@
+../../Task/Set-of-real-numbers/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Short-circuit-evaluation b/Lang/Elena/Short-circuit-evaluation
new file mode 120000
index 0000000000..ddad794abc
--- /dev/null
+++ b/Lang/Elena/Short-circuit-evaluation
@@ -0,0 +1 @@
+../../Task/Short-circuit-evaluation/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Singleton b/Lang/Elena/Singleton
new file mode 120000
index 0000000000..9ccedb0ecd
--- /dev/null
+++ b/Lang/Elena/Singleton
@@ -0,0 +1 @@
+../../Task/Singleton/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Sort-an-array-of-composite-structures b/Lang/Elena/Sort-an-array-of-composite-structures
new file mode 120000
index 0000000000..fada06a584
--- /dev/null
+++ b/Lang/Elena/Sort-an-array-of-composite-structures
@@ -0,0 +1 @@
+../../Task/Sort-an-array-of-composite-structures/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Sort-an-integer-array b/Lang/Elena/Sort-an-integer-array
new file mode 120000
index 0000000000..d979c1eec8
--- /dev/null
+++ b/Lang/Elena/Sort-an-integer-array
@@ -0,0 +1 @@
+../../Task/Sort-an-integer-array/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Stack b/Lang/Elena/Stack
new file mode 120000
index 0000000000..247d357e3a
--- /dev/null
+++ b/Lang/Elena/Stack
@@ -0,0 +1 @@
+../../Task/Stack/Elena
\ No newline at end of file
diff --git a/Lang/Elena/String-length b/Lang/Elena/String-length
new file mode 120000
index 0000000000..d97a4e9a7d
--- /dev/null
+++ b/Lang/Elena/String-length
@@ -0,0 +1 @@
+../../Task/String-length/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Substring b/Lang/Elena/Substring
new file mode 120000
index 0000000000..636c457493
--- /dev/null
+++ b/Lang/Elena/Substring
@@ -0,0 +1 @@
+../../Task/Substring/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Sum-and-product-of-an-array b/Lang/Elena/Sum-and-product-of-an-array
new file mode 120000
index 0000000000..6dd83667af
--- /dev/null
+++ b/Lang/Elena/Sum-and-product-of-an-array
@@ -0,0 +1 @@
+../../Task/Sum-and-product-of-an-array/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Tokenize-a-string b/Lang/Elena/Tokenize-a-string
new file mode 120000
index 0000000000..6c2aa53996
--- /dev/null
+++ b/Lang/Elena/Tokenize-a-string
@@ -0,0 +1 @@
+../../Task/Tokenize-a-string/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Top-rank-per-group b/Lang/Elena/Top-rank-per-group
new file mode 120000
index 0000000000..d2fb7a2b22
--- /dev/null
+++ b/Lang/Elena/Top-rank-per-group
@@ -0,0 +1 @@
+../../Task/Top-rank-per-group/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Trigonometric-functions b/Lang/Elena/Trigonometric-functions
new file mode 120000
index 0000000000..019feea310
--- /dev/null
+++ b/Lang/Elena/Trigonometric-functions
@@ -0,0 +1 @@
+../../Task/Trigonometric-functions/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Truncatable-primes b/Lang/Elena/Truncatable-primes
new file mode 120000
index 0000000000..798fbf0980
--- /dev/null
+++ b/Lang/Elena/Truncatable-primes
@@ -0,0 +1 @@
+../../Task/Truncatable-primes/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Truncate-a-file b/Lang/Elena/Truncate-a-file
new file mode 120000
index 0000000000..7a06ba0426
--- /dev/null
+++ b/Lang/Elena/Truncate-a-file
@@ -0,0 +1 @@
+../../Task/Truncate-a-file/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Twelve-statements b/Lang/Elena/Twelve-statements
new file mode 120000
index 0000000000..86833fccd6
--- /dev/null
+++ b/Lang/Elena/Twelve-statements
@@ -0,0 +1 @@
+../../Task/Twelve-statements/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Unicode-strings b/Lang/Elena/Unicode-strings
new file mode 120000
index 0000000000..329b1cc60d
--- /dev/null
+++ b/Lang/Elena/Unicode-strings
@@ -0,0 +1 @@
+../../Task/Unicode-strings/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Unicode-variable-names b/Lang/Elena/Unicode-variable-names
new file mode 120000
index 0000000000..d9ef2dac0d
--- /dev/null
+++ b/Lang/Elena/Unicode-variable-names
@@ -0,0 +1 @@
+../../Task/Unicode-variable-names/Elena
\ No newline at end of file
diff --git a/Lang/Elena/User-input-Text b/Lang/Elena/User-input-Text
new file mode 120000
index 0000000000..2759bc8e29
--- /dev/null
+++ b/Lang/Elena/User-input-Text
@@ -0,0 +1 @@
+../../Task/User-input-Text/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Variables b/Lang/Elena/Variables
new file mode 120000
index 0000000000..c1bb097499
--- /dev/null
+++ b/Lang/Elena/Variables
@@ -0,0 +1 @@
+../../Task/Variables/Elena
\ No newline at end of file
diff --git a/Lang/Elena/Visualize-a-tree b/Lang/Elena/Visualize-a-tree
new file mode 120000
index 0000000000..e6a1b5a670
--- /dev/null
+++ b/Lang/Elena/Visualize-a-tree
@@ -0,0 +1 @@
+../../Task/Visualize-a-tree/Elena
\ No newline at end of file
diff --git a/Lang/Elixir/24-game b/Lang/Elixir/24-game
new file mode 120000
index 0000000000..08a8802174
--- /dev/null
+++ b/Lang/Elixir/24-game
@@ -0,0 +1 @@
+../../Task/24-game/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/24-game-Solve b/Lang/Elixir/24-game-Solve
new file mode 120000
index 0000000000..5e33c638b7
--- /dev/null
+++ b/Lang/Elixir/24-game-Solve
@@ -0,0 +1 @@
+../../Task/24-game-Solve/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/9-billion-names-of-God-the-integer b/Lang/Elixir/9-billion-names-of-God-the-integer
new file mode 120000
index 0000000000..1ec79b01ad
--- /dev/null
+++ b/Lang/Elixir/9-billion-names-of-God-the-integer
@@ -0,0 +1 @@
+../../Task/9-billion-names-of-God-the-integer/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Abundant,-deficient-and-perfect-number-classifications b/Lang/Elixir/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..fc87646030
--- /dev/null
+++ b/Lang/Elixir/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Accumulator-factory b/Lang/Elixir/Accumulator-factory
new file mode 120000
index 0000000000..66d4bb80f8
--- /dev/null
+++ b/Lang/Elixir/Accumulator-factory
@@ -0,0 +1 @@
+../../Task/Accumulator-factory/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Aliquot-sequence-classifications b/Lang/Elixir/Aliquot-sequence-classifications
new file mode 120000
index 0000000000..0f5531cbfb
--- /dev/null
+++ b/Lang/Elixir/Aliquot-sequence-classifications
@@ -0,0 +1 @@
+../../Task/Aliquot-sequence-classifications/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Amicable-pairs b/Lang/Elixir/Amicable-pairs
new file mode 120000
index 0000000000..a15ca8a724
--- /dev/null
+++ b/Lang/Elixir/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Anagrams-Deranged-anagrams b/Lang/Elixir/Anagrams-Deranged-anagrams
new file mode 120000
index 0000000000..939537b0a1
--- /dev/null
+++ b/Lang/Elixir/Anagrams-Deranged-anagrams
@@ -0,0 +1 @@
+../../Task/Anagrams-Deranged-anagrams/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Append-a-record-to-the-end-of-a-text-file b/Lang/Elixir/Append-a-record-to-the-end-of-a-text-file
new file mode 120000
index 0000000000..41b018f05a
--- /dev/null
+++ b/Lang/Elixir/Append-a-record-to-the-end-of-a-text-file
@@ -0,0 +1 @@
+../../Task/Append-a-record-to-the-end-of-a-text-file/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Apply-a-callback-to-an-array b/Lang/Elixir/Apply-a-callback-to-an-array
new file mode 120000
index 0000000000..72ac23e78a
--- /dev/null
+++ b/Lang/Elixir/Apply-a-callback-to-an-array
@@ -0,0 +1 @@
+../../Task/Apply-a-callback-to-an-array/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Arithmetic-Complex b/Lang/Elixir/Arithmetic-Complex
new file mode 120000
index 0000000000..cf53228357
--- /dev/null
+++ b/Lang/Elixir/Arithmetic-Complex
@@ -0,0 +1 @@
+../../Task/Arithmetic-Complex/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Arithmetic-Rational b/Lang/Elixir/Arithmetic-Rational
new file mode 120000
index 0000000000..1a46991ff6
--- /dev/null
+++ b/Lang/Elixir/Arithmetic-Rational
@@ -0,0 +1 @@
+../../Task/Arithmetic-Rational/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Arrays b/Lang/Elixir/Arrays
new file mode 120000
index 0000000000..8c89dd1c68
--- /dev/null
+++ b/Lang/Elixir/Arrays
@@ -0,0 +1 @@
+../../Task/Arrays/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Assertions b/Lang/Elixir/Assertions
new file mode 120000
index 0000000000..8cc96f5f11
--- /dev/null
+++ b/Lang/Elixir/Assertions
@@ -0,0 +1 @@
+../../Task/Assertions/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Averages-Mean-angle b/Lang/Elixir/Averages-Mean-angle
new file mode 120000
index 0000000000..03b09a00ae
--- /dev/null
+++ b/Lang/Elixir/Averages-Mean-angle
@@ -0,0 +1 @@
+../../Task/Averages-Mean-angle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Averages-Simple-moving-average b/Lang/Elixir/Averages-Simple-moving-average
new file mode 120000
index 0000000000..566eab2880
--- /dev/null
+++ b/Lang/Elixir/Averages-Simple-moving-average
@@ -0,0 +1 @@
+../../Task/Averages-Simple-moving-average/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Bernoulli-numbers b/Lang/Elixir/Bernoulli-numbers
new file mode 120000
index 0000000000..f13858ed89
--- /dev/null
+++ b/Lang/Elixir/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Bulls-and-cows b/Lang/Elixir/Bulls-and-cows
new file mode 120000
index 0000000000..cf1c919d55
--- /dev/null
+++ b/Lang/Elixir/Bulls-and-cows
@@ -0,0 +1 @@
+../../Task/Bulls-and-cows/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Bulls-and-cows-Player b/Lang/Elixir/Bulls-and-cows-Player
new file mode 120000
index 0000000000..30346aa4ac
--- /dev/null
+++ b/Lang/Elixir/Bulls-and-cows-Player
@@ -0,0 +1 @@
+../../Task/Bulls-and-cows-Player/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/CSV-data-manipulation b/Lang/Elixir/CSV-data-manipulation
new file mode 120000
index 0000000000..4608ed9a9d
--- /dev/null
+++ b/Lang/Elixir/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Call-a-function b/Lang/Elixir/Call-a-function
new file mode 120000
index 0000000000..a530c5f479
--- /dev/null
+++ b/Lang/Elixir/Call-a-function
@@ -0,0 +1 @@
+../../Task/Call-a-function/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Call-an-object-method b/Lang/Elixir/Call-an-object-method
new file mode 120000
index 0000000000..97fd589385
--- /dev/null
+++ b/Lang/Elixir/Call-an-object-method
@@ -0,0 +1 @@
+../../Task/Call-an-object-method/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Closures-Value-capture b/Lang/Elixir/Closures-Value-capture
new file mode 120000
index 0000000000..1c79e8e79c
--- /dev/null
+++ b/Lang/Elixir/Closures-Value-capture
@@ -0,0 +1 @@
+../../Task/Closures-Value-capture/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Combinations-and-permutations b/Lang/Elixir/Combinations-and-permutations
new file mode 120000
index 0000000000..293ef07828
--- /dev/null
+++ b/Lang/Elixir/Combinations-and-permutations
@@ -0,0 +1 @@
+../../Task/Combinations-and-permutations/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Command-line-arguments b/Lang/Elixir/Command-line-arguments
new file mode 120000
index 0000000000..1128f6dd97
--- /dev/null
+++ b/Lang/Elixir/Command-line-arguments
@@ -0,0 +1 @@
+../../Task/Command-line-arguments/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Compound-data-type b/Lang/Elixir/Compound-data-type
new file mode 120000
index 0000000000..c62a039b06
--- /dev/null
+++ b/Lang/Elixir/Compound-data-type
@@ -0,0 +1 @@
+../../Task/Compound-data-type/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Concurrent-computing b/Lang/Elixir/Concurrent-computing
new file mode 120000
index 0000000000..ed6d558b9b
--- /dev/null
+++ b/Lang/Elixir/Concurrent-computing
@@ -0,0 +1 @@
+../../Task/Concurrent-computing/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Conways-Game-of-Life b/Lang/Elixir/Conways-Game-of-Life
new file mode 120000
index 0000000000..fd18794aee
--- /dev/null
+++ b/Lang/Elixir/Conways-Game-of-Life
@@ -0,0 +1 @@
+../../Task/Conways-Game-of-Life/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Create-a-two-dimensional-array-at-runtime b/Lang/Elixir/Create-a-two-dimensional-array-at-runtime
new file mode 120000
index 0000000000..fdc6e55aa9
--- /dev/null
+++ b/Lang/Elixir/Create-a-two-dimensional-array-at-runtime
@@ -0,0 +1 @@
+../../Task/Create-a-two-dimensional-array-at-runtime/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Cut-a-rectangle b/Lang/Elixir/Cut-a-rectangle
new file mode 120000
index 0000000000..0cea7d4ec7
--- /dev/null
+++ b/Lang/Elixir/Cut-a-rectangle
@@ -0,0 +1 @@
+../../Task/Cut-a-rectangle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/First-class-functions b/Lang/Elixir/First-class-functions
new file mode 120000
index 0000000000..0373385e7e
--- /dev/null
+++ b/Lang/Elixir/First-class-functions
@@ -0,0 +1 @@
+../../Task/First-class-functions/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Flipping-bits-game b/Lang/Elixir/Flipping-bits-game
new file mode 120000
index 0000000000..b619ab9d11
--- /dev/null
+++ b/Lang/Elixir/Flipping-bits-game
@@ -0,0 +1 @@
+../../Task/Flipping-bits-game/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Four-bit-adder b/Lang/Elixir/Four-bit-adder
new file mode 120000
index 0000000000..2c39efae55
--- /dev/null
+++ b/Lang/Elixir/Four-bit-adder
@@ -0,0 +1 @@
+../../Task/Four-bit-adder/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Fractran b/Lang/Elixir/Fractran
new file mode 120000
index 0000000000..6e7583875d
--- /dev/null
+++ b/Lang/Elixir/Fractran
@@ -0,0 +1 @@
+../../Task/Fractran/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Generate-Chess960-starting-position b/Lang/Elixir/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..05dfc7cad9
--- /dev/null
+++ b/Lang/Elixir/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Generator-Exponential b/Lang/Elixir/Generator-Exponential
new file mode 120000
index 0000000000..3a7956031b
--- /dev/null
+++ b/Lang/Elixir/Generator-Exponential
@@ -0,0 +1 @@
+../../Task/Generator-Exponential/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Hofstadter-Q-sequence b/Lang/Elixir/Hofstadter-Q-sequence
new file mode 120000
index 0000000000..b5d58ac423
--- /dev/null
+++ b/Lang/Elixir/Hofstadter-Q-sequence
@@ -0,0 +1 @@
+../../Task/Hofstadter-Q-sequence/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/IBAN b/Lang/Elixir/IBAN
new file mode 120000
index 0000000000..7aaeed52c3
--- /dev/null
+++ b/Lang/Elixir/IBAN
@@ -0,0 +1 @@
+../../Task/IBAN/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Knights-tour b/Lang/Elixir/Knights-tour
new file mode 120000
index 0000000000..023372bc78
--- /dev/null
+++ b/Lang/Elixir/Knights-tour
@@ -0,0 +1 @@
+../../Task/Knights-tour/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Knuths-algorithm-S b/Lang/Elixir/Knuths-algorithm-S
new file mode 120000
index 0000000000..f46cead22d
--- /dev/null
+++ b/Lang/Elixir/Knuths-algorithm-S
@@ -0,0 +1 @@
+../../Task/Knuths-algorithm-S/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Longest-increasing-subsequence b/Lang/Elixir/Longest-increasing-subsequence
new file mode 120000
index 0000000000..c0f84aec66
--- /dev/null
+++ b/Lang/Elixir/Longest-increasing-subsequence
@@ -0,0 +1 @@
+../../Task/Longest-increasing-subsequence/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Mandelbrot-set b/Lang/Elixir/Mandelbrot-set
new file mode 120000
index 0000000000..c82260848a
--- /dev/null
+++ b/Lang/Elixir/Mandelbrot-set
@@ -0,0 +1 @@
+../../Task/Mandelbrot-set/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Matrix-multiplication b/Lang/Elixir/Matrix-multiplication
new file mode 120000
index 0000000000..84e809e2a0
--- /dev/null
+++ b/Lang/Elixir/Matrix-multiplication
@@ -0,0 +1 @@
+../../Task/Matrix-multiplication/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Menu b/Lang/Elixir/Menu
new file mode 120000
index 0000000000..e510592e9c
--- /dev/null
+++ b/Lang/Elixir/Menu
@@ -0,0 +1 @@
+../../Task/Menu/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Modular-inverse b/Lang/Elixir/Modular-inverse
new file mode 120000
index 0000000000..0d871583b6
--- /dev/null
+++ b/Lang/Elixir/Modular-inverse
@@ -0,0 +1 @@
+../../Task/Modular-inverse/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Named-parameters b/Lang/Elixir/Named-parameters
new file mode 120000
index 0000000000..577809b6cb
--- /dev/null
+++ b/Lang/Elixir/Named-parameters
@@ -0,0 +1 @@
+../../Task/Named-parameters/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Natural-sorting b/Lang/Elixir/Natural-sorting
new file mode 120000
index 0000000000..32b01bba20
--- /dev/null
+++ b/Lang/Elixir/Natural-sorting
@@ -0,0 +1 @@
+../../Task/Natural-sorting/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Non-continuous-subsequences b/Lang/Elixir/Non-continuous-subsequences
new file mode 120000
index 0000000000..5c965fee80
--- /dev/null
+++ b/Lang/Elixir/Non-continuous-subsequences
@@ -0,0 +1 @@
+../../Task/Non-continuous-subsequences/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Number-reversal-game b/Lang/Elixir/Number-reversal-game
new file mode 120000
index 0000000000..c6bb0a1d97
--- /dev/null
+++ b/Lang/Elixir/Number-reversal-game
@@ -0,0 +1 @@
+../../Task/Number-reversal-game/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Odd-word-problem b/Lang/Elixir/Odd-word-problem
new file mode 120000
index 0000000000..90e73331ff
--- /dev/null
+++ b/Lang/Elixir/Odd-word-problem
@@ -0,0 +1 @@
+../../Task/Odd-word-problem/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Old-lady-swallowed-a-fly b/Lang/Elixir/Old-lady-swallowed-a-fly
new file mode 120000
index 0000000000..9c83ec2c70
--- /dev/null
+++ b/Lang/Elixir/Old-lady-swallowed-a-fly
@@ -0,0 +1 @@
+../../Task/Old-lady-swallowed-a-fly/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/One-of-n-lines-in-a-file b/Lang/Elixir/One-of-n-lines-in-a-file
new file mode 120000
index 0000000000..c1fbee26ba
--- /dev/null
+++ b/Lang/Elixir/One-of-n-lines-in-a-file
@@ -0,0 +1 @@
+../../Task/One-of-n-lines-in-a-file/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Optional-parameters b/Lang/Elixir/Optional-parameters
new file mode 120000
index 0000000000..a29f9aef25
--- /dev/null
+++ b/Lang/Elixir/Optional-parameters
@@ -0,0 +1 @@
+../../Task/Optional-parameters/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Order-disjoint-list-items b/Lang/Elixir/Order-disjoint-list-items
new file mode 120000
index 0000000000..ff767bf0bf
--- /dev/null
+++ b/Lang/Elixir/Order-disjoint-list-items
@@ -0,0 +1 @@
+../../Task/Order-disjoint-list-items/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Order-two-numerical-lists b/Lang/Elixir/Order-two-numerical-lists
new file mode 120000
index 0000000000..65712b2542
--- /dev/null
+++ b/Lang/Elixir/Order-two-numerical-lists
@@ -0,0 +1 @@
+../../Task/Order-two-numerical-lists/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Ordered-Partitions b/Lang/Elixir/Ordered-Partitions
new file mode 120000
index 0000000000..50931ce4a4
--- /dev/null
+++ b/Lang/Elixir/Ordered-Partitions
@@ -0,0 +1 @@
+../../Task/Ordered-Partitions/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Pattern-matching b/Lang/Elixir/Pattern-matching
new file mode 120000
index 0000000000..e619c68948
--- /dev/null
+++ b/Lang/Elixir/Pattern-matching
@@ -0,0 +1 @@
+../../Task/Pattern-matching/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Penneys-game b/Lang/Elixir/Penneys-game
new file mode 120000
index 0000000000..6b23af612c
--- /dev/null
+++ b/Lang/Elixir/Penneys-game
@@ -0,0 +1 @@
+../../Task/Penneys-game/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Playing-cards b/Lang/Elixir/Playing-cards
new file mode 120000
index 0000000000..1034da4b5b
--- /dev/null
+++ b/Lang/Elixir/Playing-cards
@@ -0,0 +1 @@
+../../Task/Playing-cards/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Polynomial-long-division b/Lang/Elixir/Polynomial-long-division
new file mode 120000
index 0000000000..31f6e14a61
--- /dev/null
+++ b/Lang/Elixir/Polynomial-long-division
@@ -0,0 +1 @@
+../../Task/Polynomial-long-division/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Priority-queue b/Lang/Elixir/Priority-queue
new file mode 120000
index 0000000000..995bf4b645
--- /dev/null
+++ b/Lang/Elixir/Priority-queue
@@ -0,0 +1 @@
+../../Task/Priority-queue/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Probabilistic-choice b/Lang/Elixir/Probabilistic-choice
new file mode 120000
index 0000000000..4e223af0b1
--- /dev/null
+++ b/Lang/Elixir/Probabilistic-choice
@@ -0,0 +1 @@
+../../Task/Probabilistic-choice/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Quickselect-algorithm b/Lang/Elixir/Quickselect-algorithm
new file mode 120000
index 0000000000..35f3a54f5f
--- /dev/null
+++ b/Lang/Elixir/Quickselect-algorithm
@@ -0,0 +1 @@
+../../Task/Quickselect-algorithm/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Ranking-methods b/Lang/Elixir/Ranking-methods
new file mode 120000
index 0000000000..519b84d03a
--- /dev/null
+++ b/Lang/Elixir/Ranking-methods
@@ -0,0 +1 @@
+../../Task/Ranking-methods/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Read-a-configuration-file b/Lang/Elixir/Read-a-configuration-file
new file mode 120000
index 0000000000..3818d04c78
--- /dev/null
+++ b/Lang/Elixir/Read-a-configuration-file
@@ -0,0 +1 @@
+../../Task/Read-a-configuration-file/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Real-constants-and-functions b/Lang/Elixir/Real-constants-and-functions
new file mode 120000
index 0000000000..b7844e6191
--- /dev/null
+++ b/Lang/Elixir/Real-constants-and-functions
@@ -0,0 +1 @@
+../../Task/Real-constants-and-functions/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Remove-lines-from-a-file b/Lang/Elixir/Remove-lines-from-a-file
new file mode 120000
index 0000000000..b3331d7ffa
--- /dev/null
+++ b/Lang/Elixir/Remove-lines-from-a-file
@@ -0,0 +1 @@
+../../Task/Remove-lines-from-a-file/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Rename-a-file b/Lang/Elixir/Rename-a-file
new file mode 120000
index 0000000000..665365246a
--- /dev/null
+++ b/Lang/Elixir/Rename-a-file
@@ -0,0 +1 @@
+../../Task/Rename-a-file/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Rep-string b/Lang/Elixir/Rep-string
new file mode 120000
index 0000000000..7b117fa72b
--- /dev/null
+++ b/Lang/Elixir/Rep-string
@@ -0,0 +1 @@
+../../Task/Rep-string/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Rock-paper-scissors b/Lang/Elixir/Rock-paper-scissors
new file mode 120000
index 0000000000..e5394da3ad
--- /dev/null
+++ b/Lang/Elixir/Rock-paper-scissors
@@ -0,0 +1 @@
+../../Task/Rock-paper-scissors/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Runtime-evaluation b/Lang/Elixir/Runtime-evaluation
new file mode 120000
index 0000000000..ad8fba8def
--- /dev/null
+++ b/Lang/Elixir/Runtime-evaluation
@@ -0,0 +1 @@
+../../Task/Runtime-evaluation/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/SEDOLs b/Lang/Elixir/SEDOLs
new file mode 120000
index 0000000000..a45f773aa9
--- /dev/null
+++ b/Lang/Elixir/SEDOLs
@@ -0,0 +1 @@
+../../Task/SEDOLs/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Self-describing-numbers b/Lang/Elixir/Self-describing-numbers
new file mode 120000
index 0000000000..7f273dea89
--- /dev/null
+++ b/Lang/Elixir/Self-describing-numbers
@@ -0,0 +1 @@
+../../Task/Self-describing-numbers/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Semiprime b/Lang/Elixir/Semiprime
new file mode 120000
index 0000000000..a00f892787
--- /dev/null
+++ b/Lang/Elixir/Semiprime
@@ -0,0 +1 @@
+../../Task/Semiprime/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Semordnilap b/Lang/Elixir/Semordnilap
new file mode 120000
index 0000000000..607b88ab2f
--- /dev/null
+++ b/Lang/Elixir/Semordnilap
@@ -0,0 +1 @@
+../../Task/Semordnilap/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sequence-of-non-squares b/Lang/Elixir/Sequence-of-non-squares
new file mode 120000
index 0000000000..2f32ac9d3f
--- /dev/null
+++ b/Lang/Elixir/Sequence-of-non-squares
@@ -0,0 +1 @@
+../../Task/Sequence-of-non-squares/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sequence-of-primes-by-Trial-Division b/Lang/Elixir/Sequence-of-primes-by-Trial-Division
new file mode 120000
index 0000000000..f4295be7a3
--- /dev/null
+++ b/Lang/Elixir/Sequence-of-primes-by-Trial-Division
@@ -0,0 +1 @@
+../../Task/Sequence-of-primes-by-Trial-Division/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Set-consolidation b/Lang/Elixir/Set-consolidation
new file mode 120000
index 0000000000..4af6937313
--- /dev/null
+++ b/Lang/Elixir/Set-consolidation
@@ -0,0 +1 @@
+../../Task/Set-consolidation/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Set-puzzle b/Lang/Elixir/Set-puzzle
new file mode 120000
index 0000000000..8fa7df715d
--- /dev/null
+++ b/Lang/Elixir/Set-puzzle
@@ -0,0 +1 @@
+../../Task/Set-puzzle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sleep b/Lang/Elixir/Sleep
new file mode 120000
index 0000000000..9951896703
--- /dev/null
+++ b/Lang/Elixir/Sleep
@@ -0,0 +1 @@
+../../Task/Sleep/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sockets b/Lang/Elixir/Sockets
new file mode 120000
index 0000000000..c95f661c1f
--- /dev/null
+++ b/Lang/Elixir/Sockets
@@ -0,0 +1 @@
+../../Task/Sockets/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sokoban b/Lang/Elixir/Sokoban
new file mode 120000
index 0000000000..dc8350cfa0
--- /dev/null
+++ b/Lang/Elixir/Sokoban
@@ -0,0 +1 @@
+../../Task/Sokoban/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Solve-a-Hidato-puzzle b/Lang/Elixir/Solve-a-Hidato-puzzle
new file mode 120000
index 0000000000..111ffc147d
--- /dev/null
+++ b/Lang/Elixir/Solve-a-Hidato-puzzle
@@ -0,0 +1 @@
+../../Task/Solve-a-Hidato-puzzle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Solve-a-Holy-Knights-tour b/Lang/Elixir/Solve-a-Holy-Knights-tour
new file mode 120000
index 0000000000..01c7ab58f5
--- /dev/null
+++ b/Lang/Elixir/Solve-a-Holy-Knights-tour
@@ -0,0 +1 @@
+../../Task/Solve-a-Holy-Knights-tour/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Solve-a-Hopido-puzzle b/Lang/Elixir/Solve-a-Hopido-puzzle
new file mode 120000
index 0000000000..a867198da0
--- /dev/null
+++ b/Lang/Elixir/Solve-a-Hopido-puzzle
@@ -0,0 +1 @@
+../../Task/Solve-a-Hopido-puzzle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Solve-a-Numbrix-puzzle b/Lang/Elixir/Solve-a-Numbrix-puzzle
new file mode 120000
index 0000000000..ed16cb7d9e
--- /dev/null
+++ b/Lang/Elixir/Solve-a-Numbrix-puzzle
@@ -0,0 +1 @@
+../../Task/Solve-a-Numbrix-puzzle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Solve-the-no-connection-puzzle b/Lang/Elixir/Solve-the-no-connection-puzzle
new file mode 120000
index 0000000000..a514b2584b
--- /dev/null
+++ b/Lang/Elixir/Solve-the-no-connection-puzzle
@@ -0,0 +1 @@
+../../Task/Solve-the-no-connection-puzzle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sort-using-a-custom-comparator b/Lang/Elixir/Sort-using-a-custom-comparator
new file mode 120000
index 0000000000..5759c13a85
--- /dev/null
+++ b/Lang/Elixir/Sort-using-a-custom-comparator
@@ -0,0 +1 @@
+../../Task/Sort-using-a-custom-comparator/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sorting-algorithms-Comb-sort b/Lang/Elixir/Sorting-algorithms-Comb-sort
new file mode 120000
index 0000000000..dcdbd601ab
--- /dev/null
+++ b/Lang/Elixir/Sorting-algorithms-Comb-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Comb-sort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sorting-algorithms-Heapsort b/Lang/Elixir/Sorting-algorithms-Heapsort
new file mode 120000
index 0000000000..68156714ca
--- /dev/null
+++ b/Lang/Elixir/Sorting-algorithms-Heapsort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Heapsort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sorting-algorithms-Permutation-sort b/Lang/Elixir/Sorting-algorithms-Permutation-sort
new file mode 120000
index 0000000000..6f0d01c44f
--- /dev/null
+++ b/Lang/Elixir/Sorting-algorithms-Permutation-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Permutation-sort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sorting-algorithms-Shell-sort b/Lang/Elixir/Sorting-algorithms-Shell-sort
new file mode 120000
index 0000000000..6a6583e7bd
--- /dev/null
+++ b/Lang/Elixir/Sorting-algorithms-Shell-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Shell-sort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sorting-algorithms-Sleep-sort b/Lang/Elixir/Sorting-algorithms-Sleep-sort
new file mode 120000
index 0000000000..5d41b3ca86
--- /dev/null
+++ b/Lang/Elixir/Sorting-algorithms-Sleep-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Sleep-sort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sorting-algorithms-Stooge-sort b/Lang/Elixir/Sorting-algorithms-Stooge-sort
new file mode 120000
index 0000000000..4632a56370
--- /dev/null
+++ b/Lang/Elixir/Sorting-algorithms-Stooge-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Stooge-sort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sorting-algorithms-Strand-sort b/Lang/Elixir/Sorting-algorithms-Strand-sort
new file mode 120000
index 0000000000..435b1797e3
--- /dev/null
+++ b/Lang/Elixir/Sorting-algorithms-Strand-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Strand-sort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Soundex b/Lang/Elixir/Soundex
new file mode 120000
index 0000000000..44dbabf5b7
--- /dev/null
+++ b/Lang/Elixir/Soundex
@@ -0,0 +1 @@
+../../Task/Soundex/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Stack-traces b/Lang/Elixir/Stack-traces
new file mode 120000
index 0000000000..1e9f276c7f
--- /dev/null
+++ b/Lang/Elixir/Stack-traces
@@ -0,0 +1 @@
+../../Task/Stack-traces/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Stair-climbing-puzzle b/Lang/Elixir/Stair-climbing-puzzle
new file mode 120000
index 0000000000..ec3edf9ff2
--- /dev/null
+++ b/Lang/Elixir/Stair-climbing-puzzle
@@ -0,0 +1 @@
+../../Task/Stair-climbing-puzzle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Statistics-Basic b/Lang/Elixir/Statistics-Basic
new file mode 120000
index 0000000000..0179a1c909
--- /dev/null
+++ b/Lang/Elixir/Statistics-Basic
@@ -0,0 +1 @@
+../../Task/Statistics-Basic/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Stern-Brocot-sequence b/Lang/Elixir/Stern-Brocot-sequence
new file mode 120000
index 0000000000..2f6c49b999
--- /dev/null
+++ b/Lang/Elixir/Stern-Brocot-sequence
@@ -0,0 +1 @@
+../../Task/Stern-Brocot-sequence/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Subtractive-generator b/Lang/Elixir/Subtractive-generator
new file mode 120000
index 0000000000..28184f1aa8
--- /dev/null
+++ b/Lang/Elixir/Subtractive-generator
@@ -0,0 +1 @@
+../../Task/Subtractive-generator/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Sutherland-Hodgman-polygon-clipping b/Lang/Elixir/Sutherland-Hodgman-polygon-clipping
new file mode 120000
index 0000000000..05243dfd01
--- /dev/null
+++ b/Lang/Elixir/Sutherland-Hodgman-polygon-clipping
@@ -0,0 +1 @@
+../../Task/Sutherland-Hodgman-polygon-clipping/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Synchronous-concurrency b/Lang/Elixir/Synchronous-concurrency
new file mode 120000
index 0000000000..0e3f49b996
--- /dev/null
+++ b/Lang/Elixir/Synchronous-concurrency
@@ -0,0 +1 @@
+../../Task/Synchronous-concurrency/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Take-notes-on-the-command-line b/Lang/Elixir/Take-notes-on-the-command-line
new file mode 120000
index 0000000000..71170e208d
--- /dev/null
+++ b/Lang/Elixir/Take-notes-on-the-command-line
@@ -0,0 +1 @@
+../../Task/Take-notes-on-the-command-line/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Topological-sort b/Lang/Elixir/Topological-sort
new file mode 120000
index 0000000000..e0ab7dbdc6
--- /dev/null
+++ b/Lang/Elixir/Topological-sort
@@ -0,0 +1 @@
+../../Task/Topological-sort/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Topswops b/Lang/Elixir/Topswops
new file mode 120000
index 0000000000..5f9b435d9e
--- /dev/null
+++ b/Lang/Elixir/Topswops
@@ -0,0 +1 @@
+../../Task/Topswops/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Trabb-Pardo-Knuth-algorithm b/Lang/Elixir/Trabb-Pardo-Knuth-algorithm
new file mode 120000
index 0000000000..47915268e5
--- /dev/null
+++ b/Lang/Elixir/Trabb-Pardo-Knuth-algorithm
@@ -0,0 +1 @@
+../../Task/Trabb-Pardo-Knuth-algorithm/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Tree-traversal b/Lang/Elixir/Tree-traversal
new file mode 120000
index 0000000000..088bc34d36
--- /dev/null
+++ b/Lang/Elixir/Tree-traversal
@@ -0,0 +1 @@
+../../Task/Tree-traversal/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Truncatable-primes b/Lang/Elixir/Truncatable-primes
new file mode 120000
index 0000000000..1342cea83b
--- /dev/null
+++ b/Lang/Elixir/Truncatable-primes
@@ -0,0 +1 @@
+../../Task/Truncatable-primes/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Unix-ls b/Lang/Elixir/Unix-ls
new file mode 120000
index 0000000000..eba6018ad3
--- /dev/null
+++ b/Lang/Elixir/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Vampire-number b/Lang/Elixir/Vampire-number
new file mode 120000
index 0000000000..746b135383
--- /dev/null
+++ b/Lang/Elixir/Vampire-number
@@ -0,0 +1 @@
+../../Task/Vampire-number/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Variable-size-Get b/Lang/Elixir/Variable-size-Get
new file mode 120000
index 0000000000..dda2f94922
--- /dev/null
+++ b/Lang/Elixir/Variable-size-Get
@@ -0,0 +1 @@
+../../Task/Variable-size-Get/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Vector-products b/Lang/Elixir/Vector-products
new file mode 120000
index 0000000000..7b5bbca5ed
--- /dev/null
+++ b/Lang/Elixir/Vector-products
@@ -0,0 +1 @@
+../../Task/Vector-products/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Verify-distribution-uniformity-Chi-squared-test b/Lang/Elixir/Verify-distribution-uniformity-Chi-squared-test
new file mode 120000
index 0000000000..b7cb2dff29
--- /dev/null
+++ b/Lang/Elixir/Verify-distribution-uniformity-Chi-squared-test
@@ -0,0 +1 @@
+../../Task/Verify-distribution-uniformity-Chi-squared-test/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Vigen-re-cipher b/Lang/Elixir/Vigen-re-cipher
new file mode 120000
index 0000000000..9457c06047
--- /dev/null
+++ b/Lang/Elixir/Vigen-re-cipher
@@ -0,0 +1 @@
+../../Task/Vigen-re-cipher/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Walk-a-directory-Non-recursively b/Lang/Elixir/Walk-a-directory-Non-recursively
new file mode 120000
index 0000000000..debe23f430
--- /dev/null
+++ b/Lang/Elixir/Walk-a-directory-Non-recursively
@@ -0,0 +1 @@
+../../Task/Walk-a-directory-Non-recursively/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Walk-a-directory-Recursively b/Lang/Elixir/Walk-a-directory-Recursively
new file mode 120000
index 0000000000..9e4cb3554c
--- /dev/null
+++ b/Lang/Elixir/Walk-a-directory-Recursively
@@ -0,0 +1 @@
+../../Task/Walk-a-directory-Recursively/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Wireworld b/Lang/Elixir/Wireworld
new file mode 120000
index 0000000000..287bde1483
--- /dev/null
+++ b/Lang/Elixir/Wireworld
@@ -0,0 +1 @@
+../../Task/Wireworld/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Write-float-arrays-to-a-text-file b/Lang/Elixir/Write-float-arrays-to-a-text-file
new file mode 120000
index 0000000000..f58f2ec175
--- /dev/null
+++ b/Lang/Elixir/Write-float-arrays-to-a-text-file
@@ -0,0 +1 @@
+../../Task/Write-float-arrays-to-a-text-file/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Zebra-puzzle b/Lang/Elixir/Zebra-puzzle
new file mode 120000
index 0000000000..0cc761d6a9
--- /dev/null
+++ b/Lang/Elixir/Zebra-puzzle
@@ -0,0 +1 @@
+../../Task/Zebra-puzzle/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Zeckendorf-number-representation b/Lang/Elixir/Zeckendorf-number-representation
new file mode 120000
index 0000000000..28b2a75a29
--- /dev/null
+++ b/Lang/Elixir/Zeckendorf-number-representation
@@ -0,0 +1 @@
+../../Task/Zeckendorf-number-representation/Elixir
\ No newline at end of file
diff --git a/Lang/Elixir/Zhang-Suen-thinning-algorithm b/Lang/Elixir/Zhang-Suen-thinning-algorithm
new file mode 120000
index 0000000000..f5943f9530
--- /dev/null
+++ b/Lang/Elixir/Zhang-Suen-thinning-algorithm
@@ -0,0 +1 @@
+../../Task/Zhang-Suen-thinning-algorithm/Elixir
\ No newline at end of file
diff --git a/Lang/Emacs-Lisp/Arithmetic-evaluation b/Lang/Emacs-Lisp/Arithmetic-evaluation
new file mode 120000
index 0000000000..8170bb20ba
--- /dev/null
+++ b/Lang/Emacs-Lisp/Arithmetic-evaluation
@@ -0,0 +1 @@
+../../Task/Arithmetic-evaluation/Emacs-Lisp
\ No newline at end of file
diff --git a/Lang/Emacs-Lisp/Array-concatenation b/Lang/Emacs-Lisp/Array-concatenation
new file mode 120000
index 0000000000..921ba449dc
--- /dev/null
+++ b/Lang/Emacs-Lisp/Array-concatenation
@@ -0,0 +1 @@
+../../Task/Array-concatenation/Emacs-Lisp
\ No newline at end of file
diff --git a/Lang/Emacs-Lisp/Combinations b/Lang/Emacs-Lisp/Combinations
new file mode 120000
index 0000000000..bf4547628c
--- /dev/null
+++ b/Lang/Emacs-Lisp/Combinations
@@ -0,0 +1 @@
+../../Task/Combinations/Emacs-Lisp
\ No newline at end of file
diff --git a/Lang/Emacs-Lisp/Conways-Game-of-Life b/Lang/Emacs-Lisp/Conways-Game-of-Life
new file mode 120000
index 0000000000..ec6023c351
--- /dev/null
+++ b/Lang/Emacs-Lisp/Conways-Game-of-Life
@@ -0,0 +1 @@
+../../Task/Conways-Game-of-Life/Emacs-Lisp
\ No newline at end of file
diff --git a/Lang/Emacs-Lisp/Date-format b/Lang/Emacs-Lisp/Date-format
new file mode 120000
index 0000000000..5ebbba386f
--- /dev/null
+++ b/Lang/Emacs-Lisp/Date-format
@@ -0,0 +1 @@
+../../Task/Date-format/Emacs-Lisp
\ No newline at end of file
diff --git a/Lang/Emacs-Lisp/Forest-fire b/Lang/Emacs-Lisp/Forest-fire
new file mode 120000
index 0000000000..bf1c104b41
--- /dev/null
+++ b/Lang/Emacs-Lisp/Forest-fire
@@ -0,0 +1 @@
+../../Task/Forest-fire/Emacs-Lisp
\ No newline at end of file
diff --git a/Lang/Emacs-Lisp/Walk-a-directory-Recursively b/Lang/Emacs-Lisp/Walk-a-directory-Recursively
new file mode 120000
index 0000000000..f9eea4a265
--- /dev/null
+++ b/Lang/Emacs-Lisp/Walk-a-directory-Recursively
@@ -0,0 +1 @@
+../../Task/Walk-a-directory-Recursively/Emacs-Lisp
\ No newline at end of file
diff --git a/Lang/Erlang/Euler-method b/Lang/Erlang/Euler-method
new file mode 120000
index 0000000000..dba7dcc25b
--- /dev/null
+++ b/Lang/Erlang/Euler-method
@@ -0,0 +1 @@
+../../Task/Euler-method/Erlang
\ No newline at end of file
diff --git a/Lang/Erlang/Fractran b/Lang/Erlang/Fractran
new file mode 120000
index 0000000000..561f423277
--- /dev/null
+++ b/Lang/Erlang/Fractran
@@ -0,0 +1 @@
+../../Task/Fractran/Erlang
\ No newline at end of file
diff --git a/Lang/Erlang/Holidays-related-to-Easter b/Lang/Erlang/Holidays-related-to-Easter
new file mode 120000
index 0000000000..e7fea7901c
--- /dev/null
+++ b/Lang/Erlang/Holidays-related-to-Easter
@@ -0,0 +1 @@
+../../Task/Holidays-related-to-Easter/Erlang
\ No newline at end of file
diff --git a/Lang/Erlang/Knapsack-problem-0-1 b/Lang/Erlang/Knapsack-problem-0-1
new file mode 120000
index 0000000000..08c079c2cb
--- /dev/null
+++ b/Lang/Erlang/Knapsack-problem-0-1
@@ -0,0 +1 @@
+../../Task/Knapsack-problem-0-1/Erlang
\ No newline at end of file
diff --git a/Lang/Erlang/The-Twelve-Days-of-Christmas b/Lang/Erlang/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..4db392ab67
--- /dev/null
+++ b/Lang/Erlang/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Erlang
\ No newline at end of file
diff --git a/Lang/Excel/Averages-Pythagorean-means b/Lang/Excel/Averages-Pythagorean-means
new file mode 120000
index 0000000000..6d016f3dbb
--- /dev/null
+++ b/Lang/Excel/Averages-Pythagorean-means
@@ -0,0 +1 @@
+../../Task/Averages-Pythagorean-means/Excel
\ No newline at end of file
diff --git a/Lang/Excel/Even-or-odd b/Lang/Excel/Even-or-odd
new file mode 120000
index 0000000000..b189d4dfaa
--- /dev/null
+++ b/Lang/Excel/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/Excel
\ No newline at end of file
diff --git a/Lang/Excel/Greatest-element-of-a-list b/Lang/Excel/Greatest-element-of-a-list
new file mode 120000
index 0000000000..a5bfc4c299
--- /dev/null
+++ b/Lang/Excel/Greatest-element-of-a-list
@@ -0,0 +1 @@
+../../Task/Greatest-element-of-a-list/Excel
\ No newline at end of file
diff --git a/Lang/F-Sharp/Calendar b/Lang/F-Sharp/Calendar
new file mode 120000
index 0000000000..91cb3c03cc
--- /dev/null
+++ b/Lang/F-Sharp/Calendar
@@ -0,0 +1 @@
+../../Task/Calendar/F-Sharp
\ No newline at end of file
diff --git a/Lang/Factor/Evaluate-binomial-coefficients b/Lang/Factor/Evaluate-binomial-coefficients
new file mode 120000
index 0000000000..864bffa4ed
--- /dev/null
+++ b/Lang/Factor/Evaluate-binomial-coefficients
@@ -0,0 +1 @@
+../../Task/Evaluate-binomial-coefficients/Factor
\ No newline at end of file
diff --git a/Lang/Factor/Nth b/Lang/Factor/Nth
new file mode 120000
index 0000000000..ca9976cb70
--- /dev/null
+++ b/Lang/Factor/Nth
@@ -0,0 +1 @@
+../../Task/Nth/Factor
\ No newline at end of file
diff --git a/Lang/Fantom/00DESCRIPTION b/Lang/Fantom/00DESCRIPTION
index 223fcc0a51..2ddf454f10 100644
--- a/Lang/Fantom/00DESCRIPTION
+++ b/Lang/Fantom/00DESCRIPTION
@@ -6,7 +6,7 @@
{{language programming paradigm|object-oriented}}
{{language programming paradigm|functional}}
-Fantom is a general purpose [[:Category:Programming paradigm/Object-oriented|object-oriented]] programming language that runs on the [[runs on vm::Java Virtual Machine|JRE]], [[.Net Framework|.NET]] [[runs on vm::Common Language Runtime|CLR]], and [[:Category:Javascript|Javascript]]. The language supports [[:Category:Programming paradigm/Functional|functional programming]] through closures and concurrency through the [[wp:Actor model|Actor model]]. Fantom takes a "middle of the road" approach to its type system, blending together aspects of both [[:Category:Typing/Checking/Static|static]] and [[:Category:Typing/Checking/Dynamic|dynamic typing]]. Like [[:Category:C sharp|C#]] and [[:Category:Java|Java]], Fantom uses a curly brace syntax.
+Fantom is a general purpose [[:Category:Programming paradigm/Object-oriented|object-oriented]] programming language that runs on the [[runs on vm::Java Virtual Machine|JRE]], [[.Net Framework|.NET]] [[runs on vm::Common Language Runtime|CLR]], and [[JavaScript]]. The language supports [[:Category:Programming paradigm/Functional|functional programming]] through closures and concurrency through the [[wp:Actor model|Actor model]]. Fantom takes a "middle of the road" approach to its type system, blending together aspects of both [[:Category:Typing/Checking/Static|static]] and [[:Category:Typing/Checking/Dynamic|dynamic typing]]. Like [[:Category:C sharp|C#]] and [[:Category:Java|Java]], Fantom uses a curly brace syntax.
==See also==
*[http://www.fantom.org/ Fantom homepage]
diff --git a/Lang/Fish/Factors-of-an-integer b/Lang/Fish/Factors-of-an-integer
new file mode 120000
index 0000000000..c86f078635
--- /dev/null
+++ b/Lang/Fish/Factors-of-an-integer
@@ -0,0 +1 @@
+../../Task/Factors-of-an-integer/Fish
\ No newline at end of file
diff --git a/Lang/Forth/CRC-32 b/Lang/Forth/CRC-32
new file mode 120000
index 0000000000..c59d6ff86f
--- /dev/null
+++ b/Lang/Forth/CRC-32
@@ -0,0 +1 @@
+../../Task/CRC-32/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Case-sensitivity-of-identifiers b/Lang/Forth/Case-sensitivity-of-identifiers
new file mode 120000
index 0000000000..f9ddc6ada8
--- /dev/null
+++ b/Lang/Forth/Case-sensitivity-of-identifiers
@@ -0,0 +1 @@
+../../Task/Case-sensitivity-of-identifiers/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Catamorphism b/Lang/Forth/Catamorphism
new file mode 120000
index 0000000000..e553c2d134
--- /dev/null
+++ b/Lang/Forth/Catamorphism
@@ -0,0 +1 @@
+../../Task/Catamorphism/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Closures-Value-capture b/Lang/Forth/Closures-Value-capture
new file mode 120000
index 0000000000..2f013a1495
--- /dev/null
+++ b/Lang/Forth/Closures-Value-capture
@@ -0,0 +1 @@
+../../Task/Closures-Value-capture/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Comma-quibbling b/Lang/Forth/Comma-quibbling
new file mode 120000
index 0000000000..5407d730de
--- /dev/null
+++ b/Lang/Forth/Comma-quibbling
@@ -0,0 +1 @@
+../../Task/Comma-quibbling/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Convert-decimal-number-to-rational b/Lang/Forth/Convert-decimal-number-to-rational
new file mode 120000
index 0000000000..b80e26593a
--- /dev/null
+++ b/Lang/Forth/Convert-decimal-number-to-rational
@@ -0,0 +1 @@
+../../Task/Convert-decimal-number-to-rational/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Create-an-HTML-table b/Lang/Forth/Create-an-HTML-table
new file mode 120000
index 0000000000..b0ccdf1bd5
--- /dev/null
+++ b/Lang/Forth/Create-an-HTML-table
@@ -0,0 +1 @@
+../../Task/Create-an-HTML-table/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Generate-Chess960-starting-position b/Lang/Forth/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..bf5e8d23dd
--- /dev/null
+++ b/Lang/Forth/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Guess-the-number b/Lang/Forth/Guess-the-number
new file mode 120000
index 0000000000..0f876badff
--- /dev/null
+++ b/Lang/Forth/Guess-the-number
@@ -0,0 +1 @@
+../../Task/Guess-the-number/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Hash-join b/Lang/Forth/Hash-join
new file mode 120000
index 0000000000..8b201aad1e
--- /dev/null
+++ b/Lang/Forth/Hash-join
@@ -0,0 +1 @@
+../../Task/Hash-join/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Hello-world-Line-printer b/Lang/Forth/Hello-world-Line-printer
new file mode 120000
index 0000000000..aaef9833ea
--- /dev/null
+++ b/Lang/Forth/Hello-world-Line-printer
@@ -0,0 +1 @@
+../../Task/Hello-world-Line-printer/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Morse-code b/Lang/Forth/Morse-code
new file mode 120000
index 0000000000..d8f9d770e5
--- /dev/null
+++ b/Lang/Forth/Morse-code
@@ -0,0 +1 @@
+../../Task/Morse-code/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Multifactorial b/Lang/Forth/Multifactorial
new file mode 120000
index 0000000000..d6e4006775
--- /dev/null
+++ b/Lang/Forth/Multifactorial
@@ -0,0 +1 @@
+../../Task/Multifactorial/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Queue-Usage b/Lang/Forth/Queue-Usage
new file mode 120000
index 0000000000..edf388450d
--- /dev/null
+++ b/Lang/Forth/Queue-Usage
@@ -0,0 +1 @@
+../../Task/Queue-Usage/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Read-a-configuration-file b/Lang/Forth/Read-a-configuration-file
new file mode 120000
index 0000000000..4fba38b0c1
--- /dev/null
+++ b/Lang/Forth/Read-a-configuration-file
@@ -0,0 +1 @@
+../../Task/Read-a-configuration-file/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Reverse-words-in-a-string b/Lang/Forth/Reverse-words-in-a-string
new file mode 120000
index 0000000000..002f41ae8d
--- /dev/null
+++ b/Lang/Forth/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Semordnilap b/Lang/Forth/Semordnilap
new file mode 120000
index 0000000000..91849fd956
--- /dev/null
+++ b/Lang/Forth/Semordnilap
@@ -0,0 +1 @@
+../../Task/Semordnilap/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Set b/Lang/Forth/Set
new file mode 120000
index 0000000000..486af3bc87
--- /dev/null
+++ b/Lang/Forth/Set
@@ -0,0 +1 @@
+../../Task/Set/Forth
\ No newline at end of file
diff --git a/Lang/Forth/String-prepend b/Lang/Forth/String-prepend
new file mode 120000
index 0000000000..a5b5c137c3
--- /dev/null
+++ b/Lang/Forth/String-prepend
@@ -0,0 +1 @@
+../../Task/String-prepend/Forth
\ No newline at end of file
diff --git a/Lang/Forth/The-Twelve-Days-of-Christmas b/Lang/Forth/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..ae0b230473
--- /dev/null
+++ b/Lang/Forth/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Topological-sort b/Lang/Forth/Topological-sort
new file mode 120000
index 0000000000..aee35359d7
--- /dev/null
+++ b/Lang/Forth/Topological-sort
@@ -0,0 +1 @@
+../../Task/Topological-sort/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Write-language-name-in-3D-ASCII b/Lang/Forth/Write-language-name-in-3D-ASCII
new file mode 120000
index 0000000000..be58c88a02
--- /dev/null
+++ b/Lang/Forth/Write-language-name-in-3D-ASCII
@@ -0,0 +1 @@
+../../Task/Write-language-name-in-3D-ASCII/Forth
\ No newline at end of file
diff --git a/Lang/Forth/Y-combinator b/Lang/Forth/Y-combinator
new file mode 120000
index 0000000000..ba5dd17ee7
--- /dev/null
+++ b/Lang/Forth/Y-combinator
@@ -0,0 +1 @@
+../../Task/Y-combinator/Forth
\ No newline at end of file
diff --git a/Lang/Fortran/00DESCRIPTION b/Lang/Fortran/00DESCRIPTION
index ffa37bc6aa..31b2e35530 100644
--- a/Lang/Fortran/00DESCRIPTION
+++ b/Lang/Fortran/00DESCRIPTION
@@ -7,7 +7,7 @@
|LCT=yes
|tags=fortran
|bnf=http://fortran.comsci.us/syntax/statement/index.html}}{{language programming paradigm|Imperative}}{{Language programming paradigm|Procedural}}{{Language programming paradigm|Object-oriented}}{{Language programming paradigm|Concurrent}}
-Fortran is the oldest programming language still in widespread use. The language has evolved considerably since it was first released in 1957. Fortran was original developed for scientific and engineering applications, and remains especially suited to numeric computation and scientific computing. By convention, versions before Fortran 90 are spelled with all uppercase letters (e.g. FORTRAN 66, FORTRAN 77), while starting with Fortran 90, the mixed case spelling is used (i.e. Fortran 90, Fortran 95, Fortran 2003 and Fortran 2008). The most recent standard is Fortran 2008 (ISO/IEC 1539-1:2010).
+Fortran is the oldest programming language still in widespread use. The language has evolved considerably since it was first released in 1957. Fortran was original developed for scientific and engineering applications, and remains especially suited to numeric computation and scientific computing. By convention, versions before Fortran 90 are spelled with all uppercase letters (e.g. FORTRAN 66, FORTRAN 77), while starting with Fortran 90, the mixed case spelling is used (i.e. Fortran 90, Fortran 95, Fortran 2003 and [http://j3-fortran.org/doc/year/12/12-007.pdf Fortran 2008]). The most recent standard is Fortran 2008 (ISO/IEC 1539-1:2010). The next, informally known as [http://j3-fortran.org/doc/year/16/16-007r2.pdf Fortran 2015], is underway.
FORTRAN 77, being quite old, lacks almost everything one expects from a modern programming language. It uses a fixed-length line and column oriented line format which was motivated by punch cards. Due to its age, and since FORTRAN compilers generally gave very good performance for numerical code, a lot of code, especially scientific code, was written in FORTRAN. Also, for quite a while there was no free Fortran 90 compiler, which also caused a lot of FORTRAN 77 code to be written even quite some time after Fortran 90 was standardized. Because of the large body of code written in FORTRAN 77 it remains relevant today. Indeed, every modern Fortran compiler still accepts FORTRAN 77 code.
diff --git a/Lang/Fortran/Align-columns b/Lang/Fortran/Align-columns
new file mode 120000
index 0000000000..2aac28e986
--- /dev/null
+++ b/Lang/Fortran/Align-columns
@@ -0,0 +1 @@
+../../Task/Align-columns/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Append-a-record-to-the-end-of-a-text-file b/Lang/Fortran/Append-a-record-to-the-end-of-a-text-file
new file mode 120000
index 0000000000..b43a38e067
--- /dev/null
+++ b/Lang/Fortran/Append-a-record-to-the-end-of-a-text-file
@@ -0,0 +1 @@
+../../Task/Append-a-record-to-the-end-of-a-text-file/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Arbitrary-precision-integers--included- b/Lang/Fortran/Arbitrary-precision-integers--included-
new file mode 120000
index 0000000000..5abd63a01b
--- /dev/null
+++ b/Lang/Fortran/Arbitrary-precision-integers--included-
@@ -0,0 +1 @@
+../../Task/Arbitrary-precision-integers--included-/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Arena-storage-pool b/Lang/Fortran/Arena-storage-pool
new file mode 120000
index 0000000000..7565b6bb64
--- /dev/null
+++ b/Lang/Fortran/Arena-storage-pool
@@ -0,0 +1 @@
+../../Task/Arena-storage-pool/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/CRC-32 b/Lang/Fortran/CRC-32
new file mode 120000
index 0000000000..470a28522f
--- /dev/null
+++ b/Lang/Fortran/CRC-32
@@ -0,0 +1 @@
+../../Task/CRC-32/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/CSV-data-manipulation b/Lang/Fortran/CSV-data-manipulation
new file mode 120000
index 0000000000..fa1c3ee65c
--- /dev/null
+++ b/Lang/Fortran/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/CSV-to-HTML-translation b/Lang/Fortran/CSV-to-HTML-translation
new file mode 120000
index 0000000000..56ab6479de
--- /dev/null
+++ b/Lang/Fortran/CSV-to-HTML-translation
@@ -0,0 +1 @@
+../../Task/CSV-to-HTML-translation/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Carmichael-3-strong-pseudoprimes b/Lang/Fortran/Carmichael-3-strong-pseudoprimes
new file mode 120000
index 0000000000..8211909df0
--- /dev/null
+++ b/Lang/Fortran/Carmichael-3-strong-pseudoprimes
@@ -0,0 +1 @@
+../../Task/Carmichael-3-strong-pseudoprimes/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Comma-quibbling b/Lang/Fortran/Comma-quibbling
new file mode 120000
index 0000000000..dbfaed3e62
--- /dev/null
+++ b/Lang/Fortran/Comma-quibbling
@@ -0,0 +1 @@
+../../Task/Comma-quibbling/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Constrained-genericity b/Lang/Fortran/Constrained-genericity
new file mode 120000
index 0000000000..7c64ce0ff6
--- /dev/null
+++ b/Lang/Fortran/Constrained-genericity
@@ -0,0 +1 @@
+../../Task/Constrained-genericity/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Convert-decimal-number-to-rational b/Lang/Fortran/Convert-decimal-number-to-rational
new file mode 120000
index 0000000000..a85711700a
--- /dev/null
+++ b/Lang/Fortran/Convert-decimal-number-to-rational
@@ -0,0 +1 @@
+../../Task/Convert-decimal-number-to-rational/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Create-an-HTML-table b/Lang/Fortran/Create-an-HTML-table
new file mode 120000
index 0000000000..85ccdb7b17
--- /dev/null
+++ b/Lang/Fortran/Create-an-HTML-table
@@ -0,0 +1 @@
+../../Task/Create-an-HTML-table/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Documentation b/Lang/Fortran/Documentation
new file mode 120000
index 0000000000..1d319c8307
--- /dev/null
+++ b/Lang/Fortran/Documentation
@@ -0,0 +1 @@
+../../Task/Documentation/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Execute-Brain---- b/Lang/Fortran/Execute-Brain----
new file mode 120000
index 0000000000..9335fe2292
--- /dev/null
+++ b/Lang/Fortran/Execute-Brain----
@@ -0,0 +1 @@
+../../Task/Execute-Brain----/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Extensible-prime-generator b/Lang/Fortran/Extensible-prime-generator
new file mode 120000
index 0000000000..1d72090180
--- /dev/null
+++ b/Lang/Fortran/Extensible-prime-generator
@@ -0,0 +1 @@
+../../Task/Extensible-prime-generator/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Extreme-floating-point-values b/Lang/Fortran/Extreme-floating-point-values
new file mode 120000
index 0000000000..5b3a5beb46
--- /dev/null
+++ b/Lang/Fortran/Extreme-floating-point-values
@@ -0,0 +1 @@
+../../Task/Extreme-floating-point-values/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/File-size b/Lang/Fortran/File-size
new file mode 120000
index 0000000000..766097ce99
--- /dev/null
+++ b/Lang/Fortran/File-size
@@ -0,0 +1 @@
+../../Task/File-size/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Find-the-last-Sunday-of-each-month b/Lang/Fortran/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..fd6c31bc80
--- /dev/null
+++ b/Lang/Fortran/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Flow-control-structures b/Lang/Fortran/Flow-control-structures
new file mode 120000
index 0000000000..1a431aa2bb
--- /dev/null
+++ b/Lang/Fortran/Flow-control-structures
@@ -0,0 +1 @@
+../../Task/Flow-control-structures/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Fractran b/Lang/Fortran/Fractran
new file mode 120000
index 0000000000..0e27c16d86
--- /dev/null
+++ b/Lang/Fortran/Fractran
@@ -0,0 +1 @@
+../../Task/Fractran/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Function-composition b/Lang/Fortran/Function-composition
new file mode 120000
index 0000000000..7ac91fed0e
--- /dev/null
+++ b/Lang/Fortran/Function-composition
@@ -0,0 +1 @@
+../../Task/Function-composition/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Generate-Chess960-starting-position b/Lang/Fortran/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..183803d817
--- /dev/null
+++ b/Lang/Fortran/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Globally-replace-text-in-several-files b/Lang/Fortran/Globally-replace-text-in-several-files
new file mode 120000
index 0000000000..47063a8957
--- /dev/null
+++ b/Lang/Fortran/Globally-replace-text-in-several-files
@@ -0,0 +1 @@
+../../Task/Globally-replace-text-in-several-files/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/HTTPS b/Lang/Fortran/HTTPS
new file mode 120000
index 0000000000..86feed7978
--- /dev/null
+++ b/Lang/Fortran/HTTPS
@@ -0,0 +1 @@
+../../Task/HTTPS/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Hello-world-Graphical b/Lang/Fortran/Hello-world-Graphical
new file mode 120000
index 0000000000..54c3a933d8
--- /dev/null
+++ b/Lang/Fortran/Hello-world-Graphical
@@ -0,0 +1 @@
+../../Task/Hello-world-Graphical/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Hello-world-Web-server b/Lang/Fortran/Hello-world-Web-server
new file mode 120000
index 0000000000..983c34542d
--- /dev/null
+++ b/Lang/Fortran/Hello-world-Web-server
@@ -0,0 +1 @@
+../../Task/Hello-world-Web-server/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Here-document b/Lang/Fortran/Here-document
new file mode 120000
index 0000000000..288332006b
--- /dev/null
+++ b/Lang/Fortran/Here-document
@@ -0,0 +1 @@
+../../Task/Here-document/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Inverted-syntax b/Lang/Fortran/Inverted-syntax
new file mode 120000
index 0000000000..d3a96ee814
--- /dev/null
+++ b/Lang/Fortran/Inverted-syntax
@@ -0,0 +1 @@
+../../Task/Inverted-syntax/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Jensens-Device b/Lang/Fortran/Jensens-Device
new file mode 120000
index 0000000000..5e99d9a6b1
--- /dev/null
+++ b/Lang/Fortran/Jensens-Device
@@ -0,0 +1 @@
+../../Task/Jensens-Device/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Fortran/Keyboard-input-Obtain-a-Y-or-N-response
new file mode 120000
index 0000000000..6d16cf002e
--- /dev/null
+++ b/Lang/Fortran/Keyboard-input-Obtain-a-Y-or-N-response
@@ -0,0 +1 @@
+../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Largest-int-from-concatenated-ints b/Lang/Fortran/Largest-int-from-concatenated-ints
new file mode 120000
index 0000000000..bbe8346190
--- /dev/null
+++ b/Lang/Fortran/Largest-int-from-concatenated-ints
@@ -0,0 +1 @@
+../../Task/Largest-int-from-concatenated-ints/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Literals-String b/Lang/Fortran/Literals-String
new file mode 120000
index 0000000000..7b0aeb09bf
--- /dev/null
+++ b/Lang/Fortran/Literals-String
@@ -0,0 +1 @@
+../../Task/Literals-String/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/MD5 b/Lang/Fortran/MD5
new file mode 120000
index 0000000000..0e3565b816
--- /dev/null
+++ b/Lang/Fortran/MD5
@@ -0,0 +1 @@
+../../Task/MD5/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Memory-layout-of-a-data-structure b/Lang/Fortran/Memory-layout-of-a-data-structure
new file mode 120000
index 0000000000..98524b62f9
--- /dev/null
+++ b/Lang/Fortran/Memory-layout-of-a-data-structure
@@ -0,0 +1 @@
+../../Task/Memory-layout-of-a-data-structure/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Multifactorial b/Lang/Fortran/Multifactorial
new file mode 120000
index 0000000000..ecb4c1cb64
--- /dev/null
+++ b/Lang/Fortran/Multifactorial
@@ -0,0 +1 @@
+../../Task/Multifactorial/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Numeric-error-propagation b/Lang/Fortran/Numeric-error-propagation
new file mode 120000
index 0000000000..620aee7a27
--- /dev/null
+++ b/Lang/Fortran/Numeric-error-propagation
@@ -0,0 +1 @@
+../../Task/Numeric-error-propagation/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Odd-word-problem b/Lang/Fortran/Odd-word-problem
new file mode 120000
index 0000000000..a4568c1c36
--- /dev/null
+++ b/Lang/Fortran/Odd-word-problem
@@ -0,0 +1 @@
+../../Task/Odd-word-problem/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Parsing-RPN-calculator-algorithm b/Lang/Fortran/Parsing-RPN-calculator-algorithm
new file mode 120000
index 0000000000..7d70404103
--- /dev/null
+++ b/Lang/Fortran/Parsing-RPN-calculator-algorithm
@@ -0,0 +1 @@
+../../Task/Parsing-RPN-calculator-algorithm/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Parsing-Shunting-yard-algorithm b/Lang/Fortran/Parsing-Shunting-yard-algorithm
new file mode 120000
index 0000000000..d3938ad519
--- /dev/null
+++ b/Lang/Fortran/Parsing-Shunting-yard-algorithm
@@ -0,0 +1 @@
+../../Task/Parsing-Shunting-yard-algorithm/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Phrase-reversals b/Lang/Fortran/Phrase-reversals
new file mode 120000
index 0000000000..d4faa62c3e
--- /dev/null
+++ b/Lang/Fortran/Phrase-reversals
@@ -0,0 +1 @@
+../../Task/Phrase-reversals/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Pi b/Lang/Fortran/Pi
new file mode 120000
index 0000000000..a12791827a
--- /dev/null
+++ b/Lang/Fortran/Pi
@@ -0,0 +1 @@
+../../Task/Pi/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Quickselect-algorithm b/Lang/Fortran/Quickselect-algorithm
new file mode 120000
index 0000000000..622b84bd42
--- /dev/null
+++ b/Lang/Fortran/Quickselect-algorithm
@@ -0,0 +1 @@
+../../Task/Quickselect-algorithm/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Range-expansion b/Lang/Fortran/Range-expansion
new file mode 120000
index 0000000000..a74f9d7ee7
--- /dev/null
+++ b/Lang/Fortran/Range-expansion
@@ -0,0 +1 @@
+../../Task/Range-expansion/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Range-extraction b/Lang/Fortran/Range-extraction
new file mode 120000
index 0000000000..92570c94e7
--- /dev/null
+++ b/Lang/Fortran/Range-extraction
@@ -0,0 +1 @@
+../../Task/Range-extraction/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Read-a-file-line-by-line b/Lang/Fortran/Read-a-file-line-by-line
new file mode 120000
index 0000000000..d9c3939e57
--- /dev/null
+++ b/Lang/Fortran/Read-a-file-line-by-line
@@ -0,0 +1 @@
+../../Task/Read-a-file-line-by-line/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Read-a-specific-line-from-a-file b/Lang/Fortran/Read-a-specific-line-from-a-file
new file mode 120000
index 0000000000..2b94345edf
--- /dev/null
+++ b/Lang/Fortran/Read-a-specific-line-from-a-file
@@ -0,0 +1 @@
+../../Task/Read-a-specific-line-from-a-file/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Read-entire-file b/Lang/Fortran/Read-entire-file
new file mode 120000
index 0000000000..6043e67796
--- /dev/null
+++ b/Lang/Fortran/Read-entire-file
@@ -0,0 +1 @@
+../../Task/Read-entire-file/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/SHA-1 b/Lang/Fortran/SHA-1
new file mode 120000
index 0000000000..ae9931027a
--- /dev/null
+++ b/Lang/Fortran/SHA-1
@@ -0,0 +1 @@
+../../Task/SHA-1/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/SHA-256 b/Lang/Fortran/SHA-256
new file mode 120000
index 0000000000..a7770c5275
--- /dev/null
+++ b/Lang/Fortran/SHA-256
@@ -0,0 +1 @@
+../../Task/SHA-256/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Secure-temporary-file b/Lang/Fortran/Secure-temporary-file
new file mode 120000
index 0000000000..829930cd62
--- /dev/null
+++ b/Lang/Fortran/Secure-temporary-file
@@ -0,0 +1 @@
+../../Task/Secure-temporary-file/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Send-email b/Lang/Fortran/Send-email
new file mode 120000
index 0000000000..9dc899cc43
--- /dev/null
+++ b/Lang/Fortran/Send-email
@@ -0,0 +1 @@
+../../Task/Send-email/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/String-prepend b/Lang/Fortran/String-prepend
new file mode 120000
index 0000000000..9ce3ce7f0e
--- /dev/null
+++ b/Lang/Fortran/String-prepend
@@ -0,0 +1 @@
+../../Task/String-prepend/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Strip-block-comments b/Lang/Fortran/Strip-block-comments
new file mode 120000
index 0000000000..bc88ba2e8a
--- /dev/null
+++ b/Lang/Fortran/Strip-block-comments
@@ -0,0 +1 @@
+../../Task/Strip-block-comments/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Terminal-control-Coloured-text b/Lang/Fortran/Terminal-control-Coloured-text
new file mode 120000
index 0000000000..b20a9de7e1
--- /dev/null
+++ b/Lang/Fortran/Terminal-control-Coloured-text
@@ -0,0 +1 @@
+../../Task/Terminal-control-Coloured-text/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Terminal-control-Cursor-positioning b/Lang/Fortran/Terminal-control-Cursor-positioning
new file mode 120000
index 0000000000..4f80f25525
--- /dev/null
+++ b/Lang/Fortran/Terminal-control-Cursor-positioning
@@ -0,0 +1 @@
+../../Task/Terminal-control-Cursor-positioning/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/The-Twelve-Days-of-Christmas b/Lang/Fortran/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..0687cc91e2
--- /dev/null
+++ b/Lang/Fortran/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Tree-traversal b/Lang/Fortran/Tree-traversal
new file mode 120000
index 0000000000..35a6776330
--- /dev/null
+++ b/Lang/Fortran/Tree-traversal
@@ -0,0 +1 @@
+../../Task/Tree-traversal/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Truncate-a-file b/Lang/Fortran/Truncate-a-file
new file mode 120000
index 0000000000..76c0aa497d
--- /dev/null
+++ b/Lang/Fortran/Truncate-a-file
@@ -0,0 +1 @@
+../../Task/Truncate-a-file/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Universal-Turing-machine b/Lang/Fortran/Universal-Turing-machine
new file mode 120000
index 0000000000..178c36c503
--- /dev/null
+++ b/Lang/Fortran/Universal-Turing-machine
@@ -0,0 +1 @@
+../../Task/Universal-Turing-machine/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Unix-ls b/Lang/Fortran/Unix-ls
new file mode 120000
index 0000000000..94755d6e3f
--- /dev/null
+++ b/Lang/Fortran/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Update-a-configuration-file b/Lang/Fortran/Update-a-configuration-file
new file mode 120000
index 0000000000..74717c0a29
--- /dev/null
+++ b/Lang/Fortran/Update-a-configuration-file
@@ -0,0 +1 @@
+../../Task/Update-a-configuration-file/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/Word-wrap b/Lang/Fortran/Word-wrap
new file mode 120000
index 0000000000..e81ff30d6e
--- /dev/null
+++ b/Lang/Fortran/Word-wrap
@@ -0,0 +1 @@
+../../Task/Word-wrap/Fortran
\ No newline at end of file
diff --git a/Lang/Fortran/XML-Input b/Lang/Fortran/XML-Input
new file mode 120000
index 0000000000..f081e9e035
--- /dev/null
+++ b/Lang/Fortran/XML-Input
@@ -0,0 +1 @@
+../../Task/XML-Input/Fortran
\ No newline at end of file
diff --git a/Lang/Frege/Fractal-tree b/Lang/Frege/Fractal-tree
new file mode 120000
index 0000000000..c3d7282016
--- /dev/null
+++ b/Lang/Frege/Fractal-tree
@@ -0,0 +1 @@
+../../Task/Fractal-tree/Frege
\ No newline at end of file
diff --git a/Lang/Frege/Greatest-common-divisor b/Lang/Frege/Greatest-common-divisor
new file mode 120000
index 0000000000..890ee07a89
--- /dev/null
+++ b/Lang/Frege/Greatest-common-divisor
@@ -0,0 +1 @@
+../../Task/Greatest-common-divisor/Frege
\ No newline at end of file
diff --git a/Lang/Frege/Hello-world-Graphical b/Lang/Frege/Hello-world-Graphical
new file mode 120000
index 0000000000..f304e9061d
--- /dev/null
+++ b/Lang/Frege/Hello-world-Graphical
@@ -0,0 +1 @@
+../../Task/Hello-world-Graphical/Frege
\ No newline at end of file
diff --git a/Lang/Frink/00DESCRIPTION b/Lang/Frink/00DESCRIPTION
index 9031493c2c..4d100df873 100644
--- a/Lang/Frink/00DESCRIPTION
+++ b/Lang/Frink/00DESCRIPTION
@@ -11,10 +11,10 @@ Frink runs on the JVM and on Android, and is available in the Android Market.
==See Also==
-*[http://futureboy.us/frinkdocs/ Frink] homepage, including full documentation.
-*[http://futureboy.us/frink/ Frink web-based interface]
-*[http://futureboy.us/frinkdocs/faq.html Frequently Asked Questions]
-*[http://futureboy.us/frinkdocs/fspdocs.html Frink Server Pages Documentation]
-*[http://futureboy.us/fsp/samples.fsp Sample Programs]
-*[http://futureboy.us/frinkdocs/LL4.html Presentation at Lightweight Languages 4, MIT]
+*[https://frinklang.org/ Frink] homepage, including full documentation.
+*[https://frinklang.org/frink/ Frink web-based interface]
+*[https://frinklang.org/faq.html Frequently Asked Questions]
+*[https://frinklang.org/fspdocs.html Frink Server Pages Documentation]
+*[https://frinklang.org/fsp/samples.fsp Sample Programs]
+*[https://frinklang.org/LL4.html Presentation at Lightweight Languages 4, MIT]
*[http://confreaks.net/videos/120-elcamp2010-frink Presentation at Emerging Languages Camp, 2010]
\ No newline at end of file
diff --git a/Lang/Frink/Arithmetic-Rational b/Lang/Frink/Arithmetic-Rational
new file mode 120000
index 0000000000..6e09d160f5
--- /dev/null
+++ b/Lang/Frink/Arithmetic-Rational
@@ -0,0 +1 @@
+../../Task/Arithmetic-Rational/Frink
\ No newline at end of file
diff --git a/Lang/Frink/Execute-a-system-command b/Lang/Frink/Execute-a-system-command
new file mode 120000
index 0000000000..2a7c1e9c66
--- /dev/null
+++ b/Lang/Frink/Execute-a-system-command
@@ -0,0 +1 @@
+../../Task/Execute-a-system-command/Frink
\ No newline at end of file
diff --git a/Lang/Frink/Hailstone-sequence b/Lang/Frink/Hailstone-sequence
new file mode 120000
index 0000000000..0301ffc11c
--- /dev/null
+++ b/Lang/Frink/Hailstone-sequence
@@ -0,0 +1 @@
+../../Task/Hailstone-sequence/Frink
\ No newline at end of file
diff --git a/Lang/Frink/Loops-Do-while b/Lang/Frink/Loops-Do-while
new file mode 120000
index 0000000000..39a6eacc16
--- /dev/null
+++ b/Lang/Frink/Loops-Do-while
@@ -0,0 +1 @@
+../../Task/Loops-Do-while/Frink
\ No newline at end of file
diff --git a/Lang/Frink/Percentage-difference-between-images b/Lang/Frink/Percentage-difference-between-images
new file mode 120000
index 0000000000..10ad395dd1
--- /dev/null
+++ b/Lang/Frink/Percentage-difference-between-images
@@ -0,0 +1 @@
+../../Task/Percentage-difference-between-images/Frink
\ No newline at end of file
diff --git a/Lang/GAP/Bernoulli-numbers b/Lang/GAP/Bernoulli-numbers
new file mode 120000
index 0000000000..af991174cf
--- /dev/null
+++ b/Lang/GAP/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/GAP
\ No newline at end of file
diff --git a/Lang/GAP/Check-Machin-like-formulas b/Lang/GAP/Check-Machin-like-formulas
new file mode 120000
index 0000000000..a79aca68c5
--- /dev/null
+++ b/Lang/GAP/Check-Machin-like-formulas
@@ -0,0 +1 @@
+../../Task/Check-Machin-like-formulas/GAP
\ No newline at end of file
diff --git a/Lang/GML/Wireworld b/Lang/GML/Wireworld
new file mode 120000
index 0000000000..c1cbf452c3
--- /dev/null
+++ b/Lang/GML/Wireworld
@@ -0,0 +1 @@
+../../Task/Wireworld/GML
\ No newline at end of file
diff --git a/Lang/Gambas/00DESCRIPTION b/Lang/Gambas/00DESCRIPTION
index 3bfe141f2a..1801824bc0 100644
--- a/Lang/Gambas/00DESCRIPTION
+++ b/Lang/Gambas/00DESCRIPTION
@@ -11,5 +11,4 @@
Gambas is a free development environment based on a [[Basic]] interpreter with object extensions, a bit like Visual Basic™ (but it is NOT a clone !).
-With Gambas, you can quickly design your program [[GUI]] with QT or GTK+, access [[MySQL]], [[PostgreSQL]], Firebird, ODBC and [[SQLite]] databases, pilot KDE applications with DCOP, translate your program into any language, create network applications easily, make 3D [[OpenGL]] applications, make CGI web applications, and so on...
-[http://www.papdan.com/seo-services-search-engine-optimisation.php Melbourne SEO Services] | [http://www.papdan.com/ Melbourne Web Developer] | [http://www.usapropertyinvestors.com.au USA Property Investment] | [http://www.phillro.com.au/p/industrial-2/airless-spray-packages-2/ Airless Spray]
\ No newline at end of file
+With Gambas, you can quickly design your program [[GUI]] with QT or GTK+, access [[MySQL]], [[PostgreSQL]], Firebird, ODBC and [[SQLite]] databases, pilot KDE applications with DCOP, translate your program into any language, create network applications easily, make 3D [[OpenGL]] applications, make CGI web applications, and so on...
\ No newline at end of file
diff --git a/Lang/Glee/Repeat-a-string b/Lang/Glee/Repeat-a-string
new file mode 120000
index 0000000000..e92b219395
--- /dev/null
+++ b/Lang/Glee/Repeat-a-string
@@ -0,0 +1 @@
+../../Task/Repeat-a-string/Glee
\ No newline at end of file
diff --git a/Lang/Go/00DESCRIPTION b/Lang/Go/00DESCRIPTION
index 026db41f29..5d3553ff07 100644
--- a/Lang/Go/00DESCRIPTION
+++ b/Lang/Go/00DESCRIPTION
@@ -19,10 +19,8 @@ Go is distributed under a [http://golang.org/LICENSE BSD-style license].
Not to be confused with [[:Category:Go!|Go!]]
==Links==
-*[[wp:Go (programming language)|Go in Wikipedia]]
+* [[wp:Go (programming language)|Go in Wikipedia]]
* [http://tour.golang.org/ Go Tour and Tutorial]
-* [http://golang.org/doc/devel/release.html Release History]
-** Release Notes: [http://golang.org/doc/go1.4 1.4], [http://golang.org/doc/go1.3 1.3], [http://golang.org/doc/go1.2 1.2], [http://golang.org/doc/go1.1 1.1], [http://golang.org/doc/go1 1.0]
* [http://golang.org/ref/spec Go language specification]
* [http://golang.org/pkg/ Go standard library documentation]
-* [http://go-lang.cat-v.org/ Go Language Resources]
\ No newline at end of file
+* [https://github.com/golang/go/wiki/ Community maintained Go wiki]
\ No newline at end of file
diff --git a/Lang/Go/Animation b/Lang/Go/Animation
new file mode 120000
index 0000000000..80017c7cd2
--- /dev/null
+++ b/Lang/Go/Animation
@@ -0,0 +1 @@
+../../Task/Animation/Go
\ No newline at end of file
diff --git a/Lang/Go/Compare-sorting-algorithms-performance b/Lang/Go/Compare-sorting-algorithms-performance
new file mode 120000
index 0000000000..f5c0d0191f
--- /dev/null
+++ b/Lang/Go/Compare-sorting-algorithms-performance
@@ -0,0 +1 @@
+../../Task/Compare-sorting-algorithms-performance/Go
\ No newline at end of file
diff --git a/Lang/Go/Dinesmans-multiple-dwelling-problem b/Lang/Go/Dinesmans-multiple-dwelling-problem
new file mode 120000
index 0000000000..1a632660d5
--- /dev/null
+++ b/Lang/Go/Dinesmans-multiple-dwelling-problem
@@ -0,0 +1 @@
+../../Task/Dinesmans-multiple-dwelling-problem/Go
\ No newline at end of file
diff --git a/Lang/Go/Heronian-triangles b/Lang/Go/Heronian-triangles
new file mode 120000
index 0000000000..49a357c1ee
--- /dev/null
+++ b/Lang/Go/Heronian-triangles
@@ -0,0 +1 @@
+../../Task/Heronian-triangles/Go
\ No newline at end of file
diff --git a/Lang/Go/Percolation-Mean-cluster-density b/Lang/Go/Percolation-Mean-cluster-density
new file mode 120000
index 0000000000..53629df1d8
--- /dev/null
+++ b/Lang/Go/Percolation-Mean-cluster-density
@@ -0,0 +1 @@
+../../Task/Percolation-Mean-cluster-density/Go
\ No newline at end of file
diff --git a/Lang/Go/Percolation-Mean-run-density b/Lang/Go/Percolation-Mean-run-density
new file mode 120000
index 0000000000..25b05d3662
--- /dev/null
+++ b/Lang/Go/Percolation-Mean-run-density
@@ -0,0 +1 @@
+../../Task/Percolation-Mean-run-density/Go
\ No newline at end of file
diff --git a/Lang/Go/Speech-synthesis b/Lang/Go/Speech-synthesis
new file mode 120000
index 0000000000..0e79792a10
--- /dev/null
+++ b/Lang/Go/Speech-synthesis
@@ -0,0 +1 @@
+../../Task/Speech-synthesis/Go
\ No newline at end of file
diff --git a/Lang/Go/Topic-variable b/Lang/Go/Topic-variable
new file mode 120000
index 0000000000..31ae4e7e8d
--- /dev/null
+++ b/Lang/Go/Topic-variable
@@ -0,0 +1 @@
+../../Task/Topic-variable/Go
\ No newline at end of file
diff --git a/Lang/Go/Ulam-spiral--for-primes- b/Lang/Go/Ulam-spiral--for-primes-
new file mode 120000
index 0000000000..67d395ba90
--- /dev/null
+++ b/Lang/Go/Ulam-spiral--for-primes-
@@ -0,0 +1 @@
+../../Task/Ulam-spiral--for-primes-/Go
\ No newline at end of file
diff --git a/Lang/Gosu/00DESCRIPTION b/Lang/Gosu/00DESCRIPTION
index fd83f91c6d..95b39e193f 100644
--- a/Lang/Gosu/00DESCRIPTION
+++ b/Lang/Gosu/00DESCRIPTION
@@ -5,5 +5,5 @@
{{Language programming paradigm|object-oriented}}
'''Gosu''' is [[runs on vm::JVM]]-based an imperative statically-typed object-oriented programming language that is designed to be expressive, easy-to-read, and reasonably fast. It started in 2002 in company called [http://guidewire.com/ Guidewire] as a internal language and was released in 2010 to the opensource world.
-* [http://lazygosu.org/ LazyGosu.org - nice community tutorial]
+* [http://lazygosu.github.io/ LazyGosu - nice community tutorial]
* [http://developers.slashdot.org/story/10/11/09/0510258/Gosu-Programming-Language-Released-To-Public Slashdot finds Gosu]
\ No newline at end of file
diff --git a/Lang/Groovy/Abundant,-deficient-and-perfect-number-classifications b/Lang/Groovy/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..cfbd88a9a6
--- /dev/null
+++ b/Lang/Groovy/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/Groovy
\ No newline at end of file
diff --git a/Lang/Groovy/Catamorphism b/Lang/Groovy/Catamorphism
new file mode 120000
index 0000000000..b917e155b3
--- /dev/null
+++ b/Lang/Groovy/Catamorphism
@@ -0,0 +1 @@
+../../Task/Catamorphism/Groovy
\ No newline at end of file
diff --git a/Lang/Groovy/Fibonacci-n-step-number-sequences b/Lang/Groovy/Fibonacci-n-step-number-sequences
new file mode 120000
index 0000000000..a31b034106
--- /dev/null
+++ b/Lang/Groovy/Fibonacci-n-step-number-sequences
@@ -0,0 +1 @@
+../../Task/Fibonacci-n-step-number-sequences/Groovy
\ No newline at end of file
diff --git a/Lang/Groovy/First-class-functions-Use-numbers-analogously b/Lang/Groovy/First-class-functions-Use-numbers-analogously
new file mode 120000
index 0000000000..66bb4387c3
--- /dev/null
+++ b/Lang/Groovy/First-class-functions-Use-numbers-analogously
@@ -0,0 +1 @@
+../../Task/First-class-functions-Use-numbers-analogously/Groovy
\ No newline at end of file
diff --git a/Lang/Groovy/Guess-the-number-With-feedback b/Lang/Groovy/Guess-the-number-With-feedback
new file mode 120000
index 0000000000..4eea17ca8e
--- /dev/null
+++ b/Lang/Groovy/Guess-the-number-With-feedback
@@ -0,0 +1 @@
+../../Task/Guess-the-number-With-feedback/Groovy
\ No newline at end of file
diff --git a/Lang/Groovy/Hello-world-Newbie b/Lang/Groovy/Hello-world-Newbie
new file mode 120000
index 0000000000..3e74eb958f
--- /dev/null
+++ b/Lang/Groovy/Hello-world-Newbie
@@ -0,0 +1 @@
+../../Task/Hello-world-Newbie/Groovy
\ No newline at end of file
diff --git a/Lang/Groovy/Window-creation-X11 b/Lang/Groovy/Window-creation-X11
new file mode 120000
index 0000000000..45cc71e8f7
--- /dev/null
+++ b/Lang/Groovy/Window-creation-X11
@@ -0,0 +1 @@
+../../Task/Window-creation-X11/Groovy
\ No newline at end of file
diff --git a/Lang/Haskell/Casting-out-nines b/Lang/Haskell/Casting-out-nines
new file mode 120000
index 0000000000..66bf458465
--- /dev/null
+++ b/Lang/Haskell/Casting-out-nines
@@ -0,0 +1 @@
+../../Task/Casting-out-nines/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Colour-bars-Display b/Lang/Haskell/Colour-bars-Display
new file mode 120000
index 0000000000..536edf20c7
--- /dev/null
+++ b/Lang/Haskell/Colour-bars-Display
@@ -0,0 +1 @@
+../../Task/Colour-bars-Display/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Conjugate-transpose b/Lang/Haskell/Conjugate-transpose
new file mode 120000
index 0000000000..105c118f64
--- /dev/null
+++ b/Lang/Haskell/Conjugate-transpose
@@ -0,0 +1 @@
+../../Task/Conjugate-transpose/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Find-the-last-Sunday-of-each-month b/Lang/Haskell/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..ba8f46736e
--- /dev/null
+++ b/Lang/Haskell/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/First-class-environments b/Lang/Haskell/First-class-environments
new file mode 120000
index 0000000000..6742816a18
--- /dev/null
+++ b/Lang/Haskell/First-class-environments
@@ -0,0 +1 @@
+../../Task/First-class-environments/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Galton-box-animation b/Lang/Haskell/Galton-box-animation
new file mode 120000
index 0000000000..12810e6a48
--- /dev/null
+++ b/Lang/Haskell/Galton-box-animation
@@ -0,0 +1 @@
+../../Task/Galton-box-animation/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Gaussian-elimination b/Lang/Haskell/Gaussian-elimination
new file mode 120000
index 0000000000..bb0e84535b
--- /dev/null
+++ b/Lang/Haskell/Gaussian-elimination
@@ -0,0 +1 @@
+../../Task/Gaussian-elimination/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Jump-anywhere b/Lang/Haskell/Jump-anywhere
new file mode 120000
index 0000000000..b9f08fc0e3
--- /dev/null
+++ b/Lang/Haskell/Jump-anywhere
@@ -0,0 +1 @@
+../../Task/Jump-anywhere/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/K-means++-clustering b/Lang/Haskell/K-means++-clustering
new file mode 120000
index 0000000000..8dd6f22b26
--- /dev/null
+++ b/Lang/Haskell/K-means++-clustering
@@ -0,0 +1 @@
+../../Task/K-means++-clustering/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Matrix-arithmetic b/Lang/Haskell/Matrix-arithmetic
new file mode 120000
index 0000000000..b1d9124e8a
--- /dev/null
+++ b/Lang/Haskell/Matrix-arithmetic
@@ -0,0 +1 @@
+../../Task/Matrix-arithmetic/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Numerical-integration-Gauss-Legendre-Quadrature b/Lang/Haskell/Numerical-integration-Gauss-Legendre-Quadrature
new file mode 120000
index 0000000000..8ec0dc6e70
--- /dev/null
+++ b/Lang/Haskell/Numerical-integration-Gauss-Legendre-Quadrature
@@ -0,0 +1 @@
+../../Task/Numerical-integration-Gauss-Legendre-Quadrature/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Order-disjoint-list-items b/Lang/Haskell/Order-disjoint-list-items
new file mode 120000
index 0000000000..13cb18429d
--- /dev/null
+++ b/Lang/Haskell/Order-disjoint-list-items
@@ -0,0 +1 @@
+../../Task/Order-disjoint-list-items/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Resistor-mesh b/Lang/Haskell/Resistor-mesh
new file mode 120000
index 0000000000..53f4ff85de
--- /dev/null
+++ b/Lang/Haskell/Resistor-mesh
@@ -0,0 +1 @@
+../../Task/Resistor-mesh/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Statistics-Basic b/Lang/Haskell/Statistics-Basic
new file mode 120000
index 0000000000..5792077697
--- /dev/null
+++ b/Lang/Haskell/Statistics-Basic
@@ -0,0 +1 @@
+../../Task/Statistics-Basic/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Update-a-configuration-file b/Lang/Haskell/Update-a-configuration-file
new file mode 120000
index 0000000000..51b08403bf
--- /dev/null
+++ b/Lang/Haskell/Update-a-configuration-file
@@ -0,0 +1 @@
+../../Task/Update-a-configuration-file/Haskell
\ No newline at end of file
diff --git a/Lang/Haskell/Variable-size-Set b/Lang/Haskell/Variable-size-Set
new file mode 120000
index 0000000000..c292c767c1
--- /dev/null
+++ b/Lang/Haskell/Variable-size-Set
@@ -0,0 +1 @@
+../../Task/Variable-size-Set/Haskell
\ No newline at end of file
diff --git a/Lang/Haxe/Matrix-transposition b/Lang/Haxe/Matrix-transposition
new file mode 120000
index 0000000000..6534fbfeb5
--- /dev/null
+++ b/Lang/Haxe/Matrix-transposition
@@ -0,0 +1 @@
+../../Task/Matrix-transposition/Haxe
\ No newline at end of file
diff --git a/Lang/Icon/Animation b/Lang/Icon/Animation
new file mode 120000
index 0000000000..b27c2b8b64
--- /dev/null
+++ b/Lang/Icon/Animation
@@ -0,0 +1 @@
+../../Task/Animation/Icon
\ No newline at end of file
diff --git a/Lang/Icon/Draw-a-clock b/Lang/Icon/Draw-a-clock
new file mode 120000
index 0000000000..491889e47a
--- /dev/null
+++ b/Lang/Icon/Draw-a-clock
@@ -0,0 +1 @@
+../../Task/Draw-a-clock/Icon
\ No newline at end of file
diff --git a/Lang/Icon/Terminal-control-Cursor-positioning b/Lang/Icon/Terminal-control-Cursor-positioning
new file mode 120000
index 0000000000..ed3757bd0d
--- /dev/null
+++ b/Lang/Icon/Terminal-control-Cursor-positioning
@@ -0,0 +1 @@
+../../Task/Terminal-control-Cursor-positioning/Icon
\ No newline at end of file
diff --git a/Lang/Io/Accumulator-factory b/Lang/Io/Accumulator-factory
new file mode 120000
index 0000000000..807a49c1f1
--- /dev/null
+++ b/Lang/Io/Accumulator-factory
@@ -0,0 +1 @@
+../../Task/Accumulator-factory/Io
\ No newline at end of file
diff --git a/Lang/Io/Anonymous-recursion b/Lang/Io/Anonymous-recursion
new file mode 120000
index 0000000000..10e6752b72
--- /dev/null
+++ b/Lang/Io/Anonymous-recursion
@@ -0,0 +1 @@
+../../Task/Anonymous-recursion/Io
\ No newline at end of file
diff --git a/Lang/Io/Associative-array-Iteration b/Lang/Io/Associative-array-Iteration
new file mode 120000
index 0000000000..762ce217e4
--- /dev/null
+++ b/Lang/Io/Associative-array-Iteration
@@ -0,0 +1 @@
+../../Task/Associative-array-Iteration/Io
\ No newline at end of file
diff --git a/Lang/Io/Character-codes b/Lang/Io/Character-codes
new file mode 120000
index 0000000000..b7b8f875f0
--- /dev/null
+++ b/Lang/Io/Character-codes
@@ -0,0 +1 @@
+../../Task/Character-codes/Io
\ No newline at end of file
diff --git a/Lang/Io/Closures-Value-capture b/Lang/Io/Closures-Value-capture
new file mode 120000
index 0000000000..3525ee93ce
--- /dev/null
+++ b/Lang/Io/Closures-Value-capture
@@ -0,0 +1 @@
+../../Task/Closures-Value-capture/Io
\ No newline at end of file
diff --git a/Lang/Io/Delegates b/Lang/Io/Delegates
new file mode 120000
index 0000000000..06f0c407b3
--- /dev/null
+++ b/Lang/Io/Delegates
@@ -0,0 +1 @@
+../../Task/Delegates/Io
\ No newline at end of file
diff --git a/Lang/Io/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/Io/Exceptions-Catch-an-exception-thrown-in-a-nested-call
new file mode 120000
index 0000000000..11523662cc
--- /dev/null
+++ b/Lang/Io/Exceptions-Catch-an-exception-thrown-in-a-nested-call
@@ -0,0 +1 @@
+../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/Io
\ No newline at end of file
diff --git a/Lang/Io/Executable-library b/Lang/Io/Executable-library
new file mode 120000
index 0000000000..5d57c687a4
--- /dev/null
+++ b/Lang/Io/Executable-library
@@ -0,0 +1 @@
+../../Task/Executable-library/Io
\ No newline at end of file
diff --git a/Lang/Io/Increment-a-numerical-string b/Lang/Io/Increment-a-numerical-string
new file mode 120000
index 0000000000..7aea379565
--- /dev/null
+++ b/Lang/Io/Increment-a-numerical-string
@@ -0,0 +1 @@
+../../Task/Increment-a-numerical-string/Io
\ No newline at end of file
diff --git a/Lang/Io/Inheritance-Multiple b/Lang/Io/Inheritance-Multiple
new file mode 120000
index 0000000000..05b671dadb
--- /dev/null
+++ b/Lang/Io/Inheritance-Multiple
@@ -0,0 +1 @@
+../../Task/Inheritance-Multiple/Io
\ No newline at end of file
diff --git a/Lang/Io/Levenshtein-distance b/Lang/Io/Levenshtein-distance
new file mode 120000
index 0000000000..3846060275
--- /dev/null
+++ b/Lang/Io/Levenshtein-distance
@@ -0,0 +1 @@
+../../Task/Levenshtein-distance/Io
\ No newline at end of file
diff --git a/Lang/Io/Loops-Break b/Lang/Io/Loops-Break
new file mode 120000
index 0000000000..deff27a73c
--- /dev/null
+++ b/Lang/Io/Loops-Break
@@ -0,0 +1 @@
+../../Task/Loops-Break/Io
\ No newline at end of file
diff --git a/Lang/Io/Loops-Continue b/Lang/Io/Loops-Continue
new file mode 120000
index 0000000000..ce6b4223ef
--- /dev/null
+++ b/Lang/Io/Loops-Continue
@@ -0,0 +1 @@
+../../Task/Loops-Continue/Io
\ No newline at end of file
diff --git a/Lang/Io/Loops-Downward-for b/Lang/Io/Loops-Downward-for
new file mode 120000
index 0000000000..0d0ef6b135
--- /dev/null
+++ b/Lang/Io/Loops-Downward-for
@@ -0,0 +1 @@
+../../Task/Loops-Downward-for/Io
\ No newline at end of file
diff --git a/Lang/Io/Loops-For-with-a-specified-step b/Lang/Io/Loops-For-with-a-specified-step
new file mode 120000
index 0000000000..211e16693a
--- /dev/null
+++ b/Lang/Io/Loops-For-with-a-specified-step
@@ -0,0 +1 @@
+../../Task/Loops-For-with-a-specified-step/Io
\ No newline at end of file
diff --git a/Lang/Io/Ordered-words b/Lang/Io/Ordered-words
new file mode 120000
index 0000000000..c6867509a0
--- /dev/null
+++ b/Lang/Io/Ordered-words
@@ -0,0 +1 @@
+../../Task/Ordered-words/Io
\ No newline at end of file
diff --git a/Lang/Io/Pangram-checker b/Lang/Io/Pangram-checker
new file mode 120000
index 0000000000..447c4ea7bf
--- /dev/null
+++ b/Lang/Io/Pangram-checker
@@ -0,0 +1 @@
+../../Task/Pangram-checker/Io
\ No newline at end of file
diff --git a/Lang/Io/Respond-to-an-unknown-method-call b/Lang/Io/Respond-to-an-unknown-method-call
new file mode 120000
index 0000000000..60e0b3b496
--- /dev/null
+++ b/Lang/Io/Respond-to-an-unknown-method-call
@@ -0,0 +1 @@
+../../Task/Respond-to-an-unknown-method-call/Io
\ No newline at end of file
diff --git a/Lang/Io/Search-a-list b/Lang/Io/Search-a-list
new file mode 120000
index 0000000000..8f5d47e37b
--- /dev/null
+++ b/Lang/Io/Search-a-list
@@ -0,0 +1 @@
+../../Task/Search-a-list/Io
\ No newline at end of file
diff --git a/Lang/Io/Send-an-unknown-method-call b/Lang/Io/Send-an-unknown-method-call
new file mode 120000
index 0000000000..873fefd943
--- /dev/null
+++ b/Lang/Io/Send-an-unknown-method-call
@@ -0,0 +1 @@
+../../Task/Send-an-unknown-method-call/Io
\ No newline at end of file
diff --git a/Lang/Io/Short-circuit-evaluation b/Lang/Io/Short-circuit-evaluation
new file mode 120000
index 0000000000..fcb4afc2d1
--- /dev/null
+++ b/Lang/Io/Short-circuit-evaluation
@@ -0,0 +1 @@
+../../Task/Short-circuit-evaluation/Io
\ No newline at end of file
diff --git a/Lang/Io/Sierpinski-carpet b/Lang/Io/Sierpinski-carpet
new file mode 120000
index 0000000000..56d1141d4f
--- /dev/null
+++ b/Lang/Io/Sierpinski-carpet
@@ -0,0 +1 @@
+../../Task/Sierpinski-carpet/Io
\ No newline at end of file
diff --git a/Lang/Io/Sort-disjoint-sublist b/Lang/Io/Sort-disjoint-sublist
new file mode 120000
index 0000000000..c1109b03fc
--- /dev/null
+++ b/Lang/Io/Sort-disjoint-sublist
@@ -0,0 +1 @@
+../../Task/Sort-disjoint-sublist/Io
\ No newline at end of file
diff --git a/Lang/Io/Textonyms b/Lang/Io/Textonyms
new file mode 120000
index 0000000000..24240b93cb
--- /dev/null
+++ b/Lang/Io/Textonyms
@@ -0,0 +1 @@
+../../Task/Textonyms/Io
\ No newline at end of file
diff --git a/Lang/J/00DESCRIPTION b/Lang/J/00DESCRIPTION
index a4c5cf1794..def3c6335b 100644
--- a/Lang/J/00DESCRIPTION
+++ b/Lang/J/00DESCRIPTION
@@ -75,13 +75,13 @@ Discussion of the goals of the J community on RC and general guidelines for pres
== Jedi on RosettaCode ==
-*[[User:Roger_Hui|Roger Hui]]: [[Special:Contributions/Roger_Hui|contributions]], [[j:RogerHui|J wiki]]
-*[[User:TBH|Tracy Harms]]: [[Special:Contributions/TBH|contributions]], [[j:TracyHarms|J wiki]]
-*[[User:DanBron|Dan Bron]]: [[Special:Contributions/DanBron|contributions]], [[j:DanBron|J wiki]]
+*[[User:Roger_Hui|Roger Hui]]: [[Special:Contributions/Roger_Hui|contributions]], [[j:User:RogerHui|J wiki]]
+*[[User:TBH|Tracy Harms]]: [[Special:Contributions/TBH|contributions]], [[j:User:TracyHarms|J wiki]]
+*[[User:DanBron|Dan Bron]]: [[Special:Contributions/DanBron|contributions]], [[j:User:DanBron|J wiki]]
*[[User:Gaaijz|Arie Groeneveld]]: [[Special:Contributions/Gaaijz|contributions]]
-*[[User:Rdm|Raul Miller]]: [[Special:Contributions/Rdm|contributions]], [[j:Raul_Miller|J wiki]]
+*[[User:Rdm|Raul Miller]]: [[Special:Contributions/Rdm|contributions]], [[j:User:Raul_Miller|J wiki]]
*[[User:96.57.161.34|Jose Quintana]]: [[Special:Contributions/96.57.161.34|contributions]], [[j:Stories/JoseQuintana|J wiki]]
-*[[User:tikkanz|Ric Sherlock]]: [[Special:Contributions/tikkanz|contributions]], [[j:RicSherlock|J wiki]]
+*[[User:tikkanz|Ric Sherlock]]: [[Special:Contributions/tikkanz|contributions]], [[j:User:RicSherlock|J wiki]]
*[[User:Avmich|Avmich]]: [[Special:Contributions/Avmich|contributions]]
*[[User:VZC|VZC]]: [[Special:Contributions/VZC|contributions]]
*[[User:Bathala|Alex 'bathala' Rufon]]: [[Special:Contributions/Bathala|contributions]], [[j:bathala|J wiki]]
diff --git a/Lang/J/Metronome b/Lang/J/Metronome
new file mode 120000
index 0000000000..1dae0ebafe
--- /dev/null
+++ b/Lang/J/Metronome
@@ -0,0 +1 @@
+../../Task/Metronome/J
\ No newline at end of file
diff --git a/Lang/J/SHA-256 b/Lang/J/SHA-256
new file mode 120000
index 0000000000..ad914e85e8
--- /dev/null
+++ b/Lang/J/SHA-256
@@ -0,0 +1 @@
+../../Task/SHA-256/J
\ No newline at end of file
diff --git a/Lang/J/Scope-Function-names-and-labels b/Lang/J/Scope-Function-names-and-labels
new file mode 120000
index 0000000000..83ae317a58
--- /dev/null
+++ b/Lang/J/Scope-Function-names-and-labels
@@ -0,0 +1 @@
+../../Task/Scope-Function-names-and-labels/J
\ No newline at end of file
diff --git a/Lang/Java/9-billion-names-of-God-the-integer b/Lang/Java/9-billion-names-of-God-the-integer
new file mode 120000
index 0000000000..172e989f0d
--- /dev/null
+++ b/Lang/Java/9-billion-names-of-God-the-integer
@@ -0,0 +1 @@
+../../Task/9-billion-names-of-God-the-integer/Java
\ No newline at end of file
diff --git a/Lang/Java/Abundant,-deficient-and-perfect-number-classifications b/Lang/Java/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..634879cabf
--- /dev/null
+++ b/Lang/Java/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/Java
\ No newline at end of file
diff --git a/Lang/Java/Aliquot-sequence-classifications b/Lang/Java/Aliquot-sequence-classifications
new file mode 120000
index 0000000000..ac989b28df
--- /dev/null
+++ b/Lang/Java/Aliquot-sequence-classifications
@@ -0,0 +1 @@
+../../Task/Aliquot-sequence-classifications/Java
\ No newline at end of file
diff --git a/Lang/Java/Amicable-pairs b/Lang/Java/Amicable-pairs
new file mode 120000
index 0000000000..aa3d62cb23
--- /dev/null
+++ b/Lang/Java/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/Java
\ No newline at end of file
diff --git a/Lang/Java/Average-loop-length b/Lang/Java/Average-loop-length
new file mode 120000
index 0000000000..529e06c2f1
--- /dev/null
+++ b/Lang/Java/Average-loop-length
@@ -0,0 +1 @@
+../../Task/Average-loop-length/Java
\ No newline at end of file
diff --git a/Lang/Java/Bernoulli-numbers b/Lang/Java/Bernoulli-numbers
new file mode 120000
index 0000000000..153a1f15d0
--- /dev/null
+++ b/Lang/Java/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/Java
\ No newline at end of file
diff --git a/Lang/Java/Bitmap-Histogram b/Lang/Java/Bitmap-Histogram
new file mode 120000
index 0000000000..3ca904f913
--- /dev/null
+++ b/Lang/Java/Bitmap-Histogram
@@ -0,0 +1 @@
+../../Task/Bitmap-Histogram/Java
\ No newline at end of file
diff --git a/Lang/Java/Carmichael-3-strong-pseudoprimes b/Lang/Java/Carmichael-3-strong-pseudoprimes
new file mode 120000
index 0000000000..1d81c7aaa9
--- /dev/null
+++ b/Lang/Java/Carmichael-3-strong-pseudoprimes
@@ -0,0 +1 @@
+../../Task/Carmichael-3-strong-pseudoprimes/Java
\ No newline at end of file
diff --git a/Lang/Java/Casting-out-nines b/Lang/Java/Casting-out-nines
new file mode 120000
index 0000000000..efeb6a08e2
--- /dev/null
+++ b/Lang/Java/Casting-out-nines
@@ -0,0 +1 @@
+../../Task/Casting-out-nines/Java
\ No newline at end of file
diff --git a/Lang/Java/Catalan-numbers-Pascals-triangle b/Lang/Java/Catalan-numbers-Pascals-triangle
new file mode 120000
index 0000000000..945ca0307e
--- /dev/null
+++ b/Lang/Java/Catalan-numbers-Pascals-triangle
@@ -0,0 +1 @@
+../../Task/Catalan-numbers-Pascals-triangle/Java
\ No newline at end of file
diff --git a/Lang/Java/Chinese-remainder-theorem b/Lang/Java/Chinese-remainder-theorem
new file mode 120000
index 0000000000..a7c57aeeaa
--- /dev/null
+++ b/Lang/Java/Chinese-remainder-theorem
@@ -0,0 +1 @@
+../../Task/Chinese-remainder-theorem/Java
\ No newline at end of file
diff --git a/Lang/Java/Continued-fraction b/Lang/Java/Continued-fraction
new file mode 120000
index 0000000000..8093f7578c
--- /dev/null
+++ b/Lang/Java/Continued-fraction
@@ -0,0 +1 @@
+../../Task/Continued-fraction/Java
\ No newline at end of file
diff --git a/Lang/Java/Convert-decimal-number-to-rational b/Lang/Java/Convert-decimal-number-to-rational
new file mode 120000
index 0000000000..3fcc28ced9
--- /dev/null
+++ b/Lang/Java/Convert-decimal-number-to-rational
@@ -0,0 +1 @@
+../../Task/Convert-decimal-number-to-rational/Java
\ No newline at end of file
diff --git a/Lang/Java/Cut-a-rectangle b/Lang/Java/Cut-a-rectangle
new file mode 120000
index 0000000000..ca4a2550ed
--- /dev/null
+++ b/Lang/Java/Cut-a-rectangle
@@ -0,0 +1 @@
+../../Task/Cut-a-rectangle/Java
\ No newline at end of file
diff --git a/Lang/Java/Death-Star b/Lang/Java/Death-Star
new file mode 120000
index 0000000000..2b8b6ea082
--- /dev/null
+++ b/Lang/Java/Death-Star
@@ -0,0 +1 @@
+../../Task/Death-Star/Java
\ No newline at end of file
diff --git a/Lang/Java/Element-wise-operations b/Lang/Java/Element-wise-operations
new file mode 120000
index 0000000000..a609a8c302
--- /dev/null
+++ b/Lang/Java/Element-wise-operations
@@ -0,0 +1 @@
+../../Task/Element-wise-operations/Java
\ No newline at end of file
diff --git a/Lang/Java/Fast-Fourier-transform b/Lang/Java/Fast-Fourier-transform
new file mode 120000
index 0000000000..71b5150020
--- /dev/null
+++ b/Lang/Java/Fast-Fourier-transform
@@ -0,0 +1 @@
+../../Task/Fast-Fourier-transform/Java
\ No newline at end of file
diff --git a/Lang/Java/Fibonacci-word-fractal b/Lang/Java/Fibonacci-word-fractal
new file mode 120000
index 0000000000..edcc184cb3
--- /dev/null
+++ b/Lang/Java/Fibonacci-word-fractal
@@ -0,0 +1 @@
+../../Task/Fibonacci-word-fractal/Java
\ No newline at end of file
diff --git a/Lang/Java/Flipping-bits-game b/Lang/Java/Flipping-bits-game
new file mode 120000
index 0000000000..2cfe0f4ec4
--- /dev/null
+++ b/Lang/Java/Flipping-bits-game
@@ -0,0 +1 @@
+../../Task/Flipping-bits-game/Java
\ No newline at end of file
diff --git a/Lang/Java/Generator-Exponential b/Lang/Java/Generator-Exponential
new file mode 120000
index 0000000000..9bbe4fbbbe
--- /dev/null
+++ b/Lang/Java/Generator-Exponential
@@ -0,0 +1 @@
+../../Task/Generator-Exponential/Java
\ No newline at end of file
diff --git a/Lang/Java/Hash-join b/Lang/Java/Hash-join
new file mode 120000
index 0000000000..666d84bbc3
--- /dev/null
+++ b/Lang/Java/Hash-join
@@ -0,0 +1 @@
+../../Task/Hash-join/Java
\ No newline at end of file
diff --git a/Lang/Java/Hickerson-series-of-almost-integers b/Lang/Java/Hickerson-series-of-almost-integers
new file mode 120000
index 0000000000..b5a3d5010d
--- /dev/null
+++ b/Lang/Java/Hickerson-series-of-almost-integers
@@ -0,0 +1 @@
+../../Task/Hickerson-series-of-almost-integers/Java
\ No newline at end of file
diff --git a/Lang/Java/Keyboard-input-Keypress-check b/Lang/Java/Keyboard-input-Keypress-check
new file mode 120000
index 0000000000..b6c840ccc9
--- /dev/null
+++ b/Lang/Java/Keyboard-input-Keypress-check
@@ -0,0 +1 @@
+../../Task/Keyboard-input-Keypress-check/Java
\ No newline at end of file
diff --git a/Lang/Java/LU-decomposition b/Lang/Java/LU-decomposition
new file mode 120000
index 0000000000..138b2cf68c
--- /dev/null
+++ b/Lang/Java/LU-decomposition
@@ -0,0 +1 @@
+../../Task/LU-decomposition/Java
\ No newline at end of file
diff --git a/Lang/Java/Linear-congruential-generator b/Lang/Java/Linear-congruential-generator
new file mode 120000
index 0000000000..d6495276d6
--- /dev/null
+++ b/Lang/Java/Linear-congruential-generator
@@ -0,0 +1 @@
+../../Task/Linear-congruential-generator/Java
\ No newline at end of file
diff --git a/Lang/Java/Matrix-arithmetic b/Lang/Java/Matrix-arithmetic
new file mode 120000
index 0000000000..453a880a39
--- /dev/null
+++ b/Lang/Java/Matrix-arithmetic
@@ -0,0 +1 @@
+../../Task/Matrix-arithmetic/Java
\ No newline at end of file
diff --git a/Lang/Java/Metronome b/Lang/Java/Metronome
new file mode 120000
index 0000000000..d39410b41f
--- /dev/null
+++ b/Lang/Java/Metronome
@@ -0,0 +1 @@
+../../Task/Metronome/Java
\ No newline at end of file
diff --git a/Lang/Java/Morse-code b/Lang/Java/Morse-code
new file mode 120000
index 0000000000..a95577c1a4
--- /dev/null
+++ b/Lang/Java/Morse-code
@@ -0,0 +1 @@
+../../Task/Morse-code/Java
\ No newline at end of file
diff --git a/Lang/Java/Numerical-integration-Gauss-Legendre-Quadrature b/Lang/Java/Numerical-integration-Gauss-Legendre-Quadrature
new file mode 120000
index 0000000000..ac657cc937
--- /dev/null
+++ b/Lang/Java/Numerical-integration-Gauss-Legendre-Quadrature
@@ -0,0 +1 @@
+../../Task/Numerical-integration-Gauss-Legendre-Quadrature/Java
\ No newline at end of file
diff --git a/Lang/Java/Paraffins b/Lang/Java/Paraffins
new file mode 120000
index 0000000000..873d014c09
--- /dev/null
+++ b/Lang/Java/Paraffins
@@ -0,0 +1 @@
+../../Task/Paraffins/Java
\ No newline at end of file
diff --git a/Lang/Java/Rate-counter b/Lang/Java/Rate-counter
new file mode 120000
index 0000000000..99688df6c5
--- /dev/null
+++ b/Lang/Java/Rate-counter
@@ -0,0 +1 @@
+../../Task/Rate-counter/Java
\ No newline at end of file
diff --git a/Lang/Java/Ray-casting-algorithm b/Lang/Java/Ray-casting-algorithm
new file mode 120000
index 0000000000..e89f41dfe4
--- /dev/null
+++ b/Lang/Java/Ray-casting-algorithm
@@ -0,0 +1 @@
+../../Task/Ray-casting-algorithm/Java
\ No newline at end of file
diff --git a/Lang/Java/Runge-Kutta-method b/Lang/Java/Runge-Kutta-method
new file mode 120000
index 0000000000..63afb65a4c
--- /dev/null
+++ b/Lang/Java/Runge-Kutta-method
@@ -0,0 +1 @@
+../../Task/Runge-Kutta-method/Java
\ No newline at end of file
diff --git a/Lang/Java/Sequence-of-primes-by-Trial-Division b/Lang/Java/Sequence-of-primes-by-Trial-Division
new file mode 120000
index 0000000000..0b9491dfb7
--- /dev/null
+++ b/Lang/Java/Sequence-of-primes-by-Trial-Division
@@ -0,0 +1 @@
+../../Task/Sequence-of-primes-by-Trial-Division/Java
\ No newline at end of file
diff --git a/Lang/Java/Sokoban b/Lang/Java/Sokoban
new file mode 120000
index 0000000000..74730d7839
--- /dev/null
+++ b/Lang/Java/Sokoban
@@ -0,0 +1 @@
+../../Task/Sokoban/Java
\ No newline at end of file
diff --git a/Lang/Java/Solve-a-Holy-Knights-tour b/Lang/Java/Solve-a-Holy-Knights-tour
new file mode 120000
index 0000000000..a93e5727b2
--- /dev/null
+++ b/Lang/Java/Solve-a-Holy-Knights-tour
@@ -0,0 +1 @@
+../../Task/Solve-a-Holy-Knights-tour/Java
\ No newline at end of file
diff --git a/Lang/Java/Solve-a-Hopido-puzzle b/Lang/Java/Solve-a-Hopido-puzzle
new file mode 120000
index 0000000000..2245c9e700
--- /dev/null
+++ b/Lang/Java/Solve-a-Hopido-puzzle
@@ -0,0 +1 @@
+../../Task/Solve-a-Hopido-puzzle/Java
\ No newline at end of file
diff --git a/Lang/Java/Solve-a-Numbrix-puzzle b/Lang/Java/Solve-a-Numbrix-puzzle
new file mode 120000
index 0000000000..923e996531
--- /dev/null
+++ b/Lang/Java/Solve-a-Numbrix-puzzle
@@ -0,0 +1 @@
+../../Task/Solve-a-Numbrix-puzzle/Java
\ No newline at end of file
diff --git a/Lang/Java/Solve-the-no-connection-puzzle b/Lang/Java/Solve-the-no-connection-puzzle
new file mode 120000
index 0000000000..fb99b65e06
--- /dev/null
+++ b/Lang/Java/Solve-the-no-connection-puzzle
@@ -0,0 +1 @@
+../../Task/Solve-the-no-connection-puzzle/Java
\ No newline at end of file
diff --git a/Lang/Java/Statistics-Basic b/Lang/Java/Statistics-Basic
new file mode 120000
index 0000000000..12c4616d11
--- /dev/null
+++ b/Lang/Java/Statistics-Basic
@@ -0,0 +1 @@
+../../Task/Statistics-Basic/Java
\ No newline at end of file
diff --git a/Lang/Java/Subtractive-generator b/Lang/Java/Subtractive-generator
new file mode 120000
index 0000000000..ee3828d506
--- /dev/null
+++ b/Lang/Java/Subtractive-generator
@@ -0,0 +1 @@
+../../Task/Subtractive-generator/Java
\ No newline at end of file
diff --git a/Lang/Java/Thieles-interpolation-formula b/Lang/Java/Thieles-interpolation-formula
new file mode 120000
index 0000000000..51bf1293a8
--- /dev/null
+++ b/Lang/Java/Thieles-interpolation-formula
@@ -0,0 +1 @@
+../../Task/Thieles-interpolation-formula/Java
\ No newline at end of file
diff --git a/Lang/Java/Total-circles-area b/Lang/Java/Total-circles-area
new file mode 120000
index 0000000000..6040cbdf6a
--- /dev/null
+++ b/Lang/Java/Total-circles-area
@@ -0,0 +1 @@
+../../Task/Total-circles-area/Java
\ No newline at end of file
diff --git a/Lang/Java/Verify-distribution-uniformity-Chi-squared-test b/Lang/Java/Verify-distribution-uniformity-Chi-squared-test
new file mode 120000
index 0000000000..ecbdb44b34
--- /dev/null
+++ b/Lang/Java/Verify-distribution-uniformity-Chi-squared-test
@@ -0,0 +1 @@
+../../Task/Verify-distribution-uniformity-Chi-squared-test/Java
\ No newline at end of file
diff --git a/Lang/Java/Verify-distribution-uniformity-Naive b/Lang/Java/Verify-distribution-uniformity-Naive
new file mode 120000
index 0000000000..aa6e9736ec
--- /dev/null
+++ b/Lang/Java/Verify-distribution-uniformity-Naive
@@ -0,0 +1 @@
+../../Task/Verify-distribution-uniformity-Naive/Java
\ No newline at end of file
diff --git a/Lang/Java/Xiaolin-Wus-line-algorithm b/Lang/Java/Xiaolin-Wus-line-algorithm
new file mode 120000
index 0000000000..d7b74f59f0
--- /dev/null
+++ b/Lang/Java/Xiaolin-Wus-line-algorithm
@@ -0,0 +1 @@
+../../Task/Xiaolin-Wus-line-algorithm/Java
\ No newline at end of file
diff --git a/Lang/JavaScript/00DESCRIPTION b/Lang/JavaScript/00DESCRIPTION
index 588942c5e5..3906eaab39 100644
--- a/Lang/JavaScript/00DESCRIPTION
+++ b/Lang/JavaScript/00DESCRIPTION
@@ -19,10 +19,13 @@ Once largely confined to browser environments, and typically isolated from acces
At the same time, mainly because of JavaScript's role in the web, there is a growing number of other languages which [https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js compile to JavaScript].
+The inclusion of '''tail-call optimisation''' in the ES6 standard reflects increased interest in functional approaches to the composition of JavaScript code, expressed for example, in significant adoption of libraries like Underscore and Lodash. If ES6 tail-call optimisation is widely implemented by JavaScript engines (so far this has mainly been achieved only by Apple's Safari engine) it will make JavaScript a more efficient and more natural environment for coding in a functional idiom.
+
==Citations==
* [[wp:Javascript|Wikipedia:Javascript]]
* [https://nodejs.org/en/ Node.js] Event-driven I/O server-side JavaScript environment based on V8
* [https://www.npmjs.com npm – Node.js Package Manager] Claims to be the largest ecosystem of open source libraries in the world
* [https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/Articles/Introduction.html OS X JavaScript for Applications] JavaScript as an OS X scripting language – supported by the Safari debugger
* [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Shells Other JavaScript shells] List maintained by Mozilla
-* [https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js List of languages that compile to JS] maintained on Github by Jeremy Ashenas – author of CoffeeScript, Underscore and Backbone
\ No newline at end of file
+* [https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js List of languages that compile to JS] maintained on Github by Jeremy Ashenas – author of CoffeeScript, Underscore and Backbone
+* [http://shop.oreilly.com/product/0636920028857.do Functional JavaScript] – Michael Fogus, O'Reilly 2013
\ No newline at end of file
diff --git a/Lang/JavaScript/CSV-data-manipulation b/Lang/JavaScript/CSV-data-manipulation
new file mode 120000
index 0000000000..a277627be2
--- /dev/null
+++ b/Lang/JavaScript/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Casting-out-nines b/Lang/JavaScript/Casting-out-nines
new file mode 120000
index 0000000000..c17cdf253a
--- /dev/null
+++ b/Lang/JavaScript/Casting-out-nines
@@ -0,0 +1 @@
+../../Task/Casting-out-nines/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Dinesmans-multiple-dwelling-problem b/Lang/JavaScript/Dinesmans-multiple-dwelling-problem
new file mode 120000
index 0000000000..86102d1c70
--- /dev/null
+++ b/Lang/JavaScript/Dinesmans-multiple-dwelling-problem
@@ -0,0 +1 @@
+../../Task/Dinesmans-multiple-dwelling-problem/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Extensible-prime-generator b/Lang/JavaScript/Extensible-prime-generator
new file mode 120000
index 0000000000..093e8740a2
--- /dev/null
+++ b/Lang/JavaScript/Extensible-prime-generator
@@ -0,0 +1 @@
+../../Task/Extensible-prime-generator/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Fibonacci-word-fractal b/Lang/JavaScript/Fibonacci-word-fractal
new file mode 120000
index 0000000000..a23f13aa6e
--- /dev/null
+++ b/Lang/JavaScript/Fibonacci-word-fractal
@@ -0,0 +1 @@
+../../Task/Fibonacci-word-fractal/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Flipping-bits-game b/Lang/JavaScript/Flipping-bits-game
new file mode 120000
index 0000000000..2999312e48
--- /dev/null
+++ b/Lang/JavaScript/Flipping-bits-game
@@ -0,0 +1 @@
+../../Task/Flipping-bits-game/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Generate-Chess960-starting-position b/Lang/JavaScript/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..615ec81399
--- /dev/null
+++ b/Lang/JavaScript/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Hash-join b/Lang/JavaScript/Hash-join
new file mode 120000
index 0000000000..9c4122ce63
--- /dev/null
+++ b/Lang/JavaScript/Hash-join
@@ -0,0 +1 @@
+../../Task/Hash-join/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Hello-world-Newline-omission b/Lang/JavaScript/Hello-world-Newline-omission
new file mode 120000
index 0000000000..acc4f55196
--- /dev/null
+++ b/Lang/JavaScript/Hello-world-Newline-omission
@@ -0,0 +1 @@
+../../Task/Hello-world-Newline-omission/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/IBAN b/Lang/JavaScript/IBAN
new file mode 120000
index 0000000000..ccf82f3b4a
--- /dev/null
+++ b/Lang/JavaScript/IBAN
@@ -0,0 +1 @@
+../../Task/IBAN/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Kaprekar-numbers b/Lang/JavaScript/Kaprekar-numbers
new file mode 120000
index 0000000000..ff196b7b2e
--- /dev/null
+++ b/Lang/JavaScript/Kaprekar-numbers
@@ -0,0 +1 @@
+../../Task/Kaprekar-numbers/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Largest-int-from-concatenated-ints b/Lang/JavaScript/Largest-int-from-concatenated-ints
new file mode 120000
index 0000000000..d197bb3217
--- /dev/null
+++ b/Lang/JavaScript/Largest-int-from-concatenated-ints
@@ -0,0 +1 @@
+../../Task/Largest-int-from-concatenated-ints/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Modular-inverse b/Lang/JavaScript/Modular-inverse
new file mode 120000
index 0000000000..482fe3b769
--- /dev/null
+++ b/Lang/JavaScript/Modular-inverse
@@ -0,0 +1 @@
+../../Task/Modular-inverse/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Order-disjoint-list-items b/Lang/JavaScript/Order-disjoint-list-items
new file mode 120000
index 0000000000..db60f4ab93
--- /dev/null
+++ b/Lang/JavaScript/Order-disjoint-list-items
@@ -0,0 +1 @@
+../../Task/Order-disjoint-list-items/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Order-two-numerical-lists b/Lang/JavaScript/Order-two-numerical-lists
new file mode 120000
index 0000000000..d84ae595ed
--- /dev/null
+++ b/Lang/JavaScript/Order-two-numerical-lists
@@ -0,0 +1 @@
+../../Task/Order-two-numerical-lists/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Ordered-Partitions b/Lang/JavaScript/Ordered-Partitions
new file mode 120000
index 0000000000..6c3e3c8cde
--- /dev/null
+++ b/Lang/JavaScript/Ordered-Partitions
@@ -0,0 +1 @@
+../../Task/Ordered-Partitions/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Parsing-RPN-to-infix-conversion b/Lang/JavaScript/Parsing-RPN-to-infix-conversion
new file mode 120000
index 0000000000..061e2c5139
--- /dev/null
+++ b/Lang/JavaScript/Parsing-RPN-to-infix-conversion
@@ -0,0 +1 @@
+../../Task/Parsing-RPN-to-infix-conversion/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Pi b/Lang/JavaScript/Pi
new file mode 120000
index 0000000000..515c5ca53e
--- /dev/null
+++ b/Lang/JavaScript/Pi
@@ -0,0 +1 @@
+../../Task/Pi/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Read-a-file-line-by-line b/Lang/JavaScript/Read-a-file-line-by-line
new file mode 120000
index 0000000000..f1cb6cac75
--- /dev/null
+++ b/Lang/JavaScript/Read-a-file-line-by-line
@@ -0,0 +1 @@
+../../Task/Read-a-file-line-by-line/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Sorting-algorithms-Cocktail-sort b/Lang/JavaScript/Sorting-algorithms-Cocktail-sort
new file mode 120000
index 0000000000..150bb2ee36
--- /dev/null
+++ b/Lang/JavaScript/Sorting-algorithms-Cocktail-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Cocktail-sort/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Sorting-algorithms-Comb-sort b/Lang/JavaScript/Sorting-algorithms-Comb-sort
new file mode 120000
index 0000000000..06255b8329
--- /dev/null
+++ b/Lang/JavaScript/Sorting-algorithms-Comb-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Comb-sort/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Sorting-algorithms-Selection-sort b/Lang/JavaScript/Sorting-algorithms-Selection-sort
new file mode 120000
index 0000000000..066834ca91
--- /dev/null
+++ b/Lang/JavaScript/Sorting-algorithms-Selection-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Selection-sort/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Sorting-algorithms-Stooge-sort b/Lang/JavaScript/Sorting-algorithms-Stooge-sort
new file mode 120000
index 0000000000..69e8b907a2
--- /dev/null
+++ b/Lang/JavaScript/Sorting-algorithms-Stooge-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Stooge-sort/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Sparkline-in-unicode b/Lang/JavaScript/Sparkline-in-unicode
new file mode 120000
index 0000000000..da57479d5d
--- /dev/null
+++ b/Lang/JavaScript/Sparkline-in-unicode
@@ -0,0 +1 @@
+../../Task/Sparkline-in-unicode/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Strip-control-codes-and-extended-characters-from-a-string b/Lang/JavaScript/Strip-control-codes-and-extended-characters-from-a-string
new file mode 120000
index 0000000000..7a9b3c050e
--- /dev/null
+++ b/Lang/JavaScript/Strip-control-codes-and-extended-characters-from-a-string
@@ -0,0 +1 @@
+../../Task/Strip-control-codes-and-extended-characters-from-a-string/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Sum-digits-of-an-integer b/Lang/JavaScript/Sum-digits-of-an-integer
new file mode 120000
index 0000000000..05f77485c1
--- /dev/null
+++ b/Lang/JavaScript/Sum-digits-of-an-integer
@@ -0,0 +1 @@
+../../Task/Sum-digits-of-an-integer/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Ternary-logic b/Lang/JavaScript/Ternary-logic
new file mode 120000
index 0000000000..d49124d596
--- /dev/null
+++ b/Lang/JavaScript/Ternary-logic
@@ -0,0 +1 @@
+../../Task/Ternary-logic/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Universal-Turing-machine b/Lang/JavaScript/Universal-Turing-machine
new file mode 120000
index 0000000000..9bea53a5f8
--- /dev/null
+++ b/Lang/JavaScript/Universal-Turing-machine
@@ -0,0 +1 @@
+../../Task/Universal-Turing-machine/JavaScript
\ No newline at end of file
diff --git a/Lang/JavaScript/Zeckendorf-number-representation b/Lang/JavaScript/Zeckendorf-number-representation
new file mode 120000
index 0000000000..c979f140cf
--- /dev/null
+++ b/Lang/JavaScript/Zeckendorf-number-representation
@@ -0,0 +1 @@
+../../Task/Zeckendorf-number-representation/JavaScript
\ No newline at end of file
diff --git a/Lang/Julia/Bernoulli-numbers b/Lang/Julia/Bernoulli-numbers
new file mode 120000
index 0000000000..442ec35ee6
--- /dev/null
+++ b/Lang/Julia/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/Julia
\ No newline at end of file
diff --git a/Lang/Julia/N-queens-problem b/Lang/Julia/N-queens-problem
new file mode 120000
index 0000000000..6e1cadb6b8
--- /dev/null
+++ b/Lang/Julia/N-queens-problem
@@ -0,0 +1 @@
+../../Task/N-queens-problem/Julia
\ No newline at end of file
diff --git a/Lang/K/A+B b/Lang/K/A+B
new file mode 120000
index 0000000000..8f6bc02168
--- /dev/null
+++ b/Lang/K/A+B
@@ -0,0 +1 @@
+../../Task/A+B/K
\ No newline at end of file
diff --git a/Lang/K/Amicable-pairs b/Lang/K/Amicable-pairs
new file mode 120000
index 0000000000..07c0393d96
--- /dev/null
+++ b/Lang/K/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/K
\ No newline at end of file
diff --git a/Lang/K/Averages-Median b/Lang/K/Averages-Median
new file mode 120000
index 0000000000..0d9ef99e72
--- /dev/null
+++ b/Lang/K/Averages-Median
@@ -0,0 +1 @@
+../../Task/Averages-Median/K
\ No newline at end of file
diff --git a/Lang/K/Averages-Pythagorean-means b/Lang/K/Averages-Pythagorean-means
new file mode 120000
index 0000000000..7de8d806f3
--- /dev/null
+++ b/Lang/K/Averages-Pythagorean-means
@@ -0,0 +1 @@
+../../Task/Averages-Pythagorean-means/K
\ No newline at end of file
diff --git a/Lang/K/Averages-Root-mean-square b/Lang/K/Averages-Root-mean-square
new file mode 120000
index 0000000000..89e1c5e285
--- /dev/null
+++ b/Lang/K/Averages-Root-mean-square
@@ -0,0 +1 @@
+../../Task/Averages-Root-mean-square/K
\ No newline at end of file
diff --git a/Lang/K/Averages-Simple-moving-average b/Lang/K/Averages-Simple-moving-average
new file mode 120000
index 0000000000..e3d601b10c
--- /dev/null
+++ b/Lang/K/Averages-Simple-moving-average
@@ -0,0 +1 @@
+../../Task/Averages-Simple-moving-average/K
\ No newline at end of file
diff --git a/Lang/K/Balanced-brackets b/Lang/K/Balanced-brackets
new file mode 120000
index 0000000000..79c3d4c021
--- /dev/null
+++ b/Lang/K/Balanced-brackets
@@ -0,0 +1 @@
+../../Task/Balanced-brackets/K
\ No newline at end of file
diff --git a/Lang/K/Binary-search b/Lang/K/Binary-search
new file mode 120000
index 0000000000..1db86f034c
--- /dev/null
+++ b/Lang/K/Binary-search
@@ -0,0 +1 @@
+../../Task/Binary-search/K
\ No newline at end of file
diff --git a/Lang/K/Caesar-cipher b/Lang/K/Caesar-cipher
new file mode 120000
index 0000000000..699bb385d5
--- /dev/null
+++ b/Lang/K/Caesar-cipher
@@ -0,0 +1 @@
+../../Task/Caesar-cipher/K
\ No newline at end of file
diff --git a/Lang/K/Combinations b/Lang/K/Combinations
new file mode 120000
index 0000000000..fc43c6ed5f
--- /dev/null
+++ b/Lang/K/Combinations
@@ -0,0 +1 @@
+../../Task/Combinations/K
\ No newline at end of file
diff --git a/Lang/K/Generate-lower-case-ASCII-alphabet b/Lang/K/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..f48b3ef46f
--- /dev/null
+++ b/Lang/K/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/K
\ No newline at end of file
diff --git a/Lang/K/Sequence-of-non-squares b/Lang/K/Sequence-of-non-squares
new file mode 120000
index 0000000000..97e231cb34
--- /dev/null
+++ b/Lang/K/Sequence-of-non-squares
@@ -0,0 +1 @@
+../../Task/Sequence-of-non-squares/K
\ No newline at end of file
diff --git a/Lang/K/Stack b/Lang/K/Stack
new file mode 120000
index 0000000000..2f0d95a735
--- /dev/null
+++ b/Lang/K/Stack
@@ -0,0 +1 @@
+../../Task/Stack/K
\ No newline at end of file
diff --git a/Lang/K/String-case b/Lang/K/String-case
new file mode 120000
index 0000000000..c911391113
--- /dev/null
+++ b/Lang/K/String-case
@@ -0,0 +1 @@
+../../Task/String-case/K
\ No newline at end of file
diff --git a/Lang/K/Sum-and-product-of-an-array b/Lang/K/Sum-and-product-of-an-array
new file mode 120000
index 0000000000..65f7ba9183
--- /dev/null
+++ b/Lang/K/Sum-and-product-of-an-array
@@ -0,0 +1 @@
+../../Task/Sum-and-product-of-an-array/K
\ No newline at end of file
diff --git a/Lang/Kotlin/9-billion-names-of-God-the-integer b/Lang/Kotlin/9-billion-names-of-God-the-integer
new file mode 120000
index 0000000000..13da09cecf
--- /dev/null
+++ b/Lang/Kotlin/9-billion-names-of-God-the-integer
@@ -0,0 +1 @@
+../../Task/9-billion-names-of-God-the-integer/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/ABC-Problem b/Lang/Kotlin/ABC-Problem
new file mode 120000
index 0000000000..752b66ce2d
--- /dev/null
+++ b/Lang/Kotlin/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Almost-prime b/Lang/Kotlin/Almost-prime
new file mode 120000
index 0000000000..b9bfd47bfe
--- /dev/null
+++ b/Lang/Kotlin/Almost-prime
@@ -0,0 +1 @@
+../../Task/Almost-prime/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Apply-a-callback-to-an-array b/Lang/Kotlin/Apply-a-callback-to-an-array
new file mode 120000
index 0000000000..28bd472513
--- /dev/null
+++ b/Lang/Kotlin/Apply-a-callback-to-an-array
@@ -0,0 +1 @@
+../../Task/Apply-a-callback-to-an-array/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Arrays b/Lang/Kotlin/Arrays
new file mode 120000
index 0000000000..65a28891c4
--- /dev/null
+++ b/Lang/Kotlin/Arrays
@@ -0,0 +1 @@
+../../Task/Arrays/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Associative-array-Creation b/Lang/Kotlin/Associative-array-Creation
new file mode 120000
index 0000000000..91c783898a
--- /dev/null
+++ b/Lang/Kotlin/Associative-array-Creation
@@ -0,0 +1 @@
+../../Task/Associative-array-Creation/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Associative-array-Iteration b/Lang/Kotlin/Associative-array-Iteration
new file mode 120000
index 0000000000..5590885c17
--- /dev/null
+++ b/Lang/Kotlin/Associative-array-Iteration
@@ -0,0 +1 @@
+../../Task/Associative-array-Iteration/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Averages-Arithmetic-mean b/Lang/Kotlin/Averages-Arithmetic-mean
new file mode 120000
index 0000000000..4b6a1b27a4
--- /dev/null
+++ b/Lang/Kotlin/Averages-Arithmetic-mean
@@ -0,0 +1 @@
+../../Task/Averages-Arithmetic-mean/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Averages-Median b/Lang/Kotlin/Averages-Median
new file mode 120000
index 0000000000..190395c488
--- /dev/null
+++ b/Lang/Kotlin/Averages-Median
@@ -0,0 +1 @@
+../../Task/Averages-Median/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Averages-Pythagorean-means b/Lang/Kotlin/Averages-Pythagorean-means
new file mode 120000
index 0000000000..65d6eef080
--- /dev/null
+++ b/Lang/Kotlin/Averages-Pythagorean-means
@@ -0,0 +1 @@
+../../Task/Averages-Pythagorean-means/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Bernoulli-numbers b/Lang/Kotlin/Bernoulli-numbers
new file mode 120000
index 0000000000..b03db87cdb
--- /dev/null
+++ b/Lang/Kotlin/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Binary-search b/Lang/Kotlin/Binary-search
new file mode 120000
index 0000000000..4b39505448
--- /dev/null
+++ b/Lang/Kotlin/Binary-search
@@ -0,0 +1 @@
+../../Task/Binary-search/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Calendar b/Lang/Kotlin/Calendar
new file mode 120000
index 0000000000..84f9fcfe00
--- /dev/null
+++ b/Lang/Kotlin/Calendar
@@ -0,0 +1 @@
+../../Task/Calendar/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Carmichael-3-strong-pseudoprimes b/Lang/Kotlin/Carmichael-3-strong-pseudoprimes
new file mode 120000
index 0000000000..e7f04f4981
--- /dev/null
+++ b/Lang/Kotlin/Carmichael-3-strong-pseudoprimes
@@ -0,0 +1 @@
+../../Task/Carmichael-3-strong-pseudoprimes/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Catalan-numbers b/Lang/Kotlin/Catalan-numbers
new file mode 120000
index 0000000000..b0cd7882a6
--- /dev/null
+++ b/Lang/Kotlin/Catalan-numbers
@@ -0,0 +1 @@
+../../Task/Catalan-numbers/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Command-line-arguments b/Lang/Kotlin/Command-line-arguments
new file mode 120000
index 0000000000..1a944f7332
--- /dev/null
+++ b/Lang/Kotlin/Command-line-arguments
@@ -0,0 +1 @@
+../../Task/Command-line-arguments/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Copy-a-string b/Lang/Kotlin/Copy-a-string
new file mode 120000
index 0000000000..522d4ef280
--- /dev/null
+++ b/Lang/Kotlin/Copy-a-string
@@ -0,0 +1 @@
+../../Task/Copy-a-string/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Create-a-two-dimensional-array-at-runtime b/Lang/Kotlin/Create-a-two-dimensional-array-at-runtime
new file mode 120000
index 0000000000..f75be9cb63
--- /dev/null
+++ b/Lang/Kotlin/Create-a-two-dimensional-array-at-runtime
@@ -0,0 +1 @@
+../../Task/Create-a-two-dimensional-array-at-runtime/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Discordian-date b/Lang/Kotlin/Discordian-date
new file mode 120000
index 0000000000..bddf434f09
--- /dev/null
+++ b/Lang/Kotlin/Discordian-date
@@ -0,0 +1 @@
+../../Task/Discordian-date/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Dot-product b/Lang/Kotlin/Dot-product
new file mode 120000
index 0000000000..9882b41569
--- /dev/null
+++ b/Lang/Kotlin/Dot-product
@@ -0,0 +1 @@
+../../Task/Dot-product/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Empty-program b/Lang/Kotlin/Empty-program
new file mode 120000
index 0000000000..e6b49b7722
--- /dev/null
+++ b/Lang/Kotlin/Empty-program
@@ -0,0 +1 @@
+../../Task/Empty-program/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Empty-string b/Lang/Kotlin/Empty-string
new file mode 120000
index 0000000000..f36886a548
--- /dev/null
+++ b/Lang/Kotlin/Empty-string
@@ -0,0 +1 @@
+../../Task/Empty-string/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Factorial b/Lang/Kotlin/Factorial
new file mode 120000
index 0000000000..a04269c11f
--- /dev/null
+++ b/Lang/Kotlin/Factorial
@@ -0,0 +1 @@
+../../Task/Factorial/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Floyds-triangle b/Lang/Kotlin/Floyds-triangle
new file mode 120000
index 0000000000..33564efd72
--- /dev/null
+++ b/Lang/Kotlin/Floyds-triangle
@@ -0,0 +1 @@
+../../Task/Floyds-triangle/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Function-definition b/Lang/Kotlin/Function-definition
new file mode 120000
index 0000000000..2c19a66858
--- /dev/null
+++ b/Lang/Kotlin/Function-definition
@@ -0,0 +1 @@
+../../Task/Function-definition/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Generate-Chess960-starting-position b/Lang/Kotlin/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..0036d42015
--- /dev/null
+++ b/Lang/Kotlin/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Greatest-common-divisor b/Lang/Kotlin/Greatest-common-divisor
new file mode 120000
index 0000000000..00668dba07
--- /dev/null
+++ b/Lang/Kotlin/Greatest-common-divisor
@@ -0,0 +1 @@
+../../Task/Greatest-common-divisor/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Hello-world-Graphical b/Lang/Kotlin/Hello-world-Graphical
new file mode 120000
index 0000000000..c9465edd2f
--- /dev/null
+++ b/Lang/Kotlin/Hello-world-Graphical
@@ -0,0 +1 @@
+../../Task/Hello-world-Graphical/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Hello-world-Newline-omission b/Lang/Kotlin/Hello-world-Newline-omission
new file mode 120000
index 0000000000..3da6099743
--- /dev/null
+++ b/Lang/Kotlin/Hello-world-Newline-omission
@@ -0,0 +1 @@
+../../Task/Hello-world-Newline-omission/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Heronian-triangles b/Lang/Kotlin/Heronian-triangles
new file mode 120000
index 0000000000..153ce68795
--- /dev/null
+++ b/Lang/Kotlin/Heronian-triangles
@@ -0,0 +1 @@
+../../Task/Heronian-triangles/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Higher-order-functions b/Lang/Kotlin/Higher-order-functions
new file mode 120000
index 0000000000..e39f24d953
--- /dev/null
+++ b/Lang/Kotlin/Higher-order-functions
@@ -0,0 +1 @@
+../../Task/Higher-order-functions/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Hough-transform b/Lang/Kotlin/Hough-transform
new file mode 120000
index 0000000000..b41668a58f
--- /dev/null
+++ b/Lang/Kotlin/Hough-transform
@@ -0,0 +1 @@
+../../Task/Hough-transform/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Huffman-coding b/Lang/Kotlin/Huffman-coding
new file mode 120000
index 0000000000..c80aa1aced
--- /dev/null
+++ b/Lang/Kotlin/Huffman-coding
@@ -0,0 +1 @@
+../../Task/Huffman-coding/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Infinity b/Lang/Kotlin/Infinity
new file mode 120000
index 0000000000..4c96c4fe9c
--- /dev/null
+++ b/Lang/Kotlin/Infinity
@@ -0,0 +1 @@
+../../Task/Infinity/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Inheritance-Multiple b/Lang/Kotlin/Inheritance-Multiple
new file mode 120000
index 0000000000..2168e25a76
--- /dev/null
+++ b/Lang/Kotlin/Inheritance-Multiple
@@ -0,0 +1 @@
+../../Task/Inheritance-Multiple/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Integer-comparison b/Lang/Kotlin/Integer-comparison
new file mode 120000
index 0000000000..2e884c6564
--- /dev/null
+++ b/Lang/Kotlin/Integer-comparison
@@ -0,0 +1 @@
+../../Task/Integer-comparison/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Jensens-Device b/Lang/Kotlin/Jensens-Device
new file mode 120000
index 0000000000..3d018bcf01
--- /dev/null
+++ b/Lang/Kotlin/Jensens-Device
@@ -0,0 +1 @@
+../../Task/Jensens-Device/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Kaprekar-numbers b/Lang/Kotlin/Kaprekar-numbers
new file mode 120000
index 0000000000..d10efeb716
--- /dev/null
+++ b/Lang/Kotlin/Kaprekar-numbers
@@ -0,0 +1 @@
+../../Task/Kaprekar-numbers/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Knuth-shuffle b/Lang/Kotlin/Knuth-shuffle
new file mode 120000
index 0000000000..d828e993de
--- /dev/null
+++ b/Lang/Kotlin/Knuth-shuffle
@@ -0,0 +1 @@
+../../Task/Knuth-shuffle/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Leap-year b/Lang/Kotlin/Leap-year
new file mode 120000
index 0000000000..1c6f232737
--- /dev/null
+++ b/Lang/Kotlin/Leap-year
@@ -0,0 +1 @@
+../../Task/Leap-year/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Least-common-multiple b/Lang/Kotlin/Least-common-multiple
new file mode 120000
index 0000000000..d0e8489b9c
--- /dev/null
+++ b/Lang/Kotlin/Least-common-multiple
@@ -0,0 +1 @@
+../../Task/Least-common-multiple/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Literals-Floating-point b/Lang/Kotlin/Literals-Floating-point
new file mode 120000
index 0000000000..19526ee1ec
--- /dev/null
+++ b/Lang/Kotlin/Literals-Floating-point
@@ -0,0 +1 @@
+../../Task/Literals-Floating-point/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Long-multiplication b/Lang/Kotlin/Long-multiplication
new file mode 120000
index 0000000000..e31bc4592b
--- /dev/null
+++ b/Lang/Kotlin/Long-multiplication
@@ -0,0 +1 @@
+../../Task/Long-multiplication/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Loops-Break b/Lang/Kotlin/Loops-Break
new file mode 120000
index 0000000000..5bbede5598
--- /dev/null
+++ b/Lang/Kotlin/Loops-Break
@@ -0,0 +1 @@
+../../Task/Loops-Break/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Loops-For b/Lang/Kotlin/Loops-For
new file mode 120000
index 0000000000..14c4e7d796
--- /dev/null
+++ b/Lang/Kotlin/Loops-For
@@ -0,0 +1 @@
+../../Task/Loops-For/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Loops-Nested b/Lang/Kotlin/Loops-Nested
new file mode 120000
index 0000000000..17b558e771
--- /dev/null
+++ b/Lang/Kotlin/Loops-Nested
@@ -0,0 +1 @@
+../../Task/Loops-Nested/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Maze-generation b/Lang/Kotlin/Maze-generation
new file mode 120000
index 0000000000..2f659d55e4
--- /dev/null
+++ b/Lang/Kotlin/Maze-generation
@@ -0,0 +1 @@
+../../Task/Maze-generation/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Middle-three-digits b/Lang/Kotlin/Middle-three-digits
new file mode 120000
index 0000000000..faae414863
--- /dev/null
+++ b/Lang/Kotlin/Middle-three-digits
@@ -0,0 +1 @@
+../../Task/Middle-three-digits/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Multifactorial b/Lang/Kotlin/Multifactorial
new file mode 120000
index 0000000000..40631c6f05
--- /dev/null
+++ b/Lang/Kotlin/Multifactorial
@@ -0,0 +1 @@
+../../Task/Multifactorial/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Nth b/Lang/Kotlin/Nth
new file mode 120000
index 0000000000..7a77c2bbc6
--- /dev/null
+++ b/Lang/Kotlin/Nth
@@ -0,0 +1 @@
+../../Task/Nth/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Numeric-error-propagation b/Lang/Kotlin/Numeric-error-propagation
new file mode 120000
index 0000000000..13ec902292
--- /dev/null
+++ b/Lang/Kotlin/Numeric-error-propagation
@@ -0,0 +1 @@
+../../Task/Numeric-error-propagation/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Numerical-integration-Gauss-Legendre-Quadrature b/Lang/Kotlin/Numerical-integration-Gauss-Legendre-Quadrature
new file mode 120000
index 0000000000..b89eefcdda
--- /dev/null
+++ b/Lang/Kotlin/Numerical-integration-Gauss-Legendre-Quadrature
@@ -0,0 +1 @@
+../../Task/Numerical-integration-Gauss-Legendre-Quadrature/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Ordered-words b/Lang/Kotlin/Ordered-words
new file mode 120000
index 0000000000..aa98227c56
--- /dev/null
+++ b/Lang/Kotlin/Ordered-words
@@ -0,0 +1 @@
+../../Task/Ordered-words/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Priority-queue b/Lang/Kotlin/Priority-queue
new file mode 120000
index 0000000000..4a822c4598
--- /dev/null
+++ b/Lang/Kotlin/Priority-queue
@@ -0,0 +1 @@
+../../Task/Priority-queue/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/RIPEMD-160 b/Lang/Kotlin/RIPEMD-160
new file mode 120000
index 0000000000..d7f7e4e104
--- /dev/null
+++ b/Lang/Kotlin/RIPEMD-160
@@ -0,0 +1 @@
+../../Task/RIPEMD-160/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Ray-casting-algorithm b/Lang/Kotlin/Ray-casting-algorithm
new file mode 120000
index 0000000000..69b18c8a1d
--- /dev/null
+++ b/Lang/Kotlin/Ray-casting-algorithm
@@ -0,0 +1 @@
+../../Task/Ray-casting-algorithm/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Remove-duplicate-elements b/Lang/Kotlin/Remove-duplicate-elements
new file mode 120000
index 0000000000..d5027f13cf
--- /dev/null
+++ b/Lang/Kotlin/Remove-duplicate-elements
@@ -0,0 +1 @@
+../../Task/Remove-duplicate-elements/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Reverse-a-string b/Lang/Kotlin/Reverse-a-string
new file mode 120000
index 0000000000..5ea632230a
--- /dev/null
+++ b/Lang/Kotlin/Reverse-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-a-string/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Roman-numerals-Encode b/Lang/Kotlin/Roman-numerals-Encode
new file mode 120000
index 0000000000..b2248ddc49
--- /dev/null
+++ b/Lang/Kotlin/Roman-numerals-Encode
@@ -0,0 +1 @@
+../../Task/Roman-numerals-Encode/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Roots-of-a-quadratic-function b/Lang/Kotlin/Roots-of-a-quadratic-function
new file mode 120000
index 0000000000..dadcb3d46e
--- /dev/null
+++ b/Lang/Kotlin/Roots-of-a-quadratic-function
@@ -0,0 +1 @@
+../../Task/Roots-of-a-quadratic-function/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Roots-of-unity b/Lang/Kotlin/Roots-of-unity
new file mode 120000
index 0000000000..ccc5e04200
--- /dev/null
+++ b/Lang/Kotlin/Roots-of-unity
@@ -0,0 +1 @@
+../../Task/Roots-of-unity/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Rot-13 b/Lang/Kotlin/Rot-13
new file mode 120000
index 0000000000..2d03662429
--- /dev/null
+++ b/Lang/Kotlin/Rot-13
@@ -0,0 +1 @@
+../../Task/Rot-13/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Sieve-of-Eratosthenes b/Lang/Kotlin/Sieve-of-Eratosthenes
new file mode 120000
index 0000000000..d7316e4d85
--- /dev/null
+++ b/Lang/Kotlin/Sieve-of-Eratosthenes
@@ -0,0 +1 @@
+../../Task/Sieve-of-Eratosthenes/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Singly-linked-list-Traversal b/Lang/Kotlin/Singly-linked-list-Traversal
new file mode 120000
index 0000000000..ff10b213c2
--- /dev/null
+++ b/Lang/Kotlin/Singly-linked-list-Traversal
@@ -0,0 +1 @@
+../../Task/Singly-linked-list-Traversal/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Sort-using-a-custom-comparator b/Lang/Kotlin/Sort-using-a-custom-comparator
new file mode 120000
index 0000000000..442bb6c8b5
--- /dev/null
+++ b/Lang/Kotlin/Sort-using-a-custom-comparator
@@ -0,0 +1 @@
+../../Task/Sort-using-a-custom-comparator/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Sorting-algorithms-Insertion-sort b/Lang/Kotlin/Sorting-algorithms-Insertion-sort
new file mode 120000
index 0000000000..36059cb5a9
--- /dev/null
+++ b/Lang/Kotlin/Sorting-algorithms-Insertion-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Insertion-sort/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Sorting-algorithms-Merge-sort b/Lang/Kotlin/Sorting-algorithms-Merge-sort
new file mode 120000
index 0000000000..8a1c419024
--- /dev/null
+++ b/Lang/Kotlin/Sorting-algorithms-Merge-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Merge-sort/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Sorting-algorithms-Selection-sort b/Lang/Kotlin/Sorting-algorithms-Selection-sort
new file mode 120000
index 0000000000..8b20383cd8
--- /dev/null
+++ b/Lang/Kotlin/Sorting-algorithms-Selection-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Selection-sort/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Sparkline-in-unicode b/Lang/Kotlin/Sparkline-in-unicode
new file mode 120000
index 0000000000..f2f06ef5ed
--- /dev/null
+++ b/Lang/Kotlin/Sparkline-in-unicode
@@ -0,0 +1 @@
+../../Task/Sparkline-in-unicode/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Stable-marriage-problem b/Lang/Kotlin/Stable-marriage-problem
new file mode 120000
index 0000000000..f46875f823
--- /dev/null
+++ b/Lang/Kotlin/Stable-marriage-problem
@@ -0,0 +1 @@
+../../Task/Stable-marriage-problem/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/String-append b/Lang/Kotlin/String-append
new file mode 120000
index 0000000000..051e40d37d
--- /dev/null
+++ b/Lang/Kotlin/String-append
@@ -0,0 +1 @@
+../../Task/String-append/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/String-concatenation b/Lang/Kotlin/String-concatenation
new file mode 120000
index 0000000000..1ef1d028d8
--- /dev/null
+++ b/Lang/Kotlin/String-concatenation
@@ -0,0 +1 @@
+../../Task/String-concatenation/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/The-Twelve-Days-of-Christmas b/Lang/Kotlin/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..921abd08e6
--- /dev/null
+++ b/Lang/Kotlin/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Tree-traversal b/Lang/Kotlin/Tree-traversal
new file mode 120000
index 0000000000..bf46468849
--- /dev/null
+++ b/Lang/Kotlin/Tree-traversal
@@ -0,0 +1 @@
+../../Task/Tree-traversal/Kotlin
\ No newline at end of file
diff --git a/Lang/Kotlin/Ulam-spiral--for-primes- b/Lang/Kotlin/Ulam-spiral--for-primes-
new file mode 120000
index 0000000000..0f210ed995
--- /dev/null
+++ b/Lang/Kotlin/Ulam-spiral--for-primes-
@@ -0,0 +1 @@
+../../Task/Ulam-spiral--for-primes-/Kotlin
\ No newline at end of file
diff --git a/Lang/LOLCODE/Factorial b/Lang/LOLCODE/Factorial
new file mode 120000
index 0000000000..41f1a0b508
--- /dev/null
+++ b/Lang/LOLCODE/Factorial
@@ -0,0 +1 @@
+../../Task/Factorial/LOLCODE
\ No newline at end of file
diff --git a/Lang/LOLCODE/Leap-year b/Lang/LOLCODE/Leap-year
new file mode 120000
index 0000000000..f6842fae45
--- /dev/null
+++ b/Lang/LOLCODE/Leap-year
@@ -0,0 +1 @@
+../../Task/Leap-year/LOLCODE
\ No newline at end of file
diff --git a/Lang/LaTeX/Hello-world-Text b/Lang/LaTeX/Hello-world-Text
new file mode 120000
index 0000000000..2c1d5a2d45
--- /dev/null
+++ b/Lang/LaTeX/Hello-world-Text
@@ -0,0 +1 @@
+../../Task/Hello-world-Text/LaTeX
\ No newline at end of file
diff --git a/Lang/Liberty-BASIC/ABC-Problem b/Lang/Liberty-BASIC/ABC-Problem
new file mode 120000
index 0000000000..c93ba487a0
--- /dev/null
+++ b/Lang/Liberty-BASIC/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Liberty-BASIC
\ No newline at end of file
diff --git a/Lang/Liberty-BASIC/Abundant,-deficient-and-perfect-number-classifications b/Lang/Liberty-BASIC/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..8789542507
--- /dev/null
+++ b/Lang/Liberty-BASIC/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/Liberty-BASIC
\ No newline at end of file
diff --git a/Lang/Liberty-BASIC/Aliquot-sequence-classifications b/Lang/Liberty-BASIC/Aliquot-sequence-classifications
new file mode 120000
index 0000000000..ece4da5129
--- /dev/null
+++ b/Lang/Liberty-BASIC/Aliquot-sequence-classifications
@@ -0,0 +1 @@
+../../Task/Aliquot-sequence-classifications/Liberty-BASIC
\ No newline at end of file
diff --git a/Lang/Liberty-BASIC/Find-the-last-Sunday-of-each-month b/Lang/Liberty-BASIC/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..166668a2b8
--- /dev/null
+++ b/Lang/Liberty-BASIC/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/Liberty-BASIC
\ No newline at end of file
diff --git a/Lang/Liberty-BASIC/Honeycombs b/Lang/Liberty-BASIC/Honeycombs
new file mode 120000
index 0000000000..89b44d6fcd
--- /dev/null
+++ b/Lang/Liberty-BASIC/Honeycombs
@@ -0,0 +1 @@
+../../Task/Honeycombs/Liberty-BASIC
\ No newline at end of file
diff --git a/Lang/Liberty-BASIC/Sequence-of-primes-by-Trial-Division b/Lang/Liberty-BASIC/Sequence-of-primes-by-Trial-Division
new file mode 120000
index 0000000000..a42b9c3686
--- /dev/null
+++ b/Lang/Liberty-BASIC/Sequence-of-primes-by-Trial-Division
@@ -0,0 +1 @@
+../../Task/Sequence-of-primes-by-Trial-Division/Liberty-BASIC
\ No newline at end of file
diff --git a/Lang/Logo/Reverse-words-in-a-string b/Lang/Logo/Reverse-words-in-a-string
new file mode 120000
index 0000000000..aeddcf2e78
--- /dev/null
+++ b/Lang/Logo/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/Logo
\ No newline at end of file
diff --git a/Lang/Logo/Zeckendorf-number-representation b/Lang/Logo/Zeckendorf-number-representation
new file mode 120000
index 0000000000..46ce21599a
--- /dev/null
+++ b/Lang/Logo/Zeckendorf-number-representation
@@ -0,0 +1 @@
+../../Task/Zeckendorf-number-representation/Logo
\ No newline at end of file
diff --git a/Lang/Lua/ABC-Problem b/Lang/Lua/ABC-Problem
new file mode 120000
index 0000000000..f367aa82b0
--- /dev/null
+++ b/Lang/Lua/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Almost-prime b/Lang/Lua/Almost-prime
new file mode 120000
index 0000000000..dd6364d57d
--- /dev/null
+++ b/Lang/Lua/Almost-prime
@@ -0,0 +1 @@
+../../Task/Almost-prime/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Amicable-pairs b/Lang/Lua/Amicable-pairs
new file mode 120000
index 0000000000..471a3f1271
--- /dev/null
+++ b/Lang/Lua/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Calendar b/Lang/Lua/Calendar
new file mode 120000
index 0000000000..1728fc03ce
--- /dev/null
+++ b/Lang/Lua/Calendar
@@ -0,0 +1 @@
+../../Task/Calendar/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Calendar---for-REAL-programmers b/Lang/Lua/Calendar---for-REAL-programmers
new file mode 120000
index 0000000000..a18ba102bf
--- /dev/null
+++ b/Lang/Lua/Calendar---for-REAL-programmers
@@ -0,0 +1 @@
+../../Task/Calendar---for-REAL-programmers/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Catalan-numbers-Pascals-triangle b/Lang/Lua/Catalan-numbers-Pascals-triangle
new file mode 120000
index 0000000000..f86bd7642e
--- /dev/null
+++ b/Lang/Lua/Catalan-numbers-Pascals-triangle
@@ -0,0 +1 @@
+../../Task/Catalan-numbers-Pascals-triangle/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Catamorphism b/Lang/Lua/Catamorphism
new file mode 120000
index 0000000000..75eff3516d
--- /dev/null
+++ b/Lang/Lua/Catamorphism
@@ -0,0 +1 @@
+../../Task/Catamorphism/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Comma-quibbling b/Lang/Lua/Comma-quibbling
new file mode 120000
index 0000000000..c25be610ed
--- /dev/null
+++ b/Lang/Lua/Comma-quibbling
@@ -0,0 +1 @@
+../../Task/Comma-quibbling/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Count-the-coins b/Lang/Lua/Count-the-coins
new file mode 120000
index 0000000000..4d7eb48c41
--- /dev/null
+++ b/Lang/Lua/Count-the-coins
@@ -0,0 +1 @@
+../../Task/Count-the-coins/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Create-an-HTML-table b/Lang/Lua/Create-an-HTML-table
new file mode 120000
index 0000000000..0103169071
--- /dev/null
+++ b/Lang/Lua/Create-an-HTML-table
@@ -0,0 +1 @@
+../../Task/Create-an-HTML-table/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Currying b/Lang/Lua/Currying
new file mode 120000
index 0000000000..7b78b3e31a
--- /dev/null
+++ b/Lang/Lua/Currying
@@ -0,0 +1 @@
+../../Task/Currying/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Deepcopy b/Lang/Lua/Deepcopy
new file mode 120000
index 0000000000..6b22987bc3
--- /dev/null
+++ b/Lang/Lua/Deepcopy
@@ -0,0 +1 @@
+../../Task/Deepcopy/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Echo-server b/Lang/Lua/Echo-server
new file mode 120000
index 0000000000..e96bbb4cb4
--- /dev/null
+++ b/Lang/Lua/Echo-server
@@ -0,0 +1 @@
+../../Task/Echo-server/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Empty-directory b/Lang/Lua/Empty-directory
new file mode 120000
index 0000000000..da7f0a6015
--- /dev/null
+++ b/Lang/Lua/Empty-directory
@@ -0,0 +1 @@
+../../Task/Empty-directory/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Entropy b/Lang/Lua/Entropy
new file mode 120000
index 0000000000..489499754d
--- /dev/null
+++ b/Lang/Lua/Entropy
@@ -0,0 +1 @@
+../../Task/Entropy/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Fast-Fourier-transform b/Lang/Lua/Fast-Fourier-transform
new file mode 120000
index 0000000000..c5a8f89bea
--- /dev/null
+++ b/Lang/Lua/Fast-Fourier-transform
@@ -0,0 +1 @@
+../../Task/Fast-Fourier-transform/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Fibonacci-n-step-number-sequences b/Lang/Lua/Fibonacci-n-step-number-sequences
new file mode 120000
index 0000000000..d5508efe44
--- /dev/null
+++ b/Lang/Lua/Fibonacci-n-step-number-sequences
@@ -0,0 +1 @@
+../../Task/Fibonacci-n-step-number-sequences/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Fibonacci-word b/Lang/Lua/Fibonacci-word
new file mode 120000
index 0000000000..d1bbda0267
--- /dev/null
+++ b/Lang/Lua/Fibonacci-word
@@ -0,0 +1 @@
+../../Task/Fibonacci-word/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Find-the-last-Sunday-of-each-month b/Lang/Lua/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..ceba411c96
--- /dev/null
+++ b/Lang/Lua/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Find-the-missing-permutation b/Lang/Lua/Find-the-missing-permutation
new file mode 120000
index 0000000000..b7d8ad2b4e
--- /dev/null
+++ b/Lang/Lua/Find-the-missing-permutation
@@ -0,0 +1 @@
+../../Task/Find-the-missing-permutation/Lua
\ No newline at end of file
diff --git a/Lang/Lua/First-class-functions-Use-numbers-analogously b/Lang/Lua/First-class-functions-Use-numbers-analogously
new file mode 120000
index 0000000000..05ac864554
--- /dev/null
+++ b/Lang/Lua/First-class-functions-Use-numbers-analogously
@@ -0,0 +1 @@
+../../Task/First-class-functions-Use-numbers-analogously/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Five-weekends b/Lang/Lua/Five-weekends
new file mode 120000
index 0000000000..12cba7693a
--- /dev/null
+++ b/Lang/Lua/Five-weekends
@@ -0,0 +1 @@
+../../Task/Five-weekends/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Generate-Chess960-starting-position b/Lang/Lua/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..20373e2d91
--- /dev/null
+++ b/Lang/Lua/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Hello-world-Newbie b/Lang/Lua/Hello-world-Newbie
new file mode 120000
index 0000000000..8a97c1e7b2
--- /dev/null
+++ b/Lang/Lua/Hello-world-Newbie
@@ -0,0 +1 @@
+../../Task/Hello-world-Newbie/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Heronian-triangles b/Lang/Lua/Heronian-triangles
new file mode 120000
index 0000000000..5f86b8248b
--- /dev/null
+++ b/Lang/Lua/Heronian-triangles
@@ -0,0 +1 @@
+../../Task/Heronian-triangles/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Holidays-related-to-Easter b/Lang/Lua/Holidays-related-to-Easter
new file mode 120000
index 0000000000..10a7cf9e24
--- /dev/null
+++ b/Lang/Lua/Holidays-related-to-Easter
@@ -0,0 +1 @@
+../../Task/Holidays-related-to-Easter/Lua
\ No newline at end of file
diff --git a/Lang/Lua/I-before-E-except-after-C b/Lang/Lua/I-before-E-except-after-C
new file mode 120000
index 0000000000..ba30018101
--- /dev/null
+++ b/Lang/Lua/I-before-E-except-after-C
@@ -0,0 +1 @@
+../../Task/I-before-E-except-after-C/Lua
\ No newline at end of file
diff --git a/Lang/Lua/IBAN b/Lang/Lua/IBAN
new file mode 120000
index 0000000000..ccf2b23903
--- /dev/null
+++ b/Lang/Lua/IBAN
@@ -0,0 +1 @@
+../../Task/IBAN/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Kaprekar-numbers b/Lang/Lua/Kaprekar-numbers
new file mode 120000
index 0000000000..95871925bd
--- /dev/null
+++ b/Lang/Lua/Kaprekar-numbers
@@ -0,0 +1 @@
+../../Task/Kaprekar-numbers/Lua
\ No newline at end of file
diff --git a/Lang/Lua/LZW-compression b/Lang/Lua/LZW-compression
new file mode 120000
index 0000000000..4b61c84f61
--- /dev/null
+++ b/Lang/Lua/LZW-compression
@@ -0,0 +1 @@
+../../Task/LZW-compression/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Last-Friday-of-each-month b/Lang/Lua/Last-Friday-of-each-month
new file mode 120000
index 0000000000..9770ddff14
--- /dev/null
+++ b/Lang/Lua/Last-Friday-of-each-month
@@ -0,0 +1 @@
+../../Task/Last-Friday-of-each-month/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Left-factorials b/Lang/Lua/Left-factorials
new file mode 120000
index 0000000000..d935487376
--- /dev/null
+++ b/Lang/Lua/Left-factorials
@@ -0,0 +1 @@
+../../Task/Left-factorials/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Ludic-numbers b/Lang/Lua/Ludic-numbers
new file mode 120000
index 0000000000..89ecea8a65
--- /dev/null
+++ b/Lang/Lua/Ludic-numbers
@@ -0,0 +1 @@
+../../Task/Ludic-numbers/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Matrix-arithmetic b/Lang/Lua/Matrix-arithmetic
new file mode 120000
index 0000000000..282cb96da0
--- /dev/null
+++ b/Lang/Lua/Matrix-arithmetic
@@ -0,0 +1 @@
+../../Task/Matrix-arithmetic/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Move-to-front-algorithm b/Lang/Lua/Move-to-front-algorithm
new file mode 120000
index 0000000000..3bae429cce
--- /dev/null
+++ b/Lang/Lua/Move-to-front-algorithm
@@ -0,0 +1 @@
+../../Task/Move-to-front-algorithm/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Multifactorial b/Lang/Lua/Multifactorial
new file mode 120000
index 0000000000..40a398113d
--- /dev/null
+++ b/Lang/Lua/Multifactorial
@@ -0,0 +1 @@
+../../Task/Multifactorial/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Multiple-distinct-objects b/Lang/Lua/Multiple-distinct-objects
new file mode 120000
index 0000000000..7fc63235da
--- /dev/null
+++ b/Lang/Lua/Multiple-distinct-objects
@@ -0,0 +1 @@
+../../Task/Multiple-distinct-objects/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Multisplit b/Lang/Lua/Multisplit
new file mode 120000
index 0000000000..6a302d8a46
--- /dev/null
+++ b/Lang/Lua/Multisplit
@@ -0,0 +1 @@
+../../Task/Multisplit/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Narcissistic-decimal-number b/Lang/Lua/Narcissistic-decimal-number
new file mode 120000
index 0000000000..7a2af5a2d9
--- /dev/null
+++ b/Lang/Lua/Narcissistic-decimal-number
@@ -0,0 +1 @@
+../../Task/Narcissistic-decimal-number/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Non-decimal-radices-Convert b/Lang/Lua/Non-decimal-radices-Convert
new file mode 120000
index 0000000000..85446e26cf
--- /dev/null
+++ b/Lang/Lua/Non-decimal-radices-Convert
@@ -0,0 +1 @@
+../../Task/Non-decimal-radices-Convert/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Optional-parameters b/Lang/Lua/Optional-parameters
new file mode 120000
index 0000000000..a6a2e3d821
--- /dev/null
+++ b/Lang/Lua/Optional-parameters
@@ -0,0 +1 @@
+../../Task/Optional-parameters/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Order-disjoint-list-items b/Lang/Lua/Order-disjoint-list-items
new file mode 120000
index 0000000000..e602588956
--- /dev/null
+++ b/Lang/Lua/Order-disjoint-list-items
@@ -0,0 +1 @@
+../../Task/Order-disjoint-list-items/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Permutations-Derangements b/Lang/Lua/Permutations-Derangements
new file mode 120000
index 0000000000..a4c0ae5589
--- /dev/null
+++ b/Lang/Lua/Permutations-Derangements
@@ -0,0 +1 @@
+../../Task/Permutations-Derangements/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Permutations-by-swapping b/Lang/Lua/Permutations-by-swapping
new file mode 120000
index 0000000000..1d199962c6
--- /dev/null
+++ b/Lang/Lua/Permutations-by-swapping
@@ -0,0 +1 @@
+../../Task/Permutations-by-swapping/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Pernicious-numbers b/Lang/Lua/Pernicious-numbers
new file mode 120000
index 0000000000..6194177181
--- /dev/null
+++ b/Lang/Lua/Pernicious-numbers
@@ -0,0 +1 @@
+../../Task/Pernicious-numbers/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Phrase-reversals b/Lang/Lua/Phrase-reversals
new file mode 120000
index 0000000000..73e633751e
--- /dev/null
+++ b/Lang/Lua/Phrase-reversals
@@ -0,0 +1 @@
+../../Task/Phrase-reversals/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Pig-the-dice-game b/Lang/Lua/Pig-the-dice-game
new file mode 120000
index 0000000000..a772fe1367
--- /dev/null
+++ b/Lang/Lua/Pig-the-dice-game
@@ -0,0 +1 @@
+../../Task/Pig-the-dice-game/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Price-fraction b/Lang/Lua/Price-fraction
new file mode 120000
index 0000000000..9c6232e043
--- /dev/null
+++ b/Lang/Lua/Price-fraction
@@ -0,0 +1 @@
+../../Task/Price-fraction/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Quickselect-algorithm b/Lang/Lua/Quickselect-algorithm
new file mode 120000
index 0000000000..51f7497537
--- /dev/null
+++ b/Lang/Lua/Quickselect-algorithm
@@ -0,0 +1 @@
+../../Task/Quickselect-algorithm/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Range-extraction b/Lang/Lua/Range-extraction
new file mode 120000
index 0000000000..4233532ef8
--- /dev/null
+++ b/Lang/Lua/Range-extraction
@@ -0,0 +1 @@
+../../Task/Range-extraction/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Roots-of-a-function b/Lang/Lua/Roots-of-a-function
new file mode 120000
index 0000000000..e0f318b43c
--- /dev/null
+++ b/Lang/Lua/Roots-of-a-function
@@ -0,0 +1 @@
+../../Task/Roots-of-a-function/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Self-referential-sequence b/Lang/Lua/Self-referential-sequence
new file mode 120000
index 0000000000..6fd98eda14
--- /dev/null
+++ b/Lang/Lua/Self-referential-sequence
@@ -0,0 +1 @@
+../../Task/Self-referential-sequence/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Semiprime b/Lang/Lua/Semiprime
new file mode 120000
index 0000000000..cbb6c886e8
--- /dev/null
+++ b/Lang/Lua/Semiprime
@@ -0,0 +1 @@
+../../Task/Semiprime/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Set b/Lang/Lua/Set
new file mode 120000
index 0000000000..bc7b7bf81f
--- /dev/null
+++ b/Lang/Lua/Set
@@ -0,0 +1 @@
+../../Task/Set/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Show-the-epoch b/Lang/Lua/Show-the-epoch
new file mode 120000
index 0000000000..d429f57034
--- /dev/null
+++ b/Lang/Lua/Show-the-epoch
@@ -0,0 +1 @@
+../../Task/Show-the-epoch/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Sierpinski-triangle-Graphical b/Lang/Lua/Sierpinski-triangle-Graphical
new file mode 120000
index 0000000000..6ecb79b00d
--- /dev/null
+++ b/Lang/Lua/Sierpinski-triangle-Graphical
@@ -0,0 +1 @@
+../../Task/Sierpinski-triangle-Graphical/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Sorting-algorithms-Bead-sort b/Lang/Lua/Sorting-algorithms-Bead-sort
new file mode 120000
index 0000000000..630991817e
--- /dev/null
+++ b/Lang/Lua/Sorting-algorithms-Bead-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Bead-sort/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Sorting-algorithms-Merge-sort b/Lang/Lua/Sorting-algorithms-Merge-sort
new file mode 120000
index 0000000000..7697427748
--- /dev/null
+++ b/Lang/Lua/Sorting-algorithms-Merge-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Merge-sort/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Sorting-algorithms-Pancake-sort b/Lang/Lua/Sorting-algorithms-Pancake-sort
new file mode 120000
index 0000000000..61d93e4b1c
--- /dev/null
+++ b/Lang/Lua/Sorting-algorithms-Pancake-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Pancake-sort/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Stern-Brocot-sequence b/Lang/Lua/Stern-Brocot-sequence
new file mode 120000
index 0000000000..b607fd5218
--- /dev/null
+++ b/Lang/Lua/Stern-Brocot-sequence
@@ -0,0 +1 @@
+../../Task/Stern-Brocot-sequence/Lua
\ No newline at end of file
diff --git a/Lang/Lua/String-append b/Lang/Lua/String-append
new file mode 120000
index 0000000000..ffa0c223b2
--- /dev/null
+++ b/Lang/Lua/String-append
@@ -0,0 +1 @@
+../../Task/String-append/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Textonyms b/Lang/Lua/Textonyms
new file mode 120000
index 0000000000..6a5c7dc48e
--- /dev/null
+++ b/Lang/Lua/Textonyms
@@ -0,0 +1 @@
+../../Task/Textonyms/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Topswops b/Lang/Lua/Topswops
new file mode 120000
index 0000000000..db0f12cd16
--- /dev/null
+++ b/Lang/Lua/Topswops
@@ -0,0 +1 @@
+../../Task/Topswops/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Trabb-Pardo-Knuth-algorithm b/Lang/Lua/Trabb-Pardo-Knuth-algorithm
new file mode 120000
index 0000000000..547ad51151
--- /dev/null
+++ b/Lang/Lua/Trabb-Pardo-Knuth-algorithm
@@ -0,0 +1 @@
+../../Task/Trabb-Pardo-Knuth-algorithm/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Truncate-a-file b/Lang/Lua/Truncate-a-file
new file mode 120000
index 0000000000..b9408eae8b
--- /dev/null
+++ b/Lang/Lua/Truncate-a-file
@@ -0,0 +1 @@
+../../Task/Truncate-a-file/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Universal-Turing-machine b/Lang/Lua/Universal-Turing-machine
new file mode 120000
index 0000000000..6d5d8b28f3
--- /dev/null
+++ b/Lang/Lua/Universal-Turing-machine
@@ -0,0 +1 @@
+../../Task/Universal-Turing-machine/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Unix-ls b/Lang/Lua/Unix-ls
new file mode 120000
index 0000000000..b44add93f6
--- /dev/null
+++ b/Lang/Lua/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Web-scraping b/Lang/Lua/Web-scraping
new file mode 120000
index 0000000000..88f8e7517e
--- /dev/null
+++ b/Lang/Lua/Web-scraping
@@ -0,0 +1 @@
+../../Task/Web-scraping/Lua
\ No newline at end of file
diff --git a/Lang/Lua/XML-DOM-serialization b/Lang/Lua/XML-DOM-serialization
new file mode 120000
index 0000000000..235c751dbe
--- /dev/null
+++ b/Lang/Lua/XML-DOM-serialization
@@ -0,0 +1 @@
+../../Task/XML-DOM-serialization/Lua
\ No newline at end of file
diff --git a/Lang/Lua/XML-Output b/Lang/Lua/XML-Output
new file mode 120000
index 0000000000..f8a9907e24
--- /dev/null
+++ b/Lang/Lua/XML-Output
@@ -0,0 +1 @@
+../../Task/XML-Output/Lua
\ No newline at end of file
diff --git a/Lang/Lua/Zeckendorf-number-representation b/Lang/Lua/Zeckendorf-number-representation
new file mode 120000
index 0000000000..e34686db12
--- /dev/null
+++ b/Lang/Lua/Zeckendorf-number-representation
@@ -0,0 +1 @@
+../../Task/Zeckendorf-number-representation/Lua
\ No newline at end of file
diff --git a/Lang/MATLAB/Documentation b/Lang/MATLAB/Documentation
new file mode 120000
index 0000000000..370bdbc7a8
--- /dev/null
+++ b/Lang/MATLAB/Documentation
@@ -0,0 +1 @@
+../../Task/Documentation/MATLAB
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/99-Bottles-of-Beer b/Lang/MIPS-Assembly/99-Bottles-of-Beer
new file mode 120000
index 0000000000..e82de5184b
--- /dev/null
+++ b/Lang/MIPS-Assembly/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Arrays b/Lang/MIPS-Assembly/Arrays
new file mode 120000
index 0000000000..5df63102ef
--- /dev/null
+++ b/Lang/MIPS-Assembly/Arrays
@@ -0,0 +1 @@
+../../Task/Arrays/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Copy-a-string b/Lang/MIPS-Assembly/Copy-a-string
new file mode 120000
index 0000000000..646856f82a
--- /dev/null
+++ b/Lang/MIPS-Assembly/Copy-a-string
@@ -0,0 +1 @@
+../../Task/Copy-a-string/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Determine-if-a-string-is-numeric b/Lang/MIPS-Assembly/Determine-if-a-string-is-numeric
new file mode 120000
index 0000000000..09c4885170
--- /dev/null
+++ b/Lang/MIPS-Assembly/Determine-if-a-string-is-numeric
@@ -0,0 +1 @@
+../../Task/Determine-if-a-string-is-numeric/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Empty-program b/Lang/MIPS-Assembly/Empty-program
new file mode 120000
index 0000000000..e421bd976d
--- /dev/null
+++ b/Lang/MIPS-Assembly/Empty-program
@@ -0,0 +1 @@
+../../Task/Empty-program/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Even-or-odd b/Lang/MIPS-Assembly/Even-or-odd
new file mode 120000
index 0000000000..71da68582b
--- /dev/null
+++ b/Lang/MIPS-Assembly/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Factorial b/Lang/MIPS-Assembly/Factorial
new file mode 120000
index 0000000000..a3a742d000
--- /dev/null
+++ b/Lang/MIPS-Assembly/Factorial
@@ -0,0 +1 @@
+../../Task/Factorial/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Fibonacci-sequence b/Lang/MIPS-Assembly/Fibonacci-sequence
new file mode 120000
index 0000000000..dc6aa3bd17
--- /dev/null
+++ b/Lang/MIPS-Assembly/Fibonacci-sequence
@@ -0,0 +1 @@
+../../Task/Fibonacci-sequence/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/FizzBuzz b/Lang/MIPS-Assembly/FizzBuzz
new file mode 120000
index 0000000000..fe96af6d1d
--- /dev/null
+++ b/Lang/MIPS-Assembly/FizzBuzz
@@ -0,0 +1 @@
+../../Task/FizzBuzz/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Guess-the-number b/Lang/MIPS-Assembly/Guess-the-number
new file mode 120000
index 0000000000..399b9c35e1
--- /dev/null
+++ b/Lang/MIPS-Assembly/Guess-the-number
@@ -0,0 +1 @@
+../../Task/Guess-the-number/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Loops-Do-while b/Lang/MIPS-Assembly/Loops-Do-while
new file mode 120000
index 0000000000..cffdebcf4c
--- /dev/null
+++ b/Lang/MIPS-Assembly/Loops-Do-while
@@ -0,0 +1 @@
+../../Task/Loops-Do-while/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/Reverse-a-string b/Lang/MIPS-Assembly/Reverse-a-string
new file mode 120000
index 0000000000..45911eb6a6
--- /dev/null
+++ b/Lang/MIPS-Assembly/Reverse-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-a-string/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MIPS-Assembly/String-length b/Lang/MIPS-Assembly/String-length
new file mode 120000
index 0000000000..da295c8b7f
--- /dev/null
+++ b/Lang/MIPS-Assembly/String-length
@@ -0,0 +1 @@
+../../Task/String-length/MIPS-Assembly
\ No newline at end of file
diff --git a/Lang/MUMPS/Middle-three-digits b/Lang/MUMPS/Middle-three-digits
new file mode 120000
index 0000000000..165894891a
--- /dev/null
+++ b/Lang/MUMPS/Middle-three-digits
@@ -0,0 +1 @@
+../../Task/Middle-three-digits/MUMPS
\ No newline at end of file
diff --git a/Lang/Maple/24-game b/Lang/Maple/24-game
new file mode 120000
index 0000000000..490858a6cb
--- /dev/null
+++ b/Lang/Maple/24-game
@@ -0,0 +1 @@
+../../Task/24-game/Maple
\ No newline at end of file
diff --git a/Lang/Maple/ABC-Problem b/Lang/Maple/ABC-Problem
new file mode 120000
index 0000000000..e189d2379d
--- /dev/null
+++ b/Lang/Maple/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Address-of-a-variable b/Lang/Maple/Address-of-a-variable
new file mode 120000
index 0000000000..4dd50e704c
--- /dev/null
+++ b/Lang/Maple/Address-of-a-variable
@@ -0,0 +1 @@
+../../Task/Address-of-a-variable/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Arrays b/Lang/Maple/Arrays
new file mode 120000
index 0000000000..b960144c5d
--- /dev/null
+++ b/Lang/Maple/Arrays
@@ -0,0 +1 @@
+../../Task/Arrays/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Bulls-and-cows b/Lang/Maple/Bulls-and-cows
new file mode 120000
index 0000000000..acaf617f2a
--- /dev/null
+++ b/Lang/Maple/Bulls-and-cows
@@ -0,0 +1 @@
+../../Task/Bulls-and-cows/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Circles-of-given-radius-through-two-points b/Lang/Maple/Circles-of-given-radius-through-two-points
new file mode 120000
index 0000000000..b666d5e66d
--- /dev/null
+++ b/Lang/Maple/Circles-of-given-radius-through-two-points
@@ -0,0 +1 @@
+../../Task/Circles-of-given-radius-through-two-points/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Count-in-factors b/Lang/Maple/Count-in-factors
new file mode 120000
index 0000000000..70dccd4a98
--- /dev/null
+++ b/Lang/Maple/Count-in-factors
@@ -0,0 +1 @@
+../../Task/Count-in-factors/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Determine-if-a-string-is-numeric b/Lang/Maple/Determine-if-a-string-is-numeric
new file mode 120000
index 0000000000..efae507cd0
--- /dev/null
+++ b/Lang/Maple/Determine-if-a-string-is-numeric
@@ -0,0 +1 @@
+../../Task/Determine-if-a-string-is-numeric/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Discordian-date b/Lang/Maple/Discordian-date
new file mode 120000
index 0000000000..5a6b47b532
--- /dev/null
+++ b/Lang/Maple/Discordian-date
@@ -0,0 +1 @@
+../../Task/Discordian-date/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Draw-a-sphere b/Lang/Maple/Draw-a-sphere
new file mode 120000
index 0000000000..795c0e3729
--- /dev/null
+++ b/Lang/Maple/Draw-a-sphere
@@ -0,0 +1 @@
+../../Task/Draw-a-sphere/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Fibonacci-n-step-number-sequences b/Lang/Maple/Fibonacci-n-step-number-sequences
new file mode 120000
index 0000000000..264beff539
--- /dev/null
+++ b/Lang/Maple/Fibonacci-n-step-number-sequences
@@ -0,0 +1 @@
+../../Task/Fibonacci-n-step-number-sequences/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Fibonacci-sequence b/Lang/Maple/Fibonacci-sequence
new file mode 120000
index 0000000000..aca34e50df
--- /dev/null
+++ b/Lang/Maple/Fibonacci-sequence
@@ -0,0 +1 @@
+../../Task/Fibonacci-sequence/Maple
\ No newline at end of file
diff --git a/Lang/Maple/File-size b/Lang/Maple/File-size
new file mode 120000
index 0000000000..02101611bb
--- /dev/null
+++ b/Lang/Maple/File-size
@@ -0,0 +1 @@
+../../Task/File-size/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Flipping-bits-game b/Lang/Maple/Flipping-bits-game
new file mode 120000
index 0000000000..dd568f09b3
--- /dev/null
+++ b/Lang/Maple/Flipping-bits-game
@@ -0,0 +1 @@
+../../Task/Flipping-bits-game/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Floyds-triangle b/Lang/Maple/Floyds-triangle
new file mode 120000
index 0000000000..9f74710ad7
--- /dev/null
+++ b/Lang/Maple/Floyds-triangle
@@ -0,0 +1 @@
+../../Task/Floyds-triangle/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Formatted-numeric-output b/Lang/Maple/Formatted-numeric-output
new file mode 120000
index 0000000000..ec93401f2e
--- /dev/null
+++ b/Lang/Maple/Formatted-numeric-output
@@ -0,0 +1 @@
+../../Task/Formatted-numeric-output/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Function-definition b/Lang/Maple/Function-definition
new file mode 120000
index 0000000000..fa41c47168
--- /dev/null
+++ b/Lang/Maple/Function-definition
@@ -0,0 +1 @@
+../../Task/Function-definition/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Increment-a-numerical-string b/Lang/Maple/Increment-a-numerical-string
new file mode 120000
index 0000000000..9aa2ec26b9
--- /dev/null
+++ b/Lang/Maple/Increment-a-numerical-string
@@ -0,0 +1 @@
+../../Task/Increment-a-numerical-string/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Integer-comparison b/Lang/Maple/Integer-comparison
new file mode 120000
index 0000000000..b55960e706
--- /dev/null
+++ b/Lang/Maple/Integer-comparison
@@ -0,0 +1 @@
+../../Task/Integer-comparison/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Leap-year b/Lang/Maple/Leap-year
new file mode 120000
index 0000000000..a1f9e18d3f
--- /dev/null
+++ b/Lang/Maple/Leap-year
@@ -0,0 +1 @@
+../../Task/Leap-year/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Middle-three-digits b/Lang/Maple/Middle-three-digits
new file mode 120000
index 0000000000..b9d2de1b87
--- /dev/null
+++ b/Lang/Maple/Middle-three-digits
@@ -0,0 +1 @@
+../../Task/Middle-three-digits/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Multiplication-tables b/Lang/Maple/Multiplication-tables
new file mode 120000
index 0000000000..6906bb4449
--- /dev/null
+++ b/Lang/Maple/Multiplication-tables
@@ -0,0 +1 @@
+../../Task/Multiplication-tables/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Named-parameters b/Lang/Maple/Named-parameters
new file mode 120000
index 0000000000..f9b52686a9
--- /dev/null
+++ b/Lang/Maple/Named-parameters
@@ -0,0 +1 @@
+../../Task/Named-parameters/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Nth b/Lang/Maple/Nth
new file mode 120000
index 0000000000..d28fb45641
--- /dev/null
+++ b/Lang/Maple/Nth
@@ -0,0 +1 @@
+../../Task/Nth/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Null-object b/Lang/Maple/Null-object
new file mode 120000
index 0000000000..fdf1f4fb63
--- /dev/null
+++ b/Lang/Maple/Null-object
@@ -0,0 +1 @@
+../../Task/Null-object/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Old-lady-swallowed-a-fly b/Lang/Maple/Old-lady-swallowed-a-fly
new file mode 120000
index 0000000000..edaa030bec
--- /dev/null
+++ b/Lang/Maple/Old-lady-swallowed-a-fly
@@ -0,0 +1 @@
+../../Task/Old-lady-swallowed-a-fly/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Pascals-triangle b/Lang/Maple/Pascals-triangle
new file mode 120000
index 0000000000..8187dc7bcd
--- /dev/null
+++ b/Lang/Maple/Pascals-triangle
@@ -0,0 +1 @@
+../../Task/Pascals-triangle/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Pick-random-element b/Lang/Maple/Pick-random-element
new file mode 120000
index 0000000000..52e2787f9d
--- /dev/null
+++ b/Lang/Maple/Pick-random-element
@@ -0,0 +1 @@
+../../Task/Pick-random-element/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Pig-the-dice-game b/Lang/Maple/Pig-the-dice-game
new file mode 120000
index 0000000000..dea24cf48c
--- /dev/null
+++ b/Lang/Maple/Pig-the-dice-game
@@ -0,0 +1 @@
+../../Task/Pig-the-dice-game/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Price-fraction b/Lang/Maple/Price-fraction
new file mode 120000
index 0000000000..82632d74bd
--- /dev/null
+++ b/Lang/Maple/Price-fraction
@@ -0,0 +1 @@
+../../Task/Price-fraction/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Random-numbers b/Lang/Maple/Random-numbers
new file mode 120000
index 0000000000..556275d5cc
--- /dev/null
+++ b/Lang/Maple/Random-numbers
@@ -0,0 +1 @@
+../../Task/Random-numbers/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Roman-numerals-Decode b/Lang/Maple/Roman-numerals-Decode
new file mode 120000
index 0000000000..519d2d3fe7
--- /dev/null
+++ b/Lang/Maple/Roman-numerals-Decode
@@ -0,0 +1 @@
+../../Task/Roman-numerals-Decode/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Sierpinski-triangle b/Lang/Maple/Sierpinski-triangle
new file mode 120000
index 0000000000..592055611e
--- /dev/null
+++ b/Lang/Maple/Sierpinski-triangle
@@ -0,0 +1 @@
+../../Task/Sierpinski-triangle/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Statistics-Basic b/Lang/Maple/Statistics-Basic
new file mode 120000
index 0000000000..8d81cd428d
--- /dev/null
+++ b/Lang/Maple/Statistics-Basic
@@ -0,0 +1 @@
+../../Task/Statistics-Basic/Maple
\ No newline at end of file
diff --git a/Lang/Maple/String-append b/Lang/Maple/String-append
new file mode 120000
index 0000000000..a69a0a4821
--- /dev/null
+++ b/Lang/Maple/String-append
@@ -0,0 +1 @@
+../../Task/String-append/Maple
\ No newline at end of file
diff --git a/Lang/Maple/String-prepend b/Lang/Maple/String-prepend
new file mode 120000
index 0000000000..6281b98d98
--- /dev/null
+++ b/Lang/Maple/String-prepend
@@ -0,0 +1 @@
+../../Task/String-prepend/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Sum-and-product-of-an-array b/Lang/Maple/Sum-and-product-of-an-array
new file mode 120000
index 0000000000..f441bc7585
--- /dev/null
+++ b/Lang/Maple/Sum-and-product-of-an-array
@@ -0,0 +1 @@
+../../Task/Sum-and-product-of-an-array/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Sum-digits-of-an-integer b/Lang/Maple/Sum-digits-of-an-integer
new file mode 120000
index 0000000000..26a4520677
--- /dev/null
+++ b/Lang/Maple/Sum-digits-of-an-integer
@@ -0,0 +1 @@
+../../Task/Sum-digits-of-an-integer/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Temperature-conversion b/Lang/Maple/Temperature-conversion
new file mode 120000
index 0000000000..428d3e151b
--- /dev/null
+++ b/Lang/Maple/Temperature-conversion
@@ -0,0 +1 @@
+../../Task/Temperature-conversion/Maple
\ No newline at end of file
diff --git a/Lang/Maple/The-Twelve-Days-of-Christmas b/Lang/Maple/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..4a778b3989
--- /dev/null
+++ b/Lang/Maple/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Time-a-function b/Lang/Maple/Time-a-function
new file mode 120000
index 0000000000..b7969907c0
--- /dev/null
+++ b/Lang/Maple/Time-a-function
@@ -0,0 +1 @@
+../../Task/Time-a-function/Maple
\ No newline at end of file
diff --git a/Lang/Maple/User-input-Text b/Lang/Maple/User-input-Text
new file mode 120000
index 0000000000..3eefa820eb
--- /dev/null
+++ b/Lang/Maple/User-input-Text
@@ -0,0 +1 @@
+../../Task/User-input-Text/Maple
\ No newline at end of file
diff --git a/Lang/Maple/Variables b/Lang/Maple/Variables
new file mode 120000
index 0000000000..135a249300
--- /dev/null
+++ b/Lang/Maple/Variables
@@ -0,0 +1 @@
+../../Task/Variables/Maple
\ No newline at end of file
diff --git a/Lang/Mathematica/Percolation-Mean-run-density b/Lang/Mathematica/Percolation-Mean-run-density
new file mode 120000
index 0000000000..b942fb423f
--- /dev/null
+++ b/Lang/Mathematica/Percolation-Mean-run-density
@@ -0,0 +1 @@
+../../Task/Percolation-Mean-run-density/Mathematica
\ No newline at end of file
diff --git a/Lang/Mathematica/Ranking-methods b/Lang/Mathematica/Ranking-methods
new file mode 120000
index 0000000000..84678071a4
--- /dev/null
+++ b/Lang/Mathematica/Ranking-methods
@@ -0,0 +1 @@
+../../Task/Ranking-methods/Mathematica
\ No newline at end of file
diff --git a/Lang/Mercury/99-Bottles-of-Beer b/Lang/Mercury/99-Bottles-of-Beer
new file mode 120000
index 0000000000..7c9ea61302
--- /dev/null
+++ b/Lang/Mercury/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/Mercury
\ No newline at end of file
diff --git a/Lang/Mercury/Read-a-file-line-by-line b/Lang/Mercury/Read-a-file-line-by-line
new file mode 120000
index 0000000000..0bf01a153d
--- /dev/null
+++ b/Lang/Mercury/Read-a-file-line-by-line
@@ -0,0 +1 @@
+../../Task/Read-a-file-line-by-line/Mercury
\ No newline at end of file
diff --git a/Lang/Mercury/Write-float-arrays-to-a-text-file b/Lang/Mercury/Write-float-arrays-to-a-text-file
new file mode 120000
index 0000000000..212d64f0be
--- /dev/null
+++ b/Lang/Mercury/Write-float-arrays-to-a-text-file
@@ -0,0 +1 @@
+../../Task/Write-float-arrays-to-a-text-file/Mercury
\ No newline at end of file
diff --git a/Lang/Modula-2/Permutations b/Lang/Modula-2/Permutations
new file mode 120000
index 0000000000..bde8efe166
--- /dev/null
+++ b/Lang/Modula-2/Permutations
@@ -0,0 +1 @@
+../../Task/Permutations/Modula-2
\ No newline at end of file
diff --git a/Lang/Neko/Even-or-odd b/Lang/Neko/Even-or-odd
new file mode 120000
index 0000000000..9a29685aa8
--- /dev/null
+++ b/Lang/Neko/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/Neko
\ No newline at end of file
diff --git a/Lang/Neko/Factorial b/Lang/Neko/Factorial
new file mode 120000
index 0000000000..ffc440250b
--- /dev/null
+++ b/Lang/Neko/Factorial
@@ -0,0 +1 @@
+../../Task/Factorial/Neko
\ No newline at end of file
diff --git a/Lang/NetLogo/Universal-Turing-machine b/Lang/NetLogo/Universal-Turing-machine
new file mode 120000
index 0000000000..c993665632
--- /dev/null
+++ b/Lang/NetLogo/Universal-Turing-machine
@@ -0,0 +1 @@
+../../Task/Universal-Turing-machine/NetLogo
\ No newline at end of file
diff --git a/Lang/NewLISP/100-doors b/Lang/NewLISP/100-doors
new file mode 120000
index 0000000000..b646e267d9
--- /dev/null
+++ b/Lang/NewLISP/100-doors
@@ -0,0 +1 @@
+../../Task/100-doors/NewLISP
\ No newline at end of file
diff --git a/Lang/NewLISP/Five-weekends b/Lang/NewLISP/Five-weekends
new file mode 120000
index 0000000000..a94f13a8a6
--- /dev/null
+++ b/Lang/NewLISP/Five-weekends
@@ -0,0 +1 @@
+../../Task/Five-weekends/NewLISP
\ No newline at end of file
diff --git a/Lang/NewLISP/Make-directory-path b/Lang/NewLISP/Make-directory-path
new file mode 120000
index 0000000000..6baf4f9c80
--- /dev/null
+++ b/Lang/NewLISP/Make-directory-path
@@ -0,0 +1 @@
+../../Task/Make-directory-path/NewLISP
\ No newline at end of file
diff --git a/Lang/NewLISP/Pangram-checker b/Lang/NewLISP/Pangram-checker
new file mode 120000
index 0000000000..1ca5616c85
--- /dev/null
+++ b/Lang/NewLISP/Pangram-checker
@@ -0,0 +1 @@
+../../Task/Pangram-checker/NewLISP
\ No newline at end of file
diff --git a/Lang/NewLISP/Remove-lines-from-a-file b/Lang/NewLISP/Remove-lines-from-a-file
new file mode 120000
index 0000000000..b997d1471a
--- /dev/null
+++ b/Lang/NewLISP/Remove-lines-from-a-file
@@ -0,0 +1 @@
+../../Task/Remove-lines-from-a-file/NewLISP
\ No newline at end of file
diff --git a/Lang/NewLISP/Sockets b/Lang/NewLISP/Sockets
new file mode 120000
index 0000000000..50a06f2297
--- /dev/null
+++ b/Lang/NewLISP/Sockets
@@ -0,0 +1 @@
+../../Task/Sockets/NewLISP
\ No newline at end of file
diff --git a/Lang/NewLISP/Zero-to-the-zero-power b/Lang/NewLISP/Zero-to-the-zero-power
new file mode 120000
index 0000000000..e86c9a30d7
--- /dev/null
+++ b/Lang/NewLISP/Zero-to-the-zero-power
@@ -0,0 +1 @@
+../../Task/Zero-to-the-zero-power/NewLISP
\ No newline at end of file
diff --git a/Lang/OCaml/AKS-test-for-primes b/Lang/OCaml/AKS-test-for-primes
new file mode 120000
index 0000000000..745b4b349a
--- /dev/null
+++ b/Lang/OCaml/AKS-test-for-primes
@@ -0,0 +1 @@
+../../Task/AKS-test-for-primes/OCaml
\ No newline at end of file
diff --git a/Lang/OCaml/Benfords-law b/Lang/OCaml/Benfords-law
new file mode 120000
index 0000000000..6b80acbbea
--- /dev/null
+++ b/Lang/OCaml/Benfords-law
@@ -0,0 +1 @@
+../../Task/Benfords-law/OCaml
\ No newline at end of file
diff --git a/Lang/OCaml/Fractran b/Lang/OCaml/Fractran
new file mode 120000
index 0000000000..3773695965
--- /dev/null
+++ b/Lang/OCaml/Fractran
@@ -0,0 +1 @@
+../../Task/Fractran/OCaml
\ No newline at end of file
diff --git a/Lang/OCaml/Hamming-numbers b/Lang/OCaml/Hamming-numbers
new file mode 120000
index 0000000000..76d8b6e1a4
--- /dev/null
+++ b/Lang/OCaml/Hamming-numbers
@@ -0,0 +1 @@
+../../Task/Hamming-numbers/OCaml
\ No newline at end of file
diff --git a/Lang/OCaml/IBAN b/Lang/OCaml/IBAN
new file mode 120000
index 0000000000..bf5f1f769d
--- /dev/null
+++ b/Lang/OCaml/IBAN
@@ -0,0 +1 @@
+../../Task/IBAN/OCaml
\ No newline at end of file
diff --git a/Lang/Oberon-2/Apply-a-callback-to-an-array b/Lang/Oberon-2/Apply-a-callback-to-an-array
new file mode 120000
index 0000000000..6a0d530bd3
--- /dev/null
+++ b/Lang/Oberon-2/Apply-a-callback-to-an-array
@@ -0,0 +1 @@
+../../Task/Apply-a-callback-to-an-array/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Arithmetic-geometric-mean b/Lang/Oberon-2/Arithmetic-geometric-mean
new file mode 120000
index 0000000000..7950991d82
--- /dev/null
+++ b/Lang/Oberon-2/Arithmetic-geometric-mean
@@ -0,0 +1 @@
+../../Task/Arithmetic-geometric-mean/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Averages-Mean-time-of-day b/Lang/Oberon-2/Averages-Mean-time-of-day
new file mode 120000
index 0000000000..2e45ca3c9b
--- /dev/null
+++ b/Lang/Oberon-2/Averages-Mean-time-of-day
@@ -0,0 +1 @@
+../../Task/Averages-Mean-time-of-day/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Averages-Mode b/Lang/Oberon-2/Averages-Mode
new file mode 120000
index 0000000000..48dd9cf166
--- /dev/null
+++ b/Lang/Oberon-2/Averages-Mode
@@ -0,0 +1 @@
+../../Task/Averages-Mode/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Balanced-brackets b/Lang/Oberon-2/Balanced-brackets
new file mode 120000
index 0000000000..be20230b44
--- /dev/null
+++ b/Lang/Oberon-2/Balanced-brackets
@@ -0,0 +1 @@
+../../Task/Balanced-brackets/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Benfords-law b/Lang/Oberon-2/Benfords-law
new file mode 120000
index 0000000000..6df7ec4d7e
--- /dev/null
+++ b/Lang/Oberon-2/Benfords-law
@@ -0,0 +1 @@
+../../Task/Benfords-law/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Bitwise-operations b/Lang/Oberon-2/Bitwise-operations
new file mode 120000
index 0000000000..b0ac99b523
--- /dev/null
+++ b/Lang/Oberon-2/Bitwise-operations
@@ -0,0 +1 @@
+../../Task/Bitwise-operations/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Comma-quibbling b/Lang/Oberon-2/Comma-quibbling
new file mode 120000
index 0000000000..ad57987046
--- /dev/null
+++ b/Lang/Oberon-2/Comma-quibbling
@@ -0,0 +1 @@
+../../Task/Comma-quibbling/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Count-in-octal b/Lang/Oberon-2/Count-in-octal
new file mode 120000
index 0000000000..f716bfe8ff
--- /dev/null
+++ b/Lang/Oberon-2/Count-in-octal
@@ -0,0 +1 @@
+../../Task/Count-in-octal/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/DNS-query b/Lang/Oberon-2/DNS-query
new file mode 120000
index 0000000000..6ae2231fbb
--- /dev/null
+++ b/Lang/Oberon-2/DNS-query
@@ -0,0 +1 @@
+../../Task/DNS-query/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Dot-product b/Lang/Oberon-2/Dot-product
new file mode 120000
index 0000000000..af9fc791a5
--- /dev/null
+++ b/Lang/Oberon-2/Dot-product
@@ -0,0 +1 @@
+../../Task/Dot-product/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Even-or-odd b/Lang/Oberon-2/Even-or-odd
new file mode 120000
index 0000000000..9337f5c322
--- /dev/null
+++ b/Lang/Oberon-2/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Fibonacci-sequence b/Lang/Oberon-2/Fibonacci-sequence
new file mode 120000
index 0000000000..eece6514a5
--- /dev/null
+++ b/Lang/Oberon-2/Fibonacci-sequence
@@ -0,0 +1 @@
+../../Task/Fibonacci-sequence/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Horners-rule-for-polynomial-evaluation b/Lang/Oberon-2/Horners-rule-for-polynomial-evaluation
new file mode 120000
index 0000000000..81a9029231
--- /dev/null
+++ b/Lang/Oberon-2/Horners-rule-for-polynomial-evaluation
@@ -0,0 +1 @@
+../../Task/Horners-rule-for-polynomial-evaluation/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Huffman-coding b/Lang/Oberon-2/Huffman-coding
new file mode 120000
index 0000000000..08c4694c40
--- /dev/null
+++ b/Lang/Oberon-2/Huffman-coding
@@ -0,0 +1 @@
+../../Task/Huffman-coding/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Null-object b/Lang/Oberon-2/Null-object
new file mode 120000
index 0000000000..786dd0d880
--- /dev/null
+++ b/Lang/Oberon-2/Null-object
@@ -0,0 +1 @@
+../../Task/Null-object/Oberon-2
\ No newline at end of file
diff --git a/Lang/Oberon-2/Stack b/Lang/Oberon-2/Stack
new file mode 120000
index 0000000000..72fc2d1dd2
--- /dev/null
+++ b/Lang/Oberon-2/Stack
@@ -0,0 +1 @@
+../../Task/Stack/Oberon-2
\ No newline at end of file
diff --git a/Lang/Objeck/99-Bottles-of-Beer b/Lang/Objeck/99-Bottles-of-Beer
new file mode 120000
index 0000000000..7462432663
--- /dev/null
+++ b/Lang/Objeck/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/Objeck
\ No newline at end of file
diff --git a/Lang/Objeck/Catamorphism b/Lang/Objeck/Catamorphism
new file mode 120000
index 0000000000..da1d636d59
--- /dev/null
+++ b/Lang/Objeck/Catamorphism
@@ -0,0 +1 @@
+../../Task/Catamorphism/Objeck
\ No newline at end of file
diff --git a/Lang/Objeck/Empty-directory b/Lang/Objeck/Empty-directory
new file mode 120000
index 0000000000..5c99bf1c88
--- /dev/null
+++ b/Lang/Objeck/Empty-directory
@@ -0,0 +1 @@
+../../Task/Empty-directory/Objeck
\ No newline at end of file
diff --git a/Lang/Objeck/Towers-of-Hanoi b/Lang/Objeck/Towers-of-Hanoi
new file mode 120000
index 0000000000..9c542d8c34
--- /dev/null
+++ b/Lang/Objeck/Towers-of-Hanoi
@@ -0,0 +1 @@
+../../Task/Towers-of-Hanoi/Objeck
\ No newline at end of file
diff --git a/Lang/Onyx/100-doors b/Lang/Onyx/100-doors
new file mode 120000
index 0000000000..c2018de3ae
--- /dev/null
+++ b/Lang/Onyx/100-doors
@@ -0,0 +1 @@
+../../Task/100-doors/Onyx
\ No newline at end of file
diff --git a/Lang/Onyx/99-Bottles-of-Beer b/Lang/Onyx/99-Bottles-of-Beer
new file mode 120000
index 0000000000..fb1ed8ca55
--- /dev/null
+++ b/Lang/Onyx/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/Onyx
\ No newline at end of file
diff --git a/Lang/Onyx/A+B b/Lang/Onyx/A+B
new file mode 120000
index 0000000000..7683790576
--- /dev/null
+++ b/Lang/Onyx/A+B
@@ -0,0 +1 @@
+../../Task/A+B/Onyx
\ No newline at end of file
diff --git a/Lang/Onyx/Arithmetic-Integer b/Lang/Onyx/Arithmetic-Integer
new file mode 120000
index 0000000000..58acce76aa
--- /dev/null
+++ b/Lang/Onyx/Arithmetic-Integer
@@ -0,0 +1 @@
+../../Task/Arithmetic-Integer/Onyx
\ No newline at end of file
diff --git a/Lang/Onyx/Array-concatenation b/Lang/Onyx/Array-concatenation
new file mode 120000
index 0000000000..63ae36cb33
--- /dev/null
+++ b/Lang/Onyx/Array-concatenation
@@ -0,0 +1 @@
+../../Task/Array-concatenation/Onyx
\ No newline at end of file
diff --git a/Lang/Onyx/Loops-For b/Lang/Onyx/Loops-For
new file mode 120000
index 0000000000..fcf9a742a0
--- /dev/null
+++ b/Lang/Onyx/Loops-For
@@ -0,0 +1 @@
+../../Task/Loops-For/Onyx
\ No newline at end of file
diff --git a/Lang/OoRexx/Horizontal-sundial-calculations b/Lang/OoRexx/Horizontal-sundial-calculations
new file mode 120000
index 0000000000..91ade97771
--- /dev/null
+++ b/Lang/OoRexx/Horizontal-sundial-calculations
@@ -0,0 +1 @@
+../../Task/Horizontal-sundial-calculations/OoRexx
\ No newline at end of file
diff --git a/Lang/OoRexx/Nautical-bell b/Lang/OoRexx/Nautical-bell
new file mode 120000
index 0000000000..74b0cce0d7
--- /dev/null
+++ b/Lang/OoRexx/Nautical-bell
@@ -0,0 +1 @@
+../../Task/Nautical-bell/OoRexx
\ No newline at end of file
diff --git a/Lang/OoRexx/Roots-of-unity b/Lang/OoRexx/Roots-of-unity
new file mode 120000
index 0000000000..63fe2a78bd
--- /dev/null
+++ b/Lang/OoRexx/Roots-of-unity
@@ -0,0 +1 @@
+../../Task/Roots-of-unity/OoRexx
\ No newline at end of file
diff --git a/Lang/OpenEdge-Progress/ABC-Problem b/Lang/OpenEdge-Progress/ABC-Problem
new file mode 120000
index 0000000000..4f9cc249f0
--- /dev/null
+++ b/Lang/OpenEdge-Progress/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/OpenEdge-Progress
\ No newline at end of file
diff --git a/Lang/OpenEdge-Progress/Mandelbrot-set b/Lang/OpenEdge-Progress/Mandelbrot-set
new file mode 120000
index 0000000000..2f900b1f04
--- /dev/null
+++ b/Lang/OpenEdge-Progress/Mandelbrot-set
@@ -0,0 +1 @@
+../../Task/Mandelbrot-set/OpenEdge-Progress
\ No newline at end of file
diff --git a/Lang/Openscad/Dragon-curve b/Lang/Openscad/Dragon-curve
new file mode 120000
index 0000000000..1fec07472a
--- /dev/null
+++ b/Lang/Openscad/Dragon-curve
@@ -0,0 +1 @@
+../../Task/Dragon-curve/Openscad
\ No newline at end of file
diff --git a/Lang/Oz/00DESCRIPTION b/Lang/Oz/00DESCRIPTION
index 3e8d0187a6..31a6626c9c 100644
--- a/Lang/Oz/00DESCRIPTION
+++ b/Lang/Oz/00DESCRIPTION
@@ -20,5 +20,5 @@ All examples that start with declare can be used directly in the Em
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]
+#[https://mozart.github.io/mozart-v1/doc-1.4.0/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/PARI-GP/00DESCRIPTION b/Lang/PARI-GP/00DESCRIPTION
index 12cf8c2691..cf4ba59ba3 100644
--- a/Lang/PARI-GP/00DESCRIPTION
+++ b/Lang/PARI-GP/00DESCRIPTION
@@ -17,38 +17,40 @@ PARI/GP is a widely used computer algebra system designed for fast computations
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 Allombert.
+PARI was written by Henri Cohen and others at Université de Bordeaux 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 Allombert.
== Using PARI/GP ==
PARI/GP can be downloaded at its official website's [http://pari.math.u-bordeaux.fr/download.html download page].
-Windows precompiled binaries are available: an installer, stand-alone stable and development versions, plus a nightly build with the very latest changes.
-
-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.
+Windows precompiled binaries are available: an installer, stand-alone stable and development versions, plus a nightly build with the very latest changes. [http://pari.math.u-bordeaux.fr/pub/pari/mac/snapshots/ Mac snapshots] are also available. 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.
Android phones and tablets can use [https://code.google.com/p/paridroid/ paridroid] (also [https://github.com/FreeMonad/paridroid on github]).
-While an iPhone/iPad version has not been developed, [https://itunes.apple.com/us/app/sage-math/id496492945?mt=8 sage-math] includes PARI and GP commands can be invoked with the wrapper function pari.
+While an iPhone/iPad version has not been developed, [https://itunes.apple.com/us/app/sage-math/id496492945?mt=8 sage-math] includes gp. Click the "+" in the top-right to start a new program, then click and hold on "Sage" at the top until the "Select Language" dropdown appears, then choose GP. (You can also use the wrapper function pari in a Sage snippet.)
-Finally, gp can be used online through [http://www.compileonline.com/execute_pari_online.php compile online] or the [https://cloud.sagemath.com/ SageMath cloud] (see [http://youtu.be/CzB6T7Nvc-s How to use PARI/GP in the SageMathCloud]).
+Finally, gp can be used online through [http://pari.math.u-bordeaux.fr/gp.html the PARI/GP site] (via Emscripten), [http://www.compileonline.com/execute_pari_online.php compile online] or the [https://cloud.sagemath.com/ SageMath cloud] (see [http://youtu.be/CzB6T7Nvc-s How to use PARI/GP in the SageMathCloud]).
== 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://www.emacswiki.org/emacs/PariGP PariGP on EmacsWiki], [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]
-* [https://github.com/baruchel/vim-notebook vim-notebook]
+* [https://github.com/baruchel/vim-notebook vim-notebook] (see also [https://www.youtube.com/watch?v=vHiCpRQiJuU the author's video on using gp from vim])
* [https://github.com/jdemeyer/pari_jupyter Jupyter kernel]
-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.
+If you want to program with PARI, 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. The [http://pari.math.u-bordeaux.fr/pub/pari/manuals/gp2c/gp2c.html gp2c] utility converts GP scripts into executable C code.
** For use with the Gnu Mpc library, there is also [http://www.multiprecision.org/?prog=pari-gnump Pari-Gnump].
* [[C++]]: PARI can be used directly in C++. The code is intentionally written in a C++-compatible style. -fpermissive is sometimes useful when compiling with g++.
-* [[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].
+* [[Python]]:
+** [http://www.sagemath.org/ SageMath] (or SAGE) is a Python-based system that includes GP among others
+** [http://code.google.com/p/pari-python/ pari-python]
+** [https://pypi.python.org/pypi/cypari/ cypari] is a fork of the GP component of SageMath
+* [[Perl]]:
+** [http://search.cpan.org/dist/Math-Pari/ Math::Pari]
+** [https://github.com/FreeMonad/GPP GPP]
* [[Common Lisp]]: Use [http://clisp.sourceforge.net/impnotes/pari.html Pari] ([[CLISP]]).
+* [[Mathematica]]: A [http://pari.math.u-bordeaux.fr/dochtml/mathlink.html quick tutorial using MathLink] is available.
== See also ==
*[[wp:PARI/GP|Wikipedia:PARI/GP]]
@@ -56,25 +58,29 @@ If you want to write a program rather than script a calculator, many languages a
== 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
+*[http://pari.math.u-bordeaux.fr/ateliers.html Ateliers PARI/GP]: Conference slides and other resources
+*[http://hyperpolyglot.org/more-computer-algebra Comparison with Magma, GAP, and Singular]
=== 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)
+*[http://pari.math.u-bordeaux.fr/pub/pari/manuals/2.7.0/tutorial.pdf Official tutorial] by The PARI Group (52 pp., 2014)
+*[http://www.math.u-bordeaux.fr/~ballombe/talks/bordeaux-20150924.pdf Tutorial on Elliptic Curves] by Bill Allombert and Karim Belabas (5 pp., 2016)
*[http://www.math.psu.edu/wdb/467/pariinfo.pdf Beginning PARI Programming for CSE/MATH 467] by W. Dale Brownawell (7 pp., 2014)
*[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://people.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); also appears in an [https://bbuseruploads.s3.amazonaws.com/mvngu/www/downloads/2008-11-25_numtheory-crypto-gp.pdf?Signature=3c1KatVUdnnTc4lOtzpOgsJg6Fw%3D&Expires=1411628731&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82 extended version] lacking a stable URL (9 pp., 2008)
+*[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); also appears in an [https://bitbucket.org/mvngu/www/downloads/2008-11-25_numtheory-crypto-gp.pdf extended version] (9 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://www.youtube.com/watch?v=wCyU2n-G-pk 3] [http://www.youtube.com/watch?v=WOCuBvK8O6Q 4] (appx. 20 minutes, 2011)
*[http://w3.countnumber.de/fischer/res-ZT2007/PariByExample.pdf Erste Schritte mit PARI/GP] by Lars Fischer (13 pp., 2007; German)
*[http://www.maths.tcd.ie/~vlasenko/MA2316/ Class notes] including PARI/GP tutorial and sample code by Masha Vlasenko (2013)
* 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; now offline?)
+*[http://users.aims.ac.za/~richard/faq/index.php Pari/GP Tutorial] by Akinola Richard Olatokunbo
+*[https://www.youtube.com/watch?v=FeG0BYRrDOE&t=12m Video demo of RSA in PARI/GP] by Maren1955 (2014, 17:39)
=== 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
+* Robert H. Lewis and Michael Wester, [https://home.bway.net/lewis/cacomp.ps Comparison of polynomial-oriented computer algebra systems], ''ACM SIGSAM Bulletin'' '''33''':4 (1999), pp. 5-13.
[[Category:Mathematical programming languages]]
\ No newline at end of file
diff --git a/Lang/PARI-GP/9-billion-names-of-God-the-integer b/Lang/PARI-GP/9-billion-names-of-God-the-integer
new file mode 120000
index 0000000000..45e86c4a2f
--- /dev/null
+++ b/Lang/PARI-GP/9-billion-names-of-God-the-integer
@@ -0,0 +1 @@
+../../Task/9-billion-names-of-God-the-integer/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/ABC-Problem b/Lang/PARI-GP/ABC-Problem
new file mode 120000
index 0000000000..0bcb00d15c
--- /dev/null
+++ b/Lang/PARI-GP/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Anagrams-Deranged-anagrams b/Lang/PARI-GP/Anagrams-Deranged-anagrams
new file mode 120000
index 0000000000..8ba66c5782
--- /dev/null
+++ b/Lang/PARI-GP/Anagrams-Deranged-anagrams
@@ -0,0 +1 @@
+../../Task/Anagrams-Deranged-anagrams/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Brownian-tree b/Lang/PARI-GP/Brownian-tree
new file mode 120000
index 0000000000..61c1cc2fcd
--- /dev/null
+++ b/Lang/PARI-GP/Brownian-tree
@@ -0,0 +1 @@
+../../Task/Brownian-tree/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/CRC-32 b/Lang/PARI-GP/CRC-32
new file mode 120000
index 0000000000..b1cbe759b7
--- /dev/null
+++ b/Lang/PARI-GP/CRC-32
@@ -0,0 +1 @@
+../../Task/CRC-32/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/CSV-data-manipulation b/Lang/PARI-GP/CSV-data-manipulation
new file mode 120000
index 0000000000..510a6ff1b2
--- /dev/null
+++ b/Lang/PARI-GP/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Cholesky-decomposition b/Lang/PARI-GP/Cholesky-decomposition
new file mode 120000
index 0000000000..771d4a5d9f
--- /dev/null
+++ b/Lang/PARI-GP/Cholesky-decomposition
@@ -0,0 +1 @@
+../../Task/Cholesky-decomposition/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Combinations-and-permutations b/Lang/PARI-GP/Combinations-and-permutations
new file mode 120000
index 0000000000..e0ad06bbd2
--- /dev/null
+++ b/Lang/PARI-GP/Combinations-and-permutations
@@ -0,0 +1 @@
+../../Task/Combinations-and-permutations/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Create-a-file b/Lang/PARI-GP/Create-a-file
new file mode 120000
index 0000000000..ef0533f9ed
--- /dev/null
+++ b/Lang/PARI-GP/Create-a-file
@@ -0,0 +1 @@
+../../Task/Create-a-file/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Digital-root-Multiplicative-digital-root b/Lang/PARI-GP/Digital-root-Multiplicative-digital-root
new file mode 120000
index 0000000000..aea98a97cf
--- /dev/null
+++ b/Lang/PARI-GP/Digital-root-Multiplicative-digital-root
@@ -0,0 +1 @@
+../../Task/Digital-root-Multiplicative-digital-root/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Draw-a-cuboid b/Lang/PARI-GP/Draw-a-cuboid
new file mode 120000
index 0000000000..ed7423b393
--- /dev/null
+++ b/Lang/PARI-GP/Draw-a-cuboid
@@ -0,0 +1 @@
+../../Task/Draw-a-cuboid/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Empty-directory b/Lang/PARI-GP/Empty-directory
new file mode 120000
index 0000000000..d7ddfae180
--- /dev/null
+++ b/Lang/PARI-GP/Empty-directory
@@ -0,0 +1 @@
+../../Task/Empty-directory/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Evolutionary-algorithm b/Lang/PARI-GP/Evolutionary-algorithm
new file mode 120000
index 0000000000..0933ae556c
--- /dev/null
+++ b/Lang/PARI-GP/Evolutionary-algorithm
@@ -0,0 +1 @@
+../../Task/Evolutionary-algorithm/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Exceptions-Catch-an-exception-thrown-in-a-nested-call b/Lang/PARI-GP/Exceptions-Catch-an-exception-thrown-in-a-nested-call
new file mode 120000
index 0000000000..ec07f233c7
--- /dev/null
+++ b/Lang/PARI-GP/Exceptions-Catch-an-exception-thrown-in-a-nested-call
@@ -0,0 +1 @@
+../../Task/Exceptions-Catch-an-exception-thrown-in-a-nested-call/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Executable-library b/Lang/PARI-GP/Executable-library
new file mode 120000
index 0000000000..828321f9fe
--- /dev/null
+++ b/Lang/PARI-GP/Executable-library
@@ -0,0 +1 @@
+../../Task/Executable-library/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Fibonacci-word-fractal b/Lang/PARI-GP/Fibonacci-word-fractal
new file mode 120000
index 0000000000..2b8a1c845b
--- /dev/null
+++ b/Lang/PARI-GP/Fibonacci-word-fractal
@@ -0,0 +1 @@
+../../Task/Fibonacci-word-fractal/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Find-the-last-Sunday-of-each-month b/Lang/PARI-GP/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..b562f9d892
--- /dev/null
+++ b/Lang/PARI-GP/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Fractal-tree b/Lang/PARI-GP/Fractal-tree
new file mode 120000
index 0000000000..e5bd51d012
--- /dev/null
+++ b/Lang/PARI-GP/Fractal-tree
@@ -0,0 +1 @@
+../../Task/Fractal-tree/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Fractran b/Lang/PARI-GP/Fractran
new file mode 120000
index 0000000000..ae6bae2040
--- /dev/null
+++ b/Lang/PARI-GP/Fractran
@@ -0,0 +1 @@
+../../Task/Fractran/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Generate-lower-case-ASCII-alphabet b/Lang/PARI-GP/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..f3231a1049
--- /dev/null
+++ b/Lang/PARI-GP/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Hash-from-two-arrays b/Lang/PARI-GP/Hash-from-two-arrays
new file mode 120000
index 0000000000..b3d33fffa9
--- /dev/null
+++ b/Lang/PARI-GP/Hash-from-two-arrays
@@ -0,0 +1 @@
+../../Task/Hash-from-two-arrays/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Iterated-digits-squaring b/Lang/PARI-GP/Iterated-digits-squaring
new file mode 120000
index 0000000000..259bc2bcb1
--- /dev/null
+++ b/Lang/PARI-GP/Iterated-digits-squaring
@@ -0,0 +1 @@
+../../Task/Iterated-digits-squaring/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/LU-decomposition b/Lang/PARI-GP/LU-decomposition
new file mode 120000
index 0000000000..1c0e0fc513
--- /dev/null
+++ b/Lang/PARI-GP/LU-decomposition
@@ -0,0 +1 @@
+../../Task/LU-decomposition/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Last-Friday-of-each-month b/Lang/PARI-GP/Last-Friday-of-each-month
new file mode 120000
index 0000000000..924c7021f4
--- /dev/null
+++ b/Lang/PARI-GP/Last-Friday-of-each-month
@@ -0,0 +1 @@
+../../Task/Last-Friday-of-each-month/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Levenshtein-distance b/Lang/PARI-GP/Levenshtein-distance
new file mode 120000
index 0000000000..7b971c1850
--- /dev/null
+++ b/Lang/PARI-GP/Levenshtein-distance
@@ -0,0 +1 @@
+../../Task/Levenshtein-distance/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Ludic-numbers b/Lang/PARI-GP/Ludic-numbers
new file mode 120000
index 0000000000..2891c8deab
--- /dev/null
+++ b/Lang/PARI-GP/Ludic-numbers
@@ -0,0 +1 @@
+../../Task/Ludic-numbers/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/MD4 b/Lang/PARI-GP/MD4
new file mode 120000
index 0000000000..bc2bbbda69
--- /dev/null
+++ b/Lang/PARI-GP/MD4
@@ -0,0 +1 @@
+../../Task/MD4/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/MD5 b/Lang/PARI-GP/MD5
new file mode 120000
index 0000000000..562463c424
--- /dev/null
+++ b/Lang/PARI-GP/MD5
@@ -0,0 +1 @@
+../../Task/MD5/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Magic-squares-of-odd-order b/Lang/PARI-GP/Magic-squares-of-odd-order
new file mode 120000
index 0000000000..9a57704716
--- /dev/null
+++ b/Lang/PARI-GP/Magic-squares-of-odd-order
@@ -0,0 +1 @@
+../../Task/Magic-squares-of-odd-order/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Narcissist b/Lang/PARI-GP/Narcissist
new file mode 120000
index 0000000000..46df19394a
--- /dev/null
+++ b/Lang/PARI-GP/Narcissist
@@ -0,0 +1 @@
+../../Task/Narcissist/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Narcissistic-decimal-number b/Lang/PARI-GP/Narcissistic-decimal-number
new file mode 120000
index 0000000000..819da34a07
--- /dev/null
+++ b/Lang/PARI-GP/Narcissistic-decimal-number
@@ -0,0 +1 @@
+../../Task/Narcissistic-decimal-number/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/One-of-n-lines-in-a-file b/Lang/PARI-GP/One-of-n-lines-in-a-file
new file mode 120000
index 0000000000..acaa5440c1
--- /dev/null
+++ b/Lang/PARI-GP/One-of-n-lines-in-a-file
@@ -0,0 +1 @@
+../../Task/One-of-n-lines-in-a-file/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Ordered-words b/Lang/PARI-GP/Ordered-words
new file mode 120000
index 0000000000..fb0e1171cd
--- /dev/null
+++ b/Lang/PARI-GP/Ordered-words
@@ -0,0 +1 @@
+../../Task/Ordered-words/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Quine b/Lang/PARI-GP/Quine
new file mode 120000
index 0000000000..0ecf2943ba
--- /dev/null
+++ b/Lang/PARI-GP/Quine
@@ -0,0 +1 @@
+../../Task/Quine/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/RIPEMD-160 b/Lang/PARI-GP/RIPEMD-160
new file mode 120000
index 0000000000..542a3d7781
--- /dev/null
+++ b/Lang/PARI-GP/RIPEMD-160
@@ -0,0 +1 @@
+../../Task/RIPEMD-160/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/RSA-code b/Lang/PARI-GP/RSA-code
new file mode 120000
index 0000000000..4daa2fee18
--- /dev/null
+++ b/Lang/PARI-GP/RSA-code
@@ -0,0 +1 @@
+../../Task/RSA-code/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Ranking-methods b/Lang/PARI-GP/Ranking-methods
new file mode 120000
index 0000000000..cdc7441bcc
--- /dev/null
+++ b/Lang/PARI-GP/Ranking-methods
@@ -0,0 +1 @@
+../../Task/Ranking-methods/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Sierpinski-carpet b/Lang/PARI-GP/Sierpinski-carpet
new file mode 120000
index 0000000000..8fa12834e3
--- /dev/null
+++ b/Lang/PARI-GP/Sierpinski-carpet
@@ -0,0 +1 @@
+../../Task/Sierpinski-carpet/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Sierpinski-triangle-Graphical b/Lang/PARI-GP/Sierpinski-triangle-Graphical
new file mode 120000
index 0000000000..940a9a2dac
--- /dev/null
+++ b/Lang/PARI-GP/Sierpinski-triangle-Graphical
@@ -0,0 +1 @@
+../../Task/Sierpinski-triangle-Graphical/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Speech-synthesis b/Lang/PARI-GP/Speech-synthesis
new file mode 120000
index 0000000000..105685c88c
--- /dev/null
+++ b/Lang/PARI-GP/Speech-synthesis
@@ -0,0 +1 @@
+../../Task/Speech-synthesis/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Spiral-matrix b/Lang/PARI-GP/Spiral-matrix
new file mode 120000
index 0000000000..c5400a4767
--- /dev/null
+++ b/Lang/PARI-GP/Spiral-matrix
@@ -0,0 +1 @@
+../../Task/Spiral-matrix/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Stern-Brocot-sequence b/Lang/PARI-GP/Stern-Brocot-sequence
new file mode 120000
index 0000000000..1f15606621
--- /dev/null
+++ b/Lang/PARI-GP/Stern-Brocot-sequence
@@ -0,0 +1 @@
+../../Task/Stern-Brocot-sequence/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Substring b/Lang/PARI-GP/Substring
new file mode 120000
index 0000000000..03e3e7ce94
--- /dev/null
+++ b/Lang/PARI-GP/Substring
@@ -0,0 +1 @@
+../../Task/Substring/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Sudoku b/Lang/PARI-GP/Sudoku
new file mode 120000
index 0000000000..465bb8157f
--- /dev/null
+++ b/Lang/PARI-GP/Sudoku
@@ -0,0 +1 @@
+../../Task/Sudoku/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Terminal-control-Coloured-text b/Lang/PARI-GP/Terminal-control-Coloured-text
new file mode 120000
index 0000000000..fa14da54e1
--- /dev/null
+++ b/Lang/PARI-GP/Terminal-control-Coloured-text
@@ -0,0 +1 @@
+../../Task/Terminal-control-Coloured-text/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Terminal-control-Ringing-the-terminal-bell b/Lang/PARI-GP/Terminal-control-Ringing-the-terminal-bell
new file mode 120000
index 0000000000..356b5cb496
--- /dev/null
+++ b/Lang/PARI-GP/Terminal-control-Ringing-the-terminal-bell
@@ -0,0 +1 @@
+../../Task/Terminal-control-Ringing-the-terminal-bell/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/The-Twelve-Days-of-Christmas b/Lang/PARI-GP/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..d9b72ebdd8
--- /dev/null
+++ b/Lang/PARI-GP/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Tokenize-a-string b/Lang/PARI-GP/Tokenize-a-string
new file mode 120000
index 0000000000..3efa17caa9
--- /dev/null
+++ b/Lang/PARI-GP/Tokenize-a-string
@@ -0,0 +1 @@
+../../Task/Tokenize-a-string/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Topswops b/Lang/PARI-GP/Topswops
new file mode 120000
index 0000000000..748a0625de
--- /dev/null
+++ b/Lang/PARI-GP/Topswops
@@ -0,0 +1 @@
+../../Task/Topswops/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Towers-of-Hanoi b/Lang/PARI-GP/Towers-of-Hanoi
new file mode 120000
index 0000000000..92c00b1aad
--- /dev/null
+++ b/Lang/PARI-GP/Towers-of-Hanoi
@@ -0,0 +1 @@
+../../Task/Towers-of-Hanoi/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Truncate-a-file b/Lang/PARI-GP/Truncate-a-file
new file mode 120000
index 0000000000..337be0f1f6
--- /dev/null
+++ b/Lang/PARI-GP/Truncate-a-file
@@ -0,0 +1 @@
+../../Task/Truncate-a-file/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Ulam-spiral--for-primes- b/Lang/PARI-GP/Ulam-spiral--for-primes-
new file mode 120000
index 0000000000..fe16b5a85c
--- /dev/null
+++ b/Lang/PARI-GP/Ulam-spiral--for-primes-
@@ -0,0 +1 @@
+../../Task/Ulam-spiral--for-primes-/PARI-GP
\ No newline at end of file
diff --git a/Lang/PARI-GP/Use-another-language-to-call-a-function b/Lang/PARI-GP/Use-another-language-to-call-a-function
new file mode 120000
index 0000000000..830e693f48
--- /dev/null
+++ b/Lang/PARI-GP/Use-another-language-to-call-a-function
@@ -0,0 +1 @@
+../../Task/Use-another-language-to-call-a-function/PARI-GP
\ No newline at end of file
diff --git a/Lang/PHP/Averages-Mean-time-of-day b/Lang/PHP/Averages-Mean-time-of-day
new file mode 120000
index 0000000000..da3038b95d
--- /dev/null
+++ b/Lang/PHP/Averages-Mean-time-of-day
@@ -0,0 +1 @@
+../../Task/Averages-Mean-time-of-day/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Averages-Pythagorean-means b/Lang/PHP/Averages-Pythagorean-means
new file mode 120000
index 0000000000..95d023bf9b
--- /dev/null
+++ b/Lang/PHP/Averages-Pythagorean-means
@@ -0,0 +1 @@
+../../Task/Averages-Pythagorean-means/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Averages-Root-mean-square b/Lang/PHP/Averages-Root-mean-square
new file mode 120000
index 0000000000..440ccfb67f
--- /dev/null
+++ b/Lang/PHP/Averages-Root-mean-square
@@ -0,0 +1 @@
+../../Task/Averages-Root-mean-square/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Combinations b/Lang/PHP/Combinations
new file mode 120000
index 0000000000..1670380233
--- /dev/null
+++ b/Lang/PHP/Combinations
@@ -0,0 +1 @@
+../../Task/Combinations/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Find-the-last-Sunday-of-each-month b/Lang/PHP/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..6b918bcc0e
--- /dev/null
+++ b/Lang/PHP/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Generator-Exponential b/Lang/PHP/Generator-Exponential
new file mode 120000
index 0000000000..ab63db8fe0
--- /dev/null
+++ b/Lang/PHP/Generator-Exponential
@@ -0,0 +1 @@
+../../Task/Generator-Exponential/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Inverted-index b/Lang/PHP/Inverted-index
new file mode 120000
index 0000000000..f4508ace96
--- /dev/null
+++ b/Lang/PHP/Inverted-index
@@ -0,0 +1 @@
+../../Task/Inverted-index/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Permutations b/Lang/PHP/Permutations
new file mode 120000
index 0000000000..55fefbf034
--- /dev/null
+++ b/Lang/PHP/Permutations
@@ -0,0 +1 @@
+../../Task/Permutations/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Reverse-words-in-a-string b/Lang/PHP/Reverse-words-in-a-string
new file mode 120000
index 0000000000..f62f66a96f
--- /dev/null
+++ b/Lang/PHP/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Sudoku b/Lang/PHP/Sudoku
new file mode 120000
index 0000000000..e9301c9074
--- /dev/null
+++ b/Lang/PHP/Sudoku
@@ -0,0 +1 @@
+../../Task/Sudoku/PHP
\ No newline at end of file
diff --git a/Lang/PHP/Sutherland-Hodgman-polygon-clipping b/Lang/PHP/Sutherland-Hodgman-polygon-clipping
new file mode 120000
index 0000000000..19f134f03a
--- /dev/null
+++ b/Lang/PHP/Sutherland-Hodgman-polygon-clipping
@@ -0,0 +1 @@
+../../Task/Sutherland-Hodgman-polygon-clipping/PHP
\ No newline at end of file
diff --git a/Lang/PL-I/00DESCRIPTION b/Lang/PL-I/00DESCRIPTION
index 0d97a07077..8a8663f8ca 100644
--- a/Lang/PL-I/00DESCRIPTION
+++ b/Lang/PL-I/00DESCRIPTION
@@ -14,54 +14,69 @@
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),
-* Pointers,
-* Character strings of two kinds:
-# fixed-length, and
-# varying-length.
-* Bit strings of two kinds:
-# fixed-length, and
-# varying length.
+::* Floating-point,
+::* Decimal integer,
+::* Binary integer,
+::* Fixed-point decimal (with a fractional part),
+::* Fixed-point binary (that is, with a fractional part),
+::* Pointers,
+::* 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.
-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.
+::* 8 bits,
+::* 16 bits,
+::* 32 bits, and
+::* 64 bits.
+
Multiple precisions are available for floating point:
-* 32 bits,
-* 64 bits, and
-* 80 bits.
+::* 32 bits,
+::* 64 bits, and
+::* 80 bits.
-The language provides for static and dynamic arrays. Of the latter, there are automatic, controlled, and based.
+
+The language provides for static and dynamic arrays. Of the latter, there are automatic, controlled, and based.
-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.
+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.
+::# 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.
+::* 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.
+When any of those conditions occurs, the user/programmer may trap them and recover from them and continue execution.
-PL/I has a unique and powerful pre-processor which is a subset of the full PL/I language so it can be used to perform source file inclusion, conditional compilation, and macro expansion. The pre-processor keywords are prefixed with %.
\ No newline at end of file
+PL/I has a unique and powerful pre-processor which is a subset of the full PL/I language so it can be used to perform (among other things):
+::* source file inclusion,
+::* conditional compilation, and
+::* macro expansion.
+
+
+The pre-processor keywords are prefixed with a % (percent symbol).
+
\ No newline at end of file
diff --git a/Lang/PL-I/Dragon-curve b/Lang/PL-I/Dragon-curve
new file mode 120000
index 0000000000..94c53ed49d
--- /dev/null
+++ b/Lang/PL-I/Dragon-curve
@@ -0,0 +1 @@
+../../Task/Dragon-curve/PL-I
\ No newline at end of file
diff --git a/Lang/PL-I/N-queens-problem b/Lang/PL-I/N-queens-problem
new file mode 120000
index 0000000000..63a6f65d95
--- /dev/null
+++ b/Lang/PL-I/N-queens-problem
@@ -0,0 +1 @@
+../../Task/N-queens-problem/PL-I
\ No newline at end of file
diff --git a/Lang/PL-I/Pragmatic-directives b/Lang/PL-I/Pragmatic-directives
new file mode 120000
index 0000000000..855db8ea74
--- /dev/null
+++ b/Lang/PL-I/Pragmatic-directives
@@ -0,0 +1 @@
+../../Task/Pragmatic-directives/PL-I
\ No newline at end of file
diff --git a/Lang/Pascal/ABC-Problem b/Lang/Pascal/ABC-Problem
new file mode 120000
index 0000000000..dadba5abb5
--- /dev/null
+++ b/Lang/Pascal/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Benfords-law b/Lang/Pascal/Benfords-law
new file mode 120000
index 0000000000..7b870f77c6
--- /dev/null
+++ b/Lang/Pascal/Benfords-law
@@ -0,0 +1 @@
+../../Task/Benfords-law/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Binary-digits b/Lang/Pascal/Binary-digits
new file mode 120000
index 0000000000..8fd96c36da
--- /dev/null
+++ b/Lang/Pascal/Binary-digits
@@ -0,0 +1 @@
+../../Task/Binary-digits/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Closest-pair-problem b/Lang/Pascal/Closest-pair-problem
new file mode 120000
index 0000000000..b0108fe705
--- /dev/null
+++ b/Lang/Pascal/Closest-pair-problem
@@ -0,0 +1 @@
+../../Task/Closest-pair-problem/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Create-an-object-at-a-given-address b/Lang/Pascal/Create-an-object-at-a-given-address
new file mode 120000
index 0000000000..ce0a3db316
--- /dev/null
+++ b/Lang/Pascal/Create-an-object-at-a-given-address
@@ -0,0 +1 @@
+../../Task/Create-an-object-at-a-given-address/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Greatest-element-of-a-list b/Lang/Pascal/Greatest-element-of-a-list
new file mode 120000
index 0000000000..7038bd59f3
--- /dev/null
+++ b/Lang/Pascal/Greatest-element-of-a-list
@@ -0,0 +1 @@
+../../Task/Greatest-element-of-a-list/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Heronian-triangles b/Lang/Pascal/Heronian-triangles
new file mode 120000
index 0000000000..283dceb1b5
--- /dev/null
+++ b/Lang/Pascal/Heronian-triangles
@@ -0,0 +1 @@
+../../Task/Heronian-triangles/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Increment-a-numerical-string b/Lang/Pascal/Increment-a-numerical-string
new file mode 120000
index 0000000000..c3fcfc6de6
--- /dev/null
+++ b/Lang/Pascal/Increment-a-numerical-string
@@ -0,0 +1 @@
+../../Task/Increment-a-numerical-string/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Jensens-Device b/Lang/Pascal/Jensens-Device
new file mode 120000
index 0000000000..e62fed1676
--- /dev/null
+++ b/Lang/Pascal/Jensens-Device
@@ -0,0 +1 @@
+../../Task/Jensens-Device/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Leap-year b/Lang/Pascal/Leap-year
new file mode 120000
index 0000000000..5eb674ed97
--- /dev/null
+++ b/Lang/Pascal/Leap-year
@@ -0,0 +1 @@
+../../Task/Leap-year/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Literals-Integer b/Lang/Pascal/Literals-Integer
new file mode 120000
index 0000000000..6051260188
--- /dev/null
+++ b/Lang/Pascal/Literals-Integer
@@ -0,0 +1 @@
+../../Task/Literals-Integer/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Ludic-numbers b/Lang/Pascal/Ludic-numbers
new file mode 120000
index 0000000000..183fcd13ba
--- /dev/null
+++ b/Lang/Pascal/Ludic-numbers
@@ -0,0 +1 @@
+../../Task/Ludic-numbers/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Middle-three-digits b/Lang/Pascal/Middle-three-digits
new file mode 120000
index 0000000000..3cee5bf596
--- /dev/null
+++ b/Lang/Pascal/Middle-three-digits
@@ -0,0 +1 @@
+../../Task/Middle-three-digits/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Monty-Hall-problem b/Lang/Pascal/Monty-Hall-problem
new file mode 120000
index 0000000000..1ad5754ce8
--- /dev/null
+++ b/Lang/Pascal/Monty-Hall-problem
@@ -0,0 +1 @@
+../../Task/Monty-Hall-problem/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Nth b/Lang/Pascal/Nth
new file mode 120000
index 0000000000..8850663a3d
--- /dev/null
+++ b/Lang/Pascal/Nth
@@ -0,0 +1 @@
+../../Task/Nth/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Percolation-Mean-run-density b/Lang/Pascal/Percolation-Mean-run-density
new file mode 120000
index 0000000000..95175a5ade
--- /dev/null
+++ b/Lang/Pascal/Percolation-Mean-run-density
@@ -0,0 +1 @@
+../../Task/Percolation-Mean-run-density/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Read-a-file-line-by-line b/Lang/Pascal/Read-a-file-line-by-line
new file mode 120000
index 0000000000..553d8a7d5c
--- /dev/null
+++ b/Lang/Pascal/Read-a-file-line-by-line
@@ -0,0 +1 @@
+../../Task/Read-a-file-line-by-line/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Reverse-words-in-a-string b/Lang/Pascal/Reverse-words-in-a-string
new file mode 120000
index 0000000000..61bcfb59e3
--- /dev/null
+++ b/Lang/Pascal/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Stern-Brocot-sequence b/Lang/Pascal/Stern-Brocot-sequence
new file mode 120000
index 0000000000..74d1cb7be7
--- /dev/null
+++ b/Lang/Pascal/Stern-Brocot-sequence
@@ -0,0 +1 @@
+../../Task/Stern-Brocot-sequence/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/Sudoku b/Lang/Pascal/Sudoku
new file mode 120000
index 0000000000..e04b54cf05
--- /dev/null
+++ b/Lang/Pascal/Sudoku
@@ -0,0 +1 @@
+../../Task/Sudoku/Pascal
\ No newline at end of file
diff --git a/Lang/Pascal/The-Twelve-Days-of-Christmas b/Lang/Pascal/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..5650cbfc5a
--- /dev/null
+++ b/Lang/Pascal/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Pascal
\ No newline at end of file
diff --git a/Lang/Perl-6/00DESCRIPTION b/Lang/Perl-6/00DESCRIPTION
index 16a7c82b3a..aeb9c70e54 100644
--- a/Lang/Perl-6/00DESCRIPTION
+++ b/Lang/Perl-6/00DESCRIPTION
@@ -14,14 +14,15 @@
{{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].
+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. The first official release was at Christmas of 2015.
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.
+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.
-There are several different partial implementations of Perl 6. They vary widely in design goals, degree of completeness, and current development activity. At present, the implementation closest to matching the specification is [[Rakudo]].
+The definition of Perl 6 is specified entirely by a test suite, so we could in theory have multiple implementations.
+The current version of the language is 6.c (short for 6.christmas), as defined by the test suite known as "roast" (Repository Of All Spec Tests). Compiler releases have date-based versions, and these are typically used in Rosetta Code entries for the "works with" fields. The only compiler implementing the full test suite, rakudo, currently runs on either MoarVM or JVM. Subsequent language revisions are planned (with provisional names of "Diwali", "Eid", and other such celebrations), but these will only come out once a year or so. In 2016 we are primarily working on performance and documentation of the stable 6.c version.
\ No newline at end of file
diff --git a/Lang/Perl-6/Atomic-updates b/Lang/Perl-6/Atomic-updates
new file mode 120000
index 0000000000..3900d36c11
--- /dev/null
+++ b/Lang/Perl-6/Atomic-updates
@@ -0,0 +1 @@
+../../Task/Atomic-updates/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Chat-server b/Lang/Perl-6/Chat-server
new file mode 120000
index 0000000000..a08225809d
--- /dev/null
+++ b/Lang/Perl-6/Chat-server
@@ -0,0 +1 @@
+../../Task/Chat-server/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Conjugate-transpose b/Lang/Perl-6/Conjugate-transpose
new file mode 120000
index 0000000000..e6438962c1
--- /dev/null
+++ b/Lang/Perl-6/Conjugate-transpose
@@ -0,0 +1 @@
+../../Task/Conjugate-transpose/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Deepcopy b/Lang/Perl-6/Deepcopy
new file mode 120000
index 0000000000..279cdf6639
--- /dev/null
+++ b/Lang/Perl-6/Deepcopy
@@ -0,0 +1 @@
+../../Task/Deepcopy/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Jump-anywhere b/Lang/Perl-6/Jump-anywhere
new file mode 120000
index 0000000000..6e4ff86258
--- /dev/null
+++ b/Lang/Perl-6/Jump-anywhere
@@ -0,0 +1 @@
+../../Task/Jump-anywhere/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/LU-decomposition b/Lang/Perl-6/LU-decomposition
new file mode 120000
index 0000000000..c8061ebb51
--- /dev/null
+++ b/Lang/Perl-6/LU-decomposition
@@ -0,0 +1 @@
+../../Task/LU-decomposition/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Multiple-regression b/Lang/Perl-6/Multiple-regression
new file mode 120000
index 0000000000..3eb6bee1fa
--- /dev/null
+++ b/Lang/Perl-6/Multiple-regression
@@ -0,0 +1 @@
+../../Task/Multiple-regression/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Permutations-Rank-of-a-permutation b/Lang/Perl-6/Permutations-Rank-of-a-permutation
new file mode 120000
index 0000000000..3a8f399f8d
--- /dev/null
+++ b/Lang/Perl-6/Permutations-Rank-of-a-permutation
@@ -0,0 +1 @@
+../../Task/Permutations-Rank-of-a-permutation/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Polynomial-regression b/Lang/Perl-6/Polynomial-regression
new file mode 120000
index 0000000000..5cc44ee11b
--- /dev/null
+++ b/Lang/Perl-6/Polynomial-regression
@@ -0,0 +1 @@
+../../Task/Polynomial-regression/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl-6/Rendezvous b/Lang/Perl-6/Rendezvous
new file mode 120000
index 0000000000..dd89db83c8
--- /dev/null
+++ b/Lang/Perl-6/Rendezvous
@@ -0,0 +1 @@
+../../Task/Rendezvous/Perl-6
\ No newline at end of file
diff --git a/Lang/Perl/Chat-server b/Lang/Perl/Chat-server
new file mode 120000
index 0000000000..b6bab0a684
--- /dev/null
+++ b/Lang/Perl/Chat-server
@@ -0,0 +1 @@
+../../Task/Chat-server/Perl
\ No newline at end of file
diff --git a/Lang/Perl/Conjugate-transpose b/Lang/Perl/Conjugate-transpose
new file mode 120000
index 0000000000..5135637356
--- /dev/null
+++ b/Lang/Perl/Conjugate-transpose
@@ -0,0 +1 @@
+../../Task/Conjugate-transpose/Perl
\ No newline at end of file
diff --git a/Lang/Perl/Function-frequency b/Lang/Perl/Function-frequency
new file mode 120000
index 0000000000..0a5ec10ae3
--- /dev/null
+++ b/Lang/Perl/Function-frequency
@@ -0,0 +1 @@
+../../Task/Function-frequency/Perl
\ No newline at end of file
diff --git a/Lang/Perl/MD5-Implementation b/Lang/Perl/MD5-Implementation
new file mode 120000
index 0000000000..9cd034d5e4
--- /dev/null
+++ b/Lang/Perl/MD5-Implementation
@@ -0,0 +1 @@
+../../Task/MD5-Implementation/Perl
\ No newline at end of file
diff --git a/Lang/Perl/Set-consolidation b/Lang/Perl/Set-consolidation
new file mode 120000
index 0000000000..c4b4b08f62
--- /dev/null
+++ b/Lang/Perl/Set-consolidation
@@ -0,0 +1 @@
+../../Task/Set-consolidation/Perl
\ No newline at end of file
diff --git a/Lang/Perl/Singly-linked-list-Traversal b/Lang/Perl/Singly-linked-list-Traversal
new file mode 120000
index 0000000000..c6b0dfe2fe
--- /dev/null
+++ b/Lang/Perl/Singly-linked-list-Traversal
@@ -0,0 +1 @@
+../../Task/Singly-linked-list-Traversal/Perl
\ No newline at end of file
diff --git a/Lang/Perl/Solve-a-Holy-Knights-tour b/Lang/Perl/Solve-a-Holy-Knights-tour
new file mode 120000
index 0000000000..8e6f567491
--- /dev/null
+++ b/Lang/Perl/Solve-a-Holy-Knights-tour
@@ -0,0 +1 @@
+../../Task/Solve-a-Holy-Knights-tour/Perl
\ No newline at end of file
diff --git a/Lang/Perl/Unix-ls b/Lang/Perl/Unix-ls
new file mode 120000
index 0000000000..aa93a3c4e4
--- /dev/null
+++ b/Lang/Perl/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/Perl
\ No newline at end of file
diff --git a/Lang/PicoLisp/Hash-join b/Lang/PicoLisp/Hash-join
new file mode 120000
index 0000000000..a156f8e318
--- /dev/null
+++ b/Lang/PicoLisp/Hash-join
@@ -0,0 +1 @@
+../../Task/Hash-join/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/I-before-E-except-after-C b/Lang/PicoLisp/I-before-E-except-after-C
new file mode 120000
index 0000000000..c99e0b9c3d
--- /dev/null
+++ b/Lang/PicoLisp/I-before-E-except-after-C
@@ -0,0 +1 @@
+../../Task/I-before-E-except-after-C/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Iterated-digits-squaring b/Lang/PicoLisp/Iterated-digits-squaring
new file mode 120000
index 0000000000..fe8daa36c8
--- /dev/null
+++ b/Lang/PicoLisp/Iterated-digits-squaring
@@ -0,0 +1 @@
+../../Task/Iterated-digits-squaring/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Machine-code b/Lang/PicoLisp/Machine-code
new file mode 120000
index 0000000000..ea28130eb2
--- /dev/null
+++ b/Lang/PicoLisp/Machine-code
@@ -0,0 +1 @@
+../../Task/Machine-code/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Make-directory-path b/Lang/PicoLisp/Make-directory-path
new file mode 120000
index 0000000000..3b94fb9e4f
--- /dev/null
+++ b/Lang/PicoLisp/Make-directory-path
@@ -0,0 +1 @@
+../../Task/Make-directory-path/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Move-to-front-algorithm b/Lang/PicoLisp/Move-to-front-algorithm
new file mode 120000
index 0000000000..1755e5c181
--- /dev/null
+++ b/Lang/PicoLisp/Move-to-front-algorithm
@@ -0,0 +1 @@
+../../Task/Move-to-front-algorithm/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Multifactorial b/Lang/PicoLisp/Multifactorial
new file mode 120000
index 0000000000..8dabbdd2ec
--- /dev/null
+++ b/Lang/PicoLisp/Multifactorial
@@ -0,0 +1 @@
+../../Task/Multifactorial/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Order-disjoint-list-items b/Lang/PicoLisp/Order-disjoint-list-items
new file mode 120000
index 0000000000..aa8535d337
--- /dev/null
+++ b/Lang/PicoLisp/Order-disjoint-list-items
@@ -0,0 +1 @@
+../../Task/Order-disjoint-list-items/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Pernicious-numbers b/Lang/PicoLisp/Pernicious-numbers
new file mode 120000
index 0000000000..d588a862b8
--- /dev/null
+++ b/Lang/PicoLisp/Pernicious-numbers
@@ -0,0 +1 @@
+../../Task/Pernicious-numbers/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Phrase-reversals b/Lang/PicoLisp/Phrase-reversals
new file mode 120000
index 0000000000..21340ddec6
--- /dev/null
+++ b/Lang/PicoLisp/Phrase-reversals
@@ -0,0 +1 @@
+../../Task/Phrase-reversals/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Rep-string b/Lang/PicoLisp/Rep-string
new file mode 120000
index 0000000000..e6fefc38cd
--- /dev/null
+++ b/Lang/PicoLisp/Rep-string
@@ -0,0 +1 @@
+../../Task/Rep-string/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Sparkline-in-unicode b/Lang/PicoLisp/Sparkline-in-unicode
new file mode 120000
index 0000000000..1cc6b503ab
--- /dev/null
+++ b/Lang/PicoLisp/Sparkline-in-unicode
@@ -0,0 +1 @@
+../../Task/Sparkline-in-unicode/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Topswops b/Lang/PicoLisp/Topswops
new file mode 120000
index 0000000000..b2c597983a
--- /dev/null
+++ b/Lang/PicoLisp/Topswops
@@ -0,0 +1 @@
+../../Task/Topswops/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Ulam-spiral--for-primes- b/Lang/PicoLisp/Ulam-spiral--for-primes-
new file mode 120000
index 0000000000..457a84d81b
--- /dev/null
+++ b/Lang/PicoLisp/Ulam-spiral--for-primes-
@@ -0,0 +1 @@
+../../Task/Ulam-spiral--for-primes-/PicoLisp
\ No newline at end of file
diff --git a/Lang/PicoLisp/Unix-ls b/Lang/PicoLisp/Unix-ls
new file mode 120000
index 0000000000..d89a2428e7
--- /dev/null
+++ b/Lang/PicoLisp/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/PicoLisp
\ No newline at end of file
diff --git a/Lang/PlainTeX/Guess-the-number b/Lang/PlainTeX/Guess-the-number
new file mode 120000
index 0000000000..23f10162b5
--- /dev/null
+++ b/Lang/PlainTeX/Guess-the-number
@@ -0,0 +1 @@
+../../Task/Guess-the-number/PlainTeX
\ No newline at end of file
diff --git a/Lang/PlainTeX/String-prepend b/Lang/PlainTeX/String-prepend
new file mode 120000
index 0000000000..f93b9f52f8
--- /dev/null
+++ b/Lang/PlainTeX/String-prepend
@@ -0,0 +1 @@
+../../Task/String-prepend/PlainTeX
\ No newline at end of file
diff --git a/Lang/PlainTeX/Zig-zag-matrix b/Lang/PlainTeX/Zig-zag-matrix
new file mode 120000
index 0000000000..1ce60c0b76
--- /dev/null
+++ b/Lang/PlainTeX/Zig-zag-matrix
@@ -0,0 +1 @@
+../../Task/Zig-zag-matrix/PlainTeX
\ No newline at end of file
diff --git a/Lang/PowerShell/Abstract-type b/Lang/PowerShell/Abstract-type
new file mode 120000
index 0000000000..9390180c20
--- /dev/null
+++ b/Lang/PowerShell/Abstract-type
@@ -0,0 +1 @@
+../../Task/Abstract-type/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Accumulator-factory b/Lang/PowerShell/Accumulator-factory
new file mode 120000
index 0000000000..16ca6ab4fd
--- /dev/null
+++ b/Lang/PowerShell/Accumulator-factory
@@ -0,0 +1 @@
+../../Task/Accumulator-factory/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Align-columns b/Lang/PowerShell/Align-columns
new file mode 120000
index 0000000000..214a3531e2
--- /dev/null
+++ b/Lang/PowerShell/Align-columns
@@ -0,0 +1 @@
+../../Task/Align-columns/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Aliquot-sequence-classifications b/Lang/PowerShell/Aliquot-sequence-classifications
new file mode 120000
index 0000000000..13795d384b
--- /dev/null
+++ b/Lang/PowerShell/Aliquot-sequence-classifications
@@ -0,0 +1 @@
+../../Task/Aliquot-sequence-classifications/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Amicable-pairs b/Lang/PowerShell/Amicable-pairs
new file mode 120000
index 0000000000..6b3302d451
--- /dev/null
+++ b/Lang/PowerShell/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Append-a-record-to-the-end-of-a-text-file b/Lang/PowerShell/Append-a-record-to-the-end-of-a-text-file
new file mode 120000
index 0000000000..63953d0624
--- /dev/null
+++ b/Lang/PowerShell/Append-a-record-to-the-end-of-a-text-file
@@ -0,0 +1 @@
+../../Task/Append-a-record-to-the-end-of-a-text-file/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Arbitrary-precision-integers--included- b/Lang/PowerShell/Arbitrary-precision-integers--included-
new file mode 120000
index 0000000000..2230a9c96f
--- /dev/null
+++ b/Lang/PowerShell/Arbitrary-precision-integers--included-
@@ -0,0 +1 @@
+../../Task/Arbitrary-precision-integers--included-/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Arithmetic-Complex b/Lang/PowerShell/Arithmetic-Complex
new file mode 120000
index 0000000000..af92b2c782
--- /dev/null
+++ b/Lang/PowerShell/Arithmetic-Complex
@@ -0,0 +1 @@
+../../Task/Arithmetic-Complex/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Average-loop-length b/Lang/PowerShell/Average-loop-length
new file mode 120000
index 0000000000..3a792e9d99
--- /dev/null
+++ b/Lang/PowerShell/Average-loop-length
@@ -0,0 +1 @@
+../../Task/Average-loop-length/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Averages-Mean-time-of-day b/Lang/PowerShell/Averages-Mean-time-of-day
new file mode 120000
index 0000000000..598448f51e
--- /dev/null
+++ b/Lang/PowerShell/Averages-Mean-time-of-day
@@ -0,0 +1 @@
+../../Task/Averages-Mean-time-of-day/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Averages-Median b/Lang/PowerShell/Averages-Median
new file mode 120000
index 0000000000..110aae1065
--- /dev/null
+++ b/Lang/PowerShell/Averages-Median
@@ -0,0 +1 @@
+../../Task/Averages-Median/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Balanced-brackets b/Lang/PowerShell/Balanced-brackets
new file mode 120000
index 0000000000..2dc56da900
--- /dev/null
+++ b/Lang/PowerShell/Balanced-brackets
@@ -0,0 +1 @@
+../../Task/Balanced-brackets/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Benfords-law b/Lang/PowerShell/Benfords-law
new file mode 120000
index 0000000000..d9a20cfabb
--- /dev/null
+++ b/Lang/PowerShell/Benfords-law
@@ -0,0 +1 @@
+../../Task/Benfords-law/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Binary-strings b/Lang/PowerShell/Binary-strings
new file mode 120000
index 0000000000..6957299e86
--- /dev/null
+++ b/Lang/PowerShell/Binary-strings
@@ -0,0 +1 @@
+../../Task/Binary-strings/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Box-the-compass b/Lang/PowerShell/Box-the-compass
new file mode 120000
index 0000000000..decc96b1e7
--- /dev/null
+++ b/Lang/PowerShell/Box-the-compass
@@ -0,0 +1 @@
+../../Task/Box-the-compass/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Bulls-and-cows b/Lang/PowerShell/Bulls-and-cows
new file mode 120000
index 0000000000..11c1c4463c
--- /dev/null
+++ b/Lang/PowerShell/Bulls-and-cows
@@ -0,0 +1 @@
+../../Task/Bulls-and-cows/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/CSV-data-manipulation b/Lang/PowerShell/CSV-data-manipulation
new file mode 120000
index 0000000000..d035edb53b
--- /dev/null
+++ b/Lang/PowerShell/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Case-sensitivity-of-identifiers b/Lang/PowerShell/Case-sensitivity-of-identifiers
new file mode 120000
index 0000000000..0ea2c18e20
--- /dev/null
+++ b/Lang/PowerShell/Case-sensitivity-of-identifiers
@@ -0,0 +1 @@
+../../Task/Case-sensitivity-of-identifiers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Catalan-numbers b/Lang/PowerShell/Catalan-numbers
new file mode 120000
index 0000000000..20d69768f2
--- /dev/null
+++ b/Lang/PowerShell/Catalan-numbers
@@ -0,0 +1 @@
+../../Task/Catalan-numbers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Catamorphism b/Lang/PowerShell/Catamorphism
new file mode 120000
index 0000000000..b4f41ddba2
--- /dev/null
+++ b/Lang/PowerShell/Catamorphism
@@ -0,0 +1 @@
+../../Task/Catamorphism/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Cholesky-decomposition b/Lang/PowerShell/Cholesky-decomposition
new file mode 120000
index 0000000000..e432621b0f
--- /dev/null
+++ b/Lang/PowerShell/Cholesky-decomposition
@@ -0,0 +1 @@
+../../Task/Cholesky-decomposition/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Classes b/Lang/PowerShell/Classes
new file mode 120000
index 0000000000..31a6108e2b
--- /dev/null
+++ b/Lang/PowerShell/Classes
@@ -0,0 +1 @@
+../../Task/Classes/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Closures-Value-capture b/Lang/PowerShell/Closures-Value-capture
new file mode 120000
index 0000000000..5575c21e33
--- /dev/null
+++ b/Lang/PowerShell/Closures-Value-capture
@@ -0,0 +1 @@
+../../Task/Closures-Value-capture/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Colour-bars-Display b/Lang/PowerShell/Colour-bars-Display
new file mode 120000
index 0000000000..b17e41c8d8
--- /dev/null
+++ b/Lang/PowerShell/Colour-bars-Display
@@ -0,0 +1 @@
+../../Task/Colour-bars-Display/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Combinations b/Lang/PowerShell/Combinations
new file mode 120000
index 0000000000..98208e6735
--- /dev/null
+++ b/Lang/PowerShell/Combinations
@@ -0,0 +1 @@
+../../Task/Combinations/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Comma-quibbling b/Lang/PowerShell/Comma-quibbling
new file mode 120000
index 0000000000..bd478096b4
--- /dev/null
+++ b/Lang/PowerShell/Comma-quibbling
@@ -0,0 +1 @@
+../../Task/Comma-quibbling/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Compound-data-type b/Lang/PowerShell/Compound-data-type
new file mode 120000
index 0000000000..142de44ca6
--- /dev/null
+++ b/Lang/PowerShell/Compound-data-type
@@ -0,0 +1 @@
+../../Task/Compound-data-type/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Conjugate-transpose b/Lang/PowerShell/Conjugate-transpose
new file mode 120000
index 0000000000..29713ae272
--- /dev/null
+++ b/Lang/PowerShell/Conjugate-transpose
@@ -0,0 +1 @@
+../../Task/Conjugate-transpose/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Constrained-random-points-on-a-circle b/Lang/PowerShell/Constrained-random-points-on-a-circle
new file mode 120000
index 0000000000..6fa1faf1c2
--- /dev/null
+++ b/Lang/PowerShell/Constrained-random-points-on-a-circle
@@ -0,0 +1 @@
+../../Task/Constrained-random-points-on-a-circle/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Create-a-two-dimensional-array-at-runtime b/Lang/PowerShell/Create-a-two-dimensional-array-at-runtime
new file mode 120000
index 0000000000..bc58938c1d
--- /dev/null
+++ b/Lang/PowerShell/Create-a-two-dimensional-array-at-runtime
@@ -0,0 +1 @@
+../../Task/Create-a-two-dimensional-array-at-runtime/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Currying b/Lang/PowerShell/Currying
new file mode 120000
index 0000000000..7c5e1e239a
--- /dev/null
+++ b/Lang/PowerShell/Currying
@@ -0,0 +1 @@
+../../Task/Currying/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Define-a-primitive-data-type b/Lang/PowerShell/Define-a-primitive-data-type
new file mode 120000
index 0000000000..3cbbbe06ed
--- /dev/null
+++ b/Lang/PowerShell/Define-a-primitive-data-type
@@ -0,0 +1 @@
+../../Task/Define-a-primitive-data-type/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Determine-if-only-one-instance-is-running b/Lang/PowerShell/Determine-if-only-one-instance-is-running
new file mode 120000
index 0000000000..d3ad088603
--- /dev/null
+++ b/Lang/PowerShell/Determine-if-only-one-instance-is-running
@@ -0,0 +1 @@
+../../Task/Determine-if-only-one-instance-is-running/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Dinesmans-multiple-dwelling-problem b/Lang/PowerShell/Dinesmans-multiple-dwelling-problem
new file mode 120000
index 0000000000..b9f491a0d3
--- /dev/null
+++ b/Lang/PowerShell/Dinesmans-multiple-dwelling-problem
@@ -0,0 +1 @@
+../../Task/Dinesmans-multiple-dwelling-problem/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Discordian-date b/Lang/PowerShell/Discordian-date
new file mode 120000
index 0000000000..92212230c2
--- /dev/null
+++ b/Lang/PowerShell/Discordian-date
@@ -0,0 +1 @@
+../../Task/Discordian-date/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Documentation b/Lang/PowerShell/Documentation
new file mode 120000
index 0000000000..d3ea2cc3ec
--- /dev/null
+++ b/Lang/PowerShell/Documentation
@@ -0,0 +1 @@
+../../Task/Documentation/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Doubly-linked-list-Definition b/Lang/PowerShell/Doubly-linked-list-Definition
new file mode 120000
index 0000000000..619c280a03
--- /dev/null
+++ b/Lang/PowerShell/Doubly-linked-list-Definition
@@ -0,0 +1 @@
+../../Task/Doubly-linked-list-Definition/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Dutch-national-flag-problem b/Lang/PowerShell/Dutch-national-flag-problem
new file mode 120000
index 0000000000..a1f36fe2ed
--- /dev/null
+++ b/Lang/PowerShell/Dutch-national-flag-problem
@@ -0,0 +1 @@
+../../Task/Dutch-national-flag-problem/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Empty-program b/Lang/PowerShell/Empty-program
new file mode 120000
index 0000000000..e44b1ed6ac
--- /dev/null
+++ b/Lang/PowerShell/Empty-program
@@ -0,0 +1 @@
+../../Task/Empty-program/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Enumerations b/Lang/PowerShell/Enumerations
new file mode 120000
index 0000000000..05343e5109
--- /dev/null
+++ b/Lang/PowerShell/Enumerations
@@ -0,0 +1 @@
+../../Task/Enumerations/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Execute-HQ9+ b/Lang/PowerShell/Execute-HQ9+
new file mode 120000
index 0000000000..f0e0dc0c29
--- /dev/null
+++ b/Lang/PowerShell/Execute-HQ9+
@@ -0,0 +1 @@
+../../Task/Execute-HQ9+/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Extend-your-language b/Lang/PowerShell/Extend-your-language
new file mode 120000
index 0000000000..a83e6d8416
--- /dev/null
+++ b/Lang/PowerShell/Extend-your-language
@@ -0,0 +1 @@
+../../Task/Extend-your-language/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Find-the-last-Sunday-of-each-month b/Lang/PowerShell/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..e887d9e2d1
--- /dev/null
+++ b/Lang/PowerShell/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Gamma-function b/Lang/PowerShell/Gamma-function
new file mode 120000
index 0000000000..418db7ae34
--- /dev/null
+++ b/Lang/PowerShell/Gamma-function
@@ -0,0 +1 @@
+../../Task/Gamma-function/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Gaussian-elimination b/Lang/PowerShell/Gaussian-elimination
new file mode 120000
index 0000000000..e62c4692b2
--- /dev/null
+++ b/Lang/PowerShell/Gaussian-elimination
@@ -0,0 +1 @@
+../../Task/Gaussian-elimination/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Generate-Chess960-starting-position b/Lang/PowerShell/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..0b262e0751
--- /dev/null
+++ b/Lang/PowerShell/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Generate-lower-case-ASCII-alphabet b/Lang/PowerShell/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..cca76be154
--- /dev/null
+++ b/Lang/PowerShell/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Globally-replace-text-in-several-files b/Lang/PowerShell/Globally-replace-text-in-several-files
new file mode 120000
index 0000000000..0829e73416
--- /dev/null
+++ b/Lang/PowerShell/Globally-replace-text-in-several-files
@@ -0,0 +1 @@
+../../Task/Globally-replace-text-in-several-files/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Guess-the-number-With-feedback b/Lang/PowerShell/Guess-the-number-With-feedback
new file mode 120000
index 0000000000..78f3a518d7
--- /dev/null
+++ b/Lang/PowerShell/Guess-the-number-With-feedback
@@ -0,0 +1 @@
+../../Task/Guess-the-number-With-feedback/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Harshad-or-Niven-series b/Lang/PowerShell/Harshad-or-Niven-series
new file mode 120000
index 0000000000..ec20e925d8
--- /dev/null
+++ b/Lang/PowerShell/Harshad-or-Niven-series
@@ -0,0 +1 @@
+../../Task/Harshad-or-Niven-series/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Haversine-formula b/Lang/PowerShell/Haversine-formula
new file mode 120000
index 0000000000..ac1a9fb048
--- /dev/null
+++ b/Lang/PowerShell/Haversine-formula
@@ -0,0 +1 @@
+../../Task/Haversine-formula/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Holidays-related-to-Easter b/Lang/PowerShell/Holidays-related-to-Easter
new file mode 120000
index 0000000000..7a02b060d6
--- /dev/null
+++ b/Lang/PowerShell/Holidays-related-to-Easter
@@ -0,0 +1 @@
+../../Task/Holidays-related-to-Easter/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Horizontal-sundial-calculations b/Lang/PowerShell/Horizontal-sundial-calculations
new file mode 120000
index 0000000000..1892485510
--- /dev/null
+++ b/Lang/PowerShell/Horizontal-sundial-calculations
@@ -0,0 +1 @@
+../../Task/Horizontal-sundial-calculations/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Huffman-coding b/Lang/PowerShell/Huffman-coding
new file mode 120000
index 0000000000..39f84fd1b4
--- /dev/null
+++ b/Lang/PowerShell/Huffman-coding
@@ -0,0 +1 @@
+../../Task/Huffman-coding/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/IBAN b/Lang/PowerShell/IBAN
new file mode 120000
index 0000000000..0ef23dc960
--- /dev/null
+++ b/Lang/PowerShell/IBAN
@@ -0,0 +1 @@
+../../Task/IBAN/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Include-a-file b/Lang/PowerShell/Include-a-file
new file mode 120000
index 0000000000..4d04b0dd10
--- /dev/null
+++ b/Lang/PowerShell/Include-a-file
@@ -0,0 +1 @@
+../../Task/Include-a-file/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Inheritance-Multiple b/Lang/PowerShell/Inheritance-Multiple
new file mode 120000
index 0000000000..fd403f990e
--- /dev/null
+++ b/Lang/PowerShell/Inheritance-Multiple
@@ -0,0 +1 @@
+../../Task/Inheritance-Multiple/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Inheritance-Single b/Lang/PowerShell/Inheritance-Single
new file mode 120000
index 0000000000..d50efbcfb6
--- /dev/null
+++ b/Lang/PowerShell/Inheritance-Single
@@ -0,0 +1 @@
+../../Task/Inheritance-Single/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Inverted-index b/Lang/PowerShell/Inverted-index
new file mode 120000
index 0000000000..a225bc9ed2
--- /dev/null
+++ b/Lang/PowerShell/Inverted-index
@@ -0,0 +1 @@
+../../Task/Inverted-index/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Inverted-syntax b/Lang/PowerShell/Inverted-syntax
new file mode 120000
index 0000000000..913fe03e6d
--- /dev/null
+++ b/Lang/PowerShell/Inverted-syntax
@@ -0,0 +1 @@
+../../Task/Inverted-syntax/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Jump-anywhere b/Lang/PowerShell/Jump-anywhere
new file mode 120000
index 0000000000..3c37b17af1
--- /dev/null
+++ b/Lang/PowerShell/Jump-anywhere
@@ -0,0 +1 @@
+../../Task/Jump-anywhere/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Kaprekar-numbers b/Lang/PowerShell/Kaprekar-numbers
new file mode 120000
index 0000000000..ca229b62e7
--- /dev/null
+++ b/Lang/PowerShell/Kaprekar-numbers
@@ -0,0 +1 @@
+../../Task/Kaprekar-numbers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/PowerShell/Keyboard-input-Obtain-a-Y-or-N-response
new file mode 120000
index 0000000000..fd954a5239
--- /dev/null
+++ b/Lang/PowerShell/Keyboard-input-Obtain-a-Y-or-N-response
@@ -0,0 +1 @@
+../../Task/Keyboard-input-Obtain-a-Y-or-N-response/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Knapsack-problem-Unbounded b/Lang/PowerShell/Knapsack-problem-Unbounded
new file mode 120000
index 0000000000..3a67464ab4
--- /dev/null
+++ b/Lang/PowerShell/Knapsack-problem-Unbounded
@@ -0,0 +1 @@
+../../Task/Knapsack-problem-Unbounded/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Langtons-ant b/Lang/PowerShell/Langtons-ant
new file mode 120000
index 0000000000..259493ac90
--- /dev/null
+++ b/Lang/PowerShell/Langtons-ant
@@ -0,0 +1 @@
+../../Task/Langtons-ant/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Largest-int-from-concatenated-ints b/Lang/PowerShell/Largest-int-from-concatenated-ints
new file mode 120000
index 0000000000..43c8a6e659
--- /dev/null
+++ b/Lang/PowerShell/Largest-int-from-concatenated-ints
@@ -0,0 +1 @@
+../../Task/Largest-int-from-concatenated-ints/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Last-Friday-of-each-month b/Lang/PowerShell/Last-Friday-of-each-month
new file mode 120000
index 0000000000..cf4b6977e1
--- /dev/null
+++ b/Lang/PowerShell/Last-Friday-of-each-month
@@ -0,0 +1 @@
+../../Task/Last-Friday-of-each-month/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Letter-frequency b/Lang/PowerShell/Letter-frequency
new file mode 120000
index 0000000000..6355b045ce
--- /dev/null
+++ b/Lang/PowerShell/Letter-frequency
@@ -0,0 +1 @@
+../../Task/Letter-frequency/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Levenshtein-distance b/Lang/PowerShell/Levenshtein-distance
new file mode 120000
index 0000000000..acf77dc4c6
--- /dev/null
+++ b/Lang/PowerShell/Levenshtein-distance
@@ -0,0 +1 @@
+../../Task/Levenshtein-distance/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Longest-common-subsequence b/Lang/PowerShell/Longest-common-subsequence
new file mode 120000
index 0000000000..f8aa05ff85
--- /dev/null
+++ b/Lang/PowerShell/Longest-common-subsequence
@@ -0,0 +1 @@
+../../Task/Longest-common-subsequence/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Longest-increasing-subsequence b/Lang/PowerShell/Longest-increasing-subsequence
new file mode 120000
index 0000000000..e50cee75d6
--- /dev/null
+++ b/Lang/PowerShell/Longest-increasing-subsequence
@@ -0,0 +1 @@
+../../Task/Longest-increasing-subsequence/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Longest-string-challenge b/Lang/PowerShell/Longest-string-challenge
new file mode 120000
index 0000000000..e9334d892c
--- /dev/null
+++ b/Lang/PowerShell/Longest-string-challenge
@@ -0,0 +1 @@
+../../Task/Longest-string-challenge/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Loop-over-multiple-arrays-simultaneously b/Lang/PowerShell/Loop-over-multiple-arrays-simultaneously
new file mode 120000
index 0000000000..25c3943bba
--- /dev/null
+++ b/Lang/PowerShell/Loop-over-multiple-arrays-simultaneously
@@ -0,0 +1 @@
+../../Task/Loop-over-multiple-arrays-simultaneously/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Lucas-Lehmer-test b/Lang/PowerShell/Lucas-Lehmer-test
new file mode 120000
index 0000000000..600811b04c
--- /dev/null
+++ b/Lang/PowerShell/Lucas-Lehmer-test
@@ -0,0 +1 @@
+../../Task/Lucas-Lehmer-test/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Ludic-numbers b/Lang/PowerShell/Ludic-numbers
new file mode 120000
index 0000000000..c494f840e8
--- /dev/null
+++ b/Lang/PowerShell/Ludic-numbers
@@ -0,0 +1 @@
+../../Task/Ludic-numbers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Luhn-test-of-credit-card-numbers b/Lang/PowerShell/Luhn-test-of-credit-card-numbers
new file mode 120000
index 0000000000..b52ff27355
--- /dev/null
+++ b/Lang/PowerShell/Luhn-test-of-credit-card-numbers
@@ -0,0 +1 @@
+../../Task/Luhn-test-of-credit-card-numbers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Mad-Libs b/Lang/PowerShell/Mad-Libs
new file mode 120000
index 0000000000..ed2f6585b6
--- /dev/null
+++ b/Lang/PowerShell/Mad-Libs
@@ -0,0 +1 @@
+../../Task/Mad-Libs/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Make-directory-path b/Lang/PowerShell/Make-directory-path
new file mode 120000
index 0000000000..685667ee19
--- /dev/null
+++ b/Lang/PowerShell/Make-directory-path
@@ -0,0 +1 @@
+../../Task/Make-directory-path/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Mandelbrot-set b/Lang/PowerShell/Mandelbrot-set
new file mode 120000
index 0000000000..5c63e6e1f4
--- /dev/null
+++ b/Lang/PowerShell/Mandelbrot-set
@@ -0,0 +1 @@
+../../Task/Mandelbrot-set/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Morse-code b/Lang/PowerShell/Morse-code
new file mode 120000
index 0000000000..480555d31a
--- /dev/null
+++ b/Lang/PowerShell/Morse-code
@@ -0,0 +1 @@
+../../Task/Morse-code/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Multiple-distinct-objects b/Lang/PowerShell/Multiple-distinct-objects
new file mode 120000
index 0000000000..494d62206f
--- /dev/null
+++ b/Lang/PowerShell/Multiple-distinct-objects
@@ -0,0 +1 @@
+../../Task/Multiple-distinct-objects/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Multiplication-tables b/Lang/PowerShell/Multiplication-tables
new file mode 120000
index 0000000000..e30bfe9fae
--- /dev/null
+++ b/Lang/PowerShell/Multiplication-tables
@@ -0,0 +1 @@
+../../Task/Multiplication-tables/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Multisplit b/Lang/PowerShell/Multisplit
new file mode 120000
index 0000000000..ddf736d2ca
--- /dev/null
+++ b/Lang/PowerShell/Multisplit
@@ -0,0 +1 @@
+../../Task/Multisplit/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/N-queens-problem b/Lang/PowerShell/N-queens-problem
new file mode 120000
index 0000000000..91858a372d
--- /dev/null
+++ b/Lang/PowerShell/N-queens-problem
@@ -0,0 +1 @@
+../../Task/N-queens-problem/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Narcissist b/Lang/PowerShell/Narcissist
new file mode 120000
index 0000000000..e28688f02a
--- /dev/null
+++ b/Lang/PowerShell/Narcissist
@@ -0,0 +1 @@
+../../Task/Narcissist/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Narcissistic-decimal-number b/Lang/PowerShell/Narcissistic-decimal-number
new file mode 120000
index 0000000000..4af37b2663
--- /dev/null
+++ b/Lang/PowerShell/Narcissistic-decimal-number
@@ -0,0 +1 @@
+../../Task/Narcissistic-decimal-number/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Nautical-bell b/Lang/PowerShell/Nautical-bell
new file mode 120000
index 0000000000..6172aa2fa0
--- /dev/null
+++ b/Lang/PowerShell/Nautical-bell
@@ -0,0 +1 @@
+../../Task/Nautical-bell/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Number-names b/Lang/PowerShell/Number-names
new file mode 120000
index 0000000000..514a36ec6e
--- /dev/null
+++ b/Lang/PowerShell/Number-names
@@ -0,0 +1 @@
+../../Task/Number-names/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/One-of-n-lines-in-a-file b/Lang/PowerShell/One-of-n-lines-in-a-file
new file mode 120000
index 0000000000..85c22748d4
--- /dev/null
+++ b/Lang/PowerShell/One-of-n-lines-in-a-file
@@ -0,0 +1 @@
+../../Task/One-of-n-lines-in-a-file/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Order-two-numerical-lists b/Lang/PowerShell/Order-two-numerical-lists
new file mode 120000
index 0000000000..b2d2cc6a69
--- /dev/null
+++ b/Lang/PowerShell/Order-two-numerical-lists
@@ -0,0 +1 @@
+../../Task/Order-two-numerical-lists/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Ordered-words b/Lang/PowerShell/Ordered-words
new file mode 120000
index 0000000000..1c6dc34e94
--- /dev/null
+++ b/Lang/PowerShell/Ordered-words
@@ -0,0 +1 @@
+../../Task/Ordered-words/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Pangram-checker b/Lang/PowerShell/Pangram-checker
new file mode 120000
index 0000000000..4fe04d5081
--- /dev/null
+++ b/Lang/PowerShell/Pangram-checker
@@ -0,0 +1 @@
+../../Task/Pangram-checker/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Parse-an-IP-Address b/Lang/PowerShell/Parse-an-IP-Address
new file mode 120000
index 0000000000..7066102c2c
--- /dev/null
+++ b/Lang/PowerShell/Parse-an-IP-Address
@@ -0,0 +1 @@
+../../Task/Parse-an-IP-Address/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Parsing-RPN-calculator-algorithm b/Lang/PowerShell/Parsing-RPN-calculator-algorithm
new file mode 120000
index 0000000000..8fd31f05e7
--- /dev/null
+++ b/Lang/PowerShell/Parsing-RPN-calculator-algorithm
@@ -0,0 +1 @@
+../../Task/Parsing-RPN-calculator-algorithm/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Pernicious-numbers b/Lang/PowerShell/Pernicious-numbers
new file mode 120000
index 0000000000..1be5bb2a31
--- /dev/null
+++ b/Lang/PowerShell/Pernicious-numbers
@@ -0,0 +1 @@
+../../Task/Pernicious-numbers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Pragmatic-directives b/Lang/PowerShell/Pragmatic-directives
new file mode 120000
index 0000000000..059b42e8a9
--- /dev/null
+++ b/Lang/PowerShell/Pragmatic-directives
@@ -0,0 +1 @@
+../../Task/Pragmatic-directives/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Problem-of-Apollonius b/Lang/PowerShell/Problem-of-Apollonius
new file mode 120000
index 0000000000..f1158b9294
--- /dev/null
+++ b/Lang/PowerShell/Problem-of-Apollonius
@@ -0,0 +1 @@
+../../Task/Problem-of-Apollonius/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Quaternion-type b/Lang/PowerShell/Quaternion-type
new file mode 120000
index 0000000000..60f8156bec
--- /dev/null
+++ b/Lang/PowerShell/Quaternion-type
@@ -0,0 +1 @@
+../../Task/Quaternion-type/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Queue-Definition b/Lang/PowerShell/Queue-Definition
new file mode 120000
index 0000000000..335d8da727
--- /dev/null
+++ b/Lang/PowerShell/Queue-Definition
@@ -0,0 +1 @@
+../../Task/Queue-Definition/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Quickselect-algorithm b/Lang/PowerShell/Quickselect-algorithm
new file mode 120000
index 0000000000..841597b433
--- /dev/null
+++ b/Lang/PowerShell/Quickselect-algorithm
@@ -0,0 +1 @@
+../../Task/Quickselect-algorithm/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Random-numbers b/Lang/PowerShell/Random-numbers
new file mode 120000
index 0000000000..616e0e50ec
--- /dev/null
+++ b/Lang/PowerShell/Random-numbers
@@ -0,0 +1 @@
+../../Task/Random-numbers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Ranking-methods b/Lang/PowerShell/Ranking-methods
new file mode 120000
index 0000000000..7ce17949bf
--- /dev/null
+++ b/Lang/PowerShell/Ranking-methods
@@ -0,0 +1 @@
+../../Task/Ranking-methods/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Rate-counter b/Lang/PowerShell/Rate-counter
new file mode 120000
index 0000000000..3f9e7f07b9
--- /dev/null
+++ b/Lang/PowerShell/Rate-counter
@@ -0,0 +1 @@
+../../Task/Rate-counter/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Read-a-configuration-file b/Lang/PowerShell/Read-a-configuration-file
new file mode 120000
index 0000000000..068da8958e
--- /dev/null
+++ b/Lang/PowerShell/Read-a-configuration-file
@@ -0,0 +1 @@
+../../Task/Read-a-configuration-file/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/SEDOLs b/Lang/PowerShell/SEDOLs
new file mode 120000
index 0000000000..a502dc3177
--- /dev/null
+++ b/Lang/PowerShell/SEDOLs
@@ -0,0 +1 @@
+../../Task/SEDOLs/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Scope-Function-names-and-labels b/Lang/PowerShell/Scope-Function-names-and-labels
new file mode 120000
index 0000000000..b600e47117
--- /dev/null
+++ b/Lang/PowerShell/Scope-Function-names-and-labels
@@ -0,0 +1 @@
+../../Task/Scope-Function-names-and-labels/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Secure-temporary-file b/Lang/PowerShell/Secure-temporary-file
new file mode 120000
index 0000000000..5cce53c9d6
--- /dev/null
+++ b/Lang/PowerShell/Secure-temporary-file
@@ -0,0 +1 @@
+../../Task/Secure-temporary-file/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Self-describing-numbers b/Lang/PowerShell/Self-describing-numbers
new file mode 120000
index 0000000000..6353fe3485
--- /dev/null
+++ b/Lang/PowerShell/Self-describing-numbers
@@ -0,0 +1 @@
+../../Task/Self-describing-numbers/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Semiprime b/Lang/PowerShell/Semiprime
new file mode 120000
index 0000000000..21db1abee7
--- /dev/null
+++ b/Lang/PowerShell/Semiprime
@@ -0,0 +1 @@
+../../Task/Semiprime/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Semordnilap b/Lang/PowerShell/Semordnilap
new file mode 120000
index 0000000000..1043a00e66
--- /dev/null
+++ b/Lang/PowerShell/Semordnilap
@@ -0,0 +1 @@
+../../Task/Semordnilap/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Send-email b/Lang/PowerShell/Send-email
new file mode 120000
index 0000000000..0332bb6212
--- /dev/null
+++ b/Lang/PowerShell/Send-email
@@ -0,0 +1 @@
+../../Task/Send-email/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Short-circuit-evaluation b/Lang/PowerShell/Short-circuit-evaluation
new file mode 120000
index 0000000000..2574f96277
--- /dev/null
+++ b/Lang/PowerShell/Short-circuit-evaluation
@@ -0,0 +1 @@
+../../Task/Short-circuit-evaluation/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Simple-database b/Lang/PowerShell/Simple-database
new file mode 120000
index 0000000000..dc5c387ecd
--- /dev/null
+++ b/Lang/PowerShell/Simple-database
@@ -0,0 +1 @@
+../../Task/Simple-database/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Simulate-input-Keyboard b/Lang/PowerShell/Simulate-input-Keyboard
new file mode 120000
index 0000000000..b32b7a12b8
--- /dev/null
+++ b/Lang/PowerShell/Simulate-input-Keyboard
@@ -0,0 +1 @@
+../../Task/Simulate-input-Keyboard/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Sorting-algorithms-Counting-sort b/Lang/PowerShell/Sorting-algorithms-Counting-sort
new file mode 120000
index 0000000000..23f9d99dcf
--- /dev/null
+++ b/Lang/PowerShell/Sorting-algorithms-Counting-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Counting-sort/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Special-variables b/Lang/PowerShell/Special-variables
new file mode 120000
index 0000000000..66a6f93de5
--- /dev/null
+++ b/Lang/PowerShell/Special-variables
@@ -0,0 +1 @@
+../../Task/Special-variables/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Speech-synthesis b/Lang/PowerShell/Speech-synthesis
new file mode 120000
index 0000000000..fb4a07b832
--- /dev/null
+++ b/Lang/PowerShell/Speech-synthesis
@@ -0,0 +1 @@
+../../Task/Speech-synthesis/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Spiral-matrix b/Lang/PowerShell/Spiral-matrix
new file mode 120000
index 0000000000..58c9c545f5
--- /dev/null
+++ b/Lang/PowerShell/Spiral-matrix
@@ -0,0 +1 @@
+../../Task/Spiral-matrix/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Stack b/Lang/PowerShell/Stack
new file mode 120000
index 0000000000..fb73ff6c2c
--- /dev/null
+++ b/Lang/PowerShell/Stack
@@ -0,0 +1 @@
+../../Task/Stack/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Stair-climbing-puzzle b/Lang/PowerShell/Stair-climbing-puzzle
new file mode 120000
index 0000000000..3fd2f249a5
--- /dev/null
+++ b/Lang/PowerShell/Stair-climbing-puzzle
@@ -0,0 +1 @@
+../../Task/Stair-climbing-puzzle/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Stem-and-leaf-plot b/Lang/PowerShell/Stem-and-leaf-plot
new file mode 120000
index 0000000000..eae5eef64c
--- /dev/null
+++ b/Lang/PowerShell/Stem-and-leaf-plot
@@ -0,0 +1 @@
+../../Task/Stem-and-leaf-plot/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Stern-Brocot-sequence b/Lang/PowerShell/Stern-Brocot-sequence
new file mode 120000
index 0000000000..0032947577
--- /dev/null
+++ b/Lang/PowerShell/Stern-Brocot-sequence
@@ -0,0 +1 @@
+../../Task/Stern-Brocot-sequence/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Subtractive-generator b/Lang/PowerShell/Subtractive-generator
new file mode 120000
index 0000000000..f4920623af
--- /dev/null
+++ b/Lang/PowerShell/Subtractive-generator
@@ -0,0 +1 @@
+../../Task/Subtractive-generator/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Symmetric-difference b/Lang/PowerShell/Symmetric-difference
new file mode 120000
index 0000000000..b26eaaaa62
--- /dev/null
+++ b/Lang/PowerShell/Symmetric-difference
@@ -0,0 +1 @@
+../../Task/Symmetric-difference/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Table-creation-Postal-addresses b/Lang/PowerShell/Table-creation-Postal-addresses
new file mode 120000
index 0000000000..0d72fb498c
--- /dev/null
+++ b/Lang/PowerShell/Table-creation-Postal-addresses
@@ -0,0 +1 @@
+../../Task/Table-creation-Postal-addresses/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Terminal-control-Coloured-text b/Lang/PowerShell/Terminal-control-Coloured-text
new file mode 120000
index 0000000000..72338610a7
--- /dev/null
+++ b/Lang/PowerShell/Terminal-control-Coloured-text
@@ -0,0 +1 @@
+../../Task/Terminal-control-Coloured-text/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Text-processing-Max-licenses-in-use b/Lang/PowerShell/Text-processing-Max-licenses-in-use
new file mode 120000
index 0000000000..0662ec374b
--- /dev/null
+++ b/Lang/PowerShell/Text-processing-Max-licenses-in-use
@@ -0,0 +1 @@
+../../Task/Text-processing-Max-licenses-in-use/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Textonyms b/Lang/PowerShell/Textonyms
new file mode 120000
index 0000000000..38d7d5bc2b
--- /dev/null
+++ b/Lang/PowerShell/Textonyms
@@ -0,0 +1 @@
+../../Task/Textonyms/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Topic-variable b/Lang/PowerShell/Topic-variable
new file mode 120000
index 0000000000..3e519105fb
--- /dev/null
+++ b/Lang/PowerShell/Topic-variable
@@ -0,0 +1 @@
+../../Task/Topic-variable/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/URL-decoding b/Lang/PowerShell/URL-decoding
new file mode 120000
index 0000000000..ca59b80f9c
--- /dev/null
+++ b/Lang/PowerShell/URL-decoding
@@ -0,0 +1 @@
+../../Task/URL-decoding/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Ulam-spiral--for-primes- b/Lang/PowerShell/Ulam-spiral--for-primes-
new file mode 120000
index 0000000000..2c000f65c8
--- /dev/null
+++ b/Lang/PowerShell/Ulam-spiral--for-primes-
@@ -0,0 +1 @@
+../../Task/Ulam-spiral--for-primes-/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Unbias-a-random-generator b/Lang/PowerShell/Unbias-a-random-generator
new file mode 120000
index 0000000000..d033aca41e
--- /dev/null
+++ b/Lang/PowerShell/Unbias-a-random-generator
@@ -0,0 +1 @@
+../../Task/Unbias-a-random-generator/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Undefined-values b/Lang/PowerShell/Undefined-values
new file mode 120000
index 0000000000..1b87340778
--- /dev/null
+++ b/Lang/PowerShell/Undefined-values
@@ -0,0 +1 @@
+../../Task/Undefined-values/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Unicode-variable-names b/Lang/PowerShell/Unicode-variable-names
new file mode 120000
index 0000000000..6d64fdc654
--- /dev/null
+++ b/Lang/PowerShell/Unicode-variable-names
@@ -0,0 +1 @@
+../../Task/Unicode-variable-names/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Update-a-configuration-file b/Lang/PowerShell/Update-a-configuration-file
new file mode 120000
index 0000000000..e61498f003
--- /dev/null
+++ b/Lang/PowerShell/Update-a-configuration-file
@@ -0,0 +1 @@
+../../Task/Update-a-configuration-file/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Vigen-re-cipher b/Lang/PowerShell/Vigen-re-cipher
new file mode 120000
index 0000000000..ca557a521d
--- /dev/null
+++ b/Lang/PowerShell/Vigen-re-cipher
@@ -0,0 +1 @@
+../../Task/Vigen-re-cipher/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Write-float-arrays-to-a-text-file b/Lang/PowerShell/Write-float-arrays-to-a-text-file
new file mode 120000
index 0000000000..605bf473f0
--- /dev/null
+++ b/Lang/PowerShell/Write-float-arrays-to-a-text-file
@@ -0,0 +1 @@
+../../Task/Write-float-arrays-to-a-text-file/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/XML-XPath b/Lang/PowerShell/XML-XPath
new file mode 120000
index 0000000000..5090a527cc
--- /dev/null
+++ b/Lang/PowerShell/XML-XPath
@@ -0,0 +1 @@
+../../Task/XML-XPath/PowerShell
\ No newline at end of file
diff --git a/Lang/PowerShell/Zeckendorf-number-representation b/Lang/PowerShell/Zeckendorf-number-representation
new file mode 120000
index 0000000000..bd819e6a10
--- /dev/null
+++ b/Lang/PowerShell/Zeckendorf-number-representation
@@ -0,0 +1 @@
+../../Task/Zeckendorf-number-representation/PowerShell
\ No newline at end of file
diff --git a/Lang/Processing/100-doors b/Lang/Processing/100-doors
new file mode 120000
index 0000000000..f539c8eea6
--- /dev/null
+++ b/Lang/Processing/100-doors
@@ -0,0 +1 @@
+../../Task/100-doors/Processing
\ No newline at end of file
diff --git a/Lang/Processing/99-Bottles-of-Beer b/Lang/Processing/99-Bottles-of-Beer
new file mode 120000
index 0000000000..a85e7b1a94
--- /dev/null
+++ b/Lang/Processing/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/Processing
\ No newline at end of file
diff --git a/Lang/Processing/A+B b/Lang/Processing/A+B
new file mode 120000
index 0000000000..e71a4fa7cb
--- /dev/null
+++ b/Lang/Processing/A+B
@@ -0,0 +1 @@
+../../Task/A+B/Processing
\ No newline at end of file
diff --git a/Lang/Processing/Brownian-tree b/Lang/Processing/Brownian-tree
new file mode 120000
index 0000000000..d1e3e3f994
--- /dev/null
+++ b/Lang/Processing/Brownian-tree
@@ -0,0 +1 @@
+../../Task/Brownian-tree/Processing
\ No newline at end of file
diff --git a/Lang/Processing/Call-an-object-method b/Lang/Processing/Call-an-object-method
new file mode 120000
index 0000000000..2338190047
--- /dev/null
+++ b/Lang/Processing/Call-an-object-method
@@ -0,0 +1 @@
+../../Task/Call-an-object-method/Processing
\ No newline at end of file
diff --git a/Lang/Processing/Comments b/Lang/Processing/Comments
new file mode 120000
index 0000000000..73ca03cf8e
--- /dev/null
+++ b/Lang/Processing/Comments
@@ -0,0 +1 @@
+../../Task/Comments/Processing
\ No newline at end of file
diff --git a/Lang/Processing/Function-definition b/Lang/Processing/Function-definition
new file mode 120000
index 0000000000..9a3caad349
--- /dev/null
+++ b/Lang/Processing/Function-definition
@@ -0,0 +1 @@
+../../Task/Function-definition/Processing
\ No newline at end of file
diff --git a/Lang/Processing/Hello-world-Text b/Lang/Processing/Hello-world-Text
new file mode 120000
index 0000000000..2a60b8b593
--- /dev/null
+++ b/Lang/Processing/Hello-world-Text
@@ -0,0 +1 @@
+../../Task/Hello-world-Text/Processing
\ No newline at end of file
diff --git a/Lang/Prolog/Abundant,-deficient-and-perfect-number-classifications b/Lang/Prolog/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..817860f6b7
--- /dev/null
+++ b/Lang/Prolog/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/Prolog
\ No newline at end of file
diff --git a/Lang/Prolog/Soundex b/Lang/Prolog/Soundex
new file mode 120000
index 0000000000..806797aca2
--- /dev/null
+++ b/Lang/Prolog/Soundex
@@ -0,0 +1 @@
+../../Task/Soundex/Prolog
\ No newline at end of file
diff --git a/Lang/Prolog/The-Twelve-Days-of-Christmas b/Lang/Prolog/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..c2d4539ef5
--- /dev/null
+++ b/Lang/Prolog/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Prolog
\ No newline at end of file
diff --git a/Lang/Prolog/Variables b/Lang/Prolog/Variables
new file mode 120000
index 0000000000..1f61549c5a
--- /dev/null
+++ b/Lang/Prolog/Variables
@@ -0,0 +1 @@
+../../Task/Variables/Prolog
\ No newline at end of file
diff --git a/Lang/Protium/00DESCRIPTION b/Lang/Protium/00DESCRIPTION
index bd00fa02bb..e69de29bb2 100644
--- a/Lang/Protium/00DESCRIPTION
+++ b/Lang/Protium/00DESCRIPTION
@@ -1,8 +0,0 @@
-{{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/PureBasic/Abundant,-deficient-and-perfect-number-classifications b/Lang/PureBasic/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..67e7c78059
--- /dev/null
+++ b/Lang/PureBasic/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Amicable-pairs b/Lang/PureBasic/Amicable-pairs
new file mode 120000
index 0000000000..7edef4b433
--- /dev/null
+++ b/Lang/PureBasic/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Bitcoin-address-validation b/Lang/PureBasic/Bitcoin-address-validation
new file mode 120000
index 0000000000..886d40066c
--- /dev/null
+++ b/Lang/PureBasic/Bitcoin-address-validation
@@ -0,0 +1 @@
+../../Task/Bitcoin-address-validation/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/CRC-32 b/Lang/PureBasic/CRC-32
new file mode 120000
index 0000000000..4e9d0f73de
--- /dev/null
+++ b/Lang/PureBasic/CRC-32
@@ -0,0 +1 @@
+../../Task/CRC-32/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/CSV-data-manipulation b/Lang/PureBasic/CSV-data-manipulation
new file mode 120000
index 0000000000..c254e65b4a
--- /dev/null
+++ b/Lang/PureBasic/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Comma-quibbling b/Lang/PureBasic/Comma-quibbling
new file mode 120000
index 0000000000..841d4e6c2c
--- /dev/null
+++ b/Lang/PureBasic/Comma-quibbling
@@ -0,0 +1 @@
+../../Task/Comma-quibbling/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Date-manipulation b/Lang/PureBasic/Date-manipulation
new file mode 120000
index 0000000000..4f9748e927
--- /dev/null
+++ b/Lang/PureBasic/Date-manipulation
@@ -0,0 +1 @@
+../../Task/Date-manipulation/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Magic-squares-of-odd-order b/Lang/PureBasic/Magic-squares-of-odd-order
new file mode 120000
index 0000000000..86b0471c74
--- /dev/null
+++ b/Lang/PureBasic/Magic-squares-of-odd-order
@@ -0,0 +1 @@
+../../Task/Magic-squares-of-odd-order/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Pernicious-numbers b/Lang/PureBasic/Pernicious-numbers
new file mode 120000
index 0000000000..0bff34b62e
--- /dev/null
+++ b/Lang/PureBasic/Pernicious-numbers
@@ -0,0 +1 @@
+../../Task/Pernicious-numbers/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Remove-lines-from-a-file b/Lang/PureBasic/Remove-lines-from-a-file
new file mode 120000
index 0000000000..00a7578046
--- /dev/null
+++ b/Lang/PureBasic/Remove-lines-from-a-file
@@ -0,0 +1 @@
+../../Task/Remove-lines-from-a-file/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Runge-Kutta-method b/Lang/PureBasic/Runge-Kutta-method
new file mode 120000
index 0000000000..34a6f0a7d5
--- /dev/null
+++ b/Lang/PureBasic/Runge-Kutta-method
@@ -0,0 +1 @@
+../../Task/Runge-Kutta-method/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/SHA-1 b/Lang/PureBasic/SHA-1
new file mode 120000
index 0000000000..dc27f08421
--- /dev/null
+++ b/Lang/PureBasic/SHA-1
@@ -0,0 +1 @@
+../../Task/SHA-1/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/SHA-256 b/Lang/PureBasic/SHA-256
new file mode 120000
index 0000000000..06b7e243c4
--- /dev/null
+++ b/Lang/PureBasic/SHA-256
@@ -0,0 +1 @@
+../../Task/SHA-256/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/String-comparison b/Lang/PureBasic/String-comparison
new file mode 120000
index 0000000000..6e5e38cd0f
--- /dev/null
+++ b/Lang/PureBasic/String-comparison
@@ -0,0 +1 @@
+../../Task/String-comparison/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Sum-digits-of-an-integer b/Lang/PureBasic/Sum-digits-of-an-integer
new file mode 120000
index 0000000000..b75b0eb0d0
--- /dev/null
+++ b/Lang/PureBasic/Sum-digits-of-an-integer
@@ -0,0 +1 @@
+../../Task/Sum-digits-of-an-integer/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Sum-multiples-of-3-and-5 b/Lang/PureBasic/Sum-multiples-of-3-and-5
new file mode 120000
index 0000000000..80c5797b70
--- /dev/null
+++ b/Lang/PureBasic/Sum-multiples-of-3-and-5
@@ -0,0 +1 @@
+../../Task/Sum-multiples-of-3-and-5/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Variable-size-Set b/Lang/PureBasic/Variable-size-Set
new file mode 120000
index 0000000000..937dad9b10
--- /dev/null
+++ b/Lang/PureBasic/Variable-size-Set
@@ -0,0 +1 @@
+../../Task/Variable-size-Set/PureBasic
\ No newline at end of file
diff --git a/Lang/PureBasic/Zero-to-the-zero-power b/Lang/PureBasic/Zero-to-the-zero-power
new file mode 120000
index 0000000000..3753e52974
--- /dev/null
+++ b/Lang/PureBasic/Zero-to-the-zero-power
@@ -0,0 +1 @@
+../../Task/Zero-to-the-zero-power/PureBasic
\ No newline at end of file
diff --git a/Lang/Python/Calendar---for-REAL-programmers b/Lang/Python/Calendar---for-REAL-programmers
new file mode 120000
index 0000000000..298fd17117
--- /dev/null
+++ b/Lang/Python/Calendar---for-REAL-programmers
@@ -0,0 +1 @@
+../../Task/Calendar---for-REAL-programmers/Python
\ No newline at end of file
diff --git a/Lang/Python/Pinstripe-Display b/Lang/Python/Pinstripe-Display
new file mode 120000
index 0000000000..3b64811267
--- /dev/null
+++ b/Lang/Python/Pinstripe-Display
@@ -0,0 +1 @@
+../../Task/Pinstripe-Display/Python
\ No newline at end of file
diff --git a/Lang/Python/Speech-synthesis b/Lang/Python/Speech-synthesis
new file mode 120000
index 0000000000..cb808736f5
--- /dev/null
+++ b/Lang/Python/Speech-synthesis
@@ -0,0 +1 @@
+../../Task/Speech-synthesis/Python
\ No newline at end of file
diff --git a/Lang/Python/Terminal-control-Unicode-output b/Lang/Python/Terminal-control-Unicode-output
new file mode 120000
index 0000000000..81e71f9f6c
--- /dev/null
+++ b/Lang/Python/Terminal-control-Unicode-output
@@ -0,0 +1 @@
+../../Task/Terminal-control-Unicode-output/Python
\ No newline at end of file
diff --git a/Lang/Q/Death-Star b/Lang/Q/Death-Star
new file mode 120000
index 0000000000..406fa13592
--- /dev/null
+++ b/Lang/Q/Death-Star
@@ -0,0 +1 @@
+../../Task/Death-Star/Q
\ No newline at end of file
diff --git a/Lang/R/Almost-prime b/Lang/R/Almost-prime
new file mode 120000
index 0000000000..2fc2587e6f
--- /dev/null
+++ b/Lang/R/Almost-prime
@@ -0,0 +1 @@
+../../Task/Almost-prime/R
\ No newline at end of file
diff --git a/Lang/R/Count-in-factors b/Lang/R/Count-in-factors
new file mode 120000
index 0000000000..e1d49220d2
--- /dev/null
+++ b/Lang/R/Count-in-factors
@@ -0,0 +1 @@
+../../Task/Count-in-factors/R
\ No newline at end of file
diff --git a/Lang/R/Digital-root b/Lang/R/Digital-root
new file mode 120000
index 0000000000..a431dcb3dd
--- /dev/null
+++ b/Lang/R/Digital-root
@@ -0,0 +1 @@
+../../Task/Digital-root/R
\ No newline at end of file
diff --git a/Lang/R/Multifactorial b/Lang/R/Multifactorial
new file mode 120000
index 0000000000..f4052b747b
--- /dev/null
+++ b/Lang/R/Multifactorial
@@ -0,0 +1 @@
+../../Task/Multifactorial/R
\ No newline at end of file
diff --git a/Lang/R/Penneys-game b/Lang/R/Penneys-game
new file mode 120000
index 0000000000..367a6a9639
--- /dev/null
+++ b/Lang/R/Penneys-game
@@ -0,0 +1 @@
+../../Task/Penneys-game/R
\ No newline at end of file
diff --git a/Lang/R/Send-email b/Lang/R/Send-email
new file mode 120000
index 0000000000..cf8c73d7c0
--- /dev/null
+++ b/Lang/R/Send-email
@@ -0,0 +1 @@
+../../Task/Send-email/R
\ No newline at end of file
diff --git a/Lang/R/Sorting-algorithms-Comb-sort b/Lang/R/Sorting-algorithms-Comb-sort
new file mode 120000
index 0000000000..2263c9672d
--- /dev/null
+++ b/Lang/R/Sorting-algorithms-Comb-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Comb-sort/R
\ No newline at end of file
diff --git a/Lang/R/Sorting-algorithms-Stooge-sort b/Lang/R/Sorting-algorithms-Stooge-sort
new file mode 120000
index 0000000000..dbb8930d28
--- /dev/null
+++ b/Lang/R/Sorting-algorithms-Stooge-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Stooge-sort/R
\ No newline at end of file
diff --git a/Lang/R/Zero-to-the-zero-power b/Lang/R/Zero-to-the-zero-power
new file mode 120000
index 0000000000..9c164f2637
--- /dev/null
+++ b/Lang/R/Zero-to-the-zero-power
@@ -0,0 +1 @@
+../../Task/Zero-to-the-zero-power/R
\ No newline at end of file
diff --git a/Lang/REBOL/Hailstone-sequence b/Lang/REBOL/Hailstone-sequence
new file mode 120000
index 0000000000..f668d98fe0
--- /dev/null
+++ b/Lang/REBOL/Hailstone-sequence
@@ -0,0 +1 @@
+../../Task/Hailstone-sequence/REBOL
\ No newline at end of file
diff --git a/Lang/REBOL/Interactive-programming b/Lang/REBOL/Interactive-programming
new file mode 120000
index 0000000000..f0f58b9ac1
--- /dev/null
+++ b/Lang/REBOL/Interactive-programming
@@ -0,0 +1 @@
+../../Task/Interactive-programming/REBOL
\ No newline at end of file
diff --git a/Lang/REBOL/Read-a-specific-line-from-a-file b/Lang/REBOL/Read-a-specific-line-from-a-file
new file mode 120000
index 0000000000..fc3cb7c086
--- /dev/null
+++ b/Lang/REBOL/Read-a-specific-line-from-a-file
@@ -0,0 +1 @@
+../../Task/Read-a-specific-line-from-a-file/REBOL
\ No newline at end of file
diff --git a/Lang/REBOL/Sorting-algorithms-Insertion-sort b/Lang/REBOL/Sorting-algorithms-Insertion-sort
new file mode 120000
index 0000000000..5a9f9f2f24
--- /dev/null
+++ b/Lang/REBOL/Sorting-algorithms-Insertion-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Insertion-sort/REBOL
\ No newline at end of file
diff --git a/Lang/REXX/HTTP b/Lang/REXX/HTTP
new file mode 120000
index 0000000000..0220301fed
--- /dev/null
+++ b/Lang/REXX/HTTP
@@ -0,0 +1 @@
+../../Task/HTTP/REXX
\ No newline at end of file
diff --git a/Lang/REXX/Numeric-error-propagation b/Lang/REXX/Numeric-error-propagation
new file mode 120000
index 0000000000..27aaef849a
--- /dev/null
+++ b/Lang/REXX/Numeric-error-propagation
@@ -0,0 +1 @@
+../../Task/Numeric-error-propagation/REXX
\ No newline at end of file
diff --git a/Lang/REXX/Sort-an-array-of-composite-structures b/Lang/REXX/Sort-an-array-of-composite-structures
new file mode 120000
index 0000000000..6af7635f24
--- /dev/null
+++ b/Lang/REXX/Sort-an-array-of-composite-structures
@@ -0,0 +1 @@
+../../Task/Sort-an-array-of-composite-structures/REXX
\ No newline at end of file
diff --git a/Lang/REXX/Stable-marriage-problem b/Lang/REXX/Stable-marriage-problem
new file mode 120000
index 0000000000..f55dc04101
--- /dev/null
+++ b/Lang/REXX/Stable-marriage-problem
@@ -0,0 +1 @@
+../../Task/Stable-marriage-problem/REXX
\ No newline at end of file
diff --git a/Lang/REXX/Topological-sort b/Lang/REXX/Topological-sort
new file mode 120000
index 0000000000..2d48ac1153
--- /dev/null
+++ b/Lang/REXX/Topological-sort
@@ -0,0 +1 @@
+../../Task/Topological-sort/REXX
\ No newline at end of file
diff --git a/Lang/REXX/Unicode-variable-names b/Lang/REXX/Unicode-variable-names
new file mode 120000
index 0000000000..966d3f53fd
--- /dev/null
+++ b/Lang/REXX/Unicode-variable-names
@@ -0,0 +1 @@
+../../Task/Unicode-variable-names/REXX
\ No newline at end of file
diff --git a/Lang/REXX/Zebra-puzzle b/Lang/REXX/Zebra-puzzle
new file mode 120000
index 0000000000..53f94c2d55
--- /dev/null
+++ b/Lang/REXX/Zebra-puzzle
@@ -0,0 +1 @@
+../../Task/Zebra-puzzle/REXX
\ No newline at end of file
diff --git a/Lang/RPG/MD5 b/Lang/RPG/MD5
new file mode 120000
index 0000000000..cae7058d2b
--- /dev/null
+++ b/Lang/RPG/MD5
@@ -0,0 +1 @@
+../../Task/MD5/RPG
\ No newline at end of file
diff --git a/Lang/RPG/MD5-Implementation b/Lang/RPG/MD5-Implementation
new file mode 120000
index 0000000000..5798ea1be9
--- /dev/null
+++ b/Lang/RPG/MD5-Implementation
@@ -0,0 +1 @@
+../../Task/MD5-Implementation/RPG
\ No newline at end of file
diff --git a/Lang/RPL-2/Averages-Arithmetic-mean b/Lang/RPL-2/Averages-Arithmetic-mean
new file mode 120000
index 0000000000..2b38ee3b5e
--- /dev/null
+++ b/Lang/RPL-2/Averages-Arithmetic-mean
@@ -0,0 +1 @@
+../../Task/Averages-Arithmetic-mean/RPL-2
\ No newline at end of file
diff --git a/Lang/RapidQ/Binary-digits b/Lang/RapidQ/Binary-digits
new file mode 120000
index 0000000000..fce9be7a11
--- /dev/null
+++ b/Lang/RapidQ/Binary-digits
@@ -0,0 +1 @@
+../../Task/Binary-digits/RapidQ
\ No newline at end of file
diff --git a/Lang/Ruby/Constrained-genericity b/Lang/Ruby/Constrained-genericity
new file mode 120000
index 0000000000..34938e79bb
--- /dev/null
+++ b/Lang/Ruby/Constrained-genericity
@@ -0,0 +1 @@
+../../Task/Constrained-genericity/Ruby
\ No newline at end of file
diff --git a/Lang/Ruby/Keyboard-input-Keypress-check b/Lang/Ruby/Keyboard-input-Keypress-check
new file mode 120000
index 0000000000..d66a894b90
--- /dev/null
+++ b/Lang/Ruby/Keyboard-input-Keypress-check
@@ -0,0 +1 @@
+../../Task/Keyboard-input-Keypress-check/Ruby
\ No newline at end of file
diff --git a/Lang/Ruby/RSA-code b/Lang/Ruby/RSA-code
new file mode 120000
index 0000000000..3088139995
--- /dev/null
+++ b/Lang/Ruby/RSA-code
@@ -0,0 +1 @@
+../../Task/RSA-code/Ruby
\ No newline at end of file
diff --git a/Lang/Run-BASIC/ABC-Problem b/Lang/Run-BASIC/ABC-Problem
new file mode 120000
index 0000000000..8c96eac7f0
--- /dev/null
+++ b/Lang/Run-BASIC/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Amicable-pairs b/Lang/Run-BASIC/Amicable-pairs
new file mode 120000
index 0000000000..6d07309192
--- /dev/null
+++ b/Lang/Run-BASIC/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Averages-Mean-time-of-day b/Lang/Run-BASIC/Averages-Mean-time-of-day
new file mode 120000
index 0000000000..1657a39356
--- /dev/null
+++ b/Lang/Run-BASIC/Averages-Mean-time-of-day
@@ -0,0 +1 @@
+../../Task/Averages-Mean-time-of-day/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Averages-Median b/Lang/Run-BASIC/Averages-Median
new file mode 120000
index 0000000000..87132d543c
--- /dev/null
+++ b/Lang/Run-BASIC/Averages-Median
@@ -0,0 +1 @@
+../../Task/Averages-Median/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Empty-program b/Lang/Run-BASIC/Empty-program
new file mode 120000
index 0000000000..c4848532e7
--- /dev/null
+++ b/Lang/Run-BASIC/Empty-program
@@ -0,0 +1 @@
+../../Task/Empty-program/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Entropy b/Lang/Run-BASIC/Entropy
new file mode 120000
index 0000000000..66cdf189b4
--- /dev/null
+++ b/Lang/Run-BASIC/Entropy
@@ -0,0 +1 @@
+../../Task/Entropy/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Find-the-last-Sunday-of-each-month b/Lang/Run-BASIC/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..5f33212b3d
--- /dev/null
+++ b/Lang/Run-BASIC/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Hash-join b/Lang/Run-BASIC/Hash-join
new file mode 120000
index 0000000000..ed63af139a
--- /dev/null
+++ b/Lang/Run-BASIC/Hash-join
@@ -0,0 +1 @@
+../../Task/Hash-join/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Hello-world-Newline-omission b/Lang/Run-BASIC/Hello-world-Newline-omission
new file mode 120000
index 0000000000..065039b265
--- /dev/null
+++ b/Lang/Run-BASIC/Hello-world-Newline-omission
@@ -0,0 +1 @@
+../../Task/Hello-world-Newline-omission/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Linear-congruential-generator b/Lang/Run-BASIC/Linear-congruential-generator
new file mode 120000
index 0000000000..061db85eb6
--- /dev/null
+++ b/Lang/Run-BASIC/Linear-congruential-generator
@@ -0,0 +1 @@
+../../Task/Linear-congruential-generator/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Make-directory-path b/Lang/Run-BASIC/Make-directory-path
new file mode 120000
index 0000000000..22db875a57
--- /dev/null
+++ b/Lang/Run-BASIC/Make-directory-path
@@ -0,0 +1 @@
+../../Task/Make-directory-path/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Multiplication-tables b/Lang/Run-BASIC/Multiplication-tables
new file mode 120000
index 0000000000..bc3b7bb172
--- /dev/null
+++ b/Lang/Run-BASIC/Multiplication-tables
@@ -0,0 +1 @@
+../../Task/Multiplication-tables/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Non-decimal-radices-Output b/Lang/Run-BASIC/Non-decimal-radices-Output
new file mode 120000
index 0000000000..dc9d1717cc
--- /dev/null
+++ b/Lang/Run-BASIC/Non-decimal-radices-Output
@@ -0,0 +1 @@
+../../Task/Non-decimal-radices-Output/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Program-termination b/Lang/Run-BASIC/Program-termination
new file mode 120000
index 0000000000..a1303f62a7
--- /dev/null
+++ b/Lang/Run-BASIC/Program-termination
@@ -0,0 +1 @@
+../../Task/Program-termination/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Remove-duplicate-elements b/Lang/Run-BASIC/Remove-duplicate-elements
new file mode 120000
index 0000000000..ee50448727
--- /dev/null
+++ b/Lang/Run-BASIC/Remove-duplicate-elements
@@ -0,0 +1 @@
+../../Task/Remove-duplicate-elements/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Reverse-words-in-a-string b/Lang/Run-BASIC/Reverse-words-in-a-string
new file mode 120000
index 0000000000..68099b9905
--- /dev/null
+++ b/Lang/Run-BASIC/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Roots-of-unity b/Lang/Run-BASIC/Roots-of-unity
new file mode 120000
index 0000000000..b59c37e85c
--- /dev/null
+++ b/Lang/Run-BASIC/Roots-of-unity
@@ -0,0 +1 @@
+../../Task/Roots-of-unity/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Set b/Lang/Run-BASIC/Set
new file mode 120000
index 0000000000..1578601469
--- /dev/null
+++ b/Lang/Run-BASIC/Set
@@ -0,0 +1 @@
+../../Task/Set/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Sierpinski-triangle b/Lang/Run-BASIC/Sierpinski-triangle
new file mode 120000
index 0000000000..e46a27ce40
--- /dev/null
+++ b/Lang/Run-BASIC/Sierpinski-triangle
@@ -0,0 +1 @@
+../../Task/Sierpinski-triangle/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Statistics-Basic b/Lang/Run-BASIC/Statistics-Basic
new file mode 120000
index 0000000000..9b9287b21c
--- /dev/null
+++ b/Lang/Run-BASIC/Statistics-Basic
@@ -0,0 +1 @@
+../../Task/Statistics-Basic/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/The-Twelve-Days-of-Christmas b/Lang/Run-BASIC/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..bb4445be57
--- /dev/null
+++ b/Lang/Run-BASIC/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Unix-ls b/Lang/Run-BASIC/Unix-ls
new file mode 120000
index 0000000000..c64e0cf05f
--- /dev/null
+++ b/Lang/Run-BASIC/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Run-BASIC/Walk-a-directory-Non-recursively b/Lang/Run-BASIC/Walk-a-directory-Non-recursively
new file mode 120000
index 0000000000..17992cf7bb
--- /dev/null
+++ b/Lang/Run-BASIC/Walk-a-directory-Non-recursively
@@ -0,0 +1 @@
+../../Task/Walk-a-directory-Non-recursively/Run-BASIC
\ No newline at end of file
diff --git a/Lang/Rust/00DESCRIPTION b/Lang/Rust/00DESCRIPTION
index ce935fc36e..e0a3dbfff0 100644
--- a/Lang/Rust/00DESCRIPTION
+++ b/Lang/Rust/00DESCRIPTION
@@ -13,6 +13,8 @@
Rust is a general purpose, multi-paradigm, systems programming language sponsored by Mozilla. Its goal is to provide a fast, practical, concurrent language with zero-cost abstractions and strong memory safety. It employs a unique model of ownership to eliminate data races.
+Solutions to RosettaCode tasks are mirrored on GitHub at [http://github.com/Hoverbear/rust-rosetta Hoverbear/rust-rosetta]. If you implement a solution here, please open a pull request!
+
== Features ==
From the official website:
* zero-cost abstractions
diff --git a/Lang/Rust/24-game b/Lang/Rust/24-game
new file mode 120000
index 0000000000..a1e95ee10f
--- /dev/null
+++ b/Lang/Rust/24-game
@@ -0,0 +1 @@
+../../Task/24-game/Rust
\ No newline at end of file
diff --git a/Lang/Rust/9-billion-names-of-God-the-integer b/Lang/Rust/9-billion-names-of-God-the-integer
new file mode 120000
index 0000000000..a0872e7181
--- /dev/null
+++ b/Lang/Rust/9-billion-names-of-God-the-integer
@@ -0,0 +1 @@
+../../Task/9-billion-names-of-God-the-integer/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Abstract-type b/Lang/Rust/Abstract-type
new file mode 120000
index 0000000000..6dcbe98b3e
--- /dev/null
+++ b/Lang/Rust/Abstract-type
@@ -0,0 +1 @@
+../../Task/Abstract-type/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Arena-storage-pool b/Lang/Rust/Arena-storage-pool
new file mode 120000
index 0000000000..ae56090343
--- /dev/null
+++ b/Lang/Rust/Arena-storage-pool
@@ -0,0 +1 @@
+../../Task/Arena-storage-pool/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Arithmetic-Rational b/Lang/Rust/Arithmetic-Rational
new file mode 120000
index 0000000000..94acaf63da
--- /dev/null
+++ b/Lang/Rust/Arithmetic-Rational
@@ -0,0 +1 @@
+../../Task/Arithmetic-Rational/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Array-concatenation b/Lang/Rust/Array-concatenation
new file mode 120000
index 0000000000..98c29116db
--- /dev/null
+++ b/Lang/Rust/Array-concatenation
@@ -0,0 +1 @@
+../../Task/Array-concatenation/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Associative-array-Creation b/Lang/Rust/Associative-array-Creation
new file mode 120000
index 0000000000..d47c8882af
--- /dev/null
+++ b/Lang/Rust/Associative-array-Creation
@@ -0,0 +1 @@
+../../Task/Associative-array-Creation/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Atomic-updates b/Lang/Rust/Atomic-updates
new file mode 120000
index 0000000000..c08bc68c6d
--- /dev/null
+++ b/Lang/Rust/Atomic-updates
@@ -0,0 +1 @@
+../../Task/Atomic-updates/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Average-loop-length b/Lang/Rust/Average-loop-length
new file mode 120000
index 0000000000..e7cb405a17
--- /dev/null
+++ b/Lang/Rust/Average-loop-length
@@ -0,0 +1 @@
+../../Task/Average-loop-length/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Averages-Mean-angle b/Lang/Rust/Averages-Mean-angle
new file mode 120000
index 0000000000..0521baf164
--- /dev/null
+++ b/Lang/Rust/Averages-Mean-angle
@@ -0,0 +1 @@
+../../Task/Averages-Mean-angle/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Averages-Mode b/Lang/Rust/Averages-Mode
new file mode 120000
index 0000000000..9e8da5ad6f
--- /dev/null
+++ b/Lang/Rust/Averages-Mode
@@ -0,0 +1 @@
+../../Task/Averages-Mode/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Averages-Pythagorean-means b/Lang/Rust/Averages-Pythagorean-means
new file mode 120000
index 0000000000..1e44378195
--- /dev/null
+++ b/Lang/Rust/Averages-Pythagorean-means
@@ -0,0 +1 @@
+../../Task/Averages-Pythagorean-means/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Averages-Root-mean-square b/Lang/Rust/Averages-Root-mean-square
new file mode 120000
index 0000000000..84664673e2
--- /dev/null
+++ b/Lang/Rust/Averages-Root-mean-square
@@ -0,0 +1 @@
+../../Task/Averages-Root-mean-square/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Averages-Simple-moving-average b/Lang/Rust/Averages-Simple-moving-average
new file mode 120000
index 0000000000..e39a50da60
--- /dev/null
+++ b/Lang/Rust/Averages-Simple-moving-average
@@ -0,0 +1 @@
+../../Task/Averages-Simple-moving-average/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Benfords-law b/Lang/Rust/Benfords-law
new file mode 120000
index 0000000000..77351bc402
--- /dev/null
+++ b/Lang/Rust/Benfords-law
@@ -0,0 +1 @@
+../../Task/Benfords-law/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Bernoulli-numbers b/Lang/Rust/Bernoulli-numbers
new file mode 120000
index 0000000000..0833ddc6db
--- /dev/null
+++ b/Lang/Rust/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Binary-strings b/Lang/Rust/Binary-strings
new file mode 120000
index 0000000000..536ba2c2da
--- /dev/null
+++ b/Lang/Rust/Binary-strings
@@ -0,0 +1 @@
+../../Task/Binary-strings/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Brownian-tree b/Lang/Rust/Brownian-tree
new file mode 120000
index 0000000000..e282f3eeb6
--- /dev/null
+++ b/Lang/Rust/Brownian-tree
@@ -0,0 +1 @@
+../../Task/Brownian-tree/Rust
\ No newline at end of file
diff --git a/Lang/Rust/CRC-32 b/Lang/Rust/CRC-32
new file mode 120000
index 0000000000..9432def6a3
--- /dev/null
+++ b/Lang/Rust/CRC-32
@@ -0,0 +1 @@
+../../Task/CRC-32/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Caesar-cipher b/Lang/Rust/Caesar-cipher
new file mode 120000
index 0000000000..9f86d1a991
--- /dev/null
+++ b/Lang/Rust/Caesar-cipher
@@ -0,0 +1 @@
+../../Task/Caesar-cipher/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Call-a-foreign-language-function b/Lang/Rust/Call-a-foreign-language-function
new file mode 120000
index 0000000000..4620732d52
--- /dev/null
+++ b/Lang/Rust/Call-a-foreign-language-function
@@ -0,0 +1 @@
+../../Task/Call-a-foreign-language-function/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Call-a-function b/Lang/Rust/Call-a-function
new file mode 120000
index 0000000000..5c395a45f7
--- /dev/null
+++ b/Lang/Rust/Call-a-function
@@ -0,0 +1 @@
+../../Task/Call-a-function/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Carmichael-3-strong-pseudoprimes b/Lang/Rust/Carmichael-3-strong-pseudoprimes
new file mode 120000
index 0000000000..5ea56cc0db
--- /dev/null
+++ b/Lang/Rust/Carmichael-3-strong-pseudoprimes
@@ -0,0 +1 @@
+../../Task/Carmichael-3-strong-pseudoprimes/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Case-sensitivity-of-identifiers b/Lang/Rust/Case-sensitivity-of-identifiers
new file mode 120000
index 0000000000..565ccec8b9
--- /dev/null
+++ b/Lang/Rust/Case-sensitivity-of-identifiers
@@ -0,0 +1 @@
+../../Task/Case-sensitivity-of-identifiers/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Check-that-file-exists b/Lang/Rust/Check-that-file-exists
new file mode 120000
index 0000000000..d9b2948144
--- /dev/null
+++ b/Lang/Rust/Check-that-file-exists
@@ -0,0 +1 @@
+../../Task/Check-that-file-exists/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Collections b/Lang/Rust/Collections
new file mode 120000
index 0000000000..64acbd3eae
--- /dev/null
+++ b/Lang/Rust/Collections
@@ -0,0 +1 @@
+../../Task/Collections/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Compound-data-type b/Lang/Rust/Compound-data-type
new file mode 120000
index 0000000000..af942f441d
--- /dev/null
+++ b/Lang/Rust/Compound-data-type
@@ -0,0 +1 @@
+../../Task/Compound-data-type/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Conjugate-transpose b/Lang/Rust/Conjugate-transpose
new file mode 120000
index 0000000000..34ac95bb28
--- /dev/null
+++ b/Lang/Rust/Conjugate-transpose
@@ -0,0 +1 @@
+../../Task/Conjugate-transpose/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Continued-fraction b/Lang/Rust/Continued-fraction
new file mode 120000
index 0000000000..1c09cbfa64
--- /dev/null
+++ b/Lang/Rust/Continued-fraction
@@ -0,0 +1 @@
+../../Task/Continued-fraction/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Continued-fraction-Arithmetic-Construct-from-rational-number b/Lang/Rust/Continued-fraction-Arithmetic-Construct-from-rational-number
new file mode 120000
index 0000000000..67d2666eca
--- /dev/null
+++ b/Lang/Rust/Continued-fraction-Arithmetic-Construct-from-rational-number
@@ -0,0 +1 @@
+../../Task/Continued-fraction-Arithmetic-Construct-from-rational-number/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Copy-a-string b/Lang/Rust/Copy-a-string
new file mode 120000
index 0000000000..34b957110d
--- /dev/null
+++ b/Lang/Rust/Copy-a-string
@@ -0,0 +1 @@
+../../Task/Copy-a-string/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Count-occurrences-of-a-substring b/Lang/Rust/Count-occurrences-of-a-substring
new file mode 120000
index 0000000000..07903c3507
--- /dev/null
+++ b/Lang/Rust/Count-occurrences-of-a-substring
@@ -0,0 +1 @@
+../../Task/Count-occurrences-of-a-substring/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Date-format b/Lang/Rust/Date-format
new file mode 120000
index 0000000000..e267c24e1d
--- /dev/null
+++ b/Lang/Rust/Date-format
@@ -0,0 +1 @@
+../../Task/Date-format/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Digital-root b/Lang/Rust/Digital-root
new file mode 120000
index 0000000000..cb5c8860ae
--- /dev/null
+++ b/Lang/Rust/Digital-root
@@ -0,0 +1 @@
+../../Task/Digital-root/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Doubly-linked-list-Element-definition b/Lang/Rust/Doubly-linked-list-Element-definition
new file mode 120000
index 0000000000..f3685f6399
--- /dev/null
+++ b/Lang/Rust/Doubly-linked-list-Element-definition
@@ -0,0 +1 @@
+../../Task/Doubly-linked-list-Element-definition/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Doubly-linked-list-Element-insertion b/Lang/Rust/Doubly-linked-list-Element-insertion
new file mode 120000
index 0000000000..d3ee6db4c5
--- /dev/null
+++ b/Lang/Rust/Doubly-linked-list-Element-insertion
@@ -0,0 +1 @@
+../../Task/Doubly-linked-list-Element-insertion/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Empty-string b/Lang/Rust/Empty-string
new file mode 120000
index 0000000000..8092a45cf8
--- /dev/null
+++ b/Lang/Rust/Empty-string
@@ -0,0 +1 @@
+../../Task/Empty-string/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Evaluate-binomial-coefficients b/Lang/Rust/Evaluate-binomial-coefficients
new file mode 120000
index 0000000000..82d997bdf7
--- /dev/null
+++ b/Lang/Rust/Evaluate-binomial-coefficients
@@ -0,0 +1 @@
+../../Task/Evaluate-binomial-coefficients/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Execute-HQ9+ b/Lang/Rust/Execute-HQ9+
new file mode 120000
index 0000000000..b5046049c0
--- /dev/null
+++ b/Lang/Rust/Execute-HQ9+
@@ -0,0 +1 @@
+../../Task/Execute-HQ9+/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Factors-of-an-integer b/Lang/Rust/Factors-of-an-integer
new file mode 120000
index 0000000000..69460bf2f8
--- /dev/null
+++ b/Lang/Rust/Factors-of-an-integer
@@ -0,0 +1 @@
+../../Task/Factors-of-an-integer/Rust
\ No newline at end of file
diff --git a/Lang/Rust/First-class-functions b/Lang/Rust/First-class-functions
new file mode 120000
index 0000000000..49e62bed76
--- /dev/null
+++ b/Lang/Rust/First-class-functions
@@ -0,0 +1 @@
+../../Task/First-class-functions/Rust
\ No newline at end of file
diff --git a/Lang/Rust/First-class-functions-Use-numbers-analogously b/Lang/Rust/First-class-functions-Use-numbers-analogously
new file mode 120000
index 0000000000..268e10e636
--- /dev/null
+++ b/Lang/Rust/First-class-functions-Use-numbers-analogously
@@ -0,0 +1 @@
+../../Task/First-class-functions-Use-numbers-analogously/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Forest-fire b/Lang/Rust/Forest-fire
new file mode 120000
index 0000000000..405cb3914b
--- /dev/null
+++ b/Lang/Rust/Forest-fire
@@ -0,0 +1 @@
+../../Task/Forest-fire/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Formatted-numeric-output b/Lang/Rust/Formatted-numeric-output
new file mode 120000
index 0000000000..3910e9e512
--- /dev/null
+++ b/Lang/Rust/Formatted-numeric-output
@@ -0,0 +1 @@
+../../Task/Formatted-numeric-output/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Generate-Chess960-starting-position b/Lang/Rust/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..dffd9f20d8
--- /dev/null
+++ b/Lang/Rust/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Generate-lower-case-ASCII-alphabet b/Lang/Rust/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..7dc50bf2cf
--- /dev/null
+++ b/Lang/Rust/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Hamming-numbers b/Lang/Rust/Hamming-numbers
new file mode 120000
index 0000000000..2b5ee83cac
--- /dev/null
+++ b/Lang/Rust/Hamming-numbers
@@ -0,0 +1 @@
+../../Task/Hamming-numbers/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Haversine-formula b/Lang/Rust/Haversine-formula
new file mode 120000
index 0000000000..3251996b0d
--- /dev/null
+++ b/Lang/Rust/Haversine-formula
@@ -0,0 +1 @@
+../../Task/Haversine-formula/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Hello-world-Graphical b/Lang/Rust/Hello-world-Graphical
new file mode 120000
index 0000000000..6bed3e5541
--- /dev/null
+++ b/Lang/Rust/Hello-world-Graphical
@@ -0,0 +1 @@
+../../Task/Hello-world-Graphical/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Hello-world-Line-printer b/Lang/Rust/Hello-world-Line-printer
new file mode 120000
index 0000000000..019789cb35
--- /dev/null
+++ b/Lang/Rust/Hello-world-Line-printer
@@ -0,0 +1 @@
+../../Task/Hello-world-Line-printer/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Integer-overflow b/Lang/Rust/Integer-overflow
new file mode 120000
index 0000000000..8e3b85c4ab
--- /dev/null
+++ b/Lang/Rust/Integer-overflow
@@ -0,0 +1 @@
+../../Task/Integer-overflow/Rust
\ No newline at end of file
diff --git a/Lang/Rust/K-means++-clustering b/Lang/Rust/K-means++-clustering
new file mode 120000
index 0000000000..1171292d4e
--- /dev/null
+++ b/Lang/Rust/K-means++-clustering
@@ -0,0 +1 @@
+../../Task/K-means++-clustering/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Keyboard-input-Obtain-a-Y-or-N-response b/Lang/Rust/Keyboard-input-Obtain-a-Y-or-N-response
new file mode 120000
index 0000000000..65a9e2cd48
--- /dev/null
+++ b/Lang/Rust/Keyboard-input-Obtain-a-Y-or-N-response
@@ -0,0 +1 @@
+../../Task/Keyboard-input-Obtain-a-Y-or-N-response/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Left-factorials b/Lang/Rust/Left-factorials
new file mode 120000
index 0000000000..eaaa507010
--- /dev/null
+++ b/Lang/Rust/Left-factorials
@@ -0,0 +1 @@
+../../Task/Left-factorials/Rust
\ No newline at end of file
diff --git a/Lang/Rust/MD4 b/Lang/Rust/MD4
new file mode 120000
index 0000000000..736667f43e
--- /dev/null
+++ b/Lang/Rust/MD4
@@ -0,0 +1 @@
+../../Task/MD4/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Map-range b/Lang/Rust/Map-range
new file mode 120000
index 0000000000..91624c7dc3
--- /dev/null
+++ b/Lang/Rust/Map-range
@@ -0,0 +1 @@
+../../Task/Map-range/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Metaprogramming b/Lang/Rust/Metaprogramming
new file mode 120000
index 0000000000..aa47654d83
--- /dev/null
+++ b/Lang/Rust/Metaprogramming
@@ -0,0 +1 @@
+../../Task/Metaprogramming/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Modular-inverse b/Lang/Rust/Modular-inverse
new file mode 120000
index 0000000000..9143b5956f
--- /dev/null
+++ b/Lang/Rust/Modular-inverse
@@ -0,0 +1 @@
+../../Task/Modular-inverse/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Multiplication-tables b/Lang/Rust/Multiplication-tables
new file mode 120000
index 0000000000..c65a218b58
--- /dev/null
+++ b/Lang/Rust/Multiplication-tables
@@ -0,0 +1 @@
+../../Task/Multiplication-tables/Rust
\ No newline at end of file
diff --git a/Lang/Rust/One-of-n-lines-in-a-file b/Lang/Rust/One-of-n-lines-in-a-file
new file mode 120000
index 0000000000..bd215f7264
--- /dev/null
+++ b/Lang/Rust/One-of-n-lines-in-a-file
@@ -0,0 +1 @@
+../../Task/One-of-n-lines-in-a-file/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Palindrome-detection b/Lang/Rust/Palindrome-detection
new file mode 120000
index 0000000000..be0f3a6d5b
--- /dev/null
+++ b/Lang/Rust/Palindrome-detection
@@ -0,0 +1 @@
+../../Task/Palindrome-detection/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Pangram-checker b/Lang/Rust/Pangram-checker
new file mode 120000
index 0000000000..a7a0906a21
--- /dev/null
+++ b/Lang/Rust/Pangram-checker
@@ -0,0 +1 @@
+../../Task/Pangram-checker/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Priority-queue b/Lang/Rust/Priority-queue
new file mode 120000
index 0000000000..22a699cbea
--- /dev/null
+++ b/Lang/Rust/Priority-queue
@@ -0,0 +1 @@
+../../Task/Priority-queue/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Program-termination b/Lang/Rust/Program-termination
new file mode 120000
index 0000000000..819dbbaa3a
--- /dev/null
+++ b/Lang/Rust/Program-termination
@@ -0,0 +1 @@
+../../Task/Program-termination/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Queue-Definition b/Lang/Rust/Queue-Definition
new file mode 120000
index 0000000000..a634af8412
--- /dev/null
+++ b/Lang/Rust/Queue-Definition
@@ -0,0 +1 @@
+../../Task/Queue-Definition/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Random-number-generator--device- b/Lang/Rust/Random-number-generator--device-
new file mode 120000
index 0000000000..9164fade94
--- /dev/null
+++ b/Lang/Rust/Random-number-generator--device-
@@ -0,0 +1 @@
+../../Task/Random-number-generator--device-/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Range-extraction b/Lang/Rust/Range-extraction
new file mode 120000
index 0000000000..9e4723de57
--- /dev/null
+++ b/Lang/Rust/Range-extraction
@@ -0,0 +1 @@
+../../Task/Range-extraction/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Real-constants-and-functions b/Lang/Rust/Real-constants-and-functions
new file mode 120000
index 0000000000..a696cd1364
--- /dev/null
+++ b/Lang/Rust/Real-constants-and-functions
@@ -0,0 +1 @@
+../../Task/Real-constants-and-functions/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Remove-duplicate-elements b/Lang/Rust/Remove-duplicate-elements
new file mode 120000
index 0000000000..26fd501ce4
--- /dev/null
+++ b/Lang/Rust/Remove-duplicate-elements
@@ -0,0 +1 @@
+../../Task/Remove-duplicate-elements/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Rename-a-file b/Lang/Rust/Rename-a-file
new file mode 120000
index 0000000000..e0813f27aa
--- /dev/null
+++ b/Lang/Rust/Rename-a-file
@@ -0,0 +1 @@
+../../Task/Rename-a-file/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Shell-one-liner b/Lang/Rust/Shell-one-liner
new file mode 120000
index 0000000000..1028749a75
--- /dev/null
+++ b/Lang/Rust/Shell-one-liner
@@ -0,0 +1 @@
+../../Task/Shell-one-liner/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Singly-linked-list-Element-insertion b/Lang/Rust/Singly-linked-list-Element-insertion
new file mode 120000
index 0000000000..e02bdb28ab
--- /dev/null
+++ b/Lang/Rust/Singly-linked-list-Element-insertion
@@ -0,0 +1 @@
+../../Task/Singly-linked-list-Element-insertion/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Singly-linked-list-Traversal b/Lang/Rust/Singly-linked-list-Traversal
new file mode 120000
index 0000000000..0148d6b57d
--- /dev/null
+++ b/Lang/Rust/Singly-linked-list-Traversal
@@ -0,0 +1 @@
+../../Task/Singly-linked-list-Traversal/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Sorting-algorithms-Bogosort b/Lang/Rust/Sorting-algorithms-Bogosort
new file mode 120000
index 0000000000..395812046d
--- /dev/null
+++ b/Lang/Rust/Sorting-algorithms-Bogosort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Bogosort/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Sorting-algorithms-Merge-sort b/Lang/Rust/Sorting-algorithms-Merge-sort
new file mode 120000
index 0000000000..52e214045f
--- /dev/null
+++ b/Lang/Rust/Sorting-algorithms-Merge-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Merge-sort/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Sorting-algorithms-Stooge-sort b/Lang/Rust/Sorting-algorithms-Stooge-sort
new file mode 120000
index 0000000000..018d873ed9
--- /dev/null
+++ b/Lang/Rust/Sorting-algorithms-Stooge-sort
@@ -0,0 +1 @@
+../../Task/Sorting-algorithms-Stooge-sort/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Stack b/Lang/Rust/Stack
new file mode 120000
index 0000000000..6960a5cd8c
--- /dev/null
+++ b/Lang/Rust/Stack
@@ -0,0 +1 @@
+../../Task/Stack/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Statistics-Basic b/Lang/Rust/Statistics-Basic
new file mode 120000
index 0000000000..1b1550c191
--- /dev/null
+++ b/Lang/Rust/Statistics-Basic
@@ -0,0 +1 @@
+../../Task/Statistics-Basic/Rust
\ No newline at end of file
diff --git a/Lang/Rust/String-interpolation--included- b/Lang/Rust/String-interpolation--included-
new file mode 120000
index 0000000000..0249b79584
--- /dev/null
+++ b/Lang/Rust/String-interpolation--included-
@@ -0,0 +1 @@
+../../Task/String-interpolation--included-/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Tokenize-a-string b/Lang/Rust/Tokenize-a-string
new file mode 120000
index 0000000000..88cacbd535
--- /dev/null
+++ b/Lang/Rust/Tokenize-a-string
@@ -0,0 +1 @@
+../../Task/Tokenize-a-string/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Tree-traversal b/Lang/Rust/Tree-traversal
new file mode 120000
index 0000000000..da2152a3b2
--- /dev/null
+++ b/Lang/Rust/Tree-traversal
@@ -0,0 +1 @@
+../../Task/Tree-traversal/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Ulam-spiral--for-primes- b/Lang/Rust/Ulam-spiral--for-primes-
new file mode 120000
index 0000000000..5d62adbd1b
--- /dev/null
+++ b/Lang/Rust/Ulam-spiral--for-primes-
@@ -0,0 +1 @@
+../../Task/Ulam-spiral--for-primes-/Rust
\ No newline at end of file
diff --git a/Lang/Rust/User-input-Text b/Lang/Rust/User-input-Text
new file mode 120000
index 0000000000..2ef272b728
--- /dev/null
+++ b/Lang/Rust/User-input-Text
@@ -0,0 +1 @@
+../../Task/User-input-Text/Rust
\ No newline at end of file
diff --git a/Lang/Rust/Visualize-a-tree b/Lang/Rust/Visualize-a-tree
new file mode 120000
index 0000000000..9ed7f54906
--- /dev/null
+++ b/Lang/Rust/Visualize-a-tree
@@ -0,0 +1 @@
+../../Task/Visualize-a-tree/Rust
\ No newline at end of file
diff --git a/Lang/S-lang/00DESCRIPTION b/Lang/S-lang/00DESCRIPTION
index 5da579aa67..4cda00e997 100644
--- a/Lang/S-lang/00DESCRIPTION
+++ b/Lang/S-lang/00DESCRIPTION
@@ -9,5 +9,42 @@ Unlike many interpreters, the S-Lang interpreter supports all of the native C in
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]])
+
+Task Output Notes:
+
+For simplicity, many of the S-Lang tasks use the print()
+function. This is not part of S-Lang per se, but is normally
+included in the S-Lang shell "slsh". If it is missing, or you're
+using some other S-Lang environment, options include C-like fputs(),
+sprintf() and printf(). Their format and parameters work about
+like you'd expect in a C-inspired interpreted language.
+
+sprintf(f, d..) [f=string format, d..=zero or more data items]
+returns a string. printf(f, d..) prints to "stdout" and returns
+the number of items formatted. fputs(s, fp) prints string s to the
+file-pointer fp and returns the string length or -1 on error. Remember S-Lang is a "stack
+language", so even if you don't care about the return value, your code
+should "eat" it:
+
+ () = printf("S-Lang: %d tasks and counting!\n", 23);
+
+ () = fputs("the quality of mercy is not strnen\n", stdout);
+You can approximate print() with the following; NOTE the capital-S, which implicitly calls
+the string() function to convert-or-describe non-strings as strings:
+
+ define print(foo) { () = printf("%S\n", foo); }
+S-Lang is the extension language for the lightweight Emacs-like
+[http://www.jedsoft.org/jed/ programmer's editor Jed]. There, the
+output functions include:
+
+ insert(s) write string s into current buffer
+ vinsert(f,d..) insert(sprintf(f, d..)) ["variable"] equivalent
+
+ message(s) write string s into "mini-buffer"
+ vmessage(f,d..) message(sprintf(f, d..)) equivalent
+
+ error(s) like message(), but in error-color, then cancel cmd
+ verror(f, d..) error(sprintf(f, d..)) equivalent
+
== See Also ==
[[wp:S-Lang_(programming_language)|Wikipedia:S-Lang(programming language)]]
\ No newline at end of file
diff --git a/Lang/S-lang/Array-concatenation b/Lang/S-lang/Array-concatenation
new file mode 120000
index 0000000000..995f6e3f1b
--- /dev/null
+++ b/Lang/S-lang/Array-concatenation
@@ -0,0 +1 @@
+../../Task/Array-concatenation/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Averages-Mode b/Lang/S-lang/Averages-Mode
new file mode 120000
index 0000000000..e67ba38c92
--- /dev/null
+++ b/Lang/S-lang/Averages-Mode
@@ -0,0 +1 @@
+../../Task/Averages-Mode/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Averages-Root-mean-square b/Lang/S-lang/Averages-Root-mean-square
new file mode 120000
index 0000000000..e1091cd062
--- /dev/null
+++ b/Lang/S-lang/Averages-Root-mean-square
@@ -0,0 +1 @@
+../../Task/Averages-Root-mean-square/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Binary-digits b/Lang/S-lang/Binary-digits
new file mode 120000
index 0000000000..e95a0412c0
--- /dev/null
+++ b/Lang/S-lang/Binary-digits
@@ -0,0 +1 @@
+../../Task/Binary-digits/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Dot-product b/Lang/S-lang/Dot-product
new file mode 120000
index 0000000000..cb07956bae
--- /dev/null
+++ b/Lang/S-lang/Dot-product
@@ -0,0 +1 @@
+../../Task/Dot-product/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Generate-lower-case-ASCII-alphabet b/Lang/S-lang/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..fc17f853fa
--- /dev/null
+++ b/Lang/S-lang/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Greatest-element-of-a-list b/Lang/S-lang/Greatest-element-of-a-list
new file mode 120000
index 0000000000..26884eaeaf
--- /dev/null
+++ b/Lang/S-lang/Greatest-element-of-a-list
@@ -0,0 +1 @@
+../../Task/Greatest-element-of-a-list/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Hailstone-sequence b/Lang/S-lang/Hailstone-sequence
new file mode 120000
index 0000000000..df3622c754
--- /dev/null
+++ b/Lang/S-lang/Hailstone-sequence
@@ -0,0 +1 @@
+../../Task/Hailstone-sequence/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Hello-world-Standard-error b/Lang/S-lang/Hello-world-Standard-error
new file mode 120000
index 0000000000..2c95318886
--- /dev/null
+++ b/Lang/S-lang/Hello-world-Standard-error
@@ -0,0 +1 @@
+../../Task/Hello-world-Standard-error/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Interactive-programming b/Lang/S-lang/Interactive-programming
new file mode 120000
index 0000000000..c89a770bfa
--- /dev/null
+++ b/Lang/S-lang/Interactive-programming
@@ -0,0 +1 @@
+../../Task/Interactive-programming/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Loops-Infinite b/Lang/S-lang/Loops-Infinite
new file mode 120000
index 0000000000..46572a11c8
--- /dev/null
+++ b/Lang/S-lang/Loops-Infinite
@@ -0,0 +1 @@
+../../Task/Loops-Infinite/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Loops-N-plus-one-half b/Lang/S-lang/Loops-N-plus-one-half
new file mode 120000
index 0000000000..c15bf6ad3c
--- /dev/null
+++ b/Lang/S-lang/Loops-N-plus-one-half
@@ -0,0 +1 @@
+../../Task/Loops-N-plus-one-half/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/MD5 b/Lang/S-lang/MD5
new file mode 120000
index 0000000000..c72c88fa97
--- /dev/null
+++ b/Lang/S-lang/MD5
@@ -0,0 +1 @@
+../../Task/MD5/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Mutual-recursion b/Lang/S-lang/Mutual-recursion
new file mode 120000
index 0000000000..a2d2d29e7c
--- /dev/null
+++ b/Lang/S-lang/Mutual-recursion
@@ -0,0 +1 @@
+../../Task/Mutual-recursion/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Range-expansion b/Lang/S-lang/Range-expansion
new file mode 120000
index 0000000000..d85d0de1fc
--- /dev/null
+++ b/Lang/S-lang/Range-expansion
@@ -0,0 +1 @@
+../../Task/Range-expansion/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Reverse-a-string b/Lang/S-lang/Reverse-a-string
new file mode 120000
index 0000000000..6424749086
--- /dev/null
+++ b/Lang/S-lang/Reverse-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-a-string/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Reverse-words-in-a-string b/Lang/S-lang/Reverse-words-in-a-string
new file mode 120000
index 0000000000..eb0c3ca313
--- /dev/null
+++ b/Lang/S-lang/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Rot-13 b/Lang/S-lang/Rot-13
new file mode 120000
index 0000000000..a7f8199f9f
--- /dev/null
+++ b/Lang/S-lang/Rot-13
@@ -0,0 +1 @@
+../../Task/Rot-13/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/SHA-1 b/Lang/S-lang/SHA-1
new file mode 120000
index 0000000000..55519ec93f
--- /dev/null
+++ b/Lang/S-lang/SHA-1
@@ -0,0 +1 @@
+../../Task/SHA-1/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Shell-one-liner b/Lang/S-lang/Shell-one-liner
new file mode 120000
index 0000000000..4dcb0b0142
--- /dev/null
+++ b/Lang/S-lang/Shell-one-liner
@@ -0,0 +1 @@
+../../Task/Shell-one-liner/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Sum-and-product-of-an-array b/Lang/S-lang/Sum-and-product-of-an-array
new file mode 120000
index 0000000000..a588294aa2
--- /dev/null
+++ b/Lang/S-lang/Sum-and-product-of-an-array
@@ -0,0 +1 @@
+../../Task/Sum-and-product-of-an-array/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Tokenize-a-string b/Lang/S-lang/Tokenize-a-string
new file mode 120000
index 0000000000..9b41c31d43
--- /dev/null
+++ b/Lang/S-lang/Tokenize-a-string
@@ -0,0 +1 @@
+../../Task/Tokenize-a-string/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Unix-ls b/Lang/S-lang/Unix-ls
new file mode 120000
index 0000000000..2fed8926cc
--- /dev/null
+++ b/Lang/S-lang/Unix-ls
@@ -0,0 +1 @@
+../../Task/Unix-ls/S-lang
\ No newline at end of file
diff --git a/Lang/S-lang/Zero-to-the-zero-power b/Lang/S-lang/Zero-to-the-zero-power
new file mode 120000
index 0000000000..c8ae2c9290
--- /dev/null
+++ b/Lang/S-lang/Zero-to-the-zero-power
@@ -0,0 +1 @@
+../../Task/Zero-to-the-zero-power/S-lang
\ No newline at end of file
diff --git a/Lang/SAS/CSV-data-manipulation b/Lang/SAS/CSV-data-manipulation
new file mode 120000
index 0000000000..4630452a4d
--- /dev/null
+++ b/Lang/SAS/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/SAS
\ No newline at end of file
diff --git a/Lang/SAS/Count-the-coins b/Lang/SAS/Count-the-coins
new file mode 120000
index 0000000000..05f3ae3707
--- /dev/null
+++ b/Lang/SAS/Count-the-coins
@@ -0,0 +1 @@
+../../Task/Count-the-coins/SAS
\ No newline at end of file
diff --git a/Lang/SAS/FizzBuzz b/Lang/SAS/FizzBuzz
new file mode 120000
index 0000000000..1dfe5f6af1
--- /dev/null
+++ b/Lang/SAS/FizzBuzz
@@ -0,0 +1 @@
+../../Task/FizzBuzz/SAS
\ No newline at end of file
diff --git a/Lang/SAS/Knapsack-problem-0-1 b/Lang/SAS/Knapsack-problem-0-1
new file mode 120000
index 0000000000..fbea490d2c
--- /dev/null
+++ b/Lang/SAS/Knapsack-problem-0-1
@@ -0,0 +1 @@
+../../Task/Knapsack-problem-0-1/SAS
\ No newline at end of file
diff --git a/Lang/SAS/Knapsack-problem-Bounded b/Lang/SAS/Knapsack-problem-Bounded
new file mode 120000
index 0000000000..182928b5f4
--- /dev/null
+++ b/Lang/SAS/Knapsack-problem-Bounded
@@ -0,0 +1 @@
+../../Task/Knapsack-problem-Bounded/SAS
\ No newline at end of file
diff --git a/Lang/SAS/Knapsack-problem-Continuous b/Lang/SAS/Knapsack-problem-Continuous
new file mode 120000
index 0000000000..1c9c488009
--- /dev/null
+++ b/Lang/SAS/Knapsack-problem-Continuous
@@ -0,0 +1 @@
+../../Task/Knapsack-problem-Continuous/SAS
\ No newline at end of file
diff --git a/Lang/SAS/Sudoku b/Lang/SAS/Sudoku
new file mode 120000
index 0000000000..5280fc3d1f
--- /dev/null
+++ b/Lang/SAS/Sudoku
@@ -0,0 +1 @@
+../../Task/Sudoku/SAS
\ No newline at end of file
diff --git a/Lang/SETL/Associative-array-Creation b/Lang/SETL/Associative-array-Creation
new file mode 120000
index 0000000000..1328ee4720
--- /dev/null
+++ b/Lang/SETL/Associative-array-Creation
@@ -0,0 +1 @@
+../../Task/Associative-array-Creation/SETL
\ No newline at end of file
diff --git a/Lang/SETL/Case-sensitivity-of-identifiers b/Lang/SETL/Case-sensitivity-of-identifiers
new file mode 120000
index 0000000000..2eb94141b4
--- /dev/null
+++ b/Lang/SETL/Case-sensitivity-of-identifiers
@@ -0,0 +1 @@
+../../Task/Case-sensitivity-of-identifiers/SETL
\ No newline at end of file
diff --git a/Lang/SETL/Even-or-odd b/Lang/SETL/Even-or-odd
new file mode 120000
index 0000000000..0d867b4dca
--- /dev/null
+++ b/Lang/SETL/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/SETL
\ No newline at end of file
diff --git a/Lang/SETL/Function-definition b/Lang/SETL/Function-definition
new file mode 120000
index 0000000000..ea95d1a59a
--- /dev/null
+++ b/Lang/SETL/Function-definition
@@ -0,0 +1 @@
+../../Task/Function-definition/SETL
\ No newline at end of file
diff --git a/Lang/SETL/Hello-world-Newline-omission b/Lang/SETL/Hello-world-Newline-omission
new file mode 120000
index 0000000000..cf2b6bd886
--- /dev/null
+++ b/Lang/SETL/Hello-world-Newline-omission
@@ -0,0 +1 @@
+../../Task/Hello-world-Newline-omission/SETL
\ No newline at end of file
diff --git a/Lang/SETL/Loops-For b/Lang/SETL/Loops-For
new file mode 120000
index 0000000000..032c670e13
--- /dev/null
+++ b/Lang/SETL/Loops-For
@@ -0,0 +1 @@
+../../Task/Loops-For/SETL
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Arrays b/Lang/SNOBOL4/Arrays
new file mode 120000
index 0000000000..a835e180a5
--- /dev/null
+++ b/Lang/SNOBOL4/Arrays
@@ -0,0 +1 @@
+../../Task/Arrays/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Case-sensitivity-of-identifiers b/Lang/SNOBOL4/Case-sensitivity-of-identifiers
new file mode 120000
index 0000000000..bc78e5a326
--- /dev/null
+++ b/Lang/SNOBOL4/Case-sensitivity-of-identifiers
@@ -0,0 +1 @@
+../../Task/Case-sensitivity-of-identifiers/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Empty-string b/Lang/SNOBOL4/Empty-string
new file mode 120000
index 0000000000..2f108662fc
--- /dev/null
+++ b/Lang/SNOBOL4/Empty-string
@@ -0,0 +1 @@
+../../Task/Empty-string/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Even-or-odd b/Lang/SNOBOL4/Even-or-odd
new file mode 120000
index 0000000000..d9c92c476a
--- /dev/null
+++ b/Lang/SNOBOL4/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/IBAN b/Lang/SNOBOL4/IBAN
new file mode 120000
index 0000000000..1d1b2e5d33
--- /dev/null
+++ b/Lang/SNOBOL4/IBAN
@@ -0,0 +1 @@
+../../Task/IBAN/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Include-a-file b/Lang/SNOBOL4/Include-a-file
new file mode 120000
index 0000000000..134d035963
--- /dev/null
+++ b/Lang/SNOBOL4/Include-a-file
@@ -0,0 +1 @@
+../../Task/Include-a-file/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Loops-Downward-for b/Lang/SNOBOL4/Loops-Downward-for
new file mode 120000
index 0000000000..ae9faee828
--- /dev/null
+++ b/Lang/SNOBOL4/Loops-Downward-for
@@ -0,0 +1 @@
+../../Task/Loops-Downward-for/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/String-append b/Lang/SNOBOL4/String-append
new file mode 120000
index 0000000000..360fa9c29d
--- /dev/null
+++ b/Lang/SNOBOL4/String-append
@@ -0,0 +1 @@
+../../Task/String-append/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/String-comparison b/Lang/SNOBOL4/String-comparison
new file mode 120000
index 0000000000..5f4c2079a6
--- /dev/null
+++ b/Lang/SNOBOL4/String-comparison
@@ -0,0 +1 @@
+../../Task/String-comparison/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/String-matching b/Lang/SNOBOL4/String-matching
new file mode 120000
index 0000000000..c57a48e434
--- /dev/null
+++ b/Lang/SNOBOL4/String-matching
@@ -0,0 +1 @@
+../../Task/String-matching/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/String-prepend b/Lang/SNOBOL4/String-prepend
new file mode 120000
index 0000000000..97424ec30e
--- /dev/null
+++ b/Lang/SNOBOL4/String-prepend
@@ -0,0 +1 @@
+../../Task/String-prepend/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Strip-a-set-of-characters-from-a-string b/Lang/SNOBOL4/Strip-a-set-of-characters-from-a-string
new file mode 120000
index 0000000000..a07913bc76
--- /dev/null
+++ b/Lang/SNOBOL4/Strip-a-set-of-characters-from-a-string
@@ -0,0 +1 @@
+../../Task/Strip-a-set-of-characters-from-a-string/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SNOBOL4/Strip-whitespace-from-a-string-Top-and-tail b/Lang/SNOBOL4/Strip-whitespace-from-a-string-Top-and-tail
new file mode 120000
index 0000000000..1012aa8eb0
--- /dev/null
+++ b/Lang/SNOBOL4/Strip-whitespace-from-a-string-Top-and-tail
@@ -0,0 +1 @@
+../../Task/Strip-whitespace-from-a-string-Top-and-tail/SNOBOL4
\ No newline at end of file
diff --git a/Lang/SPARK/00DESCRIPTION b/Lang/SPARK/00DESCRIPTION
index 3dd36e5585..7d49d710a7 100644
--- a/Lang/SPARK/00DESCRIPTION
+++ b/Lang/SPARK/00DESCRIPTION
@@ -23,7 +23,7 @@ The properties that SPARK code can be analysed for are:
*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.
+In older versions, the annotations always began, on each line, with the Ada comment symbol “--”, so all SPARK programs comply with the [[Ada]] standard. Newer versions, starting with SPARK 2014, use the aspect syntax known from Ada 2012.
A SPARK program can be compiled by any [[Ada]] compiler or processed by any other [[Ada]] tool.
@@ -31,6 +31,6 @@ The annotations state the required properties of a program. Different propertie
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 SPARK tools are freely available under the GNU GPL. The SPARK language definition is available from AdaCore at [http://docs.adacore.com/spark2014-docs/html/lrm/ SPARK 2014 Reference Manual].
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/SQL/Even-or-odd b/Lang/SQL/Even-or-odd
new file mode 120000
index 0000000000..47ea3b288c
--- /dev/null
+++ b/Lang/SQL/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/SQL
\ No newline at end of file
diff --git a/Lang/SQL/Nth b/Lang/SQL/Nth
new file mode 120000
index 0000000000..06fd522eff
--- /dev/null
+++ b/Lang/SQL/Nth
@@ -0,0 +1 @@
+../../Task/Nth/SQL
\ No newline at end of file
diff --git a/Lang/SQL/Number-names b/Lang/SQL/Number-names
new file mode 120000
index 0000000000..00676da142
--- /dev/null
+++ b/Lang/SQL/Number-names
@@ -0,0 +1 @@
+../../Task/Number-names/SQL
\ No newline at end of file
diff --git a/Lang/SQL/Write-language-name-in-3D-ASCII b/Lang/SQL/Write-language-name-in-3D-ASCII
new file mode 120000
index 0000000000..9afc52872e
--- /dev/null
+++ b/Lang/SQL/Write-language-name-in-3D-ASCII
@@ -0,0 +1 @@
+../../Task/Write-language-name-in-3D-ASCII/SQL
\ No newline at end of file
diff --git a/Lang/Scala/Bernoulli-numbers b/Lang/Scala/Bernoulli-numbers
new file mode 120000
index 0000000000..c3767adda0
--- /dev/null
+++ b/Lang/Scala/Bernoulli-numbers
@@ -0,0 +1 @@
+../../Task/Bernoulli-numbers/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Conjugate-transpose b/Lang/Scala/Conjugate-transpose
new file mode 120000
index 0000000000..49d8e66cf1
--- /dev/null
+++ b/Lang/Scala/Conjugate-transpose
@@ -0,0 +1 @@
+../../Task/Conjugate-transpose/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Equilibrium-index b/Lang/Scala/Equilibrium-index
new file mode 120000
index 0000000000..f4c9fb3419
--- /dev/null
+++ b/Lang/Scala/Equilibrium-index
@@ -0,0 +1 @@
+../../Task/Equilibrium-index/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Generate-Chess960-starting-position b/Lang/Scala/Generate-Chess960-starting-position
new file mode 120000
index 0000000000..33429243e9
--- /dev/null
+++ b/Lang/Scala/Generate-Chess960-starting-position
@@ -0,0 +1 @@
+../../Task/Generate-Chess960-starting-position/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Hough-transform b/Lang/Scala/Hough-transform
new file mode 120000
index 0000000000..32f18ae63e
--- /dev/null
+++ b/Lang/Scala/Hough-transform
@@ -0,0 +1 @@
+../../Task/Hough-transform/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Knapsack-problem-Unbounded b/Lang/Scala/Knapsack-problem-Unbounded
new file mode 120000
index 0000000000..e42edf910d
--- /dev/null
+++ b/Lang/Scala/Knapsack-problem-Unbounded
@@ -0,0 +1 @@
+../../Task/Knapsack-problem-Unbounded/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Move-to-front-algorithm b/Lang/Scala/Move-to-front-algorithm
new file mode 120000
index 0000000000..43425fc68e
--- /dev/null
+++ b/Lang/Scala/Move-to-front-algorithm
@@ -0,0 +1 @@
+../../Task/Move-to-front-algorithm/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Multifactorial b/Lang/Scala/Multifactorial
new file mode 120000
index 0000000000..aadf067874
--- /dev/null
+++ b/Lang/Scala/Multifactorial
@@ -0,0 +1 @@
+../../Task/Multifactorial/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Numeric-error-propagation b/Lang/Scala/Numeric-error-propagation
new file mode 120000
index 0000000000..d0413ad7b3
--- /dev/null
+++ b/Lang/Scala/Numeric-error-propagation
@@ -0,0 +1 @@
+../../Task/Numeric-error-propagation/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Runge-Kutta-method b/Lang/Scala/Runge-Kutta-method
new file mode 120000
index 0000000000..e4b6a342e0
--- /dev/null
+++ b/Lang/Scala/Runge-Kutta-method
@@ -0,0 +1 @@
+../../Task/Runge-Kutta-method/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Stable-marriage-problem b/Lang/Scala/Stable-marriage-problem
new file mode 120000
index 0000000000..fb540a05d0
--- /dev/null
+++ b/Lang/Scala/Stable-marriage-problem
@@ -0,0 +1 @@
+../../Task/Stable-marriage-problem/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Stern-Brocot-sequence b/Lang/Scala/Stern-Brocot-sequence
new file mode 120000
index 0000000000..a5338ae0f5
--- /dev/null
+++ b/Lang/Scala/Stern-Brocot-sequence
@@ -0,0 +1 @@
+../../Task/Stern-Brocot-sequence/Scala
\ No newline at end of file
diff --git a/Lang/Scala/The-Twelve-Days-of-Christmas b/Lang/Scala/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..b5b0aed84c
--- /dev/null
+++ b/Lang/Scala/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Scala
\ No newline at end of file
diff --git a/Lang/Scala/Ulam-spiral--for-primes- b/Lang/Scala/Ulam-spiral--for-primes-
new file mode 120000
index 0000000000..34bccfc98c
--- /dev/null
+++ b/Lang/Scala/Ulam-spiral--for-primes-
@@ -0,0 +1 @@
+../../Task/Ulam-spiral--for-primes-/Scala
\ No newline at end of file
diff --git a/Lang/Sed/Four-bit-adder b/Lang/Sed/Four-bit-adder
new file mode 120000
index 0000000000..789a2d9c64
--- /dev/null
+++ b/Lang/Sed/Four-bit-adder
@@ -0,0 +1 @@
+../../Task/Four-bit-adder/Sed
\ No newline at end of file
diff --git a/Lang/Simula/Case-sensitivity-of-identifiers b/Lang/Simula/Case-sensitivity-of-identifiers
new file mode 120000
index 0000000000..e9bc211519
--- /dev/null
+++ b/Lang/Simula/Case-sensitivity-of-identifiers
@@ -0,0 +1 @@
+../../Task/Case-sensitivity-of-identifiers/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Classes b/Lang/Simula/Classes
new file mode 120000
index 0000000000..09427ddbb9
--- /dev/null
+++ b/Lang/Simula/Classes
@@ -0,0 +1 @@
+../../Task/Classes/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Factorial b/Lang/Simula/Factorial
new file mode 120000
index 0000000000..f7648fea5c
--- /dev/null
+++ b/Lang/Simula/Factorial
@@ -0,0 +1 @@
+../../Task/Factorial/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Fibonacci-sequence b/Lang/Simula/Fibonacci-sequence
new file mode 120000
index 0000000000..17803bda53
--- /dev/null
+++ b/Lang/Simula/Fibonacci-sequence
@@ -0,0 +1 @@
+../../Task/Fibonacci-sequence/Simula
\ No newline at end of file
diff --git a/Lang/Simula/FizzBuzz b/Lang/Simula/FizzBuzz
new file mode 120000
index 0000000000..0310a1d029
--- /dev/null
+++ b/Lang/Simula/FizzBuzz
@@ -0,0 +1 @@
+../../Task/FizzBuzz/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Function-definition b/Lang/Simula/Function-definition
new file mode 120000
index 0000000000..cf592d9f2e
--- /dev/null
+++ b/Lang/Simula/Function-definition
@@ -0,0 +1 @@
+../../Task/Function-definition/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Inheritance-Single b/Lang/Simula/Inheritance-Single
new file mode 120000
index 0000000000..56204c9fa8
--- /dev/null
+++ b/Lang/Simula/Inheritance-Single
@@ -0,0 +1 @@
+../../Task/Inheritance-Single/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Loops-Downward-for b/Lang/Simula/Loops-Downward-for
new file mode 120000
index 0000000000..bd6a2eb05b
--- /dev/null
+++ b/Lang/Simula/Loops-Downward-for
@@ -0,0 +1 @@
+../../Task/Loops-Downward-for/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Loops-For-with-a-specified-step b/Lang/Simula/Loops-For-with-a-specified-step
new file mode 120000
index 0000000000..94d6ee1c9d
--- /dev/null
+++ b/Lang/Simula/Loops-For-with-a-specified-step
@@ -0,0 +1 @@
+../../Task/Loops-For-with-a-specified-step/Simula
\ No newline at end of file
diff --git a/Lang/Simula/Multiplication-tables b/Lang/Simula/Multiplication-tables
new file mode 120000
index 0000000000..7c4c2e6448
--- /dev/null
+++ b/Lang/Simula/Multiplication-tables
@@ -0,0 +1 @@
+../../Task/Multiplication-tables/Simula
\ No newline at end of file
diff --git a/Lang/Simula/The-Twelve-Days-of-Christmas b/Lang/Simula/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..189f9e74bb
--- /dev/null
+++ b/Lang/Simula/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Simula
\ No newline at end of file
diff --git a/Lang/Smalltalk/Find-the-last-Sunday-of-each-month b/Lang/Smalltalk/Find-the-last-Sunday-of-each-month
new file mode 120000
index 0000000000..66b42e4866
--- /dev/null
+++ b/Lang/Smalltalk/Find-the-last-Sunday-of-each-month
@@ -0,0 +1 @@
+../../Task/Find-the-last-Sunday-of-each-month/Smalltalk
\ No newline at end of file
diff --git a/Lang/Smalltalk/Generate-lower-case-ASCII-alphabet b/Lang/Smalltalk/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..ab41e0fc0f
--- /dev/null
+++ b/Lang/Smalltalk/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/Smalltalk
\ No newline at end of file
diff --git a/Lang/Smalltalk/Last-Friday-of-each-month b/Lang/Smalltalk/Last-Friday-of-each-month
new file mode 120000
index 0000000000..6074683df0
--- /dev/null
+++ b/Lang/Smalltalk/Last-Friday-of-each-month
@@ -0,0 +1 @@
+../../Task/Last-Friday-of-each-month/Smalltalk
\ No newline at end of file
diff --git a/Lang/Smalltalk/Substring-Top-and-tail b/Lang/Smalltalk/Substring-Top-and-tail
new file mode 120000
index 0000000000..236c6315b2
--- /dev/null
+++ b/Lang/Smalltalk/Substring-Top-and-tail
@@ -0,0 +1 @@
+../../Task/Substring-Top-and-tail/Smalltalk
\ No newline at end of file
diff --git a/Lang/Smalltalk/The-Twelve-Days-of-Christmas b/Lang/Smalltalk/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..8419248ee3
--- /dev/null
+++ b/Lang/Smalltalk/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Smalltalk
\ No newline at end of file
diff --git a/Lang/Snobol/The-Twelve-Days-of-Christmas b/Lang/Snobol/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..de71d689a5
--- /dev/null
+++ b/Lang/Snobol/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/Snobol
\ No newline at end of file
diff --git a/Lang/Standard-ML/A+B b/Lang/Standard-ML/A+B
new file mode 120000
index 0000000000..ed689517c5
--- /dev/null
+++ b/Lang/Standard-ML/A+B
@@ -0,0 +1 @@
+../../Task/A+B/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Arithmetic-evaluation b/Lang/Standard-ML/Arithmetic-evaluation
new file mode 120000
index 0000000000..890e9564e3
--- /dev/null
+++ b/Lang/Standard-ML/Arithmetic-evaluation
@@ -0,0 +1 @@
+../../Task/Arithmetic-evaluation/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Averages-Root-mean-square b/Lang/Standard-ML/Averages-Root-mean-square
new file mode 120000
index 0000000000..149381293a
--- /dev/null
+++ b/Lang/Standard-ML/Averages-Root-mean-square
@@ -0,0 +1 @@
+../../Task/Averages-Root-mean-square/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Balanced-brackets b/Lang/Standard-ML/Balanced-brackets
new file mode 120000
index 0000000000..b1efc07c74
--- /dev/null
+++ b/Lang/Standard-ML/Balanced-brackets
@@ -0,0 +1 @@
+../../Task/Balanced-brackets/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Case-sensitivity-of-identifiers b/Lang/Standard-ML/Case-sensitivity-of-identifiers
new file mode 120000
index 0000000000..3e12caf0ad
--- /dev/null
+++ b/Lang/Standard-ML/Case-sensitivity-of-identifiers
@@ -0,0 +1 @@
+../../Task/Case-sensitivity-of-identifiers/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Create-an-HTML-table b/Lang/Standard-ML/Create-an-HTML-table
new file mode 120000
index 0000000000..838e24e046
--- /dev/null
+++ b/Lang/Standard-ML/Create-an-HTML-table
@@ -0,0 +1 @@
+../../Task/Create-an-HTML-table/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Empty-directory b/Lang/Standard-ML/Empty-directory
new file mode 120000
index 0000000000..6eee3d1db1
--- /dev/null
+++ b/Lang/Standard-ML/Empty-directory
@@ -0,0 +1 @@
+../../Task/Empty-directory/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Even-or-odd b/Lang/Standard-ML/Even-or-odd
new file mode 120000
index 0000000000..b9170478a9
--- /dev/null
+++ b/Lang/Standard-ML/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Flatten-a-list b/Lang/Standard-ML/Flatten-a-list
new file mode 120000
index 0000000000..44691b113e
--- /dev/null
+++ b/Lang/Standard-ML/Flatten-a-list
@@ -0,0 +1 @@
+../../Task/Flatten-a-list/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Integer-sequence b/Lang/Standard-ML/Integer-sequence
new file mode 120000
index 0000000000..19624f54f1
--- /dev/null
+++ b/Lang/Standard-ML/Integer-sequence
@@ -0,0 +1 @@
+../../Task/Integer-sequence/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Named-parameters b/Lang/Standard-ML/Named-parameters
new file mode 120000
index 0000000000..fadd0943b0
--- /dev/null
+++ b/Lang/Standard-ML/Named-parameters
@@ -0,0 +1 @@
+../../Task/Named-parameters/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Parsing-Shunting-yard-algorithm b/Lang/Standard-ML/Parsing-Shunting-yard-algorithm
new file mode 120000
index 0000000000..945b438f55
--- /dev/null
+++ b/Lang/Standard-ML/Parsing-Shunting-yard-algorithm
@@ -0,0 +1 @@
+../../Task/Parsing-Shunting-yard-algorithm/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Stack b/Lang/Standard-ML/Stack
new file mode 120000
index 0000000000..170e31cff9
--- /dev/null
+++ b/Lang/Standard-ML/Stack
@@ -0,0 +1 @@
+../../Task/Stack/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Wireworld b/Lang/Standard-ML/Wireworld
new file mode 120000
index 0000000000..77759c1c96
--- /dev/null
+++ b/Lang/Standard-ML/Wireworld
@@ -0,0 +1 @@
+../../Task/Wireworld/Standard-ML
\ No newline at end of file
diff --git a/Lang/Standard-ML/Zebra-puzzle b/Lang/Standard-ML/Zebra-puzzle
new file mode 120000
index 0000000000..e099de5fd3
--- /dev/null
+++ b/Lang/Standard-ML/Zebra-puzzle
@@ -0,0 +1 @@
+../../Task/Zebra-puzzle/Standard-ML
\ No newline at end of file
diff --git a/Lang/SuperCollider/00DESCRIPTION b/Lang/SuperCollider/00DESCRIPTION
index 2d33371297..f804a4a144 100644
--- a/Lang/SuperCollider/00DESCRIPTION
+++ b/Lang/SuperCollider/00DESCRIPTION
@@ -1,6 +1,12 @@
{{stub}}{{language
|checking=dynamic
|exec=interpreted
-|site=http://supercollider.sourceforge.net/
+|site=http://supercollider.github.io/
|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
+SuperCollider is an environment and programming language for real time audio synthesis and algorithmic composition. It provides an interpreted object-oriented language (often called sclang) which functions as a network client to a state of the art, realtime sound synthesis server. It is used by musicians, artists, and researchers working with sound.
+
+The programming language was originally devised by James McCartney and has been further developed by an interdisciplinary open source community. Its design follows a pure object-oriented design that relies on objects including functions as first-class citizens. It is dynamically typed, and has functions of both lexical and dynamic scope. SuperCollider comes with an interactive programming library for the runtime rewriting of programs, which includes programming as a performance (live coding). There are several purely functional sublanguages embedded in the system. While mostly used for sound, its structure is general purpose.
+
+
+[https://github.com/supercollider/supercollider SuperCollider at GitHub]
+[http://supercollider.github.io/ SuperCollider Homepage]
\ No newline at end of file
diff --git a/Lang/SuperCollider/100-doors b/Lang/SuperCollider/100-doors
new file mode 120000
index 0000000000..9254308083
--- /dev/null
+++ b/Lang/SuperCollider/100-doors
@@ -0,0 +1 @@
+../../Task/100-doors/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/99-Bottles-of-Beer b/Lang/SuperCollider/99-Bottles-of-Beer
new file mode 120000
index 0000000000..c3fd043f60
--- /dev/null
+++ b/Lang/SuperCollider/99-Bottles-of-Beer
@@ -0,0 +1 @@
+../../Task/99-Bottles-of-Beer/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Active-object b/Lang/SuperCollider/Active-object
new file mode 120000
index 0000000000..e0f9247510
--- /dev/null
+++ b/Lang/SuperCollider/Active-object
@@ -0,0 +1 @@
+../../Task/Active-object/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Anagrams b/Lang/SuperCollider/Anagrams
new file mode 120000
index 0000000000..cfaa505ee8
--- /dev/null
+++ b/Lang/SuperCollider/Anagrams
@@ -0,0 +1 @@
+../../Task/Anagrams/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Fibonacci-sequence b/Lang/SuperCollider/Fibonacci-sequence
new file mode 120000
index 0000000000..d47dd19491
--- /dev/null
+++ b/Lang/SuperCollider/Fibonacci-sequence
@@ -0,0 +1 @@
+../../Task/Fibonacci-sequence/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/First-class-functions b/Lang/SuperCollider/First-class-functions
new file mode 120000
index 0000000000..74393fb9d1
--- /dev/null
+++ b/Lang/SuperCollider/First-class-functions
@@ -0,0 +1 @@
+../../Task/First-class-functions/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Flatten-a-list b/Lang/SuperCollider/Flatten-a-list
new file mode 120000
index 0000000000..dd4de79bcf
--- /dev/null
+++ b/Lang/SuperCollider/Flatten-a-list
@@ -0,0 +1 @@
+../../Task/Flatten-a-list/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Function-composition b/Lang/SuperCollider/Function-composition
new file mode 120000
index 0000000000..5ced86c8dc
--- /dev/null
+++ b/Lang/SuperCollider/Function-composition
@@ -0,0 +1 @@
+../../Task/Function-composition/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Generate-lower-case-ASCII-alphabet b/Lang/SuperCollider/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..6ae0a205e7
--- /dev/null
+++ b/Lang/SuperCollider/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Generator-Exponential b/Lang/SuperCollider/Generator-Exponential
new file mode 120000
index 0000000000..4c31361996
--- /dev/null
+++ b/Lang/SuperCollider/Generator-Exponential
@@ -0,0 +1 @@
+../../Task/Generator-Exponential/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Higher-order-functions b/Lang/SuperCollider/Higher-order-functions
new file mode 120000
index 0000000000..09e530a08c
--- /dev/null
+++ b/Lang/SuperCollider/Higher-order-functions
@@ -0,0 +1 @@
+../../Task/Higher-order-functions/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Integer-sequence b/Lang/SuperCollider/Integer-sequence
new file mode 120000
index 0000000000..8e1628c959
--- /dev/null
+++ b/Lang/SuperCollider/Integer-sequence
@@ -0,0 +1 @@
+../../Task/Integer-sequence/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Maze-generation b/Lang/SuperCollider/Maze-generation
new file mode 120000
index 0000000000..a9ea0a6e13
--- /dev/null
+++ b/Lang/SuperCollider/Maze-generation
@@ -0,0 +1 @@
+../../Task/Maze-generation/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Permutations-Derangements b/Lang/SuperCollider/Permutations-Derangements
new file mode 120000
index 0000000000..035dfb3974
--- /dev/null
+++ b/Lang/SuperCollider/Permutations-Derangements
@@ -0,0 +1 @@
+../../Task/Permutations-Derangements/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Respond-to-an-unknown-method-call b/Lang/SuperCollider/Respond-to-an-unknown-method-call
new file mode 120000
index 0000000000..6dfa71e6f3
--- /dev/null
+++ b/Lang/SuperCollider/Respond-to-an-unknown-method-call
@@ -0,0 +1 @@
+../../Task/Respond-to-an-unknown-method-call/SuperCollider
\ No newline at end of file
diff --git a/Lang/SuperCollider/Semordnilap b/Lang/SuperCollider/Semordnilap
new file mode 120000
index 0000000000..ace051dba8
--- /dev/null
+++ b/Lang/SuperCollider/Semordnilap
@@ -0,0 +1 @@
+../../Task/Semordnilap/SuperCollider
\ No newline at end of file
diff --git a/Lang/TI-83-BASIC/Dot-product b/Lang/TI-83-BASIC/Dot-product
new file mode 120000
index 0000000000..29e1abb598
--- /dev/null
+++ b/Lang/TI-83-BASIC/Dot-product
@@ -0,0 +1 @@
+../../Task/Dot-product/TI-83-BASIC
\ No newline at end of file
diff --git a/Lang/TXR/00DESCRIPTION b/Lang/TXR/00DESCRIPTION
index 739386c444..a72bb54bed 100644
--- a/Lang/TXR/00DESCRIPTION
+++ b/Lang/TXR/00DESCRIPTION
@@ -1,7 +1,12 @@
{{language
|site=http://www.nongnu.org/txr/}}
+{{language programming paradigm|functional}}
+{{language programming paradigm|procedural}}
+{{language programming paradigm|object-oriented}}
+{{language programming paradigm|imperative}}
+{{language programming paradigm|declarative}}
-TXR is a new language implemented in [[C]], running on POSIX platforms such as [[Linux]], [[Mac OS X]] and on Windows via [[Cygwin]] as well as more natively thanks to [[MinGW]].
+TXR is a new language implemented in [[C]], running on POSIX platforms such as [[Linux]], [[Mac OS X]] and [[Solaris]] as well as on [[Microsoft Windows]]. It is a dynamic, high level language originally intended for "data munging" tasks in Unix-like environments, particularly tasks requiring accurate, robust text scraping from loosely structured documents.
The Rosetta Code TXR solutions can be viewed in color, and all on one page with a convenient navigation pane [http://www.nongnu.org/txr/rosetta-solutions.html here].
@@ -9,50 +14,6 @@ TXR started as a language for "reversing here-documents": evaluating a template
eval $(txr ...)
-TXR remains close to these roots: its main language is the pattern-based text extraction notation well-suited for matching large regions of
-entire text documents. That language has become powerful enough to neatly parse grammars, while the tool developed a Lisp dialect to round out the functionality and increase its power.
+TXR was internally based, from the beginning, on a data model based on Lisp and eventually exposed a Lisp dialect that came to be known as TXR Lisp. TXR Lisp at first complemented the pattern extraction language, extending its power, but eventually became distinct. Programs can be written in TXR Lisp with no traces of the TXR pattern language, or vice versa.
-=== What's with all that @ stuff? ===
-
-About the @ character: this serves as a multi-level escape in TXR. In the fundamental TXR syntax, which is literal text, this character is a signal which indicates that the object which follows is a variable or directive. Then inside a directive, the character indicates that the object which follows is a TXR Lisp expression to be evaluated as such, rather than according to the expression evaluation rules of the pattern language:
-
-
This is some literal text to be matched.
-@# this is a comment in the pattern language.
-This text matches and binds @variable.
-@(bind y ;; this is the start of a directive in the TXR pattern language
- @(> x 42) ;; this is an expression in TXR Lisp
-)
-Back to text.
-
-In TXR Lisp, the @ character has more "meta" piled on top of it: @foo denotes (sys:var foo), and @(foo ...) denotes (sys:expr foo>). In any context which needs to separate meta-variables and meta-expressions from variables and expressions, this may come in handy. It's used by the op operator for currying, for instance (op * @1 @1) returns a function of one argument which returns the square of that argument. The implementation of the operator looks for syntax like (sys:var 1) and replaces it with the arguments of the generated lambda function. The @ character also appears in quasiliteral strings, where it interpolates the values of variables and expressions as text.
-
-TXR is somewhat unusual in that the relationship between a domain-specific language (DSL) and general-purpose host language is reversed. Typically, at least in Lisp systems, DSL's are embedded into the parent language. In TXR, the "outer shell" is the domain-specific language for extracting text, and Lisp is embedded in it as "computational appliance". It doesn't take much to reach the Lisp though: a TXR source file can just consist of a single @(do ...) directive which contains nothing but TXR Lisp forms. Also, TXR Lisp evaluation is available from program invocation via the -e and -p options.
-
-The second unusual feature in TXR is that the "tokens" in the pattern matching language are essentially themselves Lisp symbols and expressions. These "tokens" are used to create a block-structured language. This is quite odd. For instance a construct might begin with a @(collect :vars (foo)). This is a Lisp expression with interior structure, but to the parser of the pattern language, it's also basically just a token, like a giant keyword. IT begins a collect clause, and is followed by some optional material which may just be literal text, and must be terminated by the @(end) directive: another token-expression entity.
-
-=== Dual Personality ===
-
-From the solutions below, it is obvious that some of them make heavy use of the pattern language and little or no TXR Lisp. Others are quite the other way around, based entirely or almost entirely on Lisp, whereas others follow strategies of mixing the approaches.
-
-=== Lisp Innovation ===
-
-Although TXR Lisp is heavily based on prior work and strongly influenced by Common Lisp (for instance, there is a real nil symbol which is a list terminator and means "false", and it's primarily Lisp-2 dialect), TXR Lisp nevertheless manages to innovate within the world of Lisp.
-
-==== Can't We All Just Get Along? ====
-
-One major innovation is the way in which TXR Lisp closes the ages-old gap between Lisp-1 and Lisp-2, and the associated religious sectarian division it has caused. TXR Lisp recognizes that there are advantages both in having separate function and variable namespaces, and in having a single namespace: and it provides support for both approaches. The idea is devilishly simple. A special operator called "dwim" (do what I mean) is provided such that (dwim forms ...) basically denotes (forms ...), but with Lisp-1 style evaluation: any of the forms which are symbols are resolved according to a flattened namespace that combines variable and function bindings (with conflicts resolved in favor of variables). TXR Lisp programmers do not use the dwim operator directly, but rather the square bracket notation [a b c ...] -> (dwim a b c). So for instance, [mapcar list '(1 2 3) '(a b c)] zips together two lists. Using round brackets, it would have to be (mapcar (fun list) '(1 2 3) '(a b c)). Moreover, if foo is a variable that holds a function of one argument, it has to be called using (call foo arg). But with the "dwim brackets", it is just [foo arg]. The "dwim brackets" also support various funcall-extensions, like indexing into arrays and slicing and so on. If h is a hash then [h "a" 42] looks up the string a in the hash and returns the value, or else returns 42 if the key is not found. If a is an array, list or string, then [a 2..3] extracts a slice. On the other hand, "dwim brackets" do not support operators: [let (a b c) ...] is not valid; or rather, it expects a variable or function let to exist, ignoring the let operator. Operators are strictly in the Lisp-2 domain, which is fine because Lisp-2 is a cleaner model with regard to operators anyway!
-
-==== Polymorphizing the Classics ====
-
-In TXR Lisp, classic Lisp operations like mapcar, cdr or append work exactly like they are supposed to, when they operate on lists. Right down to improper lists like (append 42) -> 42 and (append '(1) 2) -> (1 . 2).
-However, most of the operations have been extended to also work with strings and vectors. So for instance, (mapcar (op + 1) "abc") nicely yields the string "bcd" where 1 has been added to every character code of the original string. (car "abc") yields #\a, a character, (cdr "abc") yields "bc", and (cdr "c") yields nil (rather than the empty string!) (Almost) everything proceeds from there.
-
-==== Good Hackers Borrow; Great Ones Steal ====
-
-TXR steals ideas from libraries and languages related to Lisp. The op operator is inspired by Goo's op, and the cl-op library for Common Lisp which is also inspired by Goo's op.
-
-Array and list slices are straight out of Python, right down to the half-open ranges (not including the upper endpoint), and negative values indexing from the tail of the array. The concept is further improved upon by allowing the Lisp symbols nil and t to be used as range indexes.
-
-Slices, even empty ones, are assignable places in TXR Lisp: we can easily replace a possibly empty section of a string, lisp or vector, with a sequence that is of different length, also possibly empty: for instance, if x contains "abc" then (set [x 1..2] "foo") changes x to contain "afooc".
-
-The group-by function is a straight rip-off from Ruby.
\ No newline at end of file
+TXR Lisp is an original dialect that contains many innovative features, which orchestrate together to express neat, compact solutions to everyday data processing problems. Programmers familiar with Common Lisp will be comfortable with TXR Lisp, and there is much to like for those who use Scheme, Racket or Clojure. TXR Lisp incorporates ideas from contemporary scripting languages also; a key motivation in many of its developments is the promotion of succinctness, which is something that often isn't associated with languages in the Lisp family.
\ No newline at end of file
diff --git a/Lang/TXR/Currying b/Lang/TXR/Currying
new file mode 120000
index 0000000000..632d792137
--- /dev/null
+++ b/Lang/TXR/Currying
@@ -0,0 +1 @@
+../../Task/Currying/TXR
\ No newline at end of file
diff --git a/Lang/TXR/Generic-swap b/Lang/TXR/Generic-swap
new file mode 120000
index 0000000000..f9e8b3ee99
--- /dev/null
+++ b/Lang/TXR/Generic-swap
@@ -0,0 +1 @@
+../../Task/Generic-swap/TXR
\ No newline at end of file
diff --git a/Lang/TXR/Man-or-boy-test b/Lang/TXR/Man-or-boy-test
new file mode 120000
index 0000000000..68d87335ed
--- /dev/null
+++ b/Lang/TXR/Man-or-boy-test
@@ -0,0 +1 @@
+../../Task/Man-or-boy-test/TXR
\ No newline at end of file
diff --git a/Lang/TXR/Range-extraction b/Lang/TXR/Range-extraction
new file mode 120000
index 0000000000..619dec23c4
--- /dev/null
+++ b/Lang/TXR/Range-extraction
@@ -0,0 +1 @@
+../../Task/Range-extraction/TXR
\ No newline at end of file
diff --git a/Lang/TXR/Sleep b/Lang/TXR/Sleep
new file mode 120000
index 0000000000..088078f0b7
--- /dev/null
+++ b/Lang/TXR/Sleep
@@ -0,0 +1 @@
+../../Task/Sleep/TXR
\ No newline at end of file
diff --git a/Lang/TXR/Sockets b/Lang/TXR/Sockets
new file mode 120000
index 0000000000..5b15b84e35
--- /dev/null
+++ b/Lang/TXR/Sockets
@@ -0,0 +1 @@
+../../Task/Sockets/TXR
\ No newline at end of file
diff --git a/Lang/TXR/Synchronous-concurrency b/Lang/TXR/Synchronous-concurrency
new file mode 120000
index 0000000000..112e655872
--- /dev/null
+++ b/Lang/TXR/Synchronous-concurrency
@@ -0,0 +1 @@
+../../Task/Synchronous-concurrency/TXR
\ No newline at end of file
diff --git a/Lang/UNIX-Shell/Narcissist b/Lang/UNIX-Shell/Narcissist
new file mode 120000
index 0000000000..5fecccb07d
--- /dev/null
+++ b/Lang/UNIX-Shell/Narcissist
@@ -0,0 +1 @@
+../../Task/Narcissist/UNIX-Shell
\ No newline at end of file
diff --git a/Lang/UNIX-Shell/Soundex b/Lang/UNIX-Shell/Soundex
new file mode 120000
index 0000000000..d1b23e304c
--- /dev/null
+++ b/Lang/UNIX-Shell/Soundex
@@ -0,0 +1 @@
+../../Task/Soundex/UNIX-Shell
\ No newline at end of file
diff --git a/Lang/UNIX-Shell/Stable-marriage-problem b/Lang/UNIX-Shell/Stable-marriage-problem
new file mode 120000
index 0000000000..e95fa15b6b
--- /dev/null
+++ b/Lang/UNIX-Shell/Stable-marriage-problem
@@ -0,0 +1 @@
+../../Task/Stable-marriage-problem/UNIX-Shell
\ No newline at end of file
diff --git a/Lang/UNIX-Shell/The-Twelve-Days-of-Christmas b/Lang/UNIX-Shell/The-Twelve-Days-of-Christmas
new file mode 120000
index 0000000000..b8c24871cf
--- /dev/null
+++ b/Lang/UNIX-Shell/The-Twelve-Days-of-Christmas
@@ -0,0 +1 @@
+../../Task/The-Twelve-Days-of-Christmas/UNIX-Shell
\ No newline at end of file
diff --git a/Lang/Unicon/HTTPS b/Lang/Unicon/HTTPS
new file mode 120000
index 0000000000..149450f34c
--- /dev/null
+++ b/Lang/Unicon/HTTPS
@@ -0,0 +1 @@
+../../Task/HTTPS/Unicon
\ No newline at end of file
diff --git a/Lang/VBA/Address-of-a-variable b/Lang/VBA/Address-of-a-variable
new file mode 120000
index 0000000000..2f97f51866
--- /dev/null
+++ b/Lang/VBA/Address-of-a-variable
@@ -0,0 +1 @@
+../../Task/Address-of-a-variable/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Associative-array-Creation b/Lang/VBA/Associative-array-Creation
new file mode 120000
index 0000000000..ba8cdcebc5
--- /dev/null
+++ b/Lang/VBA/Associative-array-Creation
@@ -0,0 +1 @@
+../../Task/Associative-array-Creation/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Associative-array-Iteration b/Lang/VBA/Associative-array-Iteration
new file mode 120000
index 0000000000..558c210c92
--- /dev/null
+++ b/Lang/VBA/Associative-array-Iteration
@@ -0,0 +1 @@
+../../Task/Associative-array-Iteration/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Averages-Root-mean-square b/Lang/VBA/Averages-Root-mean-square
new file mode 120000
index 0000000000..30574d0e14
--- /dev/null
+++ b/Lang/VBA/Averages-Root-mean-square
@@ -0,0 +1 @@
+../../Task/Averages-Root-mean-square/VBA
\ No newline at end of file
diff --git a/Lang/VBA/CSV-data-manipulation b/Lang/VBA/CSV-data-manipulation
new file mode 120000
index 0000000000..a74bb3c432
--- /dev/null
+++ b/Lang/VBA/CSV-data-manipulation
@@ -0,0 +1 @@
+../../Task/CSV-data-manipulation/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Call-a-function-in-a-shared-library b/Lang/VBA/Call-a-function-in-a-shared-library
new file mode 120000
index 0000000000..1c280b32b0
--- /dev/null
+++ b/Lang/VBA/Call-a-function-in-a-shared-library
@@ -0,0 +1 @@
+../../Task/Call-a-function-in-a-shared-library/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Loops-For b/Lang/VBA/Loops-For
new file mode 120000
index 0000000000..3662d9a3a8
--- /dev/null
+++ b/Lang/VBA/Loops-For
@@ -0,0 +1 @@
+../../Task/Loops-For/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Loops-For-with-a-specified-step b/Lang/VBA/Loops-For-with-a-specified-step
new file mode 120000
index 0000000000..35f202032d
--- /dev/null
+++ b/Lang/VBA/Loops-For-with-a-specified-step
@@ -0,0 +1 @@
+../../Task/Loops-For-with-a-specified-step/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Numerical-integration b/Lang/VBA/Numerical-integration
new file mode 120000
index 0000000000..29a68ed77d
--- /dev/null
+++ b/Lang/VBA/Numerical-integration
@@ -0,0 +1 @@
+../../Task/Numerical-integration/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Read-a-file-line-by-line b/Lang/VBA/Read-a-file-line-by-line
new file mode 120000
index 0000000000..bb10f58b8e
--- /dev/null
+++ b/Lang/VBA/Read-a-file-line-by-line
@@ -0,0 +1 @@
+../../Task/Read-a-file-line-by-line/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Send-email b/Lang/VBA/Send-email
new file mode 120000
index 0000000000..8f0ba0ea36
--- /dev/null
+++ b/Lang/VBA/Send-email
@@ -0,0 +1 @@
+../../Task/Send-email/VBA
\ No newline at end of file
diff --git a/Lang/VBA/Stable-marriage-problem b/Lang/VBA/Stable-marriage-problem
new file mode 120000
index 0000000000..2b2a4cfb6f
--- /dev/null
+++ b/Lang/VBA/Stable-marriage-problem
@@ -0,0 +1 @@
+../../Task/Stable-marriage-problem/VBA
\ No newline at end of file
diff --git a/Lang/VBScript/Averages-Simple-moving-average b/Lang/VBScript/Averages-Simple-moving-average
new file mode 120000
index 0000000000..14e5296078
--- /dev/null
+++ b/Lang/VBScript/Averages-Simple-moving-average
@@ -0,0 +1 @@
+../../Task/Averages-Simple-moving-average/VBScript
\ No newline at end of file
diff --git a/Lang/VBScript/I-before-E-except-after-C b/Lang/VBScript/I-before-E-except-after-C
new file mode 120000
index 0000000000..c1c94f7ba4
--- /dev/null
+++ b/Lang/VBScript/I-before-E-except-after-C
@@ -0,0 +1 @@
+../../Task/I-before-E-except-after-C/VBScript
\ No newline at end of file
diff --git a/Lang/VBScript/Input-loop b/Lang/VBScript/Input-loop
new file mode 120000
index 0000000000..19668005cf
--- /dev/null
+++ b/Lang/VBScript/Input-loop
@@ -0,0 +1 @@
+../../Task/Input-loop/VBScript
\ No newline at end of file
diff --git a/Lang/VBScript/Longest-increasing-subsequence b/Lang/VBScript/Longest-increasing-subsequence
new file mode 120000
index 0000000000..1cbc082e77
--- /dev/null
+++ b/Lang/VBScript/Longest-increasing-subsequence
@@ -0,0 +1 @@
+../../Task/Longest-increasing-subsequence/VBScript
\ No newline at end of file
diff --git a/Lang/VBScript/Loops-For b/Lang/VBScript/Loops-For
new file mode 120000
index 0000000000..141d889652
--- /dev/null
+++ b/Lang/VBScript/Loops-For
@@ -0,0 +1 @@
+../../Task/Loops-For/VBScript
\ No newline at end of file
diff --git a/Lang/VBScript/Loops-For-with-a-specified-step b/Lang/VBScript/Loops-For-with-a-specified-step
new file mode 120000
index 0000000000..9524dfbff7
--- /dev/null
+++ b/Lang/VBScript/Loops-For-with-a-specified-step
@@ -0,0 +1 @@
+../../Task/Loops-For-with-a-specified-step/VBScript
\ No newline at end of file
diff --git a/Lang/VBScript/Reverse-words-in-a-string b/Lang/VBScript/Reverse-words-in-a-string
new file mode 120000
index 0000000000..425489dc3b
--- /dev/null
+++ b/Lang/VBScript/Reverse-words-in-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-words-in-a-string/VBScript
\ No newline at end of file
diff --git a/Lang/VBScript/XML-Output b/Lang/VBScript/XML-Output
new file mode 120000
index 0000000000..82a4a7bcf3
--- /dev/null
+++ b/Lang/VBScript/XML-Output
@@ -0,0 +1 @@
+../../Task/XML-Output/VBScript
\ No newline at end of file
diff --git a/Lang/Vala/Check-that-file-exists b/Lang/Vala/Check-that-file-exists
new file mode 120000
index 0000000000..80e37430de
--- /dev/null
+++ b/Lang/Vala/Check-that-file-exists
@@ -0,0 +1 @@
+../../Task/Check-that-file-exists/Vala
\ No newline at end of file
diff --git a/Lang/Vala/Identity-matrix b/Lang/Vala/Identity-matrix
new file mode 120000
index 0000000000..745fefb788
--- /dev/null
+++ b/Lang/Vala/Identity-matrix
@@ -0,0 +1 @@
+../../Task/Identity-matrix/Vala
\ No newline at end of file
diff --git a/Lang/Vala/Logical-operations b/Lang/Vala/Logical-operations
new file mode 120000
index 0000000000..7212adab82
--- /dev/null
+++ b/Lang/Vala/Logical-operations
@@ -0,0 +1 @@
+../../Task/Logical-operations/Vala
\ No newline at end of file
diff --git a/Lang/Vala/Loops-For b/Lang/Vala/Loops-For
new file mode 120000
index 0000000000..19952f6162
--- /dev/null
+++ b/Lang/Vala/Loops-For
@@ -0,0 +1 @@
+../../Task/Loops-For/Vala
\ No newline at end of file
diff --git a/Lang/Vala/Palindrome-detection b/Lang/Vala/Palindrome-detection
new file mode 120000
index 0000000000..81cb915587
--- /dev/null
+++ b/Lang/Vala/Palindrome-detection
@@ -0,0 +1 @@
+../../Task/Palindrome-detection/Vala
\ No newline at end of file
diff --git a/Lang/Vala/Reverse-a-string b/Lang/Vala/Reverse-a-string
new file mode 120000
index 0000000000..0d9709976f
--- /dev/null
+++ b/Lang/Vala/Reverse-a-string
@@ -0,0 +1 @@
+../../Task/Reverse-a-string/Vala
\ No newline at end of file
diff --git a/Lang/Vala/Unicode-strings b/Lang/Vala/Unicode-strings
new file mode 120000
index 0000000000..f20106d38d
--- /dev/null
+++ b/Lang/Vala/Unicode-strings
@@ -0,0 +1 @@
+../../Task/Unicode-strings/Vala
\ No newline at end of file
diff --git a/Lang/Vim-Script/Factorial b/Lang/Vim-Script/Factorial
new file mode 120000
index 0000000000..a5e9bd2358
--- /dev/null
+++ b/Lang/Vim-Script/Factorial
@@ -0,0 +1 @@
+../../Task/Factorial/Vim-Script
\ No newline at end of file
diff --git a/Lang/Vim-Script/Langtons-ant b/Lang/Vim-Script/Langtons-ant
new file mode 120000
index 0000000000..726754733a
--- /dev/null
+++ b/Lang/Vim-Script/Langtons-ant
@@ -0,0 +1 @@
+../../Task/Langtons-ant/Vim-Script
\ No newline at end of file
diff --git a/Lang/Visual-Basic-.NET/Loops-For-with-a-specified-step b/Lang/Visual-Basic-.NET/Loops-For-with-a-specified-step
new file mode 120000
index 0000000000..f61c81a637
--- /dev/null
+++ b/Lang/Visual-Basic-.NET/Loops-For-with-a-specified-step
@@ -0,0 +1 @@
+../../Task/Loops-For-with-a-specified-step/Visual-Basic-.NET
\ No newline at end of file
diff --git a/Lang/Visual-Basic/Loops-For-with-a-specified-step b/Lang/Visual-Basic/Loops-For-with-a-specified-step
new file mode 120000
index 0000000000..bee90576a6
--- /dev/null
+++ b/Lang/Visual-Basic/Loops-For-with-a-specified-step
@@ -0,0 +1 @@
+../../Task/Loops-For-with-a-specified-step/Visual-Basic
\ No newline at end of file
diff --git a/Lang/X86-Assembly/Address-of-a-variable b/Lang/X86-Assembly/Address-of-a-variable
new file mode 120000
index 0000000000..6ea0512b3c
--- /dev/null
+++ b/Lang/X86-Assembly/Address-of-a-variable
@@ -0,0 +1 @@
+../../Task/Address-of-a-variable/X86-Assembly
\ No newline at end of file
diff --git a/Lang/X86-Assembly/Dot-product b/Lang/X86-Assembly/Dot-product
new file mode 120000
index 0000000000..500a004edb
--- /dev/null
+++ b/Lang/X86-Assembly/Dot-product
@@ -0,0 +1 @@
+../../Task/Dot-product/X86-Assembly
\ No newline at end of file
diff --git a/Lang/XQuery/Haversine-formula b/Lang/XQuery/Haversine-formula
new file mode 120000
index 0000000000..85a7a3e681
--- /dev/null
+++ b/Lang/XQuery/Haversine-formula
@@ -0,0 +1 @@
+../../Task/Haversine-formula/XQuery
\ No newline at end of file
diff --git a/Lang/ZED/00DESCRIPTION b/Lang/ZED/00DESCRIPTION
index 6627627124..b0cb425a84 100644
--- a/Lang/ZED/00DESCRIPTION
+++ b/Lang/ZED/00DESCRIPTION
@@ -10,13 +10,10 @@ A version that adds the concept of types also exists to compile ZED into C funct
Development of ZEDc is also happening on GitHub: https://github.com/zelah/ZEDc
-My latest programming projects are here: http://zedlan.blogspot.com
-
-
-ZED can be seen compiling itself here: http://ideone.com/UHMQco
+ZED can be seen compiling itself here: http://ideone.com/ARpMCM
Language author on RC: [[User:Zelah|Zelah]] ([[User_talk:Zelah|talk]] | [[Special:Contributions/Zelah|contribs]])
-
+165x2 194x2 207x2
.
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/24-game b/Lang/ZX-Spectrum-Basic/24-game
new file mode 120000
index 0000000000..fa48dd0e1b
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/24-game
@@ -0,0 +1 @@
+../../Task/24-game/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/A+B b/Lang/ZX-Spectrum-Basic/A+B
new file mode 120000
index 0000000000..b72c502e7a
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/A+B
@@ -0,0 +1 @@
+../../Task/A+B/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/ABC-Problem b/Lang/ZX-Spectrum-Basic/ABC-Problem
new file mode 120000
index 0000000000..1e64f865aa
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/ABC-Problem
@@ -0,0 +1 @@
+../../Task/ABC-Problem/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Abundant,-deficient-and-perfect-number-classifications b/Lang/ZX-Spectrum-Basic/Abundant,-deficient-and-perfect-number-classifications
new file mode 120000
index 0000000000..4fc43932d0
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Abundant,-deficient-and-perfect-number-classifications
@@ -0,0 +1 @@
+../../Task/Abundant,-deficient-and-perfect-number-classifications/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Ackermann-function b/Lang/ZX-Spectrum-Basic/Ackermann-function
new file mode 120000
index 0000000000..4192be1842
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Ackermann-function
@@ -0,0 +1 @@
+../../Task/Ackermann-function/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Align-columns b/Lang/ZX-Spectrum-Basic/Align-columns
new file mode 120000
index 0000000000..d7c17d4ffd
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Align-columns
@@ -0,0 +1 @@
+../../Task/Align-columns/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Aliquot-sequence-classifications b/Lang/ZX-Spectrum-Basic/Aliquot-sequence-classifications
new file mode 120000
index 0000000000..5465db10c0
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Aliquot-sequence-classifications
@@ -0,0 +1 @@
+../../Task/Aliquot-sequence-classifications/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Almost-prime b/Lang/ZX-Spectrum-Basic/Almost-prime
new file mode 120000
index 0000000000..497b0642d0
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Almost-prime
@@ -0,0 +1 @@
+../../Task/Almost-prime/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Amicable-pairs b/Lang/ZX-Spectrum-Basic/Amicable-pairs
new file mode 120000
index 0000000000..229bde67dd
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Amicable-pairs
@@ -0,0 +1 @@
+../../Task/Amicable-pairs/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Animate-a-pendulum b/Lang/ZX-Spectrum-Basic/Animate-a-pendulum
new file mode 120000
index 0000000000..7ab1d07608
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Animate-a-pendulum
@@ -0,0 +1 @@
+../../Task/Animate-a-pendulum/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Animation b/Lang/ZX-Spectrum-Basic/Animation
new file mode 120000
index 0000000000..3c3bf3a322
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Animation
@@ -0,0 +1 @@
+../../Task/Animation/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Anonymous-recursion b/Lang/ZX-Spectrum-Basic/Anonymous-recursion
new file mode 120000
index 0000000000..5300a1204f
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Anonymous-recursion
@@ -0,0 +1 @@
+../../Task/Anonymous-recursion/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Apply-a-callback-to-an-array b/Lang/ZX-Spectrum-Basic/Apply-a-callback-to-an-array
new file mode 120000
index 0000000000..7e12e0b053
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Apply-a-callback-to-an-array
@@ -0,0 +1 @@
+../../Task/Apply-a-callback-to-an-array/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Arithmetic-Complex b/Lang/ZX-Spectrum-Basic/Arithmetic-Complex
new file mode 120000
index 0000000000..c67f2823f3
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Arithmetic-Complex
@@ -0,0 +1 @@
+../../Task/Arithmetic-Complex/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Arithmetic-Integer b/Lang/ZX-Spectrum-Basic/Arithmetic-Integer
new file mode 120000
index 0000000000..b30f3473e8
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Arithmetic-Integer
@@ -0,0 +1 @@
+../../Task/Arithmetic-Integer/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Arithmetic-evaluation b/Lang/ZX-Spectrum-Basic/Arithmetic-evaluation
new file mode 120000
index 0000000000..56de044d73
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Arithmetic-evaluation
@@ -0,0 +1 @@
+../../Task/Arithmetic-evaluation/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Arithmetic-geometric-mean b/Lang/ZX-Spectrum-Basic/Arithmetic-geometric-mean
new file mode 120000
index 0000000000..22b6e33c41
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Arithmetic-geometric-mean
@@ -0,0 +1 @@
+../../Task/Arithmetic-geometric-mean/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Array-concatenation b/Lang/ZX-Spectrum-Basic/Array-concatenation
new file mode 120000
index 0000000000..b554c89706
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Array-concatenation
@@ -0,0 +1 @@
+../../Task/Array-concatenation/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Arrays b/Lang/ZX-Spectrum-Basic/Arrays
new file mode 120000
index 0000000000..f18da20623
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Arrays
@@ -0,0 +1 @@
+../../Task/Arrays/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Balanced-brackets b/Lang/ZX-Spectrum-Basic/Balanced-brackets
new file mode 120000
index 0000000000..b31b7979ed
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Balanced-brackets
@@ -0,0 +1 @@
+../../Task/Balanced-brackets/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Benfords-law b/Lang/ZX-Spectrum-Basic/Benfords-law
new file mode 120000
index 0000000000..de8ec5226b
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Benfords-law
@@ -0,0 +1 @@
+../../Task/Benfords-law/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Best-shuffle b/Lang/ZX-Spectrum-Basic/Best-shuffle
new file mode 120000
index 0000000000..1901ef8a9c
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Best-shuffle
@@ -0,0 +1 @@
+../../Task/Best-shuffle/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Binary-search b/Lang/ZX-Spectrum-Basic/Binary-search
new file mode 120000
index 0000000000..6152b03645
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Binary-search
@@ -0,0 +1 @@
+../../Task/Binary-search/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Box-the-compass b/Lang/ZX-Spectrum-Basic/Box-the-compass
new file mode 120000
index 0000000000..969a2e4af3
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Box-the-compass
@@ -0,0 +1 @@
+../../Task/Box-the-compass/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Brownian-tree b/Lang/ZX-Spectrum-Basic/Brownian-tree
new file mode 120000
index 0000000000..76b62b4b7d
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Brownian-tree
@@ -0,0 +1 @@
+../../Task/Brownian-tree/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Bulls-and-cows b/Lang/ZX-Spectrum-Basic/Bulls-and-cows
new file mode 120000
index 0000000000..748467032e
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Bulls-and-cows
@@ -0,0 +1 @@
+../../Task/Bulls-and-cows/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Caesar-cipher b/Lang/ZX-Spectrum-Basic/Caesar-cipher
new file mode 120000
index 0000000000..5c35824846
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Caesar-cipher
@@ -0,0 +1 @@
+../../Task/Caesar-cipher/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Carmichael-3-strong-pseudoprimes b/Lang/ZX-Spectrum-Basic/Carmichael-3-strong-pseudoprimes
new file mode 120000
index 0000000000..6d7b8e923b
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Carmichael-3-strong-pseudoprimes
@@ -0,0 +1 @@
+../../Task/Carmichael-3-strong-pseudoprimes/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Casting-out-nines b/Lang/ZX-Spectrum-Basic/Casting-out-nines
new file mode 120000
index 0000000000..b8743ff652
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Casting-out-nines
@@ -0,0 +1 @@
+../../Task/Casting-out-nines/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Catalan-numbers b/Lang/ZX-Spectrum-Basic/Catalan-numbers
new file mode 120000
index 0000000000..2061ea93cf
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Catalan-numbers
@@ -0,0 +1 @@
+../../Task/Catalan-numbers/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Catalan-numbers-Pascals-triangle b/Lang/ZX-Spectrum-Basic/Catalan-numbers-Pascals-triangle
new file mode 120000
index 0000000000..a3dbafcb43
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Catalan-numbers-Pascals-triangle
@@ -0,0 +1 @@
+../../Task/Catalan-numbers-Pascals-triangle/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Catamorphism b/Lang/ZX-Spectrum-Basic/Catamorphism
new file mode 120000
index 0000000000..332fead955
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Catamorphism
@@ -0,0 +1 @@
+../../Task/Catamorphism/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Character-codes b/Lang/ZX-Spectrum-Basic/Character-codes
new file mode 120000
index 0000000000..8ff3f9f373
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Character-codes
@@ -0,0 +1 @@
+../../Task/Character-codes/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Chinese-remainder-theorem b/Lang/ZX-Spectrum-Basic/Chinese-remainder-theorem
new file mode 120000
index 0000000000..d29809d2cb
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Chinese-remainder-theorem
@@ -0,0 +1 @@
+../../Task/Chinese-remainder-theorem/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Cholesky-decomposition b/Lang/ZX-Spectrum-Basic/Cholesky-decomposition
new file mode 120000
index 0000000000..9c7a253f15
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Cholesky-decomposition
@@ -0,0 +1 @@
+../../Task/Cholesky-decomposition/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Circles-of-given-radius-through-two-points b/Lang/ZX-Spectrum-Basic/Circles-of-given-radius-through-two-points
new file mode 120000
index 0000000000..bd96a56380
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Circles-of-given-radius-through-two-points
@@ -0,0 +1 @@
+../../Task/Circles-of-given-radius-through-two-points/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Closest-pair-problem b/Lang/ZX-Spectrum-Basic/Closest-pair-problem
new file mode 120000
index 0000000000..bcfebdb28c
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Closest-pair-problem
@@ -0,0 +1 @@
+../../Task/Closest-pair-problem/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Combinations-with-repetitions b/Lang/ZX-Spectrum-Basic/Combinations-with-repetitions
new file mode 120000
index 0000000000..10778cf1a6
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Combinations-with-repetitions
@@ -0,0 +1 @@
+../../Task/Combinations-with-repetitions/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Comma-quibbling b/Lang/ZX-Spectrum-Basic/Comma-quibbling
new file mode 120000
index 0000000000..06ff688648
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Comma-quibbling
@@ -0,0 +1 @@
+../../Task/Comma-quibbling/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Constrained-random-points-on-a-circle b/Lang/ZX-Spectrum-Basic/Constrained-random-points-on-a-circle
new file mode 120000
index 0000000000..21143b160e
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Constrained-random-points-on-a-circle
@@ -0,0 +1 @@
+../../Task/Constrained-random-points-on-a-circle/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Continued-fraction b/Lang/ZX-Spectrum-Basic/Continued-fraction
new file mode 120000
index 0000000000..f9f2fa1c31
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Continued-fraction
@@ -0,0 +1 @@
+../../Task/Continued-fraction/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Conways-Game-of-Life b/Lang/ZX-Spectrum-Basic/Conways-Game-of-Life
new file mode 120000
index 0000000000..a062883d2f
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Conways-Game-of-Life
@@ -0,0 +1 @@
+../../Task/Conways-Game-of-Life/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Count-in-factors b/Lang/ZX-Spectrum-Basic/Count-in-factors
new file mode 120000
index 0000000000..f807df3ee9
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Count-in-factors
@@ -0,0 +1 @@
+../../Task/Count-in-factors/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Count-in-octal b/Lang/ZX-Spectrum-Basic/Count-in-octal
new file mode 120000
index 0000000000..7eeda86012
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Count-in-octal
@@ -0,0 +1 @@
+../../Task/Count-in-octal/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Count-occurrences-of-a-substring b/Lang/ZX-Spectrum-Basic/Count-occurrences-of-a-substring
new file mode 120000
index 0000000000..870eda378d
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Count-occurrences-of-a-substring
@@ -0,0 +1 @@
+../../Task/Count-occurrences-of-a-substring/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Count-the-coins b/Lang/ZX-Spectrum-Basic/Count-the-coins
new file mode 120000
index 0000000000..3d8b39671b
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Count-the-coins
@@ -0,0 +1 @@
+../../Task/Count-the-coins/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Day-of-the-week b/Lang/ZX-Spectrum-Basic/Day-of-the-week
new file mode 120000
index 0000000000..69a01b0ee2
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Day-of-the-week
@@ -0,0 +1 @@
+../../Task/Day-of-the-week/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Digital-root b/Lang/ZX-Spectrum-Basic/Digital-root
new file mode 120000
index 0000000000..89029c1fa3
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Digital-root
@@ -0,0 +1 @@
+../../Task/Digital-root/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Dinesmans-multiple-dwelling-problem b/Lang/ZX-Spectrum-Basic/Dinesmans-multiple-dwelling-problem
new file mode 120000
index 0000000000..1f40978aa8
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Dinesmans-multiple-dwelling-problem
@@ -0,0 +1 @@
+../../Task/Dinesmans-multiple-dwelling-problem/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Dot-product b/Lang/ZX-Spectrum-Basic/Dot-product
new file mode 120000
index 0000000000..47242a9d0e
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Dot-product
@@ -0,0 +1 @@
+../../Task/Dot-product/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Dragon-curve b/Lang/ZX-Spectrum-Basic/Dragon-curve
new file mode 120000
index 0000000000..1d9285585f
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Dragon-curve
@@ -0,0 +1 @@
+../../Task/Dragon-curve/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Draw-a-cuboid b/Lang/ZX-Spectrum-Basic/Draw-a-cuboid
new file mode 120000
index 0000000000..7376c7f429
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Draw-a-cuboid
@@ -0,0 +1 @@
+../../Task/Draw-a-cuboid/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Draw-a-sphere b/Lang/ZX-Spectrum-Basic/Draw-a-sphere
new file mode 120000
index 0000000000..fd3f93c9f4
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Draw-a-sphere
@@ -0,0 +1 @@
+../../Task/Draw-a-sphere/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Dutch-national-flag-problem b/Lang/ZX-Spectrum-Basic/Dutch-national-flag-problem
new file mode 120000
index 0000000000..b1c6403067
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Dutch-national-flag-problem
@@ -0,0 +1 @@
+../../Task/Dutch-national-flag-problem/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Entropy b/Lang/ZX-Spectrum-Basic/Entropy
new file mode 120000
index 0000000000..dafb212b38
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Entropy
@@ -0,0 +1 @@
+../../Task/Entropy/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Equilibrium-index b/Lang/ZX-Spectrum-Basic/Equilibrium-index
new file mode 120000
index 0000000000..1778b05d2e
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Equilibrium-index
@@ -0,0 +1 @@
+../../Task/Equilibrium-index/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Ethiopian-multiplication b/Lang/ZX-Spectrum-Basic/Ethiopian-multiplication
new file mode 120000
index 0000000000..c76da97edf
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Ethiopian-multiplication
@@ -0,0 +1 @@
+../../Task/Ethiopian-multiplication/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Euler-method b/Lang/ZX-Spectrum-Basic/Euler-method
new file mode 120000
index 0000000000..89e8f8b07b
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Euler-method
@@ -0,0 +1 @@
+../../Task/Euler-method/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Evaluate-binomial-coefficients b/Lang/ZX-Spectrum-Basic/Evaluate-binomial-coefficients
new file mode 120000
index 0000000000..02f55582bf
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Evaluate-binomial-coefficients
@@ -0,0 +1 @@
+../../Task/Evaluate-binomial-coefficients/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Even-or-odd b/Lang/ZX-Spectrum-Basic/Even-or-odd
new file mode 120000
index 0000000000..9b5ca50cce
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Even-or-odd
@@ -0,0 +1 @@
+../../Task/Even-or-odd/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Factors-of-an-integer b/Lang/ZX-Spectrum-Basic/Factors-of-an-integer
new file mode 120000
index 0000000000..27cc94a39d
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Factors-of-an-integer
@@ -0,0 +1 @@
+../../Task/Factors-of-an-integer/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Fibonacci-sequence b/Lang/ZX-Spectrum-Basic/Fibonacci-sequence
new file mode 120000
index 0000000000..bf7cdcd64d
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Fibonacci-sequence
@@ -0,0 +1 @@
+../../Task/Fibonacci-sequence/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Fibonacci-word b/Lang/ZX-Spectrum-Basic/Fibonacci-word
new file mode 120000
index 0000000000..478faa1caf
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Fibonacci-word
@@ -0,0 +1 @@
+../../Task/Fibonacci-word/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Filter b/Lang/ZX-Spectrum-Basic/Filter
new file mode 120000
index 0000000000..300015287b
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Filter
@@ -0,0 +1 @@
+../../Task/Filter/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Find-the-missing-permutation b/Lang/ZX-Spectrum-Basic/Find-the-missing-permutation
new file mode 120000
index 0000000000..c28b2c4980
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Find-the-missing-permutation
@@ -0,0 +1 @@
+../../Task/Find-the-missing-permutation/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/FizzBuzz b/Lang/ZX-Spectrum-Basic/FizzBuzz
new file mode 120000
index 0000000000..6463f923ed
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/FizzBuzz
@@ -0,0 +1 @@
+../../Task/FizzBuzz/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Flatten-a-list b/Lang/ZX-Spectrum-Basic/Flatten-a-list
new file mode 120000
index 0000000000..27d8ed3a73
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Flatten-a-list
@@ -0,0 +1 @@
+../../Task/Flatten-a-list/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Floyds-triangle b/Lang/ZX-Spectrum-Basic/Floyds-triangle
new file mode 120000
index 0000000000..e9609c33a2
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Floyds-triangle
@@ -0,0 +1 @@
+../../Task/Floyds-triangle/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Formatted-numeric-output b/Lang/ZX-Spectrum-Basic/Formatted-numeric-output
new file mode 120000
index 0000000000..de30e20b09
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Formatted-numeric-output
@@ -0,0 +1 @@
+../../Task/Formatted-numeric-output/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Forward-difference b/Lang/ZX-Spectrum-Basic/Forward-difference
new file mode 120000
index 0000000000..50bdabbd03
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Forward-difference
@@ -0,0 +1 @@
+../../Task/Forward-difference/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Fractal-tree b/Lang/ZX-Spectrum-Basic/Fractal-tree
new file mode 120000
index 0000000000..12a6accc2b
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Fractal-tree
@@ -0,0 +1 @@
+../../Task/Fractal-tree/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Generate-lower-case-ASCII-alphabet b/Lang/ZX-Spectrum-Basic/Generate-lower-case-ASCII-alphabet
new file mode 120000
index 0000000000..dd6309b8a5
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Generate-lower-case-ASCII-alphabet
@@ -0,0 +1 @@
+../../Task/Generate-lower-case-ASCII-alphabet/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Greatest-common-divisor b/Lang/ZX-Spectrum-Basic/Greatest-common-divisor
new file mode 120000
index 0000000000..20532ea3dc
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Greatest-common-divisor
@@ -0,0 +1 @@
+../../Task/Greatest-common-divisor/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Greatest-element-of-a-list b/Lang/ZX-Spectrum-Basic/Greatest-element-of-a-list
new file mode 120000
index 0000000000..b00179fd55
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Greatest-element-of-a-list
@@ -0,0 +1 @@
+../../Task/Greatest-element-of-a-list/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Greatest-subsequential-sum b/Lang/ZX-Spectrum-Basic/Greatest-subsequential-sum
new file mode 120000
index 0000000000..2c3f6c3f10
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Greatest-subsequential-sum
@@ -0,0 +1 @@
+../../Task/Greatest-subsequential-sum/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Guess-the-number-With-feedback b/Lang/ZX-Spectrum-Basic/Guess-the-number-With-feedback
new file mode 120000
index 0000000000..56265756ae
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Guess-the-number-With-feedback
@@ -0,0 +1 @@
+../../Task/Guess-the-number-With-feedback/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Guess-the-number-With-feedback--player- b/Lang/ZX-Spectrum-Basic/Guess-the-number-With-feedback--player-
new file mode 120000
index 0000000000..5aeabfa666
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Guess-the-number-With-feedback--player-
@@ -0,0 +1 @@
+../../Task/Guess-the-number-With-feedback--player-/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Hailstone-sequence b/Lang/ZX-Spectrum-Basic/Hailstone-sequence
new file mode 120000
index 0000000000..62fea84b7a
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Hailstone-sequence
@@ -0,0 +1 @@
+../../Task/Hailstone-sequence/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Hamming-numbers b/Lang/ZX-Spectrum-Basic/Hamming-numbers
new file mode 120000
index 0000000000..615cb4a123
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Hamming-numbers
@@ -0,0 +1 @@
+../../Task/Hamming-numbers/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Happy-numbers b/Lang/ZX-Spectrum-Basic/Happy-numbers
new file mode 120000
index 0000000000..9e912a12b9
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Happy-numbers
@@ -0,0 +1 @@
+../../Task/Happy-numbers/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Harshad-or-Niven-series b/Lang/ZX-Spectrum-Basic/Harshad-or-Niven-series
new file mode 120000
index 0000000000..dfa4d2a8f4
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Harshad-or-Niven-series
@@ -0,0 +1 @@
+../../Task/Harshad-or-Niven-series/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Haversine-formula b/Lang/ZX-Spectrum-Basic/Haversine-formula
new file mode 120000
index 0000000000..a4672ea5eb
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Haversine-formula
@@ -0,0 +1 @@
+../../Task/Haversine-formula/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Higher-order-functions b/Lang/ZX-Spectrum-Basic/Higher-order-functions
new file mode 120000
index 0000000000..945d3e3c37
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Higher-order-functions
@@ -0,0 +1 @@
+../../Task/Higher-order-functions/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Hofstadter-Conway-$10,000-sequence b/Lang/ZX-Spectrum-Basic/Hofstadter-Conway-$10,000-sequence
new file mode 120000
index 0000000000..934453b118
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Hofstadter-Conway-$10,000-sequence
@@ -0,0 +1 @@
+../../Task/Hofstadter-Conway-$10,000-sequence/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Hofstadter-Q-sequence b/Lang/ZX-Spectrum-Basic/Hofstadter-Q-sequence
new file mode 120000
index 0000000000..681be02d80
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Hofstadter-Q-sequence
@@ -0,0 +1 @@
+../../Task/Hofstadter-Q-sequence/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Horizontal-sundial-calculations b/Lang/ZX-Spectrum-Basic/Horizontal-sundial-calculations
new file mode 120000
index 0000000000..df84be983c
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Horizontal-sundial-calculations
@@ -0,0 +1 @@
+../../Task/Horizontal-sundial-calculations/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Lang/ZX-Spectrum-Basic/Pythagorean-triples b/Lang/ZX-Spectrum-Basic/Pythagorean-triples
new file mode 120000
index 0000000000..fe68243fbc
--- /dev/null
+++ b/Lang/ZX-Spectrum-Basic/Pythagorean-triples
@@ -0,0 +1 @@
+../../Task/Pythagorean-triples/ZX-Spectrum-Basic
\ No newline at end of file
diff --git a/Task/100-doors/00DESCRIPTION b/Task/100-doors/00DESCRIPTION
index 163a84b285..1db5397c00 100644
--- a/Task/100-doors/00DESCRIPTION
+++ b/Task/100-doors/00DESCRIPTION
@@ -1,11 +1,21 @@
-Problem: You have 100 doors in a row that are all initially closed.
-You make 100 [[task feature::Rosetta Code:multiple passes|passes]] by the doors.
-The first time through, you visit every door and toggle the door (if the door is closed, you open it; if it is open, you close it). The second time you only visit every 2nd door (door #2, #4, #6, ...).
-The third time, every 3rd door (door #3, #6, #9, ...), etc, until you only visit the 100th door.
+There are 100 doors in a row that are all initially closed.
+
+You make 100 [[task feature::Rosetta Code:multiple passes|passes]] by the doors.
+
+The first time through, visit every door and ''toggle'' the door (if the door is closed, open it; if it is open, close it).
+
+The second time, only visit every 2nd door (door #2, #4, #6, ...), and toggle it.
+
+The third time, visit every 3rd door (door #3, #6, #9, ...), etc, until you only visit the 100th door.
+
+
+;Task:
+Answer the question: what state are the doors in after the last pass? Which are open, which are closed?
-Question: What state are the doors in after the last pass? Which are open, which are closed?
'''[[task feature::Rosetta Code:extra credit|Alternate]]:'''
-As noted in this page's [[Talk:100 doors|discussion page]], the only doors that remain open are whose numbers are perfect squares of integers.
-Opening only those doors is an [[task feature::Rosetta Code:optimization|optimization]] that may also be expressed;
+As noted in this page's [[Talk:100 doors|discussion page]], the only doors that remain open are those whose numbers are perfect squares.
+
+Opening only those doors is an [[task feature::Rosetta Code:optimization|optimization]] that may also be expressed;
however, as should be obvious, this defeats the intent of comparing implementations across programming languages.
+
diff --git a/Task/100-doors/Agena/100-doors.agena b/Task/100-doors/Agena/100-doors.agena
new file mode 100644
index 0000000000..18c9cb1963
--- /dev/null
+++ b/Task/100-doors/Agena/100-doors.agena
@@ -0,0 +1,19 @@
+# find the first few squares via the unoptimised door flipping method
+scope
+
+ local doorMax := 100;
+ local door;
+ create register door( doorMax );
+
+ # set all doors to closed
+ for i to doorMax do door[ i ] := false od;
+
+ # repeatedly flip the doors
+ for i to doorMax do
+ for j from i to doorMax by i do door[ j ] := not door[ j ] od
+ od;
+
+ # display the results
+ for i to doorMax do if door[ i ] then write( " ", i ) fi od; print()
+
+epocs
diff --git a/Task/100-doors/AppleScript/100-doors.applescript b/Task/100-doors/AppleScript/100-doors-1.applescript
similarity index 100%
rename from Task/100-doors/AppleScript/100-doors.applescript
rename to Task/100-doors/AppleScript/100-doors-1.applescript
diff --git a/Task/100-doors/AppleScript/100-doors-2.applescript b/Task/100-doors/AppleScript/100-doors-2.applescript
new file mode 100644
index 0000000000..382a73ed29
--- /dev/null
+++ b/Task/100-doors/AppleScript/100-doors-2.applescript
@@ -0,0 +1,149 @@
+-- finalDoors :: Int -> [(Int, Bool)]
+on finalDoors(n)
+
+ -- toggledCorridor :: [(Int, Bool)] -> (Int, Bool) -> Int -> [(Int, Bool)]
+ script toggledCorridor
+ on lambda(a, _, k)
+
+ -- perhapsToggled :: Bool -> Int -> Bool
+ script perhapsToggled
+ on lambda(x, i)
+ if i mod k = 0 then
+ {i, not item 2 of x}
+ else
+ {i, item 2 of x}
+ end if
+ end lambda
+ end script
+
+ map(perhapsToggled, a)
+ end lambda
+ end script
+
+ set lstRange to range(1, n)
+
+ foldl(toggledCorridor, ¬
+ zip(lstRange, replicate(n, {false})), lstRange)
+end finalDoors
+
+-- TEST
+on run
+ -- isOpenAtEnd :: (Int, Bool) -> Bool
+ script isOpenAtEnd
+ on lambda(door)
+ (item 2 of door)
+ end lambda
+ end script
+
+ -- doorNumber :: (Int, Bool) -> Int
+ script doorNumber
+ on lambda(door)
+ (item 1 of door)
+ end lambda
+ end script
+
+ map(doorNumber, filter(isOpenAtEnd, finalDoors(100)))
+
+ --> {1, 4, 9, 16, 25, 36, 49, 64, 81, 100}
+end run
+
+
+
+-- GENERIC FUNCTIONS
+
+-- filter :: (a -> Bool) -> [a] -> [a]
+on filter(f, xs)
+ tell mReturn(f)
+ set lst to {}
+ set lng to length of xs
+ repeat with i from 1 to lng
+ set v to item i of xs
+ if lambda(v, i, xs) then set end of lst to v
+ end repeat
+ return lst
+ end tell
+end filter
+
+-- foldl :: (a -> b -> a) -> a -> [b] -> a
+on foldl(f, startValue, xs)
+ tell mReturn(f)
+ set v to startValue
+ set lng to length of xs
+ repeat with i from 1 to lng
+ set v to lambda(v, item i of xs, i, xs)
+ end repeat
+ return v
+ end tell
+end foldl
+
+-- map :: (a -> b) -> [a] -> [b]
+on map(f, xs)
+ tell mReturn(f)
+ set lng to length of xs
+ set lst to {}
+ repeat with i from 1 to lng
+ set end of lst to lambda(item i of xs, i, xs)
+ end repeat
+ return lst
+ end tell
+end map
+
+-- zip :: [a] -> [b] -> [(a, b)]
+on zip(xs, ys)
+ script pair
+ on lambda(x, i)
+ [x, item i of ys]
+ end lambda
+ end script
+
+ if length of xs = length of ys then
+ map(pair, xs)
+ else
+ missing value
+ end if
+end zip
+
+-- Egyptian multiplication - progressively doubling a list, appending
+-- stages of doubling to an accumulator where needed for binary
+-- assembly of a target length
+
+-- replicate :: Int -> a -> [a]
+on replicate(n, a)
+ if class of a is list then
+ set out to {}
+ else
+ set out to ""
+ end if
+ if n < 1 then return out
+ set dbl to a
+
+ repeat while (n > 1)
+ if (n mod 2) > 0 then set out to out & dbl
+ set n to (n div 2)
+ set dbl to (dbl & dbl)
+ end repeat
+ return out & dbl
+end replicate
+
+-- range :: Int -> Int -> [Int]
+on range(m, n)
+ set d to 1
+ if n < m then set d to -1
+ set lst to {}
+ repeat with i from m to n by d
+ set end of lst to i
+ end repeat
+ return lst
+end range
+
+-- Lift 2nd class handler function into 1st class script wrapper
+-- mReturn :: Handler -> Script
+on mReturn(f)
+ if class of f is script then
+ f
+ else
+ script
+ property lambda : f
+ end script
+ end if
+end mReturn
diff --git a/Task/100-doors/AppleScript/100-doors-3.applescript b/Task/100-doors/AppleScript/100-doors-3.applescript
new file mode 100644
index 0000000000..831ceff834
--- /dev/null
+++ b/Task/100-doors/AppleScript/100-doors-3.applescript
@@ -0,0 +1 @@
+{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}
diff --git a/Task/100-doors/AppleScript/100-doors-4.applescript b/Task/100-doors/AppleScript/100-doors-4.applescript
new file mode 100644
index 0000000000..efe91e4d16
--- /dev/null
+++ b/Task/100-doors/AppleScript/100-doors-4.applescript
@@ -0,0 +1,5 @@
+map(factorCountMod2, range(1, 100))
+
+on factorCountMod2(n)
+ {n, (length of integerFactors(n)) mod 2 = 1}
+end factorCountMod2
diff --git a/Task/100-doors/AppleScript/100-doors-5.applescript b/Task/100-doors/AppleScript/100-doors-5.applescript
new file mode 100644
index 0000000000..a0f2e17b5d
--- /dev/null
+++ b/Task/100-doors/AppleScript/100-doors-5.applescript
@@ -0,0 +1,21 @@
+-- perfectSquaresUpTo :: Int -> [Int]
+on perfectSquaresUpTo(n)
+ script squared
+ -- (Int -> Int)
+ on lambda(x)
+ x * x
+ end lambda
+ end script
+
+ set realRoot to n ^ (1 / 2)
+ set intRoot to realRoot as integer
+ set blnNotPerfectSquare to not (intRoot = realRoot)
+
+ map(squared, range(1, intRoot - (blnNotPerfectSquare as integer)))
+end perfectSquaresUpTo
+
+on run
+
+ perfectSquaresUpTo(100)
+
+end run
diff --git a/Task/100-doors/AppleScript/100-doors-6.applescript b/Task/100-doors/AppleScript/100-doors-6.applescript
new file mode 100644
index 0000000000..831ceff834
--- /dev/null
+++ b/Task/100-doors/AppleScript/100-doors-6.applescript
@@ -0,0 +1 @@
+{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}
diff --git a/Task/100-doors/Clojure/100-doors-3.clj b/Task/100-doors/Clojure/100-doors-3.clj
index 63f5be1883..89d7d3d6fe 100644
--- a/Task/100-doors/Clojure/100-doors-3.clj
+++ b/Task/100-doors/Clojure/100-doors-3.clj
@@ -2,7 +2,7 @@
(->> (for [step (range 1 101), occ (range step 101 step)] occ)
frequencies
(filter (comp odd? val))
- (map first)
+ keys
sort))
(defn print-open-doors []
diff --git a/Task/100-doors/DWScript/100-doors.dw b/Task/100-doors/DWScript/100-doors.dw
index f55e6a854b..561644985e 100644
--- a/Task/100-doors/DWScript/100-doors.dw
+++ b/Task/100-doors/DWScript/100-doors.dw
@@ -4,7 +4,7 @@ var i, j : Integer;
for i := 1 to 100 do
for j := i to 100 do
if (j mod i) = 0 then
- doors[j] := not doors[j];
+ doors[j] := not doors[j];F
for i := 1 to 100 do
if doors[i] then
diff --git a/Task/100-doors/Elena/100-doors.elena b/Task/100-doors/Elena/100-doors.elena
index 9affe761fe..5fc7093148 100644
--- a/Task/100-doors/Elena/100-doors.elena
+++ b/Task/100-doors/Elena/100-doors.elena
@@ -1,6 +1,6 @@
-#define system.
-#define system'routines.
-#define extensions.
+#import system.
+#import system'routines.
+#import extensions.
#symbol program=
[
diff --git a/Task/100-doors/Factor/100-doors-1.factor b/Task/100-doors/Factor/100-doors-1.factor
index 6dccd9b759..e9eb7b4c70 100644
--- a/Task/100-doors/Factor/100-doors-1.factor
+++ b/Task/100-doors/Factor/100-doors-1.factor
@@ -21,3 +21,5 @@ CONSTANT: number-of-doors 100
: main ( -- )
number-of-doors 1 +
[ toggle-all-multiples ] [ print-doors ] bi ;
+
+main
diff --git a/Task/100-doors/Fortran/100-doors-1.f b/Task/100-doors/Fortran/100-doors-1.f
index e0d194e1ff..b2d4d6c38c 100644
--- a/Task/100-doors/Fortran/100-doors-1.f
+++ b/Task/100-doors/Fortran/100-doors-1.f
@@ -1,22 +1,15 @@
-PROGRAM DOORS
+program doors
+ implicit none
+ integer, allocatable :: door(:)
+ character(6), parameter :: s(0:1) = ["closed", "open "]
+ integer :: i, n
- INTEGER, PARAMETER :: n = 100 ! Number of doors
- INTEGER :: i, j
- LOGICAL :: door(n) = .TRUE. ! Initially closed
-
- DO i = 1, n
- DO j = i, n, i
- door(j) = .NOT. door(j)
- END DO
- END DO
-
- DO i = 1, n
- WRITE(*,"(A,I3,A)", ADVANCE="NO") "Door ", i, " is "
- IF (door(i)) THEN
- WRITE(*,"(A)") "closed"
- ELSE
- WRITE(*,"(A)") "open"
- END IF
- END DO
-
-END PROGRAM DOORS
+ print "(A)", "Number of doors?"
+ read *, n
+ allocate (door(n))
+ door = 1
+ do i = 1, n
+ door(i:n:i) = 1 - door(i:n:i)
+ print "(A,G0,2A)", "door ", i, " is ", s(door(i))
+ end do
+end program
diff --git a/Task/100-doors/Java/100-doors-1.java b/Task/100-doors/Java/100-doors-1.java
index e215518087..df5e0aee5c 100644
--- a/Task/100-doors/Java/100-doors-1.java
+++ b/Task/100-doors/Java/100-doors-1.java
@@ -1,13 +1 @@
-public class HundredDoors {
- public static void main(String[] args) {
- boolean[] doors = new boolean[101];
- for (int i = 1; i <= 100; i++) {
- for (int j = i; j <= 100; j++) {
- if(j % i == 0) doors[j] = !doors[j];
- }
- }
- for (int i = 1; i <= 100; i++) {
- System.out.printf("Door %d: %s%n", i, doors[i] ? "open" : "closed");
- }
- }
-}
+N.println(IntStream.rangeClosed(1, 100).filter(i -> Math.pow((int) Math.sqrt(i), 2) == i).boxed().join(", ", "Open Doors: ", ""));
diff --git a/Task/100-doors/Java/100-doors-2.java b/Task/100-doors/Java/100-doors-2.java
index fbc73e7d13..e215518087 100644
--- a/Task/100-doors/Java/100-doors-2.java
+++ b/Task/100-doors/Java/100-doors-2.java
@@ -1,11 +1,13 @@
-public class Doors
-{
- public static void main(String[] args)
- {
- boolean[] doors=new boolean[100];
- for(int i=0;i<10;i++)
- doors[i*(i+2)]=true;
- for(int i=0;i<100;i++)
- System.out.println("Door #"+(i+1)+" is"+(doors[i]?"open.":" closed."));
- }
+public class HundredDoors {
+ public static void main(String[] args) {
+ boolean[] doors = new boolean[101];
+ for (int i = 1; i <= 100; i++) {
+ for (int j = i; j <= 100; j++) {
+ if(j % i == 0) doors[j] = !doors[j];
+ }
+ }
+ for (int i = 1; i <= 100; i++) {
+ System.out.printf("Door %d: %s%n", i, doors[i] ? "open" : "closed");
+ }
+ }
}
diff --git a/Task/100-doors/Java/100-doors-3.java b/Task/100-doors/Java/100-doors-3.java
index 7722346acf..fbc73e7d13 100644
--- a/Task/100-doors/Java/100-doors-3.java
+++ b/Task/100-doors/Java/100-doors-3.java
@@ -2,7 +2,10 @@ public class Doors
{
public static void main(String[] args)
{
+ boolean[] doors=new boolean[100];
for(int i=0;i<10;i++)
- System.out.println("Door #"+(i*(i+2)+1)+" is open.");
+ doors[i*(i+2)]=true;
+ for(int i=0;i<100;i++)
+ System.out.println("Door #"+(i+1)+" is"+(doors[i]?"open.":" closed."));
}
}
diff --git a/Task/100-doors/Java/100-doors-4.java b/Task/100-doors/Java/100-doors-4.java
index 318cd39a24..7722346acf 100644
--- a/Task/100-doors/Java/100-doors-4.java
+++ b/Task/100-doors/Java/100-doors-4.java
@@ -1,13 +1,8 @@
public class Doors
{
- public static void main(final String[] args)
- {
- boolean[] doors = new boolean[100];
-
- for (int pass = 0; pass < 10; pass++)
- doors[(pass + 1) * (pass + 1) - 1] = true;
-
- for(int i = 0; i < 100; i++)
- System.out.println("Door #" + (i + 1) + " is " + (doors[i] ? "open." : "closed."));
- }
+ public static void main(String[] args)
+ {
+ for(int i=0;i<10;i++)
+ System.out.println("Door #"+(i*(i+2)+1)+" is open.");
+ }
}
diff --git a/Task/100-doors/Java/100-doors-5.java b/Task/100-doors/Java/100-doors-5.java
index 2d89ca9dc4..318cd39a24 100644
--- a/Task/100-doors/Java/100-doors-5.java
+++ b/Task/100-doors/Java/100-doors-5.java
@@ -2,11 +2,12 @@ public class Doors
{
public static void main(final String[] args)
{
- StringBuilder sb = new StringBuilder();
+ boolean[] doors = new boolean[100];
- for (int i = 1; i <= 10; i++)
- sb.append("Door #").append(i*i).append(" is open\n");
+ for (int pass = 0; pass < 10; pass++)
+ doors[(pass + 1) * (pass + 1) - 1] = true;
- System.out.println(sb.toString());
+ for(int i = 0; i < 100; i++)
+ System.out.println("Door #" + (i + 1) + " is " + (doors[i] ? "open." : "closed."));
}
}
diff --git a/Task/100-doors/Java/100-doors-6.java b/Task/100-doors/Java/100-doors-6.java
index 4d4b8e884c..2d89ca9dc4 100644
--- a/Task/100-doors/Java/100-doors-6.java
+++ b/Task/100-doors/Java/100-doors-6.java
@@ -1,13 +1,12 @@
-public class Doors{
- public static void main(String[] args){
- int i;
- for(i = 1; i < 101; i++){
- double sqrt = Math.sqrt(i);
- if(sqrt != (int)sqrt){
- System.out.println("Door " + i + " is closed");
- }else{
- System.out.println("Door " + i + " is open");
- }
- }
- }
+public class Doors
+{
+ public static void main(final String[] args)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ for (int i = 1; i <= 10; i++)
+ sb.append("Door #").append(i*i).append(" is open\n");
+
+ System.out.println(sb.toString());
+ }
}
diff --git a/Task/100-doors/Java/100-doors-7.java b/Task/100-doors/Java/100-doors-7.java
new file mode 100644
index 0000000000..4d4b8e884c
--- /dev/null
+++ b/Task/100-doors/Java/100-doors-7.java
@@ -0,0 +1,13 @@
+public class Doors{
+ public static void main(String[] args){
+ int i;
+ for(i = 1; i < 101; i++){
+ double sqrt = Math.sqrt(i);
+ if(sqrt != (int)sqrt){
+ System.out.println("Door " + i + " is closed");
+ }else{
+ System.out.println("Door " + i + " is open");
+ }
+ }
+ }
+}
diff --git a/Task/100-doors/JavaScript/100-doors-10.js b/Task/100-doors/JavaScript/100-doors-10.js
index 82bffcfb20..7378d4bae5 100644
--- a/Task/100-doors/JavaScript/100-doors-10.js
+++ b/Task/100-doors/JavaScript/100-doors-10.js
@@ -1,14 +1,9 @@
-(function () {
+// Array comprehension style
+[ for (i of Array.apply(null, { length: 100 })) i ].forEach((_, i) => {
+ var door = i + 1
+ var sqrt = Math.sqrt(door);
- return rng(1, Math.sqrt(100)).map(function (x) {
- return x * x;
- });
-
- // rng(1, 20) --> [1..20]
- function rng(m, n) {
- return Array.apply(null, Array(n - m + 1)).map(function (x, i) {
- return m + i;
- });
+ if (sqrt === (sqrt | 0)) {
+ console.log("Door %d is open", door);
}
-
-})();
+});
diff --git a/Task/100-doors/JavaScript/100-doors-11.js b/Task/100-doors/JavaScript/100-doors-11.js
index 162c896db8..c2190391c8 100644
--- a/Task/100-doors/JavaScript/100-doors-11.js
+++ b/Task/100-doors/JavaScript/100-doors-11.js
@@ -1 +1,29 @@
-[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
+(function (n) {
+
+
+ // ONLY PERFECT SQUARES HAVE AN ODD NUMBER OF INTEGER FACTORS
+ // (Leaving the door open at the end of the process)
+
+ return perfectSquaresUpTo(n);
+
+
+ // perfectSquaresUpTo :: Int -> [Int]
+ function perfectSquaresUpTo(n) {
+ return range(1, Math.floor(Math.sqrt(n)))
+ .map(x => x * x);
+ }
+
+
+ // GENERIC
+
+ // range(intFrom, intTo, optional intStep)
+ // Int -> Int -> Maybe Int -> [Int]
+ function range(m, n, step) {
+ let d = (step || 1) * (n >= m ? 1 : -1);
+
+ return Array.from({
+ length: Math.floor((n - m) / d) + 1
+ }, (_, i) => m + (i * d));
+ }
+
+})(100);
diff --git a/Task/100-doors/JavaScript/100-doors-12.js b/Task/100-doors/JavaScript/100-doors-12.js
index 2e3d824574..162c896db8 100644
--- a/Task/100-doors/JavaScript/100-doors-12.js
+++ b/Task/100-doors/JavaScript/100-doors-12.js
@@ -1,9 +1 @@
-Array.apply(null, { length: 100 })
- .map((v, i) => i + 1)
- .forEach(door => {
- var sqrt = Math.sqrt(door);
-
- if (sqrt === (sqrt | 0)) {
- console.log("Door %d is open", door);
- }
- });
+[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
diff --git a/Task/100-doors/JavaScript/100-doors-2.js b/Task/100-doors/JavaScript/100-doors-2.js
index bd5c2b1146..589024f58d 100644
--- a/Task/100-doors/JavaScript/100-doors-2.js
+++ b/Task/100-doors/JavaScript/100-doors-2.js
@@ -1,41 +1,80 @@
-(function () {
- return chain(
+(function (n) {
+ 'use strict';
- // 100 passes ...
- rng(0, 99).reduce(function (a, _, i) {
- return a.slice(0, i).concat(
- a.slice(i).map(function (v, j) {
- return (i + j + 1) % (i + 1) ? v : {
- door: v.door,
- open: !v.open
- };
- })
- )
- },
- // 100 closed doors at start
- Array.apply(null, Array(100)).map(function (x, i) {
- return {
- open: false,
- door: i + 1
- };
- })),
+ // finalDoors :: Int -> [(Int, Bool)]
+ function finalDoors(n) {
+ var lstRange = range(1, n);
- // Filtering by chained function
- function (door) {
- return door.open ? [door] : [];
+ return lstRange
+ .reduce(function (a, _, k) {
+ var m = k + 1;
+
+ return a.map(function (x, i) {
+ var j = i + 1;
+
+ return [j, j % m ? x[1] : !x[1]];
+ });
+ }, zip(
+ lstRange,
+ replicate(n, false)
+ ));
+ };
+
+
+
+ // GENERIC FUNCTIONS
+
+ // zip :: [a] -> [b] -> [(a,b)]
+ function zip(xs, ys) {
+ return xs.length === ys.length ? (
+ xs.map(function (x, i) {
+ return [x, ys[i]];
+ })
+ ) : undefined;
}
- )
- // Monadic bind (chain) for lists
- function chain(xs, f) {
- return [].concat.apply([], xs.map(f));
- }
+ // replicate :: Int -> a -> [a]
+ function replicate(n, a) {
+ var v = [a],
+ o = [];
- // range(1, 20) --> [1..20]
- function rng(m, n) {
- return Array.apply(null, Array(n - m + 1)).map(function (x, i) {
- return m + i;
- });
- }
-})();
+ if (n < 1) return o;
+ while (n > 1) {
+ if (n & 1) o = o.concat(v);
+ n >>= 1;
+ v = v.concat(v);
+ }
+ return o.concat(v);
+ }
+
+ // range(intFrom, intTo, optional intStep)
+ // Int -> Int -> Maybe Int -> [Int]
+ function range(m, n, delta) {
+ var d = delta || 1,
+ blnUp = n > m,
+ lng = Math.floor((blnUp ? n - m : m - n) / d) + 1,
+ a = Array(lng),
+ i = lng;
+
+ if (blnUp)
+ while (i--) a[i] = (d * i) + m;
+ else
+ while (i--) a[i] = m - (d * i);
+
+ return a;
+ }
+
+
+ return finalDoors(n)
+ .filter(function (tuple) {
+ return tuple[1];
+ })
+ .map(function (tuple) {
+ return {
+ door: tuple[0],
+ open: tuple[1]
+ };
+ });
+
+})(100);
diff --git a/Task/100-doors/JavaScript/100-doors-6.js b/Task/100-doors/JavaScript/100-doors-6.js
index 7a4f61260e..a541d6e13c 100644
--- a/Task/100-doors/JavaScript/100-doors-6.js
+++ b/Task/100-doors/JavaScript/100-doors-6.js
@@ -1,9 +1,44 @@
-Array.apply(null, { length: 100 })
- .map(function(v, i) { return i + 1; })
- .forEach(function(door) {
- var sqrt = Math.sqrt(door);
+(function (n) {
+ 'use strict';
- if (sqrt === (sqrt | 0)) {
- console.log("Door %d is open", door);
- }
- });
+ return range(1, 100)
+ .filter(function (x) {
+ return integerFactors(x)
+ .length % 2;
+ });
+
+ function integerFactors(n) {
+ var rRoot = Math.sqrt(n),
+ intRoot = Math.floor(rRoot),
+
+ lows = range(1, intRoot)
+ .filter(function (x) {
+ return (n % x) === 0;
+ });
+
+ // for perfect squares, we can drop the head of the 'highs' list
+ return lows.concat(lows.map(function (x) {
+ return n / x;
+ })
+ .reverse()
+ .slice((rRoot === intRoot) | 0));
+ }
+
+ // range(intFrom, intTo, optional intStep)
+ // Int -> Int -> Maybe Int -> [Int]
+ function range(m, n, delta) {
+ var d = delta || 1,
+ blnUp = n > m,
+ lng = Math.floor((blnUp ? n - m : m - n) / d) + 1,
+ a = Array(lng),
+ i = lng;
+
+ if (blnUp)
+ while (i--) a[i] = (d * i) + m;
+ else
+ while (i--) a[i] = m - (d * i);
+
+ return a;
+ }
+
+})(100);
diff --git a/Task/100-doors/JavaScript/100-doors-7.js b/Task/100-doors/JavaScript/100-doors-7.js
index 69f398813c..0a165455b3 100644
--- a/Task/100-doors/JavaScript/100-doors-7.js
+++ b/Task/100-doors/JavaScript/100-doors-7.js
@@ -1,34 +1,31 @@
-(function () {
- return chain(
+(function (n) {
+ 'use strict';
- rng(1, 100),
+ return perfectSquaresUpTo(100);
- function (x) {
- var root = Math.sqrt(x);
-
- return root === Math.floor(root) ? inject(x) : fail();
+ function perfectSquaresUpTo(n) {
+ return range(1, Math.floor(Math.sqrt(n)))
+ .map(function (x) {
+ return x * x;
+ });
}
- );
+ // GENERIC
- /*************************************************************/
+ // range(intFrom, intTo, optional intStep)
+ // Int -> Int -> Maybe Int -> [Int]
+ function range(m, n, delta) {
+ var d = delta || 1,
+ blnUp = n > m,
+ lng = Math.floor((blnUp ? n - m : m - n) / d) + 1,
+ a = Array(lng),
+ i = lng;
- // monadic Bind/chain for lists
- function chain(xs, f) {
- return [].concat.apply([], xs.map(f));
- }
+ if (blnUp)
+ while (i--) a[i] = (d * i) + m;
+ else
+ while (i--) a[i] = m - (d * i);
+ return a;
+ }
- // monadic Return/inject for lists
- function inject(x) { return [x]; }
-
- // monadic Fail for lists
- function fail() { return []; }
-
- // rng(1, 20) --> [1..20]
- function rng(m, n) {
- return Array.apply(null, Array(n - m + 1)).map(function (x, i) {
- return m + i;
- });
- }
-
-})();
+})(100);
diff --git a/Task/100-doors/JavaScript/100-doors-9.js b/Task/100-doors/JavaScript/100-doors-9.js
index d963e627fd..2e3d824574 100644
--- a/Task/100-doors/JavaScript/100-doors-9.js
+++ b/Task/100-doors/JavaScript/100-doors-9.js
@@ -1,18 +1,9 @@
-(function () {
+Array.apply(null, { length: 100 })
+ .map((v, i) => i + 1)
+ .forEach(door => {
+ var sqrt = Math.sqrt(door);
- return rng(1, 100).filter(
- function (x) {
- var root = Math.sqrt(x);
-
- return root === Math.floor(root);
- }
- );
-
- // rng(1, 20) --> [1..20]
- function rng(m, n) {
- return Array.apply(null, Array(n - m + 1)).map(function (x, i) {
- return m + i;
+ if (sqrt === (sqrt | 0)) {
+ console.log("Door %d is open", door);
+ }
});
- }
-
-})();
diff --git a/Task/100-doors/Kotlin/100-doors.kotlin b/Task/100-doors/Kotlin/100-doors.kotlin
index 8055e822a6..a7a693598e 100644
--- a/Task/100-doors/Kotlin/100-doors.kotlin
+++ b/Task/100-doors/Kotlin/100-doors.kotlin
@@ -1,11 +1,10 @@
fun oneHundredDoors(): List {
- val doors = Array(100, { false })
+ val doors = BooleanArray(100, { false })
for (i in 0..99)
for (j in i..99 step (i + 1))
doors[j] = !doors[j]
- return IndexIterator(doors.iterator()).filter { it.second }
- .map { it.first + 1 }
- .toList()
+ return doors.asSequence().mapIndexed { i, b -> i to b }.filter { it.second }
+ .map { it.first + 1 }.toList()
}
diff --git a/Task/100-doors/Lua/100-doors.lua b/Task/100-doors/Lua/100-doors.lua
index c8c0b476a3..3183bc7730 100644
--- a/Task/100-doors/Lua/100-doors.lua
+++ b/Task/100-doors/Lua/100-doors.lua
@@ -1,6 +1,4 @@
-is_open = {}
-
-for door = 1,100 do is_open[door] = false end
+local is_open = {}
for pass = 1,100 do
for door = pass,100,pass do
@@ -9,9 +7,5 @@ for pass = 1,100 do
end
for i,v in next,is_open do
- if v then
- print ('Door '..i..':','open')
- else
- print ('Door '..i..':', 'close')
- end
+ print ('Door '..i..':',v and 'open' or 'close')
end
diff --git a/Task/100-doors/NewLISP/100-doors-1.newlisp b/Task/100-doors/NewLISP/100-doors-1.newlisp
new file mode 100644
index 0000000000..ed824eef9d
--- /dev/null
+++ b/Task/100-doors/NewLISP/100-doors-1.newlisp
@@ -0,0 +1,8 @@
+(define (status door-num)
+ (let ((x (int (sqrt door-num))))
+ (if
+ (= (* x x) door-num) (string "Door " door-num " Open")
+ (string "Door " door-num " Closed"))))
+
+(dolist (n (map status (sequence 1 100)))
+ (println n))
diff --git a/Task/100-doors/NewLISP/100-doors-2.newlisp b/Task/100-doors/NewLISP/100-doors-2.newlisp
new file mode 100644
index 0000000000..f50fcefad6
--- /dev/null
+++ b/Task/100-doors/NewLISP/100-doors-2.newlisp
@@ -0,0 +1,9 @@
+(set 'Doors (array 100)) ;; Default value: nil (Closed)
+
+(for (x 0 99)
+ (for (y x 99 (+ 1 x))
+ (setf (Doors y) (not (Doors y)))))
+
+(for (x 0 99) ;; Display open doors
+ (if (Doors x)
+ (println (+ x 1) " : Open")))
diff --git a/Task/100-doors/OCaml/100-doors-3.ocaml b/Task/100-doors/OCaml/100-doors-3.ocaml
new file mode 100644
index 0000000000..ea9c489c58
--- /dev/null
+++ b/Task/100-doors/OCaml/100-doors-3.ocaml
@@ -0,0 +1,24 @@
+type door = Open | Closed (* human readable code *)
+
+let flipdoor = function Open -> Closed | Closed -> Open
+
+let string_of_door =
+ function Open -> "is open." | Closed -> "is closed."
+
+let printdoors ls =
+ let f i d = Printf.printf "Door %i %s\n" (i + 1) (string_of_door d)
+ in List.iteri f ls
+
+let outerlim = 100
+let innerlim = 100
+
+let rec outer cnt accu =
+ let rec inner i door = match i > innerlim with (* define inner loop *)
+ | true -> door
+ | false -> inner (i + 1) (if (cnt mod i) = 0 then flipdoor door else door)
+ in (* define and do outer loop *)
+ match cnt > outerlim with
+ | true -> List.rev accu
+ | false -> outer (cnt + 1) (inner 1 Closed :: accu) (* generate new entries with inner *)
+
+let () = printdoors (outer 1 [])
diff --git a/Task/100-doors/Onyx/100-doors.onyx b/Task/100-doors/Onyx/100-doors.onyx
new file mode 100644
index 0000000000..67dff847ce
--- /dev/null
+++ b/Task/100-doors/Onyx/100-doors.onyx
@@ -0,0 +1,9 @@
+$Door dict def
+1 1 100 {Door exch false put} for
+$Toggle {dup Door exch get not Door up put} def
+$EveryNthDoor {dup 100 {Toggle} for} def
+$Run {1 1 100 {EveryNthDoor} for} def
+$ShowDoor {dup `Door no. ' exch cvs cat ` is ' cat
+ exch Door exch get {`open.\n'}{`shut.\n'} ifelse cat
+ print flush} def
+Run 1 1 100 {ShowDoor} for
diff --git a/Task/100-doors/Perl-6/100-doors-5.pl6 b/Task/100-doors/Perl-6/100-doors-5.pl6
new file mode 100644
index 0000000000..5dbedccd7c
--- /dev/null
+++ b/Task/100-doors/Perl-6/100-doors-5.pl6
@@ -0,0 +1,26 @@
+sub output( @arr, $max ) {
+ my $output = 1;
+ for 1..^$max -> $index {
+ if @arr[$index] {
+ printf "%4d", $index;
+ say '' if $output++ %% 10;
+ }
+ }
+ say '';
+}
+
+sub MAIN ( Int :$doors = 100 ) {
+ my $doorcount = $doors + 1;
+ my @door[$doorcount] = 0 xx ($doorcount);
+
+ INDEX:
+ for 1...^$doorcount -> $index {
+ # flip door $index & its multiples, up to last door.
+ #
+ for ($index, * + $index ... *)[^$doors] -> $multiple {
+ next INDEX if $multiple > $doors;
+ @door[$multiple] = @door[$multiple] ?? 0 !! 1;
+ }
+ }
+ output @door, $doors+1;
+}
diff --git a/Task/100-doors/Processing/100-doors b/Task/100-doors/Processing/100-doors
new file mode 100644
index 0000000000..88c508c22f
--- /dev/null
+++ b/Task/100-doors/Processing/100-doors
@@ -0,0 +1,19 @@
+boolean[] doors = new boolean[100];
+
+void setup() {
+ for (int i = 0; i < 100; i++) {
+ doors[i] = false;
+ }
+ for (int i = 1; i < 100; i++) {
+ for (int j = 0; j < 100; j += i) {
+ doors[j] = !doors[j];
+ }
+ }
+ println("Open:");
+ for (int i = 1; i < 100; i++) {
+ if (doors[i]) {
+ println(i);
+ }
+ }
+ exit();
+}
diff --git a/Task/100-doors/Python/100-doors-1.py b/Task/100-doors/Python/100-doors-1.py
index 55ad725caf..b45b458c2c 100644
--- a/Task/100-doors/Python/100-doors-1.py
+++ b/Task/100-doors/Python/100-doors-1.py
@@ -1,5 +1,5 @@
doors = [False] * 100
-for i in xrange(100):
- for j in xrange(i, 100, i+1):
- doors[j] = not doors[j]
- print "Door %d:" % (i+1), 'open' if doors[i] else 'close'
+for i in range(100):
+ for j in range(i, 100, i+1):
+ doors[j] = not doors[j]
+ print("Door %d:" % (i+1), 'open' if doors[i] else 'close')
diff --git a/Task/100-doors/REXX/100-doors-1.rexx b/Task/100-doors/REXX/100-doors-1.rexx
index f81469ac5e..0ee5ea71a6 100644
--- a/Task/100-doors/REXX/100-doors-1.rexx
+++ b/Task/100-doors/REXX/100-doors-1.rexx
@@ -1,11 +1,17 @@
-/*rexx*/
-door. = 0
-do inc = 1 to 100
- do d = inc to 100 by inc
- door.d = \door.d
- end
-end
-say "The open doors after 100 passes:"
-do i = 1 to 100
- if door.i = 1 then say i
-end
+/*REXX pgm solves the 100 doors puzzle, doing it the hard way by opening/closing doors.*/
+parse arg doors . /*obtain the optional argument from CL.*/
+if doors=='' | doors=="," then doors=100 /*not specified? Then assume 100 doors*/
+ /* 0 = the door is closed. */
+ /* 1 = " " " open. */
+door.=0 /*assume all doors are closed at start.*/
+ do #=1 for doors /*process a pass─through for all doors.*/
+ do j=# by # to doors /* ··· every Jth door from this point.*/
+ door.j= \door.j /*toggle the "openness" of the door. */
+ end /*j*/
+ end /*#*/
+
+say 'After ' doors " passes, the following doors are open:"
+say
+ do k=1 for doors
+ if door.k then say right(k, 20) /*add some indentation for the output. */
+ end /*k*/ /*stick a fork in it, we're all done. */
diff --git a/Task/100-doors/REXX/100-doors-2.rexx b/Task/100-doors/REXX/100-doors-2.rexx
index 88580a4ef5..cf560ab58d 100644
--- a/Task/100-doors/REXX/100-doors-2.rexx
+++ b/Task/100-doors/REXX/100-doors-2.rexx
@@ -1,18 +1,8 @@
-/*REXX program to solve the 100 door puzzle, the hard-way version. */
-parse arg doors . /*get the first argument (# of doors.) */
-if doors=='' then doors=100 /*not specified? Then assume 100 doors*/
- /* 0 = closed. */
- /* 1 = open. */
-door.=0 /*assume all that all doors are closed.*/
-
- do j=1 for doors /*process a pass-through for all doors.*/
- do k=j by j to doors /* ... every Jth door from this point. */
- door.k=\door.k /*toggle the "openness" of the door. */
- end /*k*/
- end /*j*/
+/*REXX pgm solves the 100 doors puzzle, doing it the easy way by calculating squares.*/
+parse arg doors . /*obtain the optional argument from CL.*/
+if doors=='' | doors=="," then doors=100 /*not specified? Then assume 100 doors*/
+say 'After ' doors " passes, the following doors are open:"
say
-say 'After' doors "passes, the following doors are open:"
-say
- do n=1 for doors
- if door.n then say right(n,20)
- end /*n*/
+ do #=1 while #**2 <= doors /*process easy pass─through (squares).*/
+ say right(#**2, 20) /*add some indentation for the output. */
+ end /*#*/ /*stick a fork in it, we're all done. */
diff --git a/Task/100-doors/Rust/100-doors-3.rust b/Task/100-doors/Rust/100-doors-3.rust
new file mode 100644
index 0000000000..e263967d6f
--- /dev/null
+++ b/Task/100-doors/Rust/100-doors-3.rust
@@ -0,0 +1,5 @@
+fn main() {
+ for i in 1u32..11u32{
+ println!("Door {} is open", i.pow(2));
+ }
+}
diff --git a/Task/100-doors/SuperCollider/100-doors.supercollider b/Task/100-doors/SuperCollider/100-doors.supercollider
new file mode 100644
index 0000000000..cedeb6c654
--- /dev/null
+++ b/Task/100-doors/SuperCollider/100-doors.supercollider
@@ -0,0 +1,6 @@
+(
+var n = 100, doors = false ! n;
+var pass = { |j| (0, j .. n-1).do { |i| doors[i] = doors[i].not } };
+(1..n-1).do(pass);
+doors.selectIndices { |open| open }; // all are closed except [ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 ]
+)
diff --git a/Task/100-doors/VBA/100-doors.vba b/Task/100-doors/VBA/100-doors.vba
index d8c760bf4d..671efa391e 100644
--- a/Task/100-doors/VBA/100-doors.vba
+++ b/Task/100-doors/VBA/100-doors.vba
@@ -11,3 +11,42 @@ For i = 1 To 100 Step 1
End If
Next i
End Sub
+
+
+*** USE THIS ONE, SEE COMMENTED LINES, DONT KNOW WHY EVERYBODY FOLLOWED OTHERS ANSWERS AND CODED THE PROBLEM DIFFERENTLY ***
+*** ALWAYS USE AND TEST A READABLE, EASY TO COMPREHEND CODING BEFORE 'OPTIMIZING' YOUR CODE AND TEST THE 'OPTIMIZED' CODE AGAINST THE 'READABLE' ONE.
+Panikkos Savvides.
+
+
+Sub Rosetta_100Doors2()
+Dim Door(100) As Boolean, i As Integer, j As Integer
+Dim strAns As String
+' There are 100 doors in a row that are all initially closed.
+' You make 100 passes by the doors.
+For j = 1 To 100
+ ' The first time through, visit every door and toggle the door
+ ' (if the door is closed, open it; if it is open, close it).
+ For i = 1 To 100 Step 1
+ Door(i) = Not Door(i)
+ Next i
+ ' The second time, only visit every 2nd door (door #2, #4, #6, ...), and toggle it.
+ For i = 2 To 100 Step 2
+ Door(i) = Not Door(i)
+ Next i
+ ' The third time, visit every 3rd door (door #3, #6, #9, ...), etc, until you only visit the 100th door.
+ For i = 3 To 100 Step 3
+ Door(i) = Not Door(i)
+ Next i
+Next j
+
+For j = 1 To 100
+ If Door(j) = True Then
+ strAns = j & strAns & ", "
+ End If
+Next j
+
+If Right(strAns, 2) = ", " Then strAns = Left(strAns, Len(strAns) - 2)
+If Len(strAns) = 0 Then strAns = "0"
+Debug.Print "Doors [" & strAns & "] are open, the rest are closed."
+' Doors [0] are open, the rest are closed., AKA ZERO DOORS OPEN
+End Sub
diff --git a/Task/24-game-Solve/00DESCRIPTION b/Task/24-game-Solve/00DESCRIPTION
index 3828d70f94..94a27b24cc 100644
--- a/Task/24-game-Solve/00DESCRIPTION
+++ b/Task/24-game-Solve/00DESCRIPTION
@@ -1,5 +1,9 @@
+;task:
Write a program that takes four digits, either from user input or by random generation, and computes arithmetic expressions following the rules of the [[24 game]].
Show examples of solutions generated by the program.
-C.F: [[Arithmetic Evaluator]]
+
+;Related task:
+* [[Arithmetic Evaluator]]
+
diff --git a/Task/24-game-Solve/COBOL/24-game-solve.cobol b/Task/24-game-Solve/COBOL/24-game-solve.cobol
new file mode 100644
index 0000000000..086cf6c30b
--- /dev/null
+++ b/Task/24-game-Solve/COBOL/24-game-solve.cobol
@@ -0,0 +1,446 @@
+ >>SOURCE FORMAT FREE
+*> This code is dedicated to the public domain
+*> This is GNUCobol 2.0
+identification division.
+program-id. twentyfoursolve.
+environment division.
+configuration section.
+repository. function all intrinsic.
+input-output section.
+file-control.
+ select count-file
+ assign to count-file-name
+ file status count-file-status
+ organization line sequential.
+data division.
+file section.
+fd count-file.
+01 count-record pic x(7).
+
+working-storage section.
+01 count-file-name pic x(64) value 'solutioncounts'.
+01 count-file-status pic xx.
+
+01 command-area.
+ 03 nd pic 9.
+ 03 number-definition.
+ 05 n occurs 4 pic 9.
+ 03 number-definition-9 redefines number-definition
+ pic 9(4).
+ 03 command-input pic x(16).
+ 03 command pic x(5).
+ 03 number-count pic 9999.
+ 03 l1 pic 99.
+ 03 l2 pic 99.
+ 03 expressions pic zzz,zzz,zz9.
+
+01 number-validation.
+ 03 px pic 99.
+ 03 permutations value
+ '1234'
+ & '1243'
+ & '1324'
+ & '1342'
+ & '1423'
+ & '1432'
+
+ & '2134'
+ & '2143'
+ & '2314'
+ & '2341'
+ & '2413'
+ & '2431'
+
+ & '3124'
+ & '3142'
+ & '3214'
+ & '3241'
+ & '3423'
+ & '3432'
+
+ & '4123'
+ & '4132'
+ & '4213'
+ & '4231'
+ & '4312'
+ & '4321'.
+ 05 permutation occurs 24 pic x(4).
+ 03 cpx pic 9.
+ 03 current-permutation pic x(4).
+ 03 od1 pic 9.
+ 03 od2 pic 9.
+ 03 od3 pic 9.
+ 03 operator-definitions pic x(4) value '+-*/'.
+ 03 cox pic 9.
+ 03 current-operators pic x(3).
+ 03 rpn-forms value
+ 'nnonono'
+ & 'nnonnoo'
+ & 'nnnonoo'
+ & 'nnnoono'
+ & 'nnnnooo'.
+ 05 rpn-form occurs 5 pic x(7).
+ 03 rpx pic 9.
+ 03 current-rpn-form pic x(7).
+
+01 calculation-area.
+ 03 oqx pic 99.
+ 03 output-queue pic x(7).
+ 03 work-number pic s9999.
+ 03 top-numerator pic s9999 sign leading separate.
+ 03 top-denominator pic s9999 sign leading separate.
+ 03 rsx pic 9.
+ 03 result-stack occurs 8.
+ 05 numerator pic s9999.
+ 05 denominator pic s9999.
+ 03 divide-by-zero-error pic x.
+
+01 totals.
+ 03 s pic 999.
+ 03 s-lim pic 999 value 600.
+ 03 s-max pic 999 value 0.
+ 03 solution occurs 600 pic x(7).
+ 03 sc pic 999.
+ 03 sc1 pic 999.
+ 03 sc2 pic 9.
+ 03 sc-max pic 999 value 0.
+ 03 sc-lim pic 999 value 600.
+ 03 solution-counts value zeros.
+ 05 solution-count occurs 600 pic 999.
+ 03 ns pic 9999.
+ 03 ns-max pic 9999 value 0.
+ 03 ns-lim pic 9999 value 6561.
+ 03 number-solutions occurs 6561.
+ 05 ns-number pic x(4).
+ 05 ns-count pic 999.
+ 03 record-counts pic 9999.
+ 03 total-solutions pic 9999.
+
+01 infix-area.
+ 03 i pic 9.
+ 03 i-s pic 9.
+ 03 i-s1 pic 9.
+ 03 i-work pic x(16).
+ 03 i-stack occurs 7 pic x(13).
+
+procedure division.
+start-twentyfoursolve.
+ display 'start twentyfoursolve'
+ perform display-instructions
+ perform get-command
+ perform until command-input = spaces
+ display space
+ initialize command number-count
+ unstring command-input delimited by all space
+ into command number-count
+ move command-input to number-definition
+ move spaces to command-input
+ evaluate command
+ when 'h'
+ when 'help'
+ perform display-instructions
+ when 'list'
+ if ns-max = 0
+ perform load-solution-counts
+ end-if
+ perform list-counts
+ when 'show'
+ if ns-max = 0
+ perform load-solution-counts
+ end-if
+ perform show-numbers
+ when other
+ if number-definition-9 not numeric
+ display 'invalid number'
+ else
+ perform get-solutions
+ perform display-solutions
+ end-if
+ end-evaluate
+ if command-input = spaces
+ perform get-command
+ end-if
+ end-perform
+ display 'exit twentyfoursolve'
+ stop run
+ .
+display-instructions.
+ display space
+ display 'enter a number as four integers from 1-9 to see its solutions'
+ display 'enter list to see counts of solutions for all numbers'
+ display 'enter show to see numbers having solutions'
+ display ' ends the program'
+ .
+get-command.
+ display space
+ move spaces to command-input
+ display '(h for help)?' with no advancing
+ accept command-input
+ .
+ask-for-more.
+ display space
+ move 0 to l1
+ add 1 to l2
+ if l2 = 10
+ display 'more ()?' with no advancing
+ accept command-input
+ move 0 to l2
+ end-if
+ .
+list-counts.
+ add 1 to sc-max giving sc
+ display 'there are ' sc ' solution counts'
+ display space
+ display 'solutions/numbers'
+ move 0 to l1
+ move 0 to l2
+ perform varying sc from 1 by 1 until sc > sc-max
+ or command-input <> spaces
+ if solution-count(sc) > 0
+ subtract 1 from sc giving sc1 *> offset to capture zero counts
+ display sc1 '/' solution-count(sc) space with no advancing
+ add 1 to l1
+ if l1 = 8
+ perform ask-for-more
+ end-if
+ end-if
+ end-perform
+ if l1 > 0
+ display space
+ end-if
+ .
+show-numbers. *> with number-count solutions
+ add 1 to number-count giving sc1 *> offset for zero count
+ evaluate true
+ when number-count >= sc-max
+ display 'no number has ' number-count ' solutions'
+ exit paragraph
+ when solution-count(sc1) = 1 and number-count = 1
+ display '1 number has 1 solution'
+ when solution-count(sc1) = 1
+ display '1 number has ' number-count ' solutions'
+ when number-count = 1
+ display solution-count(sc1) ' numbers have 1 solution'
+ when other
+ display solution-count(sc1) ' numbers have ' number-count ' solutions'
+ end-evaluate
+ display space
+ move 0 to l1
+ move 0 to l2
+ perform varying ns from 1 by 1 until ns > ns-max
+ or command-input <> spaces
+ if ns-count(ns) = number-count
+ display ns-number(ns) space with no advancing
+ add 1 to l1
+ if l1 = 14
+ perform ask-for-more
+ end-if
+ end-if
+ end-perform
+ if l1 > 0
+ display space
+ end-if
+ .
+display-solutions.
+ evaluate s-max
+ when 0 display number-definition ' has no solutions'
+ when 1 display number-definition ' has 1 solution'
+ when other display number-definition ' has ' s-max ' solutions'
+ end-evaluate
+ display space
+ move 0 to l1
+ move 0 to l2
+ perform varying s from 1 by 1 until s > s-max
+ or command-input <> spaces
+ *> convert rpn solution(s) to infix
+ move 0 to i-s
+ perform varying i from 1 by 1 until i > 7
+ if solution(s)(i:1) >= '1' and <= '9'
+ add 1 to i-s
+ move solution(s)(i:1) to i-stack(i-s)
+ else
+ subtract 1 from i-s giving i-s1
+ move spaces to i-work
+ string '(' i-stack(i-s1) solution(s)(i:1) i-stack(i-s) ')'
+ delimited by space into i-work
+ move i-work to i-stack(i-s1)
+ subtract 1 from i-s
+ end-if
+ end-perform
+ display solution(s) space i-stack(1) space space with no advancing
+ add 1 to l1
+ if l1 = 3
+ perform ask-for-more
+ end-if
+ end-perform
+ if l1 > 0
+ display space
+ end-if
+ .
+load-solution-counts.
+ move 0 to ns-max *> numbers and their solution count
+ move 0 to sc-max *> solution counts
+ move spaces to count-file-status
+ open input count-file
+ if count-file-status <> '00'
+ perform create-count-file
+ move 0 to ns-max *> numbers and their solution count
+ move 0 to sc-max *> solution counts
+ open input count-file
+ end-if
+ read count-file
+ move 0 to record-counts
+ move zeros to solution-counts
+ perform until count-file-status <> '00'
+ add 1 to record-counts
+ perform increment-ns-max
+ move count-record to number-solutions(ns-max)
+ add 1 to ns-count(ns-max) giving sc *> offset 1 for zero counts
+ if sc > sc-lim
+ display 'sc ' sc ' exceeds sc-lim ' sc-lim
+ stop run
+ end-if
+ if sc > sc-max
+ move sc to sc-max
+ end-if
+ add 1 to solution-count(sc)
+ read count-file
+ end-perform
+ close count-file
+ .
+create-count-file.
+ open output count-file
+ display 'Counting solutions for all numbers'
+ display 'We will examine 9*9*9*9 numbers'
+ display 'For each number we will examine 4! permutations of the digits'
+ display 'For each permutation we will examine 4*4*4 combinations of operators'
+ display 'For each permutation and combination we will examine 5 rpn forms'
+ display 'We will count the number of unique solutions for the given number'
+ display 'Each number and its counts will be written to file ' trim(count-file-name)
+ compute expressions = 9*9*9*9*factorial(4)*4*4*4*5
+ display 'So we will evaluate ' trim(expressions) ' statements'
+ display 'This will take a few minutes'
+ display 'In the future if ' trim(count-file-name) ' exists, this step will be bypassed'
+ move 0 to record-counts
+ move 0 to total-solutions
+ perform varying n(1) from 1 by 1 until n(1) = 0
+ perform varying n(2) from 1 by 1 until n(2) = 0
+ display n(1) n(2) '..' *> show progress
+ perform varying n(3) from 1 by 1 until n(3) = 0
+ perform varying n(4) from 1 by 1 until n(4) = 0
+ perform get-solutions
+ perform increment-ns-max
+ move number-definition to ns-number(ns-max)
+ move s-max to ns-count(ns-max)
+ move number-solutions(ns-max) to count-record
+ write count-record
+ add s-max to total-solutions
+ add 1 to record-counts
+ add 1 to ns-count(ns-max) giving sc *> offset by 1 for zero counts
+ if sc > sc-lim
+ display 'error: ' sc ' solution count exceeds ' sc-lim
+ stop run
+ end-if
+ add 1 to solution-count(sc)
+ end-perform
+ end-perform
+ end-perform
+ end-perform
+ close count-file
+ display record-counts ' numbers and counts written to ' trim(count-file-name)
+ display total-solutions ' total solutions'
+ display space
+ .
+increment-ns-max.
+ if ns-max >= ns-lim
+ display 'error: numbers exceeds ' ns-lim
+ stop run
+ end-if
+ add 1 to ns-max
+ .
+get-solutions.
+ move 0 to s-max
+ perform varying px from 1 by 1 until px > 24
+ move permutation(px) to current-permutation
+ perform varying od1 from 1 by 1 until od1 > 4
+ move operator-definitions(od1:1) to current-operators(1:1)
+ perform varying od2 from 1 by 1 until od2 > 4
+ move operator-definitions(od2:1) to current-operators(2:1)
+ perform varying od3 from 1 by 1 until od3 > 4
+ move operator-definitions(od3:1) to current-operators(3:1)
+ perform varying rpx from 1 by 1 until rpx > 5
+ move rpn-form(rpx) to current-rpn-form
+ move 0 to cpx cox
+ move spaces to output-queue
+ perform varying oqx from 1 by 1 until oqx > 7
+ if current-rpn-form(oqx:1) = 'n'
+ add 1 to cpx
+ move current-permutation(cpx:1) to nd
+ move n(nd) to output-queue(oqx:1)
+ else
+ add 1 to cox
+ move current-operators(cox:1) to output-queue(oqx:1)
+ end-if
+ end-perform
+ perform evaluate-rpn
+ if divide-by-zero-error = space
+ and 24 * top-denominator = top-numerator
+ perform varying s from 1 by 1 until s > s-max
+ or solution(s) = output-queue
+ continue
+ end-perform
+ if s > s-max
+ if s >= s-lim
+ display 'error: solutions ' s ' for ' number-definition ' exceeds ' s-lim
+ stop run
+ end-if
+ move s to s-max
+ move output-queue to solution(s-max)
+ end-if
+ end-if
+ end-perform
+ end-perform
+ end-perform
+ end-perform
+ end-perform
+ .
+evaluate-rpn.
+ move space to divide-by-zero-error
+ move 0 to rsx *> stack depth
+ perform varying oqx from 1 by 1 until oqx > 7
+ if output-queue(oqx:1) >= '1' and <= '9'
+ *> push the digit onto the stack
+ add 1 to rsx
+ move top-numerator to numerator(rsx)
+ move top-denominator to denominator(rsx)
+ move output-queue(oqx:1) to top-numerator
+ move 1 to top-denominator
+ else
+ *> apply the operation
+ evaluate output-queue(oqx:1)
+ when '+'
+ compute top-numerator = top-numerator * denominator(rsx)
+ + top-denominator * numerator(rsx)
+ compute top-denominator = top-denominator * denominator(rsx)
+ when '-'
+ compute top-numerator = top-denominator * numerator(rsx)
+ - top-numerator * denominator(rsx)
+ compute top-denominator = top-denominator * denominator(rsx)
+ when '*'
+ compute top-numerator = top-numerator * numerator(rsx)
+ compute top-denominator = top-denominator * denominator(rsx)
+ when '/'
+ compute work-number = numerator(rsx) * top-denominator
+ compute top-denominator = denominator(rsx) * top-numerator
+ if top-denominator = 0
+ move 'y' to divide-by-zero-error
+ exit paragraph
+ end-if
+ move work-number to top-numerator
+ end-evaluate
+ *> pop the stack
+ subtract 1 from rsx
+ end-if
+ end-perform
+ .
+end program twentyfoursolve.
diff --git a/Task/24-game-Solve/Elixir/24-game-solve.elixir b/Task/24-game-Solve/Elixir/24-game-solve.elixir
new file mode 100644
index 0000000000..bbb23ef0e6
--- /dev/null
+++ b/Task/24-game-Solve/Elixir/24-game-solve.elixir
@@ -0,0 +1,46 @@
+defmodule Game24 do
+ @expressions [ ["((", "", ")", "", ")", ""],
+ ["(", "(", "", "", "))", ""],
+ ["(", "", ")", "(", "", ")"],
+ ["", "((", "", "", ")", ")"],
+ ["", "(", "", "(", "", "))"] ]
+
+ def solve(digits) do
+ dig_perm = permute(digits) |> Enum.uniq
+ operators = perm_rep(~w[+ - * /], 3)
+ for dig <- dig_perm, ope <- operators, expr <- @expressions,
+ check?(str = make_expr(dig, ope, expr)),
+ do: str
+ end
+
+ defp check?(str) do
+ try do
+ {val, _} = Code.eval_string(str)
+ val == 24
+ rescue
+ ArithmeticError -> false # division by zero
+ end
+ end
+
+ defp permute([]), do: [[]]
+ defp permute(list) do
+ for x <- list, y <- permute(list -- [x]), do: [x|y]
+ end
+
+ defp perm_rep([], _), do: [[]]
+ defp perm_rep(_, 0), do: [[]]
+ defp perm_rep(list, i) do
+ for x <- list, y <- perm_rep(list, i-1), do: [x|y]
+ end
+
+ defp make_expr([a,b,c,d], [x,y,z], [e0,e1,e2,e3,e4,e5]) do
+ e0 <> a <> x <> e1 <> b <> e2 <> y <> e3 <> c <> e4 <> z <> d <> e5
+ end
+end
+
+case Game24.solve(System.argv) do
+ [] -> IO.puts "no solutions"
+ solutions ->
+ IO.puts "found #{length(solutions)} solutions, including #{hd(solutions)}"
+ IO.inspect Enum.sort(solutions)
+end
diff --git a/Task/24-game-Solve/Perl-6/24-game-solve.pl6 b/Task/24-game-Solve/Perl-6/24-game-solve.pl6
index ca5fdddfb3..7d0af0d32d 100644
--- a/Task/24-game-Solve/Perl-6/24-game-solve.pl6
+++ b/Task/24-game-Solve/Perl-6/24-game-solve.pl6
@@ -1,18 +1,19 @@
+use MONKEY-SEE-NO-EVAL;
+
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, "
+ @digits.append: (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;
+my @ops = [X,] <+ - * /> xx 3;
# Enough sprintf formats to cover most precedence orderings
my @formats = (
@@ -26,34 +27,16 @@ my @formats = (
);
# Brute force test the different permutations
-for unique permutations @digits -> @p {
+for unique @digits.permutations -> @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) };
+ my $string = sprintf $format, flat roundrobin(|@p; |@o);
+ my $result = 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;
diff --git a/Task/24-game-Solve/Ruby/24-game-solve.rb b/Task/24-game-Solve/Ruby/24-game-solve.rb
index c6016c35ad..f183f47d15 100644
--- a/Task/24-game-Solve/Ruby/24-game-solve.rb
+++ b/Task/24-game-Solve/Ruby/24-game-solve.rb
@@ -1,29 +1,22 @@
-class TwentyFourGamePlayer
+class TwentyFourGame
EXPRESSIONS = [
- '((%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))',
- ].map{|expr| [expr, expr.gsub('%d', 'Rational(%d,1)')]}
+ '((%dr %s %dr) %s %dr) %s %dr',
+ '(%dr %s (%dr %s %dr)) %s %dr',
+ '(%dr %s %dr) %s (%dr %s %dr)',
+ '%dr %s ((%dr %s %dr) %s %dr)',
+ '%dr %s (%dr %s (%dr %s %dr))',
+ ]
- OPERATORS = [:+, :-, :*, :/].repeated_permutation(3)
-
- OBJECTIVE = Rational(24,1)
+ OPERATORS = [:+, :-, :*, :/].repeated_permutation(3).to_a
def self.solve(digits)
solutions = []
- digits.permutation.to_a.uniq.each do |a,b,c,d|
- OPERATORS.each do |op1,op2,op3|
- EXPRESSIONS.each do |expr,expr_rat|
- # evaluate using rational arithmetic
- test = expr_rat % [a, op1, b, op2, c, op3, d]
- value = eval(test) rescue -1 # catch division by zero
- if value == OBJECTIVE
- solutions << expr % [a, op1, b, op2, c, op3, d]
- end
- end
- end
+ perms = digits.permutation.to_a.uniq
+ perms.product(OPERATORS, EXPRESSIONS) do |(a,b,c,d), (op1,op2,op3), expr|
+ # evaluate using rational arithmetic
+ text = expr % [a, op1, b, op2, c, op3, d]
+ value = eval(text) rescue next # catch division by zero
+ solutions << text.delete("r") if value == 24
end
solutions
end
@@ -39,7 +32,7 @@ digits = ARGV.map do |arg|
end
digits.size == 4 or raise "error: need 4 digits, only have #{digits.size}"
-solutions = TwentyFourGamePlayer.solve(digits)
+solutions = TwentyFourGame.solve(digits)
if solutions.empty?
puts "no solutions"
else
diff --git a/Task/24-game/00DESCRIPTION b/Task/24-game/00DESCRIPTION
index 8e28595bf2..720125f53a 100644
--- a/Task/24-game/00DESCRIPTION
+++ b/Task/24-game/00DESCRIPTION
@@ -1,18 +1,28 @@
The [[wp:24 Game|24 Game]] tests one's mental arithmetic.
-Write a program that [[task feature::Rosetta Code:randomness|randomly]] chooses and [[task feature::Rosetta Code:user output|displays]] four digits, each from one to nine, with repetitions allowed. The program should prompt for the player to enter an arithmetic expression using ''just'' those, and ''all'' of those four digits, used exactly ''once'' each. The program should ''check'' then [[task feature::Rosetta Code:parsing|evaluate the expression]].
-The goal is for the player to [[task feature::Rosetta Code:user input|enter]] an expression that evaluates to '''24'''.
-* Only multiplication, division, addition, and subtraction operators/functions are allowed.
-* Division should use floating point or rational arithmetic, etc, to preserve remainders.
-* Brackets are allowed, if using an infix expression evaluator.
-* Forming multiple digit numbers from the supplied digits is ''disallowed''. (So an answer of 12+12 when given 1, 2, 2, and 1 is wrong).
-* The order of the digits when given does not have to be preserved.
-Note:
+;Task
+Write a program that [[task feature::Rosetta Code:randomness|randomly]] chooses and [[task feature::Rosetta Code:user output|displays]] four digits, each from 1 ──► 9 (inclusive) with repetitions allowed.
+
+The program should prompt for the player to enter an arithmetic expression using ''just'' those, and ''all'' of those four digits, used exactly ''once'' each. The program should ''check'' then [[task feature::Rosetta Code:parsing|evaluate the expression]].
+
+The goal is for the player to [[task feature::Rosetta Code:user input|enter]] an expression that (numerically) evaluates to '''24'''.
+* Only the following operators/functions are allowed: multiplication, division, addition, subtraction
+* Division should use floating point or rational arithmetic, etc, to preserve remainders.
+* Brackets are allowed, if using an infix expression evaluator.
+* Forming multiple digit numbers from the supplied digits is ''disallowed''. (So an answer of 12+12 when given 1, 2, 2, and 1 is wrong).
+* The order of the digits when given does not have to be preserved.
+
+
+;Notes
* The type of expression evaluator used is not mandated. An [[wp:Reverse Polish notation|RPN]] evaluator is equally acceptable for example.
* The task is not for the program to generate the expression, or test whether an expression is even possible.
-C.f: [[24 game Player]]
-'''Reference'''
-# [http://www.bbc.co.uk/dna/h2g2/A933121 The 24 Game] on h2g2.
+;Related tasks
+* [[24 game/Solve]]
+
+
+;Reference
+* [http://www.bbc.co.uk/dna/h2g2/A933121 The 24 Game] on h2g2.
+
diff --git a/Task/24-game/COBOL/24-game.cobol b/Task/24-game/COBOL/24-game.cobol
new file mode 100644
index 0000000000..8041901235
--- /dev/null
+++ b/Task/24-game/COBOL/24-game.cobol
@@ -0,0 +1,843 @@
+ >>SOURCE FORMAT FREE
+*> This code is dedicated to the public domain
+*> This is GNUCobol 2.0
+identification division.
+program-id. twentyfour.
+environment division.
+configuration section.
+repository. function all intrinsic.
+data division.
+working-storage section.
+01 p pic 999.
+01 p1 pic 999.
+01 p-max pic 999 value 38.
+01 program-syntax pic x(494) value
+*>statement = expression;
+ '001 001 000 n'
+ & '002 000 004 ='
+ & '003 005 000 n'
+ & '004 000 002 ;'
+*>expression = term, {('+'|'-') term,};
+ & '005 005 000 n'
+ & '006 000 016 ='
+ & '007 017 000 n'
+ & '008 000 015 {'
+ & '009 011 013 ('
+ & '010 001 000 t'
+ & '011 013 000 |'
+ & '012 002 000 t'
+ & '013 000 009 )'
+ & '014 017 000 n'
+ & '015 000 008 }'
+ & '016 000 006 ;'
+*>term = factor, {('*'|'/') factor,};
+ & '017 017 000 n'
+ & '018 000 028 ='
+ & '019 029 000 n'
+ & '020 000 027 {'
+ & '021 023 025 ('
+ & '022 003 000 t'
+ & '023 025 000 |'
+ & '024 004 000 t'
+ & '025 000 021 )'
+ & '026 029 000 n'
+ & '027 000 020 }'
+ & '028 000 018 ;'
+*>factor = ('(' expression, ')' | digit,);
+ & '029 029 000 n'
+ & '030 000 038 ='
+ & '031 035 037 ('
+ & '032 005 000 t'
+ & '033 005 000 n'
+ & '034 006 000 t'
+ & '035 037 000 |'
+ & '036 000 000 n'
+ & '037 000 031 )'
+ & '038 000 030 ;'.
+01 filler redefines program-syntax.
+ 03 p-entry occurs 038.
+ 05 p-address pic 999.
+ 05 filler pic x.
+ 05 p-definition pic 999.
+ 05 p-alternate redefines p-definition pic 999.
+ 05 filler pic x.
+ 05 p-matching pic 999.
+ 05 filler pic x.
+ 05 p-symbol pic x.
+
+01 t pic 999.
+01 t-len pic 99 value 6.
+01 terminal-symbols
+ pic x(210) value
+ '01 + '
+ & '01 - '
+ & '01 * '
+ & '01 / '
+ & '01 ( '
+ & '01 ) '.
+01 filler redefines terminal-symbols.
+ 03 terminal-symbol-entry occurs 6.
+ 05 terminal-symbol-len pic 99.
+ 05 filler pic x.
+ 05 terminal-symbol pic x(32).
+
+01 nt pic 999.
+01 nt-lim pic 99 value 5.
+01 nonterminal-statements pic x(294) value
+ "000 ....,....,....,....,....,....,....,....,....,"
+ & "001 statement = expression; "
+ & "005 expression = term, {('+'|'-') term,}; "
+ & "017 term = factor, {('*'|'/') factor,}; "
+ & "029 factor = ('(' expression, ')' | digit,); "
+ & "036 digit; ".
+01 filler redefines nonterminal-statements.
+ 03 nonterminal-statement-entry occurs 5.
+ 05 nonterminal-statement-number pic 999.
+ 05 filler pic x.
+ 05 nonterminal-statement pic x(45).
+
+01 indent pic x(64) value all '| '.
+01 interpreter-stack.
+ 03 r pic 99. *> previous top of stack
+ 03 s pic 99. *> current top of stack
+ 03 s-max pic 99 value 32.
+ 03 s-entry occurs 32.
+ 05 filler pic x(2) value 'p='.
+ 05 s-p pic 999. *> callers return address
+ 05 filler pic x(4) value ' sc='.
+ 05 s-start-control pic 999. *> sequence start address
+ 05 filler pic x(4) value ' ec='.
+ 05 s-end-control pic 999. *> sequence end address
+ 05 filler pic x(4) value ' al='.
+ 05 s-alternate pic 999. *> the next alternate
+ 05 filler pic x(3) value ' r='.
+ 05 s-result pic x. *> S success, F failure, N no result
+ 05 filler pic x(3) value ' c='.
+ 05 s-count pic 99. *> successes in a sequence
+ 05 filler pic x(3) value ' x='.
+ 05 s-repeat pic 99. *> repeats in a {} sequence
+ 05 filler pic x(4) value ' nt='.
+ 05 s-nt pic 99. *> current nonterminal
+
+01 language-area.
+ 03 l pic 99.
+ 03 l-lim pic 99.
+ 03 l-len pic 99 value 1.
+ 03 nd pic 9.
+ 03 number-definitions.
+ 05 n occurs 4 pic 9.
+ 03 nu pic 9.
+ 03 number-use.
+ 05 u occurs 4 pic x.
+ 03 statement.
+ 05 c occurs 32.
+ 07 c9 pic 9.
+
+01 number-validation.
+ 03 p4 pic 99.
+ 03 p4-lim pic 99 value 24.
+ 03 permutations-4 pic x(96) value
+ '1234'
+ & '1243'
+ & '1324'
+ & '1342'
+ & '1423'
+ & '1432'
+ & '2134'
+ & '2143'
+ & '2314'
+ & '2341'
+ & '2413'
+ & '2431'
+ & '3124'
+ & '3142'
+ & '3214'
+ & '3241'
+ & '3423'
+ & '3432'
+ & '4123'
+ & '4132'
+ & '4213'
+ & '4231'
+ & '4312'
+ & '4321'.
+ 03 filler redefines permutations-4.
+ 05 permutation-4 occurs 24 pic x(4).
+ 03 current-permutation-4 pic x(4).
+ 03 cpx pic 9.
+ 03 od1 pic 9.
+ 03 od2 pic 9.
+ 03 odx pic 9.
+ 03 od-lim pic 9 value 4.
+ 03 operator-definitions pic x(4) value '+-*/'.
+ 03 current-operators pic x(3).
+ 03 co3 pic 9.
+ 03 rpx pic 9.
+ 03 rpx-lim pic 9 value 4.
+ 03 valid-rpn-forms pic x(28) value
+ 'nnonono'
+ & 'nnnonoo'
+ & 'nnnoono'
+ & 'nnnnooo'.
+ 03 filler redefines valid-rpn-forms.
+ 05 rpn-form occurs 4 pic x(7).
+ 03 current-rpn-form pic x(7).
+
+01 calculation-area.
+ 03 osx pic 99.
+ 03 operator-stack pic x(32).
+ 03 oqx pic 99.
+ 03 oqx1 pic 99.
+ 03 output-queue pic x(32).
+ 03 work-number pic s9999.
+ 03 top-numerator pic s9999 sign leading separate.
+ 03 top-denominator pic s9999 sign leading separate.
+ 03 rsx pic 9.
+ 03 result-stack occurs 8.
+ 05 numerator pic s9999.
+ 05 denominator pic s9999.
+
+01 error-found pic x.
+01 divide-by-zero-error pic x.
+
+*> diagnostics
+01 NL pic x value x'0A'.
+01 NL-flag pic x value space.
+01 display-level pic x value '0'.
+01 loop-lim pic 9999 value 1500.
+01 loop-count pic 9999 value 0.
+01 message-area value spaces.
+ 03 message-level pic x.
+ 03 message-value pic x(128).
+
+*> input and examples
+01 instruction pic x(32) value spaces.
+01 tsx pic 99.
+01 tsx-lim pic 99 value 14.
+01 test-statements.
+ 03 filler pic x(32) value '1234;1 + 2 + 3 + 4'.
+ 03 filler pic x(32) value '1234;1 * 2 * 3 * 4'.
+ 03 filler pic x(32) value '1234;((1)) * (((2 * 3))) * 4'.
+ 03 filler pic x(32) value '1234;((1)) * ((2 * 3))) * 4'.
+ 03 filler pic x(32) value '1234;(1 + 2 + 3 + 4'.
+ 03 filler pic x(32) value '1234;)1 + 2 + 3 + 4'.
+ 03 filler pic x(32) value '1234;1 * * 2 * 3 * 4'.
+ 03 filler pic x(32) value '5679;6 - (5 - 7) * 9'.
+ 03 filler pic x(32) value '1268;((1 * (8 * 6) / 2))'.
+ 03 filler pic x(32) value '4583;-5-3+(8*4)'.
+ 03 filler pic x(32) value '4583;8 * 4 - 5 - 3'.
+ 03 filler pic x(32) value '4583;8 * 4 - (5 + 3)'.
+ 03 filler pic x(32) value '1223;1 * 3 / (2 - 2)'.
+ 03 filler pic x(32) value '2468;(6 * 8) / 4 / 2'.
+01 filler redefines test-statements.
+ 03 filler occurs 14.
+ 05 test-numbers pic x(4).
+ 05 filler pic x.
+ 05 test-statement pic x(27).
+
+procedure division.
+start-twentyfour.
+ display 'start twentyfour'
+ perform generate-numbers
+ display 'type h to see instructions'
+ accept instruction
+ perform until instruction = spaces or 'q'
+ evaluate true
+ when instruction = 'h'
+ perform display-instructions
+ when instruction = 'n'
+ perform generate-numbers
+ when instruction(1:1) = 'm'
+ move instruction(2:4) to number-definitions
+ perform validate-number
+ if divide-by-zero-error = space
+ and 24 * top-denominator = top-numerator
+ display number-definitions ' is solved by ' output-queue(1:oqx)
+ else
+ display number-definitions ' is not solvable'
+ end-if
+ when instruction = 'd0' or 'd1' or 'd2' or 'd3'
+ move instruction(2:1) to display-level
+ when instruction = 'e'
+ display 'examples:'
+ perform varying tsx from 1 by 1
+ until tsx > tsx-lim
+ move spaces to statement
+ move test-numbers(tsx) to number-definitions
+ move test-statement(tsx) to statement
+ perform evaluate-statement
+ perform show-result
+ end-perform
+ when other
+ move instruction to statement
+ perform evaluate-statement
+ perform show-result
+ end-evaluate
+ move spaces to instruction
+ display 'instruction? ' with no advancing
+ accept instruction
+ end-perform
+
+ display 'exit twentyfour'
+ stop run
+ .
+generate-numbers.
+ perform with test after until divide-by-zero-error = space
+ and 24 * top-denominator = top-numerator
+ compute n(1) = random(seconds-past-midnight) * 10 *> seed
+ perform varying nd from 1 by 1 until nd > 4
+ compute n(nd) = random() * 10
+ perform until n(nd) <> 0
+ compute n(nd) = random() * 10
+ end-perform
+ end-perform
+ perform validate-number
+ end-perform
+ display NL 'numbers:' with no advancing
+ perform varying nd from 1 by 1 until nd > 4
+ display space n(nd) with no advancing
+ end-perform
+ display space
+ .
+validate-number.
+ perform varying p4 from 1 by 1 until p4 > p4-lim
+ move permutation-4(p4) to current-permutation-4
+ perform varying od1 from 1 by 1 until od1 > od-lim
+ move operator-definitions(od1:1) to current-operators(1:1)
+ perform varying od2 from 1 by 1 until od2 > od-lim
+ move operator-definitions(od2:1) to current-operators(2:1)
+ perform varying odx from 1 by 1 until odx > od-lim
+ move operator-definitions(odx:1) to current-operators(3:1)
+ perform varying rpx from 1 by 1 until rpx > rpx-lim
+ move rpn-form(rpx) to current-rpn-form
+ move 0 to cpx co3
+ move spaces to output-queue
+ move 7 to oqx
+ perform varying oqx1 from 1 by 1 until oqx1 > oqx
+ if current-rpn-form(oqx1:1) = 'n'
+ add 1 to cpx
+ move current-permutation-4(cpx:1) to nd
+ move n(nd) to output-queue(oqx1:1)
+ else
+ add 1 to co3
+ move current-operators(co3:1) to output-queue(oqx1:1)
+ end-if
+ end-perform
+ end-perform
+ perform evaluate-rpn
+ if divide-by-zero-error = space
+ and 24 * top-denominator = top-numerator
+ exit paragraph
+ end-if
+ end-perform
+ end-perform
+ end-perform
+ end-perform
+ .
+display-instructions.
+ display '1) Type h to repeat these instructions.'
+ display '2) The program will display four randomly-generated'
+ display ' single-digit numbers and will then prompt you to enter'
+ display ' an arithmetic expression followed by to sum'
+ display ' the given numbers to 24.'
+ display ' The four numbers may contain duplicates and the entered'
+ display ' expression must reference all the generated numbers and duplicates.'
+ display ' Warning: the program converts the entered infix expression'
+ display ' to a reverse polish notation (rpn) expression'
+ display ' which is then interpreted from RIGHT to LEFT.'
+ display ' So, for instance, 8*4 - 5 - 3 will not sum to 24.'
+ display '3) Type n to generate a new set of four numbers.'
+ display ' The program will ensure the generated numbers are solvable.'
+ display '4) Type m#### (e.g. m1234) to create a fixed set of numbers'
+ display ' for testing purposes.'
+ display ' The program will test the solvability of the entered numbers.'
+ display ' For example, m1234 is solvable and m9999 is not solvable.'
+ display '5) Type d0, d1, d2 or d3 followed by to display none or'
+ display ' increasingly detailed diagnostic information as the program evaluates'
+ display ' the entered expression.'
+ display '6) Type e to see a list of example expressions and results'
+ display '7) Type or q to exit the program'
+ .
+show-result.
+ if error-found = 'y'
+ or divide-by-zero-error = 'y'
+ exit paragraph
+ end-if
+ display 'statement in RPN is' space output-queue
+ evaluate true
+ when top-numerator = 0
+ when top-denominator = 0
+ when 24 * top-denominator <> top-numerator
+ display 'result (' top-numerator '/' top-denominator ') is not 24'
+ when other
+ display 'result is 24'
+ end-evaluate
+ .
+evaluate-statement.
+ compute l-lim = length(trim(statement))
+
+ display NL 'numbers:' space n(1) space n(2) space n(3) space n(4)
+ move number-definitions to number-use
+ display 'statement is' space statement
+
+ move 1 to l
+ move 0 to loop-count
+ move space to error-found
+
+ move 0 to osx oqx
+ move spaces to output-queue
+
+ move 1 to p
+ move 1 to nt
+ move 0 to s
+ perform increment-s
+ perform display-start-nonterminal
+ perform increment-p
+
+ *>===================================
+ *> interpret ebnf
+ *>===================================
+ perform until s = 0
+ or error-found = 'y'
+
+ evaluate true
+
+ when p-symbol(p) = 'n'
+ and p-definition(p) = 000 *> a variable
+ perform test-variable
+ if s-result(s) = 'S'
+ perform increment-l
+ end-if
+ perform increment-p
+
+ when p-symbol(p) = 'n'
+ and p-address(p) <> p-definition(p) *> nonterminal reference
+ move p to s-p(s)
+ move p-definition(p) to p
+
+ when p-symbol(p) = 'n'
+ and p-address(p) = p-definition(p) *> nonterminal definition
+ perform increment-s
+ perform display-start-nonterminal
+ perform increment-p
+
+ when p-symbol(p) = '=' *> nonterminal control
+ move p to s-start-control(s)
+ move p-matching(p) to s-end-control(s)
+ perform increment-p
+
+ when p-symbol(p) = ';' *> end nonterminal
+ perform display-end-control
+ perform display-end-nonterminal
+ perform decrement-s
+ if s > 0
+ evaluate true
+ when s-result(r) = 'S'
+ perform set-success
+ when s-result(r) = 'F'
+ perform set-failure
+ end-evaluate
+ move s-p(s) to p
+ perform increment-p
+ perform display-continue-nonterminal
+ end-if
+
+ when p-symbol(p) = '{' *> start repeat sequence
+ perform increment-s
+ perform display-start-control
+ move p to s-start-control(s)
+ move p-alternate(p) to s-alternate(s)
+ move p-matching(p) to s-end-control(s)
+ move 0 to s-count(s)
+ perform increment-p
+
+ when p-symbol(p) = '}' *> end repeat sequence
+ perform display-end-control
+ evaluate true
+ when s-result(s) = 'S' *> repeat the sequence
+ perform display-repeat-control
+ perform set-nothing
+ add 1 to s-repeat(s)
+ move s-start-control(s) to p
+ perform increment-p
+ when other
+ perform decrement-s
+ evaluate true
+ when s-result(r) = 'N'
+ and s-repeat(r) = 0 *> no result
+ perform increment-p
+ when s-result(r) = 'N'
+ and s-repeat(r) > 0 *> no result after success
+ perform set-success
+ perform increment-p
+ when other *> fail the sequence
+ perform increment-p
+ end-evaluate
+ end-evaluate
+
+ when p-symbol(p) = '(' *> start sequence
+ perform increment-s
+ perform display-start-control
+ move p to s-start-control(s)
+ move p-alternate(p) to s-alternate(s)
+ move p-matching(p) to s-end-control(s)
+ move 0 to s-count(s)
+ perform increment-p
+
+ when p-symbol(p) = ')' *> end sequence
+ perform display-end-control
+ perform decrement-s
+ evaluate true
+ when s-result(r) = 'S' *> success
+ perform set-success
+ perform increment-p
+ when s-result(r) = 'N' *> no result
+ perform set-failure
+ perform increment-p
+ when other *> fail the sequence
+ perform set-failure
+ perform increment-p
+ end-evaluate
+
+ when p-symbol(p) = '|' *> alternate
+ evaluate true
+ when s-result(s) = 'S' *> exit the sequence
+ perform display-skip-alternate
+ move s-end-control(s) to p
+ when other
+ perform display-take-alternate
+ move p-alternate(p) to s-alternate(s) *> the next alternate
+ perform increment-p
+ perform set-nothing
+ end-evaluate
+
+ when p-symbol(p) = 't' *> terminal
+ move p-definition(p) to t
+ move terminal-symbol-len(t) to t-len
+ perform display-terminal
+ evaluate true
+ when statement(l:t-len) = terminal-symbol(t)(1:t-len) *> successful match
+ perform set-success
+ perform display-recognize-terminal
+ perform process-token
+ move t-len to l-len
+ perform increment-l
+ perform increment-p
+ when s-alternate(s) <> 000 *> we are in an alternate sequence
+ move s-alternate(s) to p
+ when other *> fail the sequence
+ perform set-failure
+ move s-end-control(s) to p
+ end-evaluate
+
+ when other *> end control
+ perform display-control-failure *> shouldnt happen
+
+ end-evaluate
+
+ end-perform
+
+ evaluate true *> at end of evaluation
+ when error-found = 'y'
+ continue
+ when l <= l-lim *> not all tokens parsed
+ display 'error: invalid statement'
+ perform statement-error
+ when number-use <> spaces
+ display 'error: not all numbers were used: ' number-use
+ move 'y' to error-found
+ end-evaluate
+ .
+increment-l.
+ evaluate true
+ when l > l-lim *> end of statement
+ continue
+ when other
+ add l-len to l
+ perform varying l from l by 1
+ until c(l) <> space
+ or l > l-lim
+ continue
+ end-perform
+ move 1 to l-len
+ if l > l-lim
+ perform end-tokens
+ end-if
+ end-evaluate
+ .
+increment-p.
+ evaluate true
+ when p >= p-max
+ display 'at' space p ' parse overflow'
+ space 's=<' s space s-entry(s) '>'
+ move 'y' to error-found
+ when other
+ add 1 to p
+ perform display-statement
+ end-evaluate
+ .
+increment-s.
+ evaluate true
+ when s >= s-max
+ display 'at' space p ' stack overflow '
+ space 's=<' s space s-entry(s) '>'
+ move 'y' to error-found
+ when other
+ move s to r
+ add 1 to s
+ initialize s-entry(s)
+ move 'N' to s-result(s)
+ move p to s-p(s)
+ move nt to s-nt(s)
+ end-evaluate
+ .
+decrement-s.
+ if s > 0
+ move s to r
+ subtract 1 from s
+ if s > 0
+ move s-nt(s) to nt
+ end-if
+ end-if
+ .
+set-failure.
+ move 'F' to s-result(s)
+ if s-count(s) > 0
+ display 'sequential parse failure'
+ perform statement-error
+ end-if
+ .
+set-success.
+ move 'S' to s-result(s)
+ add 1 to s-count(s)
+ .
+set-nothing.
+ move 'N' to s-result(s)
+ move 0 to s-count(s)
+ .
+statement-error.
+ display statement
+ move spaces to statement
+ move '^ syntax error' to statement(l:)
+ display statement
+ move 'y' to error-found
+ .
+*>=====================
+*> twentyfour semantics
+*>=====================
+test-variable.
+ *> check validity
+ perform varying nd from 1 by 1 until nd > 4
+ or c(l) = n(nd)
+ continue
+ end-perform
+ *> check usage
+ perform varying nu from 1 by 1 until nu > 4
+ or c(l) = u(nu)
+ continue
+ end-perform
+ evaluate true
+ when l > l-lim
+ perform set-failure
+ when c9(l) not numeric
+ perform set-failure
+ when nd > 4
+ display 'invalid number'
+ perform statement-error
+ when nu > 4
+ display 'number already used'
+ perform statement-error
+ when other
+ move space to u(nu)
+ perform set-success
+ add 1 to oqx
+ move c(l) to output-queue(oqx:1)
+ end-evaluate
+ .
+*> ==================================
+*> Dijkstra Shunting-Yard Algorithm
+*> to convert infix to rpn
+*> ==================================
+process-token.
+ evaluate true
+ when c(l) = '('
+ add 1 to osx
+ move c(l) to operator-stack(osx:1)
+ when c(l) = ')'
+ perform varying osx from osx by -1 until osx < 1
+ or operator-stack(osx:1) = '('
+ add 1 to oqx
+ move operator-stack(osx:1) to output-queue(oqx:1)
+ end-perform
+ if osx < 1
+ display 'parenthesis error'
+ perform statement-error
+ exit paragraph
+ end-if
+ subtract 1 from osx
+ when (c(l) = '+' or '-') and (operator-stack(osx:1) = '*' or '/')
+ *> lesser operator precedence
+ add 1 to oqx
+ move operator-stack(osx:1) to output-queue(oqx:1)
+ move c(l) to operator-stack(osx:1)
+ when other
+ *> greater operator precedence
+ add 1 to osx
+ move c(l) to operator-stack(osx:1)
+ end-evaluate
+ .
+end-tokens.
+ *> 1) copy stacked operators to the output-queue
+ perform varying osx from osx by -1 until osx < 1
+ or operator-stack(osx:1) = '('
+ add 1 to oqx
+ move operator-stack(osx:1) to output-queue(oqx:1)
+ end-perform
+ if osx > 0
+ display 'parenthesis error'
+ perform statement-error
+ exit paragraph
+ end-if
+ *> 2) evaluate the rpn statement
+ perform evaluate-rpn
+ if divide-by-zero-error = 'y'
+ display 'divide by zero error'
+ end-if
+ .
+evaluate-rpn.
+ move space to divide-by-zero-error
+ move 0 to rsx *> stack depth
+ perform varying oqx1 from 1 by 1 until oqx1 > oqx
+ if output-queue(oqx1:1) >= '1' and <= '9'
+ *> push current data onto the stack
+ add 1 to rsx
+ move top-numerator to numerator(rsx)
+ move top-denominator to denominator(rsx)
+ move output-queue(oqx1:1) to top-numerator
+ move 1 to top-denominator
+ else
+ *> apply the operation
+ evaluate true
+ when output-queue(oqx1:1) = '+'
+ compute top-numerator = top-numerator * denominator(rsx)
+ + top-denominator * numerator(rsx)
+ compute top-denominator = top-denominator * denominator(rsx)
+ when output-queue(oqx1:1) = '-'
+ compute top-numerator = top-denominator * numerator(rsx)
+ - top-numerator * denominator(rsx)
+ compute top-denominator = top-denominator * denominator(rsx)
+ when output-queue(oqx1:1) = '*'
+ compute top-numerator = top-numerator * numerator(rsx)
+ compute top-denominator = top-denominator * denominator(rsx)
+ when output-queue(oqx1:1) = '/'
+ compute work-number = numerator(rsx) * top-denominator
+ compute top-denominator = denominator(rsx) * top-numerator
+ if top-denominator = 0
+ move 'y' to divide-by-zero-error
+ exit paragraph
+ end-if
+ move work-number to top-numerator
+ end-evaluate
+ *> pop the stack
+ subtract 1 from rsx
+ end-if
+ end-perform
+ .
+*>====================
+*> diagnostic displays
+*>====================
+display-start-nonterminal.
+ perform varying nt from nt-lim by -1 until nt < 1
+ or p-definition(p) = nonterminal-statement-number(nt)
+ continue
+ end-perform
+ if nt > 0
+ move '1' to NL-flag
+ string '1' indent(1:s + s) 'at ' s space p ' start ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ move nt to s-nt(s)
+ end-if
+ .
+display-continue-nonterminal.
+ move s-nt(s) to nt
+ string '1' indent(1:s + s) 'at ' s space p space p-symbol(p) ' continue ' trim(nonterminal-statement(nt)) ' with result ' s-result(s)
+ into message-area perform display-message
+ .
+display-end-nonterminal.
+ move s-nt(s) to nt
+ move '2' to NL-flag
+ string '1' indent(1:s + s) 'at ' s space p ' end ' trim(nonterminal-statement(nt)) ' with result ' s-result(s)
+ into message-area perform display-message
+ .
+display-start-control.
+ string '2' indent(1:s + s) 'at ' s space p ' start ' p-symbol(p) ' in ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ .
+display-repeat-control.
+ string '2' indent(1:s + s) 'at ' s space p ' repeat ' p-symbol(p) ' in ' trim(nonterminal-statement(nt)) ' with result ' s-result(s)
+ into message-area perform display-message
+ .
+display-end-control.
+ string '2' indent(1:s + s) 'at ' s space p ' end ' p-symbol(p) ' in ' trim(nonterminal-statement(nt)) ' with result ' s-result(s)
+ into message-area perform display-message
+ .
+display-take-alternate.
+ string '2' indent(1:s + s) 'at ' s space p ' take alternate' ' in ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ .
+display-skip-alternate.
+ string '2' indent(1:s + s) 'at ' s space p ' skip alternate' ' in ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ .
+display-terminal.
+ string '1' indent(1:s + s) 'at ' s space p
+ ' compare ' statement(l:t-len) ' to ' terminal-symbol(t)(1:t-len)
+ ' in ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ .
+display-recognize-terminal.
+ string '1' indent(1:s + s) 'at ' s space p ' recognize terminal: ' c(l) ' in ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ .
+display-recognize-variable.
+ string '1' indent(1:s + s) 'at ' s space p ' recognize digit: ' c(l) ' in ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ .
+display-statement.
+ compute p1 = p - s-start-control(s)
+ string '3' indent(1:s + s) 'at ' s space p
+ ' statement: ' s-start-control(s) '/' p1
+ space p-symbol(p) space s-result(s)
+ ' in ' trim(nonterminal-statement(nt))
+ into message-area perform display-message
+ .
+display-control-failure.
+ display loop-count space indent(1:s + s) 'at' space p ' control failure' ' in ' trim(nonterminal-statement(nt))
+ display loop-count space indent(1:s + s) ' ' 'p=<' p p-entry(p) '>'
+ display loop-count space indent(1:s + s) ' ' 's=<' s space s-entry(s) '>'
+ display loop-count space indent(1:s + s) ' ' 'l=<' l space c(l)'>'
+ perform statement-error
+ .
+display-message.
+ if display-level = 1
+ move space to NL-flag
+ end-if
+ evaluate true
+ when loop-count > loop-lim *> loop control
+ display 'display count exceeds ' loop-lim
+ stop run
+ when message-level <= display-level
+ evaluate true
+ when NL-flag = '1'
+ display NL loop-count space trim(message-value)
+ when NL-flag = '2'
+ display loop-count space trim(message-value) NL
+ when other
+ display loop-count space trim(message-value)
+ end-evaluate
+ end-evaluate
+ add 1 to loop-count
+ move spaces to message-area
+ move space to NL-flag
+ .
+end program twentyfour.
diff --git a/Task/24-game/Elixir/24-game.elixir b/Task/24-game/Elixir/24-game.elixir
new file mode 100644
index 0000000000..45b27ad843
--- /dev/null
+++ b/Task/24-game/Elixir/24-game.elixir
@@ -0,0 +1,39 @@
+defmodule Game24 do
+ def main do
+ IO.puts "24 Game"
+ play
+ end
+
+ defp play do
+ IO.puts "Generating 4 digits..."
+ digts = for _ <- 1..4, do: Enum.random(1..9)
+ IO.puts "Your digits\t#{inspect digts, char_lists: :as_lists}"
+ read_eval(digts)
+ play
+ end
+
+ defp read_eval(digits) do
+ exp = IO.gets("Your expression: ") |> String.strip
+ if exp in ["","q"], do: exit(:normal) # give up
+ case {correct_nums(exp, digits), eval(exp)} do
+ {:ok, x} when x==24 -> IO.puts "You Win!"
+ {:ok, x} -> IO.puts "You Lose with #{inspect x}!"
+ {err, _} -> IO.puts "The following numbers are wrong: #{inspect err, char_lists: :as_lists}"
+ end
+ end
+
+ defp correct_nums(exp, digits) do
+ nums = String.replace(exp, ~r/\D/, " ") |> String.split |> Enum.map(&String.to_integer &1)
+ if length(nums)==4 and (nums--digits)==[], do: :ok, else: nums
+ end
+
+ defp eval(exp) do
+ try do
+ Code.eval_string(exp) |> elem(0)
+ rescue
+ e -> Exception.message(e)
+ end
+ end
+end
+
+Game24.main
diff --git a/Task/24-game/Haskell/24-game.hs b/Task/24-game/Haskell/24-game.hs
index c905ce3bd8..e53c48e3e3 100644
--- a/Task/24-game/Haskell/24-game.hs
+++ b/Task/24-game/Haskell/24-game.hs
@@ -29,10 +29,9 @@ processGuess digits xs = calc xs >>= check
check x = Left (show (fromRational (x :: Rational)) ++ " is wrong")
-- A Reverse Polish Notation calculator with full error handling
-calc = result []
- where result [n] [] = Right n
- result _ [] = Left "Too few operators"
- result ns (x:xs) = simplify ns x >>= flip result xs
+calc xs = foldM simplify [] xs >>= \ns -> (case ns of
+ [n] -> Right n
+ _ -> Left "Too few operators")
simplify (a:b:ns) s | isOp s = Right ((fromJust $ lookup s ops) b a : ns)
simplify _ s | isOp s = Left ("Too few values before " ++ s)
diff --git a/Task/24-game/Maple/24-game.maple b/Task/24-game/Maple/24-game.maple
new file mode 100644
index 0000000000..e62d3a9000
--- /dev/null
+++ b/Task/24-game/Maple/24-game.maple
@@ -0,0 +1,84 @@
+play24 := module()
+ export ModuleApply;
+ local cheating;
+ cheating := proc(input, digits)
+ local i, j, stringDigits;
+ use StringTools in
+ stringDigits := Implode([seq(convert(i, string), i in digits)]);
+ for i in digits do
+ for j in digits do
+ if Search(cat(convert(i, string), j), input) > 0 then
+ return true, ": Please don't combine digits to form another number."
+ end if;
+ end do;
+ end do;
+ for i in digits do
+ if CountCharacterOccurrences(input, convert(i, string)) < CountCharacterOccurrences(stringDigits, convert(i, string)) then
+ return true, ": Please use all digits.";
+ end if;
+ end do;
+ for i in digits do
+ if CountCharacterOccurrences(input, convert(i, string)) > CountCharacterOccurrences(stringDigits, convert(i, string)) then
+ return true, ": Please only use a digit once.";
+ end if;
+ end do;
+ for i in input do
+ try
+ if type(parse(i), numeric) and not member(parse(i), digits) then
+ return true, ": Please only use the digits you were given.";
+ end if;
+ catch:
+ end try;
+ end do;
+ return false, "";
+ end use;
+ end proc:
+
+ ModuleApply := proc()
+ local replay, digits, err, message, answer;
+ randomize():
+ replay := "":
+ while not replay = "END" do
+ if not replay = "YES" then
+ digits := [seq(rand(1..9)(), i = 1..4)]:
+ end if;
+ err := true:
+ while err do
+ message := "";
+ printf("Please make 24 from the digits: %a. Press enter for a new set of numbers or type END to quit\n", digits);
+ answer := StringTools[UpperCase](readline());
+ if not answer = "" and not answer = "END" then
+ try
+ if not type(parse(answer), numeric) then
+ error;
+ elif cheating(answer, digits)[1] then
+ message := cheating(answer, digits)[2];
+ error;
+ end if;
+ err := false;
+ catch:
+ printf("Invalid Input%s\n\n", message);
+ end try;
+ else
+ err := false;
+ end if;
+ end do:
+ if not answer = "" and not answer = "END" then
+ if parse(answer) = 24 then
+ printf("You win! Do you wish to play another game? (Press enter for a new set of numbers or END to quit.)\n");
+ replay := StringTools[UpperCase](readline());
+ else
+ printf("Your expression evaluated to %a. Try again!\n", parse(answer));
+ replay := "YES";
+ end if;
+ else
+ replay := answer;
+ end if;
+
+ printf("\n");
+ end do:
+ printf("GAME OVER\n");
+ end proc:
+end module:
+
+play24();
diff --git a/Task/24-game/Perl-6/24-game.pl6 b/Task/24-game/Perl-6/24-game.pl6
index bef0c6aa5f..3227007d18 100644
--- a/Task/24-game/Perl-6/24-game.pl6
+++ b/Task/24-game/Perl-6/24-game.pl6
@@ -1,3 +1,5 @@
+use MONKEY-SEE-NO-EVAL;
+
say "Here are your digits: ",
constant @digits = (1..9).roll(4)».Str;
@@ -9,15 +11,16 @@ grammar Exp24 {
}
while my $exp = prompt "\n24? " {
- if Exp24.parse: $exp {
- say "You win :)";
- last;
+ if try Exp24.parse: $exp {
+ say "You win :)";
+ last;
} else {
- say pick 1,
- 'Sorry. Try again.' xx 20,
- 'Try harder.' xx 5,
- 'Nope. Not even close.' xx 2,
- 'Are you five or something?',
- 'Come on, you can do better than that.';
+ say (
+ 'Sorry. Try again.' xx 20,
+ 'Try harder.' xx 5,
+ 'Nope. Not even close.' xx 2,
+ 'Are you five or something?',
+ 'Come on, you can do better than that.'
+ ).flat.pick
}
}
diff --git a/Task/24-game/Python/24-game.py b/Task/24-game/Python/24-game.py
index 0d534555e9..0a5a6e38c9 100644
--- a/Task/24-game/Python/24-game.py
+++ b/Task/24-game/Python/24-game.py
@@ -64,4 +64,5 @@ def main():
if ans == 24:
print ("Thats right!")
print ("Thank you and goodbye")
-main()
+
+if __name__ == '__main__': main()
diff --git a/Task/24-game/REXX/24-game-1.rexx b/Task/24-game/REXX/24-game-1.rexx
index 6a11702185..9709af0e5e 100644
--- a/Task/24-game/REXX/24-game-1.rexx
+++ b/Task/24-game/REXX/24-game-1.rexx
@@ -1,73 +1,68 @@
-/*REXX program which allows a user to play the game of 24 (twenty-four). */
-numeric digits 15 /*allow more leeway when computing #s. */
-parse arg yyy /*get the optional arguments from C.L. */
- yyy = space(yyy,0) /*remove extraneous blanks from YYY. */
-parse var yyy start '-' fin /*get the START and FINish (maybe). */
- fin = word(fin start,1) /*if no FINish specified, use START.*/
- opers = '+-*/' /*define the legal arithmetic operators*/
- ops = length(opers) /* ··· and the count of them (length). */
-groupSymbols = '()[]{}' /*legal grouping symbols for this game.*/
- indent = left('',30) /*used to indent display of solutions. */
- Lpar = '(' /*a string to make the output prettier.*/
- Rpar = ')' /*Ditto. [You can say that again.] */
- digs = 123456789 /*numerals (digits) that can be used. */
- show = 1 /*flag used show solutions (0 = not). */
- do j=1 for ops /*define a version for fast execution. */
- @.j=substr(opers,j,1) /*assign each operation to an array. */
- end /*j*/
-signal on syntax /*enable program to trap syntax errors.*/
-if yyy\=='' then do /*if START (or FINish), then solve 'em.*/
- sols=solve(start,fin) /*solve START ───► FINish. */
- if sols <0 then exit 13 /*Was there a problem with input? */
- if sols==0 then sols='No' /*Englishize the SOLS variable.*/
- say; say sols 'unique solution's(sols) "found for" yyy
- exit /*S [↑] does pluralizations. */
- end
-show=0 /*stop SOLVE from blabbing solutions.*/
+/*REXX program supports a human to play the game of 24 (twenty-four) with error checking*/
+numeric digits 15 /*allow more leeway when computing #s. */
+parse arg yyy /*get the optional arguments from C.L. */
+ yyy = space(yyy, 0) /*remove extraneous blanks from YYY. */
+parse var yyy start '-' fin /*get the START and FINish (maybe). */
+ fin = word(fin start, 1) /*if no FINish specified, use START.*/
+ ops = '+-*/' ; Lops = length(0ps) /*define the legal arithmetic operators*/
+groupSym = '()[]{}' /*legal grouping symbols for this game.*/
+ indent = left('', 30) /*used to indent display of solutions. */
+ Lpar = '(' ; Rpar = ')' /*strings to make the output prettier.*/
+ digs = 123456789 /*numerals (digits) that can be used. */
+ show = 1 /*flag used show solutions (0 = not). */
+ do j=1 for Lops; @.j=substr(ops,j,1) /*define a version for fast execution. */
+ end /*j*/
+signal on syntax /*enable program to trap syntax errors.*/
+if yyy\=='' then do; sols=solve(start, fin) /*solve from START ───► FINish. */
+ if sols <0 then exit 13 /*Was there a problem with the input? */
+ if sols==0 then sols='No' /*Englishize the SOLS variable value*/
+ say; say sols 'unique solution's(sols) "found for" yyy
+ exit /*S [↑] does pluralizations. */
+ end
+show=0 /*stop SOLVE from blabbing solutions.*/
do forever; rrrr=random(1111, 9999)
- if pos(0, rrrr)\==0 then iterate /*if contains a zero, ignore it*/
- if solve(rrrr)\==0 then leave /*if solved, then stop looking.*/
+ if pos(0, rrrr)\==0 then iterate /*if it contains a zero, then ignore it*/
+ if solve(rrrr) \==0 then leave /*if solved, then we can stop looking. */
end /*forever*/
-show=1 /*enable SOLVE to display solutions. */
-rrrr=sort(rrrr) /*sort four digits (for consistency). */
+show=1 /*enable SOLVE to display solutions. */
+rrrr=sort(rrrr); Lrrrr=length(rrrr) /*sort four digits (for consistency). */
$.=0
- do j=1 for length(rrrr) /*digit count for each digit in RRRR. */
- _=substr(rrrr, j, 1) /*pick off one of the digits in RRRR. */
- $._=countDigs(rrrr, _) /*define the count for this digit. */
- end /*j*/ /* [↑] counts duplicates twice, no harm*/
+ do j=1 for Lrrrr; _=substr(rrrr,j,1) /*digit count for each digit in RRRR. */
+ $._= countDigs(rrrr, _) /*define the count for this digit. */
+ end /*j*/ /* [↑] counts duplicates twice, no harm*/
-prompt= 'Using the digits' rrrr", enter an expression that equals 24 (or QUIT):"
- /* [↓] ITERATE needs a variable name.*/
- do prompter=0; say; say prompt /*display blank line and the prompt (P)*/
- pull y; y=space(y,0) /*get Y from CL, then remove all blanks*/
- if abbrev('QUIT',y,1) then exit /*Does the user want to quit this game?*/
- _v=verify(y, digs || opers || groupSymbols); a=substr(y, max(1,_v), 1)
- if _v\==0 then do; call ger 'invalid character:' a; iterate; end
- if pos('**',y) then do; call ger 'invalid ** operator'; iterate; end
- if pos('//',y) then do; call ger 'invalid // operator'; iterate; end
- yL=length(y)
- if y=='' then do; call validate y; iterate; end
+__ = copies('─', 9) /*used for output highlighting. */
+prompt= 'Using the digits ' rrrr", enter an expression that equals 24 (or QUIT):"
+ /* [↓] ITERATE needs a variable name.*/
+ do prompter=0; say; say __ prompt /*display blank line and the prompt (P)*/
+ pull y; y=space(y, 0) /*get Y from CL, then remove all blanks*/
+ if abbrev('QUIT', y, 1) then exit 0 /*Does the user want to quit this game?*/
+ _v=verify(y, digs || ops || groupSym); a=substr(y, max(1,_v), 1)
+ if _v\==0 then do; call ger "invalid character:" a; iterate; end
+ if pos('**', y) then do; call ger "invalid ** operator"; iterate; end
+ if pos('//', y) then do; call ger "invalid // operator"; iterate; end
+ Ly=length(y)
+ if y=='' then do; call validate y; iterate; end
- do j=1 for yL-1; if \datatype(substr(y, j ,1), 'W') then iterate
- if \datatype(substr(y, j+1,1), 'W') then iterate
+ do j=1 for Ly-1; if \datatype(substr(y, j , 1), 'W') then iterate
+ if \datatype(substr(y, j+1, 1), 'W') then iterate
call ger 'invalid use of "digit abuttal".'
iterate prompter
end /*j*/
- yd=countDigs(y, digs) /*count of the digits 1──►9 (123456789)*/
- if yd<4 then do; call ger 'not enough digits entered.'; iterate prompter; end
- if yd>4 then do; call ger 'too many digits entered.' ; iterate prompter; end
+ yd=countDigs(y, digs) /*count of the digits 1──►9 (123456789)*/
+ if yd<4 then do; call ger 'not enough digits entered.'; iterate /*prompter*/; end
+ if yd>4 then do; call ger 'too many digits entered.' ; iterate /*prompter*/; end
- do j=1 for 9; if $.j==0 then iterate
- _d=countDigs(y, j); if $.j==_d then iterate
- if _d<$.j then call ger 'not enough' j "digits, must be" $.j
- else call ger 'too many' j "digits, must be" $.j
+ do j=1 for 9; if $.j==0 then iterate
+ _d=countDigs(y, j); if $.j==_d then iterate
+ if _d<$.j then call ger 'not enough' j "digits, must be" $.j
+ else call ger 'too many' j "digits, must be" $.j
iterate prompter
end /*j*/
- y=translate(y, '()()', "[]{}")
- interpret 'ans=' y; ans=ans/1; if ans==24 then leave prompter
- say 'incorrect, ' y'='ans
+ interpret 'ans=' translate(y, '()()', "[]{}"); ans=ans/1
+ if ans==24 then leave prompter; say 'incorrect, ' y"="ans
end /*prompter*/
say; say center('┌─────────────────────┐', 79)
@@ -75,84 +70,65 @@ say; say center('┌────────────────
say center('│ congratulations ! │', 79)
say center('│ │', 79)
say center('└─────────────────────┘', 79)
-exit /*stick a fork in it, we're all done. */
-/*──────────────────────────────────one─liner subroutines─────────────────────*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
countDigs: arg ?; return length(?) - length(space(translate(?, , arg(2)), 0))
-div: if arg(1)=0 then return 7e9; return arg(1) /*if ÷ by 0, fudge result*/
-ger: say; say '***error!*** for argument:' y; say arg(1); say;errCode=1;return 0
-s: if arg(1)==1 then return ''; return 's' /*simple pluralizer.*/
-syntax: call ger 'illegal syntax in' y; exit
-/*──────────────────────────────────SOLVE subroutine──────────────────────────*/
-solve: parse arg ssss, ffff /*parse the argument passed to SOLVE. */
-if ffff=='' then ffff=ssss /*create a FFFF if necessary. */
-if \validate(ssss) then return -1 /*validate the SSSS field. */
-if \validate(ffff) then return -1 /* " " FFFF " */
-#=0 /*number of found solutions (so far). */
-!.=0 /*a method to hold unique expressions. */
- /*alternative: indent=copies(' ',30) */
+div: if arg(1)=0 then return 7e9; return arg(1) /*÷ by 0? Fudge result*/
+ger: say; say __ '***error*** for expression:' y; say __ arg(1); say; OK=0; return 0
+s: if arg(1)==1 then return ''; return "s" /*a simple pluralizer.*/
+syntax: call ger 'illegal syntax in' y; exit
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+solve: parse arg ssss, ffff /*parse the argument passed to SOLVE. */
+ if ffff=='' then ffff=ssss /*create a FFFF if necessary. */
+ if \validate(ssss) then return -1 /*validate the SSSS field. */
+ if \validate(ffff) then return -1 /* " " FFFF " */
+ #=0 /*number of found solutions (so far). */
+ !.=0 /*a method to hold unique expressions. */
+ /*alternative: indent=copies(' ',30) */
+ do g=ssss to ffff /*process a (possible) range of values.*/
+ if pos(0, g)\==0 then iterate /*ignore values with zero in them. */
- do g=ssss to ffff /*process a (possible) range of values.*/
- if pos(0, g)\==0 then iterate /*ignore values with zero in them. */
+ do j=1 for 4; g.j=substr(g, j, 1) /*define a version for fast execution. */
+ end /*j*/
- do j=1 for 4 /*define a version for fast execution. */
- g.j=substr(g, j, 1) /*extract each digit of G into array.*/
- end /*j*/
+ do i =1 for Lops /*insert an operator after 1st number. */
+ do j =1 for Lops /* " " " " 2nd " */
+ do k =1 for Lops /* " " " " 3rd " */
+ do m=0 to 3; L.= /*assume no left parenthesis (so far).*/
+ do n=m+1 to 4; L.m=Lpar; R.= /*match left paren with a right paren. */
+ if m==1 & n==2 then L.= /*special case of : (n) + ··· */
+ else if m\==0 then R.n=Rpar /*no (, no )*/
+ e= L.1 g.1 @.i L.2 g.2 @.j L.3 g.3 R.3 @.k g.4 R.4
+ e=space(e, 0) /*remove all blanks from the expression*/
+ yyyE=e /*keep old the version for the display.*/
+ /* [↓] change /(yyy) ═══► /div(yyy) */
+ if pos('/(', e)\==0 then e=changestr( "/(", e, '/div(' )
+ if !.e then iterate /*was this expression already used? */
+ !.e=1 /*mark this expression as being used. */
+ interpret 'x=' e /*have REXX do all the heavy lifting */
+ if x\=24 then iterate /*Is the result incorrect? Try again. */
+ #=#+1 /*bump number of found solutions. */
+ if show then say indent 'a solution:' translate(yyyE, '][', ")(")
+ end /*n*/ /* [↑] display a (single) solution. */
+ end /*m*/
+ end /*k*/
+ end /*j*/
+ end /*i*/
+ end /*g*/
- do i =1 for ops /*insert an operator after 1st number. */
- do j =1 for ops /*insert an operator after 2nd number. */
- do k =1 for ops /*insert an operator after 2nd number. */
- do m=0 to 3; L.= /*assume no left parenthesis so far. */
- do n=m+1 to 4 /*match left paren with a right paren. */
- L.m=Lpar /*define a left paren, m=0 means ignore*/
- R.= /*un-define all right parenthesis. */
- if m==1 & n==2 then L.= /*special case of : (n) + ··· */
- else if m\==0 then R.n=Rpar /*no (, no )*/
- e = L.1 g.1 @.i L.2 g.2 @.j L.3 g.3 R.3 @.k g.4 R.4
- e=space(e, 0) /*remove all blanks from the expression*/
- /* [↓] change expression: */
- /* /(yyy) ═══► /div(yyy) */
- /*Enables to check for division by zero*/
- yyyE=e /*keep old the version for the display.*/
- if pos('/(', e)\==0 then e=changestr( '/(', e, "/div(" )
- /* [↓] INTERPRET stresses REXX's groin,*/
- /* so try to avoid repeated lifting.*/
- if !.e then iterate /*was this expression already used? */
- !.e=1 /*mark this expression as being used. */
- interpret 'x=' e /*have REXX do all the heavy lifting */
- x=x/1 /*remove any trailing decimal point. */
- if x\==24 then iterate /*Is the result incorrect? Try again. */
- #=#+1 /*bump number of found solutions. */
- _=translate(yyyE, '][', ")(") /*display [], not (). */
- if show then say indent 'a solution:' _
- end /*n*/ /* [↑] show a solution.*/
- end /*m*/
- end /*k*/
- end /*j*/
- end /*i*/
- end /*g*/
-
-return #
-/*──────────────────────────────────SORT subroutine───────────────────────────*/
-sort: procedure; arg nnnn; L=length(nnnn)
-
- do i=1 for L /*build an array of digits from NNNN. */
- s.i=substr(nnnn, i, 1) /*this enables SORT to sort an array. */
- end /*i*/
-
- do j=1 for L; _=s.j
- do k=j+1 to L
- if s.k<_ then parse value s.j s.k with s.k s.j
- end /*k*/
- end /*j*/
-return s.1 || s.2 || s.3 || s.4
-/*──────────────────────────────────VALIDATE subroutine───────────────────────*/
-validate: parse arg y; errCode=0; _v=verify(y,digs)
- select
- when y=='' then call ger 'no digits entered.'
- when length(y)<4 then call ger 'not enough digits entered, must be four.'
- when length(y)>4 then call ger 'too many digits entered, must be four.'
- when pos(0,y)\==0 then call ger "can't use the digit 0 (zero)."
- when _v\==0 then call ger 'illegal character: ' substr(y,_v,1)
- otherwise nop
- end /*select*/
-return \errCode
+ return #
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+sort: procedure; parse arg #; L=length(#); !.= /*this is a modified bin sort.*/
+ do d=1 for L; _=substr(#, d, 1); !.d=!.d || _; end /*d*/
+ return space(!.0 !.1 !.2 !.3 !.4 !.5 !.6 !.7 !.8 !.9, 0) /*reconstitute the #.*/
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+validate: parse arg y; OK=1; _v=verify(y,digs); DE='digits entered, there must be four.'
+ select
+ when y=='' then call ger "no" DE
+ when length(y)<4 then call ger "not enough" DE
+ when length(y)>4 then call ger "too many" DE
+ when pos(0,y)\==0 then call ger "can't use the digit 0 (zero)."
+ when _v\==0 then call ger "illegal character: " substr(y, _v, 1)
+ otherwise nop
+ end /*select*/
+ return OK
diff --git a/Task/24-game/Ruby/24-game.rb b/Task/24-game/Ruby/24-game.rb
index 1e6ef926b4..fde9726d23 100644
--- a/Task/24-game/Ruby/24-game.rb
+++ b/Task/24-game/Ruby/24-game.rb
@@ -1,16 +1,14 @@
-def validate(guess, nums)
- name, error =
- {
- invalid_character: ->(str){ !str.scan(%r{[^\d\s()+*/-]}).empty? },
- wrong_number: ->(str){ str.scan(/\d/).map(&:to_i).sort != nums.sort },
- multi_digit_number: ->(str){ str.match(/\d\d/) }
- }
- .find {|name, validator| validator[guess] }
-
- error ? puts("Invalid input of a(n) #{name.to_s.tr('_',' ')}!") : true
-end
-
class Guess < String
+ def self.play
+ nums = Array.new(4){rand(1..9)}
+ loop do
+ result = get(nums).evaluate!
+ break if result == 24.0
+ puts "Try again! That gives #{result}!"
+ end
+ puts "You win!"
+ end
+
def self.get(nums)
loop do
print "\nEnter a guess using #{nums}: "
@@ -19,24 +17,24 @@ class Guess < String
end
end
+ def self.validate(guess, nums)
+ name, error =
+ {
+ invalid_character: ->(str){ !str.scan(%r{[^\d\s()+*/-]}).empty? },
+ wrong_number: ->(str){ str.scan(/\d/).map(&:to_i).sort != nums.sort },
+ multi_digit_number: ->(str){ str.match(/\d\d/) }
+ }
+ .find {|name, validator| validator[guess] }
+
+ error ? puts("Invalid input of a(n) #{name.to_s.tr('_',' ')}!") : true
+ end
+
def evaluate!
- as_rat = gsub(/(\d)/, 'Rational(\1,1)')
- begin
- eval "(#{as_rat}).to_f"
- rescue SyntaxError
- "[syntax error]"
- end
+ as_rat = gsub(/(\d)/, '\1r') # r : Rational suffix
+ eval "(#{as_rat}).to_f"
+ rescue SyntaxError
+ "[syntax error]"
end
end
-def play
- nums = Array.new(4){rand(1..9)}
- loop do
- result = Guess.get(nums).evaluate!
- break if result == 24.0
- puts "Try again! That gives #{result}!"
- end
- puts "You win!"
-end
-
-play
+Guess.play
diff --git a/Task/24-game/Rust/24-game.rust b/Task/24-game/Rust/24-game.rust
new file mode 100644
index 0000000000..bdcad8b01d
--- /dev/null
+++ b/Task/24-game/Rust/24-game.rust
@@ -0,0 +1,102 @@
+use std::io::{self,BufRead};
+extern crate rand;
+use rand::Rng;
+
+fn op_type(x: char) -> i32{
+ match x {
+ '-' | '+' => return 1,
+ '/' | '*' => return 2,
+ '(' | ')' => return -1,
+ _ => return 0,
+ }
+}
+
+fn to_rpn(input: &mut String){
+
+ let mut rpn_string : String = String::new();
+ let mut rpn_stack : String = String::new();
+ let mut last_token = '#';
+ for token in input.chars(){
+ if token.is_digit(10) {
+ rpn_string.push(token);
+ }
+ else if op_type(token) == 0 {
+ continue;
+ }
+ else if op_type(token) > op_type(last_token) || token == '(' {
+ rpn_stack.push(token);
+ last_token=token;
+ }
+ else {
+ while let Some(top) = rpn_stack.pop() {
+ if top=='(' {
+ break;
+ }
+ rpn_string.push(top);
+ }
+ if token != ')'{
+ rpn_stack.push(token);
+ }
+ }
+ }
+ while let Some(top) = rpn_stack.pop() {
+ rpn_string.push(top);
+ }
+
+ println!("you formula results in {}", rpn_string);
+
+ *input=rpn_string;
+}
+
+fn calculate(input: &String, list : &mut [u32;4]) -> f32{
+ let mut stack : Vec = Vec::new();
+ let mut accumulator : f32 = 0.0;
+
+ for token in input.chars(){
+ if token.is_digit(10) {
+ let test = token.to_digit(10).unwrap() as u32;
+ match list.iter().position(|&x| x == test){
+ Some(idx) => list[idx]=10 ,
+ _ => println!(" invalid digit: {} ",test),
+ }
+ stack.push(accumulator);
+ accumulator = test as f32;
+ }else{
+ let a = stack.pop().unwrap();
+ accumulator = match token {
+ '-' => a-accumulator,
+ '+' => a+accumulator,
+ '/' => a/accumulator,
+ '*' => a*accumulator,
+ _ => {accumulator},//NOP
+ };
+ }
+ }
+ println!("you formula results in {}",accumulator);
+ accumulator
+}
+
+fn main() {
+
+ let mut rng = rand::thread_rng();
+ let mut list :[u32;4]=[rng.gen::()%10,rng.gen::()%10,rng.gen::()%10,rng.gen::()%10];
+
+ println!("form 24 with using + - / * {:?}",list);
+ //get user input
+ let mut input = String::new();
+ io::stdin().read_line(&mut input).unwrap();
+ //convert to rpn
+ to_rpn(&mut input);
+ let result = calculate(&input, &mut list);
+
+ if list.iter().any(|&list| list !=10){
+ println!("and you used all numbers");
+ match result {
+ 24.0 => println!("you won"),
+ _ => println!("but your formulla doesn't result in 24"),
+ }
+ }else{
+ println!("you didn't use all the numbers");
+ }
+
+}
diff --git a/Task/24-game/ZX-Spectrum-Basic/24-game.zx b/Task/24-game/ZX-Spectrum-Basic/24-game.zx
new file mode 100644
index 0000000000..391a4e21fd
--- /dev/null
+++ b/Task/24-game/ZX-Spectrum-Basic/24-game.zx
@@ -0,0 +1,52 @@
+10 LET n$=""
+20 RANDOMIZE
+30 FOR i=1 TO 4
+40 LET n$=n$+STR$ (INT (RND*9)+1)
+50 NEXT i
+60 LET i$="": LET f$="": LET p$=""
+70 CLS
+80 PRINT "24 game"
+90 PRINT "Allowed characters:"
+100 LET i$=n$+"+-*/()"
+110 PRINT AT 4,0;
+120 FOR i=1 TO 10
+130 PRINT i$(i);" ";
+140 NEXT i
+150 PRINT "(0 to end)"
+160 INPUT "Enter the formula";f$
+170 IF f$="0" THEN STOP
+180 PRINT AT 6,0;f$;" = ";
+190 FOR i=1 TO LEN f$
+200 LET c$=f$(i)
+210 IF c$=" " THEN LET f$(i)="": GO TO 250
+220 IF c$="+" OR c$="-" OR c$="*" OR c$="/" THEN LET p$=p$+"o": GO TO 250
+230 IF c$="(" OR c$=")" THEN LET p$=p$+c$: GO TO 250
+240 LET p$=p$+"n"
+250 NEXT i
+260 RESTORE
+270 FOR i=1 TO 11
+280 READ t$
+290 IF t$=p$ THEN LET i=11
+300 NEXT i
+310 IF t$<>p$ THEN PRINT INVERSE 1;"Bad construction!": BEEP 1,.1: PAUSE 0: GO TO 60
+320 FOR i=1 TO LEN f$
+330 FOR j=1 TO 10
+340 IF (f$(i)=i$(j)) AND f$(i)>"0" AND f$(i)<="9" THEN LET i$(j)=" "
+350 NEXT j
+360 NEXT i
+370 IF i$( TO 4)<>" " THEN PRINT FLASH 1;"Invalid arguments!": BEEP 1,.01: PAUSE 0: GO TO 60
+380 LET r=VAL f$
+390 PRINT r;" ";
+400 IF r<>24 THEN PRINT FLASH 1;"Wrong!": BEEP 1,1: PAUSE 0: GO TO 60
+410 PRINT FLASH 1;"Correct!": PAUSE 0: GO TO 10
+420 DATA "nononon"
+430 DATA "(non)onon"
+440 DATA "nono(non)"
+450 DATA "no(no(non))"
+460 DATA "((non)on)on"
+470 DATA "no(non)on"
+480 DATA "(non)o(non)"
+485 DATA "no((non)on)"
+490 DATA "(nonon)on"
+495 DATA "(no(non))on"
+500 DATA "no(nonon)"
diff --git a/Task/9-billion-names-of-God-the-integer/00DESCRIPTION b/Task/9-billion-names-of-God-the-integer/00DESCRIPTION
index 650f143d7d..12a6cd28e3 100644
--- a/Task/9-billion-names-of-God-the-integer/00DESCRIPTION
+++ b/Task/9-billion-names-of-God-the-integer/00DESCRIPTION
@@ -1,14 +1,17 @@
This task is a variation of the [[wp:The Nine Billion Names of God#Plot_summary|short story by Arthur C. Clarke]].
+
(Solvers should be aware of the consequences of completing this task.)
-In detail, to specify what is meant by a “name”:
-:The integer 1 has 1 name “1”.
-:The integer 2 has 2 names “1+1”, and “2”.
-:The integer 3 has 3 names “1+1+1”, “2+1”, and “3”.
-:The integer 4 has 5 names “1+1+1+1”, “2+1+1”, “2+2”, “3+1”, “4”.
-:The integer 5 has 7 names “1+1+1+1+1”, “2+1+1+1”, “2+2+1”, “3+1+1”, “3+2”, “4+1”, “5”.
+
+In detail, to specify what is meant by a “name”:
+:The integer 1 has 1 name “1”.
+:The integer 2 has 2 names “1+1”, and “2”.
+:The integer 3 has 3 names “1+1+1”, “2+1”, and “3”.
+:The integer 4 has 5 names “1+1+1+1”, “2+1+1”, “2+2”, “3+1”, “4”.
+:The integer 5 has 7 names “1+1+1+1+1”, “2+1+1+1”, “2+2+1”, “3+1+1”, “3+2”, “4+1”, “5”.
+
;Task
-The task is to display the first 25 rows of a number triangle which begins:
+Display the first 25 rows of a number triangle which begins:
1
1 1
@@ -18,11 +21,18 @@ The task is to display the first 25 rows of a number triangle which begins:
1 3 3 2 1 1
-Where row corresponds to integer , and each column in row from left to right corresponds to the number of names begining with .
+Where row corresponds to integer , and each column in row from left to right corresponds to the number of names beginning with .
+
+A function should return the sum of the -th row.
+
+Demonstrate this function by displaying: , , , and .
+
+Optionally note that the sum of the -th row is the [http://mathworld.wolfram.com/PartitionFunctionP.html integer partition function].
+
+Demonstrate this is equivalent to by displaying: , , , and .
-A function should return the sum of the -th row. Demonstrate this function by displaying: , , , and .
-Optionally note that the sum of the -th row is the [http://mathworld.wolfram.com/PartitionFunctionP.html integer partition function]. Demonstrate this is equivalent to by displaying: , , , and .
;Extra credit
-If your environment is able, plot against for .
+If your environment is able, plot against for .
+
diff --git a/Task/9-billion-names-of-God-the-integer/Elixir/9-billion-names-of-god-the-integer.elixir b/Task/9-billion-names-of-God-the-integer/Elixir/9-billion-names-of-god-the-integer.elixir
new file mode 100644
index 0000000000..df84201441
--- /dev/null
+++ b/Task/9-billion-names-of-God-the-integer/Elixir/9-billion-names-of-god-the-integer.elixir
@@ -0,0 +1,12 @@
+defmodule God do
+ def g(n,g) when g == 1 or n < g, do: 1
+ def g(n,g) do
+ Enum.reduce(2..g, 1, fn q,res ->
+ res + (if q > n-g, do: 0, else: g(n-g,q))
+ end)
+ end
+end
+
+Enum.each(1..25, fn n ->
+ IO.puts Enum.map(1..n, fn g -> "#{God.g(n,g)} " end)
+end)
diff --git a/Task/9-billion-names-of-God-the-integer/Frink/9-billion-names-of-god-the-integer.frink b/Task/9-billion-names-of-God-the-integer/Frink/9-billion-names-of-god-the-integer-1.frink
similarity index 100%
rename from Task/9-billion-names-of-God-the-integer/Frink/9-billion-names-of-god-the-integer.frink
rename to Task/9-billion-names-of-God-the-integer/Frink/9-billion-names-of-god-the-integer-1.frink
diff --git a/Task/9-billion-names-of-God-the-integer/Frink/9-billion-names-of-god-the-integer-2.frink b/Task/9-billion-names-of-God-the-integer/Frink/9-billion-names-of-god-the-integer-2.frink
new file mode 100644
index 0000000000..3e352ff030
--- /dev/null
+++ b/Task/9-billion-names-of-God-the-integer/Frink/9-billion-names-of-god-the-integer-2.frink
@@ -0,0 +1,33 @@
+PrintArray(List([1 .. 25], n -> List([1 .. n], k -> NrPartitions(n, k))));
+
+[ [ 1 ],
+ [ 1, 1 ],
+ [ 1, 1, 1 ],
+ [ 1, 2, 1, 1 ],
+ [ 1, 2, 2, 1, 1 ],
+ [ 1, 3, 3, 2, 1, 1 ],
+ [ 1, 3, 4, 3, 2, 1, 1 ],
+ [ 1, 4, 5, 5, 3, 2, 1, 1 ],
+ [ 1, 4, 7, 6, 5, 3, 2, 1, 1 ],
+ [ 1, 5, 8, 9, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 5, 10, 11, 10, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 6, 12, 15, 13, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 6, 14, 18, 18, 14, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 7, 16, 23, 23, 20, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 7, 19, 27, 30, 26, 21, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 8, 21, 34, 37, 35, 28, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 8, 24, 39, 47, 44, 38, 29, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 9, 27, 47, 57, 58, 49, 40, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 9, 30, 54, 70, 71, 65, 52, 41, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 10, 33, 64, 84, 90, 82, 70, 54, 42, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 10, 37, 72, 101, 110, 105, 89, 73, 55, 42, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 11, 40, 84, 119, 136, 131, 116, 94, 75, 56, 42, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 11, 44, 94, 141, 163, 164, 146, 123, 97, 76, 56, 42, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 12, 48, 108, 164, 199, 201, 186, 157, 128, 99, 77, 56, 42, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ],
+ [ 1, 12, 52, 120, 192, 235, 248, 230, 201, 164, 131, 100, 77, 56, 42, 30, 22, 15, 11, 7, 5, 3, 2, 1, 1 ] ]
+
+
+List([23, 123, 1234, 12345], NrPartitions);
+
+[ 1255, 2552338241, 156978797223733228787865722354959930,
+ 69420357953926116819562977205209384460667673094671463620270321700806074195845953959951425306140971942519870679768681736 ]
diff --git a/Task/9-billion-names-of-God-the-integer/J/9-billion-names-of-god-the-integer-4.j b/Task/9-billion-names-of-God-the-integer/J/9-billion-names-of-god-the-integer-4.j
index b2c645086a..b3ebb4c029 100644
--- a/Task/9-billion-names-of-God-the-integer/J/9-billion-names-of-god-the-integer-4.j
+++ b/Task/9-billion-names-of-God-the-integer/J/9-billion-names-of-god-the-integer-4.j
@@ -1,11 +1,11 @@
rowSums=: 3 :0"0
-z=. (y+1){. 1x
-for_ks. <\1+i.y do.
- n=.{: k=.>ks
- r=.#c=. ({.~* i._1:)(n,0.5 _1.5) p. k
- s=.#d=.({.~* i._1:)c-r{.k
- 'v i'=.|: \:~(c,d),. r ,&({.&k) s
- a=. +/(n{z),(_1^1x+2|i) * v{z
- z=. a n}z
-end.
+ z=. (y+1){. 1x
+ for_ks. <\1+i.y do.
+ n=.{: k=.>ks
+ r=.#c=. ({.~* i._1:)(n,0.5 _1.5) p. k
+ s=.#d=.({.~* i._1:)c-r{.k
+ 'v i'=.|: \:~(c,d),. r ,&({.&k) s
+ a=. +/(n{z),(_1^1x+2|i) * v{z
+ z=. a n}z
+ end.
)
diff --git a/Task/9-billion-names-of-God-the-integer/Java/9-billion-names-of-god-the-integer.java b/Task/9-billion-names-of-God-the-integer/Java/9-billion-names-of-god-the-integer.java
new file mode 100644
index 0000000000..aab3e6ac94
--- /dev/null
+++ b/Task/9-billion-names-of-God-the-integer/Java/9-billion-names-of-god-the-integer.java
@@ -0,0 +1,41 @@
+import java.math.BigInteger;
+import java.util.*;
+import static java.util.Arrays.asList;
+import static java.util.stream.Collectors.toList;
+import static java.util.stream.IntStream.range;
+import static java.lang.Math.min;
+
+public class Test {
+
+ static List cumu(int n) {
+ List> cache = new ArrayList<>();
+ cache.add(asList(BigInteger.ONE));
+
+ for (int L = cache.size(); L < n + 1; L++) {
+ List r = new ArrayList<>();
+ r.add(BigInteger.ZERO);
+ for (int x = 1; x < L + 1; x++)
+ r.add(r.get(r.size() - 1).add(cache.get(L - x).get(min(x, L - x))));
+ cache.add(r);
+ }
+ return cache.get(n);
+ }
+
+ static List row(int n) {
+ List r = cumu(n);
+ return range(0, n).mapToObj(i -> r.get(i + 1).subtract(r.get(i)))
+ .collect(toList());
+ }
+
+ public static void main(String[] args) {
+ System.out.println("Rows:");
+ for (int x = 1; x < 11; x++)
+ System.out.printf("%2d: %s%n", x, row(x));
+
+ System.out.println("\nSums:");
+ for (int x : new int[]{23, 123, 1234}) {
+ List c = cumu(x);
+ System.out.printf("%s %s%n", x, c.get(c.size() - 1));
+ }
+ }
+}
diff --git a/Task/9-billion-names-of-God-the-integer/Kotlin/9-billion-names-of-god-the-integer.kotlin b/Task/9-billion-names-of-God-the-integer/Kotlin/9-billion-names-of-god-the-integer.kotlin
new file mode 100644
index 0000000000..063ee350cd
--- /dev/null
+++ b/Task/9-billion-names-of-God-the-integer/Kotlin/9-billion-names-of-god-the-integer.kotlin
@@ -0,0 +1,29 @@
+fun namesOfGod(n: Int): List {
+
+ val cache = ArrayList>()
+ cache.add(asList(BigInteger.ONE))
+
+ (cache.size..n).forEach { l ->
+ val r = ArrayList()
+ r.add(BigInteger.ZERO)
+
+ (1..l).forEach { x ->
+ r.add(r[r.size - 1] + cache[l - x][min(x, l - x)])
+ }
+ cache.add(r)
+ }
+ return cache[n]
+}
+
+fun row(n: Int) = namesOfGod(n).let { r -> (0..n-1).map { r[it + 1] - r[it] } }
+
+println("Rows:")
+(1..25).forEach {
+ System.out.printf("%2d: %s%n", it, row(it))
+}
+
+println("\nSums:")
+intArrayOf(23, 123, 1234, 1234).forEach {
+ val c = namesOfGod(it)
+ System.out.printf("%s %s%n", it, c[c.size - 1])
+}
diff --git a/Task/9-billion-names-of-God-the-integer/PARI-GP/9-billion-names-of-god-the-integer.pari b/Task/9-billion-names-of-God-the-integer/PARI-GP/9-billion-names-of-god-the-integer.pari
new file mode 100644
index 0000000000..e1d7a3ee99
--- /dev/null
+++ b/Task/9-billion-names-of-God-the-integer/PARI-GP/9-billion-names-of-god-the-integer.pari
@@ -0,0 +1,5 @@
+row(n)=my(v=vector(n)); forpart(i=n,v[i[#i]]++); v;
+show(n)=for(k=1,n,print(row(k)));
+show(25)
+apply(numbpart, [23,123,1234,12345])
+plot(x=1,999.9, numbpart(x\1))
diff --git a/Task/9-billion-names-of-God-the-integer/Perl-6/9-billion-names-of-god-the-integer.pl6 b/Task/9-billion-names-of-God-the-integer/Perl-6/9-billion-names-of-god-the-integer.pl6
index d3b8bd70f4..d61874dd56 100644
--- a/Task/9-billion-names-of-God-the-integer/Perl-6/9-billion-names-of-god-the-integer.pl6
+++ b/Task/9-billion-names-of-God-the-integer/Perl-6/9-billion-names-of-god-the-integer.pl6
@@ -1,4 +1,4 @@
-my @todo = [1];
+my @todo = $[1];
my @sums = 0;
sub nextrow($n) {
for +@todo .. $n -> $l {
@@ -24,6 +24,6 @@ say .fmt('%2d'), ": ", nextrow($_)[] for 1..10;
say "\nsums:";
-for 23, 123, 1234, 10000 {
+for 23, 123, 1234, 12345 {
say $_, "\t", [+] nextrow($_)[];
}
diff --git a/Task/9-billion-names-of-God-the-integer/REXX/9-billion-names-of-god-the-integer.rexx b/Task/9-billion-names-of-God-the-integer/REXX/9-billion-names-of-god-the-integer.rexx
index d47d43180a..04428c8133 100644
--- a/Task/9-billion-names-of-God-the-integer/REXX/9-billion-names-of-god-the-integer.rexx
+++ b/Task/9-billion-names-of-God-the-integer/REXX/9-billion-names-of-god-the-integer.rexx
@@ -1,52 +1,52 @@
-/*REXX program generates & shows a number triangle for partitions of a number.*/
-numeric digits 400 /*be able to handle larger numbers. */
-parse arg N .; if N=='' then N=25 /*N specified? Then use the default. */
+/*REXX program generates and displays a number triangle for partitions of a number. */
+numeric digits 400 /*be able to handle larger numbers. */
+parse arg N .; if N=='' then N=25 /*N specified? Then use the default. */
@.=0; @.0=1; aN=abs(N)
-if N==N+0 then say ' G('aN"):" G(N) /*just for well formed numbers.*/
- say 'partitions('aN"):" partitions(aN) /*do it the easy way*/
-exit /*stick a fork in it, we're all done. */
-/*──────────────────────────────────G subroutine──────────────────────────────*/
-G: procedure; parse arg nn; !.=0; mx=1; aN=abs(nn); build=nn>0
-!.4.2=2; do j=1 for aN%2; !.j.j=1; end /*j*/ /*gen shortcuts.*/
+if N==N+0 then say ' G('aN"):" G(N) /*just do this for well formed numbers.*/
+ say 'partitions('aN"):" partitions(aN) /*do it the easy way.*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+G: procedure; parse arg nn; !.=0; mx=1; aN=abs(nn); build=nn>0
+ !.4.2=2; do j=1 for aN%2; !.j.j=1; end /*j*/ /*generate some shortcuts.*/
- do t=1 for 1+build; #.=1 /*gen triangle once or twice ···*/
- do r=1 for aN; #.2=r%2 /*#.2 is a shortcut calculation.*/
- do c=3 to r-2; #.c=gen#(r,c); end /*c*/
- L=length(mx); p=0; __= /*__ will be a row (line) of triangle.*/
- do cc=1 for r /*only sum the last row of numbers. */
- p=p+#.cc /*add the last row of the triangle. */
- if \build then iterate /*should we skip building the triangle?*/
- mx=max(mx,#.cc) /*used to build the symmetric numbers. */
- __=__ right(#.cc,L) /*construct a row (or line) of triangle*/
- end /*cc*/
- if t==1 then iterate /*Is this the 1st time through? No show*/
- say center(strip(__), 2+(aN-1)*(length(mx)+1))
- end /*r*/ /* [↑] center the row of the triangle.*/
- end /*t*/
-return p /*return with the generated number. */
-/*──────────────────────────────────GEN# subroutine───────────────────────────*/
-gen#: procedure expose !.; parse arg x,y /*obtain X and Y arguments. */
-if !.x.y\==0 then return !.x.y /*was number generated before?*/
-if y>x%2 then do; nx=x+1-2*(y-x%2)-(x//2==0); ny=nx%2; !.x.y=!.nx.ny
- return !.x.y /*return the calculated number*/
- end /* [↑] right half of triangle*/
-$=1 /* [↓] left " " " */
- do q=2 for y-1; xy=x-y; if q>xy then iterate
- if q==2 then $=$+xy%2
- else if q==xy-1 then $=$+1
- else $=$+gen#(xy,q) /*recurse.*/
- end /*q*/
-!.x.y=$; return $ /*use memoization; return with number.*/
-/*──────────────────────────────────PARTITIONS subroutine─────────────────────*/
-partitions: procedure expose @.; parse arg n; if @.n\==0 then return @.n /*◄─┐*/
-$=0 /*Already known? Then return value►───┘*/
- do k=1 for n; _=n-(k*3-1)*k%2; if _<0 then leave
- if @._==0 then x=partitions(_) /* [◄] recursive call.*/
- else x=@._ /*value already known. */
- _=_-k; if _<0 then y=0 /*recursive call ►────┐*/
- else if @._==0 then y=partitions(_) /*◄──┘*/
- else y=@._
- if k//2 then $=$+x+y /*utilize this method if K is odd. */
- else $=$2x-y /* " " " " " " even. */
- end /*k*/ /* [↑] Euler's recursive function. */
-@.n=$; return $ /*use memoization; return with number.*/
+ do t=1 for 1+build; #.=1 /*generate triangle once or twice. */
+ do r=1 for aN; #.2=r%2 /*#.2 is a shortcut calculation. */
+ do c=3 to r-2; #.c=gen#(r,c); end /*c*/
+ L=length(mx); p=0; __= /*__ will be a row of the triangle*/
+ do cc=1 for r /*only sum the last row of numbers.*/
+ p=p+#.cc /*add the last row of the triangle.*/
+ if \build then iterate /*should we skip building triangle?*/
+ mx=max(mx, #.cc) /*used to build the symmetric #s. */
+ __=__ right(#.cc, L) /*construct a row of the triangle. */
+ end /*cc*/
+ if t==1 then iterate /*Is this 1st time through? No show*/
+ say center(strip(__), 2+(aN-1)*(length(mx)+1))
+ end /*r*/ /* [↑] center row of the triangle.*/
+ end /*t*/
+ return p /*return with the generated number.*/
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+gen#: procedure expose !.; parse arg x,y /*obtain the X and Y arguments.*/
+ if !.x.y\==0 then return !.x.y /*was number generated before ? */
+ if y>x%2 then do; nx=x+1-2*(y-x%2)-(x//2==0); ny=nx%2; !.x.y=!.nx.ny
+ return !.x.y /*return the calculated number. */
+ end /* [↑] right half of triangle. */
+ $=1 /* [↓] left " " " */
+ do q=2 for y-1; xy=x-y; if q>xy then iterate
+ if q==2 then $=$+xy%2
+ else if q==xy-1 then $=$+1
+ else $=$+gen#(xy,q) /*recurse.*/
+ end /*q*/
+ !.x.y=$; return $ /*use memoization; return with #.*/
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+partitions: procedure expose @.; parse arg n; if @.n\==0 then return @.n /* ◄────────┐ */
+ $=0 /*Already known? Return ►───┘ */
+ do k=1 for n; _=n-(k*3-1)*k%2; if _<0 then leave
+ if @._==0 then x=partitions(_) /* [◄] recursive call.*/
+ else x=@._ /*value already known. */
+ _=_-k; if _<0 then y=0 /*recursive call ►────┐*/
+ else if @._==0 then y=partitions(_) /*◄──┘*/
+ else y=@._
+ if k//2 then $=$+x+y /*use this method if K is odd. */
+ else $=$-x-y /* " " " " " " even.*/
+ end /*k*/ /* [↑] Euler's recursive func.*/
+ @.n=$; return $ /*use memoization; return #. */
diff --git a/Task/9-billion-names-of-God-the-integer/Rust/9-billion-names-of-god-the-integer.rust b/Task/9-billion-names-of-God-the-integer/Rust/9-billion-names-of-god-the-integer.rust
new file mode 100644
index 0000000000..f7d0da724a
--- /dev/null
+++ b/Task/9-billion-names-of-God-the-integer/Rust/9-billion-names-of-god-the-integer.rust
@@ -0,0 +1,45 @@
+extern crate num;
+
+use std::cmp;
+use num::bigint::BigUint;
+
+fn cumu(n: usize, cache: &mut Vec>) {
+ for l in cache.len()..n+1 {
+ let mut r = vec![BigUint::from(0u32)];
+ for x in 1..l+1 {
+ let prev = r[r.len() - 1].clone();
+ r.push(prev + cache[l-x][cmp::min(x, l-x)].clone());
+ }
+ cache.push(r);
+ }
+}
+
+fn row(n: usize, cache: &mut Vec>) -> Vec {
+ cumu(n, cache);
+ let r = &cache[n];
+ let mut v: Vec = Vec::new();
+
+ for i in 0..n {
+ v.push(&r[i+1] - &r[i]);
+ }
+ v
+}
+
+fn main() {
+ let mut cache = vec![vec![BigUint::from(1u32)]];
+
+ println!("rows:");
+ for x in 1..26 {
+ let v: Vec = row(x, &mut cache).iter().map(|e| e.to_string()).collect();
+ let s: String = v.join(" ");
+ println!("{}: {}", x, s);
+ }
+
+ println!("sums:");
+ for x in vec![23, 123, 1234, 12345] {
+ cumu(x, &mut cache);
+ let v = &cache[x];
+ let s = v[v.len() - 1].to_string();
+ println!("{}: {}", x, s);
+ }
+}
diff --git a/Task/99-Bottles-of-Beer/00DESCRIPTION b/Task/99-Bottles-of-Beer/00DESCRIPTION
index b80cf19829..429e8fe81f 100644
--- a/Task/99-Bottles-of-Beer/00DESCRIPTION
+++ b/Task/99-Bottles-of-Beer/00DESCRIPTION
@@ -1,25 +1,29 @@
-'''The beersong'''
-In this puzzle, write code to print out
-the entire "99 bottles of beer on the wall" song.
+;Task:
+Display the complete lyrics for the song: '''99 bottles of beer on the wall'''.
-For those who do not know the song, the lyrics follow this form:
- X bottles of beer on the wall
- X bottles of beer
- Take one down, pass it around
- X-1 bottles of beer on the wall
- X-1 bottles of beer on the wall
- ...
- Take one down, pass it around
- 0 bottles of beer on the wall
+;The beersong:
+The lyrics follow this form:
+ X bottles of beer on the wall
+ X bottles of beer
+ Take one down, pass it around
+ X-1 bottles of beer on the wall
+
+ X-1 bottles of beer on the wall
+ ...
+ Take one down, pass it around
+ 0 bottles of beer on the wall
Where X and X-1 are replaced by numbers of course.
+
Grammatical support for "1 bottle of beer" is optional.
+
As with any puzzle, try to do it in as creative/concise/comical a way
as possible (simple, obvious solutions allowed, too).
+
;See also:
* http://99-bottles-of-beer.net/
* [[:Category:99_Bottles_of_Beer]]
* [[:Category:Programming language families]]
-
-
+* [https://en.wikipedia.org/wiki/99_Bottles_of_Beer Wikipedia 99 bottles of beer]
+
diff --git a/Task/99-Bottles-of-Beer/AppleScript/99-bottles-of-beer.applescript b/Task/99-Bottles-of-Beer/AppleScript/99-bottles-of-beer-1.applescript
similarity index 100%
rename from Task/99-Bottles-of-Beer/AppleScript/99-bottles-of-beer.applescript
rename to Task/99-Bottles-of-Beer/AppleScript/99-bottles-of-beer-1.applescript
diff --git a/Task/99-Bottles-of-Beer/AppleScript/99-bottles-of-beer-2.applescript b/Task/99-Bottles-of-Beer/AppleScript/99-bottles-of-beer-2.applescript
new file mode 100644
index 0000000000..064bf47b16
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/AppleScript/99-bottles-of-beer-2.applescript
@@ -0,0 +1,91 @@
+-- BRIEF
+
+on run
+
+ intercalate("\n\n", ¬
+ map(recitation, range(99, 0)))
+
+end run
+
+
+-- DECLARATIVE
+
+script recitation
+ property coordinates : " on the wall"
+ property redistribution : "Take one down, pass it around"
+ property resort : "Better go to the store to buy some more"
+ property unit : "bottle"
+
+ -- Int -> String
+ on lambda(n)
+ if n > 0 then
+ set reserve to resourceDescriptor(n)
+ set residue to resourceDescriptor(n - 1)
+
+ intercalate(linefeed, ¬
+ {reserve & coordinates, reserve, ¬
+ redistribution, residue & coordinates})
+ else
+ resort
+ end if
+ end lambda
+
+ -- resourceDescriptor :: Int -> String
+ on resourceDescriptor(n)
+ if n ≠ 1 then
+ (n as string) & space & unit & "s"
+ else
+ "1 " & unit
+ end if
+ end resourceDescriptor
+end script
+
+
+
+-- DYSFUNCTIONAL
+
+-- map :: (a -> b) -> [a] -> [b]
+on map(f, xs)
+ tell mReturn(f)
+ set lng to length of xs
+ set lst to {}
+ repeat with i from 1 to lng
+ set end of lst to lambda(item i of xs, i, xs)
+ end repeat
+ return lst
+ end tell
+end map
+
+-- range :: Int -> Int -> [Int]
+on range(m, n)
+ if n < m then
+ set d to -1
+ else
+ set d to 1
+ end if
+ set lst to {}
+ repeat with i from m to n by d
+ set end of lst to i
+ end repeat
+ return lst
+end range
+
+-- intercalate :: Text -> [Text] -> Text
+on intercalate(strText, lstText)
+ set {dlm, my text item delimiters} to {my text item delimiters, strText}
+ set strJoined to lstText as text
+ set my text item delimiters to dlm
+ return strJoined
+end intercalate
+
+-- Lift 2nd class handler function into 1st class script wrapper
+-- mReturn :: Handler -> Script
+on mReturn(f)
+ if class of f is script then
+ f
+ else
+ script
+ property lambda : f
+ end script
+ end if
+end mReturn
diff --git a/Task/99-Bottles-of-Beer/Bc/99-bottles-of-beer.bc b/Task/99-Bottles-of-Beer/Bc/99-bottles-of-beer.bc
new file mode 100644
index 0000000000..50271dd870
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Bc/99-bottles-of-beer.bc
@@ -0,0 +1,14 @@
+i = 99;
+while (i > -1) {
+ print i , " bottles of beer on the wall\n";
+ print i , " bottles of beer\nTake one down, pass it around\n";
+ if (i == 2) {
+ break
+ }
+ print --i , " bottles of beer on the wall\n";
+}
+
+print --i , " bottle of beer on the wall\n";
+print i , " bottle of beer on the wall\n";
+print i , " bottle of beer\nTake it down, pass it around\nno more bottles of beer on the wall\n";
+quit
diff --git a/Task/99-Bottles-of-Beer/Dc/99-bottles-of-beer-1.dc b/Task/99-Bottles-of-Beer/Dc/99-bottles-of-beer-1.dc
new file mode 100644
index 0000000000..c58331ca18
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Dc/99-bottles-of-beer-1.dc
@@ -0,0 +1,29 @@
+[
+ dnrpr
+ dnlBP
+ lCP
+ 1-dnrp
+ rd2r >L
+]sL
+
+[Take one down, pass it around
+]sC
+[ bottles of beer
+]sB
+[ bottles of beer on the wall]
+99
+
+lLx
+
+dnrpsA
+dnlBP
+lCP
+1-
+dn[ bottle of beer on the wall]p
+rdnrpsA
+n[ bottle of beer
+]P
+[Take it down, pass it around
+]P
+[no more bottles of beer on the wall
+]P
diff --git a/Task/99-Bottles-of-Beer/Dc/99-bottles-of-beer-2.dc b/Task/99-Bottles-of-Beer/Dc/99-bottles-of-beer-2.dc
new file mode 100644
index 0000000000..83fd3b862c
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Dc/99-bottles-of-beer-2.dc
@@ -0,0 +1,32 @@
+[
+ plAP
+ plBP
+ lCP
+ 1-dplAP
+ d2r >L
+]sL
+
+[Take one down, pass it around
+]sC
+[bottles of beer
+]sB
+[bottles of beer on the wall
+]sA
+99
+
+lLx
+
+plAP
+plBP
+lCP
+1-
+p
+[bottle of beer on the wall
+]P
+p
+[bottle of beer
+]P
+[Take it down, pass it around
+]P
+[no more bottles of beer on the wall
+]P
diff --git a/Task/99-Bottles-of-Beer/Elena/99-bottles-of-beer.elena b/Task/99-Bottles-of-Beer/Elena/99-bottles-of-beer.elena
new file mode 100644
index 0000000000..84959b3420
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Elena/99-bottles-of-beer.elena
@@ -0,0 +1,33 @@
+#import system.
+#import system'dynamic.
+#import system'routines.
+#import extensions.
+#import extensions'routines.
+#import extensions'text.
+
+#class(extension)bottleOp
+{
+ #method bottleDescription
+ = self literal + (self != 1) iif:" bottles":" bottle".
+
+ #method bottleEnumerator = Variable new:self eval &with:target
+ [
+ Enumerator
+ {
+ next = target > 0.
+
+ get = StringWriter new
+ writeLine:(target bottleDescription):" of beer on the wall"
+ writeLine:(target bottleDescription):" of beer"
+ writeLine:"Take one down, pass it around"
+ writeLine:((target -= 1) bottleDescription):" of beer on the wall".
+ }
+ ].
+}
+
+#symbol program =
+[
+ #var bottles := 99.
+
+ bottles bottleEnumerator run &each:printingLn.
+].
diff --git a/Task/99-Bottles-of-Beer/IDL/99-bottles-of-beer-3.idl b/Task/99-Bottles-of-Beer/IDL/99-bottles-of-beer-3.idl
new file mode 100644
index 0000000000..cae2872619
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/IDL/99-bottles-of-beer-3.idl
@@ -0,0 +1,9 @@
+Pro bottles_noloop2
+ n_bottles=99
+ b1 = reverse(SINDGEN(n_bottles,START=1))
+ b2= reverse(SINDGEN(n_bottles))
+ wallT=replicate(' bottles of beer on the wall.', n_bottles)
+ wallT2=replicate(' bottles of beer.', n_bottles)
+ takeT=replicate('Take one down, pass it around,', n_bottles)
+ print, b1+wallT+string(10B)+b1+wallT2+string(10B)+takeT+string(10B)+b2+wallT+string(10B)
+End
diff --git a/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-3.js b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-3.js
index 8c8b4a2fca..260c9d448a 100644
--- a/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-3.js
+++ b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-3.js
@@ -1,2 +1,11 @@
-// Line breaks are in HTML
-var beer; while ((beer = typeof beer === "undefined" ? 99 : beer) > 0) document.write( beer + " bottle" + (beer != 1 ? "s" : "") + " of beer on the wall " + beer + " bottle" + (beer != 1 ? "s" : "") + " of beer Take one down, pass it around " + (--beer) + " bottle" + (beer != 1 ? "s" : "") + " of beer on the wall " );
+var bottles = 99;
+var songTemplate = "{X} bottles of beer on the wall \n" +
+ "{X} bottles of beer \n"+
+ "Take one down, pass it around \n"+
+ "{X-1} bottles of beer on the wall \n";
+
+function song(x, txt) {
+ return txt.replace(/\{X\}/gi, x).replace(/\{X-1\}/gi, x-1) + (x > 1 ? song(x-1, txt) : "");
+}
+
+console.log(song(bottles, songTemplate));
diff --git a/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-4.js b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-4.js
index f24a6c991d..8c8b4a2fca 100644
--- a/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-4.js
+++ b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-4.js
@@ -1,25 +1,2 @@
-function Bottles(count) {
- this.count = count || 99;
-}
-
-Bottles.prototype.take = function() {
- var verse = [
- this.count + " bottles of beer on the wall,",
- this.count + " bottles of beer!",
- "Take one down, pass it around",
- (this.count - 1) + " bottles of beer on the wall!"
- ].join("\n");
-
- console.log(verse);
-
- this.count--;
-};
-
-Bottles.prototype.sing = function() {
- while (this.count) {
- this.take();
- }
-};
-
-var bar = new Bottles(99);
-bar.sing();
+// Line breaks are in HTML
+var beer; while ((beer = typeof beer === "undefined" ? 99 : beer) > 0) document.write( beer + " bottle" + (beer != 1 ? "s" : "") + " of beer on the wall " + beer + " bottle" + (beer != 1 ? "s" : "") + " of beer Take one down, pass it around " + (--beer) + " bottle" + (beer != 1 ? "s" : "") + " of beer on the wall " );
diff --git a/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-5.js b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-5.js
index 036d7f4de0..f24a6c991d 100644
--- a/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-5.js
+++ b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-5.js
@@ -1,18 +1,25 @@
-function bottleSong(n) {
- if (!isFinite(Number(n)) || n == 0) n = 100;
- var a = '%% bottles of beer',
- b = ' on the wall',
- c = 'Take one down, pass it around',
- r = ' '
- p = document.createElement('p'),
- s = [],
- re = /%%/g;
-
- while(n) {
- s.push((a+b+r+a+r+c+r).replace(re, n) + (a+b).replace(re, --n));
- }
- p.innerHTML = s.join(r+r);
- document.body.appendChild(p);
+function Bottles(count) {
+ this.count = count || 99;
}
-window.onload = bottleSong;
+Bottles.prototype.take = function() {
+ var verse = [
+ this.count + " bottles of beer on the wall,",
+ this.count + " bottles of beer!",
+ "Take one down, pass it around",
+ (this.count - 1) + " bottles of beer on the wall!"
+ ].join("\n");
+
+ console.log(verse);
+
+ this.count--;
+};
+
+Bottles.prototype.sing = function() {
+ while (this.count) {
+ this.take();
+ }
+};
+
+var bar = new Bottles(99);
+bar.sing();
diff --git a/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-6.js b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-6.js
new file mode 100644
index 0000000000..036d7f4de0
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/JavaScript/99-bottles-of-beer-6.js
@@ -0,0 +1,18 @@
+function bottleSong(n) {
+ if (!isFinite(Number(n)) || n == 0) n = 100;
+ var a = '%% bottles of beer',
+ b = ' on the wall',
+ c = 'Take one down, pass it around',
+ r = ' '
+ p = document.createElement('p'),
+ s = [],
+ re = /%%/g;
+
+ while(n) {
+ s.push((a+b+r+a+r+c+r).replace(re, n) + (a+b).replace(re, --n));
+ }
+ p.innerHTML = s.join(r+r);
+ document.body.appendChild(p);
+}
+
+window.onload = bottleSong;
diff --git a/Task/99-Bottles-of-Beer/MIPS-Assembly/99-bottles-of-beer.mips b/Task/99-Bottles-of-Beer/MIPS-Assembly/99-bottles-of-beer.mips
new file mode 100644
index 0000000000..75d1ee5c53
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/MIPS-Assembly/99-bottles-of-beer.mips
@@ -0,0 +1,77 @@
+##################################
+# 99 bottles of beer on the wall #
+# MIPS Assembly targeting MARS #
+# By Keith Stellyes #
+# August 24, 2016 #
+##################################
+
+#It is simple, a loop that goes as follows:
+
+#if accumulator is not 1:
+#PRINT INTEGER: accumulator
+#PRINT lyrica
+#PRINT INTEGER: accumulator
+#PRINT lyricb
+#PRINT INTEGER: accumulator
+#PRINT lyricc
+#DECREMENT accumulator
+
+#else:
+#PRINT FINAL LYRICS
+
+.data
+ lyrica: .asciiz " bottles of beer on the wall, "
+ lyricb: " bottles of beer.\nTake one down and pass it around, "
+ lyricc: " bottles of beer on the wall. \n\n"
+
+ #normally, I don't like going past 80 columns, but that was done here.
+ # there's an argument to be had for breaking this up. I chose not to
+ # for simpler instructions.
+ final_lyrics: "1 bottle of beer on the wall, 1 bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall."
+
+.text
+ #lw $a0,accumulator #load address of accumulator into $a0 (or is it getting val?)
+ li $a1,99 #set the inital value of the counter to 99
+
+loop:
+ ###99
+ li $v0, 1 #specify print integer system service
+ move $a0,$a1
+ syscall #print that integer
+
+ ### bottles of beer on the wall,
+ la $a0,lyrica
+ li $v0,4
+ syscall
+
+ ###99
+ li $v0, 1 #specify print integer system service
+ move $a0,$a1
+ syscall #print that integer
+
+ ### bottles of beer.\n Take one down and pass it around,
+ la $a0,lyricb
+ li $v0,4
+ syscall
+
+ ###99
+ li $v0, 1 #specify print integer system service
+ move $a0,$a1
+ syscall #print that integer
+
+ ### "bottles of beer on the wall. \n\n"
+ la $a0,lyricc
+ li $v0,4
+ syscall
+
+ #decrement counter, if at 1, print the final and exit.
+ subi $a1,$a1,1
+ bne $a1,1,loop
+
+### PRINT FINAL LYRIC, THEN TERMINATE.
+final: la $a0,final_lyrics
+ li $v0,4
+ syscall
+
+ li $v0,10
+ syscall
diff --git a/Task/99-Bottles-of-Beer/MUMPS/99-bottles-of-beer-3.mumps b/Task/99-Bottles-of-Beer/MUMPS/99-bottles-of-beer-3.mumps
new file mode 100644
index 0000000000..ff289c13b9
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/MUMPS/99-bottles-of-beer-3.mumps
@@ -0,0 +1,12 @@
+bottles
+ set template1="i_n_""of beer on the wall. ""_i_n_"" of beer. """
+ set template2="""Take""_n2_""down, pass it around. """
+ set template3="j_n3_""of beer on the wall."""
+ for i=99:-1:1 do write ! hang 1
+ . set:i>1 n=" bottles ",n2=" one " set:i=1 n=" bottle ",n2=" it "
+ . set n3=" bottle " set j=i-1 set:(j>1)!(j=0) n3=" bottles " set:j=0 j="No"
+ . write @template1,@template2,@template3
+
+repeat
+ write "One more time!",! hang 5
+ goto bottles
diff --git a/Task/99-Bottles-of-Beer/Mercury/99-bottles-of-beer.mercury b/Task/99-Bottles-of-Beer/Mercury/99-bottles-of-beer.mercury
new file mode 100644
index 0000000000..e4552eab5a
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Mercury/99-bottles-of-beer.mercury
@@ -0,0 +1,60 @@
+% file: beer.m
+% author:
+% Fergus Henderson Thursday 9th November 1995
+% Re-written with new syntax standard library calls:
+% Paul Bone 2015-11-20
+%
+% This beer song is more idiomatic Mercury than the original, I feel bad
+% saying that since Fergus is a founder of the language.
+
+:- module beer.
+:- interface.
+:- import_module io.
+
+:- pred main(io::di, io::uo) is det.
+
+:- implementation.
+
+:- import_module int.
+:- import_module list.
+:- import_module string.
+
+main(!IO) :-
+ beer(99, !IO).
+
+:- pred beer(int::in, io::di, io::uo) is det.
+
+beer(N, !IO) :-
+ io.write_string(beer_stanza(N), !IO),
+ ( N > 0 ->
+ io.nl(!IO),
+ beer(N - 1, !IO)
+ ;
+ true
+ ).
+
+:- func beer_stanza(int) = string.
+
+beer_stanza(N) = Stanza :-
+ ( N = 0 ->
+ Stanza = "Go to the store and buy some more!\n"
+ ;
+ NBottles = bottles_line(N),
+ N1Bottles = bottles_line(N - 1),
+ Stanza =
+ NBottles ++ " on the wall.\n" ++
+ NBottles ++ ".\n" ++
+ "Take one down, pass it around,\n" ++
+ N1Bottles ++ " on the wall.\n"
+ ).
+
+:- func bottles_line(int) = string.
+
+bottles_line(N) =
+ ( N = 0 ->
+ "No more bottles of beer"
+ ; N = 1 ->
+ "1 bottle of beer"
+ ;
+ string.format("%d bottles of beer", [i(N)])
+ ).
diff --git a/Task/99-Bottles-of-Beer/Objeck/99-bottles-of-beer.objeck b/Task/99-Bottles-of-Beer/Objeck/99-bottles-of-beer.objeck
new file mode 100644
index 0000000000..71267a57ec
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Objeck/99-bottles-of-beer.objeck
@@ -0,0 +1,12 @@
+class Bottles {
+ function : Main(args : String[]) ~ Nil {
+ bottles := 99;
+ do {
+ "{$bottles} bottles of beer on the wall"->PrintLine();
+ "{$bottles} bottles of beer"->PrintLine();
+ "Take one down, pass it around"->PrintLine();
+ bottles--;
+ "{$bottles} bottles of beer on the wall"->PrintLine();
+ } while(bottles > 0);
+ }
+}
diff --git a/Task/99-Bottles-of-Beer/Onyx/99-bottles-of-beer.onyx b/Task/99-Bottles-of-Beer/Onyx/99-bottles-of-beer.onyx
new file mode 100644
index 0000000000..38ba9fcc41
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Onyx/99-bottles-of-beer.onyx
@@ -0,0 +1,16 @@
+$Bottles {
+ dup cvs ` bottle' cat exch 1 ne {`s' cat} if
+ ` of beer' cat
+} def
+
+$GetPronoun {
+ 1 eq {`it'}{`one'} ifelse cat
+} def
+
+$WriteStanza {
+ dup dup Bottles ` on the wall. ' cat exch Bottles `.\n' cat cat
+ exch `Take ' 1 idup GetPronoun ` down. Pass it around.\n' cat
+ exch dec Bottles ` on the wall.\n\n' 3 {cat} repeat print flush
+} def
+
+99 -1 1 {WriteStanza} for
diff --git a/Task/99-Bottles-of-Beer/Processing/99-bottles-of-beer b/Task/99-Bottles-of-Beer/Processing/99-bottles-of-beer
new file mode 100644
index 0000000000..f10588ecf0
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Processing/99-bottles-of-beer
@@ -0,0 +1,3 @@
+for (int i = 99; i > 0; i--) {
+ print(i + " bottles of beer on the wall\n" + i + " bottles of beer\nTake one down, pass it around\n" + (i - 1) + " bottles of beer on the wall\n\n");
+}
diff --git a/Task/99-Bottles-of-Beer/REXX/99-bottles-of-beer.rexx b/Task/99-Bottles-of-Beer/REXX/99-bottles-of-beer.rexx
index 62a56cb038..71b7768580 100644
--- a/Task/99-Bottles-of-Beer/REXX/99-bottles-of-beer.rexx
+++ b/Task/99-Bottles-of-Beer/REXX/99-bottles-of-beer.rexx
@@ -1,20 +1,20 @@
-/*REXX pgm displays lyrics to the song "99 Bottles of Beer on the Wall".*/
-parse arg N .; if N=='' then N=99 /*let # bottles be specified*/
+/*REXX program displays lyrics to the song "99 Bottles of Beer on the Wall". */
+parse arg N .; if N=='' | N=="," then N=99 /*let number of bottles be given. */
- do j=N by -1 to 1 /*start countdown & singdown*/
- say j 'bottle's(j) "of beer on the wall," /*sing the #bottles of beer.*/
- say j 'bottle's(j) "of beer." /* ··· and the refrain.*/
- say 'Take one down, pass it around,' /*get a bottle and share it.*/
- m=j-1 /*M: # bottles we have now.*/
- if m==0 then m='no' /*use "no" instead of 0. */
- say m 'bottle's(m) "of beer on the wall." /*sing beer bottle inventory*/
- say /*blank line between verses.*/
- end /*j*/
- /*Not tanked? Then sing it.*/
-say 'No more bottles of beer on the wall,' /*Finally! The last verse.*/
-say 'no more bottles of beer.' /*this is so forlorn ··· */
-say 'Go to the store and buy some more,' /*replenishment of the beer.*/
-say N 'bottles of beer on the wall.' /*all is well in the tavern.*/
-exit /*we're done & also sloshed.*/
-/*───────────────────────────────────S subroutine───────────────────────*/
-s: if arg(1)=1 then return ''; return 's' /*simple pluralizer function*/
+ do j=N by -1 to 1 /*start the countdown and singdown*/
+ say j 'bottle's(j) "of beer on the wall," /*sing the number bottles of beer.*/
+ say j 'bottle's(j) "of beer." /* ··· and the song's refrain.*/
+ say 'Take one down, pass it around,' /*take a beer bottle and share it.*/
+ m=j-1 /*M: number of bottles we have now*/
+ if m==0 then m='no' /*use "no" instead of numeric 0.*/
+ say m 'bottle's(m) "of beer on the wall." /*sing the beer bottle inventory. */
+ say /*a blank line between the verses.*/
+ end /*j*/
+ /*Not quite tanked? Then sing it.*/
+say 'No more bottles of beer on the wall,' /*Finally! The last verse. */
+say 'no more bottles of beer.' /*this is so forlorn ··· */
+say 'Go to the store and buy some more,' /*obtain replenishment of the beer*/
+say N 'bottles of beer on the wall.' /*all is well in the ole tavern. */
+exit /*we're all done and also sloshed.*/
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+s: if arg(1)=1 then return ''; return 's' /*a simple pluralizer function. */
diff --git a/Task/99-Bottles-of-Beer/Rust/99-bottles-of-beer.rust b/Task/99-Bottles-of-Beer/Rust/99-bottles-of-beer-1.rust
similarity index 100%
rename from Task/99-Bottles-of-Beer/Rust/99-bottles-of-beer.rust
rename to Task/99-Bottles-of-Beer/Rust/99-bottles-of-beer-1.rust
diff --git a/Task/99-Bottles-of-Beer/Rust/99-bottles-of-beer-2.rust b/Task/99-Bottles-of-Beer/Rust/99-bottles-of-beer-2.rust
new file mode 100644
index 0000000000..31c96e952b
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/Rust/99-bottles-of-beer-2.rust
@@ -0,0 +1,16 @@
+use std::borrow::Cow;
+
+fn main() {
+ for i in (0..100).rev().map(|x| beer(x)) {
+ println!("{}", i)
+ }
+}
+fn beer(num: u32) -> Cow<'static, str> {
+ match num {
+ 1=> "1 bottle of beer on the wall\n1 bottle of beer\nTake one down, pass it around".into(),
+ 0 => "better go to the store and buy some more.".into(),
+ _ => (num.to_string() + " bottles of beer on the wall\n" +
+ &num.to_string() +" bottles of beer\nTake one down, pass it around\n" +
+ beer(num - 1).lines().nth(0).unwrap() + "\n").into(),
+ }
+}
diff --git a/Task/99-Bottles-of-Beer/SQL/99-bottles-of-beer-4.sql b/Task/99-Bottles-of-Beer/SQL/99-bottles-of-beer-4.sql
index 999d56c8a8..0b49048fdc 100644
--- a/Task/99-Bottles-of-Beer/SQL/99-bottles-of-beer-4.sql
+++ b/Task/99-Bottles-of-Beer/SQL/99-bottles-of-beer-4.sql
@@ -1,19 +1,20 @@
-/*These statements work in PostgreSQL (tested in 9.3)*/
+/*These statements work in PostgreSQL (tested in 9.4)*/
SELECT generate_series || ' bottles of beer on the wall' || chr(10) ||
generate_series || ' bottles of beer' || chr(10) ||
'Take one down, pass it around' || chr(10) ||
-coalesce(lead(generate_series) OVER (ORDER BY generate_series DESC),0) || ' bottles of beer on the wall'
-FROM generate_series(1,100)
+coalesce(lead(generate_series) OVER (ORDER BY generate_series DESC),0) || ' bottles of beer on the wall' AS song
+FROM generate_series(1,99)
ORDER BY generate_series DESC;
-/*The next statement takes also into account the grammaticalt support for "1 bottle of beer".*/
+/*The next statement takes also into account the grammatical support for "1 bottle of beer".*/
SELECT generate_series || ' bottle' || CASE WHEN generate_series>1 THEN 's' ELSE '' END || ' of beer on the wall' || chr(10) ||
generate_series || ' bottle' || CASE WHEN generate_series>1 THEN 's' ELSE '' END || ' of beer' || chr(10) ||
'Take one down, pass it around' || chr(10) ||
-coalesce(lead(generate_series) OVER (ORDER BY generate_series DESC),0) || ' bottle' || CASE WHEN coalesce(lead(generate_series) OVER (ORDER BY generate_series DESC),0) <>1 THEN 's' ELSE '' END || ' of beer on the wall'
-FROM generate_series(1,100)
+coalesce(lead(generate_series) OVER (ORDER BY generate_series DESC),0) || ' bottle' || CASE WHEN coalesce(lead(generate_series) OVER (ORDER BY
+generate_series DESC),0) <>1 THEN 's' ELSE '' END || ' of beer on the wall' AS song
+FROM generate_series(1,99)
ORDER BY generate_series DESC;
/*The next statement uses recursive query.*/
@@ -21,12 +22,12 @@ ORDER BY generate_series DESC;
WITH RECURSIVE t(n) AS (
VALUES (1)
UNION ALL
- SELECT n+1 FROM t WHERE n < 100
+ SELECT n+1 FROM t WHERE n < 99
)
SELECT n || ' bottle' || CASE WHEN n>1 THEN 's' ELSE '' END || ' of beer on the wall' || chr(10) ||
n || ' bottle' || CASE WHEN n>1 THEN 's' ELSE '' END || ' of beer' || chr(10) ||
'Take one down, pass it around' || chr(10) ||
coalesce(lead(n) OVER (ORDER BY n DESC),0) || ' bottle' ||
-CASE WHEN coalesce(lead(n) OVER (ORDER BY n DESC),0) <>1 THEN 's' ELSE '' END || ' of beer on the wall'
+CASE WHEN coalesce(lead(n) OVER (ORDER BY n DESC),0) <>1 THEN 's' ELSE '' END || ' of beer on the wall' AS song
FROM t
ORDER BY n DESC;
diff --git a/Task/99-Bottles-of-Beer/SuperCollider/99-bottles-of-beer.supercollider b/Task/99-Bottles-of-Beer/SuperCollider/99-bottles-of-beer.supercollider
new file mode 100644
index 0000000000..5c86850a30
--- /dev/null
+++ b/Task/99-Bottles-of-Beer/SuperCollider/99-bottles-of-beer.supercollider
@@ -0,0 +1,19 @@
+// post to the REPL directly
+(
+(99..0).do { |n|
+ "% bottles of beer on the wall\n% bottles of beer\nTake one down, pass it around\n% bottles of beer on the wall\n".postf(n, n, n)
+};
+)
+
+// post over time
+(
+fork {
+ 100.reverseDo { |n|
+ n.post; " bottles of beer on the wall".postln; 0.5.wait;
+ n.post; " bottles of beer".postln; 0.5.wait;
+ "Take one down, pass it around".postln; 0.5.wait;
+ n.post; " bottles of beer on the wall".postln; 0.5.wait;
+ 1.wait;
+ };
+}
+)
diff --git a/Task/A+B/00DESCRIPTION b/Task/A+B/00DESCRIPTION
index 0bcc826b67..89a587458e 100644
--- a/Task/A+B/00DESCRIPTION
+++ b/Task/A+B/00DESCRIPTION
@@ -1,23 +1,30 @@
-'''A+B''' - in programming contests, classic problem, which is given so contestants can gain familiarity with the online judging system being used.
+'''A+B''' ─── a classic problem in programming contests, it's given so contestants can gain familiarity with the online judging system being used.
-'''Problem statement'''
-Given 2 integer numbers, A and B. One needs to find their sum.
-:'''Input data'''
-:Two integer numbers are written in the input stream, separated by space.
-:
+;Task:
+Given two integer, '''A''' and '''B'''.
-:'''Output data'''
-:The required output is one integer: the sum of A and B.
+Their sum needs to be calculated.
-:'''Example:'''
+
+;Input data:
+Two integers are written in the input stream, separated by space(s):
+:
+
+
+;Output data:
+The required output is one integer: the sum of '''A''' and '''B'''.
+
+
+;Example:
::{|class="standard"
- ! Input
- ! Output
+ ! input
+ ! output
|-
- |2 2
- |4
+ | 2 2
+ | 4
|-
- |3 2
- |5
+ | 3 2
+ | 5
|}
+
diff --git a/Task/A+B/AppleScript/a+b.applescript b/Task/A+B/AppleScript/a+b.applescript
index 69a882d9a8..aa54d8cba5 100644
--- a/Task/A+B/AppleScript/a+b.applescript
+++ b/Task/A+B/AppleScript/a+b.applescript
@@ -1,7 +1,7 @@
on run argv
- try
- return ((first item of argv) as integer) + (second item of argv) as integer
- on error
- return "Usage with -1000 <= a,b <= 1000: " & tab & " A+B.scpt a b"
- end try
+ try
+ return ((first item of argv) as integer) + (second item of argv) as integer
+ on error
+ return "Usage with -1000 <= a,b <= 1000: " & tab & " A+B.scpt a b"
+ end try
end run
diff --git a/Task/A+B/AutoIt/a+b.autoit b/Task/A+B/AutoIt/a+b-1.autoit
similarity index 100%
rename from Task/A+B/AutoIt/a+b.autoit
rename to Task/A+B/AutoIt/a+b-1.autoit
diff --git a/Task/A+B/AutoIt/a+b-2.autoit b/Task/A+B/AutoIt/a+b-2.autoit
new file mode 100644
index 0000000000..bb6bfba619
--- /dev/null
+++ b/Task/A+B/AutoIt/a+b-2.autoit
@@ -0,0 +1,22 @@
+ConsoleWrite("# A+B:" & @CRLF)
+
+Func Sum($inp)
+ Local $num = StringSplit($inp, " "), $sum = 0
+ For $i = 1 To $num[0]
+;~ ConsoleWrite("# num["&$i&"]:" & $num[$i] & @CRLF) ;;
+ $sum = $sum + $num[$i]
+ Next
+ Return $sum
+EndFunc ;==>Sum
+
+$inp = "17 4"
+$res = Sum($inp)
+ConsoleWrite($inp & " --> " & $res & @CRLF)
+
+$inp = "999 42 -999"
+ConsoleWrite($inp & " --> " & Sum($inp) & @CRLF)
+
+; In calculations, text counts as 0,
+; so the program works correctly even with this input:
+Local $inp = "999x y 42 -999", $res = Sum($inp)
+ConsoleWrite($inp & " --> " & $res & @CRLF)
diff --git a/Task/A+B/DCL/a+b.dcl b/Task/A+B/DCL/a+b.dcl
index d98987dd46..de20258d6d 100644
--- a/Task/A+B/DCL/a+b.dcl
+++ b/Task/A+B/DCL/a+b.dcl
@@ -1,4 +1,4 @@
$ read sys$command line
$ a = f$element( 0, " ", line )
$ b = f$element( 1, " ", line )
-$ write sys$output a + b
+$ write sys$output a, "+", b, "=", a + b
diff --git a/Task/A+B/Delphi/a+b.delphi b/Task/A+B/Delphi/a+b.delphi
index 1686668b29..f71a55606a 100644
--- a/Task/A+B/Delphi/a+b.delphi
+++ b/Task/A+B/Delphi/a+b.delphi
@@ -5,6 +5,7 @@ program SUM;
uses
SysUtils;
+procedure
var
s1, s2:string;
begin
diff --git a/Task/A+B/Elena/a+b.elena b/Task/A+B/Elena/a+b.elena
index 789a47618e..10d82b0e85 100644
--- a/Task/A+B/Elena/a+b.elena
+++ b/Task/A+B/Elena/a+b.elena
@@ -1,5 +1,5 @@
-#define system.
-#define extensions.
+#import system.
+#import extensions.
#symbol program =
[
diff --git a/Task/A+B/K/a+b.k b/Task/A+B/K/a+b.k
new file mode 100644
index 0000000000..5e0e676d88
--- /dev/null
+++ b/Task/A+B/K/a+b.k
@@ -0,0 +1,5 @@
+ split:{(a@&~&/' y=/: a:(0,&x=y)_ x) _dv\: y}
+ ab:{+/0$split[0:`;" "]}
+ ab[]
+2 3
+5
diff --git a/Task/A+B/Onyx/a+b.onyx b/Task/A+B/Onyx/a+b.onyx
new file mode 100644
index 0000000000..21336fab00
--- /dev/null
+++ b/Task/A+B/Onyx/a+b.onyx
@@ -0,0 +1,25 @@
+$Prompt {
+ `\nEnter two numbers between -1000 and +1000,\nseparated by a space: ' print flush
+} def
+
+$GetNumbers {
+ mark stdin readline pop # Reads input as a string. Pop gets rid of false.
+ cvx eval # Convert string to integers.
+} def
+
+$CheckRange { # (n1 n2 -- bool)
+ dup -1000 ge exch 1000 le and
+} def
+
+$CheckInput {
+ counttomark 2 ne
+ {`You have to enter exactly two numbers.\n' print flush quit} if
+ 2 ndup CheckRange exch CheckRange and not
+ {`The numbers have to be between -1000 and +1000.\n' print flush quit} if
+} def
+
+$Answer {
+ add cvs `The sum is ' exch cat `.\n' cat print flush
+} def
+
+Prompt GetNumbers CheckInput Answer
diff --git a/Task/A+B/Perl-6/a+b-1.pl6 b/Task/A+B/Perl-6/a+b-1.pl6
index b2bd52e81d..c2d803d141 100644
--- a/Task/A+B/Perl-6/a+b-1.pl6
+++ b/Task/A+B/Perl-6/a+b-1.pl6
@@ -1 +1 @@
-say [+] get.words
+get.words.sum.say;
diff --git a/Task/A+B/Perl-6/a+b-2.pl6 b/Task/A+B/Perl-6/a+b-2.pl6
index 1ca776638f..d3825a5262 100644
--- a/Task/A+B/Perl-6/a+b-2.pl6
+++ b/Task/A+B/Perl-6/a+b-2.pl6
@@ -1 +1 @@
-$*IN.get.words.reduce(* + *).say
+say [+] get.words;
diff --git a/Task/A+B/Perl-6/a+b-3.pl6 b/Task/A+B/Perl-6/a+b-3.pl6
index 8d02852753..04c7a5e40a 100644
--- a/Task/A+B/Perl-6/a+b-3.pl6
+++ b/Task/A+B/Perl-6/a+b-3.pl6
@@ -1,2 +1,2 @@
-my ($a,$b) = $*IN.get.split(" ");
+my ($a, $b) = $*IN.get.split(" ");
say $a + $b;
diff --git a/Task/A+B/PowerShell/a+b-3.psh b/Task/A+B/PowerShell/a+b-3.psh
new file mode 100644
index 0000000000..a2139f6c26
--- /dev/null
+++ b/Task/A+B/PowerShell/a+b-3.psh
@@ -0,0 +1,3 @@
+filter add {
+ return [int]$args[0] + [int]$args[1]
+}
diff --git a/Task/A+B/PowerShell/a+b-4.psh b/Task/A+B/PowerShell/a+b-4.psh
new file mode 100644
index 0000000000..04adb7b18a
--- /dev/null
+++ b/Task/A+B/PowerShell/a+b-4.psh
@@ -0,0 +1 @@
+add 2 3
diff --git a/Task/A+B/Processing/a+b b/Task/A+B/Processing/a+b
new file mode 100644
index 0000000000..86c6b72179
--- /dev/null
+++ b/Task/A+B/Processing/a+b
@@ -0,0 +1,25 @@
+int a = 0;
+int b = 0;
+
+void setup() {
+ size(200, 200);
+}
+
+void draw() {
+ fill(255);
+ rect(0, 0, width, height);
+ fill(0);
+ line(width/2, 0, width/2, height * 3 / 4);
+ line(0, height * 3 / 4, width, height * 3 / 4);
+ text(a, width / 4, height / 4);
+ text(b, width * 3 / 4, height / 4);
+ text("Sum: " + (a + b), width / 4, height * 7 / 8);
+}
+
+void mousePressed() {
+ if (mouseX < width/2) {
+ a++;
+ } else {
+ b++;
+ }
+}
diff --git a/Task/A+B/Python/a+b-1.py b/Task/A+B/Python/a+b-1.py
index db1a94e67a..27e6aacf38 100644
--- a/Task/A+B/Python/a+b-1.py
+++ b/Task/A+B/Python/a+b-1.py
@@ -1,4 +1,4 @@
try: raw_input
except: raw_input = input
-print(sum(int(x) for x in raw_input().split()))
+print(sum(map(int, raw_input().split())))
diff --git a/Task/A+B/Python/a+b-2.py b/Task/A+B/Python/a+b-2.py
index 71e8a4ff5c..cfdc38a5f9 100644
--- a/Task/A+B/Python/a+b-2.py
+++ b/Task/A+B/Python/a+b-2.py
@@ -1,4 +1,4 @@
import sys
for line in sys.stdin:
- print(sum(int(i) for i in line.split()))
+ print(sum(map(int, line.split())))
diff --git a/Task/A+B/REXX/a+b-1.rexx b/Task/A+B/REXX/a+b-1.rexx
index dbc7c1e614..46a34f359e 100644
--- a/Task/A+B/REXX/a+b-1.rexx
+++ b/Task/A+B/REXX/a+b-1.rexx
@@ -1,2 +1,4 @@
-parse pull a b
-say a+b
+/*REXX program obtains two numbers from the input stream (the console), shows their sum.*/
+parse pull a b /*obtain two numbers from input stream.*/
+say a+b /*display the sum to the terminal. */
+ /*stick a fork in it, we're all done. */
diff --git a/Task/A+B/REXX/a+b-2.rexx b/Task/A+B/REXX/a+b-2.rexx
index 5c6592790f..064640ab38 100644
--- a/Task/A+B/REXX/a+b-2.rexx
+++ b/Task/A+B/REXX/a+b-2.rexx
@@ -1,2 +1,4 @@
-parse pull a b
-say (a+b)/1 /*dividing by 1 normalizes the REXX number.*/
+/*REXX program obtains two numbers from the input stream (the console), shows their sum.*/
+parse pull a b /*obtain two numbers from input stream.*/
+say (a+b) / 1 /*display normalized sum to terminal. */
+ /*stick a fork in it, we're all done. */
diff --git a/Task/A+B/REXX/a+b-3.rexx b/Task/A+B/REXX/a+b-3.rexx
index 2104c6391a..774178e64d 100644
--- a/Task/A+B/REXX/a+b-3.rexx
+++ b/Task/A+B/REXX/a+b-3.rexx
@@ -1,4 +1,6 @@
-numeric digits 300
-parse pull a b
-z=(a+b)/1
-say z
+/*REXX program obtains two numbers from the input stream (the console), shows their sum.*/
+numeric digits 300 /*the default is nine decimal digits.*/
+parse pull a b /*obtain two numbers from input stream.*/
+z= (a+b) / 1 /*add and normalize sum, store it in Z.*/
+say z /*display normalized sum Z to terminal.*/
+ /*stick a fork in it, we're all done. */
diff --git a/Task/A+B/REXX/a+b-4.rexx b/Task/A+B/REXX/a+b-4.rexx
index 99c303ec95..fa55e73dfc 100644
--- a/Task/A+B/REXX/a+b-4.rexx
+++ b/Task/A+B/REXX/a+b-4.rexx
@@ -1,9 +1,12 @@
-numeric digits 1000 /*just in case the user gets ka-razy. */
-say 'enter some numbers to be summed:'
-parse pull y
-many=words(y)
-sum=0
- do j=1 for many
- sum=sum+word(y,j)
- end
-say 'sum of' many "numbers = " sum/1
+/*REXX program obtains some numbers from the input stream (the console), shows their sum*/
+numeric digits 1000 /*just in case the user gets ka-razy. */
+say 'enter some numbers to be summed:' /*display a prompt message to terminal.*/
+parse pull y /*obtain all numbers from input stream.*/
+many=words(y) /*obtain the number of numbers entered.*/
+$=0 /*initialize the sum to zero. */
+ do j=1 for many /*process each of the numbers. */
+ $=$ + word(y, j) /*add one number to the sum. */
+ end /*j*/
+
+say 'sum of ' many " numbers = " $/1 /*display normalized sum $ to terminal.*/
+ /*stick a fork in it, we're all done. */
diff --git a/Task/A+B/Rust/a+b-1.rust b/Task/A+B/Rust/a+b-1.rust
new file mode 100644
index 0000000000..7a45d0c3cf
--- /dev/null
+++ b/Task/A+B/Rust/a+b-1.rust
@@ -0,0 +1,12 @@
+use std::io;
+
+fn main() {
+ let mut line = String::new();
+ io::stdin().read_line(&mut line).expect("reading stdin");
+
+ let mut i: i64 = 0;
+ for word in line.split_whitespace() {
+ i += word.parse::().expect("trying to interpret your input as numbers");
+ }
+ println!("{}", i);
+}
diff --git a/Task/A+B/Rust/a+b-2.rust b/Task/A+B/Rust/a+b-2.rust
new file mode 100644
index 0000000000..7ae5c6b2c3
--- /dev/null
+++ b/Task/A+B/Rust/a+b-2.rust
@@ -0,0 +1,11 @@
+#![feature(iter_arith)]
+use std::io;
+
+fn main() {
+ let mut a = String::new();
+ io::stdin().read_line(&mut a).expect("reading stdin");
+ println!("{}",
+ a.split_whitespace()
+ .map(|x| x.parse::().expect("these better be numbers"))
+ .sum::());
+}
diff --git a/Task/A+B/Rust/a+b.rust b/Task/A+B/Rust/a+b.rust
deleted file mode 100644
index 7c99355b66..0000000000
--- a/Task/A+B/Rust/a+b.rust
+++ /dev/null
@@ -1,18 +0,0 @@
-use std::io::{self, Write};
-fn main() {
- let mut buf = String::new();
- loop { // Loop until user gives a string of valid numbers
- print!("Give me a number: ");
- io::stdout().flush().expect("Could not flush stdout");
- io::stdin().read_line(&mut buf).expect("Could not read stdin");
- let res: Result, _> = buf.split_whitespace().map(|num| num.parse()).collect();
- println!("{}", match res {
- Ok(vec) => vec.iter().fold(0, |sum, x| sum + x),
- Err(e) => {
- writeln!(&mut io::stderr(), "Error: {}", e).expect("Could not write to stdout");
- continue;
- }
- });
- break;
- }
-}
diff --git a/Task/A+B/Standard-ML/a+b.ml b/Task/A+B/Standard-ML/a+b.ml
new file mode 100644
index 0000000000..41f0ca01ec
--- /dev/null
+++ b/Task/A+B/Standard-ML/a+b.ml
@@ -0,0 +1,22 @@
+(*
+ * val split : string -> string list
+ * splits a string at it spaces
+ *)
+val split = String.fields (fn #" " => true | _ => false)
+
+(*
+ * val removeNl : string -> string
+ * removes the occurence of "\n" in a string
+ *)
+val removeNl = String.translate (fn #"\n" => "" | c => implode [c])
+
+(*
+ * val aplusb : unit -> int
+ * reads a line and gets the sum of the numbers
+ *)
+fun aplusb () =
+ let
+ val input = removeNl (valOf (TextIO.inputLine TextIO.stdIn))
+ in
+ foldl op+ 0 (map (fn s => valOf (Int.fromString s)) (split input))
+ end
diff --git a/Task/A+B/ZX-Spectrum-Basic/a+b.zx b/Task/A+B/ZX-Spectrum-Basic/a+b.zx
new file mode 100644
index 0000000000..a0bbe856ce
--- /dev/null
+++ b/Task/A+B/ZX-Spectrum-Basic/a+b.zx
@@ -0,0 +1,10 @@
+10 PRINT "Input two numbers separated by"'"space(s) "
+20 INPUT LINE a$
+30 GO SUB 90
+40 FOR i=1 TO LEN a$
+50 IF a$(i)=" " THEN LET a=VAL a$( TO i): LET b=VAL a$(i TO ): PRINT a;" + ";b;" = ";a+b: GO TO 70
+60 NEXT i
+70 STOP
+80 REM LTrim operation
+90 IF a$(1)=" " THEN LET a$=a$(2 TO ): GO TO 90
+100 RETURN
diff --git a/Task/ABC-Problem/00DESCRIPTION b/Task/ABC-Problem/00DESCRIPTION
index 13624d5561..037b35bf54 100644
--- a/Task/ABC-Problem/00DESCRIPTION
+++ b/Task/ABC-Problem/00DESCRIPTION
@@ -1,37 +1,44 @@
-You are given a collection of ABC blocks. Just like the ones you had when you were a kid. There are twenty blocks with two letters on each block. You are guaranteed to have a complete alphabet amongst all sides of the blocks. The sample blocks are:
+You are given a collection of ABC blocks (maybe like the ones you had when you were a kid).
+
+There are twenty blocks with two letters on each block.
+
+A complete alphabet is guaranteed amongst all sides of the blocks.
+
+The sample collection of blocks:
+ (B O)
+ (X K)
+ (D Q)
+ (C P)
+ (N A)
+ (G T)
+ (R E)
+ (T G)
+ (Q D)
+ (F S)
+ (J W)
+ (H U)
+ (V I)
+ (A N)
+ (O B)
+ (E R)
+ (F S)
+ (L Y)
+ (P C)
+ (Z M)
+
+
+;Task:
+Write a function that takes a string (word) and determines whether the word can be spelled with the given collection of blocks.
-:((B O)
-: (X K)
-: (D Q)
-: (C P)
-: (N A)
-: (G T)
-: (R E)
-: (T G)
-: (Q D)
-: (F S)
-: (J W)
-: (H U)
-: (V I)
-: (A N)
-: (O B)
-: (E R)
-: (F S)
-: (L Y)
-: (P C)
-: (Z M))
-The goal of this task is to write a function that takes a string and can determine whether you can spell the word with the given collection of blocks.
The rules are simple:
+::# Once a letter on a block is used that block cannot be used again
+::# The function should be case-insensitive
+::# Show the output on this page for the following 7 words in the following example
-#Once a letter on a block is used that block cannot be used again
-#The function should be case-insensitive
-# Show your output on this page for the following words:
;Example:
-
-
- >>> can_make_word("A")
+ >>> can_make_word("A")
True
>>> can_make_word("BARK")
True
@@ -44,5 +51,5 @@ The rules are simple:
>>> can_make_word("SQUAD")
True
>>> can_make_word("CONFUSE")
- True
-
+ True
+
diff --git a/Task/ABC-Problem/BASIC/abc-problem.basic b/Task/ABC-Problem/BASIC/abc-problem.basic
new file mode 100644
index 0000000000..2ee941231e
--- /dev/null
+++ b/Task/ABC-Problem/BASIC/abc-problem.basic
@@ -0,0 +1,125 @@
+' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
+' ABC_Problem '
+' '
+' Developed by A. David Garza Marín in VB-DOS for '
+' RosettaCode. November 29, 2016. '
+' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
+
+' Comment the following line to run it in QB or QBasic
+OPTION EXPLICIT ' Modify to OPTION _EXPLICIT for QB64
+
+' SUBs and FUNCTIONs
+DECLARE SUB doCleanBlocks ()
+DECLARE FUNCTION ICanMakeTheWord (WhichWord AS STRING) AS INTEGER
+DECLARE SUB doReadBlocks ()
+
+' rBlock Data Type
+TYPE regBlock
+ Block AS STRING * 2
+ Used AS INTEGER
+END TYPE
+
+' Initialize
+CONST False = 0, True = NOT False, HMBlocks = 20
+DATA "BO", "XK", "DQ", "CP", "NA", "GT","RE", "TG"
+DATA "QD", "FS", "JW", "HU", "VI", "AN", "OB", "ER"
+DATA "FS", "LY", "PC","ZM"
+
+DIM rBlock(1 TO HMBlocks) AS regBlock
+DIM i AS INTEGER, aWord AS STRING, YorN AS STRING
+
+doReadBlocks ' Read the data in the blocks
+
+'-------------- Main program cycle ------------------
+CLS
+PRINT "This program has the following blocks: ";
+FOR i = 1 TO HMBlocks
+ PRINT rBlock(i).Block; "|";
+NEXT i
+PRINT : PRINT
+PRINT "Please, write a word or a short sentence to see if the available"
+PRINT "blocks can make it. If so, I will tell you."
+DO
+ doCleanBlocks ' Clean all blocks
+ PRINT
+ INPUT "Which is the word"; aWord
+ aWord = LTRIM$(RTRIM$(aWord))
+
+ IF aWord <> "" THEN
+ IF ICanMakeTheWord(aWord) THEN
+ PRINT "Yes, i can make it."
+ ELSE
+ PRINT "No, I can't make it."
+ END IF
+ ELSE
+ PRINT "At least, you need to type a letter."
+ END IF
+
+ PRINT
+ PRINT "Do you want to try again (Y/N) ";
+ DO
+ YorN = INPUT$(1)
+ YorN = UCASE$(YorN)
+ LOOP UNTIL YorN = "Y" OR YorN = "N"
+ PRINT YorN
+
+LOOP UNTIL YorN = "N"
+' -------------- End of Main program ----------------
+END
+
+SUB doCleanBlocks ()
+ ' Var
+ SHARED rBlock() AS regBlock
+ DIM i AS INTEGER
+
+ ' Will clean the Used status of all blocks
+ FOR i = 1 TO HMBlocks
+ rBlock(i).Used = False
+ NEXT i
+
+END SUB
+
+SUB doReadBlocks ()
+ ' Var
+ SHARED rBlock() AS regBlock
+ DIM i AS INTEGER
+
+ ' Will read the block values from DATA
+ FOR i = 1 TO HMBlocks
+ READ rBlock(i).Block
+ NEXT i
+END SUB
+
+FUNCTION ICanMakeTheWord (WhichWord AS STRING) AS INTEGER ' Comment AS INTEGER to run in QBasic, QB64 and QuickBASIC
+ ' Var
+ SHARED rBlock() AS regBlock
+ DIM i AS INTEGER, l AS INTEGER, j AS INTEGER, iYesICan AS INTEGER
+ DIM c AS STRING, sUWord AS STRING
+
+ ' Will evaluate if can make the word
+ sUWord = UCASE$(WhichWord)
+ l = LEN(sUWord)
+ i = 0
+
+ DO
+ i = i + 1
+ iYesICan = False
+ c = MID$(sUWord, i, 1)
+ j = 0
+ DO
+ j = j + 1
+ IF NOT rBlock(j).Used THEN
+ iYesICan = (INSTR(rBlock(j).Block, c) > 0)
+ rBlock(j).Used = iYesICan
+ END IF
+ LOOP UNTIL j >= HMBlocks OR iYesICan
+
+ LOOP UNTIL i >= l OR NOT iYesICan
+
+ ' The result will depend on the last value of
+ ' iYesICan variable. If the last value is True
+ ' is because the function found even the last
+ ' letter analyzed.
+ ICanMakeTheWord = iYesICan
+
+END FUNCTION
diff --git a/Task/ABC-Problem/CoffeeScript/abc-problem.coffee b/Task/ABC-Problem/CoffeeScript/abc-problem.coffee
index 2bc54c4925..edb40cdc3a 100644
--- a/Task/ABC-Problem/CoffeeScript/abc-problem.coffee
+++ b/Task/ABC-Problem/CoffeeScript/abc-problem.coffee
@@ -1,3 +1,5 @@
+blockList = [ 'BO', 'XK', 'DQ', 'CP', 'NA', 'GT', 'RE', 'TG', 'QD', 'FS', 'JW', 'HU', 'VI', 'AN', 'OB', 'ER', 'FS', 'LY', 'PC', 'ZM' ]
+
canMakeWord = (word="") ->
# Create a shallow clone of the master blockList
blocks = blockList.slice 0
@@ -7,9 +9,10 @@ canMakeWord = (word="") ->
for block, idx in blocks
# If letter is in block, blocks.splice will return an array, which will evaluate as true
return blocks.splice idx, 1 if letter.toUpperCase() in block
- return false
+ false
# Return true if there are no falsy values
- return false not in (checkBlocks letter for letter in word)
+ false not in (checkBlocks letter for letter in word)
# Expect true, true, false, true, false, true, true, true
-console.log (canMakeWord word for word in ["A", "BARK", "BOOK", "TREAT", "COMMON", "squad", "CONFUSE", "STORM"])
+for word in ["A", "BARK", "BOOK", "TREAT", "COMMON", "squad", "CONFUSE", "STORM"]
+ console.log word + " -> " + canMakeWord(word)
diff --git a/Task/ABC-Problem/Ela/abc-problem.ela b/Task/ABC-Problem/Ela/abc-problem.ela
new file mode 100644
index 0000000000..c9e1bbb59a
--- /dev/null
+++ b/Task/ABC-Problem/Ela/abc-problem.ela
@@ -0,0 +1,17 @@
+open list monad io char
+
+:::IO
+
+null = foldr (\_ _ -> false) true
+
+mapM_ f = foldr ((>>-) << f) (return ())
+
+abc _ [] = [[]]
+abc blocks (c::cs) =
+ [b::ans \\ b <- blocks | c `elem` b, ans <- abc (delete b blocks) cs]
+
+blocks = ["BO", "XK", "DQ", "CP", "NA", "GT", "RE", "TG", "QD", "FS",
+ "JW", "HU", "VI", "AN", "OB", "ER", "FS", "LY", "PC", "ZM"]
+
+mapM_ (\w -> putLn (w, not << null $ abc blocks (map char.upper w)))
+ ["", "A", "BARK", "BoOK", "TrEAT", "COmMoN", "SQUAD", "conFUsE"]
diff --git a/Task/ABC-Problem/Elena/abc-problem.elena b/Task/ABC-Problem/Elena/abc-problem.elena
new file mode 100644
index 0000000000..c44f073afd
--- /dev/null
+++ b/Task/ABC-Problem/Elena/abc-problem.elena
@@ -0,0 +1,37 @@
+#import system.
+#import system'routines.
+#import system'collections.
+#import extensions.
+#import extensions'routines.
+
+#class(extension)op
+{
+ #method canMakeWord &from:blocks
+ [
+ #var list := ArrayList new:blocks.
+
+ ^ $nil == self literal upperCase seek &each:ch
+ [
+ #var index := list indexOf:(word [ word indexOf:ch &at:0 != -1 ] asComparer).
+
+ (index>=0)
+ ? [ list remove &at:index. ^ false. ]
+ ! [ ^ true. ].
+ ].
+ ]
+}
+
+#symbol program =
+[
+ #var blocks := ("BO", "XK", "DQ", "CP", "NA",
+ "GT", "RE", "TG", "QD", "FS",
+ "JW", "HU", "VI", "AN", "OB",
+ "ER", "FS", "LY", "PC", "ZM").
+
+ #var words := ("", "A", "BARK", "BOOK", "TREAT", "COMMON", "SQUAD", "Confuse").
+
+ words run &each:word
+ [
+ console writeLine:"can make '":word:"' : ":(word canMakeWord &from:blocks).
+ ].
+].
diff --git a/Task/ABC-Problem/Fortran/abc-problem.f b/Task/ABC-Problem/Fortran/abc-problem-1.f
similarity index 100%
rename from Task/ABC-Problem/Fortran/abc-problem.f
rename to Task/ABC-Problem/Fortran/abc-problem-1.f
diff --git a/Task/ABC-Problem/Fortran/abc-problem-2.f b/Task/ABC-Problem/Fortran/abc-problem-2.f
new file mode 100644
index 0000000000..0c0d917d24
--- /dev/null
+++ b/Task/ABC-Problem/Fortran/abc-problem-2.f
@@ -0,0 +1,277 @@
+ MODULE PLAYPEN !Messes with a set of alphabet blocks.
+ INTEGER MSG !Output unit number.
+ PARAMETER (MSG = 6) !Standard output.
+ INTEGER MS !I dislike unidentified constants...
+ PARAMETER (MS = 2) !So this is the maximum number of lettered sides.
+ INTEGER LETTER(26),SUPPLY(26) !For counting the alphabet.
+ CONTAINS
+ SUBROUTINE SWAP(I,J) !This really should be known to the compiler.
+ INTEGER I,J,K !Which could generate in-place code,
+ K = I !Using registers, maybe.
+ I = J !Or maybe, there are special op-codes.
+ J = K !Rather than this clunkiness.
+ END SUBROUTINE SWAP !And it should be for any type of thingy.
+
+ INTEGER FUNCTION LSTNB(TEXT) !Sigh. Last Not Blank.
+Concocted yet again by R.N.McLean (whom God preserve) December MM.
+Code checking reveals that the Compaq compiler generates a copy of the string and then finds the length of that when using the latter-day intrinsic LEN_TRIM. Madness!
+Can't DO WHILE (L.GT.0 .AND. TEXT(L:L).LE.' ') !Control chars. regarded as spaces.
+Curse the morons who think it good that the compiler MIGHT evaluate logical expressions fully.
+Crude GO TO rather than a DO-loop, because compilers use a loop counter as well as updating the index variable.
+Comparison runs of GNASH showed a saving of ~3% in its mass-data reading through the avoidance of DO in LSTNB alone.
+Crappy code for character comparison of varying lengths is avoided by using ICHAR which is for single characters only.
+Checking the indexing of CHARACTER variables for bounds evoked astounding stupidities, such as calculating the length of TEXT(L:L) by subtracting L from L!
+Comparison runs of GNASH showed a saving of ~25-30% in its mass data scanning for this, involving all its two-dozen or so single-character comparisons, not just in LSTNB.
+ CHARACTER*(*),INTENT(IN):: TEXT !The bumf. If there must be copy-in, at least there need not be copy back.
+ INTEGER L !The length of the bumf.
+ L = LEN(TEXT) !So, what is it?
+ 1 IF (L.LE.0) GO TO 2 !Are we there yet?
+ IF (ICHAR(TEXT(L:L)).GT.ICHAR(" ")) GO TO 2 !Control chars are regarded as spaces also.
+ L = L - 1 !Step back one.
+ GO TO 1 !And try again.
+ 2 LSTNB = L !The last non-blank, possibly zero.
+ RETURN !Unsafe to use LSTNB as a variable.
+ END FUNCTION LSTNB !Compilers can bungle it.
+
+ SUBROUTINE LETTERCOUNT(TEXT) !Count the occurrences of A-Z.
+ CHARACTER*(*) TEXT !The text to inspect.
+ INTEGER I,K !Assistants.
+ DO I = 1,LEN(TEXT) !Step through the text.
+ K = ICHAR(TEXT(I:I)) - ICHAR("A") + 1 !This presumes that A-Z have contiguous codes!
+ IF (K.GE.1 .AND. K.LE.26) LETTER(K) = LETTER(K) + 1 !Not so with EBCDIC!!
+ END DO !On to the next letter.
+ END SUBROUTINE LETTERCOUNT !Be careful with LETTER.
+
+ SUBROUTINE UPCASE(TEXT) !In the absence of an intrinsic...
+Converts any lower case letters in TEXT to upper case...
+Concocted yet again by R.N.McLean (whom God preserve) December MM.
+Converting from a DO loop evades having both an iteration counter to decrement and an index variable to adjust.
+ CHARACTER*(*) TEXT !The stuff to be modified.
+c CHARACTER*26 LOWER,UPPER !Tables. a-z may not be contiguous codes.
+c PARAMETER (LOWER = "abcdefghijklmnopqrstuvwxyz")
+c PARAMETER (UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+CAREFUL!! The below relies on a-z and A-Z being contiguous, as is NOT the case with EBCDIC.
+ INTEGER I,L,IT !Fingers.
+ L = LEN(TEXT) !Get a local value, in case LEN engages in oddities.
+ I = L !Start at the end and work back..
+ 1 IF (I.LE.0) RETURN !Are we there yet? Comparison against zero should not require a subtraction.
+c IT = INDEX(LOWER,TEXT(I:I)) !Well?
+c IF (IT .GT. 0) TEXT(I:I) = UPPER(IT:IT) !One to convert?
+ IT = ICHAR(TEXT(I:I)) - ICHAR("a") !More symbols precede "a" than "A".
+ IF (IT.GE.0 .AND. IT.LE.25) TEXT(I:I) = CHAR(IT + ICHAR("A")) !In a-z? Convert!
+ I = I - 1 !Back one.
+ GO TO 1 !Inspect..
+ END SUBROUTINE UPCASE !Easy.
+
+ SUBROUTINE ORDERSIDE(LETTER) !Puts the letters into order.
+ CHARACTER*(*) LETTER !The letters.
+ INTEGER I,N,H !Assistants.
+ CHARACTER*1 T !A scratchpad.
+ LOGICAL CURSE !A bit.
+ N = LEN(LETTER) !So, how many letters?
+ H = N - 1 !Last - First, and not +1.
+ IF (H.LE.0) RETURN !Ha ha.
+ 1 H = MAX(1,H*10/13) !The special feature.
+ IF (H.EQ.9 .OR. H.EQ.10) H = 11 !A twiddle.
+ CURSE = .FALSE. !So far, so good.
+ DO I = N - H,1,-1 !If H = 1, this is a BubbleSort.
+ IF (LETTER(I:I).LT.LETTER(I + H:I + H)) THEN !One compare.
+ T = LETTER(I:I) !One swap.
+ LETTER(I:I) = LETTER(I + H:I + H) !Alas, no SWAP(A,B)
+ LETTER(I + H:I + H) = T !Is recognised by the compiler.
+ CURSE = .TRUE. !If once a tiger is seen...
+ END IF !So much for that comparison.
+ END DO !On to the next.
+ IF (CURSE .OR. H.GT.1) GO TO 1!Another pass?
+ END SUBROUTINE ORDERSIDE !Simple enough.
+ SUBROUTINE ORDERBLOCKS(N,SOME) !Puts the collection of blocks into order.
+ INTEGER N !The number of blocks.
+ CHARACTER*(*) SOME(:) !Their lists of letters.
+ INTEGER I,H !Assistants.
+ CHARACTER*(LEN(SOME(1))) T !A scratchpad matching an element of SOME.
+ LOGICAL CURSE !Since there is still no SWAP(SOME(I),SOME(I + H)).
+ H = N - 1 !So here comes another CombSort.
+ IF (H.LE.0) RETURN !With standard suspicion.
+ 1 H = MAX(1,H*10/13) !This is the outer loop.
+ IF (H.EQ.9 .OR. H.EQ.10) H = 11 !This is a fiddle.
+ CURSE = .FALSE. !Start the next pass in hope.
+ DO I = N - H,1,-1 !Going backwards, just for fun.
+ IF (SOME(I).LT.SOME(I + H)) THEN !So then?
+ T = SOME(I) !Disorder.
+ SOME(I) = SOME(I + H) !So once again,
+ SOME(I + H) = T !Swap the two miscreants.
+ CURSE = .TRUE. !And remember.
+ END IF !So much for that comparison.
+ END DO !On to the next.
+ IF (CURSE .OR. H.GT.1) GO TO 1!Are we there yet?
+ END SUBROUTINE ORDERBLOCKS !Not much code, but ringing the changes is still tedious.
+
+ SUBROUTINE PLAY(N,SOME) !Mess about with the collection of blocks.
+ INTEGER N !Their number.
+ CHARACTER*(*) SOME(:) !Their letters.
+ INTEGER NH,HIT(N) !A list of blocks.
+ INTEGER B,I,J,K,L,M !Assistants.
+ CHARACTER*1 C !A letter of the moment.
+ L = LEN(SOME(1)) !The maximum number of letters to any block.
+Cast the collection on to the floor.
+ WRITE (MSG,1) N,L,SOME !Announce the set as it is supplied.
+ 1 FORMAT (I7," blocks, with at most",I2," letters:",66(1X,A))
+Change the "orientation" of some blocks.
+ DO B = 1,N !Step through each block.
+ CALL UPCASE(SOME(B)) !Paranoia rules.
+ CALL ORDERSIDE(SOME(B)) !Put its letter list into order.
+ END DO !On to the next block.
+ WRITE (MSG,2) SOME !Reveal the orderly array.
+ 2 FORMAT (6X,"... the letters in reverse order:",66(1X,A))
+Collate the collection of blocks.
+ CALL ORDERBLOCKS(N,SOME) !Now order the blocks by their letters.
+ WRITE (MSG,3) SOME !Reveal them in neato order.
+ 3 FORMAT (7X,"... the blocks in reverse order:",66(1X,A))
+Count the appearances of the letters of the alphabet.
+ LETTER = 0 !Enough of shuffling blocks around.
+ DO B = 1,N !Now inspect their collective letters.
+ CALL LETTERCOUNT(SOME(B)) !A block's worth at a go.
+ END DO !On to the next block.
+ SUPPLY = LETTER !Save the counts of supplied letters.
+ WRITE (MSG,4) (CHAR(ICHAR("A") + I - 1),I = 1,26),SUPPLY !Results.
+ 4 FORMAT (15X,"Letters of the alphabet:",26A,/, !First, a line with A ... Z.
+ 1 11X,"... number thereof supplied:",26I) !Then a line of the associated counts.
+Check for blocks with duplicated letters.
+ WRITE (MSG,5) !Announce.
+ 5 FORMAT (8X,"Blocks with duplicated letters:",$) !Further output impends.
+ M = 0 !No duplication found.
+ DO B = 1,N !So step through each block.
+ JJ:DO J = 2,L !Inspecting successive letters of the block,
+ IF (SOME(B)(J:J).LE." ") EXIT JJ !Provided they've not run out.
+ DO K = 1,J - 1 !To see if it has appeared earlier.
+ IF (SOME(B)(K:K).LE." ") EXIT JJ!Reverse order means that spaces will be at the end!
+ IF (SOME(B)(J:J).EQ.SOME(B)(K:K)) THEN !Well?
+ M = M + 1 !A match!
+ WRITE (MSG,6) SOME(B) !Name the block.
+ 6 FORMAT (1X,A,$) !With further output still impending,
+ EXIT JJ !And give up on this block.
+ END IF !One duplicated letter is sufficient for its downfall.
+ END DO !Next letter up.
+ END DO JJ !On to the next letter of the block.
+ END DO !On to the next block.
+ CALL HIC(M) !Show the count and end the line.
+Check for duplicate blocks, knowing that the array of blocks is ordered.
+ WRITE (MSG,7) !Announce.
+ 7 FORMAT (21X,"Duplicated blocks:",$) !Again, leave the line dangling.
+ K = 0 !No duplication found.
+ B = 1 !Syncopation.
+ 70 B = B + 1 !Advance one.
+ IF (B.GT.N) GO TO 72 !Are we there yet?
+ IF (SOME(B).NE.SOME(B - 1)) GO TO 70 !No match? Search on.
+ K = K + 1 !A match is counted.
+ WRITE (MSG,6) SOME(B) !Name it.
+ 71 B = B + 1 !And speed through continued matching.
+ IF (B.GT.N) GO TO 72 !Unless we're of the end.
+ IF (SOME(B).EQ.SOME(B - 1)) GO TO 71 !Continued matching?
+ GO TO 70 !Mismatch: resume the normal scan.
+ 72 CALL HIC(K) !So much for that.
+Check for duplicated letters across different blocks.
+ IF (ALL(SUPPLY.LE.1)) RETURN !Unless there are no duplicated letters.
+ WRITE (MSG,8) !Announce.
+ 8 FORMAT ("Duplicated letters on different blocks:",$) !More to come.
+ K = 0 !Start another count.
+ DO I = 1,26 !A well-known span.
+ IF (SUPPLY(I).LE.1) CYCLE !Any duplicated letters?
+ C = CHAR(ICHAR("A") + I - 1)!Yes. This is the character.
+ NH = 0 !So, how many blocks contribute?
+ DO B = 1,N !Find out.
+ IF (INDEX(SOME(B),C).GT.0) THEN !On this block?
+ NH = NH + 1 !Yes.
+ HIT(NH) = B !Keep track of which.
+ END IF !So much for that block.
+ END DO !On to the next.
+ IF (ANY(SOME(HIT(2:NH)) .NE. SOME(HIT(1)))) THEN !All have the same collection of letters?
+ K = K + 1 !No!
+ WRITE (MSG,9) C !Name the heterogenously supported letter.
+ 9 FORMAT (A,$) !Use the same spacing even though one character only.
+ END IF !So much for that letter's search.
+ END DO !On to the next letter.
+ CALL HIC(K) !Finish the line with the count report.
+ CONTAINS !This is used often enough.
+ SUBROUTINE HIC(N) !But has very specific context.
+ INTEGER N !The count.
+ IF (N.LE.0) WRITE (MSG,*) "None." !Yes, we have no bananas.
+ IF (N.GT.0) WRITE (MSG,*) N !Either way, end the line.
+ END SUBROUTINE HIC !This service routine is not needed elsewhere.
+ END SUBROUTINE PLAY !Look mummy! All the blockses are neatened!
+
+ LOGICAL FUNCTION CANBLOCK(WORD,N,SOME) !Can the blocks spell out the word?
+Creates a move tree based on the letters of WORD and for each, the blocks available.
+ CHARACTER*(*) WORD !The word to spell out.
+ INTEGER N !The number of blocks.
+ CHARACTER*(*) SOME(:) !The blocks and their letters.
+ INTEGER NA,AVAIL(N) !Say not the struggle naught availeth!
+ INTEGER NMOVE(LEN(WORD)) !I need a list of acceptable blocks,
+ INTEGER MOVE(LEN(WORD),N) !One list for each letter of WORD.
+ INTEGER I,L,S !Assistants.
+ CHARACTER*1 C !The letter of the moment.
+ CANBLOCK = .FALSE. !Initial pessimism.
+ L = LSTNB(WORD) !Ignore trailing spaces.
+ IF (L.GT.N) RETURN !Enough blocks?
+ LETTER = 0 !To make rabbit stew,
+ CALL LETTERCOUNT(WORD(1:L)) !First catch your rabbit.
+ IF (ANY(SUPPLY .LT. LETTER)) RETURN !The larder is lacking.
+ NA = N !Prepare a list.
+ FORALL (I = 1:N) AVAIL(I) = I !That fingers every block.
+ I = 0 !Step through the letters of the WORD.
+Chug through the letters of the WORD.
+ 1 I = I + 1 !One letter after the other.
+ IF (I.GT.L) GO TO 100 !Yay! We're through!
+ C = WORD(I:I) !The letter of the moment.
+ NMOVE(I) = 0 !No moves known at this new level.
+ DO S = 1,NA !So, look for them amongst the available slots.
+ IF (INDEX(SOME(AVAIL(S)),C) .GT. 0) THEN !A hit?
+ NMOVE(I) = NMOVE(I) + 1 !Yes! Count up another possible move.
+ MOVE(I,NMOVE(I)) = S !Remember its slot.
+ END IF !So much for that block.
+ END DO !On to the next.
+ 2 IF (NMOVE(I).GT.0) THEN !Have we any moves?
+ S = MOVE(I,NMOVE(I)) !Yes! Recover the last found.
+ NMOVE(I) = NMOVE(I) - 1 !Uncount, as it is about to be used.
+ IF (S.NE.NA) CALL SWAP(AVAIL(S),AVAIL(NA)) !This block is no longer available.
+ NA = NA - 1 !Shift the boundary back.
+ GO TO 1 !Try the next letter!
+ END IF !But if we can't find a move at that level...
+ I = I - 1 !Retreat a level.
+ IF (I.LE.0) RETURN !Oh dear!
+ S = MOVE(I,NMOVE(I) + 1) !Undo the move that had been made at this level.
+ NA = NA + 1 !And make its block is re-available.
+ IF (S.NE.NA) CALL SWAP(AVAIL(S),AVAIL(NA)) !Move it back.
+ GO TO 2 !See what moves remain at this level.
+Completed!
+ 100 CANBLOCK = .TRUE. !That's a relief.
+ END FUNCTION CANBLOCK !Some revisions might have been made.
+ END MODULE PLAYPEN !No sand here.
+
+ USE PLAYPEN !Just so.
+ INTEGER HAVE,TESTS !Parameters for the specified problem.
+ PARAMETER (HAVE = 20, TESTS = 7) !Number of blocks, number of tests.
+ CHARACTER*(MS) BLOCKS(HAVE) !Have blocks, will juggle.
+ DATA BLOCKS/"BO","XK","DQ","CP","NA","GT","RE","TG","QD","FS", !The specified set
+ 1 "JW","HU","VI","AN","OB","ER","FS","LY","PC","ZM"/ !Of letter blocks.
+ CHARACTER*8 WORD(TESTS) !Now for the specified test words.
+ LOGICAL ANS(TESTS),T,F !And the given results.
+ PARAMETER (T = .TRUE., F = .FALSE.) !Enable a more compact specification.
+ DATA WORD/"A","BARK","BOOK","TREAT","COMMON","SQUAD","CONFUSE"/ !So that these
+ DATA ANS/ T , T , F , T , F , T , T / !Can be aligned.
+ LOGICAL YAY
+ INTEGER I
+
+ WRITE (MSG,1)
+ 1 FORMAT ("Arranges alphabet blocks, attending only to the ",
+ 1 "letters on the blocks, and ignoring case and orientation.",/)
+
+ CALL PLAY(HAVE,BLOCKS) !Some fun first.
+
+ WRITE (MSG,'(/"Now to see if some words can be spelled out.")')
+ DO I = 1,TESTS
+ CALL UPCASE(WORD(I))
+ YAY = CANBLOCK(WORD(I),HAVE,BLOCKS)
+ WRITE (MSG,*) YAY,ANS(I),YAY.EQ.ANS(I),WORD(I)
+ END DO
+ END
diff --git a/Task/ABC-Problem/Kotlin/abc-problem.kotlin b/Task/ABC-Problem/Kotlin/abc-problem.kotlin
new file mode 100644
index 0000000000..d33d1e9ee6
--- /dev/null
+++ b/Task/ABC-Problem/Kotlin/abc-problem.kotlin
@@ -0,0 +1,39 @@
+package abc
+
+object ABC_block_checker {
+ fun run() {
+ val blocks = arrayOf("BO", "XK", "DQ", "CP", "NA", "GT", "RE", "TG", "QD", "FS",
+ "JW", "HU", "VI", "AN", "OB", "ER", "FS", "LY", "PC", "ZM")
+
+ println("\"\": " + blocks.canMakeWord(""))
+ val words = arrayOf("A", "BARK", "book", "treat", "COMMON", "SQuAd", "CONFUSE")
+ for (w in words) println("$w: " + blocks.canMakeWord(w))
+ }
+
+ private fun Array.swap(i: Int, j: Int) {
+ val tmp = this[i]
+ this[i] = this[j]
+ this[j] = tmp
+ }
+
+ private fun Array.canMakeWord(word: String): Boolean {
+ if (word.length == 0)
+ return true
+
+ val c = Character.toUpperCase(word.first())
+ var i = 0
+ forEach { b ->
+ if (b.first().toUpperCase() == c || b[1].toUpperCase() == c) {
+ swap(0, i)
+ if (drop(1).toTypedArray().canMakeWord(word.substring(1)))
+ return true
+ swap(0, i)
+ }
+ i++
+ }
+
+ return false
+ }
+}
+
+fun main(args: Array) = ABC_block_checker.run()
diff --git a/Task/ABC-Problem/Liberty-BASIC/abc-problem-1.liberty b/Task/ABC-Problem/Liberty-BASIC/abc-problem-1.liberty
new file mode 100644
index 0000000000..1791de412d
--- /dev/null
+++ b/Task/ABC-Problem/Liberty-BASIC/abc-problem-1.liberty
@@ -0,0 +1,42 @@
+print "Rosetta Code - ABC problem (recursive solution)"
+print
+blocks$="BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM"
+data "A"
+data "BARK", "BOOK", "TREAT", "COMMON", "SQUAD", "CONFUSE"
+data "XYZZY"
+
+do
+ read text$
+ if text$="XYZZY" then exit do
+ print ">>> can_make_word("; chr$(34); text$; chr$(34); ")"
+ if canDo(text$,blocks$) then print "True" else print "False"
+loop while 1
+print "Program complete."
+end
+
+function canDo(text$,blocks$)
+ 'endcase
+ if len(text$)=1 then canDo=(instr(blocks$,text$)<>0): exit function
+ 'get next letter
+ ltr$=left$(text$,1)
+ 'cut
+ if instr(blocks$,ltr$)=0 then canDo=0: exit function
+ 'recursion
+ text$=mid$(text$,2) 'rest
+ 'loop by all word in blocks. Need to make "newBlocks" - all but taken
+ 'optimisation: take only fitting blocks
+ wrd$="*"
+ i=0
+ while wrd$<>""
+ i=i+1
+ wrd$=word$(blocks$, i)
+ if instr(wrd$, ltr$) then
+ 'newblocks without wrd$
+ pos=instr(blocks$,wrd$)
+ newblocks$=left$(blocks$, pos-1)+mid$(blocks$, pos+3)
+ canDo=canDo(text$,newblocks$)
+ 'first found cuts
+ if canDo then exit while
+ end if
+ wend
+end function
diff --git a/Task/ABC-Problem/Liberty-BASIC/abc-problem-2.liberty b/Task/ABC-Problem/Liberty-BASIC/abc-problem-2.liberty
new file mode 100644
index 0000000000..882f4956f9
--- /dev/null
+++ b/Task/ABC-Problem/Liberty-BASIC/abc-problem-2.liberty
@@ -0,0 +1,133 @@
+print "Rosetta Code - ABC problem (procedural solution)"
+print
+w$(1)="A"
+w$(2)="BARK"
+w$(3)="BOOK"
+w$(4)="TREAT"
+w$(5)="COMMON"
+w$(6)="SQUAD"
+w$(7)="CONFUSE"
+
+for x=1 to 7
+ print ">>> can_make_word("; chr$(34); w$(x); chr$(34); ")"
+ if CanMakeWord(w$(x)) then print "True" else print "False"
+next x
+print "Program complete."
+end
+
+function CanMakeWord(x$)
+global DoneWithWord, BlocksUsed, LetterOK, Possibility
+dim block$(20,2), block(20,2)
+'numeric blocks, col 0 flags used block
+block(1,1)=asc("B")-64: block(1,2)=asc("O")-64
+block(2,1)=asc("X")-64: block(2,2)=asc("K")-64
+block(3,1)=asc("D")-64: block(3,2)=asc("Q")-64
+block(4,1)=asc("C")-64: block(4,2)=asc("P")-64
+block(5,1)=asc("N")-64: block(5,2)=asc("A")-64
+block(6,1)=asc("G")-64: block(6,2)=asc("T")-64
+block(7,1)=asc("R")-64: block(7,2)=asc("E")-64
+block(8,1)=asc("T")-64: block(8,2)=asc("G")-64
+block(9,1)=asc("Q")-64: block(9,2)=asc("D")-64
+block(10,1)=asc("F")-64: block(10,2)=asc("S")-64
+block(11,1)=asc("J")-64: block(11,2)=asc("W")-64
+block(12,1)=asc("H")-64: block(12,2)=asc("U")-64
+block(13,1)=asc("V")-64: block(13,2)=asc("I")-64
+block(14,1)=asc("A")-64: block(14,2)=asc("N")-64
+block(15,1)=asc("O")-64: block(15,2)=asc("B")-64
+block(16,1)=asc("E")-64: block(16,2)=asc("R")-64
+block(17,1)=asc("F")-64: block(17,2)=asc("S")-64
+block(18,1)=asc("L")-64: block(18,2)=asc("Y")-64
+block(19,1)=asc("P")-64: block(19,2)=asc("C")-64
+block(20,1)=asc("Z")-64: block(20,2)=asc("M")-64
+
+x$=upper$(x$)
+for x=1 to len(x$)
+ y$=mid$(x$,x,1)
+ if y$>="A" and y$<="Z" then w$=w$+y$
+next x
+if w$="" then exit function
+DoneWithWord=0: BlocksUsed=0
+l=len(w$)
+dim LetterOK(l)
+dim alphabet(26,1) 'clear letter-usage array
+for x=1 to 20 'load block letters into letter-usage array col 0
+ alphabet(block(x,1),0)+=1
+ alphabet(block(x,2),0)+=1
+next x
+for x=1 to l 'load current word into letter-usage aray col 1
+ wl$=mid$(w$,x,1): w=asc(wl$)-64
+ alphabet(w,1)+=1
+next x
+
+for x=1 to 26 ' test for more of any letter in the word than in the blocks
+ if alphabet(x,1)>alphabet(x,0) then exit function
+next x
+
+[NextLetter]
+if wl 2)
+ THEN RETURN ERROR.
+
+ CREATE ttBlocks.
+ ASSIGN ttBlocks.ttFaces[1] = SUBSTRING(i-chBlockValue, 1, 1)
+ ttBlocks.ttFaces[2] = SUBSTRING(i-chBlockValue, 2, 1).
+END PROCEDURE.
+
+
+FUNCTION blockInList RETURNS LOGICAL (pChar AS CHARACTER):
+ /* Find first unused block in list */
+ FIND FIRST ttBlocks WHERE (ttBlocks.ttFaces[1] = pChar
+ OR ttBlocks.ttFaces[2] = pChar)
+ AND NOT ttBlocks.ttUsed NO-ERROR.
+ IF (AVAILABLE ttBlocks) THEN DO:
+ /* found it! set to used and return true */
+ ASSIGN ttBlocks.ttUsed = TRUE.
+ RETURN TRUE.
+ END.
+ ELSE RETURN FALSE.
+END FUNCTION.
+
+
+FUNCTION canMakeWord RETURNS LOGICAL (INPUT pWord AS CHARACTER):
+ DEFINE VARIABLE i AS INTEGER NO-UNDO.
+ DEFINE VARIABLE chChar AS CHARACTER NO-UNDO.
+
+ /* Word has to be valid */
+ IF (LENGTH(pWord) = 0)
+ THEN RETURN FALSE.
+
+ DO i = 1 TO LENGTH(pWord):
+ /* get the char */
+ chChar = SUBSTRING(pWord, i, 1).
+
+ /* Check to see if this is a letter? */
+ IF ((ASC(chChar) < 65) OR (ASC(chChar) > 90) AND
+ (ASC(chChar) < 97) OR (ASC(chChar) > 122))
+ THEN RETURN FALSE.
+
+ /* Is block is list (and unused) */
+ IF NOT blockInList(chChar)
+ THEN RETURN FALSE.
+ END.
+
+ /* Reset all blocks */
+ FOR EACH ttBlocks:
+ ASSIGN ttUsed = FALSE.
+ END.
+ RETURN TRUE.
+END FUNCTION.
diff --git a/Task/ABC-Problem/PARI-GP/abc-problem.pari b/Task/ABC-Problem/PARI-GP/abc-problem.pari
new file mode 100644
index 0000000000..8473277932
--- /dev/null
+++ b/Task/ABC-Problem/PARI-GP/abc-problem.pari
@@ -0,0 +1,18 @@
+BLOCKS = "BOXKDQCPNAGTRETGQDFSJWHUVIANOBERFSLYPCZM";
+WORDS = ["A","Bark","BOOK","Treat","COMMON","SQUAD","conFUSE"];
+
+can_make_word(w) = check(Vecsmall(BLOCKS), Vecsmall(w))
+
+check(B,W,l=1,n=1) =
+{
+ if (l > #W, return(1), n > #B, return(0));
+
+ forstep (i = 1, #B-2, 2,
+ if (B[i] != bitand(W[l],223) && B[i+1] != bitand(W[l],223), next());
+ B[i] = B[i+1] = 0;
+ if (check(B, W, l+1, n+2), return(1))
+ );
+ 0
+}
+
+for (i = 1, #WORDS, printf("%s\t%d\n", WORDS[i], can_make_word(WORDS[i])));
diff --git a/Task/ABC-Problem/Pascal/abc-problem.pascal b/Task/ABC-Problem/Pascal/abc-problem.pascal
new file mode 100644
index 0000000000..9054ae3fe5
--- /dev/null
+++ b/Task/ABC-Problem/Pascal/abc-problem.pascal
@@ -0,0 +1,66 @@
+#!/usr/bin/instantfpc
+//program ABCProblem;
+
+{$mode objfpc}{$H+}
+
+uses SysUtils, Classes;
+
+const
+ // every couple of chars is a block
+ // remove one by replacing its 2 chars by 2 spaces
+ Blocks = 'BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM';
+ BlockSize = 3;
+
+function can_make_word(Str: String): boolean;
+var
+ wkBlocks: string = Blocks;
+ c: Char;
+ iPos : Integer;
+begin
+ // all chars to uppercase
+ Str := UpperCase(Str);
+ Result := Str <> '';
+ if Result then
+ begin
+ for c in Str do
+ begin
+ iPos := Pos(c, wkBlocks);
+ if (iPos > 0) then
+ begin
+ // Char found
+ wkBlocks[iPos] := ' ';
+ // Remove the other face
+ if (iPos mod BlockSize = 1) then
+ wkBlocks[iPos + 1] := ' '
+ else
+ wkBlocks[iPos - 1] := ' ';
+ end
+ else
+ begin
+ // missed
+ Result := False;
+ break;
+ end;
+ end;
+ end;
+ // Debug...
+ //WriteLn(Blocks);
+ //WriteLn(wkBlocks);
+End;
+
+procedure TestABCProblem(Str: String);
+const
+ boolStr : array[boolean] of String = ('False', 'True');
+begin
+ WriteLn(Format('>>> can_make_word("%s")%s%s', [Str, LineEnding, boolStr[can_make_word(Str)]]));
+End;
+
+begin
+ TestABCProblem('A');
+ TestABCProblem('BARK');
+ TestABCProblem('BOOK');
+ TestABCProblem('TREAT');
+ TestABCProblem('COMMON');
+ TestABCProblem('SQUAD');
+ TestABCProblem('CONFUSE');
+END.
diff --git a/Task/ABC-Problem/Perl-6/abc-problem.pl6 b/Task/ABC-Problem/Perl-6/abc-problem.pl6
index fd9c9b4fa3..9bf7e48ac2 100644
--- a/Task/ABC-Problem/Perl-6/abc-problem.pl6
+++ b/Task/ABC-Problem/Perl-6/abc-problem.pl6
@@ -1,5 +1,5 @@
multi can-spell-word(Str $word, @blocks) {
- my @regex = @blocks.map({ EVAL "/{.comb.join('|')}/" }).grep: { .ACCEPTS($word.uc) }
+ my @regex = @blocks.map({ my @c = .comb; rx/<@c>/ }).grep: { .ACCEPTS($word.uc) }
can-spell-word $word.uc.comb.list, @regex;
}
diff --git a/Task/ABC-Problem/Run-BASIC/abc-problem.run b/Task/ABC-Problem/Run-BASIC/abc-problem.run
new file mode 100644
index 0000000000..0c53e56b60
--- /dev/null
+++ b/Task/ABC-Problem/Run-BASIC/abc-problem.run
@@ -0,0 +1,25 @@
+blocks$ = "BO,XK,DQ,CP,NA,GT,RE,TG,QD,FS,JW,HU,VI,AN,OB,ER,FS,LY,PC,ZM"
+makeWord$ = "A,BARK,BOOK,TREAT,COMMON,SQUAD,Confuse"
+b = int((len(blocks$) /3) + 1)
+dim blk$(b)
+
+for i = 1 to len(makeWord$)
+ wrd$ = word$(makeWord$,i,",")
+ dim hit(b)
+ n = 0
+ if wrd$ = "" then exit for
+ for k = 1 to len(wrd$)
+ w$ = upper$(mid$(wrd$,k,1))
+ for j = 1 to b
+ if hit(j) = 0 then
+ if w$ = left$(word$(blocks$,j,","),1) or w$ = right$(word$(blocks$,j,","),1) then
+ hit(j) = 1
+ n = n + 1
+ exit for
+ end if
+ end if
+ next j
+ next k
+ print wrd$;chr$(9);
+ if n = len(wrd$) then print " True" else print " False"
+next i
diff --git a/Task/ABC-Problem/ZX-Spectrum-Basic/abc-problem.zx b/Task/ABC-Problem/ZX-Spectrum-Basic/abc-problem.zx
new file mode 100644
index 0000000000..85e2aba46e
--- /dev/null
+++ b/Task/ABC-Problem/ZX-Spectrum-Basic/abc-problem.zx
@@ -0,0 +1,21 @@
+10 LET b$="BOXKDQCPNAGTRETGQDFSJWHUVIANOBERFSLYPCZM"
+20 READ p
+30 FOR c=1 TO p
+40 READ p$
+50 GO SUB 100
+60 NEXT c
+70 STOP
+80 DATA 7,"A","BARK","BOOK","TREAT","COMMON","SQUAD","CONFUSE"
+90 REM Can make?
+100 LET u$=b$
+110 PRINT "Can make word ";p$;"? ";
+120 FOR i=1 TO LEN p$
+130 FOR j=1 TO LEN u$
+140 IF p$(i)=u$(j) THEN GO SUB 200: GO TO 160
+150 NEXT j
+160 IF j>LEN u$ THEN PRINT "No": RETURN
+170 NEXT i
+180 PRINT "Yes": RETURN
+190 REM Erase pair
+200 IF j/2=INT (j/2) THEN LET u$(j-1 TO j)=" ": RETURN
+210 LET u$(j TO j+1)=" ": RETURN
diff --git a/Task/AKS-test-for-primes/00DESCRIPTION b/Task/AKS-test-for-primes/00DESCRIPTION
index c709f6e5bf..66f8fc2c9b 100644
--- a/Task/AKS-test-for-primes/00DESCRIPTION
+++ b/Task/AKS-test-for-primes/00DESCRIPTION
@@ -1,29 +1,37 @@
-The [http://www.cse.iitk.ac.in/users/manindra/algebra/primality_v6.pdf AKS algorithm] for testing whether a number is prime is a
-polynomial-time algorithm based on an elementary theorem about Pascal triangles.
+The [http://www.cse.iitk.ac.in/users/manindra/algebra/primality_v6.pdf AKS algorithm] for testing whether a number is prime is a polynomial-time algorithm based on an elementary theorem about Pascal triangles.
The theorem on which the test is based can be stated as follows:
-* a number is prime if and only if all the coefficients of the polynomial expansion of
-:
-are divisible by .
+* a number is prime if and only if all the coefficients of the polynomial expansion of
+:::
+are divisible by .
-For example, trying :
-:
-:And all the coefficients are divisible by 3 so 3 is prime.
+;Example:
+Using :
-{{alertbox|#ffe4e4|'''Note:''' This task is '''not''' the AKS primality test. It is an inefficient exponential time algorithm discovered in the late 1600s and used as an introductory lemma in the AKS derivation.}}
+ (x-1)^3 - (x^3 - 1)
+ = (x^3 - 3x^2 + 3x - 1) - (x^3 - 1)
+ = -3x^2 + 3x
+
+
+And all the coefficients are divisible by '''3''', so '''3''' is prime.
+
+
+{{alertbox|#ffe4e4|'''Note:''' This task is '''not''' the AKS primality test. It is an inefficient exponential time algorithm discovered in the late 1600s and used as an introductory lemma in the AKS derivation.}}
+
+
+;Task:
+
+
+# Create a function/subroutine/method that given generates the coefficients of the expanded polynomial representation of .
+# Use the function to show here the polynomial expansions of for in the range '''0''' to at least '''7''', inclusive.
+# Use the previous function in creating another function that when given returns whether is prime using the theorem.
+# Use your test to generate a list of all primes ''under'' '''35'''.
+# '''As a stretch goal''', generate all primes under '''50''' (needs integers larger than 31-bit).
-;The task:
-# Create a function/subroutine/method that given p generates the coefficients of the expanded polynomial representation of .
-# Use the function to show here the polynomial expansions of for p in the range 0 to at least 7, inclusive.
-# Use the previous function in creating another function that when given p returns whether p is prime using the theorem.
-# Use your test to generate a list of all primes ''under'' 35.
-# '''As a stretch goal''', generate all primes under 50 (Needs greater than 31 bit integers).
;References:
* [https://en.wikipedia.org/wiki/AKS_primality_test Agrawal-Kayal-Saxena (AKS) primality test] (Wikipedia)
* [http://www.youtube.com/watch?v=HvMSRWTE2mI Fool-Proof Test for Primes] - Numberphile (Video). The accuracy of this video is disputed -- at best it is an oversimplification.
+
diff --git a/Task/AKS-test-for-primes/OCaml/aks-test-for-primes.ocaml b/Task/AKS-test-for-primes/OCaml/aks-test-for-primes.ocaml
new file mode 100644
index 0000000000..3018caed33
--- /dev/null
+++ b/Task/AKS-test-for-primes/OCaml/aks-test-for-primes.ocaml
@@ -0,0 +1,42 @@
+#require "gen"
+#require "zarith"
+open Z
+let range ?(step=one) i j = if i = j then Gen.empty else Gen.unfold (fun k ->
+ if compare i j = compare k j then Some (k, (add step k)) else None) i
+
+(* kth coefficient of (x - 1)^n *)
+let coeff n k =
+ let numer = Gen.fold mul one
+ (range n (sub n k) ~step:minus_one) in
+ let denom = Gen.fold mul one
+ (range k zero ~step:minus_one) in
+ div numer denom |> mul @@
+ if
+ compare k n < 0 && is_even k
+ then
+ minus_one
+ else
+ one
+
+(* coefficient series for (x - 1)^n, k=[0..n] *)
+let coeff_series n =
+ Gen.map (coeff n) (range zero (succ n))
+
+let middle g = Gen.drop 1 g |> Gen.peek |> Gen.filter_map
+ (function (_, None) -> None | (e, _) -> Some e)
+
+let is_mod_p ~p n = rem n p = zero
+
+let aks p =
+ coeff_series p |> middle |> Gen.for_all (is_mod_p ~p)
+
+let _ =
+ print_endline "coefficient series n (k[0] .. k[n])";
+ Gen.iter
+ (fun n -> Format.printf "%d (%s)\n" (to_int n)
+ (Gen.map to_string (coeff_series n) |> Gen.to_list |> String.concat " "))
+ (range zero (of_int 10));
+ print_endline "";
+ print_endline ("primes < 50 per AKS: " ^
+ (Gen.filter aks (range (of_int 2) (of_int 50)) |>
+ Gen.map to_string |> Gen.to_list |> String.concat " "))
diff --git a/Task/AKS-test-for-primes/Perl-6/aks-test-for-primes-1.pl6 b/Task/AKS-test-for-primes/Perl-6/aks-test-for-primes-1.pl6
index c79e49e1f9..76f3a8bf07 100644
--- a/Task/AKS-test-for-primes/Perl-6/aks-test-for-primes-1.pl6
+++ b/Task/AKS-test-for-primes/Perl-6/aks-test-for-primes-1.pl6
@@ -1,3 +1,3 @@
-constant expansions = [1], [1,-1], -> @prior { [@prior,0 Z- 0,@prior] } ... *;
+constant expansions = [1], [1,-1], -> @prior { [|@prior,0 Z- 0,|@prior] } ... *;
sub polyprime($p where 2..*) { so expansions[$p].[1 ..^ */2].all %% $p }
diff --git a/Task/AKS-test-for-primes/REXX/aks-test-for-primes-2.rexx b/Task/AKS-test-for-primes/REXX/aks-test-for-primes-2.rexx
index f93378cb28..75fa6d9b5a 100644
--- a/Task/AKS-test-for-primes/REXX/aks-test-for-primes-2.rexx
+++ b/Task/AKS-test-for-primes/REXX/aks-test-for-primes-2.rexx
@@ -1,40 +1,41 @@
-/*REXX pgm calculates primes via the Agrawal-Kayal-Saxena (AKS) primality test*/
-parse arg Z .; if Z=='' then Z=200 /*Z not specified? Then use default.*/
-OZ=Z; tell=Z<0; Z=abs(Z) /*Is Z negative? Then show expression.*/
-numeric digits max(9,Z%3) /*define a dynamic # of decimal digits.*/
-$.0='-'; $.1="+"; @.=1 /*$.x: sign char; default coefficients.*/
-#= /*define list of prime numbers (so far)*/
- do p=3 for Z; pm=p-1; pp=p+1 /*PM & PP: used as a coding convenience*/
- do m=2 for pp%2-1; mm=m-1 /*calculate coefficients for a power. */
- @.p.m=@.pm.mm + @.pm.m; h=pp-m /*calculate left side of coefficients*/
- @.p.h=@.p.m /* " right " " " */
- end /*m*/ /* [↑] The M DO loop creates both */
- end /*p*/ /* sides in the same loop, saving */
- /* a bunch of execution time. */
-if tell then say '(x-1)^0: 1' /*possibly display the first expression*/
- /* [↓] test for primality by division.*/
- do n=2 for Z; nh=n%2; d=n-1 /*create expressions; find the primes.*/
- do k=3 to nh while @.n.k//d==0 /*are coefficients divisible by N-1 ? */
- end /*k*/ /* [↑] skip the 1st & 2nd coefficients*/
- /* [↓] multiple THEN─IF faster than &s*/
- if d\==1 then if d\==4 then if k>nh then #=# d /*add number to prime list.*/
- if \tell then iterate /*Don't tell? Don't show expressions.*/
- y='(x-1)^'d": " /*define first part of the expression. */
- s=1 /*S: is the sign indicator (-1│+1).*/
- do j=n to 2 by -1 /*create the higher powers first. */
- if j==2 then xp='x' /*if power=1, then don't show the power*/
- else xp='x^' || (j-1) /* ··· else show power with ^ */
- if j==n then y=y xp /*no sign (+│-) for the 1st expression.*/
- else y=y $.s @.n.j'∙'xp /*build the expression with sign (+|-).*/
- s=\s /*flip the sign for the next expression*/
- end /*j*/ /* [↑] the sign (now) is either 0 │ 1,*/
- /* and is displayed either - │ + */
- say y $.s 1 /*just show the first N expressions, */
- end /*n*/ /* [↑] ··· but only for negative Z. */
- say /* [↓] Has Z a leading + ? Then show.*/
-is="isn't"; if Z==word(. #,words(#)+1) then is='is' /*is or isn't a prime.*/
-if left(OZ,1)=='+' then say Z is 'prime.' /*tell if OZ has a +. */
- else say 'primes:' # /*display prime # list. */
-say /* [↓] size of big 'un.*/
-say 'Found ' words(#) ' primes and the largest coefficient has' ,
- length(@.pm.h) "decimal digits." /*stick a fork in it, we're all done. */
+/*REXX program calculates primes via the Agrawal─Kayal─Saxena (AKS) primality test.*/
+parse arg Z .; if Z=='' | Z=="," then Z=200 /*Z not specified? Then use default.*/
+OZ=Z; tell=Z<0; Z=abs(Z) /*Is Z negative? Then show expression.*/
+numeric digits max(9,Z%3) /*define a dynamic # of decimal digits.*/
+$.0='-'; $.1="+"; @.=1 /*$.x: sign char; default coefficients.*/
+#= /*define list of prime numbers (so far)*/
+ do p=3 for Z; pm=p-1; pp=p+1 /*PM & PP: used as a coding convenience*/
+ do m=2 for pp%2-1; mm=m-1 /*calculate coefficients for a power. */
+ @.p.m=@.pm.mm + @.pm.m; h=pp-m /*calculate left side of coefficients*/
+ @.p.h=@.p.m /* " right " " " */
+ end /*m*/ /* [↑] The M DO loop creates both */
+ end /*p*/ /* sides in the same loop, saving */
+ /* a bunch of execution time. */
+if tell then say '(x-1)^0: 1' /*possibly display the first expression*/
+ /* [↓] test for primality by division.*/
+ do n=2 for Z; nh=n%2; d=n-1 /*create expressions; find the primes.*/
+ do k=3 to nh while @.n.k//d==0 /*are coefficients divisible by N-1 ? */
+ end /*k*/ /* [↑] skip the 1st & 2nd coefficients*/
+ /* [↓] multiple THEN─IF faster than &s*/
+ if d\==1 then if d\==4 then if k>nh then #=# d /*add a number to prime list.*/
+ if \tell then iterate /*Don't tell? Don't show expressions.*/
+ y='(x-1)^'d": " /*define the 1st part of the expression*/
+ s=1 /*S: is the sign indicator (-1│+1).*/
+ do j=n to 2 by -1 /*create the higher powers first. */
+ if j==2 then xp='x' /*if power=1, then don't show the power*/
+ else xp='x^' || (j-1) /* ··· else show power with ^ */
+ if j==n then y=y xp /*no sign (+│-) for the 1st expression.*/
+ else y=y $.s @.n.j'∙'xp /*build the expression with sign (+|-).*/
+ s=\s /*flip the sign for the next expression*/
+ end /*j*/ /* [↑] the sign (now) is either 0 │ 1,*/
+ /* and is displayed either - │ + */
+ say y $.s 1 /*just show the first N expressions, */
+ end /*n*/ /* [↑] ··· but only for negative Z. */
+say /* [↓] Has Z a leading + ? Then show.*/
+if Z==word(. #,words(#)+1) then is='is' /*the number is a prime. */
+ else is="isn't" /* " " ain't " " */
+if left(OZ,1)=='+' then say Z is 'prime.' /*show if OZ has a + (plus sign). */
+ else say 'primes:' # /*display the prime number list. */
+say /* [↓] the digit length of a big coef.*/
+say 'Found ' words(#) " primes and the largest coefficient has " length(@.pm.h),
+ " decimal digits." /*stick a fork in it, we're all done. */
diff --git a/Task/Abstract-type/PowerShell/abstract-type-1.psh b/Task/Abstract-type/PowerShell/abstract-type-1.psh
new file mode 100644
index 0000000000..c1c82d3b36
--- /dev/null
+++ b/Task/Abstract-type/PowerShell/abstract-type-1.psh
@@ -0,0 +1,92 @@
+#Requires -Version 5.0
+
+Class Player
+{
+ <#
+ Properties: Name, Team, Position and Number
+ #>
+ [string]$Name
+
+ [ValidateSet("Baltimore Ravens","Cincinnati Bengals","Cleveland Browns","Pittsburgh Steelers",
+ "Chicago Bears","Detroit Lions","Green Bay Packers","Minnesota Vikings",
+ "Houston Texans","Indianapolis Colts","Jacksonville Jaguars","Tennessee Titans",
+ "Atlanta Falcons","Carolina Panthers","New Orleans Saints","Tampa Bay Buccaneers",
+ "Buffalo Bills","Miami Dolphins","New England Patriots","New York Jets",
+ "Dallas Cowboys","New York Giants","Philadelphia Eagles","Washington Redskins",
+ "Denver Broncos","Kansas City Chiefs","Oakland Raiders","San Diego Chargers",
+ "Arizona Cardinals","Los Angeles Rams","San Francisco 49ers","Seattle Seahawks")]
+ [string]$Team
+
+ [ValidateSet("C","G","T","QB","RB","WR","TE","DT","DE","ILB","OLB","CB","S","K","H","LS","P","KOS","R")]
+ [string]$Position
+
+ [ValidateRange(0,99)]
+ [int]$Number
+
+ <#
+ Constructor: Creates a new Player object, with the specified Name, Team, Position and Number.
+ #>
+ Player([string]$Name, [string]$Team, [string]$Position, [int]$Number)
+ {
+ $this.Name = (Get-Culture).TextInfo.ToTitleCase("$Name")
+ $this.Team = (Get-Culture).TextInfo.ToTitleCase("$Team")
+ $this.Position = $Position.ToUpper()
+ $this.Number = $Number
+ }
+
+ <#
+ Methods: Trade the player to a different team (optional parameters for methods in PowerShell 5 classes are not available. Boo!!)
+ An overloaded method is a method with the same name as another method but in a different context,
+ in this case with different parameters.
+ #>
+ Trade([string]$NewTeam)
+ {
+ [string[]]$league = "Baltimore Ravens","Cincinnati Bengals","Cleveland Browns","Pittsburgh Steelers",
+ "Chicago Bears","Detroit Lions","Green Bay Packers","Minnesota Vikings",
+ "Houston Texans","Indianapolis Colts","Jacksonville Jaguars","Tennessee Titans",
+ "Atlanta Falcons","Carolina Panthers","New Orleans Saints","Tampa Bay Buccaneers",
+ "Buffalo Bills","Miami Dolphins","New England Patriots","New York Jets",
+ "Dallas Cowboys","New York Giants","Philadelphia Eagles","Washington Redskins",
+ "Denver Broncos","Kansas City Chiefs","Oakland Raiders","San Diego Chargers",
+ "Arizona Cardinals","Los Angeles Rams","San Francisco 49ers","Seattle Seahawks"
+
+ if ($NewTeam -in $league | Where-Object {$_ -notmatch $this.Team})
+ {
+ $this.Team = (Get-Culture).TextInfo.ToTitleCase("$NewTeam")
+ }
+ else
+ {
+ throw "Invalid Team"
+ }
+ }
+
+ Trade([string]$NewTeam, [int]$NewNumber)
+ {
+ [string[]]$league = "Baltimore Ravens","Cincinnati Bengals","Cleveland Browns","Pittsburgh Steelers",
+ "Chicago Bears","Detroit Lions","Green Bay Packers","Minnesota Vikings",
+ "Houston Texans","Indianapolis Colts","Jacksonville Jaguars","Tennessee Titans",
+ "Atlanta Falcons","Carolina Panthers","New Orleans Saints","Tampa Bay Buccaneers",
+ "Buffalo Bills","Miami Dolphins","New England Patriots","New York Jets",
+ "Dallas Cowboys","New York Giants","Philadelphia Eagles","Washington Redskins",
+ "Denver Broncos","Kansas City Chiefs","Oakland Raiders","San Diego Chargers",
+ "Arizona Cardinals","Los Angeles Rams","San Francisco 49ers","Seattle Seahawks"
+
+ if ($NewTeam -in $league | Where-Object {$_ -notmatch $this.Team})
+ {
+ $this.Team = (Get-Culture).TextInfo.ToTitleCase("$NewTeam")
+ }
+ else
+ {
+ throw "Invalid Team"
+ }
+
+ if ($NewNumber -in 0..99)
+ {
+ $this.Number = $NewNumber
+ }
+ else
+ {
+ throw "Invalid Number"
+ }
+ }
+}
diff --git a/Task/Abstract-type/PowerShell/abstract-type-2.psh b/Task/Abstract-type/PowerShell/abstract-type-2.psh
new file mode 100644
index 0000000000..a0711e85f9
--- /dev/null
+++ b/Task/Abstract-type/PowerShell/abstract-type-2.psh
@@ -0,0 +1,2 @@
+$player1 = [Player]::new("sam bradford", "philadelphia eagles", "qb", 7)
+$player1
diff --git a/Task/Abstract-type/PowerShell/abstract-type-3.psh b/Task/Abstract-type/PowerShell/abstract-type-3.psh
new file mode 100644
index 0000000000..4c2ddc606c
--- /dev/null
+++ b/Task/Abstract-type/PowerShell/abstract-type-3.psh
@@ -0,0 +1,2 @@
+$player1.Trade("minnesota vikings", 8)
+$player1
diff --git a/Task/Abstract-type/PowerShell/abstract-type-4.psh b/Task/Abstract-type/PowerShell/abstract-type-4.psh
new file mode 100644
index 0000000000..7cd5678d1b
--- /dev/null
+++ b/Task/Abstract-type/PowerShell/abstract-type-4.psh
@@ -0,0 +1,2 @@
+$player2 = [Player]::new("demarco murray", "philadelphia eagles", "rb", 29)
+$player2
diff --git a/Task/Abstract-type/PowerShell/abstract-type-5.psh b/Task/Abstract-type/PowerShell/abstract-type-5.psh
new file mode 100644
index 0000000000..1b65e884e8
--- /dev/null
+++ b/Task/Abstract-type/PowerShell/abstract-type-5.psh
@@ -0,0 +1,2 @@
+$player2.Trade("tennessee titans")
+$player2
diff --git a/Task/Abstract-type/Rust/abstract-type-1.rust b/Task/Abstract-type/Rust/abstract-type-1.rust
new file mode 100644
index 0000000000..c2f21a3b63
--- /dev/null
+++ b/Task/Abstract-type/Rust/abstract-type-1.rust
@@ -0,0 +1,3 @@
+trait Shape {
+ fn area(self) -> i32;
+}
diff --git a/Task/Abstract-type/Rust/abstract-type-2.rust b/Task/Abstract-type/Rust/abstract-type-2.rust
new file mode 100644
index 0000000000..e3b34fc67a
--- /dev/null
+++ b/Task/Abstract-type/Rust/abstract-type-2.rust
@@ -0,0 +1,9 @@
+struct Square {
+ side_length: i32
+}
+
+impl Shape for Square {
+ fn area(self) -> i32 {
+ self.side_length * self.side_length
+ }
+}
diff --git a/Task/Abstract-type/Rust/abstract-type-3.rust b/Task/Abstract-type/Rust/abstract-type-3.rust
new file mode 100644
index 0000000000..6be8ab9015
--- /dev/null
+++ b/Task/Abstract-type/Rust/abstract-type-3.rust
@@ -0,0 +1,7 @@
+trait Shape {
+ fn area(self) -> i32;
+
+ fn is_shape(self) -> bool {
+ true
+ }
+}
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/00DESCRIPTION b/Task/Abundant,-deficient-and-perfect-number-classifications/00DESCRIPTION
index e0f267b3d9..d9bc0e98a5 100644
--- a/Task/Abundant,-deficient-and-perfect-number-classifications/00DESCRIPTION
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/00DESCRIPTION
@@ -1,16 +1,24 @@
-These define three classifications of positive integers based on their [[Proper divisors|proper divisors]].
+These define three classifications of positive integers based on their [[Proper divisors|proper divisors]].
-Let P(n) be the sum of the proper divisors of n, where the proper divisors of n are all positive divisors of n other than n itself.
-* if P(n) < n then n is classed as '''deficient''' ([https://oeis.org/A005100 OEIS A005100]).
-* if P(n) == n then n is classed as '''perfect''' ([https://oeis.org/A000396 OEIS A000396]).
-* if P(n) > n then n is classed as '''abundant''' ([https://oeis.org/A005101 OEIS A005101]).
+Let P(n) be the sum of the proper divisors of '''n''' where the proper divisors are all positive divisors of '''n''' other than '''n''' itself.
+ if P(n) < n then '''n''' is classed as '''deficient''' ([https://oeis.org/A005100 OEIS A005100]).
+ if P(n) == n then '''n''' is classed as '''perfect''' ([https://oeis.org/A000396 OEIS A000396]).
+ if P(n) > n then '''n''' is classed as '''abundant''' ([https://oeis.org/A005101 OEIS A005101]).
+
+
+;Example:
+'''6''' has proper divisors of '''1''', '''2''', and '''3'''.
+
+'''1 + 2 + 3 = 6''', so '''6''' is classed as a perfect number.
-Example: 6 has proper divisors 1, 2, and 3. 1 + 2 + 3 = 6 so 6 is classed as a perfect number.
;Task:
-Calculate how many of the integers 1 to 20,000 inclusive are in each of the three classes and show the result here.
+Calculate how many of the integers '''1''' to '''20,000''' (inclusive) are in each of the three classes.
-;Cf.
-* [[Aliquot sequence classifications]]. (The whole series from which this task is a subset).
-* [[Proper divisors]]
-* [[Amicable pairs]]
+Show the results here.
+
+
+;Related tasks:
+* [[Aliquot sequence classifications]]. (The whole series from which this task is a subset.)
+* [[Proper divisors]]
+* [[Amicable pairs]]
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/360-Assembly/abundant,-deficient-and-perfect-number-classifications.360 b/Task/Abundant,-deficient-and-perfect-number-classifications/360-Assembly/abundant,-deficient-and-perfect-number-classifications.360
new file mode 100644
index 0000000000..491c0e5fa6
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/360-Assembly/abundant,-deficient-and-perfect-number-classifications.360
@@ -0,0 +1,56 @@
+* Abundant, deficient and perfect number 08/05/2016
+ABUNDEFI CSECT
+ USING ABUNDEFI,R13 set base register
+SAVEAR B STM-SAVEAR(R15) skip savearea
+ DC 17F'0' savearea
+STM STM R14,R12,12(R13) save registers
+ ST R13,4(R15) link backward SA
+ ST R15,8(R13) link forward SA
+ LR R13,R15 establish addressability
+ SR R10,R10 deficient=0
+ SR R11,R11 perfect =0
+ SR R12,R12 abundant =0
+ LA R6,1 i=1
+LOOPI C R6,NN do i=1 to nn
+ BH ELOOPI
+ SR R8,R8 sum=0
+ LR R9,R6 i
+ SRA R9,1 i/2
+ LA R7,1 j=1
+LOOPJ CR R7,R9 do j=1 to i/2
+ BH ELOOPJ
+ LR R2,R6 i
+ SRDA R2,32
+ DR R2,R7 i//j=0
+ LTR R2,R2 if i//j=0
+ BNZ NOTMOD
+ AR R8,R7 sum=sum+j
+NOTMOD LA R7,1(R7) j=j+1
+ B LOOPJ
+ELOOPJ CR R8,R6 if sum?i
+ BL SLI <
+ BE SEI =
+ BH SHI >
+SLI LA R10,1(R10) deficient+=1
+ B EIF
+SEI LA R11,1(R11) perfect +=1
+ B EIF
+SHI LA R12,1(R12) abundant +=1
+EIF LA R6,1(R6) i=i+1
+ B LOOPI
+ELOOPI XDECO R10,XDEC edit deficient
+ MVC PG+10(5),XDEC+7
+ XDECO R11,XDEC edit perfect
+ MVC PG+24(5),XDEC+7
+ XDECO R12,XDEC edit abundant
+ MVC PG+39(5),XDEC+7
+ XPRNT PG,80 print buffer
+ L R13,4(0,R13) restore savearea pointer
+ LM R14,R12,12(R13) restore registers
+ XR R15,R15 return code = 0
+ BR R14 return to caller
+NN DC F'20000'
+PG DC CL80'deficient=xxxxx perfect=xxxxx abundant=xxxxx'
+XDEC DS CL12
+ REGEQU
+ END ABUNDEFI
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/ALGOL-68/abundant,-deficient-and-perfect-number-classifications.alg b/Task/Abundant,-deficient-and-perfect-number-classifications/ALGOL-68/abundant,-deficient-and-perfect-number-classifications.alg
new file mode 100644
index 0000000000..dc2d461165
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/ALGOL-68/abundant,-deficient-and-perfect-number-classifications.alg
@@ -0,0 +1,69 @@
+# resturns the sum of the proper divisors of n #
+# if n = 1, 0 or -1, we return 0 #
+PROC sum proper divisors = ( INT n )INT:
+ BEGIN
+ INT result := 0;
+ INT abs n = ABS n;
+ IF abs n > 1 THEN
+ FOR d FROM ENTIER sqrt( abs n ) BY -1 TO 2 DO
+ IF abs n MOD d = 0 THEN
+ # found another divisor #
+ result +:= d;
+ IF d * d /= n THEN
+ # include the other divisor #
+ result +:= n OVER d
+ FI
+ FI
+ OD;
+ # 1 is always a proper divisor of numbers > 1 #
+ result +:= 1
+ FI;
+ result
+ END # sum proper divisors # ;
+
+# classify the numbers 1 : 20 000 as abudant, deficient or perfect #
+INT abundant count := 0;
+INT deficient count := 0;
+INT perfect count := 0;
+INT abundant example := 0;
+INT deficient example := 0;
+INT perfect example := 0;
+INT max number = 20 000;
+FOR n TO max number DO
+ IF INT pd sum = sum proper divisors( n );
+ pd sum < n
+ THEN
+ # have a deficient number #
+ deficient count +:= 1;
+ deficient example := n
+ ELIF pd sum = n
+ THEN
+ # have a perfect number #
+ perfect count +:= 1;
+ perfect example := n
+ ELSE # pd sum > n #
+ # have an abundant number #
+ abundant count +:= 1;
+ abundant example := n
+ FI
+OD;
+
+# show how many of each type of number there are and an example #
+
+# displays the classification, count and example #
+PROC show result = ( STRING classification, INT count, example )VOID:
+ print( ( "There are "
+ , whole( count, -8 )
+ , " "
+ , classification
+ , " numbers up to "
+ , whole( max number, 0 )
+ , " e.g.: "
+ , whole( example, 0 )
+ , newline
+ )
+ );
+
+show result( "abundant ", abundant count, abundant example );
+show result( "deficient", deficient count, deficient example );
+show result( "perfect ", perfect count, perfect example )
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/C-sharp/abundant,-deficient-and-perfect-number-classifications.cs b/Task/Abundant,-deficient-and-perfect-number-classifications/C-sharp/abundant,-deficient-and-perfect-number-classifications.cs
new file mode 100644
index 0000000000..563eb10179
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/C-sharp/abundant,-deficient-and-perfect-number-classifications.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Linq;
+
+public class Program
+{
+ public static void Main()
+ {
+ int abundant, deficient, perfect;
+ ClassifyNumbers.UsingSieve(20000, out abundant, out deficient, out perfect);
+ Console.WriteLine($"Abundant: {abundant}, Deficient: {deficient}, Perfect: {perfect}");
+
+ ClassifyNumbers.UsingDivision(20000, out abundant, out deficient, out perfect);
+ Console.WriteLine($"Abundant: {abundant}, Deficient: {deficient}, Perfect: {perfect}");
+ }
+}
+
+public static class ClassifyNumbers
+{
+ //Fastest way
+ public static void UsingSieve(int bound, out int abundant, out int deficient, out int perfect) {
+ int a = 0, d = 0, p = 0;
+ //For very large bounds, this array can get big.
+ int[] sum = new int[bound + 1];
+ for (int divisor = 1; divisor <= bound / 2; divisor++) {
+ for (int i = divisor + divisor; i <= bound; i += divisor) {
+ sum[i] += divisor;
+ }
+ }
+ for (int i = 1; i <= bound; i++) {
+ if (sum[i] < i) d++;
+ else if (sum[i] > i) a++;
+ else p++;
+ }
+ abundant = a;
+ deficient = d;
+ perfect = p;
+ }
+
+ //Much slower, but doesn't use storage
+ public static void UsingDivision(int bound, out int abundant, out int deficient, out int perfect) {
+ int a = 0, d = 0, p = 0;
+ for (int i = 1; i < 20001; i++) {
+ int sum = Enumerable.Range(1, (i + 1) / 2)
+ .Where(div => div != i && i % div == 0).Sum();
+ if (sum < i) d++;
+ else if (sum > i) a++;
+ else p++;
+ }
+ abundant = a;
+ deficient = d;
+ perfect = p;
+ }
+}
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Ela/abundant,-deficient-and-perfect-number-classifications.ela b/Task/Abundant,-deficient-and-perfect-number-classifications/Ela/abundant,-deficient-and-perfect-number-classifications.ela
new file mode 100644
index 0000000000..1d44220c5b
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Ela/abundant,-deficient-and-perfect-number-classifications.ela
@@ -0,0 +1,11 @@
+open monad io number list
+
+divisors n = filter ((0 ==) << (n `mod`)) [1 .. (n `div` 2)]
+classOf n = compare (sum $ divisors n) n
+
+do
+ let classes = map classOf [1 .. 20000]
+ let printRes w c = putStrLn $ w ++ (show << length $ filter (== c) classes)
+ printRes "deficient: " LT
+ printRes "perfect: " EQ
+ printRes "abundant: " GT
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Elixir/abundant,-deficient-and-perfect-number-classifications.elixir b/Task/Abundant,-deficient-and-perfect-number-classifications/Elixir/abundant,-deficient-and-perfect-number-classifications.elixir
new file mode 100644
index 0000000000..b8045fe469
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Elixir/abundant,-deficient-and-perfect-number-classifications.elixir
@@ -0,0 +1,19 @@
+defmodule Proper do
+ def divisors(1), do: []
+ def divisors(n), do: [1 | divisors(2,n,:math.sqrt(n))] |> Enum.sort
+
+ defp divisors(k,_n,q) when k>q, do: []
+ defp divisors(k,n,q) when rem(n,k)>0, do: divisors(k+1,n,q)
+ defp divisors(k,n,q) when k * k == n, do: [k | divisors(k+1,n,q)]
+ defp divisors(k,n,q) , do: [k,div(n,k) | divisors(k+1,n,q)]
+end
+
+{abundant, deficient, perfect} = Enum.reduce(1..20000, {0,0,0}, fn n,{a, d, p} ->
+ sum = Proper.divisors(n) |> Enum.sum
+ cond do
+ n < sum -> {a+1, d, p}
+ n > sum -> {a, d+1, p}
+ true -> {a, d, p+1}
+ end
+end)
+IO.puts "Deficient: #{deficient} Perfect: #{perfect} Abundant: #{abundant}"
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Groovy/abundant,-deficient-and-perfect-number-classifications.groovy b/Task/Abundant,-deficient-and-perfect-number-classifications/Groovy/abundant,-deficient-and-perfect-number-classifications.groovy
new file mode 100644
index 0000000000..f82640076e
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Groovy/abundant,-deficient-and-perfect-number-classifications.groovy
@@ -0,0 +1,15 @@
+def dpaCalc = { factors ->
+ def n = factors.pop()
+ def fSum = factors.sum()
+ fSum < n
+ ? 'deficient'
+ : fSum > n
+ ? 'abundant'
+ : 'perfect'
+}
+
+(1..20000).inject([deficient:0, perfect:0, abundant:0]) { map, n ->
+ map[dpaCalc(factorize(n))]++
+ map
+}
+.each { e -> println e }
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Java/abundant,-deficient-and-perfect-number-classifications.java b/Task/Abundant,-deficient-and-perfect-number-classifications/Java/abundant,-deficient-and-perfect-number-classifications.java
new file mode 100644
index 0000000000..3bd3d9a65b
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Java/abundant,-deficient-and-perfect-number-classifications.java
@@ -0,0 +1,27 @@
+import static java.util.stream.LongStream.rangeClosed;
+
+public class NumberClassifications {
+
+ public static void main(String[] args) {
+ int countDeficient = 0;
+ int countPerfect = 0;
+ int countAbundant = 0;
+
+ for (long i = 1; i <= 20_000L; i++) {
+ long sum = properDivsSum(i);
+ if (sum < i)
+ countDeficient++;
+ else if (sum == i)
+ countPerfect++;
+ else
+ countAbundant++;
+ }
+ System.out.println("Deficient: " + countDeficient);
+ System.out.println("Perfect: " + countPerfect);
+ System.out.println("Abundant: " + countAbundant);
+ }
+
+ public static Long properDivsSum(long n) {
+ return rangeClosed(1, (n + 1) / 2).filter(i -> n % i == 0 && n != i).sum();
+ }
+}
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Liberty-BASIC/abundant,-deficient-and-perfect-number-classifications.liberty b/Task/Abundant,-deficient-and-perfect-number-classifications/Liberty-BASIC/abundant,-deficient-and-perfect-number-classifications.liberty
new file mode 100644
index 0000000000..b97a003359
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Liberty-BASIC/abundant,-deficient-and-perfect-number-classifications.liberty
@@ -0,0 +1,49 @@
+print "ROSETTA CODE - Abundant, deficient and perfect number classifications"
+print
+for x=1 to 20000
+ x$=NumberClassification$(x)
+ select case x$
+ case "deficient": de=de+1
+ case "perfect": pe=pe+1: print x; " is a perfect number"
+ case "abundant": ab=ab+1
+ end select
+ select case x
+ case 2000: print "Checking the number classifications of 20,000 integers..."
+ case 4000: print "Please be patient."
+ case 7000: print "7,000"
+ case 10000: print "10,000"
+ case 12000: print "12,000"
+ case 14000: print "14,000"
+ case 16000: print "16,000"
+ case 18000: print "18,000"
+ case 19000: print "Almost done..."
+ end select
+next x
+print "Deficient numbers = "; de
+print "Perfect numbers = "; pe
+print "Abundant numbers = "; ab
+print "TOTAL = "; pe+de+ab
+[Quit]
+print "Program complete."
+end
+
+function NumberClassification$(n)
+ x=ProperDivisorCount(n)
+ for y=1 to x
+ PDtotal=PDtotal+ProperDivisor(y)
+ next y
+ if PDtotal=n then NumberClassification$="perfect": exit function
+ if PDtotaln then NumberClassification$="abundant": exit function
+end function
+
+function ProperDivisorCount(n)
+ n=abs(int(n)): if n=0 or n>20000 then exit function
+ dim ProperDivisor(100)
+ for y=2 to n
+ if (n mod y)=0 then
+ ProperDivisorCount=ProperDivisorCount+1
+ ProperDivisor(ProperDivisorCount)=n/y
+ end if
+ next y
+end function
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Lua/abundant,-deficient-and-perfect-number-classifications.lua b/Task/Abundant,-deficient-and-perfect-number-classifications/Lua/abundant,-deficient-and-perfect-number-classifications.lua
index f1d6f342d8..338cf74162 100644
--- a/Task/Abundant,-deficient-and-perfect-number-classifications/Lua/abundant,-deficient-and-perfect-number-classifications.lua
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Lua/abundant,-deficient-and-perfect-number-classifications.lua
@@ -1,21 +1,21 @@
function sumDivs (n)
- if n < 2 then return 0 end
- local sum, sr = 1, math.sqrt(n)
- for d = 2, sr do
- if n % d == 0 then
- sum = sum + d
- if d ~= sr then sum = sum + n / d end
- end
- end
- return sum
+ if n < 2 then return 0 end
+ local sum, sr = 1, math.sqrt(n)
+ for d = 2, sr do
+ if n % d == 0 then
+ sum = sum + d
+ if d ~= sr then sum = sum + n / d end
+ end
+ end
+ return sum
end
local a, d, p, Pn = 0, 0, 0
for n = 1, 20000 do
- Pn = sumDivs(n)
- if Pn > n then a = a + 1 end
- if Pn < n then d = d + 1 end
- if Pn == n then p = p + 1 end
+ Pn = sumDivs(n)
+ if Pn > n then a = a + 1 end
+ if Pn < n then d = d + 1 end
+ if Pn == n then p = p + 1 end
end
print("Abundant:", a)
print("Deficient:", d)
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Perl-6/abundant,-deficient-and-perfect-number-classifications.pl6 b/Task/Abundant,-deficient-and-perfect-number-classifications/Perl-6/abundant,-deficient-and-perfect-number-classifications.pl6
index dfd1f3a358..61ab336e21 100644
--- a/Task/Abundant,-deficient-and-perfect-number-classifications/Perl-6/abundant,-deficient-and-perfect-number-classifications.pl6
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Perl-6/abundant,-deficient-and-perfect-number-classifications.pl6
@@ -1,8 +1,8 @@
sub propdivsum (\x) {
- [+] (1 if x > 1), gather for 2 .. x.sqrt.floor -> \d {
+ [+] flat(x > 1, gather for 2 .. x.sqrt.floor -> \d {
my \y = x div d;
if y * d == x { take d; take y unless y == d }
- }
+ })
}
say bag map { propdivsum($_) <=> $_ }, 1..20000
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/PowerShell/abundant,-deficient-and-perfect-number-classifications.psh b/Task/Abundant,-deficient-and-perfect-number-classifications/PowerShell/abundant,-deficient-and-perfect-number-classifications.psh
index f53d6699e6..010bc23ece 100644
--- a/Task/Abundant,-deficient-and-perfect-number-classifications/PowerShell/abundant,-deficient-and-perfect-number-classifications.psh
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/PowerShell/abundant,-deficient-and-perfect-number-classifications.psh
@@ -1,27 +1,33 @@
-new-variable deficient -value 0
-new-variable perfect -value 0
-new-variable abundant -value 0
-new-variable sum
+function Get-ProperDivisorSum ( [int]$N )
+ {
+ If ( $N -lt 2 ) { return 0 }
-for($i=1;$i -le 20000;$i++){
- $sum=0
- for($n=1;$n -le [System.Math]::Floor([System.Math]::Sqrt($i));$n++){
- if($i%$n -eq 0){
- $sum+=($i/$n)
- if($i/$n -ne $n) {$sum+=$n}
- }
- }
- $sum-=$i
- if($sum -lt $i){
- $deficient++
- }
- elseif($sum -eq $i){
- $perfect++
- } else {
- $abundant++
- }
-}
+ $Sum = 1
+ If ( $N -gt 3 )
+ {
+ $SqrtN = [math]::Sqrt( $N )
+ ForEach ( $Divisor in 2..$SqrtN )
+ {
+ If ( $N % $Divisor -eq 0 ) { $Sum += $Divisor + $N / $Divisor }
+ }
+ If ( $N % $SqrtN -eq 0 ) { $Sum -= $SqrtN }
+ }
+ return $Sum
+ }
-Write-Host "Deficient = $deficient"
-Write-Host "Perfect = $perfect"
-Write-Host "Abundant = $abundant"
+
+$Deficient = $Perfect = $Abundant = 0
+
+ForEach ( $N in 1..20000 )
+ {
+ Switch ( [math]::Sign( ( Get-ProperDivisorSum $N ) - $N ) )
+ {
+ -1 { $Deficient++ }
+ 0 { $Perfect++ }
+ 1 { $Abundant++ }
+ }
+ }
+
+"Deficient: $Deficient"
+"Perfect : $Perfect"
+"Abundant : $Abundant"
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/Prolog/abundant,-deficient-and-perfect-number-classifications.pro b/Task/Abundant,-deficient-and-perfect-number-classifications/Prolog/abundant,-deficient-and-perfect-number-classifications.pro
new file mode 100644
index 0000000000..b0a87e05b3
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/Prolog/abundant,-deficient-and-perfect-number-classifications.pro
@@ -0,0 +1,42 @@
+proper_divisors(1, []) :- !.
+proper_divisors(N, [1|L]) :-
+ FSQRTN is floor(sqrt(N)),
+ proper_divisors(2, FSQRTN, N, L).
+
+proper_divisors(M, FSQRTN, _, []) :-
+ M > FSQRTN,
+ !.
+proper_divisors(M, FSQRTN, N, L) :-
+ N mod M =:= 0, !,
+ MO is N//M, % must be integer
+ L = [M,MO|L1], % both proper divisors
+ M1 is M+1,
+ proper_divisors(M1, FSQRTN, N, L1).
+proper_divisors(M, FSQRTN, N, L) :-
+ M1 is M+1,
+ proper_divisors(M1, FSQRTN, N, L).
+
+dpa(1, [1], [], []) :-
+ !.
+dpa(N, D, P, A) :-
+ N > 1,
+ proper_divisors(N, PN),
+ sum_list(PN, SPN),
+ compare(VGL, SPN, N),
+ dpa(VGL, N, D, P, A).
+
+dpa(<, N, [N|D], P, A) :- N1 is N-1, dpa(N1, D, P, A).
+dpa(=, N, D, [N|P], A) :- N1 is N-1, dpa(N1, D, P, A).
+dpa(>, N, D, P, [N|A]) :- N1 is N-1, dpa(N1, D, P, A).
+
+
+dpa(N) :-
+ T0 is cputime,
+ dpa(N, D, P, A),
+ Dur is cputime-T0,
+ length(D, LD),
+ length(P, LP),
+ length(A, LA),
+ format("deficient: ~d~n abundant: ~d~n perfect: ~d~n",
+ [LD, LA, LP]),
+ format("took ~f seconds~n", [Dur]).
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/PureBasic/abundant,-deficient-and-perfect-number-classifications.purebasic b/Task/Abundant,-deficient-and-perfect-number-classifications/PureBasic/abundant,-deficient-and-perfect-number-classifications.purebasic
new file mode 100644
index 0000000000..aefa87df08
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/PureBasic/abundant,-deficient-and-perfect-number-classifications.purebasic
@@ -0,0 +1,36 @@
+EnableExplicit
+
+Procedure.i SumProperDivisors(Number)
+ If Number < 2 : ProcedureReturn 0 : EndIf
+ Protected i, sum = 0
+ For i = 1 To Number / 2
+ If Number % i = 0
+ sum + i
+ EndIf
+ Next
+ ProcedureReturn sum
+EndProcedure
+
+Define n, sum, deficient, perfect, abundant
+
+If OpenConsole()
+ For n = 1 To 20000
+ sum = SumProperDivisors(n)
+ If sum < n
+ deficient + 1
+ ElseIf sum = n
+ perfect + 1
+ Else
+ abundant + 1
+ EndIf
+ Next
+ PrintN("The breakdown for the numbers 1 to 20,000 is as follows : ")
+ PrintN("")
+ PrintN("Deficient = " + deficient)
+ PrintN("Pefect = " + perfect)
+ PrintN("Abundant = " + abundant)
+ PrintN("")
+ PrintN("Press any key to close the console")
+ Repeat: Delay(10) : Until Inkey() <> ""
+ CloseConsole()
+EndIf
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/REXX/abundant,-deficient-and-perfect-number-classifications-1.rexx b/Task/Abundant,-deficient-and-perfect-number-classifications/REXX/abundant,-deficient-and-perfect-number-classifications-1.rexx
index e4c26a1d94..f9c7b40d90 100644
--- a/Task/Abundant,-deficient-and-perfect-number-classifications/REXX/abundant,-deficient-and-perfect-number-classifications-1.rexx
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/REXX/abundant,-deficient-and-perfect-number-classifications-1.rexx
@@ -1,24 +1,24 @@
-/*REXX pgm counts the number of abundant/deficient/perfect numbers in a range.*/
-parse arg low high . /*get optional args from C.L. */
-high=word(high low 20000,1); low=word(low 1,1) /*get the LOW and HIGH values.*/
-say center('integers from ' low " to " high, 45, "═")
-!.=0 /*define all types of sums to zero. */
- do j=low to high; $=sigma(j) /*find the sigma for an integer range. */
- if $j then !.a=!.a+1 /* " " abundant " */
- else !.p=!.p+1 /* " " perfect " */
- end /*j*/
+/*REXX program counts the number of abundant/deficient/perfect numbers within a range.*/
+parse arg low high . /*obtain optional arguments from the CL*/
+high=word(high low 20000,1); low=word(low 1,1) /*obtain the LOW and HIGH values.*/
+say center('integers from ' low " to " high, 45, "═") /*display a header.*/
+!.=0 /*define all types of sums to zero. */
+ do j=low to high; $=sigma(j) /*get sigma for an integer in a range. */
+ if $j then !.a=!.a+1 /*Greater? " " abundant " */
+ else !.p=!.p+1 /*Equal? " " perfect " */
+ end /*j*/ /* [↑] IFs are coded as per likelihood*/
-say ' the number of perfect numbers: ' right(!.p, length(high))
-say ' the number of abundant numbers: ' right(!.a, length(high))
-say ' the number of deficient numbers: ' right(!.d, length(high))
-exit /*stick a fork in it, we're all done. */
-/*────────────────────────────────────────────────────────────────────────────*/
-sigma: procedure; parse arg x; if x<2 then return 0; odd=x//2 /*odd? */
-s=1 /* [↓] only use EVEN or ODD integers.*/
- do j=2+odd by 1+odd while j*jj then !.a=!.a+1 /* " " abundant " */
- else !.p=!.p+1 /* " " perfect " */
- end /*j*/
+/*REXX program counts the number of abundant/deficient/perfect numbers within a range.*/
+parse arg low high . /*obtain optional arguments from the CL*/
+high=word(high low 20000,1); low=word(low 1,1) /*obtain the LOW and HIGH values.*/
+say center('integers from ' low " to " high, 45, "═") /*display a header.*/
+!.=0 /*define all types of sums to zero. */
+ do j=low to high; $=sigma(j) /*get sigma for an integer in a range. */
+ if $j then !.a=!.a+1 /*Greater? " " abundant " */
+ else !.p=!.p+1 /*Equal? " " perfect " */
+ end /*j*/ /* [↑] IFs are coded as per likelihood*/
-say ' the number of perfect numbers: ' right(!.p, length(high))
-say ' the number of abundant numbers: ' right(!.a, length(high))
-say ' the number of deficient numbers: ' right(!.d, length(high))
-exit /*stick a fork in it, we're all done. */
-/*────────────────────────────────────────────────────────────────────────────*/
-iSqrt: procedure; parse arg x; q=1; r=0; do while q<=x; q=q*4; end
- do while q>1; q=q%4; _=x-r-q; r=r%2; if _>=0 then do; x=_; r=r+q; end
- end /*while ···*/
-return r
-/*────────────────────────────────────────────────────────────────────────────*/
-sigma: procedure; parse arg x; if x<5 then return max(0,x-1); sqX=iSqrt(x)
-s=1; odd=x//2 /* [↓] only use EVEN or ODD integers.*/
- do j=2+odd by 1+odd to sqX /*divide by all integers up to √ x */
- if x//j==0 then s=s+j+ x%j /*add the two divisors to (sigma) sum. */
- end /*j*/ /* [↑] % is the REXX integer division*/
- /* [↓] adjust for a square. ___*/
-if sqx*sqx==x then s=s-j /*Was X a square? If so, subtract √ x */
-return s /*return (sigma) sum of the divisors. */
+say ' the number of perfect numbers: ' right(!.p, length(high) )
+say ' the number of abundant numbers: ' right(!.a, length(high) )
+say ' the number of deficient numbers: ' right(!.d, length(high) )
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+sigma: procedure; parse arg x 1 z; if x<5 then return max(0,x-1); odd=x//2 /*is X odd?*/
+ q=1; r=0; do while q<=z; q=q*4; end /* ◄── | compute the integer sqrt of Z*/
+ do while q>1; q=q%4; _=z-r-q; r=r%2; if _>=0 then do; z=_; r=r+q; end
+ end /*while*/ /*upon completion, R is the sqrt of Z*/
+ s=1 /* [↓] only use EVEN | ODD ints. ___*/
+ do j=2+odd by 1+odd to r /*divide by all integers up to √ x */
+ if x//j==0 then s=s+j+ x%j /*add the two divisors to (sigma) sum. */
+ end /*j*/ /* [↑] % is the REXX integer division*/
+ /* [↓] adjust for a square. ___*/
+ if r*r==x then s=s-j /*Was X a square? If so, subtract √ x */
+ return s /*return (sigma) sum of the divisors. */
diff --git a/Task/Abundant,-deficient-and-perfect-number-classifications/ZX-Spectrum-Basic/abundant,-deficient-and-perfect-number-classifications-1.zx b/Task/Abundant,-deficient-and-perfect-number-classifications/ZX-Spectrum-Basic/abundant,-deficient-and-perfect-number-classifications-1.zx
new file mode 100644
index 0000000000..2a71951c20
--- /dev/null
+++ b/Task/Abundant,-deficient-and-perfect-number-classifications/ZX-Spectrum-Basic/abundant,-deficient-and-perfect-number-classifications-1.zx
@@ -0,0 +1,15 @@
+ 10 LET nd=1: LET np=0: LET na=0
+ 20 FOR i=2 TO 20000
+ 30 LET sum=1
+ 40 LET max=i/2
+ 50 LET n=2: LET l=max-1
+ 60 IF n>l THEN GO TO 90
+ 70 IF i/n=INT (i/n) THEN LET sum=sum+n: LET max=i/n: IF max<>n THEN LET sum=sum+max: LET l=max-1
+ 80 LET n=n+1: GO TO 60
+ 90 IF sumj THEN LET sum=sum+j/i
+ 170 NEXT i
+ 180 LET sump=sum
+ 190 RETURN
diff --git a/Task/Accumulator-factory/00DESCRIPTION b/Task/Accumulator-factory/00DESCRIPTION
index 109491ef80..325e7a8880 100644
--- a/Task/Accumulator-factory/00DESCRIPTION
+++ b/Task/Accumulator-factory/00DESCRIPTION
@@ -1,5 +1,9 @@
+{{Omit from|MUMPS|Creating a function implies that there is routine somewhere that has the function stored, and that function could be modified}}
+
A problem posed by [[wp:Paul Graham|Paul Graham]] is that of creating a function that takes a single (numeric) argument and which returns another function that is an accumulator. The returned accumulator function in turn also takes a single numeric argument, and returns the sum of all the numeric values passed in so far to that accumulator (including the initial value passed when the accumulator was created).
+
+;Rules:
The detailed rules are at http://paulgraham.com/accgensub.html and are reproduced here for simplicity (with additions in ''small italic text'').
:Before you submit an example, make sure the function
@@ -14,7 +18,13 @@ x(5);
foo(3);
print x(2.3);
: It should print 8.3. ''(There is no need to print the form of the accumulator function returned by foo(3); it's not part of the task at all.)''
-The purpose of this task is to create a function that implements the described rules. It need not handle any special error cases not described above. The simplest way to implement the task as described is typically to use a [[Closures|closure]], providing the language supports them.
+
+
+;Task:
+Create a function that implements the described rules.
+
+
+It need not handle any special error cases not described above. The simplest way to implement the task as described is typically to use a [[Closures|closure]], providing the language supports them.
Where it is not possible to hold exactly to the constraints above, describe the deviations.
-{{Omit from|MUMPS|Creating a function implies that there is routine somewhere that has the function stored, and that function could be modified}}
+
diff --git a/Task/Accumulator-factory/AppleScript/accumulator-factory.applescript b/Task/Accumulator-factory/AppleScript/accumulator-factory-1.applescript
similarity index 100%
rename from Task/Accumulator-factory/AppleScript/accumulator-factory.applescript
rename to Task/Accumulator-factory/AppleScript/accumulator-factory-1.applescript
diff --git a/Task/Accumulator-factory/AppleScript/accumulator-factory-2.applescript b/Task/Accumulator-factory/AppleScript/accumulator-factory-2.applescript
new file mode 100644
index 0000000000..40c157d51d
--- /dev/null
+++ b/Task/Accumulator-factory/AppleScript/accumulator-factory-2.applescript
@@ -0,0 +1,20 @@
+on run
+
+ set x to foo(1)
+
+ x's lambda(5)
+
+ foo(3)
+
+ x's lambda(2.3)
+
+end run
+
+-- foo :: Int -> Script
+on foo(sum)
+ script
+ on lambda(n)
+ set sum to sum + n
+ end lambda
+ end script
+end foo
diff --git a/Task/Accumulator-factory/Elena/accumulator-factory.elena b/Task/Accumulator-factory/Elena/accumulator-factory.elena
index b843af4afd..43975bcceb 100644
--- a/Task/Accumulator-factory/Elena/accumulator-factory.elena
+++ b/Task/Accumulator-factory/Elena/accumulator-factory.elena
@@ -1,19 +1,22 @@
-#define system.
-#define system'dynamic.
+#import system.
+#import system'dynamic.
#symbol Function =
- (:x) [ self append:x ].
+ (:x) [ this append:x ].
-#symbol Accumulator = (:anInitialValue)
- [ Extension(Function, Variable new:anInitialValue) ].
+#class(extension)op
+{
+ #method accumulator &of:func
+ = Variable new:self mix &into:func.
+}
-#symbol Program =
+#symbol program =
[
- #var x := Accumulator:1.
+ #var x := 1 accumulator &of:Function.
- x:5.
+ x eval:5.
- #var y := Accumulator:3.
+ #var y := 3 accumulator &of:Function.
- console write:(x:2.3r).
+ console write:(x eval:2.3r).
].
diff --git a/Task/Accumulator-factory/Elixir/accumulator-factory-1.elixir b/Task/Accumulator-factory/Elixir/accumulator-factory-1.elixir
new file mode 100644
index 0000000000..eda708be5a
--- /dev/null
+++ b/Task/Accumulator-factory/Elixir/accumulator-factory-1.elixir
@@ -0,0 +1,8 @@
+defmodule AccumulatorFactory do
+ def new(initial) do
+ {:ok, pid} = Agent.start_link(fn() -> initial end)
+ fn (a) ->
+ Agent.get_and_update(pid, fn(old) -> {a + old, a + old} end)
+ end
+ end
+end
diff --git a/Task/Accumulator-factory/Elixir/accumulator-factory-2.elixir b/Task/Accumulator-factory/Elixir/accumulator-factory-2.elixir
new file mode 100644
index 0000000000..5c0d7c2c0b
--- /dev/null
+++ b/Task/Accumulator-factory/Elixir/accumulator-factory-2.elixir
@@ -0,0 +1,11 @@
+defmodule AccumulatorFactoryTest do
+ use ExUnit.Case
+
+ test "Accumulator basic function" do
+ foo = AccumulatorFactory.new(1)
+ foo.(5)
+ bar = AccumulatorFactory.new(3)
+ assert bar.(4) == 7
+ assert foo.(2.3) == 8.3
+ end
+end
diff --git a/Task/Accumulator-factory/Haskell/accumulator-factory.hs b/Task/Accumulator-factory/Haskell/accumulator-factory-1.hs
similarity index 100%
rename from Task/Accumulator-factory/Haskell/accumulator-factory.hs
rename to Task/Accumulator-factory/Haskell/accumulator-factory-1.hs
diff --git a/Task/Accumulator-factory/Haskell/accumulator-factory-2.hs b/Task/Accumulator-factory/Haskell/accumulator-factory-2.hs
new file mode 100644
index 0000000000..eff5451665
--- /dev/null
+++ b/Task/Accumulator-factory/Haskell/accumulator-factory-2.hs
@@ -0,0 +1,2 @@
+accumulator = newSTRef >=> return . factory
+ where factory s n = modifySTRef s (+ n) >> readSTRef s
diff --git a/Task/Accumulator-factory/Io/accumulator-factory.io b/Task/Accumulator-factory/Io/accumulator-factory.io
new file mode 100644
index 0000000000..62a9da602e
--- /dev/null
+++ b/Task/Accumulator-factory/Io/accumulator-factory.io
@@ -0,0 +1,7 @@
+accumulator := method(sum,
+ block(x, sum = sum + x) setIsActivatable(true)
+)
+x := accumulator(1)
+x(5)
+accumulator(3)
+x(2.3) println // --> 8.3000000000000007
diff --git a/Task/Accumulator-factory/PowerShell/accumulator-factory-1.psh b/Task/Accumulator-factory/PowerShell/accumulator-factory-1.psh
new file mode 100644
index 0000000000..9d6b0bc910
--- /dev/null
+++ b/Task/Accumulator-factory/PowerShell/accumulator-factory-1.psh
@@ -0,0 +1,4 @@
+function Get-Accumulator ([double]$Start)
+{
+ {param([double]$Plus) return $script:Start += $Plus}.GetNewClosure()
+}
diff --git a/Task/Accumulator-factory/PowerShell/accumulator-factory-2.psh b/Task/Accumulator-factory/PowerShell/accumulator-factory-2.psh
new file mode 100644
index 0000000000..35ce2c8ca6
--- /dev/null
+++ b/Task/Accumulator-factory/PowerShell/accumulator-factory-2.psh
@@ -0,0 +1,3 @@
+$total = Get-Accumulator -Start 1
+& $total -Plus 5.0 | Out-Null
+& $total -Plus 2.3
diff --git a/Task/Accumulator-factory/REXX/accumulator-factory.rexx b/Task/Accumulator-factory/REXX/accumulator-factory.rexx
index 4256c1ca7a..adccf861cc 100644
--- a/Task/Accumulator-factory/REXX/accumulator-factory.rexx
+++ b/Task/Accumulator-factory/REXX/accumulator-factory.rexx
@@ -1,13 +1,13 @@
-/*REXX pgm: acculation factory copied/modeled after the ooRexx program. */
-x=.accumulator(new(1)) /*set accumulater with init val 1*/
+/*REXX program shows one method an accumulator factory could be implemented. */
+x=.accumulator(1) /*initialize accumulator with a 1 value*/
x=call(5)
x=call(2.3)
-say " X value is now" x /*displays current value of X. */
-say "Accumulator value is now" sum /*displays current value of accum*/
-exit /*stick a fork in it, we're done.*/
-/*──────────────────────────────────subroutines─────────────────────────*/
-.accumulator: procedure expose sum
- if symbol('SUM')=='LIT' then sum=0; sum=sum+arg(1)
+say ' X value is now' x /*displays the current value of X. */
+say 'Accumulator value is now' sum /*displays the current value of accum.*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+.accumulator: procedure expose sum; if symbol('SUM')=="LIT" then sum=0 /*1st time?*/
+ sum=sum + arg(1) /*add──►sum*/
return sum
-call: procedure expose sum; sum=sum+arg(1); return sum /*adds arg1──►sum*/
-new: procedure; return arg(1) /*long way 'round of using one. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+call: procedure expose sum; sum=sum+arg(1); return sum /*add arg1 ──► sum.*/
diff --git a/Task/Accumulator-factory/TXR/accumulator-factory-1.txr b/Task/Accumulator-factory/TXR/accumulator-factory-1.txr
index f0d126467c..661e6eb35c 100644
--- a/Task/Accumulator-factory/TXR/accumulator-factory-1.txr
+++ b/Task/Accumulator-factory/TXR/accumulator-factory-1.txr
@@ -4,6 +4,6 @@
;; test
(for ((f (accumulate 0)) num)
- ((set num (read : : nil)))
+ ((set num (iread : : nil)))
((format t "~s -> ~s\n" num [f num])))
(exit 0)
diff --git a/Task/Accumulator-factory/TXR/accumulator-factory-2.txr b/Task/Accumulator-factory/TXR/accumulator-factory-2.txr
index c4a9dd7dec..3e8bc7595e 100644
--- a/Task/Accumulator-factory/TXR/accumulator-factory-2.txr
+++ b/Task/Accumulator-factory/TXR/accumulator-factory-2.txr
@@ -1,2 +1,2 @@
(let ((f (let ((sum 0)) (do inc sum @1))))
- (mapdo (do put-line `@1 -> @[f @1]`) (gun (read : : nil))))
+ (mapdo (do put-line `@1 -> @[f @1]`) (gun (iread : : nil))))
diff --git a/Task/Accumulator-factory/TXR/accumulator-factory-3.txr b/Task/Accumulator-factory/TXR/accumulator-factory-3.txr
index 42a895e00d..6caa1456df 100644
--- a/Task/Accumulator-factory/TXR/accumulator-factory-3.txr
+++ b/Task/Accumulator-factory/TXR/accumulator-factory-3.txr
@@ -4,4 +4,4 @@
((inc sum (yield-from accum sum)))))
(let ((f (obtain (accum))))
- (mapdo (do put-line `@1 -> @[f @1]`) (gun (read : : nil))))
+ (mapdo (do put-line `@1 -> @[f @1]`) (gun (iread : : nil))))
diff --git a/Task/Accumulator-factory/TXR/accumulator-factory-4.txr b/Task/Accumulator-factory/TXR/accumulator-factory-4.txr
new file mode 100644
index 0000000000..a40ce0f52b
--- /dev/null
+++ b/Task/Accumulator-factory/TXR/accumulator-factory-4.txr
@@ -0,0 +1,10 @@
+(defstruct (accum count) nil
+ (count 0))
+
+(defmeth accum lambda (self delta)
+ (inc self.count delta))
+
+;; Identical test code to Yield-Based and Sugared, except for
+;; the construction of the function object bound to variable f.
+(let ((f (new (accum 0))))
+ (mapdo (do put-line `@1 -> @[f @1]`) (gun (iread : : nil))))
diff --git a/Task/Ackermann-function/00DESCRIPTION b/Task/Ackermann-function/00DESCRIPTION
index 5a999940ce..cbf33306bc 100644
--- a/Task/Ackermann-function/00DESCRIPTION
+++ b/Task/Ackermann-function/00DESCRIPTION
@@ -1,7 +1,9 @@
-The '''[[wp:Ackermann function|Ackermann function]]''' is a classic example of a recursive function, notable especially because it is not a [[wp:Primitive_recursive_function|primitive recursive function]]. It grows very quickly in value, as does the size of its call tree.
+The '''[[wp:Ackermann function|Ackermann function]]''' is a classic example of a recursive function, notable especially because it is not a [[wp:Primitive_recursive_function|primitive recursive function]]. It grows very quickly in value, as does the size of its call tree.
+
The Ackermann function is usually defined as follows:
+
:
+
+
Its arguments are never negative and it always terminates. Write a function which returns the value of . Arbitrary precision is preferred (since the function grows so quickly), but not required.
+
;See also:
* [[wp:Conway_chained_arrow_notation#Ackermann_function|Conway chained arrow notation]] for the Ackermann function.
+
diff --git a/Task/Ackermann-function/AppleScript/ackermann-function.applescript b/Task/Ackermann-function/AppleScript/ackermann-function.applescript
index 21cc254552..40e28fb6ab 100644
--- a/Task/Ackermann-function/AppleScript/ackermann-function.applescript
+++ b/Task/Ackermann-function/AppleScript/ackermann-function.applescript
@@ -1,5 +1,5 @@
on ackermann(m, n)
- if m is equal to 0 then return n + 1
- if n is equal to 0 then return ackermann(m - 1, 1)
- return ackermann(m - 1, ackermann(m, n - 1))
+ if m is equal to 0 then return n + 1
+ if n is equal to 0 then return ackermann(m - 1, 1)
+ return ackermann(m - 1, ackermann(m, n - 1))
end ackermann
diff --git a/Task/Ackermann-function/Coq/ackermann-function.coq b/Task/Ackermann-function/Coq/ackermann-function-1.coq
similarity index 100%
rename from Task/Ackermann-function/Coq/ackermann-function.coq
rename to Task/Ackermann-function/Coq/ackermann-function-1.coq
diff --git a/Task/Ackermann-function/Coq/ackermann-function-2.coq b/Task/Ackermann-function/Coq/ackermann-function-2.coq
new file mode 100644
index 0000000000..dbba33f6a2
--- /dev/null
+++ b/Task/Ackermann-function/Coq/ackermann-function-2.coq
@@ -0,0 +1,13 @@
+Require Import Utf8.
+
+Section FOLD.
+ Context {A: Type} (f: A → A) (a: A).
+ Fixpoint fold (n: nat) : A :=
+ match n with
+ | O => a
+ | S n' => f (fold n')
+ end.
+End FOLD.
+
+Definition ackermann : nat → nat → nat :=
+ fold (λ g, fold g (g (S O))) S.
diff --git a/Task/Ackermann-function/Elena/ackermann-function.elena b/Task/Ackermann-function/Elena/ackermann-function.elena
index 6ceae5c6ee..7c06aeb159 100644
--- a/Task/Ackermann-function/Elena/ackermann-function.elena
+++ b/Task/Ackermann-function/Elena/ackermann-function.elena
@@ -8,8 +8,8 @@
m =>
0 ? [ n + 1 ]
> 0 ? [
- n => 0 ? [ ackermann:(m - 1):1 ]
- > 0 ? [ ackermann:(m - 1):(ackermann:m:(n-1)) ]
+ n => 0 ? [ ackermann eval:(m - 1):1 ]
+ > 0 ? [ ackermann eval:(m - 1):(ackermann eval:m:(n-1)) ]
]
].
@@ -19,7 +19,7 @@
[
0 to:5 &doEach: (:j)
[
- console writeLine:"A(":i:",":j:")=":(ackermann:i:j).
+ console writeLine:"A(":i:",":j:")=":(ackermann eval:i:j).
].
].
diff --git a/Task/Ackermann-function/Go/ackermann-function-1.go b/Task/Ackermann-function/Go/ackermann-function-1.go
index ea2c7a2614..486ad4b8bb 100644
--- a/Task/Ackermann-function/Go/ackermann-function-1.go
+++ b/Task/Ackermann-function/Go/ackermann-function-1.go
@@ -1,9 +1,9 @@
func Ackermann(m, n uint) uint {
- switch {
- case m == 0:
- return n + 1
- case n == 0:
- return Ackermann(m - 1, 1)
- }
- return Ackermann(m - 1, Ackermann(m, n - 1))
+ switch 0 {
+ case m:
+ return n + 1
+ case n:
+ return Ackermann(m - 1, 1)
+ }
+ return Ackermann(m - 1, Ackermann(m, n - 1))
}
diff --git a/Task/Ackermann-function/Haskell/ackermann-function-2.hs b/Task/Ackermann-function/Haskell/ackermann-function-2.hs
index 25b4cbf489..7997efa8f8 100644
--- a/Task/Ackermann-function/Haskell/ackermann-function-2.hs
+++ b/Task/Ackermann-function/Haskell/ackermann-function-2.hs
@@ -1,9 +1,10 @@
+import Data.List (mapAccumL)
+
-- everything here are [Int] or [[Int]], which would overflow
-- * had it not overrun the stack first *
ackermann = iterate ack [1..] where
ack a = s where
- s = a!!1 : f (tail a) (zipWith (-) s (1:s))
- f a (b:bs) = (head aa) : f aa bs where
- aa = drop b a
+ s = snd $ mapAccumL f (tail a) (1 : zipWith (-) s (1:s))
+ f a b = (aa, head aa) where aa = drop b a
main = mapM_ print $ map (\n -> take (6 - n) $ ackermann !! n) [0..5]
diff --git a/Task/Ackermann-function/Kotlin/ackermann-function.kotlin b/Task/Ackermann-function/Kotlin/ackermann-function.kotlin
index 02dc8f33d6..77317662c4 100644
--- a/Task/Ackermann-function/Kotlin/ackermann-function.kotlin
+++ b/Task/Ackermann-function/Kotlin/ackermann-function.kotlin
@@ -15,17 +15,17 @@ fun main(args: Array) {
val N: Long = 20
val r = 0..N
for (m in 0..M) {
- print("\nA(%d, %s) =".format(m, r))
+ print("\nA($m, $r) =")
var able = true
- r forEach {
+ r.forEach {
try {
if (able) {
val a = A(m, it)
print(" %6d".format(a))
} else
- print(" %6s".format("?"))
+ print(" ?")
} catch(e: Throwable) {
- print(" %6s".format("?"))
+ print(" ?")
able = false
}
}
diff --git a/Task/Ackermann-function/PowerShell/ackermann-function-3.psh b/Task/Ackermann-function/PowerShell/ackermann-function-3.psh
new file mode 100644
index 0000000000..cb92013c7d
--- /dev/null
+++ b/Task/Ackermann-function/PowerShell/ackermann-function-3.psh
@@ -0,0 +1,14 @@
+function Get-Ackermann ([int64]$m, [int64]$n)
+{
+ if ($m -eq 0)
+ {
+ return $n + 1
+ }
+
+ if ($n -eq 0)
+ {
+ return Get-Ackermann ($m - 1) 1
+ }
+
+ return (Get-Ackermann ($m - 1) (Get-Ackermann $m ($n - 1)))
+}
diff --git a/Task/Ackermann-function/PowerShell/ackermann-function-4.psh b/Task/Ackermann-function/PowerShell/ackermann-function-4.psh
new file mode 100644
index 0000000000..c43df1d52a
--- /dev/null
+++ b/Task/Ackermann-function/PowerShell/ackermann-function-4.psh
@@ -0,0 +1,3 @@
+$ackermann = 0..3 | ForEach-Object {$m = $_; 0..6 | ForEach-Object {Get-Ackermann $m $_}}
+
+$ackermann | Format-Wide {"{0,3}" -f $_} -Column 7 -Force
diff --git a/Task/Ackermann-function/REXX/ackermann-function-1.rexx b/Task/Ackermann-function/REXX/ackermann-function-1.rexx
index 84ebc21c4f..4166968a81 100644
--- a/Task/Ackermann-function/REXX/ackermann-function-1.rexx
+++ b/Task/Ackermann-function/REXX/ackermann-function-1.rexx
@@ -1,25 +1,25 @@
-/*REXX program calculates and displays some values for the Ackermann function.*/
-/* ╔════════════════════════════════════════════════════════════════════════╗
- ║ Note: the Ackermann function (as implemented here) utilizes deep ║
- ║ recursive and is limited by the largest number that can have ║
- ║ "1" (unity) added to a number (successfully and accurately). ║
- ╚════════════════════════════════════════════════════════════════════════╝ */
+/*REXX program calculates and displays some values for the Ackermann function. */
+ /*╔════════════════════════════════════════════════════════════════════════╗
+ ║ Note: the Ackermann function (as implemented here) utilizes deep ║
+ ║ recursive and is limited by the largest number that can have ║
+ ║ "1" (unity) added to a number (successfully and accurately). ║
+ ╚════════════════════════════════════════════════════════════════════════╝*/
high=24
- do j=0 to 3; say
- do k=0 to high%(max(1,j))
- call Ackermann_tell j,k
+ do j=0 to 3; say
+ do k=0 to high % (max(1, j))
+ call tell_Ack j, k
end /*k*/
end /*j*/
-exit /*stick a fork in it, we're all done. */
-/*──────────────────────────────────ACKERMANN_TELL subroutine─────────────────*/
-ackermann_tell: parse arg mm,nn; calls=0 /*display an echo message. */
-#=right(nn,length(high))
-say 'Ackermann('mm","#')='right(ackermann(mm,nn),high),
- left('',12) 'calls='right(calls,high)
-return
-/*──────────────────────────────────ACKERMANN subroutine──────────────────────*/
-ackermann: procedure expose calls /*compute value of Ackermann function.*/
-parse arg m,n; calls=calls+1
-if m==0 then return n+1
-if n==0 then return ackermann(m-1,1)
- return ackermann(m-1,ackermann(m,n-1))
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+tell_Ack: parse arg mm,nn; calls=0 /*display an echo message to terminal. */
+ #=right(nn,length(high))
+ say 'Ackermann('mm", "#')='right(ackermann(mm, nn), high),
+ left('', 12) 'calls='right(calls, high)
+ return
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+ackermann: procedure expose calls /*compute value of Ackermann function. */
+ parse arg m,n; calls=calls+1
+ if m==0 then return n+1
+ if n==0 then return ackermann(m-1, 1)
+ return ackermann(m-1, ackermann(m, n-1) )
diff --git a/Task/Ackermann-function/REXX/ackermann-function-2.rexx b/Task/Ackermann-function/REXX/ackermann-function-2.rexx
index 0ff1d7ddc5..d489d6c82a 100644
--- a/Task/Ackermann-function/REXX/ackermann-function-2.rexx
+++ b/Task/Ackermann-function/REXX/ackermann-function-2.rexx
@@ -1,21 +1,21 @@
-/*REXX program calculates and displays some values for the Ackermann function.*/
+/*REXX program calculates and displays some values for the Ackermann function. */
high=24
- do j=0 to 3; say
- do k=0 to high%(max(1,j))
- call Ackermann_tell j,k
+ do j=0 to 3; say
+ do k=0 to high % (max(1, j))
+ call tell_Ack j, k
end /*k*/
end /*j*/
-exit /*stick a fork in it, we're all done. */
-/*──────────────────────────────────ACKERMANN_TELL subroutine─────────────────*/
-ackermann_tell: parse arg mm,nn; calls=0 /*display an echo message.*/
-#=right(nn,length(high))
-say 'Ackermann('mm","#')='right(ackermann(mm,nn),high),
- left('',12) 'calls='right(calls,high)
-return
-/*──────────────────────────────────ACKERMANN subroutine──────────────────────*/
-ackermann: procedure expose calls /*compute value of Ackermann function.*/
-parse arg m,n; calls=calls+1
-if m==0 then return n+1
-if n==0 then return ackermann(m-1,1)
-if m==2 then return n*2+3
- return ackermann(m-1,ackermann(m,n-1))
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+tell_Ack: parse arg mm,nn; calls=0 /*display an echo message to terminal. */
+ #=right(nn,length(high))
+ say 'Ackermann('mm", "#')='right(ackermann(mm, nn), high),
+ left('', 12) 'calls='right(calls, high)
+ return
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+ackermann: procedure expose calls /*compute value of Ackermann function. */
+ parse arg m,n; calls=calls+1
+ if m==0 then return n + 1
+ if n==0 then return ackermann(m-1, 1)
+ if m==2 then return n + 3 + n
+ return ackermann(m-1, ackermann(m, n-1) )
diff --git a/Task/Ackermann-function/REXX/ackermann-function-3.rexx b/Task/Ackermann-function/REXX/ackermann-function-3.rexx
index 10d1b991c7..46a20892d0 100644
--- a/Task/Ackermann-function/REXX/ackermann-function-3.rexx
+++ b/Task/Ackermann-function/REXX/ackermann-function-3.rexx
@@ -1,36 +1,36 @@
-/*REXX program calculates and displays some values for the Ackermann function.*/
+/*REXX program calculates and displays some values for the Ackermann function. */
+numeric digits 100 /*use up to 100 decimal digit integers.*/
+ /*╔═════════════════════════════════════════════════════════════╗
+ ║ When REXX raises a number to an integer power (via the ** ║
+ ║ operator, the power can be positive, zero, or negative). ║
+ ║ Ackermann(5,1) is a bit impractical to calculate. ║
+ ╚═════════════════════════════════════════════════════════════╝*/
high=24
-numeric digits 100 /*have REXX to use up to 100 digit integers.*/
-
- /*When REXX raises a number to a power (via */
- /* the ** operator), the power must be an */
- /* integer (positive, zero, or negative). */
-
- do j=0 to 4; say /*Ackermann(5,1) is a bit impractical to calc.*/
- do k=0 to high%(max(1,j))
- call Ackermann_tell j,k
- if j==4 & k==2 then leave /*there's no sense in going overboard. */
- end /*k*/
- end /*j*/
-exit /*stick a fork in it, we're all done. */
-/*──────────────────────────────────ACKERMANN_TELL subroutine─────────────────*/
-ackermann_tell: parse arg mm,nn; calls=0 /*display an echo message.*/
-#=right(nn,length(high))
-say 'Ackermann('mm","#')='right(ackermann(mm,nn),high),
- left('',12) 'calls='right(calls,high)
-return
-/*──────────────────────────────────ACKERMANN subroutine──────────────────────*/
-ackermann: procedure expose calls /*compute value of Ackermann function.*/
-parse arg m,n; calls=calls+1
-if m==0 then return n+1
-if m==1 then return n+2
-if m==2 then return n+n+3
-if m==3 then return 2**(n+3)-3
-if m==4 then do; a=2 /* [↓] Ugh! ··· and more ughs. */
- do (n+3)-1 /*This is where the heavy lifting is. */
- a=2**a
- end
- return a-3
- end
-if n==0 then return ackermann(m-1,1)
- return ackermann(m-1,ackermann(m,n-1))
+ do j=0 to 4; say
+ do k=0 to high % (max(1, j))
+ call tell_Ack j, k
+ if j==4 & k==2 then leave /*there's no sense in going overboard. */
+ end /*k*/
+ end /*j*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+tell_Ack: parse arg mm,nn; calls=0 /*display an echo message to terminal. */
+ #=right(nn,length(high))
+ say 'Ackermann('mm", "#')='right(ackermann(mm, nn), high),
+ left('', 12) 'calls='right(calls, high)
+ return
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+ackermann: procedure expose calls /*compute value of Ackermann function. */
+ parse arg m,n; calls=calls+1
+ if m==0 then return n + 1
+ if m==1 then return n + 2
+ if m==2 then return n + 3 + n
+ if m==3 then return 2**(n+3) - 3
+ if m==4 then do; #=2 /* [↓] Ugh! ··· and still more ughs.*/
+ do (n+3)-1 /*This is where the heavy lifting is. */
+ #=2**#
+ end
+ return #-3
+ end
+ if n==0 then return ackermann(m-1, 1)
+ return ackermann(m-1, ackermann(m, n-1) )
diff --git a/Task/Ackermann-function/Run-BASIC/ackermann-function.run b/Task/Ackermann-function/Run-BASIC/ackermann-function.run
index 7d958974f8..f7f68df222 100644
--- a/Task/Ackermann-function/Run-BASIC/ackermann-function.run
+++ b/Task/Ackermann-function/Run-BASIC/ackermann-function.run
@@ -1,9 +1,7 @@
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/ZX-Spectrum-Basic/ackermann-function.zx b/Task/Ackermann-function/ZX-Spectrum-Basic/ackermann-function.zx
new file mode 100644
index 0000000000..0c635f5323
--- /dev/null
+++ b/Task/Ackermann-function/ZX-Spectrum-Basic/ackermann-function.zx
@@ -0,0 +1,19 @@
+10 DIM s(2000,3)
+20 LET s(1,1)=3: REM M
+30 LET s(1,2)=7: REM N
+40 LET lev=1
+50 GO SUB 100
+60 PRINT "A(";s(1,1);",";s(1,2);") = ";s(1,3)
+70 STOP
+100 IF s(lev,1)=0 THEN LET s(lev,3)=s(lev,2)+1: RETURN
+110 IF s(lev,2)=0 THEN LET lev=lev+1: LET s(lev,1)=s(lev-1,1)-1: LET s(lev,2)=1: GO SUB 100: LET s(lev-1,3)=s(lev,3): LET lev=lev-1: RETURN
+120 LET lev=lev+1
+130 LET s(lev,1)=s(lev-1,1)
+140 LET s(lev,2)=s(lev-1,2)-1
+150 GO SUB 100
+160 LET s(lev,1)=s(lev-1,1)-1
+170 LET s(lev,2)=s(lev,3)
+180 GO SUB 100
+190 LET s(lev-1,3)=s(lev,3)
+200 LET lev=lev-1
+210 RETURN
diff --git a/Task/Active-Directory-Search-for-a-user/Eiffel/active-directory-search-for-a-user-1.e b/Task/Active-Directory-Search-for-a-user/Eiffel/active-directory-search-for-a-user-1.e
new file mode 100644
index 0000000000..a83aa4dbb5
--- /dev/null
+++ b/Task/Active-Directory-Search-for-a-user/Eiffel/active-directory-search-for-a-user-1.e
@@ -0,0 +1,12 @@
+feature -- Validation
+
+ is_user_credential_valid (a_domain, a_username, a_password: READABLE_STRING_GENERAL): BOOLEAN
+ -- Is the pair `a_username'/`a_password' a valid credential in `a_domain'?
+ local
+ l_domain, l_username, l_password: WEL_STRING
+ do
+ create l_domain.make (a_domain)
+ create l_username.make (a_username)
+ create l_password.make (a_password)
+ Result := cwel_is_credential_valid (l_domain.item, l_username.item, l_password.item)
+ end
diff --git a/Task/Active-Directory-Search-for-a-user/Eiffel/active-directory-search-for-a-user-2.e b/Task/Active-Directory-Search-for-a-user/Eiffel/active-directory-search-for-a-user-2.e
new file mode 100644
index 0000000000..43fa6dc36e
--- /dev/null
+++ b/Task/Active-Directory-Search-for-a-user/Eiffel/active-directory-search-for-a-user-2.e
@@ -0,0 +1,6 @@
+ cwel_is_credential_valid (a_domain, a_username, a_password: POINTER): BOOLEAN
+ external
+ "C inline use %"wel_user_validation.h%""
+ alias
+ "return cwel_is_credential_valid ((LPTSTR) $a_domain, (LPTSTR) $a_username, (LPTSTR) $a_password);"
+ end
diff --git a/Task/Active-object/SuperCollider/active-object.supercollider b/Task/Active-object/SuperCollider/active-object.supercollider
new file mode 100644
index 0000000000..6de4ba0a4f
--- /dev/null
+++ b/Task/Active-object/SuperCollider/active-object.supercollider
@@ -0,0 +1,31 @@
+(
+a = TaskProxy { |envir|
+ envir.use {
+ ~integral = 0;
+ ~time = 0;
+ ~prev = 0;
+ ~running = true;
+ loop {
+ ~val = ~input.(~time);
+ ~integral = ~integral + (~val + ~prev * ~dt / 2);
+ ~prev = ~val;
+ ~time = ~time + ~dt;
+ ~dt.wait;
+ }
+ }
+};
+)
+
+// run the test
+(
+fork {
+ a.set(\dt, 0.0001);
+ a.set(\input, { |t| sin(2pi * 0.5 * t) });
+ a.play(quant: 0); // play immediately
+ 2.wait;
+ a.set(\input, 0);
+ 0.5.wait;
+ a.stop;
+ a.get(\integral).postln; // answers -7.0263424372343e-15
+}
+)
diff --git a/Task/Add-a-variable-to-a-class-instance-at-runtime/Forth/add-a-variable-to-a-class-instance-at-runtime.fth b/Task/Add-a-variable-to-a-class-instance-at-runtime/Forth/add-a-variable-to-a-class-instance-at-runtime.fth
index c4694a3439..6804a35c5a 100644
--- a/Task/Add-a-variable-to-a-class-instance-at-runtime/Forth/add-a-variable-to-a-class-instance-at-runtime.fth
+++ b/Task/Add-a-variable-to-a-class-instance-at-runtime/Forth/add-a-variable-to-a-class-instance-at-runtime.fth
@@ -2,9 +2,9 @@ include FMS-SI.f
include FMS-SILib.f
-\ FMS doesn't have the ability to add instance variables
-\ or methods at run time. But it is very simple to add any number of
-\ objects of any type to a single object at run time. The added
+
+\ We can add any number of variables at runtime by adding
+\ objects of any type to an instance at run time. The added
\ objects are then accessible via an index number.
:class foo
diff --git a/Task/Address-of-a-variable/00DESCRIPTION b/Task/Address-of-a-variable/00DESCRIPTION
index a6bdb20480..15dcd8d07a 100644
--- a/Task/Address-of-a-variable/00DESCRIPTION
+++ b/Task/Address-of-a-variable/00DESCRIPTION
@@ -1,4 +1,5 @@
{{basic data operation}}
-Demonstrate how to get the address of a variable
-and how to set the address of a variable.
+;Task:
+Demonstrate how to get the address of a variable and how to set the address of a variable.
+
diff --git a/Task/Address-of-a-variable/360-Assembly/address-of-a-variable-1.360 b/Task/Address-of-a-variable/360-Assembly/address-of-a-variable-1.360
new file mode 100644
index 0000000000..6d02f8a6ca
--- /dev/null
+++ b/Task/Address-of-a-variable/360-Assembly/address-of-a-variable-1.360
@@ -0,0 +1,3 @@
+ LA R3,I load address of I
+...
+I DS F
diff --git a/Task/Address-of-a-variable/360-Assembly/address-of-a-variable-2.360 b/Task/Address-of-a-variable/360-Assembly/address-of-a-variable-2.360
new file mode 100644
index 0000000000..05d2f85795
--- /dev/null
+++ b/Task/Address-of-a-variable/360-Assembly/address-of-a-variable-2.360
@@ -0,0 +1,7 @@
+ USING MYDSECT,R12
+ LA R12,I set @J=@I
+ L R2,J now J is at the same location as I
+...
+I DS F
+MYDSECT DSECT
+J DS F
diff --git a/Task/Address-of-a-variable/Maple/address-of-a-variable-1.maple b/Task/Address-of-a-variable/Maple/address-of-a-variable-1.maple
new file mode 100644
index 0000000000..99b49375f3
--- /dev/null
+++ b/Task/Address-of-a-variable/Maple/address-of-a-variable-1.maple
@@ -0,0 +1,2 @@
+> addressof( x );
+ 18446884674469911422
diff --git a/Task/Address-of-a-variable/Maple/address-of-a-variable-2.maple b/Task/Address-of-a-variable/Maple/address-of-a-variable-2.maple
new file mode 100644
index 0000000000..be2c83587a
--- /dev/null
+++ b/Task/Address-of-a-variable/Maple/address-of-a-variable-2.maple
@@ -0,0 +1,2 @@
+> pointto( 18446884674469911422 );
+ x
diff --git a/Task/Address-of-a-variable/Maple/address-of-a-variable-3.maple b/Task/Address-of-a-variable/Maple/address-of-a-variable-3.maple
new file mode 100644
index 0000000000..35c5e6631a
--- /dev/null
+++ b/Task/Address-of-a-variable/Maple/address-of-a-variable-3.maple
@@ -0,0 +1,6 @@
+> addressof( sin( x )^2 + cos( x )^2 );
+ 18446884674469972158
+
+> pointto( 18446884674469972158 );
+ 2 2
+ sin(x) + cos(x)
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
index 31927677c1..75649c90a4 100644
--- 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
@@ -1 +1,9 @@
-my $x; say $x.WHERE;
+my $x;
+say $x.WHERE;
+
+my $y := $x; # alias
+say $y.WHERE; # same address as $x
+
+say "Same variable" if $y =:= $x;
+$x = 42;
+say $y; # 42
diff --git a/Task/Address-of-a-variable/VBA/address-of-a-variable.vba b/Task/Address-of-a-variable/VBA/address-of-a-variable.vba
new file mode 100644
index 0000000000..95d1877ffb
--- /dev/null
+++ b/Task/Address-of-a-variable/VBA/address-of-a-variable.vba
@@ -0,0 +1,24 @@
+Option Explicit
+Declare Sub GetMem1 Lib "msvbvm60" (ByVal ptr As Long, ByRef x As Byte)
+Declare Sub GetMem2 Lib "msvbvm60" (ByVal ptr As Long, ByRef x As Integer)
+Declare Sub GetMem4 Lib "msvbvm60" (ByVal ptr As Long, ByRef x As Long)
+Declare Sub PutMem1 Lib "msvbvm60" (ByVal ptr As Long, ByVal x As Byte)
+Declare Sub PutMem2 Lib "msvbvm60" (ByVal ptr As Long, ByVal x As Integer)
+Declare Sub PutMem4 Lib "msvbvm60" (ByVal ptr As Long, ByVal x As Long)
+
+Sub Test()
+ Dim a As Long, ptr As Long, s As Long
+ a = 12345678
+
+ 'Get and print address
+ ptr = VarPtr(a)
+ Debug.Print ptr
+
+ 'Peek
+ Call GetMem4(ptr, s)
+ Debug.Print s
+
+ 'Poke
+ Call PutMem4(ptr, 87654321)
+ Debug.Print a
+End Sub
diff --git a/Task/Address-of-a-variable/X86-Assembly/address-of-a-variable-1.x86 b/Task/Address-of-a-variable/X86-Assembly/address-of-a-variable-1.x86
new file mode 100644
index 0000000000..f913bf03d9
--- /dev/null
+++ b/Task/Address-of-a-variable/X86-Assembly/address-of-a-variable-1.x86
@@ -0,0 +1 @@
+ movl my_variable, %eax
diff --git a/Task/Address-of-a-variable/X86-Assembly/address-of-a-variable-2.x86 b/Task/Address-of-a-variable/X86-Assembly/address-of-a-variable-2.x86
new file mode 100644
index 0000000000..bcad0d4965
--- /dev/null
+++ b/Task/Address-of-a-variable/X86-Assembly/address-of-a-variable-2.x86
@@ -0,0 +1,7 @@
+ call eip_to_eax
+ addl $_GLOBAL_OFFSET_TABLE_, %eax
+ movl my_variable@GOT(%eax), %eax
+ ...
+eip_to_eax:
+ movl (%esp), %eax
+ ret
diff --git a/Task/Align-columns/AWK/align-columns.awk b/Task/Align-columns/AWK/align-columns.awk
index c4a5961ec0..ef392b6e0c 100644
--- a/Task/Align-columns/AWK/align-columns.awk
+++ b/Task/Align-columns/AWK/align-columns.awk
@@ -1,34 +1,41 @@
+# syntax: GAWK -f ALIGN_COLUMNS.AWK ALIGN_COLUMNS.TXT
BEGIN {
- FS="$"
- lcounter = 1
- maxfield = 0
- # justification; pick one
- #justify = "left"
- justify = "center"
- #justify = "right"
+ colsep = " " # separator between columns
+ report("raw data")
}
-{
- if ( NF > maxfield ) maxfield = NF;
- for(i=1; i <= NF; i++) {
- line[lcounter,i] = $i
- if ( longest[i] == "" ) longest[i] = 0;
- if ( length($i) > longest[i] ) longest[i] = length($i);
- }
- lcounter++
+{ printf("%s\n",$0)
+ arr[NR] = $0
+ n = split($0,tmp_arr,"$")
+ for (j=1; j<=n; j++) {
+ width = max(width,length(tmp_arr[j]))
+ }
}
END {
- just = (justify == "left") ? "-" : ""
- for(i=1; i <= NR; i++) {
- for(j=1; j <= maxfield; j++) {
- if ( justify != "center" ) {
- template = "%" just longest[j] "s "
- } else {
- v = int((longest[j] - length(line[i,j]))/2)
- rt = "%" v+1 "s%%-%ds"
- template = sprintf(rt, "", longest[j] - v)
- }
- printf(template, line[i,j])
- }
- print ""
- }
+ report("left justified")
+ report("right justified")
+ report("center justified")
+ exit(0)
}
+function report(text, diff,i,j,l,n,r,tmp_arr) {
+ printf("\nreport: %s\n",text)
+ for (i=1; i<=NR; i++) {
+ n = split(arr[i],tmp_arr,"$")
+ if (tmp_arr[n] == "") { n-- }
+ for (j=1; j<=n; j++) {
+ if (text ~ /^[Ll]/) { # left
+ printf("%-*s%s",width,tmp_arr[j],colsep)
+ }
+ else if (text ~ /^[Rr]/) { # right
+ printf("%*s%s",width,tmp_arr[j],colsep)
+ }
+ else if (text ~ /^[Cc]/) { # center
+ diff = width - length(tmp_arr[j])
+ l = r = int(diff / 2)
+ if (diff != l + r) { r++ }
+ printf("%*s%s%*s%s",l,"",tmp_arr[j],r,"",colsep)
+ }
+ }
+ printf("\n")
+ }
+}
+function max(x,y) { return((x > y) ? x : y) }
diff --git a/Task/Align-columns/Aime/align-columns.aime b/Task/Align-columns/Aime/align-columns.aime
new file mode 100644
index 0000000000..66d07bdeed
--- /dev/null
+++ b/Task/Align-columns/Aime/align-columns.aime
@@ -0,0 +1,55 @@
+data b;
+file f;
+list c, r, s;
+integer a, i, j, k, m, w;
+
+b_cast(b, "Given$a$text$file$of$many$lines,$where$fields$within$a$line$\n"
+ "are$delineated$by$a$single$'dollar'$character,$write$a$program\n"
+ "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$\n"
+ "column$are$separated$by$at$least$one$space.\n"
+ "Further,$allow$for$each$word$in$a$column$to$be$either$left$\n"
+ "justified,$right$justified,$or$center$justified$within$its$column.");
+
+f_b_affix(f, b);
+
+m = 0;
+
+while (f_news(f, r, 0, 0, "$") ^ -1) {
+ l_append(c, r);
+ m = max(m, l_length(r));
+}
+
+i = 0;
+while (i < m) {
+ w = 0;
+ j = 0;
+ while (j < l_length(c)) {
+ r = c[j];
+ if (i < l_length(r)) {
+ w = max(w, length(r[i]));
+ }
+ j += 1;
+ }
+ l_append(s, w + 1);
+ i += 1;
+}
+
+k = 3;
+while (k) {
+ k -= 1;
+ o_plan(l_effect("right", "center", "left")[k], " justified", "\n");
+ j = 0;
+ while (j < l_length(c)) {
+ i = 0;
+ r = c[j];
+ while (i < l_length(r)) {
+ w = s[i];
+ m = w - length(r[i]);
+ o_form("/w~3/~/w~1/", a = k * m >> 1, "", m - a, "", r[i]);
+ i += 1;
+ }
+ o_newline();
+ j += 1;
+ }
+ o_newline();
+}
diff --git a/Task/Align-columns/AppleScript/align-columns.applescript b/Task/Align-columns/AppleScript/align-columns.applescript
new file mode 100644
index 0000000000..4b9c3d3d06
--- /dev/null
+++ b/Task/Align-columns/AppleScript/align-columns.applescript
@@ -0,0 +1,216 @@
+property pstrLines : ¬
+ "Given$a$text$file$of$many$lines,$where$fields$within$a$line$\n" & ¬
+ "are$delineated$by$a$single$'dollar'$character,$write$a$program\n" & ¬
+ "that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$\n" & ¬
+ "column$are$separated$by$at$least$one$space.\n" & ¬
+ "Further,$allow$for$each$word$in$a$column$to$be$either$left$\n" & ¬
+ "justified,$right$justified,$or$center$justified$within$its$column."
+
+property eLeft : -1
+property eCenter : 0
+property eRight : 1
+
+on run
+ set lstCols to lineColumns("$", pstrLines)
+
+ script testAlignment
+ on lambda(eAlign)
+ columnsAligned(eAlign, lstCols)
+ end lambda
+ end script
+
+ intercalate(return & return, ¬
+ map(testAlignment, {eLeft, eRight, eCenter}))
+end run
+
+
+-- columnsAligned :: EnumValue -> [[String]] -> String
+on columnsAligned(eAlign, lstCols)
+ -- padwords :: Int -> [String] -> [[String]]
+ script padwords
+ on lambda(n, lstWords)
+
+ -- pad :: String -> String
+ script pad
+ on lambda(str)
+ set lngPad to n - (length of str)
+ if eAlign = my eCenter then
+ set lngHalf to lngPad div 2
+ {replicate(lngHalf, space), str, ¬
+ replicate(lngPad - lngHalf, space)}
+ else
+ if eAlign = my eLeft then
+ {"", str, replicate(lngPad, space)}
+ else
+ {replicate(lngPad, space), str, ""}
+ end if
+ end if
+ end lambda
+ end script
+
+ map(pad, lstWords)
+ end lambda
+ end script
+
+ unlines(map(my unwords, ¬
+ transpose(zipWith(padwords, ¬
+ map(my widest, lstCols), lstCols))))
+end columnsAligned
+
+-- lineColumns :: String -> String -> String
+on lineColumns(strColDelim, strText)
+ -- _words :: Text -> [Text]
+ script _words
+ on lambda(str)
+ splitOn(strColDelim, str)
+ end lambda
+ end script
+
+ set lstRows to map(_words, splitOn(linefeed, pstrLines))
+ set nCols to widest(lstRows)
+
+ -- fullRow :: [[a]] -> [[a]]
+ script fullRow
+ on lambda(lst)
+ lst & replicate(nCols - (length of lst), {""})
+ end lambda
+ end script
+
+ transpose(map(fullRow, lstRows))
+end lineColumns
+
+-- widest [a] -> Int
+on widest(xs)
+ script maxLen
+ on lambda(a, x)
+ set lng to length of x
+ cond(lng > a, lng, a)
+ end lambda
+ end script
+
+ foldl(maxLen, 0, xs)
+end widest
+
+
+
+-- GENERIC LIBRARY FUNCTIONS
+
+-- Text -> [Text] -> Text
+on intercalate(strText, lstText)
+ set {dlm, my text item delimiters} to {my text item delimiters, strText}
+ set strJoined to lstText as text
+ set my text item delimiters to dlm
+ return strJoined
+end intercalate
+
+-- Text -> Text -> [Text]
+on splitOn(strDelim, strMain)
+ set {dlm, my text item delimiters} to {my text item delimiters, strDelim}
+ set lstParts to text items of strMain
+ set my text item delimiters to dlm
+ return lstParts
+end splitOn
+
+-- [Text] -> Text
+on unlines(lstLines)
+ intercalate(linefeed, lstLines)
+end unlines
+
+-- [Text] -> Text
+on unwords(lstWords)
+ intercalate(" ", lstWords)
+end unwords
+
+-- transpose :: [[a]] -> [[a]]
+on transpose(xss)
+ script column
+ on lambda(_, iCol)
+ script row
+ on lambda(xs)
+ item iCol of xs
+ end lambda
+ end script
+
+ map(row, xss)
+ end lambda
+ end script
+
+ map(column, item 1 of xss)
+end transpose
+
+-- foldl :: (a -> b -> a) -> a -> [b] -> a
+on foldl(f, startValue, xs)
+ tell mReturn(f)
+ set v to startValue
+ set lng to length of xs
+ repeat with i from 1 to lng
+ set v to lambda(v, item i of xs, i, xs)
+ end repeat
+ return v
+ end tell
+end foldl
+
+-- map :: (a -> b) -> [a] -> [b]
+on map(f, xs)
+ tell mReturn(f)
+ set lng to length of xs
+ set lst to {}
+ repeat with i from 1 to lng
+ set end of lst to lambda(item i of xs, i, xs)
+ end repeat
+ return lst
+ end tell
+end map
+
+-- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+on zipWith(f, xs, ys)
+ set lng to length of xs
+ if lng is not length of ys then return missing value
+
+ tell mReturn(f)
+ set lst to {}
+ repeat with i from 1 to lng
+ set end of lst to lambda(item i of xs, item i of ys)
+ end repeat
+ return lst
+ end tell
+end zipWith
+
+-- cond :: Bool -> a -> a -> a
+on cond(bool, f, g)
+ if bool then
+ f
+ else
+ g
+ end if
+end cond
+
+-- Egyptian multiplication - progressively doubling a list, appending
+-- stages of doubling to an accumulator where needed for binary
+-- assembly of a target length
+
+-- replicate :: Int -> a -> [a]
+on replicate(n, a)
+ set out to cond(class of a is string, "", {})
+ if n < 1 then return out
+ set dbl to a
+
+ repeat while (n > 1)
+ if (n mod 2) > 0 then set out to out & dbl
+ set n to (n div 2)
+ set dbl to (dbl & dbl)
+ end repeat
+ return out & dbl
+end replicate
+
+-- Lift 2nd class handler function into 1st class script wrapper
+-- mReturn :: Handler -> Script
+on mReturn(f)
+ if class of f is script then
+ f
+ else
+ script
+ property lambda : f
+ end script
+ end if
+end mReturn
diff --git a/Task/Align-columns/Batch-File/align-columns.bat b/Task/Align-columns/Batch-File/align-columns.bat
new file mode 100644
index 0000000000..1dd72d41b5
--- /dev/null
+++ b/Task/Align-columns/Batch-File/align-columns.bat
@@ -0,0 +1,84 @@
+@echo off
+setlocal enabledelayedexpansion
+mode con cols=103
+
+echo Given$a$text$file$of$many$lines,$where$fields$within$a$line$ >file.txt
+echo are$delineated$by$a$single$'dollar'$character,$write$a$program! >>file.txt
+echo that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$>>file.txt
+echo column$are$separated$by$at$least$one$space.>>file.txt
+echo Further,$allow$for$each$word$in$a$column$to$be$either$left$>>file.txt
+echo justified,$right$justified,$or$center$justified$within$its$column.>>file.txt
+
+for /f "tokens=1-13 delims=$" %%a in ('type file.txt') do (
+ call:maxlen %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m )
+echo.
+for /f "tokens=1-13 delims=$" %%a in ('type file.txt') do (
+ call:align 1 %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m )
+echo.
+for /f "tokens=1-13 delims=$" %%a in ('type file.txt') do (
+ call:align 2 %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m )
+echo.
+for /f "tokens=1-13 delims=$" %%a in ('type file.txt') do (
+ call:align 3 %%a %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l %%m )
+
+exit /B
+
+:maxlen &::sets variables len1 to len13
+ set "cnt=1"
+:loop1
+ if "%1"=="" exit /b
+ call:strlen %1 length
+ if !len%cnt%! lss !length! set len%cnt%=!length!
+ set /a cnt+=1
+ shift
+ goto loop1
+
+:align
+ setlocal
+ set cnt=1
+ set print=
+:loop2
+ if "%2"=="" echo(%print%&endlocal & exit /b
+ set /a width=len%cnt%,cnt+=1
+ set arr=%2
+ if %1 equ 1 call:left %width% arr
+ if %1 equ 2 call:right %width% arr
+ if %1 equ 3 call:center %width% arr
+ set "print=%print%%arr% "
+ shift /2
+ goto loop2
+
+:left %num% &string
+ setlocal
+ set "arr=!%2! "
+ set arr=!arr:~0,%1!
+ endlocal & set %2=%arr%
+exit /b
+
+:right %num% &string
+ setlocal
+ set "arr= !%2!"
+ set arr=!arr:~-%1!
+ endlocal & set %2=%arr%
+exit /b
+
+:center %num% &string
+setlocal
+ set /a width=%1-1
+ set arr=!%2!
+ :loop3
+ if "!arr:~%width%,1!"=="" set "arr=%arr% "
+ if "!arr:~%width%,1!"=="" set "arr= %arr%"
+ if "!arr:~%width%,1!"=="" goto loop3
+endlocal & set %2=%arr%
+exit /b
+
+:strlen StrVar &RtnVar
+ setlocal EnableDelayedExpansion
+ set "s=#%~1"
+ set "len=0"
+ for %%N in (4096 2048 1024 512 256 128 64 32 16 8 4 2 1) do (
+ if "!s:~%%N,1!" neq "" set /a "len+=%%N" & set "s=!s:~%%N!"
+ )
+ endlocal & set %~2=%len%
+exit /b
diff --git a/Task/Align-columns/Fortran/align-columns.f b/Task/Align-columns/Fortran/align-columns.f
new file mode 100644
index 0000000000..d27d46ac70
--- /dev/null
+++ b/Task/Align-columns/Fortran/align-columns.f
@@ -0,0 +1,94 @@
+ SUBROUTINE RAKE(IN,M,X,WAY) !Casts forth text in fixed-width columns.
+Collates column widths so that each column is wide enough for its widest member.
+ INTEGER IN !Fingers the input file.
+ INTEGER M !Maximum record length thereof.
+ CHARACTER*1 X !The delimiter, possibly a comma.
+ INTEGER WAY !Alignment style.
+ INTEGER W(M + 1) !If every character were X in the maximum-length record,
+ INTEGER C(0:M + 1) !Then M + 1 would be the maximum number of fields possible.
+ CHARACTER*(M) ACARD !A scratchpad big enough for the biggest.
+ CHARACTER*(28 + 4*M) FORMAT !Guess. Allow for "Ann," per field.
+ INTEGER I !A stepper.
+ INTEGER L,LF !Text fingers.
+ INTEGER NF,MF !Field counts.
+ CHARACTER*6 WAYNESS(-1:+1) !Some annotation may be helpful.
+ PARAMETER (WAYNESS = (/"Left","Centre","Right"/)) !Using normal language.
+ INTEGER LINPR !The mouthpiece.
+ COMMON LINPR !Used all over.
+ W = 0 !Maximum field widths so far seen.
+ MF = 0 !Maximum number of fields to a record.
+ C(0) = 0 !Syncopation for the first field's predecessor.
+ WRITE (LINPR,*) !Some separation.
+ WRITE (LINPR,*) "Align ",WAYNESS(MIN(MAX(WAY,-1),+1)) !Explain, cautiously.
+
+Chase through the file assessing the lengths of each field.
+ 10 READ (IN,11,END = 20) L,ACARD(1:L) !Grab a record.
+ 11 FORMAT (Q,A) !Working only up to its end.
+ CALL LIZZIEBORDEN !Find the chop points.
+ W(1:NF) = MAX(W(1:NF),C(1:NF) - C(0:NF - 1) - 1) !Thereby the lengths between.
+ MF = MAX(MF,NF) !Also want to know the most number of chops.
+ GO TO 10 !Get the next record.
+
+Concoct a FORMAT based on the maximum size of each field. Plus one.
+ 20 REWIND(IN) !Back to the beginning.
+ WRITE (FORMAT,21) W(1:MF) + 1 !Add one to meet the specified at least one space between columns.
+ 21 FORMAT ("(",("A",I0,",")) !Generates a sequence of An, items.
+ LF = INDEX(FORMAT,", ") !The last one has a trailing comma.
+ IF (LF.LE.0) STOP "Format trouble!" !Or, maybe not!
+ FORMAT(LF:LF) = ")" !Convert it to the closing bracket.
+ WRITE (LINPR,*) "Format",FORMAT(1:LF) !Present it.
+
+Chug afresh, this time knowing the maximum length of each field.
+ 30 READ (IN,11,END = 40) L,ACARD(1:L) !Place just the record's content.
+ CALL LIZZIEBORDEN !Find the chop points.
+ SELECT CASE(WAY) !What is to be done?
+ CASE(-1) !Shove leftwards by appending spaces.
+ WRITE (LINPR,FORMAT) (ACARD(C(I - 1) + 1:C(I) - 1)// !The chopped text.
+ 1 REPEAT(" ",W(I) - C(I) + C(I - 1) + 1),I = 1,NF) !Some spaces.
+ CASE( 0) !Centre by appending half as many spaces.
+ WRITE (LINPR,FORMAT) (ACARD(C(I - 1) + 1:C(I) - 1)// !The chopped text.
+ 1 REPEAT(" ",(W(I) - C(I) + C(I - 1) + 1)/2),I = 1,NF) !Some spaces.
+ CASE(+1) !Align rightwards is the default style.
+ WRITE (LINPR,FORMAT) (ACARD(C(I - 1) + 1:C(I) - 1),I = 1,NF) !So, just the texts.
+ CASE DEFAULT !This shouldn't happen.
+ WRITE (LINPR,*) "Huh? WAY=",WAY !But if it does,
+ STOP "Unanticipated value for WAY!" !Explain.
+ END SELECT !So much for that record.
+ GO TO 30 !Go for another.
+Closedown
+ 40 REWIND(IN) !Be polite.
+ CONTAINS !This also marks the end of source for RAKE...
+ SUBROUTINE LIZZIEBORDEN !Take an axe to ACARD, chopping at X.
+ NF = 0 !No strokes so far.
+ DO I = 1,L !So, step away.
+ IF (ICHAR(ACARD(I:I)).EQ.ICHAR(X)) THEN !Here?
+ NF = NF + 1 !Yes!
+ C(NF) = I !The place!
+ END IF !So much for that.
+ END DO !On to the next.
+ NF = NF + 1 !And the end of ACARD is also a chop point.
+ C(NF) = L + 1 !As if here.
+ END SUBROUTINE LIZZIEBORDEN !She was aquitted.
+ END SUBROUTINE RAKE !So much raking over.
+
+ INTEGER L,M,N !To be determined the hard way.
+ INTEGER LINPR,IN !I/O unit numbers.
+ COMMON LINPR !Some of general note.
+ LINPR = 6 !Standard output via this unit number.
+ IN = 10 !Some unit number for the input file.
+ OPEN (IN,FILE="Rake.txt",STATUS="OLD",ACTION="READ") !For formatted input.
+ N = 0 !No records read.
+ M = 0 !Longest record so far.
+
+ 1 READ (IN,2,END = 10) L !How long is this record?
+ 2 FORMAT (Q) !Obviously, Q specifies the length, not a content field.
+ N = N + 1 !Anyway, another record has been read.
+ M = MAX(M,L) !And this is the longest so far.
+ GO TO 1 !Go back for more.
+
+ 10 REWIND (IN) !We're ready now.
+ WRITE (LINPR,*) N,"Recs, longest rec. length is ",M
+ CALL RAKE(IN,M,"$",-1) !Align left.
+ CALL RAKE(IN,M,"$", 0) !Centre.
+ CALL RAKE(IN,M,"$",+1) !Align right.
+ END !That's all.
diff --git a/Task/Align-columns/JavaScript/align-columns-3.js b/Task/Align-columns/JavaScript/align-columns-3.js
index 91b889e056..cbee7cf1bc 100644
--- a/Task/Align-columns/JavaScript/align-columns-3.js
+++ b/Task/Align-columns/JavaScript/align-columns-3.js
@@ -1,63 +1,133 @@
-(function (lines) {
+(function (strText) {
+ 'use strict';
- var LEFT = 0,
- CENTRE = 1,
- RIGHT = 2;
+ // [[a]] -> [[a]]
+ function transpose(lst) {
+ return lst[0].map(function (_, iCol) {
+ return lst.map(function (row) {
+ return row[iCol];
+ })
+ });
+ }
- return alignedTable(
- lines.map(function (s) {
- return s.split('$');
+ // (a -> b -> c) -> [a] -> [b] -> [c]
+ function zipWith(f, xs, ys) {
+ return xs.length === ys.length ? (
+ xs.map(function (x, i) {
+ return f(x, ys[i]);
+ })
+ ) : undefined;
+ }
+
+ // (a -> a -> Ordering) -> [a] -> a
+ function maximumBy(f, xs) {
+ return xs.reduce(function (a, x) {
+ return a === undefined ? x : (
+ f(x) > f(a) ? x : a
+ );
+ }, undefined)
+ }
+
+ // [String] -> String
+ function widest(lst) {
+ return maximumBy(length, lst)
+ .length;
+ }
+
+ // [[a]] -> [[a]]
+ function fullRow(lst, n) {
+ return lst.concat(Array.apply(null, Array(n - lst.length))
+ .map(function () {
+ return ''
+ }));
+ }
+
+ // String -> Int -> String
+ function nreps(s, n) {
+ var o = '';
+ if (n < 1) return o;
+ while (n > 1) {
+ if (n & 1) o += s;
+ n >>= 1;
+ s += s;
+ }
+ return o + s;
+ }
+
+ // [String] -> String
+ function unwords(xs) {
+ return xs.join(' ');
+ }
+
+ // [String] -> String
+ function unlines(xs) {
+ return xs.join('\n');
+ }
+
+ // [a] -> Int
+ function length(xs) {
+ return xs.length;
+ }
+
+ // -- Int -> [String] -> [[String]]
+ function padWords(n, lstWords, eAlign) {
+ return lstWords.map(function (w) {
+ var lngPad = n - w.length;
+
+ return (
+ (eAlign === eCenter) ? (function () {
+ var lngHalf = Math.floor(lngPad / 2);
+
+ return [
+ nreps(' ', lngHalf), w,
+ nreps(' ', lngPad - lngHalf)
+ ];
+ })() : (eAlign === eLeft) ?
+ ['', w, nreps(' ', lngPad)] :
+ [nreps(' ', lngPad), w, '']
+ )
+ .join('');
+ });
+ }
+
+ // MAIN
+
+ var eLeft = -1,
+ eCenter = 0,
+ eRight = 1;
+
+ var lstRows = strText.split('\n')
+ .map(function (x) {
+ return x.split('$');
}),
- 2, // minimum gap between cols
- LEFT // [LEFT|CENTRE|RIGHT] or [0|1|2]
- )
- // TABULATION OF RESULTS IN SPACED AND ALIGNED COLUMNS
- // [s] -> n -> enum -> s
- function alignedTable(lstRows, lngPad, iAlignment) {
+ lngCols = widest(lstRows),
+ lstCols = transpose(lstRows.map(function (r) {
+ return fullRow(r, lngCols)
+ })),
+ lstColWidths = lstCols.map(widest);
- // Max width of each column
- var lstColWidths = range(0, lstRows.reduce(function (a, x) {
- return x.length > a ? x.length : a;
- }, 0) - 1).map(function (iCol) {
- return lstRows.reduce(function (a, lst) {
- var w = lst[iCol] ? lst[iCol].toString().length : 0;
- return (w > a) ? w : a;
- }, 0);
- });
+ // THREE PARAGRAPHS, WITH VARIOUS WORD COLUMN ALIGNMENTS:
- // Rows padded to equal width
- return lstRows.map(function (lstRow) {
- return lstRow.map(function (v, i) {
- return align(v, lstColWidths[i] + lngPad, iAlignment);
- }).join('')
- }).join('\n');
- }
+ return [eLeft, eRight, eCenter]
+ .map(function (eAlign) {
+ var fPad = function (n, lstWords) {
+ return padWords(n, lstWords, eAlign);
+ };
- // Text padded to left and/or right: aligned (left|centre|right)
- // String, number of characters, alignment 0|1|2
- // s -> n -> enum -> s
- function align(s, n, a) {
- var mid = (1 === a),
- gap = n - s.length,
- pad = Array(Math.floor((gap + 1) / (mid ? 2 : 1))).join(' ');
+ return transpose(
+ zipWith(fPad, lstColWidths, lstCols)
+ )
+ .map(unwords);
+ })
+ .map(unlines)
+ .join('\n\n');
- return (a ? pad + (!mid || gap % 2 ? '' : ' ') : '') + s +
- (2 > a ? pad + (mid ? ' ' : '') : '');
- }
-
- // [m..n]
- function range(m, n) {
- return Array.apply(null, Array(n - m + 1)).map(function (x, i) {
- return m + i;
- });
- }
-
-})([
- "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$\n\
+are$delineated$by$a$single$'dollar'$character,$write$a$program\n\
+that$aligns$each$column$of$fields$by$ensuring$that$words$in$each$\n\
+column$are$separated$by$at$least$one$space.\n\
+Further,$allow$for$each$word$in$a$column$to$be$either$left$\n\
+justified,$right$justified,$or$center$justified$within$its$column."
+);
diff --git a/Task/Align-columns/Kotlin/align-columns.kotlin b/Task/Align-columns/Kotlin/align-columns.kotlin
index c8dc714c8c..a02f891b04 100644
--- a/Task/Align-columns/Kotlin/align-columns.kotlin
+++ b/Task/Align-columns/Kotlin/align-columns.kotlin
@@ -5,17 +5,11 @@ import java.nio.file.Files
import java.nio.file.Paths
enum class Align_function {
- LEFT {
- override fun invoke(s: String, length: Int) = ("%-" + length + 's').format(("%" + s.length() + 's').format(s))
- },
- RIGHT {
- override fun invoke(s: String, length: Int) = ("%-" + length + 's').format(("%" + length + 's').format(s))
- },
- CENTER {
- override fun invoke(s: String, length: Int) = ("%-" + length + 's').format(("%" + ((length + s.length()) / 2) + 's').format(s))
- };
+ LEFT { override fun invoke(s: String, l: Int) = ("%-" + l + 's').format(("%" + s.length + 's').format(s)) },
+ RIGHT { override fun invoke(s: String, l: Int) = ("%-" + l + 's').format(("%" + l + 's').format(s)) },
+ CENTER { override fun invoke(s: String, l: Int) = ("%-" + l + 's').format(("%" + ((l + s.length) / 2) + 's').format(s)) };
- abstract operator fun invoke(s: String, length: Int): String
+ abstract operator fun invoke(s: String, l: Int): String
}
/** Aligns fields into columns, separated by "|".
@@ -23,42 +17,42 @@ enum class Align_function {
* @property lines Lines in a single string. Empty string does form a column.
*/
class Column_aligner(val lines: List) {
- operator fun invoke(a: Align_function): String {
- val result = StringBuilder()
+ operator fun invoke(a: Align_function) : String {
+ var result = ""
for (lineWords in words) {
for (i in lineWords.indices) {
if (i == 0)
- result.append('|')
- result.append(a(lineWords[i], column_widths[i]))
- result.append('|')
+ result += '|'
+ result += a(lineWords[i], column_widths[i])
+ result += '|'
}
- result.append('\n')
+ result += '\n'
}
- return result.toString()
+ return result
}
private val words = arrayListOf>()
private val column_widths = arrayListOf()
init {
- lines forEach {
+ lines.forEach {
val lineWords = java.lang.String(it).split("\\$")
words += lineWords
for (i in lineWords.indices)
- if (i >= column_widths.size())
- column_widths += lineWords[i].length()
+ if (i >= column_widths.size)
+ column_widths += lineWords[i].length
else
- column_widths[i] = Math.max(column_widths[i], lineWords[i].length())
+ column_widths[i] = Math.max(column_widths[i], lineWords[i].length)
}
}
}
fun main(args: Array) {
- if (args.size() < 1)
+ if (args.size < 1)
println("Usage: ColumnAligner file [L|R|C]")
else {
val ca = Column_aligner(Files.readAllLines(Paths.get(args[0]), StandardCharsets.UTF_8))
- val alignment = if (args.size() >= 2) args[1] else "L"
+ val alignment = if (args.size >= 2) args[1] else "L"
when (alignment) {
"L" -> print(ca(Align_function.LEFT))
"R" -> print(ca(Align_function.RIGHT))
diff --git a/Task/Align-columns/Perl-6/align-columns-2.pl6 b/Task/Align-columns/Perl-6/align-columns-2.pl6
index 5604b2a43d..4893c7e36c 100644
--- a/Task/Align-columns/Perl-6/align-columns-2.pl6
+++ b/Task/Align-columns/Perl-6/align-columns-2.pl6
@@ -2,7 +2,7 @@ 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) ~ " "; } }
+for @lines { say |.split('$').kv.map: { (align @widths[$^key], $^word) ~ " "; } }
sub align($column_width, $word, $aligment = @*ARGS[0]) {
my $lr = $column_width - $word.chars;
diff --git a/Task/Align-columns/Perl-6/align-columns-3.pl6 b/Task/Align-columns/Perl-6/align-columns-3.pl6
new file mode 100644
index 0000000000..1bad12856a
--- /dev/null
+++ b/Task/Align-columns/Perl-6/align-columns-3.pl6
@@ -0,0 +1,7 @@
+sub MAIN ($alignment where 'left'|'right', $file) {
+ my @lines := $file.IO.lines.map(*.split: '$').List;
+ my @widths = roundrobin(|@lines).map(*».chars.max);
+ my $align = {left=>'-', right=>''}{$alignment};
+ my $format = @widths.map({ "%{++$}\${$align}{$_}s" }).join(" ") ~ "\n";
+ printf $format, |$_ for @lines;
+}
diff --git a/Task/Align-columns/PowerShell/align-columns.psh b/Task/Align-columns/PowerShell/align-columns.psh
new file mode 100644
index 0000000000..3cfe07a5d2
--- /dev/null
+++ b/Task/Align-columns/PowerShell/align-columns.psh
@@ -0,0 +1,22 @@
+$file =
+@'
+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.
+'@.Split("`n")
+
+$arr = @()
+$file | foreach {
+ $line = $_
+ $i = 0
+ $hash = [ordered]@{}
+ $line.split('$') | foreach{
+ $hash["$i"] = "$_"
+ $i++
+ }
+ $arr += @([pscustomobject]$hash)
+}
+$arr | Format-Table -HideTableHeaders -Wrap *
diff --git a/Task/Align-columns/ZX-Spectrum-Basic/align-columns.zx b/Task/Align-columns/ZX-Spectrum-Basic/align-columns.zx
new file mode 100644
index 0000000000..089bef3083
--- /dev/null
+++ b/Task/Align-columns/ZX-Spectrum-Basic/align-columns.zx
@@ -0,0 +1,47 @@
+ 5 BORDER 2
+10 DATA 6
+20 DATA "The$problem$of$Speccy$"
+30 DATA "is$the$screen.$"
+40 DATA "Need$adapt$text$sample$"
+50 DATA "for$show$the$result$"
+60 DATA "without$problem$,right?$"
+70 DATA "But$see$the$code.$"
+80 REM First find the maximum length of a 'word'
+90 LET max=0: LET d$="$"
+100 READ nlines
+110 FOR l=1 TO nlines
+120 READ t$
+130 GO SUB 1000
+150 NEXT l
+155 LET s$=" "( TO max)
+160 REM Now display the aligned text:
+170 LET m$="l": GO SUB 2000: PRINT
+180 LET m$="r": GO SUB 2000: PRINT
+190 LET m$="c": GO SUB 2000
+200 STOP
+1000 REM Maximum length of a word
+1010 LET lt=LEN t$: LET p=1: LET lw=0
+1020 FOR i=1 TO lt
+1030 IF t$(i)=d$ THEN LET lw=i-p: LET p=i: IF lw>max THEN LET max=lw
+1040 NEXT i
+1050 RETURN
+2000 REM Show aligned text
+2010 RESTORE 20
+2020 FOR l=1 TO nlines
+2030 READ t$
+2040 GO SUB 3000
+2050 NEXT l
+2060 RETURN
+3000 REM Show words
+3010 LET lt=LEN t$: LET p=1: LET lw=0
+3020 FOR i=1 TO lt
+3030 IF t$(i)<>d$ THEN GO TO 3090
+3035 LET lw=i-p
+3040 LET p$=t$(p TO i-1): LET p=i+1: LET z$=s$
+3050 IF m$="l" THEN LET z$( TO lw)=p$
+3060 IF m$="r" THEN LET z$(max-lw+1 TO )=p$
+3070 IF m$="c" THEN LET z$((max/2)-(lw/2) TO )=p$
+3080 PRINT z$;
+3090 NEXT i
+3095 PRINT
+3100 RETURN
diff --git a/Task/Aliquot-sequence-classifications/Common-Lisp/aliquot-sequence-classifications.lisp b/Task/Aliquot-sequence-classifications/Common-Lisp/aliquot-sequence-classifications.lisp
new file mode 100644
index 0000000000..e49fb73138
--- /dev/null
+++ b/Task/Aliquot-sequence-classifications/Common-Lisp/aliquot-sequence-classifications.lisp
@@ -0,0 +1,67 @@
+(defparameter *nlimit* 16)
+(defparameter *klimit* (expt 2 47))
+(defparameter *asht* (make-hash-table))
+(load "proper-divisors")
+
+(defun ht-insert (v n)
+ (setf (gethash v *asht*) n))
+
+(defun ht-find (v n)
+ (let ((nprev (gethash v *asht*)))
+ (if nprev (- n nprev) nil)))
+
+(defun ht-list ()
+ (defun sort-keys (&optional (res '()))
+ (maphash #'(lambda (k v) (push (cons k v) res)) *asht*)
+ (sort (copy-list res) #'< :key (lambda (p) (cdr p))))
+ (let ((sorted (sort-keys)))
+ (dotimes (i (length sorted)) (format t "~A " (car (nth i sorted))))))
+
+(defun aliquot-generator (K1)
+ "integer->function::fn to generate aliquot sequence"
+ (let ((Kn K1))
+ #'(lambda () (setf Kn (reduce #'+ (proper-divisors-recursive Kn) :initial-value 0)))))
+
+(defun aliquot (K1)
+ "integer->symbol|nil::classify aliquot sequence"
+ (defun aliquot-sym (Kn n)
+ (let* ((period (ht-find Kn n))
+ (sym (if period
+ (cond ; period event
+ ((= Kn K1)
+ (case period (1 'PERF) (2 'AMIC) (otherwise 'SOCI)))
+ ((= period 1) 'ASPI)
+ (t 'CYCL))
+ (cond ; else check for limit event
+ ((= Kn 0) 'TERM)
+ ((> Kn *klimit*) 'TLIM)
+ ((= n *nlimit*) 'NLIM)
+ (t nil)))))
+ ;; if period event store the period, if no event insert the value
+ (if sym (when period (setf (symbol-plist sym) (list period)))
+ (ht-insert Kn n))
+ sym))
+
+ (defun aliquot-str (sym &optional (period 0))
+ (case sym (TERM "terminating") (PERF "perfect") (AMIC "amicable") (ASPI "aspiring")
+ (SOCI (format nil "sociable (period ~A)" (car (symbol-plist sym))))
+ (CYCL (format nil "cyclic (period ~A)" (car (symbol-plist sym))))
+ (NLIM (format nil "non-terminating (no classification before added term limit of ~A)" *nlimit*))
+ (TLIM (format nil "non-terminating (term threshold of ~A exceeded)" *klimit*))
+ (otherwise "unknown")))
+
+ (clrhash *asht*)
+ (let ((fgen (aliquot-generator K1)))
+ (setf (symbol-function 'aliseq) #'(lambda () (funcall fgen))))
+ (ht-insert K1 0)
+ (do* ((n 1 (1+ n))
+ (Kn (aliseq) (aliseq))
+ (alisym (aliquot-sym Kn n) (aliquot-sym Kn n)))
+ (alisym (format t "~A:" (aliquot-str alisym)) (ht-list) (format t "~A~%" Kn) alisym)))
+
+(defun main ()
+ (princ "The last item in each sequence triggers classification.") (terpri)
+ (dotimes (k 10)
+ (aliquot (+ k 1)))
+ (dolist (k '(11 12 28 496 220 1184 12496 1264460 790 909 562 1064 1488 15355717786080))
+ (aliquot k)))
diff --git a/Task/Aliquot-sequence-classifications/Elixir/aliquot-sequence-classifications.elixir b/Task/Aliquot-sequence-classifications/Elixir/aliquot-sequence-classifications.elixir
new file mode 100644
index 0000000000..e26d249bde
--- /dev/null
+++ b/Task/Aliquot-sequence-classifications/Elixir/aliquot-sequence-classifications.elixir
@@ -0,0 +1,50 @@
+defmodule Proper do
+ def divisors(1), do: []
+ def divisors(n), do: [1 | divisors(2,n,:math.sqrt(n))] |> Enum.sort
+
+ defp divisors(k,_n,q) when k>q, do: []
+ defp divisors(k,n,q) when rem(n,k)>0, do: divisors(k+1,n,q)
+ defp divisors(k,n,q) when k * k == n, do: [k | divisors(k+1,n,q)]
+ defp divisors(k,n,q) , do: [k,div(n,k) | divisors(k+1,n,q)]
+end
+
+defmodule Aliquot do
+ def sequence(n, maxlen\\16, maxterm\\140737488355328)
+ def sequence(0, _maxlen, _maxterm), do: "terminating"
+ def sequence(n, maxlen, maxterm) do
+ {msg, s} = sequence(n, maxlen, maxterm, [n])
+ {msg, Enum.reverse(s)}
+ end
+
+ defp sequence(n, maxlen, maxterm, s) when length(s) < maxlen and n < maxterm do
+ m = Proper.divisors(n) |> Enum.sum
+ cond do
+ m in s ->
+ case {m, List.last(s), hd(s)} do
+ {x,x,_} ->
+ case length(s) do
+ 1 -> {"perfect", s}
+ 2 -> {"amicable", s}
+ _ -> {"sociable of length #{length(s)}", s}
+ end
+ {x,_,x} -> {"aspiring", [m | s]}
+ _ -> {"cyclic back to #{m}", [m | s]}
+ end
+ m == 0 -> {"terminating", [0 | s]}
+ true -> sequence(m, maxlen, maxterm, [m | s])
+ end
+ end
+ defp sequence(_, _, _, s), do: {"non-terminating", s}
+end
+
+Enum.each(1..10, fn n ->
+ {msg, s} = Aliquot.sequence(n)
+ :io.fwrite("~7w:~21s: ~p~n", [n, msg, s])
+end)
+IO.puts ""
+[11, 12, 28, 496, 220, 1184, 12496, 1264460, 790, 909, 562, 1064, 1488, 15355717786080]
+|> Enum.each(fn n ->
+ {msg, s} = Aliquot.sequence(n)
+ if n<10000000, do: :io.fwrite("~7w:~21s: ~p~n", [n, msg, s]),
+ else: :io.fwrite("~w: ~s: ~p~n", [n, msg, s])
+ end)
diff --git a/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-1.j b/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-1.j
index 89f9521754..875443583e 100644
--- a/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-1.j
+++ b/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-1.j
@@ -1,5 +1,15 @@
-proper_divisors =: [: */&> [: }: [: , [: { [: <@:({. ^ i.@:>:@:{:)";: [: |: 2 p: x:
-aliquot =: ([: +/ proper_divisors) ::0:
-rc_aliquot_sequence =: aliquot^:(i.16)&>
-rc_classify =: [: {. ([;.1' invalid terminate non-terminating perfect amicable sociable aspiring cyclic') #~ (16 ~: #) , (6 > {:) , (([: +./ (2^47x)&<) +. (16 = #@:~.)) , (1 = #@:~.) , ((8&= , 1&<)@:{.@:(#/.~)) , ([: =/ _2&{.) , 1:
-rc_display_aliquot_sequence =: (":,~' ',~rc_classify)@:rc_aliquot_sequence
+proper_divisors=: [: */@>@}:@,@{ [: (^ i.@>:)&.>/ 2 p: x:
+aliquot=: +/@proper_divisors ::0:
+rc_aliquot_sequence=: aliquot^:(i.16)&>
+rc_classify=: 3 :0
+ if. 16 ~:# y do. ' invalid '
+ elseif. 6 > {: y do. ' terminate '
+ elseif. (+./y>2^47) +. 16 = #~.y do. ' non-terminating'
+ elseif. 1=#~. y do. ' perfect '
+ elseif. 8= st=. {.#/.~ y do. ' amicable '
+ elseif. 1 < st do. ' sociable '
+ elseif. =/_2{. y do. ' aspiring '
+ elseif. 1 do. ' cyclic '
+ end.
+)
+rc_display_aliquot_sequence=: (rc_classify,' ',":)@:rc_aliquot_sequence
diff --git a/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-2.j b/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-2.j
index 4a9dda699c..37d370862c 100644
--- a/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-2.j
+++ b/Task/Aliquot-sequence-classifications/J/aliquot-sequence-classifications-2.j
@@ -11,17 +11,17 @@
terminate 10 8 7 1 0 0 0 0 0 0 0 0 0 0 0 0
rc_display_aliquot_sequence&>11, 12, 28, 496, 220, 1184, 12496, 1264460, 790, 909, 562, 1064, 1488, 15355717786080x
- terminate 11 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
- terminate 12 16 15 9 4 3 1 0 0 0 0 0 0 0 0 0 ...
- perfect 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 ...
- perfect 496 496 496 496 496 496 496 496 496 496 496 496 496 496 496 496 ...
- amicable 220 284 220 284 220 284 220 284 220 284 220 284 220 284 220 284 ...
- amicable 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 ...
- sociable 12496 14288 15472 14536 14264 12496 14288 15472 14536 14264 12496 14288 15472 14536 14264 12496 ...
- sociable 1264460 1547860 1727636 1305184 1264460 1547860 1727636 1305184 1264460 1547860 1727636 1305184 1264460 1547860 1727636 1305184 ...
- aspiring 790 650 652 496 496 496 496 496 496 496 496 496 496 496 496 496 ...
- aspiring 909 417 143 25 6 6 6 6 6 6 6 6 6 6 6 6 ...
- cyclic 562 284 220 284 220 284 220 284 220 284 220 284 220 284 220 284 ...
- cyclic 1064 1336 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 ...
- non-terminating 1488 2480 3472 4464 8432 9424 10416 21328 22320 55056 95728 96720 236592 459792 881392 882384 ...
- non-terminating 15355717786080 44534663601120 144940087464480 471714103310688 1130798979186912 2688948041357088 6050151708497568 13613157922639968 35513546724070632 74727605255142168 162658586225561832 353930992506879768 642678347124409032 112510261154846...
+ terminate 11 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+ terminate 12 16 15 9 4 3 1 0 0 0 0 0 0 0 0 0
+ perfect 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28
+ perfect 496 496 496 496 496 496 496 496 496 496 496 496 496 496 496 496
+ amicable 220 284 220 284 220 284 220 284 220 284 220 284 220 284 220 284
+ amicable 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210
+ sociable 12496 14288 15472 14536 14264 12496 14288 15472 14536 14264 12496 14288 15472 14536 14264 12496
+ sociable 1264460 1547860 1727636 1305184 1264460 1547860 1727636 1305184 1264460 1547860 1727636 1305184 1264460 1547860 1727636 1305184
+ aspiring 790 650 652 496 496 496 496 496 496 496 496 496 496 496 496 496
+ aspiring 909 417 143 25 6 6 6 6 6 6 6 6 6 6 6 6
+ cyclic 562 284 220 284 220 284 220 284 220 284 220 284 220 284 220 284
+ cyclic 1064 1336 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210 1184 1210
+ non-terminating 1488 2480 3472 4464 8432 9424 10416 21328 22320 55056 95728 96720 236592 459792 881392 882384
+ non-terminating 15355717786080 44534663601120 144940087464480 471714103310688 1130798979186912 2688948041357088 6050151708497568 13613157922639968 35513546724070632 74727605255142168 162658586225561832 353930992506879768 642678347124409032 1125102611548462968 1977286128289819992 3415126495450394808
diff --git a/Task/Aliquot-sequence-classifications/Java/aliquot-sequence-classifications.java b/Task/Aliquot-sequence-classifications/Java/aliquot-sequence-classifications.java
new file mode 100644
index 0000000000..e4de90244e
--- /dev/null
+++ b/Task/Aliquot-sequence-classifications/Java/aliquot-sequence-classifications.java
@@ -0,0 +1,62 @@
+import java.util.*;
+import java.util.stream.LongStream;
+import static java.util.stream.LongStream.rangeClosed;
+
+public class AliquotSequenceClassifications {
+
+ public static Long properDivsSum(long n) {
+ return rangeClosed(1, (n + 1) / 2).filter(i -> n % i == 0 && n != i).sum();
+ }
+
+ static boolean aliquot(long n, int maxLen, long maxTerm) {
+ List s = new ArrayList<>(maxLen);
+ s.add(n);
+ long newN = n;
+
+ while (s.size() <= maxLen && newN < maxTerm) {
+
+ newN = properDivsSum(s.get(s.size() - 1));
+
+ if (s.contains(newN)) {
+
+ if (s.get(0) == newN) {
+
+ switch (s.size()) {
+ case 1:
+ return report("Perfect", s);
+ case 2:
+ return report("Amicable", s);
+ default:
+ return report("Sociable of length " + s.size(), s);
+ }
+
+ } else if (s.get(s.size() - 1) == newN) {
+ return report("Aspiring", s);
+
+ } else
+ return report("Cyclic back to " + newN, s);
+
+ } else {
+ s.add(newN);
+ if (newN == 0)
+ return report("Terminating", s);
+ }
+ }
+
+ return report("Non-terminating", s);
+ }
+
+ static boolean report(String msg, List result) {
+ System.out.println(msg + ": " + result);
+ return false;
+ }
+
+ public static void main(String[] args) {
+ long[] arr = {11L, 12, 28, 496, 220, 1184, 12496, 1264460,
+ 790, 909, 562, 1064, 1488};
+
+ LongStream.rangeClosed(1, 10).forEach(n -> aliquot(n, 16, 1L << 47));
+ System.out.println();
+ Arrays.stream(arr).forEach(n -> aliquot(n, 16, 1L << 47));
+ }
+}
diff --git a/Task/Aliquot-sequence-classifications/Liberty-BASIC/aliquot-sequence-classifications.liberty b/Task/Aliquot-sequence-classifications/Liberty-BASIC/aliquot-sequence-classifications.liberty
new file mode 100644
index 0000000000..3205cbcffa
--- /dev/null
+++ b/Task/Aliquot-sequence-classifications/Liberty-BASIC/aliquot-sequence-classifications.liberty
@@ -0,0 +1,44 @@
+print "ROSETTA CODE - Aliquot sequence classifications"
+[Start]
+input "Enter an integer: "; K
+K=abs(int(K)): if K=0 then goto [Quit]
+call PrintAS K
+goto [Start]
+
+[Quit]
+print "Program complete."
+end
+
+sub PrintAS K
+ Length=52
+ dim Aseq(Length)
+ n=K: class=0
+ for element=2 to Length
+ Aseq(element)=PDtotal(n)
+ print Aseq(element); " ";
+ select case
+ case Aseq(element)=0
+ print " terminating": class=1: exit for
+ case Aseq(element)=K and element=2
+ print " perfect": class=2: exit for
+ case Aseq(element)=K and element=3
+ print " amicable": class=3: exit for
+ case Aseq(element)=K and element>3
+ print " sociable": class=4: exit for
+ case Aseq(element)<>K and Aseq(element-1)=Aseq(element)
+ print " aspiring": class=5: exit for
+ case Aseq(element)<>K and Aseq(element-2)= Aseq(element)
+ print " cyclic": class=6: exit for
+ end select
+ n=Aseq(element)
+ if n>priorn then priorn=n: inc=inc+1 else inc=0: priorn=0
+ if inc=11 or n>30000000 then exit for
+ next element
+ if class=0 then print " non-terminating"
+end sub
+
+function PDtotal(n)
+ for y=2 to n
+ if (n mod y)=0 then PDtotal=PDtotal+(n/y)
+ next
+end function
diff --git a/Task/Aliquot-sequence-classifications/Perl-6/aliquot-sequence-classifications.pl6 b/Task/Aliquot-sequence-classifications/Perl-6/aliquot-sequence-classifications.pl6
index 1505c05114..b38aea8768 100644
--- a/Task/Aliquot-sequence-classifications/Perl-6/aliquot-sequence-classifications.pl6
+++ b/Task/Aliquot-sequence-classifications/Perl-6/aliquot-sequence-classifications.pl6
@@ -1,8 +1,9 @@
sub propdivsum (\x) {
- [+] x > 1, gather for 2 .. x.sqrt.floor -> \d {
+ my @l = x > 1, gather for 2 .. x.sqrt.floor -> \d {
my \y = x div d;
if y * d == x { take d; take y unless y == d }
}
+ [+] gather @l.deepmap(*.take);
}
multi quality (0,1) { 'perfect ' }
diff --git a/Task/Aliquot-sequence-classifications/PowerShell/aliquot-sequence-classifications-1.psh b/Task/Aliquot-sequence-classifications/PowerShell/aliquot-sequence-classifications-1.psh
new file mode 100644
index 0000000000..1ffa188a7b
--- /dev/null
+++ b/Task/Aliquot-sequence-classifications/PowerShell/aliquot-sequence-classifications-1.psh
@@ -0,0 +1,34 @@
+function Get-NextAliquot ( [int]$X )
+ {
+ If ( $X -gt 1 )
+ {
+ $NextAliquot = 0
+ (1..($X/2)).Where{ $x % $_ -eq 0 }.ForEach{ $NextAliquot += $_ }.Where{ $_ }
+ return $NextAliquot
+ }
+ }
+
+function Get-AliquotSequence ( [int]$K, [int]$N )
+ {
+ $X = $K
+ $X
+ (1..($N-1)).ForEach{ $X = Get-NextAliquot $X; $X }
+ }
+
+function Classify-AlliquotSequence ( [int[]]$Sequence )
+ {
+ $K = $Sequence[0]
+ $LastN = $Sequence.Count
+ If ( $Sequence[-1] -eq 0 ) { return "terminating" }
+ If ( $Sequence[-1] -eq 1 ) { return "terminating" }
+ If ( $Sequence[1] -eq $K ) { return "perfect" }
+ If ( $Sequence[2] -eq $K ) { return "amicable" }
+ If ( $Sequence[3..($Sequence.Count-1)] -contains $K ) { return "sociable" }
+ If ( $Sequence[-1] -eq $Sequence[-2] ) { return "aspiring" }
+ If ( $Sequence.Count -gt ( $Sequence | Select -Unique ).Count ) { return "cyclic" }
+ return "non-terminating and non-repeating through N = $($Sequence.Count)"
+ }
+
+(1..10).ForEach{ [string]$_ + " is " + ( Classify-AlliquotSequence -Sequence ( Get-AliquotSequence -K $_ -N 16 ) ) }
+
+( 11, 12, 28, 496, 220, 1184, 790, 909, 562, 1064, 1488 ).ForEach{ [string]$_ + " is " + ( Classify-AlliquotSequence -Sequence ( Get-AliquotSequence -K $_ -N 16 ) ) }
diff --git a/Task/Aliquot-sequence-classifications/PowerShell/aliquot-sequence-classifications-2.psh b/Task/Aliquot-sequence-classifications/PowerShell/aliquot-sequence-classifications-2.psh
new file mode 100644
index 0000000000..33b3d4fa4f
--- /dev/null
+++ b/Task/Aliquot-sequence-classifications/PowerShell/aliquot-sequence-classifications-2.psh
@@ -0,0 +1,63 @@
+function Get-NextAliquot ( [int]$X )
+ {
+ If ( $X -gt 1 )
+ {
+ $NextAliquot = 1
+ If ( $X -gt 2 )
+ {
+ $XSquareRoot = [math]::Sqrt( $X )
+
+ (2..$XSquareRoot).Where{ $X % $_ -eq 0 }.ForEach{ $NextAliquot += $_ + $x / $_ }
+
+ If ( $XSquareRoot % 1 -eq 0 ) { $NextAliquot -= $XSquareRoot }
+ }
+ return $NextAliquot
+ }
+ }
+
+function Get-AliquotSequence ( [int]$K, [int]$N )
+ {
+ $X = $K
+ $X
+ $i = 1
+ While ( $X -and $i -lt $N )
+ {
+ $i++
+ $Next = Get-NextAliquot $X
+ If ( $Next )
+ {
+ If ( $X -eq $Next )
+ {
+ ($i..$N).ForEach{ $X }
+ $i = $N
+ }
+ Else
+ {
+ $X = $Next
+ $X
+ }
+ }
+ Else
+ {
+ $i = $N
+ }
+ }
+ }
+
+function Classify-AlliquotSequence ( [int[]]$Sequence )
+ {
+ $K = $Sequence[0]
+ $LastN = $Sequence.Count
+ If ( $Sequence[-1] -eq 0 ) { return "terminating" }
+ If ( $Sequence[-1] -eq 1 ) { return "terminating" }
+ If ( $Sequence[1] -eq $K ) { return "perfect" }
+ If ( $Sequence[2] -eq $K ) { return "amicable" }
+ If ( $Sequence[3..($Sequence.Count-1)] -contains $K ) { return "sociable" }
+ If ( $Sequence[-1] -eq $Sequence[-2] ) { return "aspiring" }
+ If ( $Sequence.Count -gt ( $Sequence | Select -Unique ).Count ) { return "cyclic" }
+ return "non-terminating and non-repeating through N = $($Sequence.Count)"
+ }
+
+(1..10).ForEach{ [string]$_ + " is " + ( Classify-AlliquotSequence -Sequence ( Get-AliquotSequence -K $_ -N 16 ) ) }
+
+( 11, 12, 28, 496, 220, 1184, 12496, 1264460, 790, 909, 562, 1064, 1488 ).ForEach{ [string]$_ + " is " + ( Classify-AlliquotSequence -Sequence ( Get-AliquotSequence -K $_ -N 16 ) ) }
diff --git a/Task/Aliquot-sequence-classifications/REXX/aliquot-sequence-classifications.rexx b/Task/Aliquot-sequence-classifications/REXX/aliquot-sequence-classifications.rexx
index 0a9274b5e1..c9f0587483 100644
--- a/Task/Aliquot-sequence-classifications/REXX/aliquot-sequence-classifications.rexx
+++ b/Task/Aliquot-sequence-classifications/REXX/aliquot-sequence-classifications.rexx
@@ -1,63 +1,63 @@
-/*REXX program classifies various positive integers for aliquot sequences. */
-parse arg low high L /*get some optional arguments.*/
-high=word(high low 10,1); low=word(low 1,1) /*get the LOW and HIGH. */
+/*REXX program classifies various positive integers for types of aliquot sequences. */
+parse arg low high L /*obtain optional arguments from the CL*/
+high=word(high low 10,1); low=word(low 1,1) /*obtain the LOW and HIGH (range). */
if L='' then L=11 12 28 496 220 1184 12496 1264460 790 909 562 1064 1488 15355717786080
-big=2**47; NTlimit=16+1 /*seq. non─terminating limit. */
-numeric digits max(9, 1+length(big)) /*be able to handle // oper.*/
-#.=.; #.0=0; #.1=0 /*#. are proper divisor sums.*/
-say center('numbers from ' low " to " high, 79, "═")
+big=2**47; NTlimit=16+1 /*limit for a non─terminating sequence.*/
+numeric digits max(9, 1+length(big)) /*be able to handle big numbers for // */
+#.=.; #.0=0; #.1=0 /*#. are the proper divisor sums. */
+say center('numbers from ' low " to " high, 79, "═")
- do n=low to high /*process (probably) some low numbers. */
- call classify_aliquot n /*call a subroutine to classify number.*/
- end /*n*/ /* [↑] process a range of integers. */
+ do n=low to high /*process (probably) some low numbers. */
+ call classify n /*call a subroutine to classify number.*/
+ end /*n*/ /* [↑] process a range of integers. */
say
say center('first numbers for each classification', 79, "═")
-b.=0 /* [↓] ensure one number of each class*/
- do q=1 until b.sociable \== 0 /*the only one that has to be counted. */
- call classify_aliquot -q /*the minus (-) sign indicates ¬ tell. */
- _=what; upper _; b._=b._+1 /*bump the counter for this seq. class.*/
- if b._==1 then call show_class q,$ /*show the first occurrence only.*/
- end /*q*/ /* [↑] process until all classes found*/
+class.=0 /* [↓] ensure one number of each class*/
+ do q=1 until class.sociable\==0 /*the only one that has to be counted. */
+ call classify -q /*the minus (-) sign indicates ¬ tell. */
+ _=what; upper _; class._=class._+1 /*bump counter for this class sequence.*/
+ if class._==1 then call show_class q,$ /*only display the first occurrence. */
+ end /*q*/ /* [↑] process until all classes found*/
say
say center('classifications for specific numbers', 79, "═")
- do i=1 for words(L) /*L is a list of "special numbers". */
- call classify_aliquot word(L,i) /*call a subroutine to classify number.*/
- end /*i*/ /* [↑] process a list of integers. */
-exit /*stick a fork in it, we're all done. */
-/*────────────────────────────────────────────────────────────────────────────*/
-classify_aliquot: parse arg a 1 aa; a=abs(a) /*get what number is to be used.*/
-if #.a\==. then s=#.a /*Was this number been summed before? */
- else s=sigma(a) /*No, then classify number the hard way*/
-#.a=s; $=s /*define sum of the proper divisors. */
-what='terminating' /*assume this kind of classification. */
-c.=0; c.s=1 /*clear all cyclic sequences; set 1st.*/
-if $==a then what='perfect' /*check for a "perfect" number. */
- else do t=1 while s\==0 /*loop until sum isn't 0 or > big.*/
- m=word($, words($)) /*obtain the last number in sequence. */
- if #.m==. then s=sigma(m) /*if not defined, then sum proper divs.*/
- else s=#.m /*use the previously found integer. */
- if m==s & m\==0 then do; what='aspiring' ; leave; end
- if word($,2)==a then do; what='amicable' ; leave; end
- $=$ s /*append a sum to the integer sequence.*/
- if s==a & t>3 then do; what='sociable' ; leave; end
- if c.s & m\==0 then do; what='cyclic' ; leave; end
- c.s=1 /*assign another possible cyclic number*/
- /* [↓] Rosetta Code task's limit: >16 */
- if t>NTlimit then do; what='non-terminating'; leave; end
- if s>big then do; what='NON-TERMINATING'; leave; end
- end /*t*/ /* [↑] only permit within reason. */
-if aa>0 then call show_class a,$ /*only display if A is positive. */
-return
-/*────────────────────────────────────────────────────────────────────────────*/
-show_class: say right(arg(1),digits()) 'is' center(what,15) arg(2); return
-/*────────────────────────────────────────────────────────────────────────────*/
-sigma: procedure expose #.; parse arg x; if x<2 then return 0; odd=x//2
-s=1 /* [↓] use only EVEN|ODD ints. ___*/
- do j=2+odd by 1+odd while j*j big.*/
+ m=word($, words($)) /*obtain the last number in sequence. */
+ if #.m==. then s=sigma(m) /*Not defined? Then sum proper divisors*/
+ else s=#.m /*use the previously found integer. */
+ if m==s & m\==0 then do; what='aspiring' ; leave; end
+ if word($,2)==a then do; what='amicable' ; leave; end
+ $=$ s /*append a sum to the integer sequence.*/
+ if s==a & t>3 then do; what='sociable' ; leave; end
+ if c.s & m\==0 then do; what='cyclic' ; leave; end
+ c.s=1 /*assign another possible cyclic number*/
+ /* [↓] Rosetta Code task's limit: >16 */
+ if t>NTlimit then do; what='non-terminating'; leave; end
+ if s>big then do; what='NON-TERMINATING'; leave; end
+ end /*t*/ /* [↑] only permit within reason. */
+ if aa>0 then call show_class a,$ /*only display if A is positive. */
+ return
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+show_class: say right(arg(1),digits()) 'is' center(what,15) arg(2); return
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+sigma: procedure expose #.; parse arg x; if x<2 then return 0; odd=x//2
+ s=1 /* [↓] use only EVEN | ODD ints. ___*/
+ do j=2+odd by 1+odd while j*j0 THEN GO SUB 2000: PRINT k;" ";s$: GO TO 20
+40 STOP
+1000 REM sumprop
+1010 IF oldk=1 THEN LET newk=0: RETURN
+1020 LET sum=1
+1030 LET root=SQR oldk
+1040 FOR i=2 TO root-0.1
+1050 IF oldk/i=INT (oldk/i) THEN LET sum=sum+i+oldk/i
+1060 NEXT i
+1070 IF oldk/root=INT (oldk/root) THEN LET sum=sum+root
+1080 LET newk=sum
+1090 RETURN
+2000 REM class
+2010 LET oldk=k: LET s$=" "
+2020 GO SUB 1000
+2030 LET oldk=newk
+2040 LET s$=s$+" "+STR$ newk
+2050 IF newk=0 THEN LET s$="terminating"+s$: RETURN
+2060 IF newk=k THEN LET s$="perfect"+s$: RETURN
+2070 GO SUB 1000
+2080 LET oldk=newk
+2090 LET s$=s$+" "+STR$ newk
+2100 IF newk=0 THEN LET s$="terminating"+s$: RETURN
+2110 IF newk=k THEN LET s$="amicable"+s$: RETURN
+2120 FOR t=4 TO 16
+2130 GO SUB 1000
+2140 LET s$=s$+" "+STR$ newk
+2150 IF newk=0 THEN LET s$="terminating"+s$: RETURN
+2160 IF newk=k THEN LET s$="sociable (period "+STR$ (t-1)+")"+s$: RETURN
+2170 IF newk=oldk THEN LET s$="aspiring"+s$: RETURN
+2180 LET b$=" "+STR$ newk+" ": LET ls=LEN s$: LET lb=LEN b$: LET ls=ls-lb
+2190 FOR i=1 TO ls
+2200 IF s$(i TO i+lb-1)=b$ THEN LET s$="cyclic (at "+STR$ newk+") "+s$: LET i=ls
+2210 NEXT i
+2220 IF LEN s$<>(ls+lb) THEN RETURN
+2300 IF newk>140737488355328 THEN LET s$="non-terminating (term > 140737488355328)"+s$: RETURN
+2310 LET oldk=newk
+2320 NEXT t
+2330 LET s$="non-terminating (after 16 terms)"+s$
+2340 RETURN
diff --git a/Task/Almost-prime/00DESCRIPTION b/Task/Almost-prime/00DESCRIPTION
index b48de6f50a..aaa9393c62 100644
--- a/Task/Almost-prime/00DESCRIPTION
+++ b/Task/Almost-prime/00DESCRIPTION
@@ -1,8 +1,16 @@
-A [[wp:Almost prime|k-Almost-prime]] is a natural number that is the product of (possibly identical) primes.
-So, for example, 1-almost-primes, where , are the prime numbers themselves; 2-almost-primes are the [[Semiprime|semiprimes]].
+A [[wp:Almost prime|k-Almost-prime]] is a natural number that is the product of (possibly identical) primes.
-The task is to write a function/method/subroutine/... that generates k-almost primes and use it to create a table here of the first ten members of k-Almost primes for .
-;Cf.
-* [[Semiprime]]
-* [[:Category:Prime Numbers]]
+;Example:
+1-almost-primes, where , are the prime numbers themselves.
+ 2-almost-primes, where , are the [[Semiprime|semiprimes]].
+
+
+;Task:
+Write a function/method/subroutine/... that generates k-almost primes and use it to create a table here of the first ten members of k-Almost primes for .
+
+
+;Related tasks:
+* [[Semiprime]]
+* [[:Category:Prime Numbers]]
+
diff --git a/Task/Almost-prime/AWK/almost-prime.awk b/Task/Almost-prime/AWK/almost-prime.awk
new file mode 100644
index 0000000000..bfba392ca0
--- /dev/null
+++ b/Task/Almost-prime/AWK/almost-prime.awk
@@ -0,0 +1,25 @@
+# syntax: GAWK -f ALMOST_PRIME.AWK
+BEGIN {
+ for (k=1; k<=5; k++) {
+ printf("%d:",k)
+ c = 0
+ i = 1
+ while (c < 10) {
+ if (kprime(++i,k)) {
+ printf(" %d",i)
+ c++
+ }
+ }
+ printf("\n")
+ }
+ exit(0)
+}
+function kprime(n,k, f,p) {
+ for (p=2; f 1) == k)
+}
diff --git a/Task/Almost-prime/C++/almost-prime.cpp b/Task/Almost-prime/C++/almost-prime.cpp
new file mode 100644
index 0000000000..76f0309789
--- /dev/null
+++ b/Task/Almost-prime/C++/almost-prime.cpp
@@ -0,0 +1,32 @@
+#include
+#include
+#include
+#include
+#include
+
+bool k_prime(unsigned n, unsigned k) {
+ unsigned f = 0;
+ for (unsigned p = 2; f < k && p * p <= n; p++)
+ while (0 == n % p) { n /= p; f++; }
+ return f + (n > 1 ? 1 : 0) == k;
+}
+
+std::list primes(unsigned k, unsigned n) {
+ std::list list;
+ for (unsigned i = 2;list.size() < n;i++)
+ if (k_prime(i, k)) list.push_back(i);
+ return list;
+}
+
+int main(const int argc, const char* argv[]) {
+ using namespace std;
+ for (unsigned k = 1; k <= 5; k++) {
+ ostringstream os("");
+ const list l = primes(k, 10);
+ for (list::const_iterator i = l.begin(); i != l.end(); i++)
+ os << setw(4) << *i;
+ cout << "k = " << k << ':' << os.str() << endl;
+ }
+
+ return EXIT_SUCCESS;
+}
diff --git a/Task/Almost-prime/Clojure/almost-prime.clj b/Task/Almost-prime/Clojure/almost-prime.clj
new file mode 100644
index 0000000000..c35a61bd6b
--- /dev/null
+++ b/Task/Almost-prime/Clojure/almost-prime.clj
@@ -0,0 +1,23 @@
+(ns clojure.examples.almostprime
+ (:gen-class))
+
+(defn divisors [n]
+ " Finds divisors by looping through integers 2, 3,...i.. up to sqrt (n) [note: rather than compute sqrt(), test with i*i <=n] "
+ (let [div (some #(if (= 0 (mod n %)) % nil) (take-while #(<= (* % %) n) (iterate inc 2)))]
+ (if div ; div = nil (if no divisor found else its the divisor)
+ (into [] (concat (divisors div) (divisors (/ n div)))) ; Concat the two divisors of the two divisors
+ [n]))) ; Number is prime so only itself as a divisor
+
+(defn divisors-k [k n]
+ " Finds n numbers with k divisors. Does this by looping through integers 2, 3, ... filtering (passing) ones with k divisors and
+ taking the first n "
+ (->> (iterate inc 2) ; infinite sequence of numbers starting at 2
+ (map divisors) ; compute divisor of each element of sequence
+ (filter #(= (count %) k)) ; filter to take only elements with k divisors
+ (take n) ; take n elements from filtered sequence
+ (map #(apply * %)))) ; compute number by taking product of divisors
+
+(println (for [k (range 1 6)]
+ (println "k:" k (divisors-k k 10))))
+
+}
diff --git a/Task/Almost-prime/Kotlin/almost-prime.kotlin b/Task/Almost-prime/Kotlin/almost-prime.kotlin
new file mode 100644
index 0000000000..0da7e9a380
--- /dev/null
+++ b/Task/Almost-prime/Kotlin/almost-prime.kotlin
@@ -0,0 +1,25 @@
+fun Int.k_prime(x: Int): Boolean {
+ var n = x
+ var f = 0
+ var p = 2
+ while (f < this && p * p <= n) {
+ while (0 == n % p) { n /= p; f++ }
+ p++
+ }
+ return f + (if (n > 1) 1 else 0) == this
+}
+
+fun Int.primes(n : Int) : List {
+ var i = 2
+ var list = listOf()
+ while (list.size < n) {
+ if (k_prime(i)) list += i
+ i++
+ }
+ return list
+}
+
+fun main(args: Array) {
+ for (k in 1..5)
+ println("k = $k: " + k.primes(10))
+}
diff --git a/Task/Almost-prime/Lua/almost-prime.lua b/Task/Almost-prime/Lua/almost-prime.lua
new file mode 100644
index 0000000000..bb818d812d
--- /dev/null
+++ b/Task/Almost-prime/Lua/almost-prime.lua
@@ -0,0 +1,34 @@
+-- Returns boolean indicating whether n is k-almost prime
+function almostPrime (n, k)
+ local divisor, count = 2, 0
+ while count < k + 1 and n ~= 1 do
+ if n % divisor == 0 then
+ n = n / divisor
+ count = count + 1
+ else
+ divisor = divisor + 1
+ end
+ end
+ return count == k
+end
+
+-- Generates table containing first ten k-almost primes for given k
+function kList (k)
+ local n, kTab = 2^k, {}
+ while #kTab < 10 do
+ if almostPrime(n, k) then
+ table.insert(kTab, n)
+ end
+ n = n + 1
+ end
+ return kTab
+end
+
+-- Main procedure, displays results from five calls to kList()
+for k = 1, 5 do
+ io.write("k=" .. k .. ": ")
+ for _, v in pairs(kList(k)) do
+ io.write(v .. ", ")
+ end
+ print("...")
+end
diff --git a/Task/Almost-prime/Perl-6/almost-prime-1.pl6 b/Task/Almost-prime/Perl-6/almost-prime-1.pl6
index 19356e9e56..84ba4caf40 100644
--- a/Task/Almost-prime/Perl-6/almost-prime-1.pl6
+++ b/Task/Almost-prime/Perl-6/almost-prime-1.pl6
@@ -6,6 +6,6 @@ sub is-k-almost-prime($n is copy, $k) returns Bool {
}
for 1 .. 5 -> $k {
- say .[^10]
+ say ~.[^10]
given grep { is-k-almost-prime($_, $k) }, 2 .. *
}
diff --git a/Task/Almost-prime/Perl-6/almost-prime-2.pl6 b/Task/Almost-prime/Perl-6/almost-prime-2.pl6
index 56165db9a0..d3858e3b80 100644
--- a/Task/Almost-prime/Perl-6/almost-prime-2.pl6
+++ b/Task/Almost-prime/Perl-6/almost-prime-2.pl6
@@ -1,5 +1,23 @@
-constant factory = 0..* Z=> (0, 0, map { +factors($_) }, 2..*);
+constant @primes = 2, |(3, 5, 7 ... *).grep: *.is-prime;
-sub almost($n) { map *.key, grep *.value == $n, factory }
+multi sub factors(1) { 1 }
+multi sub 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;
+ }
+ }
+}
-say almost($_)[^10] for 1..5;
+constant @factory = lazy 0..* Z=> flat (0, 0, map { +factors($_) }, 2..*);
+
+sub almost($n) { map *.key, grep *.value == $n, @factory }
+
+put almost($_)[^10] for 1..5;
diff --git a/Task/Almost-prime/R/almost-prime.r b/Task/Almost-prime/R/almost-prime.r
new file mode 100644
index 0000000000..93c4426701
--- /dev/null
+++ b/Task/Almost-prime/R/almost-prime.r
@@ -0,0 +1,49 @@
+#===============================================================
+# Find k-Almost-primes
+# R implementation
+#===============================================================
+#---------------------------------------------------------------
+# Function for prime factorization from Rosetta Code
+#---------------------------------------------------------------
+
+findfactors <- function(n) {
+ d <- c()
+ div <- 2; nxt <- 3; rest <- n
+ while( rest != 1 ) {
+ while( rest%%div == 0 ) {
+ d <- c(d, div)
+ rest <- floor(rest / div)
+ }
+ div <- nxt
+ nxt <- nxt + 2
+ }
+ d
+}
+
+#---------------------------------------------------------------
+# Find k-Almost-primes
+#---------------------------------------------------------------
+
+almost_primes <- function(n = 10, k = 5) {
+
+ # Set up matrix for storing of the results
+
+ res <- matrix(NA, nrow = k, ncol = n)
+ rownames(res) <- paste("k = ", 1:k, sep = "")
+ colnames(res) <- rep("", n)
+
+ # Loop over k
+
+ for (i in 1:k) {
+
+ tmp <- 1
+
+ while (any(is.na(res[i, ]))) { # Keep looping if there are still missing entries in the result-matrix
+ if (length(findfactors(tmp)) == i) { # Check number of factors
+ res[i, which.max(is.na(res[i, ]))] <- tmp
+ }
+ tmp <- tmp + 1
+ }
+ }
+ print(res)
+}
diff --git a/Task/Almost-prime/REXX/almost-prime.rexx b/Task/Almost-prime/REXX/almost-prime.rexx
index f3c43280a4..92dc76fe97 100644
--- a/Task/Almost-prime/REXX/almost-prime.rexx
+++ b/Task/Almost-prime/REXX/almost-prime.rexx
@@ -1,28 +1,32 @@
-/*REXX program computes & displays N numbers of the first K k─almost primes.*/
-parse arg N K . /*get optional arguments from the C.L. */
-if N=='' then N=10 /*N not specified? Then use default.*/
-if K=='' then K= 5; w=length(k) /*K " " " " " */
- /*W: is the width of K, used for output*/
- do m=1 for K; $=2**m; fir=$ /*generate & assign 1st k─almost prime.*/
- #=1; if #==N then leave /*#: k─almost primes; Enough are found?*/
- #=2; $=$ 3*(2**(m-1)) /*generate & append 2nd k─almost prime.*/
- do j=fir+fir+1 until #==N /*process an almost-prime N times.*/
- if #factr(j)\==m then iterate /*not the correct k─almost prime? */
- #=#+1; $=$ j /*bump K─almost counter; append it to $*/
- end /*j*/ /* [↑] generate N k─almost primes.*/
- say right(m,w)"─almost ("N') primes:' $ /*displays " " " " */
- end /*m*/ /* [↑] display a line for each K-prime*/
-exit /*stick a fork in it, we're all done. */
-/*────────────────────────────────────────────────────────────────────────────*/
-#factr: procedure; parse arg x 1 z /*defines X and Z to the argument. */
- do f=0 while z//2==0; z=z%2; end /*÷ by 2s.*/
- do f=f while z//3==0; z=z%3; end /*÷ " 3s.*/
- do f=f while z//5==0; z=z%5; end /*÷ " 5s.*/
-j=5
- do y=0 by 2; j=j+2+y//4 /*insure J isn't divisible by three. */
- parse var j '' -1 _ /*obtain the right─most decimal digit. */
- if _==5 then iterate /*fast check for divisible by five. */
- if j>z then leave /*is number reduced to the smallest # ?*/
- do f=f+1 while z//j==0; z=z%j; end; f=f-1 /*÷ by Js.*/
- end /*y*/ /* [↑] find all the factors in X. */
-return max(f,1) /*if prime (f==0), then return 1. */
+/*REXX program computes and displays the first N K─almost primes from 1 ── ►K. */
+parse arg N K . /*get optional arguments from the C.L. */
+if N=='' | N=="," then N=10 /*N not specified? Then use default.*/
+if K=='' | K=="," then K= 5 /*K " " " " " */
+ /*W: is the width of K, used for output*/
+ do m=1 for K; $=2**m; fir=$ /*generate & assign 1st K─almost prime.*/
+ #=1; if #==N then leave /*#: K─almost primes; Enough are found?*/
+ #=2; $=$ 3*(2**(m-1)) /*generate & append 2nd K─almost prime.*/
+ if #==N then leave /*#: K─almost primes; Enough are found?*/
+ if m==1 then _=fir+fir /* [↓] gen & append 3rd K─almost prime*/
+ else do; _=9*(2**(m-2)); #=3; $=$ _; end
+ do j=_+m-1 until #==N /*process an K─almost prime N times.*/
+ if #factr()\==m then iterate /*not the correct K─almost prime? */
+ #=#+1; $=$ j /*bump K─almost counter; append it to $*/
+ end /*j*/ /* [↑] generate N K─almost primes.*/
+ say right(m, length(K))"─almost ("N') primes:' $
+ end /*m*/ /* [↑] display a line for each K─prime*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+#factr: z=j; do f=0 while z//2==0; z=z%2; end /*divisible by 2. */
+ do f=f while z//3==0; z=z%3; end /*divisible " 3. */
+ do f=f while z//5==0; z=z%5; end /*divisible " 5. */
+ do f=f while z//7==0; z=z%7; end /*divisible " 7. */
+ do i=11 by 6 while i<=z /*insure I isn't divisible by three. */
+ parse var i '' -1 _ /*obtain the right─most decimal digit. */
+ /* [↓] fast check for divisible by 5. */
+ if _\==5 then do; do f=f+1 while z//i==0; z=z%i; end; f=f-1; end /*divisible by I. */
+ if _==3 then iterate /*fast check for X divisible by five.*/
+ x=i+2; do f=f+1 while z//x==0; z=z%x; end; f=f-1 /*divisible by X. */
+ end /*i*/ /* [↑] find all the factors in Z. */
+
+return max(f, 1) /*if prime (f==0), then return unity.*/
diff --git a/Task/Almost-prime/ZX-Spectrum-Basic/almost-prime.zx b/Task/Almost-prime/ZX-Spectrum-Basic/almost-prime.zx
new file mode 100644
index 0000000000..a65f0a4065
--- /dev/null
+++ b/Task/Almost-prime/ZX-Spectrum-Basic/almost-prime.zx
@@ -0,0 +1,18 @@
+10 FOR k=1 TO 5
+20 PRINT k;":";
+30 LET c=0: LET i=1
+40 IF c=10 THEN GO TO 100
+50 LET i=i+1
+60 GO SUB 1000
+70 IF r THEN PRINT " ";i;: LET c=c+1
+90 GO TO 40
+100 PRINT
+110 NEXT k
+120 STOP
+1000 REM kprime
+1010 LET p=2: LET n=i: LET f=0
+1020 IF f=k OR (p*p)>n THEN GO TO 1100
+1030 IF n/p=INT (n/p) THEN LET n=n/p: LET f=f+1: GO TO 1030
+1040 LET p=p+1: GO TO 1020
+1100 LET r=(f+(n>1)=k)
+1110 RETURN
diff --git a/Task/Amb/Perl-6/amb-1.pl6 b/Task/Amb/Perl-6/amb-1.pl6
index d62d77b93d..d7961a5a0e 100644
--- a/Task/Amb/Perl-6/amb-1.pl6
+++ b/Task/Amb/Perl-6/amb-1.pl6
@@ -1,18 +1,18 @@
-sub infix: ($a,$b) {
- next unless try $a.substr(*-1,1) eq $b.substr(0,1);
- "$a $b";
+#| an array of four words, that have more possible values.
+#| Normally we would want `any' to signify we want any of the values, but well negate later and thus we need `all'
+my @a =
+(all «the that a»),
+(all «frog elephant thing»),
+(all «walked treaded grows»),
+(all «slowly quickly»);
+
+sub test (Str $l, Str $r) {
+ $l.ends-with($r.substr(0,1))
}
-multi dethunk(Callable $x) { try take $x() }
-multi dethunk( Any $x) { take $x }
-
-sub amb (*@c) { gather @c».&dethunk }
-
-say first *, do
- amb(, { die 'oops'}) Xlf
- amb('frog',{'elephant'},'thing') Xlf
- amb() Xlf
- amb { die 'poison dart' },
- {'slowly'},
- {'quickly'},
- { die 'fire' };
+(sub ($w1, $w2, $w3, $w4){
+ # return if the values are false
+ return unless [and] test($w1, $w2), test($w2, $w3),test($w3, $w4);
+ # say the results. If there is one more Container layer around them this doesn't work, this is why we need the arguments here.
+ say "$w1 $w2 $w3 $w4"
+})(|@a); # supply the array as argumetns
diff --git a/Task/Amb/Perl-6/amb-2.pl6 b/Task/Amb/Perl-6/amb-2.pl6
index 16c2c2dd70..d62d77b93d 100644
--- a/Task/Amb/Perl-6/amb-2.pl6
+++ b/Task/Amb/Perl-6/amb-2.pl6
@@ -1,22 +1,18 @@
-sub amb($var,*@a) {
- "[{
- @a.pick(*).map: {"||\{ $var = '$_' }"}
- }]";
+sub infix: ($a,$b) {
+ next unless try $a.substr(*-1,1) eq $b.substr(0,1);
+ "$a $b";
}
-sub joins ($word1, $word2) {
- substr($word1,*-1,1) eq substr($word2,0,1)
-}
+multi dethunk(Callable $x) { try take $x() }
+multi dethunk( Any $x) { take $x }
-'' ~~ m/
- :my ($a,$b,$c,$d);
- <{ amb '$a', }>
- <{ amb '$b', }>
- { joins $a, $b }>
- <{ amb '$c', }>
- { joins $b, $c }>
- <{ amb '$d', }>
- { joins $c, $d }>
- { say "$a $b $c $d" }
-
-/;
+sub amb (*@c) { gather @c».&dethunk }
+
+say first *, do
+ amb(, { die 'oops'}) Xlf
+ amb('frog',{'elephant'},'thing') Xlf
+ amb() Xlf
+ amb { die 'poison dart' },
+ {'slowly'},
+ {'quickly'},
+ { die 'fire' };
diff --git a/Task/Amb/Perl-6/amb-3.pl6 b/Task/Amb/Perl-6/amb-3.pl6
new file mode 100644
index 0000000000..16c2c2dd70
--- /dev/null
+++ b/Task/Amb/Perl-6/amb-3.pl6
@@ -0,0 +1,22 @@
+sub amb($var,*@a) {
+ "[{
+ @a.pick(*).map: {"||\{ $var = '$_' }"}
+ }]";
+}
+
+sub joins ($word1, $word2) {
+ substr($word1,*-1,1) eq substr($word2,0,1)
+}
+
+'' ~~ m/
+ :my ($a,$b,$c,$d);
+ <{ amb '$a', }>
+ <{ amb '$b', }>
+ { joins $a, $b }>
+ <{ amb '$c', }>
+ { joins $b, $c }>
+ <{ amb '$d', }>
+ { joins $c, $d }>
+ { say "$a $b $c $d" }
+
+/;
diff --git a/Task/Amicable-pairs/00DESCRIPTION b/Task/Amicable-pairs/00DESCRIPTION
index c15152bac6..38c7bb2408 100644
--- a/Task/Amicable-pairs/00DESCRIPTION
+++ b/Task/Amicable-pairs/00DESCRIPTION
@@ -1,11 +1,18 @@
Two integers and are said to be [[wp:Amicable numbers|amicable pairs]] if and the sum of the [[Proper divisors|proper divisors]] of () as well as .
-For example 1184 and 1210 are an amicable pair (with proper divisors 1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592 and 1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605 respectively).
+
+;Example:
+'''1184''' and '''1210''' are an amicable pair, with proper divisors:
+* 1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592 and
+* 1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605 respectively.
+
;Task:
Calculate and show here the Amicable pairs below 20,000; (there are eight).
-;Cf.
+
+;Related tasks
* [[Proper divisors]]
* [[Abundant, deficient and perfect number classifications]]
* [[Aliquot sequence classifications]] and its amicable ''classification''.
+
diff --git a/Task/Amicable-pairs/ALGOL-68/amicable-pairs.alg b/Task/Amicable-pairs/ALGOL-68/amicable-pairs.alg
new file mode 100644
index 0000000000..11f5cffa1c
--- /dev/null
+++ b/Task/Amicable-pairs/ALGOL-68/amicable-pairs.alg
@@ -0,0 +1,43 @@
+# resturns the sum of the proper divisors of n #
+# if n = 1, 0 or -1, we return 0 #
+PROC sum proper divisors = ( INT n )INT:
+ BEGIN
+ INT result := 0;
+ INT abs n = ABS n;
+ IF abs n > 1 THEN
+ FOR d FROM ENTIER sqrt( abs n ) BY -1 TO 2 DO
+ IF abs n MOD d = 0 THEN
+ # found another divisor #
+ result +:= d;
+ IF d * d /= n THEN
+ # include the other divisor #
+ result +:= n OVER d
+ FI
+ FI
+ OD;
+ # 1 is always a proper divisor of numbers > 1 #
+ result +:= 1
+ FI;
+ result
+ END # sum proper divisors # ;
+
+# construct a table of the sum of the proper divisors of numbers #
+# up to 20 000 #
+INT max number = 20 000;
+[ 1 : max number ]INT proper divisor sum;
+FOR n TO UPB proper divisor sum DO proper divisor sum[ n ] := sum proper divisors( n ) OD;
+
+# returns TRUE if n1 and n2 are an amicable pair FALSE otherwise #
+# n1 and n2 are amicable if the sum of the proper diviors #
+# n1 = n2 and the sum of the proper divisors of n2 = n1 #
+PROC is an amicable pair = ( INT n1, n2 )BOOL:
+ ( proper divisor sum[ n1 ] = n2 AND proper divisor sum[ n2 ] = n1 );
+
+# find the amicable pairs up to 20 000 #
+FOR p1 TO max number DO
+ FOR p2 FROM p1 + 1 TO max number DO
+ IF is an amicable pair( p1, p2 ) THEN
+ print( ( whole( p1, -6 ), " and ", whole( p2, -6 ), " are a amicable pair", newline ) )
+ FI
+ OD
+OD
diff --git a/Task/Amicable-pairs/AppleScript/amicable-pairs-1.applescript b/Task/Amicable-pairs/AppleScript/amicable-pairs-1.applescript
new file mode 100644
index 0000000000..e4e6622739
--- /dev/null
+++ b/Task/Amicable-pairs/AppleScript/amicable-pairs-1.applescript
@@ -0,0 +1,145 @@
+-- amicablePairsUpTo :: Int -> Int
+on amicablePairsUpTo(max)
+
+ -- amicable :: [Int] -> Int -> Int -> [Int] -> [Int]
+ script amicable
+ on lambda(lstAccumulator, m, n, lstSums)
+ if (m > n) and (m ≤ max) and ((item m of lstSums) = n) then
+ lstAccumulator & [[n, m]]
+ else
+ lstAccumulator
+ end if
+ end lambda
+ end script
+
+ -- divisorsSummed :: Int -> Int
+ script divisorsSummed
+ -- sum :: Int -> Int -> Int
+ script sum
+ on lambda(a, b)
+ a + b
+ end lambda
+ end script
+
+ on lambda(n)
+ foldl(sum, 0, properDivisors(n))
+ end lambda
+ end script
+
+ foldl(amicable, [], ¬
+ map(divisorsSummed, range(1, max)))
+end amicablePairsUpTo
+
+
+-- TEST
+
+on run
+
+ amicablePairsUpTo(20000)
+
+end run
+
+
+-- PROPER DIVISORS
+
+-- properDivisors :: Int -> [Int]
+on properDivisors(n)
+
+ -- isFactor :: Int -> Bool
+ script isFactor
+ on lambda(x)
+ n mod x = 0
+ end lambda
+ end script
+
+ -- integerQuotient :: Int -> Int
+ script integerQuotient
+ on lambda(x)
+ (n / x) as integer
+ end lambda
+ end script
+
+ if n = 1 then
+ {1}
+ else
+ set realRoot to n ^ (1 / 2)
+ set intRoot to realRoot as integer
+ set blnPerfectSquare to intRoot = realRoot
+
+ -- Factors up to square root of n,
+ set lows to filter(isFactor, range(1, intRoot))
+
+ -- and quotients of these factors beyond the square root,
+ -- excluding n itself (last item)
+ items 1 thru -2 of (lows & map(integerQuotient, ¬
+ items (1 + (blnPerfectSquare as integer)) thru -1 of reverse of lows))
+ end if
+end properDivisors
+
+
+---------------------------------------------------------------------------
+
+-- GENERIC LIBRARY FUNCTIONS
+
+-- filter :: (a -> Bool) -> [a] -> [a]
+on filter(f, xs)
+ tell mReturn(f)
+ set lst to {}
+ set lng to length of xs
+ repeat with i from 1 to lng
+ set v to item i of xs
+ if lambda(v, i, xs) then set end of lst to v
+ end repeat
+ return lst
+ end tell
+end filter
+
+-- foldl :: (a -> b -> a) -> a -> [b] -> a
+on foldl(f, startValue, xs)
+ tell mReturn(f)
+ set v to startValue
+ set lng to length of xs
+ repeat with i from 1 to lng
+ set v to lambda(v, item i of xs, i, xs)
+ end repeat
+ return v
+ end tell
+end foldl
+
+-- map :: (a -> b) -> [a] -> [b]
+on map(f, xs)
+ tell mReturn(f)
+ set lng to length of xs
+ set lst to {}
+ repeat with i from 1 to lng
+ set end of lst to lambda(item i of xs, i, xs)
+ end repeat
+ return lst
+ end tell
+end map
+
+-- range :: Int -> Int -> [Int]
+on range(m, n)
+ if n < m then
+ set d to -1
+ else
+ set d to 1
+ end if
+ set lst to {}
+ repeat with i from m to n by d
+ set end of lst to i
+ end repeat
+ return lst
+end range
+
+-- Lift 2nd class handler function into 1st class script wrapper
+-- mReturn :: Handler -> Script
+on mReturn(f)
+ if class of f is script then
+ f
+ else
+ script
+ property lambda : f
+ end script
+ end if
+end mReturn
diff --git a/Task/Amicable-pairs/AppleScript/amicable-pairs-2.applescript b/Task/Amicable-pairs/AppleScript/amicable-pairs-2.applescript
new file mode 100644
index 0000000000..cff6092df9
--- /dev/null
+++ b/Task/Amicable-pairs/AppleScript/amicable-pairs-2.applescript
@@ -0,0 +1,2 @@
+{{220, 284}, {1184, 1210}, {2620, 2924}, {5020, 5564},
+{6232, 6368}, {10744, 10856}, {12285, 14595}, {17296, 18416}}
diff --git a/Task/Amicable-pairs/C++/amicable-pairs.cpp b/Task/Amicable-pairs/C++/amicable-pairs.cpp
new file mode 100644
index 0000000000..d6874b5eab
--- /dev/null
+++ b/Task/Amicable-pairs/C++/amicable-pairs.cpp
@@ -0,0 +1,48 @@
+#include
+#include
+#include
+
+int main() {
+ std::vector alreadyDiscovered;
+ std::unordered_map divsumMap;
+ int count = 0;
+
+ for (int N = 1; N <= 20000; ++N)
+ {
+ int divSumN = 0;
+
+ for (int i = 1; i <= N / 2; ++i)
+ {
+ if (fmod(N, i) == 0)
+ {
+ divSumN += i;
+ }
+ }
+
+ // populate map of integers to the sum of their proper divisors
+ if (divSumN != 1) // do not include primes
+ divsumMap[N] = divSumN;
+
+ for (std::unordered_map::iterator it = divsumMap.begin(); it != divsumMap.end(); ++it)
+ {
+ int M = it->first;
+ int divSumM = it->second;
+ int divSumN = divsumMap[N];
+
+ if (N != M && divSumM == N && divSumN == M)
+ {
+ // do not print duplicate pairs
+ if (std::find(alreadyDiscovered.begin(), alreadyDiscovered.end(), N) != alreadyDiscovered.end())
+ break;
+
+ std::cout << "[" << M << ", " << N << "]" << std::endl;
+
+ alreadyDiscovered.push_back(M);
+ alreadyDiscovered.push_back(N);
+ count++;
+ }
+ }
+ }
+
+ std::cout << count << " amicable pairs discovered" << std::endl;
+}
diff --git a/Task/Amicable-pairs/C-sharp/amicable-pairs.cs b/Task/Amicable-pairs/C-sharp/amicable-pairs.cs
new file mode 100644
index 0000000000..deb9cacb03
--- /dev/null
+++ b/Task/Amicable-pairs/C-sharp/amicable-pairs.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace RosettaCode.AmicablePairs
+{
+ internal static class Program {
+ private const int Limit = 20000;
+
+ private static void Main()
+ {
+ foreach (var pair in GetPairs(Limit))
+ {
+ Console.WriteLine("{0} {1}", pair.Item1, pair.Item2);
+ }
+ }
+
+ private static IEnumerable> GetPairs(int max)
+ {
+ List divsums =
+ Enumerable.Range(0, max + 1).Select(i => ProperDivisors(i).Sum()).ToList();
+ for(int i=1; i(i, sum);
+ }
+ }
+ }
+
+ private static IEnumerable ProperDivisors(int number)
+ {
+ return
+ Enumerable.Range(1, number / 2)
+ .Where(divisor => number % divisor == 0);
+ }
+ }
+}
diff --git a/Task/Amicable-pairs/Ela/amicable-pairs.ela b/Task/Amicable-pairs/Ela/amicable-pairs.ela
new file mode 100644
index 0000000000..464645e74b
--- /dev/null
+++ b/Task/Amicable-pairs/Ela/amicable-pairs.ela
@@ -0,0 +1,8 @@
+open monad io number list
+
+divisors n = filter ((0 ==) << (n `mod`)) [1..(n `div` 2)]
+range = [1 .. 20000]
+divs = zip range $ map (sum << divisors) range
+pairs = [(n, m) \\ (n, nd) <- divs, (m, md) <- divs | n < m && nd == m && md == n]
+
+do putLn pairs ::: IO
diff --git a/Task/Amicable-pairs/Elixir/amicable-pairs.elixir b/Task/Amicable-pairs/Elixir/amicable-pairs.elixir
new file mode 100644
index 0000000000..2abea4c098
--- /dev/null
+++ b/Task/Amicable-pairs/Elixir/amicable-pairs.elixir
@@ -0,0 +1,14 @@
+defmodule Proper do
+ def divisors(1), do: []
+ def divisors(n), do: [1 | divisors(2,n,:math.sqrt(n))] |> Enum.sort
+
+ defp divisors(k,_n,q) when k>q, do: []
+ defp divisors(k,n,q) when rem(n,k)>0, do: divisors(k+1,n,q)
+ defp divisors(k,n,q) when k * k == n, do: [k | divisors(k+1,n,q)]
+ defp divisors(k,n,q) , do: [k,div(n,k) | divisors(k+1,n,q)]
+end
+
+map = Enum.into(1..20000, %{}, fn n -> {n, Proper.divisors(n) |> Enum.sum} end)
+Enum.filter(map, fn {n,sum} -> map[sum] == n and n < sum end)
+|> Enum.sort
+|> Enum.each(fn {i,j} -> IO.puts "#{i} and #{j}" end)
diff --git a/Task/Amicable-pairs/Java/amicable-pairs.java b/Task/Amicable-pairs/Java/amicable-pairs.java
new file mode 100644
index 0000000000..e20197426e
--- /dev/null
+++ b/Task/Amicable-pairs/Java/amicable-pairs.java
@@ -0,0 +1,27 @@
+import java.util.Map;
+import static java.util.function.Function.*;
+import static java.util.stream.Collectors.*;
+import static java.util.stream.LongStream.*;
+
+public class AmicablePairs {
+
+ public static void main(String[] args) {
+ final int limit = 20_000;
+
+ Map map = rangeClosed(1, limit)
+ .parallel()
+ .boxed()
+ .collect(toMap(identity(), AmicablePairs::properDivsSum));
+
+ rangeClosed(1, limit)
+ .forEach(n -> {
+ long m = map.get(n);
+ if (m > n && m <= limit && map.get(m) == n)
+ System.out.printf("%s %s %n", n, m);
+ });
+ }
+
+ public static Long properDivsSum(long n) {
+ return rangeClosed(1, (n + 1) / 2).filter(i -> n % i == 0).sum();
+ }
+}
diff --git a/Task/Amicable-pairs/JavaScript/amicable-pairs-3.js b/Task/Amicable-pairs/JavaScript/amicable-pairs-3.js
new file mode 100644
index 0000000000..928e889293
--- /dev/null
+++ b/Task/Amicable-pairs/JavaScript/amicable-pairs-3.js
@@ -0,0 +1,46 @@
+(max => {
+
+ // amicablePairsUpTo :: Int -> [(Int, Int)]
+ let amicablePairsUpTo = max =>
+ range(1, max)
+ .map(x => properDivisors(x)
+ .reduce((a, b) => a + b, 0))
+ .reduce((a, m, i, lst) => {
+ let n = i + 1;
+
+ return (m > n) && lst[m - 1] === n ?
+ a.concat([[n, m]]) : a;
+ }, []),
+
+
+ // properDivisors :: Int -> [Int]
+ properDivisors = n => {
+ if (n < 2) return [];
+ else {
+ let rRoot = Math.sqrt(n),
+ intRoot = Math.floor(rRoot),
+ blnPerfectSquare = rRoot === intRoot,
+
+ lows = range(1, intRoot)
+ .filter(x => (n % x) === 0);
+
+ return lows.concat(lows.slice(1)
+ .map(x => n / x)
+ .reverse()
+ .slice(blnPerfectSquare | 0));
+ }
+ },
+
+ // Int -> Int -> Maybe Int -> [Int]
+ range = (m, n, step) => {
+ let d = (step || 1) * (n >= m ? 1 : -1);
+
+ return Array.from({
+ length: Math.floor((n - m) / d) + 1
+ }, (_, i) => m + (i * d));
+ }
+
+
+ return amicablePairsUpTo(max);
+
+})(20000);
diff --git a/Task/Amicable-pairs/JavaScript/amicable-pairs-4.js b/Task/Amicable-pairs/JavaScript/amicable-pairs-4.js
new file mode 100644
index 0000000000..3184c67556
--- /dev/null
+++ b/Task/Amicable-pairs/JavaScript/amicable-pairs-4.js
@@ -0,0 +1,2 @@
+[[220, 284], [1184, 1210], [2620, 2924], [5020, 5564],
+[6232, 6368], [10744, 10856], [12285, 14595], [17296, 18416]]
diff --git a/Task/Amicable-pairs/K/amicable-pairs.k b/Task/Amicable-pairs/K/amicable-pairs.k
new file mode 100644
index 0000000000..0d574fd1ad
--- /dev/null
+++ b/Task/Amicable-pairs/K/amicable-pairs.k
@@ -0,0 +1,10 @@
+ propdivs:{1+&0=x!'1+!x%2}
+ (8,2)#v@&{(x=+/propdivs[a])&~x=a:+/propdivs[x]}' v:1+!20000
+(220 284
+ 1184 1210
+ 2620 2924
+ 5020 5564
+ 6232 6368
+ 10744 10856
+ 12285 14595
+ 17296 18416)
diff --git a/Task/Amicable-pairs/Lua/amicable-pairs.lua b/Task/Amicable-pairs/Lua/amicable-pairs.lua
new file mode 100644
index 0000000000..1961bf0020
--- /dev/null
+++ b/Task/Amicable-pairs/Lua/amicable-pairs.lua
@@ -0,0 +1,17 @@
+function sumDivs (n)
+ local sum = 1
+ for d = 2, math.sqrt(n) do
+ if n % d == 0 then
+ sum = sum + d
+ sum = sum + n / d
+ end
+ end
+ return sum
+end
+
+for n = 2, 20000 do
+ m = sumDivs(n)
+ if m > n then
+ if sumDivs(m) == n then print(n, m) end
+ end
+end
diff --git a/Task/Amicable-pairs/PowerShell/amicable-pairs.psh b/Task/Amicable-pairs/PowerShell/amicable-pairs.psh
new file mode 100644
index 0000000000..1a2282d4a4
--- /dev/null
+++ b/Task/Amicable-pairs/PowerShell/amicable-pairs.psh
@@ -0,0 +1,29 @@
+function Get-ProperDivisorSum ( [int]$N )
+ {
+ $Sum = 1
+ If ( $N -gt 3 )
+ {
+ $SqrtN = [math]::Sqrt( $N )
+ ForEach ( $Divisor1 in 2..$SqrtN )
+ {
+ $Divisor2 = $N / $Divisor1
+ If ( $Divisor2 -is [int] ) { $Sum += $Divisor1 + $Divisor2 }
+ }
+ If ( $SqrtN -is [int] ) { $Sum -= $SqrtN }
+ }
+ return $Sum
+ }
+
+function Get-AmicablePairs ( $N = 300 )
+ {
+ ForEach ( $X in 1..$N )
+ {
+ $Sum = Get-ProperDivisorSum $X
+ If ( $Sum -gt $X -and $X -eq ( Get-ProperDivisorSum $Sum ) )
+ {
+ "$X, $Sum"
+ }
+ }
+ }
+
+Get-AmicablePairs 20000
diff --git a/Task/Amicable-pairs/PureBasic/amicable-pairs.purebasic b/Task/Amicable-pairs/PureBasic/amicable-pairs.purebasic
new file mode 100644
index 0000000000..17b0544169
--- /dev/null
+++ b/Task/Amicable-pairs/PureBasic/amicable-pairs.purebasic
@@ -0,0 +1,34 @@
+EnableExplicit
+
+Procedure.i SumProperDivisors(Number)
+ If Number < 2 : ProcedureReturn 0 : EndIf
+ Protected i, sum = 0
+ For i = 1 To Number / 2
+ If Number % i = 0
+ sum + i
+ EndIf
+ Next
+ ProcedureReturn sum
+EndProcedure
+
+Define n, f
+Define Dim sum(19999)
+
+If OpenConsole()
+ For n = 1 To 19999
+ sum(n) = SumProperDivisors(n)
+ Next
+ PrintN("The pairs of amicable numbers below 20,000 are : ")
+ PrintN("")
+ For n = 1 To 19998
+ f = sum(n)
+ If f <= n Or f < 1 Or f > 19999 : Continue : EndIf
+ If f = sum(n) And n = sum(f)
+ PrintN(RSet(Str(n),5) + " and " + RSet(Str(sum(n)), 5))
+ EndIf
+ Next
+ PrintN("")
+ PrintN("Press any key to close the console")
+ Repeat: Delay(10) : Until Inkey() <> ""
+ CloseConsole()
+EndIf
diff --git a/Task/Amicable-pairs/REXX/amicable-pairs-2.rexx b/Task/Amicable-pairs/REXX/amicable-pairs-2.rexx
index 5adbef2791..ef205f1716 100644
--- a/Task/Amicable-pairs/REXX/amicable-pairs-2.rexx
+++ b/Task/Amicable-pairs/REXX/amicable-pairs-2.rexx
@@ -1,30 +1,26 @@
-/*REXX program finds and displays all amicable pairs up to a given number. */
-parse arg H .; if H=='' then H=20000 /*get optional arguments (high limit).*/
-w=length(H) ; low=220 /*W: used for columnar output alignment*/
-@.=. /* [↑] LOW is lowest amicable number. */
- do k=low for H-low; _=sigma(k) /*generate sigma sums for a range of #s*/
- if _>=low then @.k=_ /*only keep the pertinent sigma sums. */
- end /*k*/ /* [↑] process a range of integers. */
-#=0 /*number of amicable pairs found so far*/
- do m=low to H; n=@.m /*start the search at the lowest number*/
- if n==. then iterate /*if not pertinent, then ignore the #.*/
- if m==@.n then do /*If equal, might be an amicable number*/
- if m==n then iterate /*skip any perfect numbers. */
- #=#+1 /*bump amicable pair counter.*/
- say right(m,w) ' and ' right(n,w) " are an amicable pair."
- m=n /*start M (DO index) from N.*/
- end
- end /*m*/
+/*REXX program calculates and displays all amicable pairs up to a given number. */
+parse arg H .; if H=='' | H=="," then H=20000 /*get optional arguments (high limit).*/
+w=length(H) ; low=220 /*W: used for columnar output alignment*/
+@.=. /* [↑] LOW is lowest amicable number. */
+ do k=low for H-low; _=sigma(k) /*generate sigma sums for a range of #s*/
+ if _>=low then @.k=_ /*only keep the pertinent sigma sums. */
+ end /*k*/ /* [↑] process a range of integers. */
+#=0 /*number of amicable pairs found so far*/
+ do m=low to H; n=@.m /*start the search at the lowest number*/
+ if m==@.n then do /*If equal, might be an amicable number*/
+ if m==n then iterate /*Is this a perfect number? Then skip.*/
+ #=#+1 /*bump the amicable pair counter. */
+ say right(m,w) ' and ' right(n,w) " are an amicable pair."
+ m=n /*start M (DO index) from N. */
+ end
+ end /*m*/
say
-say # 'amicable pairs found up to' H /*display count of the amicable pairs. */
-exit /*stick a fork in it, we're all done. */
-/*────────────────────────────────────────────────────────────────────────────*/
-sigma: procedure; parse arg x; od=x//2 /*use either EVEN or ODD integers. */
-s=1 /*set initial sigma sum to one. ___*/
- do j=2+od by 1+od while j*j1; q=q%4; _=x-r-q; r=r%2; if _>=0 then do;x=_;r=r+q; end;end
+say # 'amicable pairs found up to' H /*display the count of amicable pairs. */
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+iSqrt: procedure; parse arg x; r=0; q=1; do while q<=x; q=q*4; end
+ do while q>1; q=q%4; _=x-r-q; r=r%2; if _>=0 then do;x=_;r=r+q; end; end
return r
-/*────────────────────────────────────────────────────────────────────────────*/
-sigma: procedure; parse arg x; od=x//2 /*use either EVEN or ODD integers. */
-s=1 /*set initial sigma sum to unity. ___*/
- do j=2+od by 1+od to iSqrt(x) /*divide by all integers up to the √ x */
- if x//j==0 then s=s + j + x%j /*add the two divisors to the sum. */
- end /*j*/ /* [↑] % is REXX integer division. */
-return s /*return the sum of the divisors. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+sigma: procedure; parse arg x; od=x//2 /*use either EVEN or ODD integers. */
+ s=1 /*set initial sigma sum to unity. ___*/
+ do j=2+od by 1+od to iSqrt(x) /*divide by all integers up to the √ x */
+ if x//j==0 then s=s + j + x%j /*add the two divisors to the sum. */
+ end /*j*/ /* [↑] % is the REXX integer division.*/
+ return s /*return the sum of the divisors. */
diff --git a/Task/Amicable-pairs/REXX/amicable-pairs-5.rexx b/Task/Amicable-pairs/REXX/amicable-pairs-5.rexx
index 4632a279a3..60b7379be6 100644
--- a/Task/Amicable-pairs/REXX/amicable-pairs-5.rexx
+++ b/Task/Amicable-pairs/REXX/amicable-pairs-5.rexx
@@ -1,30 +1,27 @@
-/*REXX program finds and displays all amicable pairs up to a given number. */
-parse arg H .; if H=='' then H=20000 /*get optional arguments (high limit).*/
-w=length(H) ; low=220 /*W: used for columnar output alignment*/
-x=220 34765731 6232 87633 284 12285 10856 36939357 6368 5684679 /*S minimums.*/
-y=220 34765731 6232 69615 220 12285 10744 34765731 6232 5357625 /*D minimums.*/
- do i=0 for 10; $.i=word(x,i+1); L.i=word(y,i+1); end /*minimum amicable #s.*/
-#=0 /*number of amicable pairs found so far*/
-@.= /* [↑] LOW is lowest amicable number. */
- do k=low for H-low /*generate sigma sums for a range of #s*/
- parse var k '' -1 D /*obtain last decimal digit of K. */
- if k<$.D then iterate /*if no need to compute, then skip it. */
- od=k//2 /*OD: set to unity if K is odd.*/
- z=k; r=0; q=1; do while q<=z; q=q*4; end /*R will be iSqrt of Z*/
- do while q>1; q=q%4; _=z-r-q; r=r%2; if _>=0 then do;z=_;r=r+q; end;end
- s=1 /*set initial sigma sum to unity. ___*/
- do j=2+od by 1+od to r /*divide by all integers up to the √ K */
- if k//j==0 then s=s+ j + k%j /*add the two divisors to the sum. */
- end /*j*/ /* [↑] % is REXX integer division. */
- if s10**digits(); f.p=4**p; end /*p*/ /*calc. pows of 4*/
+#=0 /*number of amicable pairs found so far*/
+@.= /* [↑] LOW is lowest amicable number. */
+ do k=low for H-low+1 /*generate sigma sums for a range of #s*/
+ parse var k '' -1 D /*obtain last decimal digit of K. */
+ if k<$.D then iterate /*if no need to compute, then skip it. */
+ od=k//2 /*OD: set to unity if K is odd.*/
+ z=k; q=1; do p=0 while f.p<=z; q=f.p; end /*R will end up being the iSqrt of Z.*/
+ r=0; do while q>1; q=q%4; _=z-r-q; r=r%2; if _>=0 then do; z=_; r=r+q; end; end
+ s=1 /*set initial sigma sum to unity. ___*/
+ do j=2+od by 1+od to r /*divide by all integers up to the √ K */
+ if k//j==0 then s=s+ j + k%j /*add the two divisors to the sum. */
+ end /*j*/ /* [↑] % is REXX integer division. */
+ @.k=s /*only keep the pertinent sigma sums. */
+ if k==@.s then do /*is it a possible amicable number ? */
+ if s==k then iterate /*Is it a perfect number? Then skip it*/
+ #=#+1 /*bump the amicable pair counter. */
+ say right(s,w) ' and ' right(k,w) " are an amicable pair."
end
- end /*k*/ /* [↑] process a range of integers. */
-say
-say # 'amicable pairs found up to' H /*display the count of amicable pairs. */
- /*stick a fork in it, we're all done. */
+ end /*k*/ /* [↑] process a range of integers. */
+say /*stick a fork in it, we're all done. */
+say # 'amicable pairs found up to' H /*display the count of amicable pairs. */
diff --git a/Task/Amicable-pairs/Run-BASIC/amicable-pairs.run b/Task/Amicable-pairs/Run-BASIC/amicable-pairs.run
new file mode 100644
index 0000000000..8215cdfda8
--- /dev/null
+++ b/Task/Amicable-pairs/Run-BASIC/amicable-pairs.run
@@ -0,0 +1,12 @@
+size = 18500
+for n = 1 to size
+ m = amicable(n)
+ if m > n and amicable(m) = n then print n ; " and " ; m
+next
+
+function amicable(nr)
+ amicable = 1
+ for d = 2 to sqr(nr)
+ if nr mod d = 0 then amicable = amicable + d + nr / d
+ next
+ end function
diff --git a/Task/Amicable-pairs/ZX-Spectrum-Basic/amicable-pairs.zx b/Task/Amicable-pairs/ZX-Spectrum-Basic/amicable-pairs.zx
new file mode 100644
index 0000000000..bea2fb66d8
--- /dev/null
+++ b/Task/Amicable-pairs/ZX-Spectrum-Basic/amicable-pairs.zx
@@ -0,0 +1,19 @@
+10 LET limit=20000
+20 PRINT "Amicable pairs < ";limit
+30 FOR n=1 TO limit
+40 LET num=n: GO SUB 1000
+50 LET m=num
+60 GO SUB 1000
+70 IF n=num AND n
diff --git a/Task/Anagrams-Deranged-anagrams/ALGOL-68/anagrams-deranged-anagrams.alg b/Task/Anagrams-Deranged-anagrams/ALGOL-68/anagrams-deranged-anagrams.alg
new file mode 100644
index 0000000000..94569e7611
--- /dev/null
+++ b/Task/Anagrams-Deranged-anagrams/ALGOL-68/anagrams-deranged-anagrams.alg
@@ -0,0 +1,124 @@
+# find the largest deranged anagrams in a list of words #
+# use the associative array in the Associate array/iteration task #
+PR read "aArray.a68" PR
+
+# returns the length of str #
+OP LENGTH = ( STRING str )INT: 1 + ( UPB str - LWB str );
+
+# returns TRUE if a and b are the same length and have no #
+# identical characters at any position, #
+# FALSE otherwise #
+PRIO ALLDIFFER = 9;
+OP ALLDIFFER = ( STRING a, b )BOOL:
+ IF LENGTH a /= LENGTH b
+ THEN
+ # the two stringa are not the same size #
+ FALSE
+ ELSE
+ # the strings are the same length, check the characters #
+ BOOL result := TRUE;
+ INT b pos := LWB b;
+ FOR a pos FROM LWB a TO UPB a WHILE result := ( a[ a pos ] /= b[ b pos ] )
+ DO
+ b pos +:= 1
+ OD;
+ result
+ FI # ALLDIFFER # ;
+
+# returns text with the characters sorted #
+OP SORT = ( STRING text )STRING:
+ BEGIN
+ STRING sorted := text;
+ FOR end pos FROM UPB sorted - 1 BY -1 TO LWB sorted
+ WHILE
+ BOOL swapped := FALSE;
+ FOR pos FROM LWB sorted TO end pos DO
+ IF sorted[ pos ] > sorted[ pos + 1 ]
+ THEN
+ CHAR t := sorted[ pos ];
+ sorted[ pos ] := sorted[ pos + 1 ];
+ sorted[ pos + 1 ] := t;
+ swapped := TRUE
+ FI
+ OD;
+ swapped
+ DO SKIP OD;
+ sorted
+ END # SORTED # ;
+
+# read the list of words and find the longest deranged anagrams #
+
+CHAR separator = "|"; # character that will separate the anagrams #
+
+IF FILE input file;
+ STRING file name = "unixdict.txt";
+ open( input file, file name, stand in channel ) /= 0
+THEN
+ # failed to open the file #
+ print( ( "Unable to open """ + file name + """", newline ) )
+ELSE
+ # file opened OK #
+ BOOL at eof := FALSE;
+ # set the EOF handler for the file #
+ on logical file end( input file, ( REF FILE f )BOOL:
+ BEGIN
+ # note that we reached EOF on the #
+ # latest read #
+ at eof := TRUE;
+ # return TRUE so processing can continue #
+ TRUE
+ END
+ );
+ REF AARRAY words := INIT LOC AARRAY;
+ STRING word;
+ INT longest derangement := 0;
+ STRING longest word := "";
+ STRING longest anagram := "";
+ WHILE NOT at eof
+ DO
+ STRING word;
+ get( input file, ( word, newline ) );
+ INT word length = LENGTH word;
+ IF word length >= longest derangement
+ THEN
+ # this word is at least long as the longest derangement #
+ # found so far - test it #
+ STRING sorted word = SORT word;
+ IF ( words // sorted word ) /= ""
+ THEN
+ # we already have this sorted word - test for #
+ # deranged anagrams #
+ # the word list will have a leading separator #
+ # and be followed by one or more words separated by #
+ # the separator #
+ STRING word list := words // sorted word;
+ INT list pos := LWB word list + 1;
+ INT list max = UPB word list;
+ BOOL is deranged := FALSE;
+ WHILE list pos < list max
+ AND NOT is deranged
+ DO
+ STRING anagram = word list[ list pos : ( list pos + word length ) - 1 ];
+ IF is deranged := word ALLDIFFER anagram
+ THEN
+ # have a deranged anagram #
+ longest derangement := word length;
+ longest word := word;
+ longest anagram := anagram
+ FI;
+ list pos +:= word length + 1
+ OD
+ FI;
+ # add the word to the anagram list #
+ words // sorted word +:= separator + word
+ FI
+ OD;
+ close( input file );
+ print( ( "Longest deranged anagrams: "
+ , longest word
+ , " and "
+ , longest anagram
+ , newline
+ )
+ )
+FI
diff --git a/Task/Anagrams-Deranged-anagrams/C-sharp/anagrams-deranged-anagrams.cs b/Task/Anagrams-Deranged-anagrams/C-sharp/anagrams-deranged-anagrams.cs
new file mode 100644
index 0000000000..9f79adab9d
--- /dev/null
+++ b/Task/Anagrams-Deranged-anagrams/C-sharp/anagrams-deranged-anagrams.cs
@@ -0,0 +1,20 @@
+public static void Main()
+{
+ var lookupTable = File.ReadLines("unixdict.txt").ToLookup(line => AnagramKey(line));
+ var query = from a in lookupTable
+ orderby a.Key.Length descending
+ let deranged = FindDeranged(a)
+ where deranged != null
+ select deranged[0] + " " + deranged[1];
+ Console.WriteLine(query.FirstOrDefault());
+}
+
+static string AnagramKey(string word) => new string(word.OrderBy(c => c).ToArray());
+
+static string[] FindDeranged(IEnumerable anagrams) => (
+ from first in anagrams
+ from second in anagrams
+ where !second.Equals(first)
+ && Enumerable.Range(0, first.Length).All(i => first[i] != second[i])
+ select new [] { first, second })
+ .FirstOrDefault();
diff --git a/Task/Anagrams-Deranged-anagrams/Elixir/anagrams-deranged-anagrams.elixir b/Task/Anagrams-Deranged-anagrams/Elixir/anagrams-deranged-anagrams.elixir
new file mode 100644
index 0000000000..09d9ac346c
--- /dev/null
+++ b/Task/Anagrams-Deranged-anagrams/Elixir/anagrams-deranged-anagrams.elixir
@@ -0,0 +1,30 @@
+defmodule Anagrams do
+ def deranged(fname) do
+ File.read!(fname)
+ |> String.split
+ |> Enum.group_by(fn word -> String.codepoints(word) |> Enum.sort end)
+ |> Enum.filter(fn {_,words} -> length(words) > 1 end)
+ |> Enum.sort_by(fn {key,_} -> -length(key) end)
+ |> Enum.find(fn {_,words} -> find_derangements(words) end)
+ end
+
+ defp find_derangements(words) do
+ comb(words,2) |> Enum.find(fn [a,b] -> deranged?(a,b) end)
+ end
+
+ defp deranged?(a,b) do
+ Enum.zip(String.codepoints(a), String.codepoints(b))
+ |> Enum.all?(fn {chr_a,chr_b} -> chr_a != chr_b end)
+ end
+
+ defp comb(_, 0), do: [[]]
+ defp comb([], _), do: []
+ defp comb([h|t], m) do
+ (for l <- comb(t, m-1), do: [h|l]) ++ comb(t, m)
+ end
+end
+
+case Anagrams.deranged("/work/unixdict.txt") do
+ {_, words} -> IO.puts "Longest derangement anagram: #{inspect words}"
+ _ -> IO.puts "derangement anagram: nothing"
+end
diff --git a/Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams.math b/Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams-1.math
similarity index 100%
rename from Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams.math
rename to Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams-1.math
diff --git a/Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams-2.math b/Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams-2.math
new file mode 100644
index 0000000000..2128cb0f03
--- /dev/null
+++ b/Task/Anagrams-Deranged-anagrams/Mathematica/anagrams-deranged-anagrams-2.math
@@ -0,0 +1,5 @@
+list = Import["http://www.puzzlers.org/pub/wordlists/unixdict.txt","Lines"];
+MaximalBy[
+ Select[GatherBy[list, Sort@*Characters],
+ Length@# > 1 && And @@ MapThread[UnsameQ, Characters /@ #] &],
+ StringLength@*First]
diff --git a/Task/Anagrams-Deranged-anagrams/PARI-GP/anagrams-deranged-anagrams.pari b/Task/Anagrams-Deranged-anagrams/PARI-GP/anagrams-deranged-anagrams.pari
new file mode 100644
index 0000000000..f0c18bbb11
--- /dev/null
+++ b/Task/Anagrams-Deranged-anagrams/PARI-GP/anagrams-deranged-anagrams.pari
@@ -0,0 +1,9 @@
+dict=readstr("unixdict.txt");
+len=apply(s->#s, dict);
+getLen(L)=my(v=List()); for(i=1,#dict, if(len[i]==L, listput(v, dict[i]))); Vec(v);
+letters(s)=vecsort(Vec(s));
+getAnagrams(v)=my(u=List(),L=apply(letters,v),t,w); for(i=1,#v-1, w=List(); t=L[i]; for(j=i+1,#v, if(L[j]==t, listput(w, v[j]))); if(#w, listput(u, concat([v[i]], Vec(w))))); Vec(u);
+deranged(s1,s2)=s1=Vec(s1);s2=Vec(s2); for(i=1,#s1, if(s1[i]==s2[i], return(0))); 1
+getDeranged(v)=my(u=List(),w); for(i=1,#v-1, for(j=i+1,#v, if(deranged(v[i], v[j]), listput(u, [v[i], v[j]])))); Vec(u);
+f(n)=my(t=getAnagrams(getLen(n))); if(#t, concat(apply(getDeranged, t)), []);
+forstep(n=vecmax(len),1,-1, t=f(n); if(#t, return(t)))
diff --git a/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams.pl6 b/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams.pl6
new file mode 100644
index 0000000000..9c5e51f99d
--- /dev/null
+++ b/Task/Anagrams-Deranged-anagrams/Perl-6/anagrams-deranged-anagrams.pl6
@@ -0,0 +1,15 @@
+my @anagrams = 'unixdict.txt'.IO.words
+ .map(*.comb.cache) # explode words into lists of characters
+ .classify(*.sort.join).values # group words with the same characters
+ .grep(* > 1) # only take groups with more than one word
+ .sort(-*[0]) # sort by length of the first word
+;
+
+for @anagrams -> @group {
+ for @group.combinations(2) -> [@a, @b] {
+ if none @a Zeq @b {
+ say "{@a.join} {@b.join}";
+ exit;
+ }
+ }
+}
diff --git a/Task/Anagrams/00DESCRIPTION b/Task/Anagrams/00DESCRIPTION
index 3092c3e883..76cec38222 100644
--- a/Task/Anagrams/00DESCRIPTION
+++ b/Task/Anagrams/00DESCRIPTION
@@ -1,2 +1,12 @@
-Two or more words can be composed of the same characters, but in a different order.
-Using the word list at http://www.puzzlers.org/pub/wordlists/unixdict.txt, find the sets of words that share the same characters that contain the most words in them.
+When two or more words are composed of the same characters, but in a different order, they are called [[wp:Anagram|anagrams]].
+
+{{task heading}}
+
+Using the word list at http://www.puzzlers.org/pub/wordlists/unixdict.txt,
+ find the sets of words that share the same characters that contain the most words in them.
+
+{{task heading|Related tasks}}
+
+{{Related tasks/Word plays}}
+
+
diff --git a/Task/Anagrams/ALGOL-68/anagrams.alg b/Task/Anagrams/ALGOL-68/anagrams.alg
new file mode 100644
index 0000000000..8fe12076cc
--- /dev/null
+++ b/Task/Anagrams/ALGOL-68/anagrams.alg
@@ -0,0 +1,93 @@
+# find longest list(s) of words that are anagrams in a list of words #
+# use the associative array in the Associate array/iteration task #
+PR read "aArray.a68" PR
+
+# returns the number of occurances of ch in text #
+PROC count = ( STRING text, CHAR ch )INT:
+ BEGIN
+ INT result := 0;
+ FOR c FROM LWB text TO UPB text DO IF text[ c ] = ch THEN result +:= 1 FI OD;
+ result
+ END # count # ;
+
+# returns text with the characters sorted into ascending order #
+PROC char sort = ( STRING text )STRING:
+ BEGIN
+ STRING sorted := text;
+ FOR end pos FROM UPB sorted - 1 BY -1 TO LWB sorted
+ WHILE
+ BOOL swapped := FALSE;
+ FOR pos FROM LWB sorted TO end pos DO
+ IF sorted[ pos ] > sorted[ pos + 1 ]
+ THEN
+ CHAR t := sorted[ pos ];
+ sorted[ pos ] := sorted[ pos + 1 ];
+ sorted[ pos + 1 ] := t;
+ swapped := TRUE
+ FI
+ OD;
+ swapped
+ DO SKIP OD;
+ sorted
+ END # char sort # ;
+
+# read the list of words and store in an associative array #
+
+CHAR separator = "|"; # character that will separate the anagrams #
+
+IF FILE input file;
+ STRING file name = "unixdict.txt";
+ open( input file, file name, stand in channel ) /= 0
+THEN
+ # failed to open the file #
+ print( ( "Unable to open """ + file name + """", newline ) )
+ELSE
+ # file opened OK #
+ BOOL at eof := FALSE;
+ # set the EOF handler for the file #
+ on logical file end( input file, ( REF FILE f )BOOL:
+ BEGIN
+ # note that we reached EOF on the #
+ # latest read #
+ at eof := TRUE;
+ # return TRUE so processing can continue #
+ TRUE
+ END
+ );
+ REF AARRAY words := INIT LOC AARRAY;
+ STRING word;
+ WHILE NOT at eof
+ DO
+ STRING word;
+ get( input file, ( word, newline ) );
+ words // char sort( word ) +:= separator + word
+ OD;
+ # close the file #
+ close( input file );
+
+ # find the maximum number of anagrams #
+
+ INT max anagrams := 0;
+
+ REF AAELEMENT e := FIRST words;
+ WHILE e ISNT nil element DO
+ IF INT anagrams := count( value OF e, separator );
+ anagrams > max anagrams
+ THEN
+ max anagrams := anagrams
+ FI;
+ e := NEXT words
+ OD;
+
+ print( ( "Maximum number of anagrams: ", whole( max anagrams, -4 ), newline ) );
+ # show the anagrams with the maximum number #
+ e := FIRST words;
+ WHILE e ISNT nil element DO
+ IF INT anagrams := count( value OF e, separator );
+ anagrams = max anagrams
+ THEN
+ print( ( ( value OF e )[ ( LWB value OF e ) + 1: ], newline ) )
+ FI;
+ e := NEXT words
+ OD
+FI
diff --git a/Task/Anagrams/COBOL/anagrams.cobol b/Task/Anagrams/COBOL/anagrams.cobol
new file mode 100644
index 0000000000..aab0308efd
--- /dev/null
+++ b/Task/Anagrams/COBOL/anagrams.cobol
@@ -0,0 +1,243 @@
+ *> TECTONICS
+ *> wget http://www.puzzlers.org/pub/wordlists/unixdict.txt
+ *> or visit https://sourceforge.net/projects/souptonuts/files
+ *> or snag ftp://ftp.openwall.com/pub/wordlists/all.gz
+ *> for a 5 million all language word file (a few phrases)
+ *> cobc -xj anagrams.cob [-DMOSTWORDS -DMOREWORDS -DALLWORDS]
+ *> ***************************************************************
+ identification division.
+ program-id. anagrams.
+
+ environment division.
+ configuration section.
+ repository.
+ function all intrinsic.
+
+ input-output section.
+ file-control.
+ select words-in
+ assign to wordfile
+ organization is line sequential
+ status is words-status
+ .
+
+ REPLACE ==:LETTERS:== BY ==42==.
+
+ data division.
+ file section.
+ fd words-in record is varying from 1 to :LETTERS: characters
+ depending on word-length.
+ 01 word-record.
+ 05 word-data pic x occurs 0 to :LETTERS: times
+ depending on word-length.
+
+ working-storage section.
+ >>IF ALLWORDS DEFINED
+ 01 wordfile constant as "/usr/local/share/dict/all.words".
+ 01 max-words constant as 4802100.
+
+ >>ELSE-IF MOSTWORDS DEFINED
+ 01 wordfile constant as "/usr/local/share/dict/linux.words".
+ 01 max-words constant as 628000.
+
+ >>ELSE-IF MOREWORDS DEFINED
+ 01 wordfile constant as "/usr/share/dict/words".
+ 01 max-words constant as 100000.
+
+ >>ELSE
+ 01 wordfile constant as "unixdict.txt".
+ 01 max-words constant as 26000.
+ >>END-IF
+
+ *> The 5 million word file needs to restrict the word length
+ >>IF ALLWORDS DEFINED
+ 01 max-letters constant as 26.
+ >>ELSE
+ 01 max-letters constant as :LETTERS:.
+ >>END-IF
+
+ 01 word-length pic 99 comp-5.
+ 01 words-status pic xx.
+ 88 ok-status values '00' thru '09'.
+ 88 eof-status value '10'.
+
+ *> sortable word by letter table
+ 01 letter-index usage index.
+ 01 letter-table.
+ 05 letters occurs 1 to max-letters times
+ depending on word-length
+ ascending key letter
+ indexed by letter-index.
+ 10 letter pic x.
+
+ *> table of words
+ 01 sorted-index usage index.
+ 01 word-table.
+ 05 word-list occurs 0 to max-words times
+ depending on word-tally
+ ascending key sorted-word
+ indexed by sorted-index.
+ 10 match-count pic 999 comp-5.
+ 10 this-word pic x(max-letters).
+ 10 sorted-word pic x(max-letters).
+ 01 sorted-display pic x(10).
+
+ 01 interest-table.
+ 05 interest-list pic 9(8) comp-5
+ occurs 0 to max-words times
+ depending on interest-tally.
+
+ 01 outer pic 9(8) comp-5.
+ 01 inner pic 9(8) comp-5.
+ 01 starter pic 9(8) comp-5.
+ 01 ender pic 9(8) comp-5.
+ 01 word-tally pic 9(8) comp-5.
+ 01 interest-tally pic 9(8) comp-5.
+ 01 tally-display pic zz,zzz,zz9.
+
+ 01 most-matches pic 99 comp-5.
+ 01 matches pic 99 comp-5.
+ 01 match-display pic z9.
+
+ *> timing display
+ 01 time-stamp.
+ 05 filler pic x(11).
+ 05 timer-hours pic 99.
+ 05 filler pic x.
+ 05 timer-minutes pic 99.
+ 05 filler pic x.
+ 05 timer-seconds pic 99.
+ 05 filler pic x.
+ 05 timer-subsec pic v9(6).
+ 01 timer-elapsed pic 9(6)v9(6).
+ 01 timer-value pic 9(6)v9(6).
+ 01 timer-display pic zzz,zz9.9(6).
+
+ *> ***************************************************************
+ procedure division.
+ main-routine.
+
+ >>IF ALLWORDS DEFINED
+ display "** Words limited to " max-letters " letters **"
+ >>END-IF
+
+ perform show-time
+
+ perform load-words
+ perform find-most
+ perform display-result
+
+ perform show-time
+ goback
+ .
+
+ *> ***************************************************************
+ load-words.
+ open input words-in
+ if not ok-status then
+ display "error opening " wordfile upon syserr
+ move 1 to return-code
+ goback
+ end-if
+
+ perform until exit
+ read words-in
+ if eof-status then exit perform end-if
+ if not ok-status then
+ display wordfile " read error: " words-status upon syserr
+ end-if
+
+ if word-length equal zero then exit perform cycle end-if
+
+ >>IF ALLWORDS DEFINED
+ move min(word-length, max-letters) to word-length
+ >>END-IF
+
+ add 1 to word-tally
+ move word-record to this-word(word-tally) letter-table
+ sort letters ascending key letter
+ move letter-table to sorted-word(word-tally)
+ end-perform
+
+ move word-tally to tally-display
+ display trim(tally-display) " words" with no advancing
+
+ close words-in
+ if not ok-status then
+ display "error closing " wordfile upon syserr
+ move 1 to return-code
+ end-if
+
+ *> sort word list by anagram check field
+ sort word-list ascending key sorted-word
+ .
+
+ *> first entry in a list will end up with highest match count
+ find-most.
+ perform varying outer from 1 by 1 until outer > word-tally
+ move 1 to matches
+ add 1 to outer giving starter
+ perform varying inner from starter by 1
+ until sorted-word(inner) not equal sorted-word(outer)
+ add 1 to matches
+ end-perform
+ if matches > most-matches then
+ move matches to most-matches
+ initialize interest-table all to value
+ move 0 to interest-tally
+ end-if
+ move matches to match-count(outer)
+ if matches = most-matches then
+ add 1 to interest-tally
+ move outer to interest-list(interest-tally)
+ end-if
+ end-perform
+ .
+
+ *> only display the words with the most anagrams
+ display-result.
+ move interest-tally to tally-display
+ move most-matches to match-display
+ display ", most anagrams: " trim(match-display)
+ ", with " trim(tally-display) " set" with no advancing
+ if interest-tally not equal 1 then
+ display "s" with no advancing
+ end-if
+ display " of interest"
+
+ perform varying outer from 1 by 1 until outer > interest-tally
+ move sorted-word(interest-list(outer)) to sorted-display
+ display sorted-display
+ " [" trim(this-word(interest-list(outer)))
+ with no advancing
+ add 1 to interest-list(outer) giving starter
+ add most-matches to interest-list(outer) giving ender
+ perform varying inner from starter by 1
+ until inner = ender
+ display ", " trim(this-word(inner))
+ with no advancing
+ end-perform
+ display "]"
+ end-perform
+ .
+
+ *> elapsed time
+ show-time.
+ move formatted-current-date("YYYY-MM-DDThh:mm:ss.ssssss")
+ to time-stamp
+ compute timer-value = timer-hours * 3600 + timer-minutes * 60
+ + timer-seconds + timer-subsec
+ if timer-elapsed = 0 then
+ display time-stamp
+ move timer-value to timer-elapsed
+ else
+ if timer-value < timer-elapsed then
+ add 86400 to timer-value
+ end-if
+ subtract timer-elapsed from timer-value
+ move timer-value to timer-display
+ display time-stamp ", " trim(timer-display) " seconds"
+ end-if
+ .
+
+ end program anagrams.
diff --git a/Task/Anagrams/Ela/anagrams.ela b/Task/Anagrams/Ela/anagrams.ela
new file mode 100644
index 0000000000..db017b097d
--- /dev/null
+++ b/Task/Anagrams/Ela/anagrams.ela
@@ -0,0 +1,14 @@
+open monad io list string
+
+groupon f x y = f x == f y
+
+lines = split "\n" << replace "\n\n" "\n" << replace "\r" "\n"
+
+main = do
+ fh <- readFile "c:\\test\\unixdict.txt" OpenMode
+ f <- readLines fh
+ closeFile fh
+ let words = lines f
+ let wix = groupBy (groupon fst) << sort $ zip (map sort words) words
+ let mxl = maximum $ map length wix
+ mapM_ (putLn << map snd) << filter ((==mxl) << length) $ wix
diff --git a/Task/Anagrams/Elena/anagrams.elena b/Task/Anagrams/Elena/anagrams.elena
index 1e7666349c..2779c65908 100644
--- a/Task/Anagrams/Elena/anagrams.elena
+++ b/Task/Anagrams/Elena/anagrams.elena
@@ -1,9 +1,9 @@
-#define system.
-#define system'routines.
-#define system'io.
-#define system'collections.
-#define extensions.
-#define extensions'routines.
+#import system.
+#import system'routines.
+#import system'io.
+#import system'collections.
+#import extensions.
+#import extensions'routines.
#class(extension) op
{
@@ -15,7 +15,7 @@
[
#var aDictionary := Dictionary new.
- File new &path:"unixdict.txt" run &eachLine: aWord
+ "unixdict.txt" file_path run &eachLine: aWord
[
#var aKey := aWord normalized.
#var anItem := aDictionary@aKey.
diff --git a/Task/Anagrams/Elixir/anagrams-1.elixir b/Task/Anagrams/Elixir/anagrams-1.elixir
index 01cece4228..1f6917b685 100644
--- a/Task/Anagrams/Elixir/anagrams-1.elixir
+++ b/Task/Anagrams/Elixir/anagrams-1.elixir
@@ -2,24 +2,15 @@ defmodule Anagrams do
def find(file) do
File.read!(file)
|> String.split
- |> Enum.map(&String.codepoints &1)
- |> sort(%{})
+ |> Enum.group_by(fn word -> String.codepoints(word) |> Enum.sort end)
|> Enum.group_by(fn {_,v} -> length(v) end)
|> Enum.max
|> print
end
- defp sort([],m), do: m
- defp sort([word|words],m) do
- s = Enum.sort(word)
- m = Dict.update(m, s, [word], fn val -> [word|val] end)
- sort(words,m)
- end
-
defp print({_,y}) do
- Enum.each(y, fn {_,e} ->
- Enum.map(e, &Enum.join(&1)) |> Enum.sort |> Enum.join(" ") |> IO.puts
- end)
+ Enum.each(y, fn {_,e} -> Enum.sort(e) |> Enum.join(" ") |> IO.puts end)
end
end
+
Anagrams.find("unixdict.txt")
diff --git a/Task/Anagrams/Elixir/anagrams-2.elixir b/Task/Anagrams/Elixir/anagrams-2.elixir
index 4010deb7a7..7661b9b235 100644
--- a/Task/Anagrams/Elixir/anagrams-2.elixir
+++ b/Task/Anagrams/Elixir/anagrams-2.elixir
@@ -1,13 +1,8 @@
File.stream!("unixdict.txt")
|> Stream.map(&String.strip &1)
- |> Stream.map(&{&1, &1 |> String.codepoints |> Enum.sort |> Enum.join})
- |> Enum.group_by(fn {_,y} -> y end)
- |> Dict.values
- |> Enum.group_by(&length(&1))
+ |> Enum.group_by(&String.codepoints(&1) |> Enum.sort)
+ |> Map.values
+ |> Enum.group_by(&length &1)
|> Enum.max
|> elem(1)
- |> Enum.each(fn n -> Enum.map(n, fn {y,_} -> y end)
- |> Enum.sort
- |> Enum.join(" ")
- |> IO.puts
- end)
+ |> Enum.each(fn n -> Enum.sort(n) |> Enum.join(" ") |> IO.puts end)
diff --git a/Task/Anagrams/Julia/anagrams.julia b/Task/Anagrams/Julia/anagrams.julia
index 07e236c335..6f41b834ff 100644
--- a/Task/Anagrams/Julia/anagrams.julia
+++ b/Task/Anagrams/Julia/anagrams.julia
@@ -1,12 +1,14 @@
url = "http://www.puzzlers.org/pub/wordlists/unixdict.txt"
-wordlist = map!(chomp,(open(readlines, download(url)))) ;
+wordlist = map!(chomp,(open(readlines, download(url))))
+
+wsort(word) = join(sort(collect(word)))
function anagram(wordlist)
hash = Dict() ; ananum = 0
for word in wordlist
- sorted = CharString(sort(collect(word.data)))
- hash[sorted] = [ get(hash, sorted, []), word ]
+ sorted = wsort(word)
+ hash[sorted] = [ get(hash, sorted, []); word ]
ananum = max(length(hash[sorted]), ananum)
end
collect(values(filter((x,y)-> length(y) == ananum, hash)))
diff --git a/Task/Anagrams/Mathematica/anagrams-5.math b/Task/Anagrams/Mathematica/anagrams-5.math
new file mode 100644
index 0000000000..9f23ae41ca
--- /dev/null
+++ b/Task/Anagrams/Mathematica/anagrams-5.math
@@ -0,0 +1,2 @@
+list=Import["http://www.puzzlers.org/pub/wordlists/unixdict.txt","Lines"];
+MaximalBy[GatherBy[list, Sort@*Characters], Length]
diff --git a/Task/Anagrams/Perl-6/anagrams-1.pl6 b/Task/Anagrams/Perl-6/anagrams-1.pl6
index a28f27a597..1e047758e4 100644
--- a/Task/Anagrams/Perl-6/anagrams-1.pl6
+++ b/Task/Anagrams/Perl-6/anagrams-1.pl6
@@ -1,5 +1,5 @@
-my %anagram = slurp('unixdict.txt').words.classify( { .comb.sort.join } );
+my @anagrams = 'unixdict.txt'.IO.words.classify(*.comb.sort.join).values;
-my $max = [max] map { +@($_) }, %anagram.values;
+my $max = @anagrams».elems.max;
-%anagram.values.grep( { +@($_) >= $max } )».join(' ')».say;
+.put for @anagrams.grep(*.elems == $max);
diff --git a/Task/Anagrams/Perl-6/anagrams-2.pl6 b/Task/Anagrams/Perl-6/anagrams-2.pl6
index a17d87e4a2..a698001833 100644
--- a/Task/Anagrams/Perl-6/anagrams-2.pl6
+++ b/Task/Anagrams/Perl-6/anagrams-2.pl6
@@ -1,7 +1,6 @@
-.say for # print each element of the array made this way:
-slurp('unixdict.txt')\ # load file in memory
-.words\ # extract words
-.classify( *.comb.sort.join )\ # group by common anagram
-.classify( *.value.elems )\ # group by number of anagrams in a group
-.max( :by(*.key) ).value\ # get the group with highest number of anagrams
-».value # get all groups of anagrams in the group just selected
+.put for # print each element of the array made this way:
+ 'unixdict.txt'.IO.words # load words from file
+ .classify(*.comb.sort.join) # group by common anagram
+ .classify(*.value.elems) # group by number of anagrams in a group
+ .max(*.key).value # get the group with highest number of anagrams
+ .map(*.value) # get all groups of anagrams in the group just selected
diff --git a/Task/Anagrams/REXX/anagrams-1.rexx b/Task/Anagrams/REXX/anagrams-1.rexx
index 4768141a96..e45539b983 100644
--- a/Task/Anagrams/REXX/anagrams-1.rexx
+++ b/Task/Anagrams/REXX/anagrams-1.rexx
@@ -1,30 +1,30 @@
-/*REXX program finds words with the largest set of anagrams (of the same size)*/
-iFID='unixdict.txt' /*the dictionary input File IDentifier.*/
-$=; !.=; #.=0; w=0; uw=0; most=0 /*initialize a bunch of REXX variables.*/
- /* [↓] read the entire file (by lines)*/
- do while lines(iFID)\==0 /*Got any data? Then read a record. */
- @=space(linein(iFID),0) /*pick off a word from the input line. */
- L=length(@); if L<3 then iterate /*onesies and twosies words can't win. */
- if \datatype(@,'M') then iterate /*ignore any non─anagramable words. */
- uw=uw+1 /*count of the (useable) words in file.*/
- z=sortA(@) /*sort the letters in the word. */
- !.z=!.z @; #.z=#.z+1 /*append it to !.z; bump the counter. */
+/*REXX program finds words with the largest set of anagrams (of the same size). */
+iFID= 'unixdict.txt' /*the dictionary input File IDentifier.*/
+$=; !.=; #.=0; w=0; uw=0; most=0 /*initialize a bunch of REXX variables.*/
+ /* [↓] read the entire file (by lines)*/
+ do while lines(iFID)\==0 /*Got any data? Then read a record. */
+ @=space( linein(iFID), 0) /*pick off a word from the input line. */
+ L=length(@); if L<3 then iterate /*onesies and twosies words can't win. */
+ if \datatype(@, 'M') then iterate /*ignore any non─anagramable words. */
+ uw=uw+1 /*count of the (useable) words in file.*/
+ z=sortA(@) /*sort the letters in the word. */
+ !.z=!.z @; #.z=#.z+1 /*append it to !.z; bump the counter. */
if #.z>most then do; $=z; most=#.z; if L>w then w=L; iterate; end
- if #.z==most then $=$ z /*append the sorted word──◄ max anagram*/
- end /*while*/ /*$ ►── list of high count anagrams. */
-say '─────────────────────────' uw 'useable words in the dictionary file: ' iFID
+ if #.z==most then $=$ z /*append the sorted word──► max anagram*/
+ end /*while*/ /*$ ◄── list of high count anagrams. */
+say '─────────────────────────' uw "useable words in the dictionary file: " iFID
say
- do m=1 for words($); z=subword($,m,1) /*high count of anagrams.*/
- say ' ' left(subword(!.z,1,1),w) ' [anagrams: ' subword(!.z,2)"]"
- end /*m*/ /*W is the maximum width of any word.*/
+ do m=1 for words($); z=subword($, m, 1) /*the high count of the anagrams. */
+ say ' ' left(subword(!.z, 1, 1), w) ' [anagrams: ' subword(!.z, 2)"]"
+ end /*m*/ /*W is the maximum width of any word.*/
say
-say '───── Found' words($) "words (each of which have" #.z-1 'anagrams).'
-exit /*stick a fork in it, we're all done. */
-/*──────────────────────────────────SORTA subroutine──────────────────────────*/
-sortA: procedure; arg char +1 xx,@. /*get the first letter of arg; @.=null*/
-@.char=char /*no need to concatenate the first char*/
- /*[↓] sort/put letters alphabetically.*/
- do length(xx); parse var xx char +1 xx; @.char=@.char || char; end
- /*reassemble word with sorted letters. */
-return @.a||@.b||@.c||@.d||@.e||@.f||@.g||@.h||@.i||@.j||@.k||@.l||@.m||,
- @.n||@.o||@.p||@.q||@.r||@.s||@.t||@.u||@.v||@.w||@.x||@.y||@.z
+say '───── Found' words($) "words (each of which have" #.z-1 'anagrams).'
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+sortA: procedure; arg char +1 xx,@. /*get the first letter of arg; @.=null*/
+ @.char=char /*no need to concatenate the first char*/
+ /*[↓] sort/put letters alphabetically.*/
+ do length(xx); parse var xx char +1 xx; @.char=@.char || char; end
+ /*reassemble word with sorted letters. */
+ return @.a||@.b||@.c||@.d||@.e||@.f||@.g||@.h||@.i||@.j||@.k||@.l||@.m||,
+ @.n||@.o||@.p||@.q||@.r||@.s||@.t||@.u||@.v||@.w||@.x||@.y||@.z
diff --git a/Task/Anagrams/REXX/anagrams-2.rexx b/Task/Anagrams/REXX/anagrams-2.rexx
index 591e7450c8..d4a6adc963 100644
--- a/Task/Anagrams/REXX/anagrams-2.rexx
+++ b/Task/Anagrams/REXX/anagrams-2.rexx
@@ -1,28 +1,27 @@
-/*REXX program finds words with the largest set of anagrams (of the same size)*/
-iFID='unixdict.txt' /*the dictionary input File IDentifier.*/
-$=; !.=; #.=0; ww=0; uw=0; most=0 /*initialize a bunch of REXX variables.*/
- /* [↓] read the entire file (by lines)*/
- do while lines(iFID)\==0 /*Got any data? Then read a record. */
- @=space(linein(iFID),0) /*pick off a word from the input line. */
- LL=length(@); if LL<3 then iterate /*onesies and twosies (words) can't win*/
- if \datatype(@,'M') then iterate /*ignore any non─anagramable words. */
- uw=uw+1 /*count of the (useable) words in file.*/
- parse upper var @ _ +1 xx @. /*get uppercase @ and nullify @. */
- @._=_ /*get the first letter (special case). */
- /*[↓] sort/put letters alphabetically.*/
- do LL-1; parse var xx _ +1 xx; @._=@._||_; end /*get rest of word.*/
- /*reassemble word with sorted letters. */
+/*REXX program finds words with the largest set of anagrams (of the same size). */
+iFID= 'unixdict.txt' /*the dictionary input File IDentifier.*/
+$=; !.=; #.=0; ww=0; uw=0; most=0 /*initialize a bunch of REXX variables.*/
+ /* [↓] read the entire file (by lines)*/
+ do while lines(iFID)\==0 /*Got any data? Then read a record. */
+ @=space( linein(iFID), 0) /*pick off a word from the input line. */
+ LL=length(@); if LL<3 then iterate /*onesies and twosies (words) can't win*/
+ if \datatype(@, 'M') then iterate /*ignore any non─anagramable words. */
+ uw=uw+1 /*count of the (useable) words in file.*/
+ parse upper var @ _ +1 xx @. /*get uppercase @ and nullify @. */
+ @._=_ /*get the first letter (special case). */
+ /*[↓] sort/put letters alphabetically.*/
+ do LL-1; parse var xx _ +1 xx; @._=@._||_; end /*get the rest of the word.*/
+ /*reassemble word with sorted letters. */
zz=@.a||@.b||@.c||@.d||@.e||@.f||@.g||@.h||@.i||@.j||@.k||@.l||@.m||,
@.n||@.o||@.p||@.q||@.r||@.s||@.t||@.u||@.v||@.w||@.x||@.y||@.z
- !.zz=!.zz @; #.zz=#.zz+1 /*append it to !.zz; bump the counter.*/
- if #.zz>most then do; $=zz; most=#.zz; if LL>ww then ww=LL; iterate; end
- if #.zz==most then $=$ zz /*append the sorted word──◄ $ anagrams.*/
+ !.zz=!.zz @; #.zz=#.zz+1 /*append it to !.zz; bump the counter.*/
+ if #.zz>most then do; $=zz; most=#.zz; if LL>ww then ww=LL; iterate; end
+ if #.zz==most then $=$ zz /*append the sorted word──► $ anagrams.*/
end /*while*/
-say '─────────────────────────' uw 'useable words in the dictionary file: ' iFID
+say '─────────────────────────' uw "useable words in the dictionary file: " iFID
say
- do m=1 for words($); z=subword($,m,1) /*high count of anagrams.*/
- say ' ' left(subword(!.z,1,1),ww) ' [anagrams: ' subword(!.z,2)"]"
- end /*m*/ /*WW is the maximum width of any word.*/
-say
-say '───── Found' words($) "words (each of which have" #.z-1 'anagrams).'
- /*stick a fork in it, we're all done. */
+ do m=1 for words($); z=subword($,m,1) /*the high count of the anagrams. */
+ say ' ' left(subword(!.z, 1, 1), ww) " [anagrams: " subword(!.z,2)"]"
+ end /*m*/ /*WW is the maximum width of any word.*/
+say /*stick a fork in it, we're all done. */
+say '───── Found' words($) "words (each of which have" #.z-1 'anagrams).'
diff --git a/Task/Anagrams/REXX/anagrams-3.rexx b/Task/Anagrams/REXX/anagrams-3.rexx
index 7ed192ca90..33e17818f5 100644
--- a/Task/Anagrams/REXX/anagrams-3.rexx
+++ b/Task/Anagrams/REXX/anagrams-3.rexx
@@ -1,28 +1,27 @@
-/*REXX program finds words with the largest set of anagrams (of the same size)*/
-iFID='unixdict.txt' /*the dictionary input File IDentifier.*/
-$=; !.=; #.=0; ww=0; uw=0; most=0 /*initialize a bunch of REXX variables.*/
- /* [↓] read the entire file (by lines)*/
- do while lines(iFID)\==0 /*Got any data? Then read a record. */
- @=space(linein(iFID),0) /*pick off a word from the input line. */
- LL=length(@); if LL<3 then iterate /*onesies and twosies (words) can't win*/
- if \datatype(@,'M') then iterate /*ignore any non─anagramable words. */
- uw=uw+1 /*count of the (useable) words in file.*/
- parse upper var @ _ +1 xx '' @. /*get uppercase @ and nullify @. */
- @._=_ /*get the first letter (special case). */
- /*[↓] sort/put letters alphabetically.*/
- do LL-1; parse var xx _ +1 xx; @._=@._||_; end /*get rest of word.*/
- /*reassemble word with sorted letters. */
- zz=@.a||@.b||@.c||@.d||@.e||@.f||@.g||@.h||@.i||@.j||@.k||@.l||@.m||,
- @.n||@.o||@.p||@.q||@.r||@.s||@.t||@.u||@.v||@.w||@.x||@.y||@.z
- !.zz=!.zz @; #.zz=#.zz+1 /*append it to !.zz; bump the counter.*/
- if #.zz>most then do; $=zz; most=#.zz; if LL>ww then ww=LL; iterate; end
- if #.zz==most then $=$ zz /*append the sorted word──► $ anagrams.*/
+/*REXX program finds words with the largest set of anagrams (of the same size). */
+iFID= 'unixdict.txt' /*the dictionary input File IDentifier.*/
+$=; !.=; #.=0; ww=0; uw=0; most=0 /*initialize a bunch of REXX variables.*/
+ /* [↓] read the entire file (by lines)*/
+ do while lines(iFID)\==0 /*Got any data? Then read a record. */
+ @=space( linein(iFID), 0) /*pick off a word from the input line. */
+ LL=length(@); if LL<3 then iterate /*onesies and twosies (words) can't win*/
+ if \datatype(@, 'M') then iterate /*ignore any non─anagramable words. */
+ uw=uw+1 /*count of the (useable) words in file.*/
+ parse upper var @ _ +1 xx . @. /*get uppercase @ and nullify @. */
+ @._=_ /*get the first letter (special case). */
+ /*[↓] sort/put letters alphabetically.*/
+ do LL-1; parse var xx _ +1 xx; @._=@._ || _; end /*get rest of the word*/
+ /*reassemble word with sorted letters. */
+ zz=@.a|| @.b|| @.c|| @.d|| @.e|| @.f|| @.g|| @.h|| @.i|| @.j|| @.k|| @.l|| @.m ||,
+ @.n|| @.o|| @.p|| @.q|| @.r|| @.s|| @.t|| @.u|| @.v|| @.w|| @.x|| @.y|| @.z
+ !.zz=!.zz @; #.zz=#.zz+1 /*append it to !.zz; bump the counter.*/
+ if #.zz>most then do; $=zz; most=#.zz; if LL>ww then ww=LL; iterate; end
+ if #.zz==most then $=$ zz /*append the sorted word──► $ anagrams.*/
end /*while*/
-say '─────────────────────────' uw 'useable words in the dictionary file: ' iFID
+say '─────────────────────────' uw 'useable words in the dictionary file: ' iFID
say
- do m=1 for words($); z=subword($,m,1) /*high count of anagrams.*/
- say ' ' left(subword(!.z,1,1),ww) ' [anagrams: ' subword(!.z,2)"]"
- end /*m*/ /*WW is the maximum width of any word.*/
-say
-say '───── Found' words($) "words (each of which have" #.z-1 'anagrams).'
- /*stick a fork in it, we're all done. */
+ do m=1 for words($); z=subword($, m, 1) /*the high count of the anagrams. */
+ say ' ' left(subword(!.z, 1, 1), ww) " [anagrams: " subword(!.z, 2)']'
+ end /*m*/ /*WW is the maximum width of any word.*/
+say /*stick a fork in it, we're all done. */
+say '───── Found' words($) "words (each of which have" #.z-1 'anagrams).'
diff --git a/Task/Anagrams/REXX/anagrams-4.rexx b/Task/Anagrams/REXX/anagrams-4.rexx
index 07f1775c22..8fef3f9055 100644
--- a/Task/Anagrams/REXX/anagrams-4.rexx
+++ b/Task/Anagrams/REXX/anagrams-4.rexx
@@ -1,23 +1,23 @@
-u='Halloween' /*the word to be sorted by letter*/
-upper u /*fast method to uppercase a var.*/
- /*another: u = translate(u) */
- /*another: parse upper var u u */
- /*another: u = upper(u) */
- /*not always available [↑] */
+u= 'Halloween' /*word to be sorted by (Latin) letter.*/
+upper u /*fast method to uppercase a variable. */
+ /*another: u = translate(u) */
+ /*another: parse upper var u u */
+ /*another: u = upper(u) */
+ /*not always available [↑] */
say 'u=' u
_.=
- do until u=='' /*keep truckin' until U is null.*/
- parse var u y +1 u /*get the next (first) char in U.*/
- xx = '?'y /*assign a prefixed char to XX. */
- _.xx = _.xx || y /*append it to all the Y chars.*/
- end /*until*/ /*U now has the first char gone.*/
- /*Note: the var U is destroyed.*/
+ do until u=='' /*keep truckin' until U is null. */
+ parse var u y +1 u /*get the next (first) character in U.*/
+ xx='?'y /*assign a prefixed character to XX. */
+ _.xx=_.xx || y /*append it to all the Y characters. */
+ end /*until*/ /*U now has the first character elided.*/
+ /*Note: the variable U is destroyed.*/
- /* [↓] build sorted letter word. */
+ /* [↓] constructs a sorted letter word*/
z=_.?a||_.?b||_.?c||_.?d||_.?e||_.?f||_.?g||_.?h||_.?i||_.?j||_.?k||_.?l||_.?m||,
_.?n||_.?o||_.?p||_.?q||_.?r||_.?s||_.?t||_.?u||_.?v||_.?w||_.?x||_.?y||_.?z
- /*Note: the ? is prefixed to the letter to avoid */
- /*collisions with other REXX one-character variables.*/
+ /*Note: the ? is prefixed to the letter to avoid */
+ /*collisions with other REXX one-character variables.*/
say 'z=' z
diff --git a/Task/Anagrams/REXX/anagrams-5.rexx b/Task/Anagrams/REXX/anagrams-5.rexx
index baa6d99a7b..bf3588afb2 100644
--- a/Task/Anagrams/REXX/anagrams-5.rexx
+++ b/Task/Anagrams/REXX/anagrams-5.rexx
@@ -1,16 +1,16 @@
-u='Halloween' /*the word to be sorted by letter*/
-upper u /*fast method to uppercase a var.*/
-L=length(u) /*get the length of the word. */
+u= 'Halloween' /*word to be sorted by (Latin) letter.*/
+upper u /*fast method to uppercase a variable. */
+L=length(u) /*get the length of the word (in bytes)*/
say 'u=' u
say 'L=' L
_.=
- do k=1 for L /*keep truckin' for L chars. */
- parse var u =(k) y +1 /*get Kth character in U string. */
- xx = '?'y /*assign a prefixed char to XX. */
- _.xx = _.xx || y /*append it to all the Y chars.*/
- end /*do k*/ /*U now has the first char gone.*/
+ do k=1 for L /*keep truckin' for L characters. */
+ parse var u =(k) y +1 /*get the Kth character in U string.*/
+ xx='?'y /*assign a prefixed character to XX. */
+ _.xx=_.xx || y /*append it to all the Y characters. */
+ end /*do k*/ /*U now has the first character elided.*/
- /* [↓] build sorted letter word. */
+ /* [↓] construct a sorted letter word.*/
z=_.?a||_.?b||_.?c||_.?d||_.?e||_.?f||_.?g||_.?h||_.?i||_.?j||_.?k||_.?l||_.?m||,
_.?n||_.?o||_.?p||_.?q||_.?r||_.?s||_.?t||_.?u||_.?v||_.?w||_.?x||_.?y||_.?z
diff --git a/Task/Anagrams/Run-BASIC/anagrams.run b/Task/Anagrams/Run-BASIC/anagrams.run
index ce5e72ff58..feb89f6a37 100644
--- a/Task/Anagrams/Run-BASIC/anagrams.run
+++ b/Task/Anagrams/Run-BASIC/anagrams.run
@@ -1,67 +1,64 @@
-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"
+sqliteconnect #mem, ":memory:"
+mem$ = "CREATE TABLE anti(gram,ordr);
+CREATE INDEX ord ON anti(ordr)"
#mem execute(mem$)
-WHILE #mem hasanswer()
- #row = #mem #nextrow()
- theWord$ = #row theWord$()
- mWord$ = #row mWord$()
- html "
";theWord$;"
";mWord$;"
"
-WEND
-html "
"
-end
+' read the file
+a$ = httpGet$("http://www.puzzlers.org/pub/wordlists/unixdict.txt")
-' -----------------------------------------
-' 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
+' break the file words apart
+i = 1
+while i <> 0
+ j = instr(a$,chr$(10),i+1)
+ if j = 0 then exit while
+ a1$ = mid$(a$,i,j-i)
+ q = instr(a1$,"'")
+ if q > 0 then a1$ = left$(a1$,q) + mid$(a1$,q)
+ ln = len(a1$)
+ s$ = a1$
+
+ ' Split the characters of the word and sort them
+ s = 1
+ while s = 1
+ s = 0
+ for k = 1 to ln -1
+ if mid$(s$,k,1) > mid$(s$,k+1,1) then
+ h$ = mid$(s$,k,1)
+ h1$ = mid$(s$,k+1,1)
+ s$ = left$(s$,k-1) + h1$ + h$ + mid$(s$,k+2)
+ s = 1
+ end if
+ next k
+ wend
+
+ mem$ = "INSERT INTO anti VALUES('";a1$;"','";ord$;"')"
+ #mem execute(mem$)
+ i = j +1
+wend
+' find all antigrams
+mem$ = "SELECT count(*) as cnt,anti.ordr FROM anti GROUP BY ordr ORDER BY cnt desc"
+#mem execute(mem$)
+numDups = #mem ROWCOUNT() 'Get the number of rows
+dim dups$(numDups)
+for i = 1 to numDups
+ #row = #mem #nextrow()
+ cnt = #row cnt()
+ if i = 1 then maxCnt = cnt
+ if cnt < maxCnt then exit for
+ dups$(i) = #row ordr$()
+next i
+
+for i = 1 to i -1
+ mem$ = "SELECT anti.gram FROM anti
+ WHERE anti.ordr = '";dups$(i);"'
+ ORDER BY anti.gram"
+ #mem execute(mem$)
+ rows = #mem ROWCOUNT() 'Get the number of rows
+
+ for ii = 1 to rows
+ #row = #mem #nextrow()
+ gram$ = #row gram$()
+ print gram$;chr$(9);
+ next ii
+ print
+next i
+end
diff --git a/Task/Anagrams/SuperCollider/anagrams-1.supercollider b/Task/Anagrams/SuperCollider/anagrams-1.supercollider
new file mode 100644
index 0000000000..225aae592a
--- /dev/null
+++ b/Task/Anagrams/SuperCollider/anagrams-1.supercollider
@@ -0,0 +1,20 @@
+(
+var text, words, sorted, dict = IdentityDictionary.new, findMax;
+File.use("unixdict.txt".resolveRelative, "r", { |f| text = f.readAllString });
+words = text.split(Char.nl);
+sorted = words.collect { |each|
+ var key = each.copy.sort.asSymbol;
+ dict[key] ?? { dict[key] = [] };
+ dict[key] = dict[key].add(each)
+};
+findMax = { |dict|
+ var size = 0, max = [];
+ dict.keysValuesDo { |key, val|
+ if(val.size == size) { max = max.add(val) } {
+ if(val.size > size) { max = []; size = val.size }
+ }
+ };
+ max
+};
+findMax.(dict)
+)
diff --git a/Task/Anagrams/SuperCollider/anagrams-2.supercollider b/Task/Anagrams/SuperCollider/anagrams-2.supercollider
new file mode 100644
index 0000000000..6ef5595f71
--- /dev/null
+++ b/Task/Anagrams/SuperCollider/anagrams-2.supercollider
@@ -0,0 +1 @@
+[ [ angel, angle, galen, glean, lange ], [ caret, carte, cater, crate, trace ], [ elan, lane, lean, lena, neal ], [ evil, levi, live, veil, vile ], [ alger, glare, lager, large, regal ] ]
diff --git a/Task/Animate-a-pendulum/Fortran/animate-a-pendulum.f b/Task/Animate-a-pendulum/Fortran/animate-a-pendulum.f
index 035fabcff2..afeabc99e6 100644
--- a/Task/Animate-a-pendulum/Fortran/animate-a-pendulum.f
+++ b/Task/Animate-a-pendulum/Fortran/animate-a-pendulum.f
@@ -14,7 +14,7 @@ do
exit
end if
end do
-call system('clear')
+call execute_command_line('cls')
c_ang = s_ang*pi/180.0D0
p_ang = c_ang
@@ -23,7 +23,7 @@ call display(c_ang)
do
call next_time_step(c_ang,p_ang,g,l,dt,n_ang)
if(abs(c_ang-p_ang).ge.0.05D0) then
- call system('clear')
+ call execute_command_line('cls')
call display(c_ang)
end if
end do
diff --git a/Task/Animate-a-pendulum/J/animate-a-pendulum-2.j b/Task/Animate-a-pendulum/J/animate-a-pendulum-2.j
index 574502bc96..dc0bb6faee 100644
--- a/Task/Animate-a-pendulum/J/animate-a-pendulum-2.j
+++ b/Task/Animate-a-pendulum/J/animate-a-pendulum-2.j
@@ -9,7 +9,7 @@ VEL =: 0 NB. ms_1
PEND=: noun define
pc pend;pn "Pendulum";
-minwh 320 200; cc isi isigraph type flush;
+minwh 320 200; cc isi isigraph flush;
)
pend_run=: verb define
diff --git a/Task/Animate-a-pendulum/JavaScript/animate-a-pendulum.js b/Task/Animate-a-pendulum/JavaScript/animate-a-pendulum-1.js
similarity index 100%
rename from Task/Animate-a-pendulum/JavaScript/animate-a-pendulum.js
rename to Task/Animate-a-pendulum/JavaScript/animate-a-pendulum-1.js
diff --git a/Task/Animate-a-pendulum/JavaScript/animate-a-pendulum-2.js b/Task/Animate-a-pendulum/JavaScript/animate-a-pendulum-2.js
new file mode 100644
index 0000000000..906b58e578
--- /dev/null
+++ b/Task/Animate-a-pendulum/JavaScript/animate-a-pendulum-2.js
@@ -0,0 +1,62 @@
+
+
+ Swinging Pendulum Simulation
+
+
+
+
+ Initial angle:(degrees)
+
+
+
+
+
+
+
diff --git a/Task/Animate-a-pendulum/Kotlin/animate-a-pendulum.kotlin b/Task/Animate-a-pendulum/Kotlin/animate-a-pendulum.kotlin
index 4c025063ab..f1f48c97a4 100644
--- a/Task/Animate-a-pendulum/Kotlin/animate-a-pendulum.kotlin
+++ b/Task/Animate-a-pendulum/Kotlin/animate-a-pendulum.kotlin
@@ -1,5 +1,3 @@
-package pendulum
-
import java.awt.*
import java.util.concurrent.*
import javax.swing.*
@@ -15,14 +13,16 @@ class Pendulum(private val length: Int) : JPanel(), Runnable {
}
override fun paint(g: Graphics) {
- g.color = Color.WHITE
- g.fillRect(0, 0, width, height)
- g.color = Color.BLACK
- val anchor = Element(width / 2, height / 4)
- val ball = Element((anchor.x + Math.sin(angle) * length).toInt(), (anchor.y + Math.cos(angle) * length).toInt())
- g.drawLine(anchor.x, anchor.y, ball.x, ball.y)
- g.fillOval(anchor.x - 3, anchor.y - 4, 7, 7)
- g.fillOval(ball.x - 7, ball.y - 7, 14, 14)
+ with(g) {
+ color = Color.WHITE
+ fillRect(0, 0, width, height)
+ color = Color.BLACK
+ val anchor = Element(width / 2, height / 4)
+ val ball = Element((anchor.x + Math.sin(angle) * length).toInt(), (anchor.y + Math.cos(angle) * length).toInt())
+ drawLine(anchor.x, anchor.y, ball.x, ball.y)
+ fillOval(anchor.x - 3, anchor.y - 4, 7, 7)
+ fillOval(ball.x - 7, ball.y - 7, 14, 14)
+ }
}
override fun run() {
diff --git a/Task/Animate-a-pendulum/Ruby/animate-a-pendulum-3.rb b/Task/Animate-a-pendulum/Ruby/animate-a-pendulum-3.rb
new file mode 100644
index 0000000000..f20d574bcd
--- /dev/null
+++ b/Task/Animate-a-pendulum/Ruby/animate-a-pendulum-3.rb
@@ -0,0 +1,104 @@
+#!/bin/ruby
+
+begin; require 'rubygems'; rescue; end
+
+require 'gosu'
+include Gosu
+
+# Screen size
+W = 640
+H = 480
+
+# Full-screen mode
+FS = false
+
+# Screen update rate (Hz)
+FPS = 60
+
+class Pendulum
+
+ attr_accessor :theta, :friction
+
+ def initialize( win, x, y, length, radius, bob = true, friction = false)
+ @win = win
+ @centerX = x
+ @centerY = y
+ @length = length
+ @radius = radius
+ @bob = bob
+ @friction = friction
+
+ @theta = 60.0
+ @omega = 0.0
+ @scale = 2.0 / FPS
+ end
+
+ def draw
+ @win.translate(@centerX, @centerY) {
+ @win.rotate(@theta) {
+ @win.draw_quad(-1, 0, 0x3F_FF_FF_FF, 1, 0, 0x3F_FF_FF_00, 1, @length, 0x3F_FF_FF_00, -1, @length, 0x3F_FF_FF_FF )
+ if @bob
+ @win.translate(0, @length) {
+ @win.draw_quad(0, -@radius, Color::RED, @radius, 0, Color::BLUE, 0, @radius, Color::WHITE, -@radius, 0, Color::BLUE )
+ }
+ end
+ }
+ }
+ end
+
+ def update
+ # Thanks to Hugo Elias for the formula (and explanation thereof)
+ @theta += @omega
+ @omega = @omega - (Math.sin(@theta * Math::PI / 180) / (@length * @scale))
+ @theta *= 0.999 if @friction
+ end
+
+end # Pendulum class
+
+class GfxWindow < Window
+
+ def initialize
+ # Initialize the base class
+ super W, H, FS, 1.0 / FPS * 1000
+ # self.caption = "You're getting sleeeeepy..."
+ self.caption = "Ruby/Gosu Pendulum Simulator (Space toggles friction)"
+
+ @n = 1 # Try changing this number!
+ @pendulums = []
+ (1..@n).each do |i|
+ @pendulums.push Pendulum.new( self, W / 2, H / 10, H * 0.75 * (i / @n.to_f), H / 60 )
+ end
+
+ end
+
+ def draw
+ @pendulums.each { |pen| pen.draw }
+ end
+
+ def update
+ @pendulums.each { |pen| pen.update }
+ end
+
+ def button_up(id)
+ if id == KbSpace
+ @pendulums.each { |pen|
+ pen.friction = !pen.friction
+ pen.theta = (pen.theta <=> 0) * 45.0 unless pen.friction
+ }
+ else
+ close
+ end
+ end
+
+ def needs_cursor?()
+ true
+ end
+
+end # GfxWindow class
+
+begin
+ GfxWindow.new.show
+rescue Exception => e
+ puts e.message, e.backtrace
+ gets
+end
diff --git a/Task/Animate-a-pendulum/ZX-Spectrum-Basic/animate-a-pendulum.zx b/Task/Animate-a-pendulum/ZX-Spectrum-Basic/animate-a-pendulum.zx
new file mode 100644
index 0000000000..4760f31798
--- /dev/null
+++ b/Task/Animate-a-pendulum/ZX-Spectrum-Basic/animate-a-pendulum.zx
@@ -0,0 +1,17 @@
+10 OVER 1: CLS
+20 LET theta=1
+30 LET g=9.81
+40 LET l=0.5
+50 LET speed=0
+100 LET pivotx=120
+110 LET pivoty=140
+120 LET bobx=pivotx+l*100*SIN (theta)
+130 LET boby=pivoty+l*100*COS (theta)
+140 GO SUB 1000: PAUSE 1: GO SUB 1000
+190 LET accel=g*SIN (theta)/l/100
+200 LET speed=speed+accel/100
+210 LET theta=theta+speed
+220 GO TO 100
+1000 PLOT pivotx,pivoty: DRAW bobx-pivotx,boby-pivoty
+1010 CIRCLE bobx,boby,3
+1020 RETURN
diff --git a/Task/Animation/00DESCRIPTION b/Task/Animation/00DESCRIPTION
index ae07b2fd12..f50a055bae 100644
--- a/Task/Animation/00DESCRIPTION
+++ b/Task/Animation/00DESCRIPTION
@@ -1,3 +1,10 @@
-'''Animation''' is integral to many parts of [[GUI]]s, including both the fancy effects when things change used in window managers, and of course games. The core of any animation system is a scheme for periodically changing the display while still remaining responsive to the user. This task demonstrates this.
+'''Animation''' is integral to many parts of [[GUI]]s, including both the fancy effects when things change used in window managers, and of course games. The core of any animation system is a scheme for periodically changing the display while still remaining responsive to the user. This task demonstrates this.
-Create a window containing the string "Hello World! " (the trailing space is significant). Make the text appear to be rotating right by periodically removing one letter from the end of the string and attaching it to the front. When the user clicks on the text, it should reverse its direction.
+
+;Task:
+Create a window containing the string "Hello World! " (the trailing space is significant).
+
+Make the text appear to be rotating right by periodically removing one letter from the end of the string and attaching it to the front.
+
+When the user clicks on the (windowed) text, it should reverse its direction.
+
diff --git a/Task/Animation/Go/animation.go b/Task/Animation/Go/animation.go
new file mode 100644
index 0000000000..13c62b51d9
--- /dev/null
+++ b/Task/Animation/Go/animation.go
@@ -0,0 +1,58 @@
+package main
+
+import (
+ "log"
+ "time"
+
+ "github.com/gdamore/tcell"
+)
+
+const (
+ msg = "Hello World! "
+ x0, y0 = 8, 3
+ shiftsPerSecond = 4
+ clicksToExit = 5
+)
+
+func main() {
+ s, err := tcell.NewScreen()
+ if err != nil {
+ log.Fatal(err)
+ }
+ if err = s.Init(); err != nil {
+ log.Fatal(err)
+ }
+ s.Clear()
+ s.EnableMouse()
+ tick := time.Tick(time.Second / shiftsPerSecond)
+ click := make(chan bool)
+ go func() {
+ for {
+ em, ok := s.PollEvent().(*tcell.EventMouse)
+ if !ok || em.Buttons()&0xFF == tcell.ButtonNone {
+ continue
+ }
+ mx, my := em.Position()
+ if my == y0 && mx >= x0 && mx < x0+len(msg) {
+ click <- true
+ }
+ }
+ }()
+ for inc, shift, clicks := 1, 0, 0; ; {
+ select {
+ case <-tick:
+ shift = (shift + inc) % len(msg)
+ for i, r := range msg {
+ s.SetContent(x0+((shift+i)%len(msg)), y0, r, nil, 0)
+ }
+ s.Show()
+ case <-click:
+ clicks++
+ if clicks == clicksToExit {
+ s.Fini()
+ return
+ }
+ inc = len(msg) - inc
+ }
+ }
+}
diff --git a/Task/Animation/HicEst/animation.hicest b/Task/Animation/HicEst/animation.hicest
new file mode 100644
index 0000000000..a510f720fc
--- /dev/null
+++ b/Task/Animation/HicEst/animation.hicest
@@ -0,0 +1,18 @@
+CHARACTER string="Hello World! "
+
+ WINDOW(WINdowhandle=wh, Height=1, X=1, TItle="left/right click to rotate left/right, Y-click-position sets milliseconds period")
+ AXIS(WINdowhandle=wh, PoinT=20, X=2048, Y, Title='ms', MiN=0, MaX=400, MouSeY=msec, MouSeCall=Mouse_callback, MouSeButton=button_type)
+ direction = 4
+ msec = 100 ! initial milliseconds
+ DO tic = 1, 1E20
+ WRITE(WIN=wh, Align='Center Vertical') string
+ IF(direction == 4) string = string(LEN(string)) // string ! rotate left
+ IF(direction == 8) string = string(2:) // string(1) ! rotate right
+ WRITE(StatusBar, Name) tic, direction, msec
+ SYSTEM(WAIT=msec)
+ ENDDO
+ END
+
+SUBROUTINE Mouse_callback()
+ direction = button_type ! 4 == left button up, 8 == right button up
+ END
diff --git a/Task/Animation/Icon/animation-1.icon b/Task/Animation/Icon/animation-1.icon
new file mode 100644
index 0000000000..e0fad2322e
--- /dev/null
+++ b/Task/Animation/Icon/animation-1.icon
@@ -0,0 +1,44 @@
+import gui
+$include "guih.icn"
+
+class WindowApp : Dialog (label, direction)
+
+ method rotate_left (msg)
+ return msg[2:0] || msg[1]
+ end
+
+ method rotate_right (msg)
+ return msg[-1:0] || msg[1:-1]
+ end
+
+ method reverse_direction ()
+ direction := 1-direction
+ end
+
+ # this method gets called by the ticker, and updates the label
+ method tick ()
+ static msg := "Hello World! "
+ if direction = 0
+ then msg := rotate_left (msg)
+ else msg := rotate_right (msg)
+ label.set_label(msg)
+ end
+
+ method component_setup ()
+ direction := 1 # start off rotating to the right
+ label := Label("label=Hello World! ", "pos=0,0")
+ # respond to a mouse click on the label
+ label.connect (self, "reverse_direction", MOUSE_RELEASE_EVENT)
+ add (label)
+
+ connect (self, "dispose", CLOSE_BUTTON_EVENT)
+ # tick every 100ms
+ self.set_ticker (100)
+ end
+end
+
+# create and show the window
+procedure main ()
+ w := WindowApp ()
+ w.show_modal ()
+end
diff --git a/Task/Animation/Icon/animation-2.icon b/Task/Animation/Icon/animation-2.icon
new file mode 100644
index 0000000000..5bcc046049
--- /dev/null
+++ b/Task/Animation/Icon/animation-2.icon
@@ -0,0 +1,21 @@
+link graphics
+
+procedure main()
+ s := "Hello World! "
+ WOpen("size=640,400", "label=Animation")
+ Font("typewriter,60,bold")
+ direction := 1
+ w := TextWidth(s)
+ h := WAttrib("fheight")
+ x := (WAttrib("width") - w) / 2
+ y := (WAttrib("height") - 20 + h) / 2
+
+ repeat
+ { if *Pending() > 0 then if (Event() = &lrelease) & (x < &x < x + w) & (y > &y > y-h) then direction := ixor(direction, 1)
+ s := s[2 - 3 * direction:0] || s[1:2 - 3 * direction]
+ EraseArea(x, y, w, -h)
+ DrawString(x,y - WAttrib("descent")-1,s)
+ WFlush()
+ delay(250)
+ }
+end
diff --git a/Task/Animation/ZX-Spectrum-Basic/animation.zx b/Task/Animation/ZX-Spectrum-Basic/animation.zx
new file mode 100644
index 0000000000..0bcf23bfe0
--- /dev/null
+++ b/Task/Animation/ZX-Spectrum-Basic/animation.zx
@@ -0,0 +1,7 @@
+10 LET t$="Hello world! ": LET lt=LEN t$
+20 LET direction=1
+30 PRINT AT 0,0;t$
+40 IF direction THEN LET t$=t$(2 TO )+t$(1): GO TO 60
+50 LET t$=t$(lt)+t$( TO lt-1)
+60 IF INKEY$<>"" THEN LET direction=NOT direction
+70 PAUSE 5: GO TO 30
diff --git a/Task/Anonymous-recursion/00DESCRIPTION b/Task/Anonymous-recursion/00DESCRIPTION
index 0a0f286b5e..2d124b9077 100644
--- a/Task/Anonymous-recursion/00DESCRIPTION
+++ b/Task/Anonymous-recursion/00DESCRIPTION
@@ -1,15 +1,18 @@
-While implementing a recursive function, it often happens that we must resort to a separate "helper function" to handle the actual recursion.
+While implementing a recursive function, it often happens that we must resort to a separate ''helper function'' to handle the actual recursion.
-This is usually the case when directly calling the current function would waste too many resources (stack space, execution time), cause unwanted side-effects, and/or the function doesn't have the right arguments and/or return values.
+This is usually the case when directly calling the current function would waste too many resources (stack space, execution time), causing unwanted side-effects, and/or the function doesn't have the right arguments and/or return values.
-So we end up inventing some silly name like "foo2" or "foo_helper". I have always found it painful to come up with a proper name, and see a quite some disadvantages:
+So we end up inventing some silly name like '''foo2''' or '''foo_helper'''. I have always found it painful to come up with a proper name, and see some disadvantages:
-* You have to think up a name, which then pollutes the namespace
-* A function is created which is called from nowhere else
-* The program flow in the source code is interrupted
+::* You have to think up a name, which then pollutes the namespace
+::* Function is created which is called from nowhere else
+::* The program flow in the source code is interrupted
-Some languages allow you to embed recursion directly in-place. This might work via a label, a local ''gosub'' instruction, or some special keyword.
+Some languages allow you to embed recursion directly in-place. This might work via a label, a local ''gosub'' instruction, or some special keyword.
-Anonymous recursion can also be accomplished using the [[Y combinator]].
+Anonymous recursion can also be accomplished using the [[Y combinator]].
-If possible, demonstrate this by writing the recursive version of the fibonacci function (see [[Fibonacci sequence]]) which checks for a negative argument before doing the actual recursion.
+
+;Task:
+If possible, demonstrate this by writing the recursive version of the fibonacci function (see [[Fibonacci sequence]]) which checks for a negative argument before doing the actual recursion.
+
diff --git a/Task/Anonymous-recursion/ALGOL-68/anonymous-recursion.alg b/Task/Anonymous-recursion/ALGOL-68/anonymous-recursion.alg
new file mode 100644
index 0000000000..76bbab5795
--- /dev/null
+++ b/Task/Anonymous-recursion/ALGOL-68/anonymous-recursion.alg
@@ -0,0 +1,15 @@
+PROC fibonacci = ( INT x )INT:
+ IF x < 0
+ THEN
+ print( ( "negative parameter to fibonacci", newline ) );
+ stop
+ ELSE
+ PROC actual fibonacci = ( INT n )INT:
+ IF n < 2
+ THEN
+ n
+ ELSE
+ actual fibonacci( n - 1 ) + actual fibonacci( n - 2 )
+ FI;
+ actual fibonacci( x )
+ FI;
diff --git a/Task/Anonymous-recursion/Elena/anonymous-recursion.elena b/Task/Anonymous-recursion/Elena/anonymous-recursion.elena
index a4ff364c13..d1f82c10b0 100644
--- a/Task/Anonymous-recursion/Elena/anonymous-recursion.elena
+++ b/Task/Anonymous-recursion/Elena/anonymous-recursion.elena
@@ -1,13 +1,20 @@
-#define system.
-#define extensions.
+#import system.
+#import extensions.
-#symbol fibo = (:n)
-[
- (n < 0)
- ? [ #throw InvalidArgumentException new &message:"Must be non negative". ].
+#class(extension)mathOp
+{
+ #method fib
+ [
+ (self < 0)
+ ? [ #throw InvalidArgumentException new &message:"Must be non negative". ].
- ^ { eval:n [ ^ (n > 1) ? [ ($self:(n - 2)) + ($self:(n - 1)) ] ! [ n ]. ] }:n.
-].
+ ^ control eval:self &for:
+ (:n)
+ [
+ (n > 1) ? [ this eval:(n - 2) + this eval:(n - 1) ] ! [ n ]
+ ].
+ ]
+}
#symbol program =
[
@@ -15,7 +22,7 @@
[
console writeLiteral:"fib(":i:")=".
- console writeLine:(fibo:i) | if &InvalidArgumentError: e
+ console writeLine:(i fib) | if &InvalidArgumentError: e
[
console writeLine:"invalid".
].
diff --git a/Task/Anonymous-recursion/Io/anonymous-recursion.io b/Task/Anonymous-recursion/Io/anonymous-recursion.io
new file mode 100644
index 0000000000..2119aacdac
--- /dev/null
+++ b/Task/Anonymous-recursion/Io/anonymous-recursion.io
@@ -0,0 +1,7 @@
+fib := method(x,
+ if(x < 0, Exception raise("Negative argument not allowed!"))
+ fib2 := method(n,
+ if(n < 2, n, fib2(n-1) + fib2(n-2))
+ )
+ fib2(x floor)
+)
diff --git a/Task/Anonymous-recursion/REXX/anonymous-recursion-1.rexx b/Task/Anonymous-recursion/REXX/anonymous-recursion-1.rexx
new file mode 100644
index 0000000000..0052921a0d
--- /dev/null
+++ b/Task/Anonymous-recursion/REXX/anonymous-recursion-1.rexx
@@ -0,0 +1,13 @@
+/*REXX program to show anonymous recursion (of a function or subroutine). */
+numeric digits 1e6 /*in case the user goes ka-razy. */
+parse arg x . /*obtain the optional argument from CL.*/
+if x=='' | x=="," then x=12 /*Not specified? Then use the default.*/
+w=length(x) /*W: used for formatting the output. */
+ do j=0 to x; jj=right(j, w) /*use the argument as an upper limit.*/
+ say 'fibonacci('jj") =" fib(j) /*show the Fibonacci sequence: 0 ──► x */
+ end /*j*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+fib: procedure; parse arg z; if z>=0 then return .(z)
+ say "***error*** argument can't be negative."; exit
+.: procedure; parse arg #; if #<2 then return #; return .(#-1) + .(#-2)
diff --git a/Task/Anonymous-recursion/REXX/anonymous-recursion-2.rexx b/Task/Anonymous-recursion/REXX/anonymous-recursion-2.rexx
new file mode 100644
index 0000000000..dff9575bbe
--- /dev/null
+++ b/Task/Anonymous-recursion/REXX/anonymous-recursion-2.rexx
@@ -0,0 +1,14 @@
+/*REXX program to show anonymous recursion of a function or subroutine with memoization.*/
+numeric digits 1e6 /*in case the user goes ka-razy. */
+parse arg x . /*obtain the optional argument from CL.*/
+if x=='' | x=="," then x=12 /*Not specified? Then use the default.*/
+@.=.; @.0=0; @.1=1 /*used to implement memoization for FIB*/
+w=length(x) /*W: used for formatting the output. */
+ do j=0 to x; jj=right(j, w) /*use the argument as an upper limit.*/
+ say 'fibonacci('jj") =" fib(j) /*show the Fibonacci sequence: 0 ──► x */
+ end /*j*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+fib: procedure expose @.; arg z; if z>=0 then return .(z)
+ say "***error*** argument can't be negative."; exit
+.: procedure expose @.; arg #; if @.#\==. then return @.#; @.#=.(#-1)+.(#-2); return @.#
diff --git a/Task/Anonymous-recursion/REXX/anonymous-recursion.rexx b/Task/Anonymous-recursion/REXX/anonymous-recursion.rexx
deleted file mode 100644
index 2d77316544..0000000000
--- a/Task/Anonymous-recursion/REXX/anonymous-recursion.rexx
+++ /dev/null
@@ -1,11 +0,0 @@
-/*REXX program to show anonymous recursion (of a function/subroutine). */
-numeric digits 1e6 /*in case the user goes kaa-razy.*/
-
- do j=0 to word(arg(1) 12, 1) /*use argument or the default: 12*/
- say 'fibonacci('j") =" fib(j) /*show Fibonacci sequence: 0──►x */
- end /*j*/
-exit /*stick a fork in it, we're done.*/
-/*──────────────────────────────────subroutines─────────────────────────*/
-fib: procedure; if arg(1)>=0 then return .(arg(1))
- say "***error!*** argument can't be negative."; exit
-.:procedure; arg _; if _<2 then return _; return .(_-1)+.(_-2)
diff --git a/Task/Anonymous-recursion/ZX-Spectrum-Basic/anonymous-recursion.zx b/Task/Anonymous-recursion/ZX-Spectrum-Basic/anonymous-recursion.zx
new file mode 100644
index 0000000000..5a39fe6673
--- /dev/null
+++ b/Task/Anonymous-recursion/ZX-Spectrum-Basic/anonymous-recursion.zx
@@ -0,0 +1,12 @@
+10 INPUT "Enter a number: ";n
+20 LET t=0
+30 GO SUB 60
+40 PRINT t
+50 STOP
+60 LET nold1=1: LET nold2=0
+70 IF n<0 THEN PRINT "Positive argument required!": RETURN
+80 IF n=0 THEN LET t=nold2: RETURN
+90 IF n=1 THEN LET t=nold1: RETURN
+100 LET t=nold2+nold1
+110 IF n>2 THEN LET n=n-1: LET nold2=nold1: LET nold1=t: GO SUB 100
+120 RETURN
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/00DESCRIPTION b/Task/Append-a-record-to-the-end-of-a-text-file/00DESCRIPTION
index 34ab44e60d..f1dc5e9517 100644
--- a/Task/Append-a-record-to-the-end-of-a-text-file/00DESCRIPTION
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/00DESCRIPTION
@@ -2,7 +2,8 @@ Many systems offer the ability to open a file for writing, such that any data wr
This feature is most useful in the case of log files, where many jobs may be appending to the log file at the same time, or where care ''must'' be taken to avoid concurrently overwriting the same record from another job.
-'''Task:'''
+
+;Task:
Given a two record sample for a mythical "passwd" file:
* Write these records out in the typical system format.
** Ideally these records will have named fields of various types.
@@ -56,3 +57,4 @@ Appended record: xyz:x:1003:1000:X Yz,Room 1003,(234)555-8913,(234)555-0033,xyz@
|}
Alternatively: If the language's appends can not guarantee its writes will '''always''' append, then note this restriction in the table. If possible, provide an actual code example (possibly using file/record locking) to guarantee correct concurrent appends.
+
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/AWK/append-a-record-to-the-end-of-a-text-file.awk b/Task/Append-a-record-to-the-end-of-a-text-file/AWK/append-a-record-to-the-end-of-a-text-file.awk
new file mode 100644
index 0000000000..3ae75a10b0
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/AWK/append-a-record-to-the-end-of-a-text-file.awk
@@ -0,0 +1,24 @@
+# syntax: GAWK -f APPEND_A_RECORD_TO_THE_END_OF_A_TEXT_FILE.AWK
+BEGIN {
+ fn = "\\etc\\passwd"
+# create and populate file
+ print("account:password:UID:GID:fullname,office,extension,homephone,email:directory:shell") >fn
+ print("jsmith:x:1001:1000:Joe Smith,Room 1007,(234)555-8917,(234)555-0077,jsmith@rosettacode.org:/home/jsmith:/bin/bash") >fn
+ print("jdoe:x:1002:1000:Jane Doe,Room 1004,(234)555-8914,(234)555-0044,jdoe@rosettacode.org:/home/jdoe:/bin/bash") >fn
+ close(fn)
+ show_file("initial file")
+# append record
+ print("xyz:x:1003:1000:X Yz,Room 1003,(234)555-8913,(234)555-0033,xyz@rosettacode.org:/home/xyz:/bin/bash") >>fn
+ close(fn)
+ show_file("file after append")
+ exit(0)
+}
+function show_file(desc, nr,rec) {
+ printf("%s:\n",desc)
+ while (getline rec 0) {
+ nr++
+ printf("%s\n",rec)
+ }
+ close(fn)
+ printf("%d records\n\n",nr)
+}
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/COBOL/append-a-record-to-the-end-of-a-text-file.cobol b/Task/Append-a-record-to-the-end-of-a-text-file/COBOL/append-a-record-to-the-end-of-a-text-file.cobol
new file mode 100644
index 0000000000..50332e8791
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/COBOL/append-a-record-to-the-end-of-a-text-file.cobol
@@ -0,0 +1,272 @@
+ *> Tectonics:
+ *> cobc -xj append.cob
+ *> cobc -xjd -DDEBUG append.cob
+ *> ***************************************************************
+ identification division.
+ program-id. append.
+
+ environment division.
+ configuration section.
+ repository.
+ function all intrinsic.
+
+ input-output section.
+ file-control.
+ select pass-file
+ assign to pass-filename
+ organization is line sequential
+ status is pass-status.
+
+ REPLACE ==:LRECL:== BY ==2048==.
+
+ data division.
+ file section.
+ fd pass-file record varying depending on pass-length.
+ 01 fd-pass-record.
+ 05 filler pic x occurs 0 to :LRECL: times
+ depending on pass-length.
+
+ working-storage section.
+ 01 pass-filename.
+ 05 filler value "passfile".
+ 01 pass-status pic xx.
+ 88 ok-status values '00' thru '09'.
+ 88 eof-pass value '10'.
+
+ 01 pass-length usage index.
+ 01 total-length usage index.
+
+ 77 file-action pic x(11).
+
+ 01 pass-record.
+ 05 account pic x(64).
+ 88 key-account value "xyz".
+ 05 password pic x(64).
+ 05 uid pic z(4)9.
+ 05 gid pic z(4)9.
+ 05 details.
+ 10 fullname pic x(128).
+ 10 office pic x(128).
+ 10 extension pic x(32).
+ 10 homephone pic x(32).
+ 10 email pic x(256).
+ 05 homedir pic x(256).
+ 05 shell pic x(256).
+
+ 77 colon pic x value ":".
+ 77 comma-mark pic x value ",".
+ 77 newline pic x value x"0a".
+
+ *> ***************************************************************
+ procedure division.
+ main-routine.
+ perform initial-fill
+
+ >>IF DEBUG IS DEFINED
+ display "Initial data:"
+ perform show-records
+ >>END-IF
+
+ perform append-record
+
+ >>IF DEBUG IS DEFINED
+ display newline "After append:"
+ perform show-records
+ >>END-IF
+
+ perform verify-append
+ goback
+ .
+
+ *> ***************************************************************
+ initial-fill.
+ perform open-output-pass-file
+
+ move "jsmith" to account
+ move "x" to password
+ move 1001 to uid
+ move 1000 to gid
+ move "Joe Smith" to fullname
+ move "Room 1007" to office
+ move "(234)555-8917" to extension
+ move "(234)555-0077" to homephone
+ move "jsmith@rosettacode.org" to email
+ move "/home/jsmith" to homedir
+ move "/bin/bash" to shell
+ perform write-pass-record
+
+ move "jdoe" to account
+ move "x" to password
+ move 1002 to uid
+ move 1000 to gid
+ move "Jane Doe" to fullname
+ move "Room 1004" to office
+ move "(234)555-8914" to extension
+ move "(234)555-0044" to homephone
+ move "jdoe@rosettacode.org" to email
+ move "/home/jdoe" to homedir
+ move "/bin/bash" to shell
+ perform write-pass-record
+
+ perform close-pass-file
+ .
+
+ *> **********************
+ check-pass-file.
+ if not ok-status then
+ perform file-error
+ end-if
+ .
+
+ *> **********************
+ check-pass-with-eof.
+ if not ok-status and not eof-pass then
+ perform file-error
+ end-if
+ .
+
+ *> **********************
+ file-error.
+ display "error " file-action space pass-filename
+ space pass-status upon syserr
+ move 1 to return-code
+ goback
+ .
+
+ *> **********************
+ append-record.
+ move "xyz" to account
+ move "x" to password
+ move 1003 to uid
+ move 1000 to gid
+ move "X Yz" to fullname
+ move "Room 1003" to office
+ move "(234)555-8913" to extension
+ move "(234)555-0033" to homephone
+ move "xyz@rosettacode.org" to email
+ move "/home/xyz" to homedir
+ move "/bin/bash" to shell
+
+ perform open-extend-pass-file
+ perform write-pass-record
+ perform close-pass-file
+ .
+
+ *> **********************
+ open-output-pass-file.
+ open output pass-file with lock
+ move "open output" to file-action
+ perform check-pass-file
+ .
+
+ *> **********************
+ open-extend-pass-file.
+ open extend pass-file with lock
+ move "open extend" to file-action
+ perform check-pass-file
+ .
+
+ *> **********************
+ open-input-pass-file.
+ open input pass-file
+ move "open input" to file-action
+ perform check-pass-file
+ .
+
+ *> **********************
+ close-pass-file.
+ close pass-file
+ move "closing" to file-action
+ perform check-pass-file
+ .
+
+ *> **********************
+ write-pass-record.
+ set total-length to 1
+ set pass-length to :LRECL:
+ string
+ account delimited by space
+ colon
+ password delimited by space
+ colon
+ trim(uid leading) delimited by size
+ colon
+ trim(gid leading) delimited by size
+ colon
+ trim(fullname trailing) delimited by size
+ comma-mark
+ trim(office trailing) delimited by size
+ comma-mark
+ trim(extension trailing) delimited by size
+ comma-mark
+ trim(homephone trailing) delimited by size
+ comma-mark
+ email delimited by space
+ colon
+ trim(homedir trailing) delimited by size
+ colon
+ trim(shell trailing) delimited by size
+ into fd-pass-record with pointer total-length
+ on overflow
+ display "error: fd-pass-record truncated at "
+ total-length upon syserr
+ end-string
+ set pass-length to total-length
+ set pass-length down by 1
+
+ write fd-pass-record
+ move "writing" to file-action
+ perform check-pass-file
+ .
+
+ *> **********************
+ read-pass-file.
+ read pass-file
+ move "reading" to file-action
+ perform check-pass-with-eof
+ .
+
+ *> **********************
+ show-records.
+ perform open-input-pass-file
+
+ perform read-pass-file
+ perform until eof-pass
+ perform show-pass-record
+ perform read-pass-file
+ end-perform
+
+ perform close-pass-file
+ .
+
+ *> **********************
+ show-pass-record.
+ display fd-pass-record
+ .
+
+ *> **********************
+ verify-append.
+ perform open-input-pass-file
+
+ move 0 to tally
+ perform read-pass-file
+ perform until eof-pass
+ add 1 to tally
+ unstring fd-pass-record delimited by colon
+ into account
+ if key-account then exit perform end-if
+ perform read-pass-file
+ end-perform
+ if (key-account and tally not > 2) or (not key-account) then
+ display
+ "error: appended record not found in correct position"
+ upon syserr
+ else
+ display "Appended record: " with no advancing
+ perform show-pass-record
+ end-if
+
+ perform close-pass-file
+ .
+
+ end program append.
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/Elixir/append-a-record-to-the-end-of-a-text-file.elixir b/Task/Append-a-record-to-the-end-of-a-text-file/Elixir/append-a-record-to-the-end-of-a-text-file.elixir
new file mode 100644
index 0000000000..3f49880c9a
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/Elixir/append-a-record-to-the-end-of-a-text-file.elixir
@@ -0,0 +1,88 @@
+defmodule Gecos do
+ defstruct [:fullname, :office, :extension, :homephone, :email]
+end
+
+defmodule Passwd do
+ defstruct [:account, :password, :uid, :gid, :gecos, :directory, :shell]
+end
+
+defimpl String.Chars, for: Gecos do
+ def to_string(gecos) do
+ [:fullname, :office, :extension, :homephone, :email]
+ |> Enum.map(&Map.get(gecos, &1))
+ |> Enum.join(",")
+ end
+end
+
+defimpl String.Chars, for: Passwd do
+ def to_string(passwd) do
+ [:account, :password, :uid, :gid, :gecos, :directory, :shell]
+ |> Enum.map(&String.Chars.to_string(Map.get(passwd, &1)))
+ |> Enum.join(":")
+ end
+end
+
+defmodule Appender do
+ def write(filename) do
+ jsmith = %Passwd{
+ account: "jsmith",
+ password: "x",
+ uid: 1001,
+ gid: 1000,
+ gecos: %Gecos{
+ fullname: "Joe Smith",
+ office: "Room 1007",
+ extension: "(234)555-8917",
+ homephone: "(234)555-0077",
+ email: "jsmith@rosettacode.org"
+ },
+ directory: "/home/jsmith",
+ shell: "/bin/bash"
+ }
+
+ jdoe = %Passwd{
+ account: "jdoe",
+ password: "x",
+ uid: 1002,
+ gid: 1000,
+ gecos: %Gecos{
+ fullname: "Jane Doe",
+ office: "Room 1004",
+ extension: "(234)555-8914",
+ homephone: "(234)555-0044",
+ email: "jdoe@rosettacode.org"
+ },
+ directory: "/home/jdoe",
+ shell: "/bin/bash"
+ }
+
+ xyz = %Passwd{
+ account: "xyz",
+ password: "x",
+ uid: 1003,
+ gid: 1000,
+ gecos: %Gecos{
+ fullname: "X Yz",
+ office: "Room 1003",
+ extension: "(234)555-8913",
+ homephone: "(234)555-0033",
+ email: "xyz@rosettacode.org"
+ },
+ directory: "/home/xyz",
+ shell: "/bin/bash"
+ }
+
+ {:ok, file} = File.open(filename, [:write])
+ IO.puts(file, jsmith)
+ IO.puts(file, jdoe)
+ File.close(file)
+
+ {:ok, file} = File.open(filename, [:append])
+ IO.puts(file, xyz)
+ File.close(file)
+
+ IO.puts File.read!(filename)
+ end
+end
+
+Appender.write("passwd.txt")
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/Fortran/append-a-record-to-the-end-of-a-text-file.f b/Task/Append-a-record-to-the-end-of-a-text-file/Fortran/append-a-record-to-the-end-of-a-text-file.f
new file mode 100644
index 0000000000..f0042d9181
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/Fortran/append-a-record-to-the-end-of-a-text-file.f
@@ -0,0 +1,64 @@
+ PROGRAM DEMO !As per the described task, more or less.
+ TYPE DETAILS !Define a component.
+ CHARACTER*28 FULLNAME
+ CHARACTER*12 OFFICE
+ CHARACTER*16 EXTENSION
+ CHARACTER*16 HOMEPHONE
+ CHARACTER*88 EMAIL
+ END TYPE DETAILS
+ TYPE USERSTUFF !Define the desired data aggregate.
+ CHARACTER*8 ACCOUNT
+ CHARACTER*8 PASSWORD !Plain text!! Eeek!!!
+ INTEGER*2 UID
+ INTEGER*2 GID
+ TYPE(DETAILS) PERSON
+ CHARACTER*18 DIRECTORY
+ CHARACTER*12 SHELL
+ END TYPE USERSTUFF
+ TYPE(USERSTUFF) NOTE !After all that, I'll have one.
+ NAMELIST /STUFF/ NOTE !Enables free-format I/O, with names.
+ INTEGER F,MSG,N
+ MSG = 6 !Standard output.
+ F = 10 !Suitable for some arbitrary file.
+ OPEN(MSG, DELIM = "QUOTE") !Text variables are to be enquoted.
+
+Create the file and supply its initial content.
+ OPEN (F, FILE="Staff.txt",STATUS="REPLACE",ACTION="WRITE",
+ 1 DELIM="QUOTE",RECL=666) !Special parameters for the free-format WRITE working.
+
+ WRITE (F,*) USERSTUFF("jsmith","x",1001,1000,
+ 1 DETAILS("Joe Smith","Room 1007","(234)555-8917",
+ 2 "(234)555-0077","jsmith@rosettacode.org"),
+ 2 "/home/jsmith","/bin/bash")
+
+ WRITE (F,*) USERSTUFF("jdoe","x",1002,1000,
+ 1 DETAILS("Jane Doe","Room 1004","(234)555-8914",
+ 2 "(234)555-0044","jdoe@rosettacode.org"),
+ 3 "home/jdoe","/bin/bash")
+ CLOSE (F) !The file is now existing.
+
+Choose the existing file, and append a further record to it.
+ OPEN (F, FILE="Staff.txt",STATUS="OLD",ACTION="WRITE",
+ 1 DELIM="QUOTE",RECL=666,ACCESS="APPEND")
+
+ NOTE = USERSTUFF("xyz","x",1003,1000, !Create a new record's worth of stuff.
+ 1 DETAILS("X Yz","Room 1003","(234)555-8193",
+ 2 "(234)555-033","xyz@rosettacode.org"),
+ 3 "/home/xyz","/bin/bash")
+ WRITE (F,*) NOTE !Append it's content to the file.
+ CLOSE (F)
+
+Chase through the file, revealing what had been written..
+ OPEN (F, FILE="Staff.txt",STATUS="OLD",ACTION="READ",
+ 1 DELIM="QUOTE",RECL=666)
+ N = 0
+ 10 READ (F,*,END = 20) NOTE !As it went out, so it comes in.
+ N = N + 1 !Another record read.
+ WRITE (MSG,11) N !Announce.
+ 11 FORMAT (/,"Record ",I0) !Thus without quotes around the text part.
+ WRITE (MSG,STUFF) !Reveal.
+ GO TO 10 !Try again.
+
+Closedown.
+ 20 CLOSE (F)
+ END
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-1.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-1.psh
new file mode 100644
index 0000000000..a512fd4292
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-1.psh
@@ -0,0 +1,163 @@
+function Test-FileLock
+{
+ Param
+ (
+ [parameter(Mandatory=$true)]
+ [string]
+ $Path
+ )
+
+ $outFile = New-Object System.IO.FileInfo $Path
+
+ if (-not(Test-Path -Path $Path))
+ {
+ return $false
+ }
+
+ try
+ {
+ $outStream = $outFile.Open([System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None)
+
+ if ($outStream)
+ {
+ $outStream.Close()
+ }
+
+ return $false
+ }
+ catch
+ {
+ # File is locked by a process.
+ return $true
+ }
+}
+
+function New-Record
+{
+ Param
+ (
+ [string]$Account,
+ [string]$Password,
+ [int]$UID,
+ [int]$GID,
+ [string]$FullName,
+ [string]$Office,
+ [string]$Extension,
+ [string]$HomePhone,
+ [string]$Email,
+ [string]$Directory,
+ [string]$Shell
+ )
+
+ $GECOS = [PSCustomObject]@{
+ FullName = $FullName
+ Office = $Office
+ Extension = $Extension
+ HomePhone = $HomePhone
+ Email = $Email
+ }
+
+ [PSCustomObject]@{
+ Account = $Account
+ Password = $Password
+ UID = $UID
+ GID = $GID
+ GECOS = $GECOS
+ Directory = $Directory
+ Shell = $Shell
+ }
+}
+
+
+function Import-File
+{
+ Param
+ (
+ [Parameter(Mandatory=$false,
+ ValueFromPipeline=$true,
+ ValueFromPipelineByPropertyName=$true)]
+ [string]
+ $Path = ".\passwd.txt"
+ )
+
+ if (-not(Test-Path $Path))
+ {
+ throw [System.IO.FileNotFoundException]
+ }
+
+ $header = "Account","Password","UID","GID","GECOS","Directory","Shell"
+
+ $csv = Import-Csv -Path $Path -Delimiter ":" -Header $header -Encoding ASCII
+ $csv | ForEach-Object {
+ New-Record -Account $_.Account `
+ -Password $_.Password `
+ -UID $_.UID `
+ -GID $_.GID `
+ -FullName $_.GECOS.Split(",")[0] `
+ -Office $_.GECOS.Split(",")[1] `
+ -Extension $_.GECOS.Split(",")[2] `
+ -HomePhone $_.GECOS.Split(",")[3] `
+ -Email $_.GECOS.Split(",")[4] `
+ -Directory $_.Directory `
+ -Shell $_.Shell
+ }
+}
+
+
+function Export-File
+{
+ [CmdletBinding()]
+ Param
+ (
+ [Parameter(Mandatory=$true,
+ ValueFromPipeline=$true,
+ ValueFromPipelineByPropertyName=$true)]
+ $InputObject,
+
+ [Parameter(Mandatory=$false,
+ ValueFromPipeline=$true,
+ ValueFromPipelineByPropertyName=$true)]
+ [string]
+ $Path = ".\passwd.txt"
+ )
+
+ Begin
+ {
+ if (-not(Test-Path $Path))
+ {
+ New-Item -Path . -Name $Path -ItemType File | Out-Null
+ }
+
+ [string]$recordString = "{0}:{1}:{2}:{3}:{4}:{5}:{6}"
+ [string]$gecosString = "{0},{1},{2},{3},{4}"
+ [string[]]$lines = @()
+ [string[]]$file = Get-Content $Path
+ }
+ Process
+ {
+ foreach ($object in $InputObject)
+ {
+ $lines += $recordString -f $object.Account,
+ $object.Password,
+ $object.UID,
+ $object.GID,
+ $($gecosString -f $object.GECOS.FullName,
+ $object.GECOS.Office,
+ $object.GECOS.Extension,
+ $object.GECOS.HomePhone,
+ $object.GECOS.Email),
+ $object.Directory,
+ $object.Shell
+ }
+ }
+ End
+ {
+ foreach ($line in $lines)
+ {
+ if (-not ($line -in $file))
+ {
+ $line | Out-File -FilePath $Path -Encoding ASCII -Append
+ }
+ }
+ }
+}
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-2.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-2.psh
new file mode 100644
index 0000000000..47fd84d242
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-2.psh
@@ -0,0 +1,25 @@
+$records = @()
+
+$records+= New-Record -Account 'jsmith' `
+ -Password 'x' `
+ -UID 1001 `
+ -GID 1000 `
+ -FullName 'Joe Smith' `
+ -Office 'Room 1007' `
+ -Extension '(234)555-8917' `
+ -HomePhone '(234)555-0077' `
+ -Email 'jsmith@rosettacode.org' `
+ -Directory '/home/jsmith' `
+ -Shell '/bin/bash'
+
+$records+= New-Record -Account 'jdoe' `
+ -Password 'x' `
+ -UID 1002 `
+ -GID 1000 `
+ -FullName 'Jane Doe' `
+ -Office 'Room 1004' `
+ -Extension '(234)555-8914' `
+ -HomePhone '(234)555-0044' `
+ -Email 'jdoe@rosettacode.org' `
+ -Directory '/home/jdoe' `
+ -Shell '/bin/bash'
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-3.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-3.psh
new file mode 100644
index 0000000000..7a06667901
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-3.psh
@@ -0,0 +1 @@
+$records | Format-Table -AutoSize
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-4.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-4.psh
new file mode 100644
index 0000000000..cda47a797f
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-4.psh
@@ -0,0 +1,4 @@
+if (-not(Test-FileLock -Path ".\passwd.txt"))
+{
+ $records | Export-File -Path ".\passwd.txt"
+}
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-5.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-5.psh
new file mode 100644
index 0000000000..ff8cd63b12
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-5.psh
@@ -0,0 +1 @@
+Get-Content -Path ".\passwd.txt"
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-6.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-6.psh
new file mode 100644
index 0000000000..1661e68a11
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-6.psh
@@ -0,0 +1,11 @@
+$records+= New-Record -Account 'xyz' `
+ -Password 'x' `
+ -UID 1003 `
+ -GID 1000 `
+ -FullName 'X Yz' `
+ -Office 'Room 1003' `
+ -Extension '(234)555-8913' `
+ -HomePhone '(234)555-0033' `
+ -Email 'xyz@rosettacode.org' `
+ -Directory '/home/xyz' `
+ -Shell '/bin/bash'
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-7.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-7.psh
new file mode 100644
index 0000000000..c22086c11f
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-7.psh
@@ -0,0 +1 @@
+$records | Sort-Object { $_.GECOS.FullName.Split(" ")[1] } | Format-Table -AutoSize
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-8.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-8.psh
new file mode 100644
index 0000000000..cda47a797f
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-8.psh
@@ -0,0 +1,4 @@
+if (-not(Test-FileLock -Path ".\passwd.txt"))
+{
+ $records | Export-File -Path ".\passwd.txt"
+}
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-9.psh b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-9.psh
new file mode 100644
index 0000000000..ff8cd63b12
--- /dev/null
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/PowerShell/append-a-record-to-the-end-of-a-text-file-9.psh
@@ -0,0 +1 @@
+Get-Content -Path ".\passwd.txt"
diff --git a/Task/Append-a-record-to-the-end-of-a-text-file/REXX/append-a-record-to-the-end-of-a-text-file.rexx b/Task/Append-a-record-to-the-end-of-a-text-file/REXX/append-a-record-to-the-end-of-a-text-file.rexx
index 7dfbc98a4e..2c4e553f25 100644
--- a/Task/Append-a-record-to-the-end-of-a-text-file/REXX/append-a-record-to-the-end-of-a-text-file.rexx
+++ b/Task/Append-a-record-to-the-end-of-a-text-file/REXX/append-a-record-to-the-end-of-a-text-file.rexx
@@ -1,48 +1,39 @@
-/*REXX pgm: writes two records, close file, appends another record. */
-signal on syntax; signal on novalue /*handle REXX program errors. */
-tFID='PASSWD.TXT' /*define the name of the out file*/
-call lineout tFID /*close the file, just in case; */
- /*could be open from calling pgm.*/
-call writeRec tFID,, /*append 1st record to the file. */
+/*REXX program writes (appends) two records, closes the file, appends another record.*/
+signal on syntax; signal on noValue /*handle (if any) REXX program errors.*/
+tFID= 'PASSWD.TXT' /*define the name of the output file.*/
+call lineout tFID /*close the output file, just in case,*/
+ /* it could be open from calling pgm.*/
+call writeRec tFID,, /*append the 1st record to the file. */
'jsmith',"x", 1001, 1000, 'Joe Smith,Room 1007,(234)555-8917,(234)555-0077,jsmith@rosettacode.org', "/home/jsmith", '/bin/bash'
-call writeRec tFID,, /*append 2nd record to the file. */
+call writeRec tFID,, /*append the 2nd record to the file. */
'jdoe', "x", 1002, 1000, 'Jane Doe,Room 1004,(234)555-8914,(234)555-0044,jdoe@rosettacode.org', "/home/jsmith", '/bin/bash'
-call lineout fid /*close the file. */
+call lineout fid /*close the outfile (just to be tidy).*/
-call writeRec tFID,, /*append 3rd record to the file. */
+call writeRec tFID,, /*append the 3rd record to the file. */
'xyz', "x", 1003, 1000, 'X Yz,Room 1003,(234)555-8913,(234)555-0033,xyz@rosettacode.org', "/home/xyz", '/bin/bash'
/*─account─pw────uid───gid──────────────fullname,office,extension,homephone,Email────────────────────────directory───────shell──*/
-call lineout fid /*safe programming: close file. */
-exit /*stick a fork in it, we're done.*/
-/*──────────────────────────────────WRITEREC subroutine─────────────────*/
-writeRec: parse arg fid,_ /*get the fileID, and the 1st arg*/
-sep=':' /*field delimiter used in file. */
- /*Note: SEP field should be ··· */
- /*··· unique and can be any size.*/
- do i=3 to arg() /*get each argument and append it*/
- _=_ ||sep|| arg(i) /*to the prev. arg, with a : sep.*/
- end /*i*/
+call lineout fid /*"be safe" programming: close the file*/
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+err: say; say '***error***'; say; do j=1 for arg(); say arg(j); say; end; exit 13
+s: if arg(1)==1 then return arg(3); return word(arg(2) 's', 1) /*pluralizer*/
+/*──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────*/
+noValue: syntax: call err 'REXX program' condition("C"), condition("D"), 'REXX source statement (line' sigl"):", sourceline(sigl)
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+writeRec: parse arg fid,_ /*get the fileID, and also the 1st arg.*/
+ sep=':' /*field delimiter used in file, it ··· */
+ /* ··· can be unique and any size.*/
+ do i=3 to arg() /*get each argument and append it to */
+ _=_ || sep || arg(i) /* the previous arg, with a : sep.*/
+ end /*i*/
- do tries=0 for 11 /*keep trying for 66 seconds. */
- r=lineout(fid,_) /*write (append) the new record. */
- if r==0 then return /*Zero? Then record was written.*/
- call sleep tries /*Error: so try again after delay*/
- end /*tries*/ /*Note: not all REXXes have SLEEP*/
-
- /*possibly: no write access, */
- /* proper authority, */
- /* permission, etc. */
-call err r 'record's(r) "not written to file" fid
-exit 13
-/*───────────────────────────────error handling subroutines and others.─*/
-err: say; say; say center(' error! ',40,"*"); say
- do j=1 for arg(); say arg(j); say; end; say; exit 13
-
-novalue: syntax: call err 'REXX program' condition('C') "error",,
- condition('D'),'REXX source statement (line' sigl"):",,
- sourceline(sigl)
-
-s: if arg(1)==1 then return arg(3);return word(arg(2) 's',1)
+ do tries=0 for 11 /*keep trying for 66 seconds. */
+ r=lineout(fid, _) /*write (append) the new record. */
+ if r==0 then return /*Zero? Then record was written. */
+ call sleep tries /*Error? So try again after a delay. */
+ end /*tries*/ /*Note: not all REXXes have SLEEP. */
+ call err r 'record's(r) "not written to file" fid; exit 13
+ /*some error causes: no write access, disk is full, file lockout, no authority*/
diff --git a/Task/Apply-a-callback-to-an-array/00DESCRIPTION b/Task/Apply-a-callback-to-an-array/00DESCRIPTION
index f292071326..cda9662e66 100644
--- a/Task/Apply-a-callback-to-an-array/00DESCRIPTION
+++ b/Task/Apply-a-callback-to-an-array/00DESCRIPTION
@@ -1,2 +1,3 @@
-In this task, the goal is to take a combined set of elements
-and apply a function to each element.
+;Task:
+Take a combined set of elements and apply a function to each element.
+
diff --git a/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array-1.applescript b/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array-1.applescript
new file mode 100644
index 0000000000..5d2d0779ad
--- /dev/null
+++ b/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array-1.applescript
@@ -0,0 +1,11 @@
+on callback for arg
+ -- Returns a string like "arc has 3 letters"
+ arg & " has " & (count arg) & " letters"
+end callback
+
+set alist to {"arc", "be", "circle"}
+repeat with aref in alist
+ -- Passes a reference to some item in alist
+ -- to callback, then speaks the return value.
+ say (callback for aref)
+end repeat
diff --git a/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array-2.applescript b/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array-2.applescript
new file mode 100644
index 0000000000..6f71daac88
--- /dev/null
+++ b/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array-2.applescript
@@ -0,0 +1,78 @@
+on run
+
+ set xs to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
+
+ {map(square, xs), ¬
+ filter(isEven, xs), ¬
+ foldl(sum, 0, xs)}
+
+ --> {{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}, {2, 4, 6, 8, 10}, 55}
+
+end run
+
+-- square :: Num -> Num -> Num
+on square(x)
+ x * x
+end square
+
+-- sum :: Num -> Num -> Num
+on sum(a, b)
+ a + b
+end sum
+
+-- isEven :: Int -> Bool
+on isEven(n)
+ n mod 2 = 0
+end isEven
+
+
+-- GENERIC HIGHER ORDER FUNCTIONS
+
+-- map :: (a -> b) -> [a] -> [b]
+on map(f, xs)
+ tell mReturn(f)
+ set lng to length of xs
+ set lst to {}
+ repeat with i from 1 to lng
+ set end of lst to lambda(item i of xs, i, xs)
+ end repeat
+ return lst
+ end tell
+end map
+
+-- foldl :: (a -> b -> a) -> a -> [b] -> a
+on foldl(f, startValue, xs)
+ tell mReturn(f)
+ set v to startValue
+ set lng to length of xs
+ repeat with i from 1 to lng
+ set v to lambda(v, item i of xs, i, xs)
+ end repeat
+ return v
+ end tell
+end foldl
+
+-- filter :: (a -> Bool) -> [a] -> [a]
+on filter(f, xs)
+ tell mReturn(f)
+ set lst to {}
+ set lng to length of xs
+ repeat with i from 1 to lng
+ set v to item i of xs
+ if lambda(v, i, xs) then set end of lst to v
+ end repeat
+ return lst
+ end tell
+end filter
+
+-- Lift 2nd class handler function into 1st class script wrapper
+-- mReturn :: Handler -> Script
+on mReturn(f)
+ if class of f is script then
+ f
+ else
+ script
+ property lambda : f
+ end script
+ end if
+end mReturn
diff --git a/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array.applescript b/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array.applescript
deleted file mode 100644
index 855c9661ae..0000000000
--- a/Task/Apply-a-callback-to-an-array/AppleScript/apply-a-callback-to-an-array.applescript
+++ /dev/null
@@ -1,11 +0,0 @@
-on callback for arg
- -- Returns a string like "arc has 3 letters"
- arg & " has " & (count arg) & " letters"
-end callback
-
-set alist to {"arc", "be", "circle"}
-repeat with aref in alist
- -- Passes a reference to some item in alist
- -- to callback, then speaks the return value.
- say (callback for aref)
-end repeat
diff --git a/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-1.pb b/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-1.pb
index 4e9cd2b5d5..20afd40d78 100644
--- a/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-1.pb
+++ b/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-1.pb
@@ -1,6 +1 @@
-((main
- { (1 1 2 3 5 8 13 21) dup
- {double !} each
- {%d ' ' . <<} each})
-
-(double { dup 2 * set }))
+sq { dup * } <
diff --git a/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-2.pb b/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-2.pb
index 3723d68068..1d33a00ef6 100644
--- a/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-2.pb
+++ b/Task/Apply-a-callback-to-an-array/Babel/apply-a-callback-to-an-array-2.pb
@@ -1,9 +1 @@
-((main
- { (1 1 2 3 5 8 13 21)
- {double !} each
- collect !
- {%d ' ' . <<} each})
-
-(double { 2 * })
-
-(collect { -1 take }))
+( 0 1 1 2 3 5 8 13 21 34 ) { sq ! } over ! lsnum !
diff --git a/Task/Apply-a-callback-to-an-array/Elixir/apply-a-callback-to-an-array.elixir b/Task/Apply-a-callback-to-an-array/Elixir/apply-a-callback-to-an-array.elixir
new file mode 100644
index 0000000000..84e62078e3
--- /dev/null
+++ b/Task/Apply-a-callback-to-an-array/Elixir/apply-a-callback-to-an-array.elixir
@@ -0,0 +1 @@
+Enum.map([1, 2, 3], fn(n) -> n * 2 end)
diff --git a/Task/Apply-a-callback-to-an-array/Kotlin/apply-a-callback-to-an-array.kotlin b/Task/Apply-a-callback-to-an-array/Kotlin/apply-a-callback-to-an-array.kotlin
new file mode 100644
index 0000000000..d833e479fb
--- /dev/null
+++ b/Task/Apply-a-callback-to-an-array/Kotlin/apply-a-callback-to-an-array.kotlin
@@ -0,0 +1,6 @@
+fun main(args: Array) {
+ val array = arrayOf(1,2,3,4,5,6,7,8,9,10) // build
+ val function = { i: Int -> i * i } // function to apply
+ val list = array.map { function(it) } // process each item
+ println(list) // print results
+}
diff --git a/Task/Apply-a-callback-to-an-array/Oberon-2/apply-a-callback-to-an-array.oberon-2 b/Task/Apply-a-callback-to-an-array/Oberon-2/apply-a-callback-to-an-array.oberon-2
new file mode 100644
index 0000000000..fe0f598b56
--- /dev/null
+++ b/Task/Apply-a-callback-to-an-array/Oberon-2/apply-a-callback-to-an-array.oberon-2
@@ -0,0 +1,88 @@
+MODULE ApplyCallBack;
+IMPORT
+ Out := NPCT:Console;
+
+TYPE
+ Fun = PROCEDURE (x: LONGINT): LONGINT;
+ Ptr2Ary = POINTER TO ARRAY OF LONGINT;
+
+VAR
+ a: ARRAY 5 OF LONGINT;
+ x: ARRAY 3 OF LONGINT;
+ r: Ptr2Ary;
+
+ PROCEDURE Min(x,y: LONGINT): LONGINT;
+ BEGIN
+ IF x <= y THEN RETURN x ELSE RETURN y END;
+ END Min;
+
+ PROCEDURE Init(VAR a: ARRAY OF LONGINT);
+ BEGIN
+ a[0] := 0;
+ a[1] := 1;
+ a[2] := 2;
+ a[3] := 3;
+ a[4] := 4;
+ END Init;
+
+ PROCEDURE Fun1(x: LONGINT): LONGINT;
+ BEGIN
+ RETURN x * 2
+ END Fun1;
+
+ PROCEDURE Fun2(x: LONGINT): LONGINT;
+ BEGIN
+ RETURN x DIV 2;
+ END Fun2;
+
+ PROCEDURE Fun3(x: LONGINT): LONGINT;
+ BEGIN
+ RETURN x + 3;
+ END Fun3;
+
+ PROCEDURE Map(F: Fun; VAR x: ARRAY OF LONGINT);
+ VAR
+ i: LONGINT;
+ BEGIN
+ FOR i := 0 TO LEN(x) - 1 DO
+ x[i] := F(x[i])
+ END
+ END Map;
+
+ PROCEDURE Map2(F: Fun; a: ARRAY OF LONGINT; VAR r: ARRAY OF LONGINT);
+ VAR
+ i,l: LONGINT;
+ BEGIN
+ l := Min(LEN(a),LEN(x));
+ FOR i := 0 TO l - 1 DO
+ r[i] := F(a[i])
+ END
+ END Map2;
+
+ PROCEDURE Map3(F: Fun; a: ARRAY OF LONGINT): Ptr2Ary;
+ VAR
+ r: Ptr2Ary;
+ i: LONGINT;
+ BEGIN
+ NEW(r,LEN(a));
+ FOR i := 0 TO LEN(a) - 1 DO
+ r[i] := F(a[i]);
+ END;
+ RETURN r
+ END Map3;
+
+ PROCEDURE Show(a: ARRAY OF LONGINT);
+ VAR
+ i: LONGINT;
+ BEGIN
+ FOR i := 0 TO LEN(a) - 1 DO
+ Out.Int(a[i],4)
+ END;
+ Out.Ln
+ END Show;
+
+BEGIN
+ Init(a);Map(Fun1,a);Show(a);
+ Init(a);Map2(Fun2,a,x);Show(x);
+ Init(a);r := Map3(Fun3,a);Show(r^);
+END ApplyCallBack.
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-1.pari
similarity index 100%
rename from Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array.pari
rename to Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array-1.pari
diff --git a/Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array-2.pari b/Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array-2.pari
new file mode 100644
index 0000000000..73a73bba60
--- /dev/null
+++ b/Task/Apply-a-callback-to-an-array/PARI-GP/apply-a-callback-to-an-array-2.pari
@@ -0,0 +1 @@
+call(callback, [1,2,3,4,5])
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
index 1e21782702..068e04f3f5 100644
--- 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
@@ -1 +1 @@
-[1, 2, 3].squared; // returns [1, 4, 9]
+[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
index af02876123..a3864475e7 100644
--- 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
@@ -1 +1 @@
-[1, 2, 3].collect({ arg x; x*x });
+[1, 2, 3].collect({ | 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
index d15215a55f..4ca917117b 100644
--- 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
@@ -1,9 +1,5 @@
-var square = {
- arg x;
- x*x;
-};
-var map = {
- arg fn, xs;
+var square = { |x| x * x };
+var map = { |fn, xs|
all {: fn.value(x), x <- xs };
};
-map.value(square,[1,2,3]);
+map.value(square, [1, 2, 3]);
diff --git a/Task/Apply-a-callback-to-an-array/ZX-Spectrum-Basic/apply-a-callback-to-an-array.zx b/Task/Apply-a-callback-to-an-array/ZX-Spectrum-Basic/apply-a-callback-to-an-array.zx
new file mode 100644
index 0000000000..9dbb8e4e16
--- /dev/null
+++ b/Task/Apply-a-callback-to-an-array/ZX-Spectrum-Basic/apply-a-callback-to-an-array.zx
@@ -0,0 +1,10 @@
+10 LET a$="x+x"
+20 LET b$="x*x"
+30 LET c$="x+x^2"
+40 LET f$=c$: REM Assign a$, b$ or c$
+150 FOR i=1 TO 5
+160 READ x
+170 PRINT x;" = ";VAL f$
+180 NEXT i
+190 STOP
+200 DATA 2,5,6,10,100
diff --git a/Task/Arbitrary-precision-integers--included-/00DESCRIPTION b/Task/Arbitrary-precision-integers--included-/00DESCRIPTION
index 0da06c6ecb..32972c33c3 100644
--- a/Task/Arbitrary-precision-integers--included-/00DESCRIPTION
+++ b/Task/Arbitrary-precision-integers--included-/00DESCRIPTION
@@ -1,14 +1,17 @@
Using the in-built capabilities of your language, calculate the integer value of:
-::
+
-* Confirm that the first and last twenty digits of the answer are: 62060698786608744707...92256259918212890625
+* 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-/C/arbitrary-precision-integers--included--3.c b/Task/Arbitrary-precision-integers--included-/C/arbitrary-precision-integers--included--3.c
new file mode 100644
index 0000000000..882396e319
--- /dev/null
+++ b/Task/Arbitrary-precision-integers--included-/C/arbitrary-precision-integers--included--3.c
@@ -0,0 +1,69 @@
+/* 5432_pure.c */
+#include
+#include
+#include
+#include
+
+/* return = a * b. Caller is responsible for freeing memory.
+ * Handling of negatives, and zeros is not here, since not needed.
+ */
+unsigned char *str_mult(const unsigned char *A, const unsigned char *B)
+{
+ int ax = 0, bx = 0, rx = 0, al, bl;
+ unsigned char *a, *b, *r; /* result */
+
+ al = strlen(A); bl = strlen(B);
+ r = calloc(al + bl + 1, 1);
+ /* convert A and B from ASCII string numbers, into numeric */
+ a = malloc(al+1); strcpy(a, A); for (ax = 0; ax < al; ++ax) a[ax] -= '0';
+ b = malloc(bl+1); strcpy(b, B); for (bx = 0; bx < bl; ++bx) b[bx] -= '0';
+
+ /* grade-school method of multiplication */
+ for (ax = al - 1; ax >= 0; ax--) {
+ int carry = 0;
+ for (bx = bl - 1, rx = ax + bx + 1; bx >= 0; bx--, rx--) {
+ int n = a[ax] * b[bx] + r[rx] + carry;
+ r[rx] = (n % 10);
+ carry = n / 10;
+ }
+ r[rx] += carry;
+ }
+ /* convert result from numeric into ASCII string numeric */
+ for (rx = 0; rx < al + bl; ++rx)
+ r[rx] += '0';
+ while (r[0] == '0')
+ memmove(r, &r[1], al + bl);
+ free(b); free(a);
+ return r;
+}
+
+unsigned char *str_exp(int b, int n) {
+ unsigned char *r, *tmp, *a;
+
+ r = malloc(2); strcpy(r, "1");
+ a = malloc(24); sprintf(a, "%d", b);
+
+ while (n!=1) {
+ if (n%2==1) {
+ tmp = str_mult(r, a);
+ free(r);
+ r = tmp;
+ }
+ n >>= 1;
+ tmp = str_mult(a, a);
+ free(a);
+ a = tmp;
+ }
+ free(r);
+ return a;
+}
+
+/* compute 5^4^3^2 which == 5^262144 */
+int main() {
+ unsigned char *r = str_exp(5,262144);
+ printf ("Length of 5^4^3^2 is %d\n", strlen(r));
+ printf ("First 20 digits: %20.20s\n", r);
+ printf ("Last 20 digits: %s\n", &r[strlen(r)-20]);
+ free(r);
+ printf ("This took %.2f seconds\n", ((double)clock())/CLOCKS_PER_SEC);
+}
diff --git a/Task/Arbitrary-precision-integers--included-/COBOL/arbitrary-precision-integers--included-.cobol b/Task/Arbitrary-precision-integers--included-/COBOL/arbitrary-precision-integers--included-.cobol
new file mode 100644
index 0000000000..a89dbd222b
--- /dev/null
+++ b/Task/Arbitrary-precision-integers--included-/COBOL/arbitrary-precision-integers--included-.cobol
@@ -0,0 +1,133 @@
+ identification division.
+ program-id. arbitrary-precision-integers.
+ remarks. Uses opaque libgmp internals that are built into libcob.
+
+ data division.
+ working-storage section.
+ 01 gmp-number.
+ 05 mp-alloc usage binary-long.
+ 05 mp-size usage binary-long.
+ 05 mp-limb usage pointer.
+ 01 gmp-build.
+ 05 mp-alloc usage binary-long.
+ 05 mp-size usage binary-long.
+ 05 mp-limb usage pointer.
+
+ 01 the-int usage binary-c-long unsigned.
+ 01 the-exponent usage binary-c-long unsigned.
+ 01 valid-exponent usage binary-long value 1.
+ 88 cant-use value 0 when set to false 1.
+
+ 01 number-string usage pointer.
+ 01 number-length usage binary-long.
+
+ 01 window-width constant as 20.
+ 01 limit-width usage binary-long.
+ 01 number-buffer pic x(window-width) based.
+
+ procedure division.
+ arbitrary-main.
+
+ *> calculate 10 ** 19
+ perform initialize-integers.
+ display "10 ** 19 : " with no advancing
+ move 10 to the-int
+ move 19 to the-exponent
+ perform raise-pow-accrete-exponent
+ perform show-all-or-portion
+ perform clean-up
+
+ *> calculate 12345 ** 9
+ perform initialize-integers.
+ display "12345 ** 9 : " with no advancing
+ move 12345 to the-int
+ move 9 to the-exponent
+ perform raise-pow-accrete-exponent
+ perform show-all-or-portion
+ perform clean-up
+
+ *> calculate 5 ** 4 ** 3 ** 2
+ perform initialize-integers.
+ display "5 ** 4 ** 3 ** 2: " with no advancing
+ move 3 to the-int
+ move 2 to the-exponent
+ perform raise-pow-accrete-exponent
+ move 4 to the-int
+ perform raise-pow-accrete-exponent
+ move 5 to the-int
+ perform raise-pow-accrete-exponent
+ perform show-all-or-portion
+ perform clean-up
+ goback.
+ *> **************************************************************
+
+ initialize-integers.
+ call "__gmpz_init" using gmp-number returning omitted
+ call "__gmpz_init" using gmp-build returning omitted
+ .
+
+ raise-pow-accrete-exponent.
+ *> check before using previously overflowed exponent intermediate
+ if cant-use then
+ display "Error: intermediate overflow occured at "
+ the-exponent upon syserr
+ goback
+ end-if
+ call "__gmpz_set_ui" using gmp-number by value 0
+ returning omitted
+ call "__gmpz_set_ui" using gmp-build by value the-int
+ returning omitted
+ call "__gmpz_pow_ui" using gmp-number gmp-build
+ by value the-exponent
+ returning omitted
+ call "__gmpz_set_ui" using gmp-build by value 0
+ returning omitted
+ call "__gmpz_get_ui" using gmp-number returning the-exponent
+ call "__gmpz_fits_ulong_p" using gmp-number
+ returning valid-exponent
+ .
+
+ *> get string representation, base 10
+ show-all-or-portion.
+ call "__gmpz_sizeinbase" using gmp-number
+ by value 10
+ returning number-length
+ display "GMP length: " number-length ", " with no advancing
+
+ call "__gmpz_get_str" using null by value 10
+ by reference gmp-number
+ returning number-string
+ call "strlen" using by value number-string
+ returning number-length
+ display "strlen: " number-length
+
+ *> slide based string across first and last of buffer
+ move window-width to limit-width
+ set address of number-buffer to number-string
+ if number-length <= window-width then
+ move number-length to limit-width
+ display number-buffer(1:limit-width)
+ else
+ display number-buffer with no advancing
+ subtract window-width from number-length
+ move function max(0, number-length) to number-length
+ if number-length <= window-width then
+ move number-length to limit-width
+ else
+ display "..." with no advancing
+ end-if
+ set address of number-buffer up by
+ function max(window-width, number-length)
+ display number-buffer(1:limit-width)
+ end-if
+ .
+
+ clean-up.
+ call "free" using by value number-string returning omitted
+ call "__gmpz_clear" using gmp-number returning omitted
+ call "__gmpz_clear" using gmp-build returning omitted
+ set address of number-buffer to null
+ set cant-use to false
+ .
+
+ end program arbitrary-precision-integers.
diff --git a/Task/Arbitrary-precision-integers--included-/Fortran/arbitrary-precision-integers--included-.f b/Task/Arbitrary-precision-integers--included-/Fortran/arbitrary-precision-integers--included-.f
new file mode 100644
index 0000000000..c9a8628d02
--- /dev/null
+++ b/Task/Arbitrary-precision-integers--included-/Fortran/arbitrary-precision-integers--included-.f
@@ -0,0 +1,12 @@
+program bignum
+ use fmzm
+ implicit none
+ type(im) :: a
+ integer :: n
+
+ call fm_set(50)
+ a = to_im(5)**(to_im(4)**(to_im(3)**to_im(2)))
+ n = to_int(floor(log10(to_fm(a))))
+ call im_print(a / to_im(10)**(n - 19))
+ call im_print(mod(a, to_im(10)**20))
+end program
diff --git a/Task/Arbitrary-precision-integers--included-/PowerShell/arbitrary-precision-integers--included-.psh b/Task/Arbitrary-precision-integers--included-/PowerShell/arbitrary-precision-integers--included-.psh
new file mode 100644
index 0000000000..5189b471ad
--- /dev/null
+++ b/Task/Arbitrary-precision-integers--included-/PowerShell/arbitrary-precision-integers--included-.psh
@@ -0,0 +1,9 @@
+# Perform calculation
+$BigNumber = [BigInt]::Pow( 5, [BigInt]::Pow( 4, [BigInt]::Pow( 3, 2 ) ) )
+
+# Display first and last 20 digits
+$BigNumberString = [string]$BigNumber
+$BigNumberString.Substring( 0, 20 ) + "..." + $BigNumberString.Substring( $BigNumberString.Length - 20, 20 )
+
+# Display number of digits
+$BigNumberString.Length
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
index 5b4292be67..3d15ed71be 100644
--- 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
@@ -1,14 +1,15 @@
-/*REXX program to calculate and demonstrate arbitrary precision numbers.*/
-numeric digits 200000
+/*REXX program calculates and demonstrates arbitrary precision numbers. */
+numeric digits 200000 /*two hundred thousand decimal digits. */
- n = 5 ** (4 ** (3 ** 2)) /*calc. multiple exponentations. */
+ n = 5 ** (4 ** (3 ** 2)) /*calculate multiple exponentiations. */
check = 62060698786608744707...92256259918212890625
-sampl = left(n, 20) || '...' || right(n, 20)
+sampl = left(n, 20) || ... || right(n, 20)
-say ' check:' check
-say 'sample:' sampl
+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.*/
+ /*stick a fork in it, we're all 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
index 658ada907e..c1694879b2 100644
--- 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
@@ -1,21 +1,22 @@
-/*REXX program to calculate and demonstrate arbitrary precision numbers.*/
-numeric digits 5 + 1 /*6 is needed (not 5) for ooRexx.*/
- n=5** (4** (3** 2)) /*calc. multiple exponentations. */
+/*REXX program calculates and demonstrates arbitrary precision numbers. */
+numeric digits 5 + 1 /*6 is needed (not 5) for ooRexx. */
-parse var n 'E' pow . /*POW might be null, so N is OK.*/
+ n=5** (4** (3** 2)) /*calculate multiple exponentiations. */
-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. */
+parse var n 'E' pow . /*POW might be null, so N is OK. */
+
+if pow\=='' then do /*general case: POW might be < zero.*/
+ numeric digits abs(pow)+9 /*recalculate with more digits.*/
+ n=5** (4** (3** 2)) /*calculate multiple exponentiations. */
end
check = 62060698786608744707...92256259918212890625
sampl = left(n, 20)'...'right(n, 20)
-say ' check:' check
-say 'sample:' sampl
-say 'digits:' length(n)
+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.*/
+ /*stick a fork in it, we're all done. */
diff --git a/Task/Arena-storage-pool/Fortran/arena-storage-pool.f b/Task/Arena-storage-pool/Fortran/arena-storage-pool.f
new file mode 100644
index 0000000000..7ed5d707cc
--- /dev/null
+++ b/Task/Arena-storage-pool/Fortran/arena-storage-pool.f
@@ -0,0 +1,13 @@
+ SUBROUTINE CHECK(A,N) !Inspect matrix A.
+ REAL A(:,:) !The matrix, whatever size it is.
+ INTEGER N !The order.
+ REAL B(N,N) !A scratchpad, size known on entry..
+ INTEGER, ALLOCATABLE::TROUBLE(:) !But for this, I'll decide later.
+ INTEGER M
+
+ M = COUNT(A(1:N,1:N).LE.0) !Some maximum number of troublemakers.
+
+ ALLOCATE (TROUBLE(1:M**3)) !Just enough.
+
+ DEALLOCATE(TROUBLE) !Not necessary.
+ END SUBROUTINE CHECK !As TROUBLE is declared within CHECK.
diff --git a/Task/Arena-storage-pool/Rust/arena-storage-pool.rust b/Task/Arena-storage-pool/Rust/arena-storage-pool.rust
new file mode 100644
index 0000000000..2b7ea32dc0
--- /dev/null
+++ b/Task/Arena-storage-pool/Rust/arena-storage-pool.rust
@@ -0,0 +1,27 @@
+#![feature(rustc_private)]
+
+extern crate arena;
+
+use arena::TypedArena;
+
+fn main() {
+ // Memory is allocated using the default allocator (currently jemalloc). The memory is
+ // allocated in chunks, and when one chunk is full another is allocated. This ensures that
+ // references to an arena don't become invalid when the original chunk runs out of space. The
+ // chunk size is configurable as an argument to TypedArena::with_capacity if necessary.
+ let arena = TypedArena::new();
+
+ // The arena crate contains two types of arenas: TypedArena and Arena. Arena is
+ // reflection-basd and slower, but can allocate objects of any type. TypedArena is faster, and
+ // can allocate only objects of one type. The type is determined by type inference--if you try
+ // to allocate an integer, then Rust's compiler knows it is an integer arena.
+ let v1 = arena.alloc(1i32);
+
+ // TypedArena returns a mutable reference
+ let v2 = arena.alloc(3);
+ *v2 += 38;
+ println!("{}", *v1 + *v2);
+
+ // The arena's destructor is called as it goes out of scope, at which point it deallocates
+ // everything stored within it at once.
+}
diff --git a/Task/Arithmetic-Complex/00DESCRIPTION b/Task/Arithmetic-Complex/00DESCRIPTION
index 619526418f..2ed1eaf1ab 100644
--- a/Task/Arithmetic-Complex/00DESCRIPTION
+++ b/Task/Arithmetic-Complex/00DESCRIPTION
@@ -1,7 +1,24 @@
-A '''[[wp:Complex number|complex number]]''' is a number which can be written as "" (sometimes shown as "") where a and b are real numbers and [[wp:Imaginary_unit| is the square root of -1]].
-Typically, complex numbers are represented as a pair of real numbers called the "imaginary part" and "real part", where the imaginary part is the number to be multiplied by .
+A '''[[wp:Complex number|complex number]]''' is a number which can be written as:
+
+(sometimes shown as:
+
+where and are real numbers, and [[wp:Imaginary_unit|]] is √{{overline| -1 }}
-* Show addition, multiplication, negation, and inversion of complex numbers in separate functions. (Subtraction and division operations can be made with pairs of these operations.) Print the results for each operation tested.
-* ''Optional:'' Show complex conjugation. By definition, the [[wp:complex conjugate|complex conjugate]] of is .
-Some languages have complex number libraries available. If your language does, show the operations. If your language does not, also show the definition of this type.
+Typically, complex numbers are represented as a pair of real numbers called the "imaginary part" and "real part", where the imaginary part is the number to be multiplied by .
+
+
+;Task:
+* Show addition, multiplication, negation, and inversion of complex numbers in separate functions. (Subtraction and division operations can be made with pairs of these operations.)
+* Print the results for each operation tested.
+* ''Optional:'' Show complex conjugation.
+
+
+By definition, the [[wp:complex conjugate|complex conjugate]] of
+
+is
+
+
+
+Some languages have complex number libraries available. If your language does, show the operations. If your language does not, also show the definition of this type.
+
diff --git a/Task/Arithmetic-Complex/Elixir/arithmetic-complex.elixir b/Task/Arithmetic-Complex/Elixir/arithmetic-complex.elixir
new file mode 100644
index 0000000000..1e31b881f6
--- /dev/null
+++ b/Task/Arithmetic-Complex/Elixir/arithmetic-complex.elixir
@@ -0,0 +1,85 @@
+defmodule Complex do
+ import Kernel, except: [abs: 1, div: 2]
+
+ defstruct real: 0, imag: 0
+
+ def new(real, imag) do
+ %__MODULE__{real: real, imag: imag}
+ end
+
+ def add(a, b) do
+ {a, b} = convert(a, b)
+ new(a.real + b.real, a.imag + b.imag)
+ end
+
+ def sub(a, b) do
+ {a, b} = convert(a, b)
+ new(a.real - b.real, a.imag - b.imag)
+ end
+
+ def mul(a, b) do
+ {a, b} = convert(a, b)
+ new(a.real*b.real - a.imag*b.imag, a.imag*b.real + a.real*b.imag)
+ end
+
+ def div(a, b) do
+ {a, b} = convert(a, b)
+ divisor = abs2(b)
+ new((a.real*b.real + a.imag*b.imag) / divisor,
+ (a.imag*b.real - a.real*b.imag) / divisor)
+ end
+
+ def neg(a) do
+ a = convert(a)
+ new(-a.real, -a.imag)
+ end
+
+ def inv(a) do
+ a = convert(a)
+ divisor = abs2(a)
+ new(a.real / divisor, -a.imag / divisor)
+ end
+
+ def conj(a) do
+ a = convert(a)
+ new(a.real, -a.imag)
+ end
+
+ def abs(a) do
+ :math.sqrt(abs2(a))
+ end
+
+ defp abs2(a) do
+ a = convert(a)
+ a.real*a.real + a.imag*a.imag
+ end
+
+ defp convert(a) when is_number(a), do: new(a, 0)
+ defp convert(%__MODULE__{} = a), do: a
+
+ defp convert(a, b), do: {convert(a), convert(b)}
+
+ def task do
+ a = new(1, 3)
+ b = new(5, 2)
+ IO.puts "a = #{a}"
+ IO.puts "b = #{b}"
+ IO.puts "add(a,b): #{add(a, b)}"
+ IO.puts "sub(a,b): #{sub(a, b)}"
+ IO.puts "mul(a,b): #{mul(a, b)}"
+ IO.puts "div(a,b): #{div(a, b)}"
+ IO.puts "div(b,a): #{div(b, a)}"
+ IO.puts "neg(a) : #{neg(a)}"
+ IO.puts "inv(a) : #{inv(a)}"
+ IO.puts "conj(a) : #{conj(a)}"
+ end
+end
+
+defimpl String.Chars, for: Complex do
+ def to_string(%Complex{real: real, imag: imag}) do
+ if imag >= 0, do: "#{real}+#{imag}j",
+ else: "#{real}#{imag}j"
+ end
+end
+
+Complex.task
diff --git a/Task/Arithmetic-Complex/J/arithmetic-complex.j b/Task/Arithmetic-Complex/J/arithmetic-complex.j
index 1e48b12c99..d485f20767 100644
--- a/Task/Arithmetic-Complex/J/arithmetic-complex.j
+++ b/Task/Arithmetic-Complex/J/arithmetic-complex.j
@@ -1,10 +1,12 @@
x=: 1j1
y=: 3.14159j1.2
- x+y
+ x+y NB. addition
4.14159j2.2
- x*y
+ x*y NB. multiplication
1.94159j4.34159
- %x
+ %x NB. inversion
0.5j_0.5
- -x
+ -x NB. negation
_1j_1
+ +x NB. (complex) conjugation
+1j_1
diff --git a/Task/Arithmetic-Complex/Java/arithmetic-complex.java b/Task/Arithmetic-Complex/Java/arithmetic-complex.java
index c2a2c925a6..a081e4fcfb 100644
--- a/Task/Arithmetic-Complex/Java/arithmetic-complex.java
+++ b/Task/Arithmetic-Complex/Java/arithmetic-complex.java
@@ -1,44 +1,52 @@
-public class Complex{
- public final double real;
- public final double imag;
+public class Complex {
+ public final double real;
+ public final double imag;
- public Complex(){this(0,0)}//default values to 0...force of habit
- public Complex(double r, double i){real = r; imag = i;}
+ public Complex() {
+ this(0, 0);
+ }
- public Complex add(Complex b){
- return new Complex(this.real + b.real, this.imag + b.imag);
- }
+ public Complex(double r, double i) {
+ real = r;
+ imag = i;
+ }
- public Complex mult(Complex b){
- //FOIL of (a+bi)(c+di) with i*i = -1
- return new Complex(this.real * b.real - this.imag * b.imag, this.real * b.imag + this.imag * b.real);
- }
+ public Complex add(Complex b) {
+ return new Complex(this.real + b.real, this.imag + b.imag);
+ }
- public Complex inv(){
- //1/(a+bi) * (a-bi)/(a-bi) = 1/(a+bi) but it's more workable
- double denom = real * real + imag * imag;
- return new Complex(real/denom,-imag/denom);
- }
+ public Complex mult(Complex b) {
+ // FOIL of (a+bi)(c+di) with i*i = -1
+ return new Complex(this.real * b.real - this.imag * b.imag,
+ this.real * b.imag + this.imag * b.real);
+ }
- public Complex neg(){
- return new Complex(-real, -imag);
- }
+ public Complex inv() {
+ // 1/(a+bi) * (a-bi)/(a-bi) = 1/(a+bi) but it's more workable
+ double denom = real * real + imag * imag;
+ return new Complex(real / denom, -imag / denom);
+ }
- public Complex conj(){
- return new Complex(real, -imag);
- }
+ public Complex neg() {
+ return new Complex(-real, -imag);
+ }
- public String toString(){ //override Object's toString
- return real + " + " + imag + " * i";
- }
+ public Complex conj() {
+ return new Complex(real, -imag);
+ }
- public static void main(String[] args){
- Complex a = new Complex(Math.PI, -5) //just some numbers
- Complex b = new Complex(-1, 2.5);
- System.out.println(a.neg());
- System.out.println(a.add(b));
- System.out.println(a.inv());
- System.out.println(a.mult(b));
- System.out.println(a.conj());
- }
+ @Override
+ public String toString() {
+ return real + " + " + imag + " * i";
+ }
+
+ public static void main(String[] args) {
+ Complex a = new Complex(Math.PI, -5); //just some numbers
+ Complex b = new Complex(-1, 2.5);
+ System.out.println(a.neg());
+ System.out.println(a.add(b));
+ System.out.println(a.inv());
+ System.out.println(a.mult(b));
+ System.out.println(a.conj());
+ }
}
diff --git a/Task/Arithmetic-Complex/PowerShell/arithmetic-complex-1.psh b/Task/Arithmetic-Complex/PowerShell/arithmetic-complex-1.psh
new file mode 100644
index 0000000000..eb0ebf6c53
--- /dev/null
+++ b/Task/Arithmetic-Complex/PowerShell/arithmetic-complex-1.psh
@@ -0,0 +1,39 @@
+class Complex {
+ [Double]$x
+ [Double]$y
+ Complex() {
+ $this.x = 0
+ $this.y = 0
+ }
+ Complex([Double]$x, [Double]$y) {
+ $this.x = $x
+ $this.y = $y
+ }
+ [Double]abs2() {return $this.x*$this.x + $this.y*$this.y}
+ [Double]abs() {return [math]::sqrt($this.abs2())}
+ static [Complex]add([Complex]$m,[Complex]$n) {return [Complex]::new($m.x+$n.x, $m.y+$n.y)}
+ static [Complex]mul([Complex]$m,[Complex]$n) {return [Complex]::new($m.x*$n.x - $m.y*$n.y, $m.x*$n.y + $n.x*$m.y)}
+ [Complex]mul([Double]$k) {return [Complex]::new($k*$this.x, $k*$this.y)}
+ [Complex]negate() {return $this.mul(-1)}
+ [Complex]conjugate() {return [Complex]::new($this.x, -$this.y)}
+ [Complex]inverse() {return $this.conjugate().mul(1/$this.abs2())}
+ [String]show() {
+ if(0 -ge $this.y) {
+ return "$($this.x)+$($this.y)i"
+ } else {
+ return "$($this.x)$($this.y)i"
+ }
+ }
+ static [String]show([Complex]$other) {
+ return $other.show()
+ }
+}
+$m = [complex]::new(3, 4)
+$n = [complex]::new(7, 6)
+"`$m: $($m.show())"
+"`$n: $($n.show())"
+"`$m + `$n: $([complex]::show([complex]::add($m,$n)))"
+"`$m * `$n: $([complex]::show([complex]::mul($m,$n)))"
+"negate `$m: $($m.negate().show())"
+"1/`$m: $([complex]::show($m.inverse()))"
+"conjugate `$m: $([complex]::show($m.conjugate()))"
diff --git a/Task/Arithmetic-Complex/PowerShell/arithmetic-complex-2.psh b/Task/Arithmetic-Complex/PowerShell/arithmetic-complex-2.psh
new file mode 100644
index 0000000000..99e19293c2
--- /dev/null
+++ b/Task/Arithmetic-Complex/PowerShell/arithmetic-complex-2.psh
@@ -0,0 +1,16 @@
+function show([System.Numerics.Complex]$c) {
+ if(0 -ge $c.Imginary) {
+ return "$($c.Real)+$($c.Imaginary)i"
+ } else {
+ return "$($c.Real)$($c.Imaginary)i"
+ }
+ }
+$m = [System.Numerics.Complex]::new(3, 4)
+$n = [System.Numerics.Complex]::new(7, 6)
+"`$m: $(show $m)"
+"`$n: $(show $n)"
+"`$m + `$n: $(show ([System.Numerics.Complex]::Add($m,$n)))"
+"`$m * `$n: $(show ([System.Numerics.Complex]::Multiply($m,$n)))"
+"negate `$m: $(show ([System.Numerics.Complex]::Negate($m)))"
+"1/`$m: $(show ([System.Numerics.Complex]::Reciprocal($m)))"
+"conjugate `$m: $(show ([System.Numerics.Complex]::Conjugate($m)))"
diff --git a/Task/Arithmetic-Complex/REXX/arithmetic-complex.rexx b/Task/Arithmetic-Complex/REXX/arithmetic-complex.rexx
index 067037b1a5..e58b2f326c 100644
--- a/Task/Arithmetic-Complex/REXX/arithmetic-complex.rexx
+++ b/Task/Arithmetic-Complex/REXX/arithmetic-complex.rexx
@@ -1,23 +1,23 @@
-/*REXX pgm demonstrates how to support some math functions for complex numbers*/
-x = '(5,3i)' /*define X ─── can use I i J or j */
-y = "( .5, 6j)" /*define Y " " " " " " " */
+/*REXX program demonstrates how to support some math functions for complex numbers. */
+x = '(5,3i)' /*define X ─── can use I i J or j */
+y = "( .5, 6j)" /*define Y " " " " " " " */
-say ' addition: ' x " + " y ' = ' Cadd(x,y)
-say ' subtraction: ' x " - " y ' = ' Csub(x,y)
-say 'multiplication: ' x " * " y ' = ' Cmul(x,y)
-say ' division: ' x " ÷ " y ' = ' Cdiv(x,y)
-say ' inverse: ' x " = " Cinv(x,y)
-say ' conjugate of: ' x " = " Conj(x,y)
-say ' negation of: ' x " = " Cneg(x,y)
-exit /*stick a fork in it, we're all done. */
-/*──────────────────────────────────one─liner subroutines─────────────────────*/
-Conj: procedure; arg a ',' b,c ',' d; call C#; return C$( a, -b)
-Cadd: procedure; arg a ',' b,c ',' d; call C#; return C$(a+c, b+d)
-Csub: procedure; arg a ',' b,c ',' d; call C#; return C$(a-c, b-d)
-Cmul: procedure; arg a ',' b,c ',' d; call C#; return C$(ac-bd, bc+ad)
-Cdiv: procedure; arg a ',' b,c ',' d; call C#; return C$((ac+bd)/s, (bc-ad)/s)
+say ' addition: ' x " + " y ' = ' Cadd(x, y)
+say ' subtraction: ' x " - " y ' = ' Csub(x, y)
+say 'multiplication: ' x " * " y ' = ' Cmul(x, y)
+say ' division: ' x " ÷ " y ' = ' Cdiv(x, y)
+say ' inverse: ' x " = " Cinv(x, y)
+say ' conjugate of: ' x " = " Conj(x, y)
+say ' negation of: ' x " = " Cneg(x, y)
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+Conj: procedure; parse arg a ',' b,c ',' d; call C#; return C$( a , -b )
+Cadd: procedure; parse arg a ',' b,c ',' d; call C#; return C$( a+c , b+d )
+Csub: procedure; parse arg a ',' b,c ',' d; call C#; return C$( a-c , b-d )
+Cmul: procedure; parse arg a ',' b,c ',' d; call C#; return C$( ac-bd , bc+ad)
+Cdiv: procedure; parse arg a ',' b,c ',' d; call C#; return C$((ac+bd)/s, (bc-ad)/s)
Cinv: return Cdiv(1, arg(1))
Cneg: return Cmul(arg(1), -1)
-C_: arg __; return word(translate(__, , '{[(JI)]}') 0, 1) /*get # or 0*/
-C#: a=C_(a);b=C_(b);c=C_(c);d=C_(d);ac=a*c;ad=a*d;bc=b*c;bd=b*d;s=c*c+d*d;return
-C$: parse arg r,c;_='['r; if c\=0 then _=_','c"j"; return _']' /*uses j*/
+C_: return word(translate(arg(1), , '{[(JjIi)]}') 0, 1) /*get # or 0*/
+C#: a=C_(a); b=C_(b); c=C_(c); d=C_(d); ac=a*c; ad=a*d; bc=b*c; bd=b*d;s=c*c+d*d; return
+C$: parse arg r,c; _='['r; if c\=0 then _=_","c'j'; return _"]" /*uses j */
diff --git a/Task/Arithmetic-Complex/ZX-Spectrum-Basic/arithmetic-complex.zx b/Task/Arithmetic-Complex/ZX-Spectrum-Basic/arithmetic-complex.zx
new file mode 100644
index 0000000000..fb8f638ed7
--- /dev/null
+++ b/Task/Arithmetic-Complex/ZX-Spectrum-Basic/arithmetic-complex.zx
@@ -0,0 +1,23 @@
+5 LET complex=2: LET r=1: LET i=2
+10 DIM a(complex): LET a(r)=1.0: LET a(i)=1.0
+20 DIM b(complex): LET b(r)=PI: LET b(i)=1.2
+30 DIM o(complex)
+40 REM add
+50 LET o(r)=a(r)+b(r)
+60 LET o(i)=a(i)+b(i)
+70 PRINT "Result of addition is:": GO SUB 1000
+80 REM mult
+90 LET o(r)=a(r)*b(r)-a(i)*b(i)
+100 LET o(i)=a(i)*b(r)+a(r)*b(i)
+110 PRINT "Result of multiplication is:": GO SUB 1000
+120 REM neg
+130 LET o(r)=-a(r)
+140 LET o(i)=-a(i)
+150 PRINT "Result of negation is:": GO SUB 1000
+160 LET denom=a(r)^2+a(i)^2
+170 LET o(r)=a(r)/denom
+180 LET o(i)=-a(i)/denom
+190 PRINT "Result of inversion is:": GO SUB 1000
+200 STOP
+1000 IF o(i)>=0 THEN PRINT o(r);" + ";o(i);"i": RETURN
+1010 PRINT o(r);" - ";-o(i);"i": RETURN
diff --git a/Task/Arithmetic-Integer/00DESCRIPTION b/Task/Arithmetic-Integer/00DESCRIPTION
index 0d641d39be..1aad7ae43a 100644
--- a/Task/Arithmetic-Integer/00DESCRIPTION
+++ b/Task/Arithmetic-Integer/00DESCRIPTION
@@ -1,7 +1,18 @@
{{basic data operation}} [[Category:Simple]]
-Get two integers from the user, and then output the sum, difference, product, integer quotient and remainder of those numbers.
-Don't include error handling.
-For quotient, indicate how it rounds (e.g. towards 0, towards negative infinity, etc.).
-For remainder, indicate whether its sign matches the sign of the first operand or of the second operand, if they are different.
-Also include the exponentiation operator if one exists.
+;Task:
+Get two integers from the user, and then (for those two integers), display their:
+::::* sum
+::::* difference
+::::* product
+::::* integer quotient
+::::* remainder
+::::* exponentiation (if the operator exists)
+
+
+Don't include error handling.
+
+For quotient, indicate how it rounds (e.g. towards zero, towards negative infinity, etc.).
+
+For remainder, indicate whether its sign matches the sign of the first operand or of the second operand, if they are different.
+
diff --git a/Task/Arithmetic-Integer/Go/arithmetic-integer.go b/Task/Arithmetic-Integer/Go/arithmetic-integer-1.go
similarity index 100%
rename from Task/Arithmetic-Integer/Go/arithmetic-integer.go
rename to Task/Arithmetic-Integer/Go/arithmetic-integer-1.go
diff --git a/Task/Arithmetic-Integer/Go/arithmetic-integer-2.go b/Task/Arithmetic-Integer/Go/arithmetic-integer-2.go
new file mode 100644
index 0000000000..5e6e39d8d2
--- /dev/null
+++ b/Task/Arithmetic-Integer/Go/arithmetic-integer-2.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "fmt"
+ "math/big"
+)
+
+func main() {
+ var a, b, c big.Int
+ fmt.Print("enter two integers: ")
+ fmt.Scan(&a, &b)
+ fmt.Printf("%d + %d = %d\n", &a, &b, c.Add(&a, &b))
+ fmt.Printf("%d - %d = %d\n", &a, &b, c.Sub(&a, &b))
+ fmt.Printf("%d * %d = %d\n", &a, &b, c.Mul(&a, &b))
+
+ // Quo, Rem functions work like Go operators on int:
+ // quo truncates toward 0,
+ // and a non-zero rem has the same sign as the first operand.
+ fmt.Printf("%d quo %d = %d\n", &a, &b, c.Quo(&a, &b))
+ fmt.Printf("%d rem %d = %d\n", &a, &b, c.Rem(&a, &b))
+
+ // Div, Mod functions do Euclidean division:
+ // the result m = a mod b is always non-negative,
+ // and for d = a div b, the results d and m give d*y + m = x.
+ fmt.Printf("%d div %d = %d\n", &a, &b, c.Div(&a, &b))
+ fmt.Printf("%d mod %d = %d\n", &a, &b, c.Mod(&a, &b))
+
+ // as with int, no exponentiation operator
+}
diff --git a/Task/Arithmetic-Integer/Onyx/arithmetic-integer.onyx b/Task/Arithmetic-Integer/Onyx/arithmetic-integer.onyx
new file mode 100644
index 0000000000..6fa3b926f9
--- /dev/null
+++ b/Task/Arithmetic-Integer/Onyx/arithmetic-integer.onyx
@@ -0,0 +1,43 @@
+# Most of this long script is mere presentation.
+# All you really need to do is push two integers onto the stack
+# and then execute add, sub, mul, idiv, or pow.
+
+$ClearScreen { # Using ANSI terminal control
+ `\e[2J\e[1;1H' print flush
+} bind def
+
+$Say { # string Say -
+ `\n' cat print flush
+} bind def
+
+$ShowPreamble {
+`To show how integer arithmetic in done in Onyx,' Say
+`we\'ll use two numbers of your choice, which' Say
+`we\'ll call A and B.\n' Say
+} bind def
+
+$Prompt { # stack: string --
+ stdout exch write pop flush
+} def
+
+$GetInt { # stack: name -- integer
+ dup cvs `Enter integer ' exch cat `: ' cat
+ Prompt stdin readline pop cvx eval def
+} bind def
+
+$Template { # arithmetic_operator_name label_string Template result_string
+ A cvs ` ' B cvs ` ' 5 ncat over cvs ` gives ' 3 ncat exch
+ A B dn cvx eval cvs `.' 3 ncat Say
+} bind def
+
+$ShowResults {
+ $add `Addition: ' Template
+ $sub `Subtraction: ' Template
+ $mul `Multiplication: ' Template
+ $idiv `Division: ' Template
+ `Note that the result of integer division is rounded toward zero.' Say
+ $pow `Exponentiation: ' Template
+ `Note that the result of raising to a negative power always gives a real number.' Say
+} bind def
+
+ClearScreen ShowPreamble $A GetInt $B GetInt ShowResults
diff --git a/Task/Arithmetic-Integer/PHP/arithmetic-integer.php b/Task/Arithmetic-Integer/PHP/arithmetic-integer.php
index fbf4bb2185..a17e74c59c 100644
--- a/Task/Arithmetic-Integer/PHP/arithmetic-integer.php
+++ b/Task/Arithmetic-Integer/PHP/arithmetic-integer.php
@@ -8,5 +8,6 @@ echo
"product: ", $a * $b, "\n",
"truncating quotient: ", (int)($a / $b), "\n",
"flooring quotient: ", floor($a / $b), "\n",
- "remainder: ", $a % $b, "\n";
+ "remainder: ", $a % $b, "\n",
+ "power: ", $a ** $b, "\n"; // PHP 5.6+ only
?>
diff --git a/Task/Arithmetic-Integer/REXX/arithmetic-integer.rexx b/Task/Arithmetic-Integer/REXX/arithmetic-integer.rexx
index 452bcd96a1..bdf1dda673 100644
--- a/Task/Arithmetic-Integer/REXX/arithmetic-integer.rexx
+++ b/Task/Arithmetic-Integer/REXX/arithmetic-integer.rexx
@@ -1,13 +1,13 @@
-/*REXX pgm gets 2 integers from the C,L. or via prompt; shows some operations.*/
-numeric digits 20 /*#s are round at 20th significant dig.*/
-parse arg x y . /*maybe the integers are on the C.L. */
+/*REXX program obtains two integers from the C.L. (a prompt); displays some operations.*/
+numeric digits 20 /*#s are round at 20th significant dig.*/
+parse arg x y . /*maybe the integers are on the C.L. */
- do while \datatype(x,'W') | \datatype(y,'W') /*both X and Y must be ints.*/
+ do while \datatype(x,'W') | \datatype(y,'W') /*both X and Y must be integers. */
say "─────Enter two integer values (separated by blanks):"
- parse pull x y . /*accept two items from command line. */
- end /*while ··· */
- /* [↓] perform this DO loop twice. */
- do j=1 for 2 /*show A oper B, then B oper A.*/
+ parse pull x y . /*accept two thingys from command line.*/
+ end /*while*/
+ /* [↓] perform this DO loop twice. */
+ do j=1 for 2 /*show A oper B, then B oper A.*/
call show 'addition' , "+", x+y
call show 'subtraction' , "-", x-y
call show 'multiplication' , "*", x*y
@@ -16,9 +16,9 @@ parse arg x y . /*maybe the integers are on the C.L. */
call show 'division remainder', "//", x//y, ' [sign from 1st operand]'
call show 'power' , "**", x**y
- parse value x y with y x /*swap the two values and perform again*/
- if j==1 then say copies('═', 79) /*display a fence after the 1st round. */
+ parse value x y with y x /*swap the two values and perform again*/
+ if j==1 then say copies('═', 79) /*display a fence after the 1st round. */
end /*j*/
-exit /*stick a fork in it, we're all done. */
-/*────────────────────────────────────────────────────────────────────────────*/
-show: parse arg c,o,#,?; say right(c,25)' ' x center(o,4) y ' ───► ' # ?; return
+exit /*stick a fork in it, we're all done. */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+show: parse arg c,o,#,?; say right(c,25)' ' x center(o,4) y " ───► " # ?; return
diff --git a/Task/Arithmetic-Integer/Racket/arithmetic-integer.rkt b/Task/Arithmetic-Integer/Racket/arithmetic-integer.rkt
index 02c4003d95..b4e1a433c1 100644
--- a/Task/Arithmetic-Integer/Racket/arithmetic-integer.rkt
+++ b/Task/Arithmetic-Integer/Racket/arithmetic-integer.rkt
@@ -1,7 +1,7 @@
-#lang racket
+#lang racket/base
+
(define (arithmetic x y)
- (for ([op '(+ - * / quotient remainder modulo max min gcd lcm)])
- (displayln (~a (list op x y) " => "
- ((eval op (make-base-namespace)) x y)))))
+ (for ([op (list + - * / quotient remainder modulo max min gcd lcm)])
+ (printf "~s => ~s\n" `(,(object-name op) ,x ,y) (op x y))))
(arithmetic 8 12)
diff --git a/Task/Arithmetic-Integer/ZX-Spectrum-Basic/arithmetic-integer.zx b/Task/Arithmetic-Integer/ZX-Spectrum-Basic/arithmetic-integer.zx
new file mode 100644
index 0000000000..fe3cd39580
--- /dev/null
+++ b/Task/Arithmetic-Integer/ZX-Spectrum-Basic/arithmetic-integer.zx
@@ -0,0 +1,7 @@
+5 LET a=5: LET b=3
+10 PRINT a;" + ";b;" = ";a+b
+20 PRINT a;" - ";b;" = ";a-b
+30 PRINT a;" * ";b;" = ";a*b
+40 PRINT a;" / ";b;" = ";INT (a/b)
+50 PRINT a;" mod ";b;" = ";a-INT (a/b)*b
+60 PRINT a;" to the power of ";b;" = ";a^b
diff --git a/Task/Arithmetic-Rational/00DESCRIPTION b/Task/Arithmetic-Rational/00DESCRIPTION
index 8937bfbe2e..10bafe19c4 100644
--- a/Task/Arithmetic-Rational/00DESCRIPTION
+++ b/Task/Arithmetic-Rational/00DESCRIPTION
@@ -1,6 +1,8 @@
-The objective of this task is to create a reasonably complete implementation of rational arithmetic in the particular language using the idioms of the language.
+;Task:
+Create a reasonably complete implementation of rational arithmetic in the particular language using the idioms of the language.
-For example:
+
+;Example:
Define a new type called '''frac''' with binary operator "//" of two integers that returns a '''structure''' made up of the numerator and the denominator (as per a rational number).
Further define the appropriate rational unary '''operators''' '''abs''' and '-', with the binary '''operators''' for addition '+', subtraction '-', multiplication '×', division '/', integer division '÷', modulo division, the comparison operators (e.g. '<', '≤', '>', & '≥') and equality operators (e.g. '=' & '≠').
@@ -12,5 +14,7 @@ If space allows, define standard increment and decrement '''operators''' (e.g. '
Finally test the operators:
Use the new type '''frac''' to find all [[Perfect Numbers|perfect numbers]] less than 219 by summing the reciprocal of the factors.
-'''See also'''
-* [[Perfect Numbers]]
+
+;Related task:
+* [[Perfect Numbers]]
+
diff --git a/Task/Arithmetic-Rational/Elixir/arithmetic-rational.elixir b/Task/Arithmetic-Rational/Elixir/arithmetic-rational.elixir
new file mode 100644
index 0000000000..f555975001
--- /dev/null
+++ b/Task/Arithmetic-Rational/Elixir/arithmetic-rational.elixir
@@ -0,0 +1,66 @@
+defmodule Rational do
+ import Kernel, except: [div: 2]
+
+ defstruct numerator: 0, denominator: 1
+
+ def new(numerator), do: %Rational{numerator: numerator, denominator: 1}
+
+ def new(numerator, denominator) do
+ sign = if numerator * denominator < 0, do: -1, else: 1
+ {numerator, denominator} = {abs(numerator), abs(denominator)}
+ gcd = gcd(numerator, denominator)
+ %Rational{numerator: sign * Kernel.div(numerator, gcd),
+ denominator: Kernel.div(denominator, gcd)}
+ end
+
+ def add(a, b) do
+ {a, b} = convert(a, b)
+ new(a.numerator * b.denominator + b.numerator * a.denominator,
+ a.denominator * b.denominator)
+ end
+
+ def sub(a, b) do
+ {a, b} = convert(a, b)
+ new(a.numerator * b.denominator - b.numerator * a.denominator,
+ a.denominator * b.denominator)
+ end
+
+ def mult(a, b) do
+ {a, b} = convert(a, b)
+ new(a.numerator * b.numerator, a.denominator * b.denominator)
+ end
+
+ def div(a, b) do
+ {a, b} = convert(a, b)
+ new(a.numerator * b.denominator, a.denominator * b.numerator)
+ end
+
+ defp convert(a), do: if is_integer(a), do: new(a), else: a
+
+ defp convert(a, b), do: {convert(a), convert(b)}
+
+ defp gcd(a, 0), do: a
+ defp gcd(a, b), do: gcd(b, rem(a, b))
+end
+
+defimpl Inspect, for: Rational do
+ def inspect(r, _opts) do
+ "%Rational<#{r.numerator}/#{r.denominator}>"
+ end
+end
+
+Enum.each(2..trunc(:math.pow(2,19)), fn candidate ->
+ sum = 2 .. round(:math.sqrt(candidate))
+ |> Enum.reduce(Rational.new(1, candidate), fn factor,sum ->
+ if rem(candidate, factor) == 0 do
+ Rational.add(sum, Rational.new(1, factor))
+ |> Rational.add(Rational.new(1, div(candidate, factor)))
+ else
+ sum
+ end
+ end)
+ if sum.denominator == 1 do
+ :io.format "Sum of recipr. factors of ~6w = ~w exactly ~s~n",
+ [candidate, sum.numerator, (if sum.numerator == 1, do: "perfect!", else: "")]
+ end
+end)
diff --git a/Task/Arithmetic-Rational/Frink/arithmetic-rational.frink b/Task/Arithmetic-Rational/Frink/arithmetic-rational.frink
new file mode 100644
index 0000000000..2545030b76
--- /dev/null
+++ b/Task/Arithmetic-Rational/Frink/arithmetic-rational.frink
@@ -0,0 +1,11 @@
+1/2 + 2/3
+// 7/6 (approx. 1.1666666666666667)
+
+1/2 + 1/2
+// 1
+
+5/sextillion + 3/quadrillion
+// 600001/200000000000000000000 (exactly 3.000005e-15)
+
+8^(1/3)
+// 2 (note the exact integer result.)
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-1.j b/Task/Arithmetic-Rational/J/arithmetic-rational-1.j
index 43410ffad4..662e7db50b 100644
--- a/Task/Arithmetic-Rational/J/arithmetic-rational-1.j
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-1.j
@@ -1,2 +1,4 @@
- 3r4*2r5
-3r10
+ (x: 3) % (x: -4)
+_3r4
+ 3 %&x: -4
+_3r4
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-10.j b/Task/Arithmetic-Rational/J/arithmetic-rational-10.j
new file mode 100644
index 0000000000..4a3f32d884
--- /dev/null
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-10.j
@@ -0,0 +1,2 @@
+ (#~ is_perfect_rational"0) (* <:@+:) 2^i.10x
+6 28 496 8128
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-2.j b/Task/Arithmetic-Rational/J/arithmetic-rational-2.j
index 69202bf44d..f7e3d1d74d 100644
--- a/Task/Arithmetic-Rational/J/arithmetic-rational-2.j
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-2.j
@@ -1 +1,28 @@
- is_perfect_rational=: 2 = (1 + i.) +/@:%@([ #~ 0 = |) ]
+ | _3r4 NB. absolute value
+3r4
+ -2r5 NB. negation
+_2r5
+ 3r4+2r5 NB. addition
+23r20
+ 3r4-2r5 NB. subtraction
+7r20
+ 3r4*2r5 NB. multiplication
+3r10
+ 3r4%2r5 NB. division
+15r8
+ 3r4 <.@% 2r5 NB. integer division
+1
+ 3r4 (-~ <.)@% 2r5 NB. remainder
+_7r8
+ 3r4 < 2r5 NB. less than
+0
+ 3r4 <: 2r5 NB. less than or equal
+0
+ 3r4 > 2r5 NB. greater than
+1
+ 3r4 >: 2r5 NB. greater than or equal
+1
+ 3r4 = 2r5 NB. equal
+0
+ 3r4 ~: 2r5 NB. not equal
+1
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-3.j b/Task/Arithmetic-Rational/J/arithmetic-rational-3.j
index 3e4a5cd64e..f0b52bf2fc 100644
--- a/Task/Arithmetic-Rational/J/arithmetic-rational-3.j
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-3.j
@@ -1,2 +1,4 @@
-factors=: */&>@{@((^ i.@>:)&.>/)@q:~&__
-is_perfect_rational=: 2= +/@:%@,@factors
+ x: 3%4
+3r4
+ x:inv 3%4
+0.75
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-4.j b/Task/Arithmetic-Rational/J/arithmetic-rational-4.j
index 22a9cdb013..4c7adf99ea 100644
--- a/Task/Arithmetic-Rational/J/arithmetic-rational-4.j
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-4.j
@@ -1,4 +1,4 @@
- I.is_perfect_rational@"0 i.2^19
-6 28 496 8128
- I.is_perfect_rational@x:@"0 i.2^19x
-6 28 496 8128
+ >: 3r4
+7r4
+ <: 3r4
+_1r4
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-5.j b/Task/Arithmetic-Rational/J/arithmetic-rational-5.j
index 4a3f32d884..24bc4d5ff4 100644
--- a/Task/Arithmetic-Rational/J/arithmetic-rational-5.j
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-5.j
@@ -1,2 +1,7 @@
- (#~ is_perfect_rational"0) (* <:@+:) 2^i.10x
-6 28 496 8128
+mutadd=:adverb define
+ (m)=: (".m)+y
+)
+
+mutsub=:adverb define
+ (m)=: (".m)-y
+)
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-6.j b/Task/Arithmetic-Rational/J/arithmetic-rational-6.j
new file mode 100644
index 0000000000..601c47fa5b
--- /dev/null
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-6.j
@@ -0,0 +1,7 @@
+ n=: 3r4
+ 'n' mutadd 1
+7r4
+ 'n' mutsub 1
+3r4
+ 'n' mutsub 1
+_1r4
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-7.j b/Task/Arithmetic-Rational/J/arithmetic-rational-7.j
new file mode 100644
index 0000000000..69202bf44d
--- /dev/null
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-7.j
@@ -0,0 +1 @@
+ is_perfect_rational=: 2 = (1 + i.) +/@:%@([ #~ 0 = |) ]
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-8.j b/Task/Arithmetic-Rational/J/arithmetic-rational-8.j
new file mode 100644
index 0000000000..3e4a5cd64e
--- /dev/null
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-8.j
@@ -0,0 +1,2 @@
+factors=: */&>@{@((^ i.@>:)&.>/)@q:~&__
+is_perfect_rational=: 2= +/@:%@,@factors
diff --git a/Task/Arithmetic-Rational/J/arithmetic-rational-9.j b/Task/Arithmetic-Rational/J/arithmetic-rational-9.j
new file mode 100644
index 0000000000..22a9cdb013
--- /dev/null
+++ b/Task/Arithmetic-Rational/J/arithmetic-rational-9.j
@@ -0,0 +1,4 @@
+ I.is_perfect_rational@"0 i.2^19
+6 28 496 8128
+ I.is_perfect_rational@x:@"0 i.2^19x
+6 28 496 8128
diff --git a/Task/Arithmetic-Rational/OCaml/arithmetic-rational-3.ocaml b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-3.ocaml
new file mode 100644
index 0000000000..efd7a34891
--- /dev/null
+++ b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-3.ocaml
@@ -0,0 +1,21 @@
+(* interface *)
+module type RATIO =
+ sig
+ type t
+ (* construct *)
+ val frac : int -> int -> t
+ val from_int : int -> t
+
+ (* integer test *)
+ val is_int : t -> bool
+
+ (* output *)
+ val to_string : t -> string
+
+ (* arithmetic *)
+ val cmp : t -> t -> int
+ val ( +/ ) : t -> t -> t
+ val ( -/ ) : t -> t -> t
+ val ( */ ) : t -> t -> t
+ val ( // ) : t -> t -> t
+ end
diff --git a/Task/Arithmetic-Rational/OCaml/arithmetic-rational-4.ocaml b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-4.ocaml
new file mode 100644
index 0000000000..2e4d612d5c
--- /dev/null
+++ b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-4.ocaml
@@ -0,0 +1,58 @@
+(* implementation conforming to signature *)
+module Frac : RATIO =
+ struct
+ open Big_int
+
+ type t = { num : big_int; den : big_int }
+
+ (* short aliases for big_int values and functions *)
+ let zero, one = zero_big_int, unit_big_int
+ let big, to_int, eq = big_int_of_int, int_of_big_int, eq_big_int
+ let (+~), (-~), ( *~) = add_big_int, sub_big_int, mult_big_int
+
+ (* helper function *)
+ let rec norm ({num=n;den=d} as k) =
+ if lt_big_int d zero then
+ norm {num=minus_big_int n;den=minus_big_int d}
+ else
+ let rec hcf a b =
+ let q,r = quomod_big_int a b in
+ if eq r zero then b else hcf b r in
+ let f = hcf n d in
+ if eq f one then k else
+ let div = div_big_int in
+ { num=div n f; den = div d f } (* inefficient *)
+
+ (* public functions *)
+ let frac a b = norm { num=big a; den=big b }
+
+ let from_int a = norm { num=big a; den=one }
+
+ let is_int {num=n; den=d} =
+ eq d one ||
+ eq (mod_big_int n d) zero
+
+ let to_string ({num=n; den=d} as r) =
+ let r1 = norm r in
+ let str = string_of_big_int in
+ if is_int r1 then
+ str (r1.num)
+ else
+ str (r1.num) ^ "/" ^ str (r1.den)
+
+ let cmp a b =
+ let a1 = norm a and b1 = norm b in
+ compare_big_int (a1.num*~b1.den) (b1.num*~a1.den)
+
+ let ( */ ) {num=n1; den=d1} {num=n2; den=d2} =
+ norm { num = n1*~n2; den = d1*~d2 }
+
+ let ( // ) {num=n1; den=d1} {num=n2; den=d2} =
+ norm { num = n1*~d2; den = d1*~n2 }
+
+ let ( +/ ) {num=n1; den=d1} {num=n2; den=d2} =
+ norm { num = n1*~d2 +~ n2*~d1; den = d1*~d2 }
+
+ let ( -/ ) {num=n1; den=d1} {num=n2; den=d2} =
+ norm { num = n1*~d2 -~ n2*~d1; den = d1*~d2 }
+ end
diff --git a/Task/Arithmetic-Rational/OCaml/arithmetic-rational-5.ocaml b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-5.ocaml
new file mode 100644
index 0000000000..221602c1e4
--- /dev/null
+++ b/Task/Arithmetic-Rational/OCaml/arithmetic-rational-5.ocaml
@@ -0,0 +1,14 @@
+(* use the module to calculate perfect numbers *)
+let () =
+ for i = 2 to 1 lsl 19 do
+ let sum = ref (Frac.frac 1 i) in
+ for factor = 2 to truncate (sqrt (float i)) do
+ if i mod factor = 0 then
+ Frac.(
+ sum := !sum +/ frac 1 factor +/ frac 1 (i / factor)
+ )
+ done;
+ if Frac.is_int !sum then
+ Printf.printf "Sum of reciprocal factors of %d = %s exactly %s\n%!"
+ i (Frac.to_string !sum) (if Frac.to_string !sum = "1" then "perfect!" else "")
+ done
diff --git a/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-1.pl6 b/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-1.pl6
index de7b6ee512..45d5716c5b 100644
--- a/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-1.pl6
+++ b/Task/Arithmetic-Rational/Perl-6/arithmetic-rational-1.pl6
@@ -5,7 +5,7 @@ for 2..2**19 -> $candidate {
$sum += 1 / $factor + 1 / ($candidate / $factor);
}
}
- if $sum.denominator == 1 {
+ if $sum.nude[1] == 1 {
say "Sum of reciprocal factors of $candidate = $sum exactly", ($sum == 1 ?? ", perfect!" !! ".");
}
}
diff --git a/Task/Arithmetic-Rational/Rust/arithmetic-rational.rust b/Task/Arithmetic-Rational/Rust/arithmetic-rational.rust
new file mode 100644
index 0000000000..9a19f51aa4
--- /dev/null
+++ b/Task/Arithmetic-Rational/Rust/arithmetic-rational.rust
@@ -0,0 +1,133 @@
+use std::cmp::Ordering;
+use std::ops::{Add, AddAssign, Sub, SubAssign, Mul, MulAssign, Div, DivAssign, Neg};
+
+fn gcd(a: i64, b: i64) -> i64 {
+ match b {
+ 0 => a,
+ _ => gcd(b, a % b),
+ }
+}
+
+fn lcm(a: i64, b: i64) -> i64 {
+ a / gcd(a, b) * b
+}
+
+#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord)]
+pub struct Rational {
+ numerator: i64,
+ denominator: i64,
+}
+
+impl Rational {
+ fn new(numerator: i64, denominator: i64) -> Self {
+ let divisor = gcd(numerator, denominator);
+ Rational {
+ numerator: numerator / divisor,
+ denominator: denominator / divisor,
+ }
+ }
+}
+
+impl Add for Rational {
+ type Output = Self;
+
+ fn add(self, other: Self) -> Self {
+ let multiplier = lcm(self.denominator, other.denominator);
+ Rational::new(self.numerator * multiplier / self.denominator +
+ other.numerator * multiplier / other.denominator,
+ multiplier)
+ }
+}
+
+impl AddAssign for Rational {
+ fn add_assign(&mut self, other: Self) {
+ *self = *self + other;
+ }
+}
+
+impl Sub for Rational {
+ type Output = Self;
+
+ fn sub(self, other: Self) -> Self {
+ self + -other
+ }
+}
+
+impl SubAssign for Rational {
+ fn sub_assign(&mut self, other: Self) {
+ *self = *self - other;
+ }
+}
+
+impl Mul for Rational {
+ type Output = Self;
+
+ fn mul(self, other: Self) -> Self {
+ Rational::new(self.numerator * other.numerator,
+ self.denominator * other.denominator)
+ }
+}
+
+impl MulAssign for Rational {
+ fn mul_assign(&mut self, other: Self) {
+ *self = *self * other;
+ }
+}
+
+impl Div for Rational {
+ type Output = Self;
+
+ fn div(self, other: Self) -> Self {
+ self *
+ Rational {
+ numerator: other.denominator,
+ denominator: other.numerator,
+ }
+ }
+}
+
+impl DivAssign for Rational {
+ fn div_assign(&mut self, other: Self) {
+ *self = *self / other;
+ }
+}
+
+impl Neg for Rational {
+ type Output = Self;
+
+ fn neg(self) -> Self {
+ Rational {
+ numerator: -self.numerator,
+ denominator: self.denominator,
+ }
+ }
+}
+
+impl PartialOrd for Rational {
+ fn partial_cmp(&self, other: &Self) -> Option {
+ (self.numerator * other.denominator).partial_cmp(&(self.denominator * other.numerator))
+ }
+}
+
+impl> From for Rational {
+ fn from(value: T) -> Self {
+ Rational::new(value.into(), 1)
+ }
+}
+
+fn main() {
+ let max = 1 << 19;
+ for candidate in 2..max {
+ let mut sum = Rational::new(1, candidate);
+ for factor in 2..(candidate as f64).sqrt().ceil() as i64 {
+ if candidate % factor == 0 {
+ sum += Rational::new(1, factor);
+ sum += Rational::new(1, candidate / factor);
+ }
+ }
+
+ if sum == 1.into() {
+ println!("{} is perfect", candidate);
+ }
+ }
+}
diff --git a/Task/Arithmetic-evaluation/00DESCRIPTION b/Task/Arithmetic-evaluation/00DESCRIPTION
index 608fa66217..de76de6aaa 100644
--- a/Task/Arithmetic-evaluation/00DESCRIPTION
+++ b/Task/Arithmetic-evaluation/00DESCRIPTION
@@ -6,15 +6,17 @@ Create a program which parses and evaluates arithmetic expressions.
* The expression will be a string or list of symbols like "(1+3)*7".
* The four symbols + - * / must be supported as binary operators with conventional precedence rules.
* Precedence-control parentheses must also be supported.
+
;Note:
For those who don't remember, mathematical precedence is as follows:
* Parentheses
* Multiplication/Division (left to right)
* Addition/Subtraction (left to right)
-
+
;C.f:
* [[24 game Player]].
* [[Parsing/RPN calculator algorithm]].
* [[Parsing/RPN to infix conversion]].
+
diff --git a/Task/Arithmetic-evaluation/Elena/arithmetic-evaluation.elena b/Task/Arithmetic-evaluation/Elena/arithmetic-evaluation.elena
index 37c77114ac..9eed08c46f 100644
--- a/Task/Arithmetic-evaluation/Elena/arithmetic-evaluation.elena
+++ b/Task/Arithmetic-evaluation/Elena/arithmetic-evaluation.elena
@@ -1,6 +1,7 @@
-#define system.
-#define system'routines.
-#define extensions.
+#import system.
+#import system'routines.
+#import extensions.
+#import extensions'text.
#class Token
{
@@ -9,7 +10,7 @@
#constructor new &level:aLevel
[
- theValue := String new.
+ theValue := StringWriter new.
theLevel := aLevel + 9.
]
@@ -17,10 +18,10 @@
#method append : aChar
[
- theValue += aChar.
+ theValue << aChar.
]
- #method number = theValue value toReal.
+ #method number = theValue get toReal.
}
#class Node
@@ -100,8 +101,6 @@
#method number => theTop.
}
-// --- States ---
-
#symbol operatorState = (:ch)
[
ch =>
@@ -219,7 +218,7 @@
#method append:ch
[
- ((ch >= 48) and:(ch < 58))
+ ((ch >= #48) and:(ch < #58))
? [ theToken append:ch. ]
! [ #throw InvalidArgumentException new &message:"Invalid expression". ].
]
@@ -320,11 +319,13 @@
#var aText := String new.
#var aParser := Parser new.
- [ (aText << console readLine) length > 0] doWhile:
+ [ console readLine save &to:aText length > 0] doWhile:
[
console writeLine:"=" :(aParser run:aText)
| if &Error:e [
console writeLine:"Invalid Expression".
].
+
+ aText clear.
].
].
diff --git a/Task/Arithmetic-evaluation/Emacs-Lisp/arithmetic-evaluation.l b/Task/Arithmetic-evaluation/Emacs-Lisp/arithmetic-evaluation.l
new file mode 100644
index 0000000000..8e806350fe
--- /dev/null
+++ b/Task/Arithmetic-evaluation/Emacs-Lisp/arithmetic-evaluation.l
@@ -0,0 +1,93 @@
+#!/usr/bin/env emacs --script
+;; -*- mode: emacs-lisp; lexical-binding: t -*-
+;;> ./arithmetic-evaluation '(1 + 2) * 3'
+
+(defun advance ()
+ (let ((rtn (buffer-substring-no-properties (point) (match-end 0))))
+ (goto-char (match-end 0))
+ rtn))
+
+(defvar current-symbol nil)
+
+(defun next-symbol ()
+ (when (looking-at "[ \t\n]+")
+ (goto-char (match-end 0)))
+
+ (cond
+ ((eobp)
+ (setq current-symbol 'eof))
+ ((looking-at "[0-9]+")
+ (setq current-symbol (string-to-number (advance))))
+ ((looking-at "[-+*/()]")
+ (setq current-symbol (advance)))
+ ((looking-at ".")
+ (error "Unknown character '%s'" (advance)))))
+
+(defun accept (sym)
+ (when (equal sym current-symbol)
+ (next-symbol)
+ t))
+
+(defun expect (sym)
+ (unless (accept sym)
+ (error "Expected symbol %s, but found %s" sym current-symbol))
+ t)
+
+(defun p-expression ()
+ " expression = term { ('+' | '-') term } . "
+ (let ((rtn (p-term)))
+ (while (or (equal current-symbol "+") (equal current-symbol "-"))
+ (let ((op current-symbol)
+ (left rtn))
+ (next-symbol)
+ (setq rtn (list op left (p-term)))))
+ rtn))
+
+(defun p-term ()
+ " term = factor { ('*' | '/') factor } . "
+ (let ((rtn (p-factor)))
+ (while (or (equal current-symbol "*") (equal current-symbol "/"))
+ (let ((op current-symbol)
+ (left rtn))
+ (next-symbol)
+ (setq rtn (list op left (p-factor)))))
+ rtn))
+
+(defun p-factor ()
+ " factor = constant | variable | '(' expression ')' . "
+ (let (rtn)
+ (cond
+ ((numberp current-symbol)
+ (setq rtn current-symbol)
+ (next-symbol))
+ ((accept "(")
+ (setq rtn (p-expression))
+ (expect ")"))
+ (t (error "Syntax error")))
+ rtn))
+
+(defun ast-build (expression)
+ (let (rtn)
+ (with-temp-buffer
+ (insert expression)
+ (goto-char (point-min))
+ (next-symbol)
+ (setq rtn (p-expression))
+ (expect 'eof))
+ rtn))
+
+(defun ast-eval (v)
+ (pcase v
+ ((pred numberp) v)
+ (`("+" ,a ,b) (+ (ast-eval a) (ast-eval b)))
+ (`("-" ,a ,b) (- (ast-eval a) (ast-eval b)))
+ (`("*" ,a ,b) (* (ast-eval a) (ast-eval b)))
+ (`("/" ,a ,b) (/ (ast-eval a) (float (ast-eval b))))
+ (_ (error "Unknown value %s" v))))
+
+(dolist (arg command-line-args-left)
+ (let ((ast (ast-build arg)))
+ (princ (format " ast = %s\n" ast))
+ (princ (format " value = %s\n" (ast-eval ast)))
+ (terpri)))
+(setq command-line-args-left nil)
diff --git a/Task/Arithmetic-evaluation/Haskell/arithmetic-evaluation.hs b/Task/Arithmetic-evaluation/Haskell/arithmetic-evaluation.hs
index 301404b8a4..bc1030b4cd 100644
--- a/Task/Arithmetic-evaluation/Haskell/arithmetic-evaluation.hs
+++ b/Task/Arithmetic-evaluation/Haskell/arithmetic-evaluation.hs
@@ -2,6 +2,7 @@ import Text.Parsec
import Text.Parsec.Expr
import Text.Parsec.Combinator
import Data.Functor
+import Data.Function (on)
data Exp = Num Int
| Add Exp Exp
@@ -15,15 +16,13 @@ expr = buildExpressionParser table factor
op s f assoc = Infix (f <$ string s) assoc
factor = (between `on` char) '(' ')' expr
<|> (Num . read <$> many1 digit)
- on f g = \x y -> f (g x) (g y)
eval :: Num a => Exp -> a
-eval e = case e of
- Num x -> fromIntegral x
- Add a b -> eval a + eval b
- Sub a b -> eval a - eval b
- Mul a b -> eval a * eval b
- Div a b -> eval a `div` eval b
+eval (Num x) = fromIntegral x
+eval (Add a b) = eval a + eval b
+eval (Sub a b) = eval a - eval b
+eval (Mul a b) = eval a * eval b
+eval (Div a b) = eval a `div` eval b
solution :: Num a => String -> a
solution = either (const (error "Did not parse")) eval . parse expr ""
diff --git a/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-1.pl6 b/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-1.pl6
index 8671ee7321..25b8d1a0cf 100644
--- a/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-1.pl6
+++ b/Task/Arithmetic-evaluation/Perl-6/arithmetic-evaluation-1.pl6
@@ -13,13 +13,13 @@ sub ev (Str $s --> Num) {
my sub minus ($b) { $b ?? -1 !! +1 }
my sub sum ($x) {
- [+] product($x), map
+ [+] flat product($x), map
{ minus($^y[0] eq '-') * product $^y },
|($x[0] or [])
}
my sub product ($x) {
- [*] factor($x), map
+ [*] flat factor($x), map
{ factor($^y) ** minus($^y[0] eq '/') },
|($x[0] or [])
}
diff --git a/Task/Arithmetic-evaluation/REXX/arithmetic-evaluation.rexx b/Task/Arithmetic-evaluation/REXX/arithmetic-evaluation.rexx
index 552f0bee2f..1279c5ecd2 100644
--- a/Task/Arithmetic-evaluation/REXX/arithmetic-evaluation.rexx
+++ b/Task/Arithmetic-evaluation/REXX/arithmetic-evaluation.rexx
@@ -1,117 +1,116 @@
-/*REXX pgm evaluates an infix-type arithmetic expression & shows result.*/
-nchars = '0123456789.eEdDqQ' /*possible parts of a #, sans ± */
-e='***error!***'; $=' '; doubleOps='&|*/'; z=
-parse arg x 1 ox1; if x='' then call serr 'no input was specified.'
-x=space(x); L=length(x); x=translate(x,'()()',"[]{}")
-
-j=0; do forever; j=j+1; if j>L then leave; _=substr(x,j,1); _2=getX()
- newT=pos(_,' ()[]{}^÷')\==0; if newT then do; z=z _ $; iterate; end
- possDouble=pos(_,doubleOps)\==0 /*is _ a possible double operator*/
- if possDouble then do /*is this a possible double oper?*/
- if _2==_ then do /*yup, it's one of 'em.*/
- _=_||_ /*use a double operator*/
- x=overlay($,x,Nj) /*blank out the*/
- end /* 2nd symbol.*/
- z=z _ $; iterate
- end
- if _=='+' | _=="-" then do; p_=word(z,words(z)) /*last Z token*/
- if p_=='(' then z=z 0 /*handle unary ±*/
- z=z _ $; iterate
+/*REXX program evaluates an infix─type arithmetic expression and displays the result.*/
+nchars = '0123456789.eEdDqQ' /*possible parts of a number, sans ± */
+e='***error***'; $=" "; doubleOps= '&|*/'; z= /*handy─dandy variables.*/
+parse arg x 1 ox1; if x='' then call serr "no input was specified."
+x=space(x); L=length(x); x=translate(x, '()()', "[]{}")
+j=0
+ do forever; j=j+1; if j>L then leave; _=substr(x, j, 1); _2=getX()
+ newT=pos(_,' ()[]{}^÷')\==0; if newT then do; z=z _ $; iterate; end
+ possDouble=pos(_,doubleOps)\==0 /*is _ a possible double operator?*/
+ if possDouble then do /* " this " " " " */
+ if _2==_ then do /*yupper, it's one of a double operator*/
+ _=_ || _ /*create and use a double char operator*/
+ x=overlay($, x, Nj) /*blank out 2nd symbol.*/
+ end
+ z=z _ $; iterate
+ end
+ if _=='+' | _=="-" then do; p_=word(z, max(1,words(z))) /*last Z token. */
+ if p_=='(' then z=z 0 /*handle a unary ± */
+ z=z _ $; iterate
end
lets=0; sigs=0; #=_
- do j=j+1 to L; _=substr(x,j,1) /*build a valid number.*/
- if lets==1 & sigs==0 then if _=='+' | _=='-' then do; sigs=1
- #=# || _
- iterate
+ do j=j+1 to L; _=substr(x,j,1) /*build a valid number.*/
+ if lets==1 & sigs==0 then if _=='+' | _=="-" then do; sigs=1
+ #=# || _
+ iterate
end
if pos(_,nchars)==0 then leave
- lets=lets+datatype(_,'M') /*keep track of # of exponents. */
- #=# || translate(_,'EEEEE','eDdQq') /*keep buildingthe num.*/
+ lets=lets+datatype(_,'M') /*keep track of the number of exponents*/
+ #=# || translate(_,'EEEEE', "eDdQq") /*keep building the number. */
end /*j*/
j=j-1
- if \datatype(#,'N') then call serr 'invalid number: ' #
+ if \datatype(#,'N') then call serr "invalid number: " #
z=z # $
end /*forever*/
-_=word(z,1); if _=='+' | _=='-' then z=0 z /*handle unary cases.*/
-x='(' space(z) ') '; tokens=words(x) /*force stacking for expression. */
- do i=1 for tokens; @.i=word(x,i); end /*i*/ /*assign input tokens*/
-L=max(20,length(x)) /*use 20 for the min show width. */
-op=')(-+/*^'; rOp=substr(op,3); p.=; s.=; n=length(op); epr=; stack=
+_=word(z,1); if _=='+' | _=="-" then z=0 z /*handle the unary cases. */
+x='(' space(z) ")"; tokens=words(x) /*force stacking for the expression. */
+ do i=1 for tokens; @.i=word(x,i); end /*i*/ /*assign input tokens. */
+L=max(20,length(x)) /*use 20 for the minimum display width.*/
+op= ')(-+/*^'; Rop=substr(op,3); p.=; s.=; n=length(op); epr=; stack=
- do i=1 for n; _=substr(op,i,1); s._=(i+1)%2; p._=s._+(i==n); end /*i*/
- /*[↑] assign operator priorities.*/
- do #=1 for tokens; ?=@.# /*process each token from @. list*/
- if ?=='**' then ?="^" /*convert REXX-type exponentation*/
- select /*@.# is: (, operator, ), operand*/
- when ?=='(' then stack='(' stack
- when isOp(?) then do /*is token an operator?*/
+ do i=1 for n; _=substr(op,i,1); s._=(i+1)%2; p._=s._ + (i==n); end /*i*/
+ /* [↑] assign the operator priorities.*/
+ do #=1 for tokens; ?=@.# /*process each token from the @. list.*/
+ if ?=='**' then ?="^" /*convert to REXX-type exponentiation. */
+ select /*@.# is: ( operator ) operand*/
+ when ?=='(' then stack="(" stack
+ when isOp(?) then do /*is the token an operator ? */
!=word(stack,1) /*get token from stack.*/
- do while !\==')' & s.!>=p.?; epr=epr ! /*add*/
- stack=subword(stack,2); /*del token from stack.*/
- !=word(stack,1) /*get token from stack.*/
- end /*while ···)*/
- stack=? stack /*add token to stack.*/
+ do while !\==')' & s.!>=p.?; epr=epr ! /*addition.*/
+ stack=subword(stack, 2) /*del token from stack*/
+ != word(stack, 1) /*get token from stack*/
+ end /*while*/
+ stack=? stack /*add token to stack*/
end
- when ?==')' then do; !=word(stack,1) /*get token from stack.*/
- do while !\=='('; epr=epr ! /*add to epr.*/
- stack=subword(stack,2) /*del token from stack.*/
- !=word(stack,1) /*get token from stack.*/
- end /*while ···( */
- stack=subword(stack,2) /*del token from stack.*/
+ when ?==')' then do; !=word(stack, 1) /*get token from stack*/
+ do while !\=='('; epr=epr ! /*append to expression*/
+ stack=subword(stack, 2) /*del token from stack*/
+ != word(stack, 1) /*get token from stack*/
+ end /*while*/
+ stack=subword(stack, 2) /*del token from stack*/
end
- otherwise epr=epr ? /*add operand to epr. */
+ otherwise epr=epr ? /*add operand to epr.*/
end /*select*/
end /*#*/
epr=space(epr stack); tokens=words(epr); x=epr; z=; stack=
- do i=1 for tokens; @.i=word(epr,i); end /*i*/ /*assign input tokens*/
-dop='/ // % ÷'; bop='& | &&' /*division ops; binary operands*/
-aop='- + * ^ **' dop bop; lop=aop '||' /*arithmetic ops; legal operands*/
+ do i=1 for tokens; @.i=word(epr,i); end /*i*/ /*assign input tokens.*/
+Dop='/ // % ÷'; Bop="& | &&" /*division operands; binary operands.*/
+Aop='- + * ^ **' Dop Bop; Lop=Aop "||" /*arithmetic operands; legal operands.*/
- do #=1 for tokens; ?=@.#; ??=? /*process each token from @. list*/
- w=words(stack); b=word(stack,max(1,w)) /*stack count; last entry.*/
- a=word(stack,max(1,w-1)) /*stack's "first" operand.*/
- division =wordpos(?,dop)\==0 /*flag: doing a division.*/
- arith =wordpos(?,aop)\==0 /*flag: doing arithmetic.*/
- bitOp =wordpos(?,bop)\==0 /*flag: doing binary math*/
- if datatype(?,'N') then do; stack=stack ?; iterate; end
- if wordpos(?,lop)==0 then do; z=e 'illegal operator:' ?; leave; end
- if w<2 then do; z=e 'illegal epr expression.'; leave; end
- if ?=='^' then ??="**" /*REXXify ^ ──► ** (make legal)*/
- if ?=='÷' then ??="/" /*REXXify ÷ ──► / (make legal)*/
- if division & b=0 then do; z=e 'division by zero: ' b; leave; end
- if bitOp & \isBit(a) then do; z=e "token isn't logical: " a; leave; end
- if bitOp & \isBit(b) then do; z=e "token isn't logical: " b; leave; end
- select /*perform arith. operation*/
- when ??=='+' then y = a + b
- when ??=='-' then y = a - b
- when ??=='*' then y = a * b
- when ??=='/' | ??=="÷" then y = a / b
- when ??=='//' then y = a // b
- when ??=='%' then y = a % b
- when ??=='^' | ??=="**" then y = a ** b
- when ??=='||' then y = a || b
- otherwise z=e 'invalid operator:' ?; leave
- end /*select*/
- if datatype(y,'W') then y=y/1 /*normalize number with ÷ by 1.*/
- _=subword(stack,1,w-2); stack=_ y /*rebuild the stack with answer. */
+ do #=1 for tokens; ?=@.#; ??=? /*process each token from @. list. */
+ w=words(stack); b=word(stack, max(1, w ) ) /*stack count; the last entry. */
+ a=word(stack, max(1, w-1) ) /*stack's "first" operand. */
+ division =wordpos(?, Dop)\==0 /*flag: doing a division operation. */
+ arith =wordpos(?, Aop)\==0 /*flag: doing arithmetic operation. */
+ bitOp =wordpos(?, Bop)\==0 /*flag: doing binary mathematics. */
+ if datatype(?, 'N') then do; stack=stack ?; iterate; end
+ if wordpos(?,Lop)==0 then do; z=e "illegal operator:" ?; leave; end
+ if w<2 then do; z=e "illegal epr expression."; leave; end
+ if ?=='^' then ??="**" /*REXXify ^ ──► ** (make it legal).*/
+ if ?=='÷' then ??="/" /*REXXify ÷ ──► / (make it legal).*/
+ if division & b=0 then do; z=e "division by zero" b; leave; end
+ if bitOp & \isBit(a) then do; z=e "token isn't logical: " a; leave; end
+ if bitOp & \isBit(b) then do; z=e "token isn't logical: " b; leave; end
+ select /*perform an arithmetic operation. */
+ when ??=='+' then y = a + b
+ when ??=='-' then y = a - b
+ when ??=='*' then y = a * b
+ when ??=='/' | ??=="÷" then y = a / b
+ when ??=='//' then y = a // b
+ when ??=='%' then y = a % b
+ when ??=='^' | ??=="**" then y = a ** b
+ when ??=='||' then y = a || b
+ otherwise z=e 'invalid operator:' ?; leave
+ end /*select*/
+ if datatype(y, 'W') then y=y/1 /*normalize the number with ÷ by 1. */
+ _=subword(stack, 1, w-2); stack=_ y /*rebuild the stack with the answer. */
end /*#*/
-if word(z,1)==e then stack= /*handle special case of errors. */
-z=space(z stack) /*append any residual entries. */
-say 'answer──►' z /*display the answer (result). */
-parse source upper . how . /*invoked via C.L. or REXX pgm?*/
-if how=='COMMAND' | ,
- \datatype(z,'W') then exit /*stick a fork in it, we're done.*/
-return z /*return Z ──► invoker (RESULT).*/
-/*──────────────────────────────────subroutines─────────────────────────*/
-isBit: return arg(1)==0 | arg(1)==1 /*returns 1 if arg1 is bin bit.*/
-isOp: return pos(arg(1),rOp)\==0 /*is argument1 a "real" operator?*/
-serr: say; say e arg(1); say; exit 13 /*issue an error message with txt*/
-/*──────────────────────────────────GETX subroutine─────────────────────*/
-getX: do Nj=j+1 to length(x); _n=substr(x,Nj,1); if _n==$ then iterate
- return substr(x,Nj,1) /* [↑] ignore any blanks in exp.*/
- end /*Nj*/
-return $ /*reached end-of-tokens, return $*/
+if word(z, 1)==e then stack= /*handle the special case of errors. */
+z=space(z stack) /*append any residual entries. */
+say 'answer──►' z /*display the answer (result). */
+parse source upper . how . /*invoked via C.L. or REXX program ? */
+if how=='COMMAND' | \datatype(z, 'W') then exit /*stick a fork in it, we're all done. */
+return z /*return Z ──► invoker (the RESULT). */
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+isBit: return arg(1)==0 | arg(1) == 1 /*returns 1 if 1st argument is binary*/
+isOp: return pos(arg(1), rOp) \== 0 /*is argument 1 a "real" operator? */
+serr: say; say e arg(1); say; exit 13 /*issue an error message with some text*/
+/*──────────────────────────────────────────────────────────────────────────────────────*/
+getX: do Nj=j+1 to length(x); _n=substr(x, Nj, 1); if _n==$ then iterate
+ return substr(x, Nj, 1) /* [↑] ignore any blanks in expression*/
+ end /*Nj*/
+ return $ /*reached end-of-tokens, return $. */
diff --git a/Task/Arithmetic-evaluation/Standard-ML/arithmetic-evaluation.ml b/Task/Arithmetic-evaluation/Standard-ML/arithmetic-evaluation.ml
new file mode 100644
index 0000000000..8804fefeff
--- /dev/null
+++ b/Task/Arithmetic-evaluation/Standard-ML/arithmetic-evaluation.ml
@@ -0,0 +1,69 @@
+(* AST *)
+datatype expression =
+ Con of int (* constant *)
+ | Add of expression * expression (* addition *)
+ | Mul of expression * expression (* multiplication *)
+ | Sub of expression * expression (* subtraction *)
+ | Div of expression * expression (* division *)
+
+(* Evaluator *)
+fun eval (Con x) = x
+ | eval (Add (x, y)) = (eval x) + (eval y)
+ | eval (Mul (x, y)) = (eval x) * (eval y)
+ | eval (Sub (x, y)) = (eval x) - (eval y)
+ | eval (Div (x, y)) = (eval x) div (eval y)
+
+(* Lexer *)
+datatype token =
+ CON of int
+ | ADD
+ | MUL
+ | SUB
+ | DIV
+ | LPAR
+ | RPAR
+
+fun lex nil = nil
+ | lex (#"+" :: cs) = ADD :: lex cs
+ | lex (#"*" :: cs) = MUL :: lex cs
+ | lex (#"-" :: cs) = SUB :: lex cs
+ | lex (#"/" :: cs) = DIV :: lex cs
+ | lex (#"(" :: cs) = LPAR :: lex cs
+ | lex (#")" :: cs) = RPAR :: lex cs
+ | lex (#"~" :: cs) = if null cs orelse not (Char.isDigit (hd cs)) then raise Domain
+ else lexDigit (0, cs, ~1)
+ | lex (c :: cs) = if Char.isDigit c then lexDigit (0, c :: cs, 1)
+ else raise Domain
+
+and lexDigit (a, cs, s) = if null cs orelse not (Char.isDigit (hd cs)) then CON (a*s) :: lex cs
+ else lexDigit (a * 10 + (ord (hd cs))- (ord #"0") , tl cs, s)
+
+(* Parser *)
+exception Error of string
+
+fun match (a,ts) t = if null ts orelse hd ts <> t
+ then raise Error "match"
+ else (a, tl ts)
+
+fun extend (a,ts) p f = let val (a',tr) = p ts in (f(a,a'), tr) end
+
+fun parseE ts = parseE' (parseM ts)
+and parseE' (e, ADD :: ts) = parseE' (extend (e, ts) parseM Add)
+ | parseE' (e, SUB :: ts) = parseE' (extend (e, ts) parseM Sub)
+ | parseE' s = s
+
+and parseM ts = parseM' (parseP ts)
+and parseM' (e, MUL :: ts) = parseM' (extend (e, ts) parseP Mul)
+ | parseM' (e, DIV :: ts) = parseM' (extend (e, ts) parseP Div)
+ | parseM' s = s
+
+and parseP (CON c :: ts) = (Con c, ts)
+ | parseP (LPAR :: ts) = match (parseE ts) RPAR
+ | parseP _ = raise Error "parseP"
+
+
+(* Test *)
+fun lex_parse_eval (str:string) =
+ case parseE (lex (explode str)) of
+ (exp, nil) => eval exp
+ | _ => raise Error "not parseable stuff at the end"
diff --git a/Task/Arithmetic-evaluation/ZX-Spectrum-Basic/arithmetic-evaluation.zx b/Task/Arithmetic-evaluation/ZX-Spectrum-Basic/arithmetic-evaluation.zx
new file mode 100644
index 0000000000..eb7f8c4ed7
--- /dev/null
+++ b/Task/Arithmetic-evaluation/ZX-Spectrum-Basic/arithmetic-evaluation.zx
@@ -0,0 +1,31 @@
+10 PRINT "Use integer numbers and signs"'"+ - * / ( )"''
+20 LET s$="": REM last symbol
+30 LET pc=0: REM parenthesis counter
+40 LET i$="1+2*(3+(4*5+6*7*8)-9)/10"
+50 PRINT "Input = ";i$
+60 FOR n=1 TO LEN i$
+70 LET c$=i$(n)
+80 IF c$>="0" AND c$<="9" THEN GO SUB 170: GO TO 130
+90 IF c$="+" OR c$="-" THEN GO SUB 200: GO TO 130
+100 IF c$="*" OR c$="/" THEN GO SUB 200: GO TO 130
+110 IF c$="(" OR c$=")" THEN GO SUB 230: GO TO 130
+120 GO TO 300
+130 NEXT n
+140 IF pc>0 THEN PRINT FLASH 1;"Parentheses not paired.": BEEP 1,-25: STOP
+150 PRINT "Result = ";VAL i$
+160 STOP
+170 IF s$=")" THEN GO TO 300
+180 LET s$=c$
+190 RETURN
+200 IF (NOT (s$>="0" AND s$<="9")) AND s$<>")" THEN GO TO 300
+210 LET s$=c$
+220 RETURN
+230 IF c$="(" AND ((s$>="0" AND s$<="9") OR s$=")") THEN GO TO 300
+240 IF c$=")" AND ((NOT (s$>="0" AND s$<="9")) OR s$="(") THEN GO TO 300
+250 LET s$=c$
+260 IF c$="(" THEN LET pc=pc+1: RETURN
+270 LET pc=pc-1
+280 IF pc<0 THEN GO TO 300
+290 RETURN
+300 PRINT FLASH 1;"Invalid symbol ";c$;" detected in pos ";n: BEEP 1,-25
+310 STOP
diff --git a/Task/Arithmetic-geometric-mean-Calculate-Pi/00DESCRIPTION b/Task/Arithmetic-geometric-mean-Calculate-Pi/00DESCRIPTION
index a18a4854c7..2b4e1a6f01 100644
--- a/Task/Arithmetic-geometric-mean-Calculate-Pi/00DESCRIPTION
+++ b/Task/Arithmetic-geometric-mean-Calculate-Pi/00DESCRIPTION
@@ -7,7 +7,7 @@ With the same notations used in [[Arithmetic-geometric mean]], we can summarize
{1 - \sum\limits_{n=1}^{\infty} 2^{n+1}(a_n^2-g_n^2)}
-This allows you to make the approximation, for any large N:
+This allows you to make the approximation, for any large '''N''':