solutions
listlengths
2
791
task_name
stringlengths
2
86
[ { "code": "---\nfrom: http://rosettacode.org/wiki/K-means++_clustering\nnote: Probability and statistics\n", "language": "00-META" }, { "code": "[[WP:K-means%2B%2B|K-means++ clustering]] a classification of data, so that points assigned to the same cluster are similar (in some sense). It is identic...
K-means++-clustering
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Kaprekar_numbers\n", "language": "00-META" }, { "code": "A positive integer is a [[wp:Kaprekar number|Kaprekar number]] if:\n* It is   '''1'''     (unity)\n* The decimal representation of its square may be split once into two parts con...
Kaprekar-numbers
[ { "code": "---\ncategory:\n- Hardware\n- Terminal control\n- Simple\nfrom: http://rosettacode.org/wiki/Keyboard_input/Flush_the_keyboard_buffer\nnote: Keyboard input\n", "language": "00-META" }, { "code": "[[user input::task| ]] \n{{omit from|ACL2}}\n{{omit from|GUISS}}\n{{omit from|PARI/GP}}\n\nFlu...
Keyboard-input-Flush-the-keyboard-buffer
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Keyboard_input/Keypress_check\nnote: Keyboard input\n", "language": "00-META" }, { "code": "[[user input::task| ]]\n\nDetermine if a key has been pressed and store this in a variable. \n\nIf no key has been pressed, the program should continue withou...
Keyboard-input-Keypress-check
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Keyboard_input/Obtain_a_Y_or_N_response\n", "language": "00-META" }, { "code": "[[user input::task| ]]\n\n;Task:\nObtain a valid   '''Y'''   or   '''N'''   response from the [[input device::keyboard]]. \n\nThe...
Keyboard-input-Obtain-a-Y-or-N-response
[ { "code": "---\ncategory:\n- Memoization\n- Puzzles\nfrom: http://rosettacode.org/wiki/Knapsack_problem/0-1\nnote: Classic CS problems and programs\n", "language": "00-META" }, { "code": "A tourist wants to make a good trip at the weekend with his friends. \n\nThey will go to the mountains to see th...
Knapsack-problem-0-1
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Knapsack_problem/Bounded\nnote: Classic CS problems and programs\n", "language": "00-META" }, { "code": "A tourist wants to make a good trip at the weekend with his friends. \n\nThey will go to the mountains to see the wonders of nature.   So he...
Knapsack-problem-Bounded
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Knapsack_problem/Continuous\nnote: Classic CS problems and programs\n", "language": "00-META" }, { "code": "A thief burgles a butcher's shop, where he can select from some items.\n\nThe thief knows the weights and prices of each items.   Because...
Knapsack-problem-Continuous
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Knight's_tour\n", "language": "00-META" }, { "code": ";Task\n[[wp:Knight%27s_tour|Problem]]: you have a standard 8x8 chessboard, empty but for a single knight on some square. Your task is to emit a series of legal knight moves that result in the kn...
Knights-tour
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Knuth_shuffle\nnote: Classic CS problems and programs\n", "language": "00-META" }, { "code": "The   [[wp:Knuth shuffle|Knuth shuffle]]   (a.k.a. the Fisher-Yates shuffle)   is an algorithm for randomly shuffling the elements of an arra...
Knuth-shuffle
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Knuth's_algorithm_S\n", "language": "00-META" }, { "code": "This is a method of randomly sampling n items from a set of M items, with equal probability; where M >= n and M, the number of items is unknown until the end.\nThis means that the equal prob...
Knuths-algorithm-S
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Koch_curve\n", "language": "00-META" }, { "code": "Draw a Koch curve. See details: [https://en.wikipedia.org/wiki/Koch_snowflake Koch curve]\n\n", "language": "00-TASK" }, { "code": "INCLUDE \"H6:REALMATH.ACT\"\n\nDEFINE MAXSIZE=\"20\"\n\...
Koch-curve
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Kolakoski_sequence\n", "language": "00-META" }, { "code": "The [[wp:Kolakoski sequence|Kolakoski sequence]] is an infinite sequence of [[wp:Natural number|natural numbers]], (excluding zero); with the property that:\n: ''if you form a new sequence fr...
Kolakoski-sequence
[ { "code": "---\ncategory:\n- Algorithm\nfrom: http://rosettacode.org/wiki/Kosaraju\n", "language": "00-META" }, { "code": "<br>\nKosaraju's algorithm (also known as the Kosaraju–Sharir algorithm) is a linear time algorithm to find the strongly connected components of a directed graph. Aho, Hopcroft ...
Kosaraju
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Kronecker_product_based_fractals\nnote: Fractals\n", "language": "00-META" }, { "code": "This task is based on &nbsp; [[Kronecker product| Kronecker product]] &nbsp; of two matrices. \n\nIf your language has no a built-in function for such product th...
Kronecker-product-based-fractals
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Lah_numbers\n", "language": "00-META" }, { "code": "Lah numbers, sometimes referred to as ''Stirling numbers of the third kind'', are coefficients of polynomial expansions expressing rising factorials in terms of falling factorials.\n\nUnsigned Lah n...
Lah-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Langton's_ant\nnote: Cellular automata\n", "language": "00-META" }, { "code": "[[wp:Langton's ant|Langton's ant]] is a cellular automaton that models an [https://en.wikipedia.org/wiki/Ant ant] sitting on a plane of cells, all of which are white initi...
Langtons-ant
[ { "code": "---\ncategory:\n- Puzzles\nfrom: http://rosettacode.org/wiki/Largest_number_divisible_by_its_digits\n", "language": "00-META" }, { "code": ";Task:\nFind the largest base 10 integer whose digits are all different, &nbsp; and &nbsp; is evenly divisible by each of its individual digits.\n\n\...
Largest-number-divisible-by-its-digits
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Largest_proper_divisor_of_n\n", "language": "00-META" }, { "code": ";Task:a(1) = 1; for n > 1, a(n) = '''largest''' proper divisor of n, where '''n < 101 '''.\n<br><br>\n\n", "language": "00-TASK" }, { "code": "F lpd(n)\n L(i) (n - 1 .<...
Largest-proper-divisor-of-n
[ { "code": "---\ncategory:\n- Date and time\nfrom: http://rosettacode.org/wiki/Last_Friday_of_each_month\n", "language": "00-META" }, { "code": ";Task:\nWrite a program or a script that returns the date of the last Fridays of each month of a given year. \n\nThe year may be given through any simple in...
Last-Friday-of-each-month
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Latin_Squares_in_reduced_form\n", "language": "00-META" }, { "code": "A Latin Square is in its reduced form if the first row and first column contain items in their natural order. The order n is the number of items. For any given n there is a set of ...
Latin-Squares-in-reduced-form
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Law_of_cosines_-_triples\n", "language": "00-META" }, { "code": "The [https://en.wikipedia.org/wiki/Law_of_cosines Law of cosines] states that for an angle γ, (gamma) of any triangle, if the sides adjacent to the angle are A and B and the side opposi...
Law-of-cosines---triples
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Leap_year\nnote: Date and time\n", "language": "00-META" }, { "code": ";Task:\nDetermine whether a given year is a leap year in the Gregorian calendar.\n\n\n;See also:\n* [[wp:Leap year|Leap year (wiki)]]\n<br><br>\n\n", "language": "00-TASK" }...
Leap-year
[ { "code": "---\ncategory:\n- Mathematics\nfrom: http://rosettacode.org/wiki/Left_factorials\n", "language": "00-META" }, { "code": "'''Left factorials''', &nbsp; <big><big>!n</big></big>, &nbsp; may refer to either &nbsp; ''subfactorials'' &nbsp; or to &nbsp; ''factorial sums''; \n<br>the same notat...
Left-factorials
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Legendre_prime_counting_function\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The prime-counting function π(n) computes the number of primes not greater than n. Legendre was the first mathematician to create a formula to compute π(n) ...
Legendre-prime-counting-function
[ { "code": "---\ncategory:\n- Classic CS problems and programs\nfrom: http://rosettacode.org/wiki/Leonardo_numbers\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": "<!-- The following <math> tag doesn't render properly as it does correctly on Wikipedia.\n It generates some ...
Leonardo-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Levenshtein_distance\n", "language": "00-META" }, { "code": "<br>\nIn information theory and computer science, the '''Levenshtein distance''' is a [[wp:string metric|metric]] for measuring the amount of difference between two sequences (i.e. an [[wp:...
Levenshtein-distance
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Levenshtein_distance/Alignment\n", "language": "00-META" }, { "code": "The [[Levenshtein distance]] algorithm returns the number of atomic operations (insertion, deletion or edition) that must be performed on a string in order to obtain an other one,...
Levenshtein-distance-Alignment
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Linear_congruential_generator\nnote: Randomness\n", "language": "00-META" }, { "code": "The [[wp:linear congruential generator|linear congruential generator]] is a very simple example of a [[random number generator]]. \n\nAll linear congruential gene...
Linear-congruential-generator
[ { "code": "---\nfrom: http://rosettacode.org/wiki/List_rooted_trees\n", "language": "00-META" }, { "code": "You came back from grocery shopping. &nbsp; After putting away all the goods, you are left with a pile of plastic bags, which you want to save for later use, so you take one bag and stuff all...
List-rooted-trees
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Literals/Floating_point\nnote: Basic language learning\n", "language": "00-META" }, { "code": "Programming languages have different ways of expressing floating-point literals. \n\n\n;Task:\nShow how floating-point literals can be expressed in your la...
Literals-Floating-point
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Literals/Integer\nnote: Basic language learning\n", "language": "00-META" }, { "code": "Some programming languages have ways of expressing integer literals in bases other than the normal base ten.\n\n\n;Task:\nShow how integer li...
Literals-Integer
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Logical_operations\nnote: Basic Data Operations\n", "language": "00-META" }, { "code": "{{basic data operation}} \n[[Category:Simple]]\n\n;Task:\nWrite a function that takes two logical (boolean) values, and outputs the result of \"and\" and \"or\" o...
Logical-operations
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Logistic_curve_fitting_in_epidemiology\nnote: Probability and statistics\n", "language": "00-META" }, { "code": "The least-squares method (see references below) in statistics is used to fit data\nto the best of a family of similar curves by finding t...
Logistic-curve-fitting-in-epidemiology
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Long_literals,_with_continuations\n", "language": "00-META" }, { "code": "This task is about writing a computer program that has long literals &nbsp; (character\nliterals that may require specifying the words/tokens on more than one (source)\nline, &...
Long-literals-with-continuations
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Long_primes\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "A &nbsp; '''long prime''' &nbsp; (as defined here) &nbsp; is a prime number whose reciprocal &nbsp; (in decimal) &nbsp; has\na &nbsp; ''period length'' &nbsp; of one less than t...
Long-primes
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Long_year\n", "language": "00-META" }, { "code": "Most years have 52 weeks, some have 53, according to [https://en.wikipedia.org/wiki/ISO_week_date#Weeks_per_year ISO8601].\n\n\n;Task:\nWrite a function which determines if a given year is long (53 we...
Long-year
[ { "code": "---\ncategory:\n- Recursion\n- Memoization\nfrom: http://rosettacode.org/wiki/Longest_common_subsequence\n", "language": "00-META" }, { "code": "'''Introduction'''\n\nDefine a ''subsequence'' to be any output string obtained by deleting zero or more symbols from an input string.\n\nThe [h...
Longest-common-subsequence
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Longest_increasing_subsequence\n", "language": "00-META" }, { "code": "Calculate and show here a [[wp:Longest increasing subsequence|longest increasing subsequence]] of the list:\n:<math>\\{3, 2, 6, 4, 5, 1\\}</math>\nAnd of the list:\n:<math>\\{0, 8...
Longest-increasing-subsequence
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Longest_string_challenge\nnote: Programming Challenge\n", "language": "00-META" }, { "code": ";Background:\nThis \"longest string challenge\" is inspired by a problem that used to be given to students learning Icon. Students were expected to try to s...
Longest-string-challenge
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Look-and-say_sequence\nnote: Text processing\n", "language": "00-META" }, { "code": "The &nbsp; [[wp:Look and say sequence|Look and say sequence]] &nbsp; is a recursively defined sequence of numbers studied most notably by &nbsp; [[wp:John Horton Con...
Look-and-say-sequence
[ { "code": "---\ncategory:\n- Loop modifiers\n- Simple\nfrom: http://rosettacode.org/wiki/Loops/Break\nnote: Iteration\n", "language": "00-META" }, { "code": ";Task:\nShow a loop which prints random numbers (each number newly generated each loop) from 0 to 19 (inclusive). \n\nIf a number is 10, stop ...
Loops-Break
[ { "code": "---\ncategory:\n- Loop modifiers\nfrom: http://rosettacode.org/wiki/Loops/Continue\nnote: Iteration\n", "language": "00-META" }, { "code": ";Task:\nShow the following output using one loop. \n 1, 2, 3, 4, 5\n 6, 7, 8, 9, 10\n\n\nTry to achieve the result by forcing the next iteration with...
Loops-Continue
[ { "code": "---\ncategory:\n- Conditional loops\n- Simple\nfrom: http://rosettacode.org/wiki/Loops/Do-while\nnote: Iteration\n", "language": "00-META" }, { "code": "Start with a value at 0. Loop while value mod 6 is not equal to 0. \nEach time through the loop, add 1 to the value then print it. \nThe...
Loops-Do-while
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Loops/For\nnote: Iteration\n", "language": "00-META" }, { "code": "“'''For'''” &nbsp; loops are used to make some block of code be iterated a number of times, setting a variable or parameter to a monotonically increasing integer ...
Loops-For
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Loops/For_with_a_specified_step\nnote: Iteration\n", "language": "00-META" }, { "code": ";Task:\nDemonstrate a &nbsp; ''for-loop'' &nbsp; where the step-value is greater than one.\n\n\n;Related tasks:\n* &nbsp; [[Loop over multip...
Loops-For-with-a-specified-step
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Loops/Foreach\nnote: Iteration\n", "language": "00-META" }, { "code": "Loop through and print each element in a collection in order. \n\nUse your language's \"for each\" loop if it has one, otherwise iterate through the collection in order with some ...
Loops-Foreach
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Loops/Infinite\nnote: Iteration\n", "language": "00-META" }, { "code": ";Task:\nPrint out &nbsp; &nbsp; &nbsp; <big> '''SPAM''' </big> &nbsp; &nbsp; &nbsp; followed by a &nbsp; ''newline'' &nbsp; in an infinite loop.\n\n\n;Relate...
Loops-Infinite
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Loops/N_plus_one_half\nnote: Iteration\n", "language": "00-META" }, { "code": "Quite often one needs loops which, in the last iteration, execute only part of the loop body.\n\n;Goal:\nDemonstrate the best way to do this.\n\n;Task...
Loops-N-plus-one-half
[ { "code": "---\ncategory:\n- Loop modifiers\nfrom: http://rosettacode.org/wiki/Loops/Nested\nnote: Iteration\n", "language": "00-META" }, { "code": "Show a nested loop which searches a two-dimensional array filled with random numbers uniformly distributed over <math>[1,\\ldots,20]</math>. \n\nThe lo...
Loops-Nested
[ { "code": "---\ncategory:\n- Loop modifiers\n- Conditional loops\n- Simple\nfrom: http://rosettacode.org/wiki/Loops/With_multiple_ranges\nnote: Iteration\n", "language": "00-META" }, { "code": "Some languages allow multiple '''loop''' ranges, such as the '''PL/I''' example (snippet) below.\n\n<synta...
Loops-With-multiple-ranges
[ { "code": "---\ncategory:\n- Loop modifiers\nfrom: http://rosettacode.org/wiki/Loops/Wrong_ranges\nnote: Iteration\n", "language": "00-META" }, { "code": "Some languages have syntax or function(s) to generate a range of numeric values from a start value, a stop value, and an increment.\n\nThe purpos...
Loops-Wrong-ranges
[ { "code": "---\nfrom: http://rosettacode.org/wiki/LU_decomposition\nnote: Matrices\n", "language": "00-META" }, { "code": "Every square matrix <math>A</math> can be decomposed into a product of a lower triangular matrix <math>L</math> and a upper triangular matrix <math>U</math>, \nas described in [...
LU-decomposition
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Lucky_and_even_lucky_numbers\n", "language": "00-META" }, { "code": "<small>Note that in the following explanation list indices are assumed to start at ''one''.</small>\n\n;Definition of lucky numbers\n''[[wp:Lucky number|Lucky numbers]]'' are positi...
Lucky-and-even-lucky-numbers
[ { "code": "---\ncategory:\n- Prime Numbers\nfrom: http://rosettacode.org/wiki/Ludic_numbers\nnote: Sieves\n", "language": "00-META" }, { "code": "[https://oeis.org/wiki/Ludic_numbers Ludic numbers] &nbsp; are related to prime numbers as they are generated by a sieve quite like the [[Sieve of Eratost...
Ludic-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers\nnote: Checksums\n", "language": "00-META" }, { "code": "The [[wp:Luhn algorithm|Luhn test]] is used by some credit card companies to distinguish valid credit card numbers from what could be a random selection of digi...
Luhn-test-of-credit-card-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/LZW_compression\nnote: Compression\n", "language": "00-META" }, { "code": "The Lempel-Ziv-Welch (LZW) algorithm provides loss-less data compression.\n\nYou can read a complete description of it in the &nbsp; [[wp:Lempel-Ziv-Welch|Wikipedia article]] ...
LZW-compression
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Möbius_function\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The classical '''Möbius function: μ(n)''' is an important multiplicative function in number theory and combinatorics.\n\nThere are several ways to implement a Möbius functio...
M-bius-function
[ { "code": "---\ncategory:\n- Network Tools\nfrom: http://rosettacode.org/wiki/MAC_vendor_lookup\n", "language": "00-META" }, { "code": "Every connected device around the world comes with a unique Media Access Control address, or a &nbsp; [https://en.wikipedia.org/wiki/MAC_address MAC address]. \n\nA...
MAC-vendor-lookup
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Mad_Libs\n", "language": "00-META" }, { "code": "<br>\n[[wp:Mad Libs|Mad Libs]] is a phrasal template word game where one player prompts another for a list of words to substitute for blanks in a story, usually with funny results. \n\n\n;Task;\nWrite ...
Mad-Libs
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Magic_8-ball\n", "language": "00-META" }, { "code": ";Task:\nCreate Magic 8-Ball. \n\n\nSee details at: &nbsp; [https://en.wikipedia.org/wiki/Magic_8-Ball Magic 8-Ball].\n\n\n{{Template:strings}}\n<br><br>\n\n", "language": "00-TASK" }, { ...
Magic-8-ball
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Magic_constant\n", "language": "00-META" }, { "code": "A magic square is a square grid containing consecutive integers from 1 to N², arranged so that every row, column and diagonal adds up to the same number. That number is a constant. There is no wa...
Magic-constant
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Magic_squares_of_odd_order\n", "language": "00-META" }, { "code": "A magic square is an &nbsp; <big>'''NxN'''</big> &nbsp; square matrix whose numbers (usually integers) consist of consecutive numbers arranged so that the sum of each row and column, ...
Magic-squares-of-odd-order
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Magic_squares_of_singly_even_order\n", "language": "00-META" }, { "code": "A [[wp:Magic_square|magic square]] is an '''NxN''' square matrix whose numbers consist of consecutive numbers arranged so that the sum of each row and column, ''and'' both dia...
Magic-squares-of-singly-even-order
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Magnanimous_numbers\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "A magnanimous number is an integer where there is no place in the number where a + (plus sign) could be added between any two digits to give a non-prime sum. \n\n\n;E.G....
Magnanimous-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Make_directory_path\nnote: File System Operations\n", "language": "00-META" }, { "code": ";Task:\nCreate a directory and any missing parents.\n\nThis task is named after the posix <code>[http://www.unix.com/man-page/POSIX/0/mkdir/ mkdir -p]</code> co...
Make-directory-path
[ { "code": "---\ncategory:\n- Recursion\nfrom: http://rosettacode.org/wiki/Man_or_boy_test\nnote: Classic CS problems and programs\n", "language": "00-META" }, { "code": "<br>\n'''Background''': The '''man or boy test''' was proposed by computer scientist [[wp:Donald_Knuth|Donald Knuth]] as a means o...
Man-or-boy-test
[ { "code": "---\ncategory:\n- Graphics\n- Raster graphics operations\nfrom: http://rosettacode.org/wiki/Mandelbrot_set\nnote: Fractals\n", "language": "00-META" }, { "code": ";Task:\nGenerate and draw the [[wp:Mandelbrot set|Mandelbrot set]]. \n\n\nNote that there are [http://en.wikibooks.org/wiki/Fr...
Mandelbrot-set
[ { "code": "---\ncategory:\n- Puzzles\nfrom: http://rosettacode.org/wiki/Mastermind\nnote: Games\n", "language": "00-META" }, { "code": "Create a simple version of the board game: &nbsp; [https://en.wikipedia.org/wiki/Mastermind_(board_game) Mastermind].\n\nIt must be possible to:\n:* &nbsp; choose t...
Mastermind
[ { "code": "---\ncategory:\n- Matrices\nfrom: http://rosettacode.org/wiki/Matrix_chain_multiplication\nnote: Discrete math\n", "language": "00-META" }, { "code": ";Problem\nUsing the most straightforward algorithm (which we assume here), computing the [[Matrix multiplication|product of two matrices]]...
Matrix-chain-multiplication
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Matrix_digital_rain\n", "language": "00-META" }, { "code": "Implement the Matrix Digital Rain visual effect from the movie \"The Matrix\" as described in [[wp:Matrix_digital_rain|Wikipedia]].\n\nProvided is a reference implementation in Common Lisp t...
Matrix-digital-rain
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Matrix_multiplication\nnote: Matrices\n", "language": "00-META" }, { "code": ";Task:\nMultiply two matrices together. \n\nThey can be of any dimensions, so long as the number of columns of the first matrix is equal to the number of rows of the second...
Matrix-multiplication
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Matrix_transposition\nnote: Matrices\n", "language": "00-META" }, { "code": "[[wp:Transpose|Transpose]] an arbitrarily sized rectangular [[wp:Matrix (mathematics)|Matrix]].\n<br><br>\n", "language": "00-TASK" }, { "code": "F transpose(&ma...
Matrix-transposition
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Maximum_triangle_path_sum\n", "language": "00-META" }, { "code": "Starting from the top of a pyramid of numbers like this, you can walk down going one step on the right or on the left, until you reach the bottom row:\n<pre>\n ...
Maximum-triangle-path-sum
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Mayan_numerals\nnote: Mayan numerals\n", "language": "00-META" }, { "code": ";Task:\nPresent numbers using the Mayan numbering system &nbsp; (displaying the Mayan numerals in a cartouche).\n\n\n;Mayan numbers:\nNormally, Mayan <u>numbers</u> are writ...
Mayan-numerals
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Maze_generation\nnote: Games\n", "language": "00-META" }, { "code": "<br>\n;Task:\nGenerate and show a maze, using the simple [[wp:Maze_generation_algorithm#Depth-first_search|Depth-first search]] algorithm.\n\n<!-- BEGIN TEXT FROM WIKIPEDIA -->\n#St...
Maze-generation
[ { "code": "---\ncategory:\n- Recursion\n- Puzzles\nfrom: http://rosettacode.org/wiki/Maze_solving\nnote: Games\n", "language": "00-META" }, { "code": ";Task:\nFor a maze generated by [[Maze generation|this task]], write a function \nthat finds (and displays) the shortest path between two cells. \n\n...
Maze-solving
[ { "code": "---\ncategory:\n- Checksums\nfrom: http://rosettacode.org/wiki/MD4\n", "language": "00-META" }, { "code": "Find the MD4 message digest of a string of [[octet]]s. \nUse the ASCII encoded string “<tt>Rosetta Code</tt>” (without quotes). \nYou may either call an MD4 library, or implement MD4...
MD4
[ { "code": "---\nfrom: http://rosettacode.org/wiki/MD5\nnote: Checksums\n", "language": "00-META" }, { "code": ";Task:\nEncode a string using an MD5 algorithm. &nbsp; The algorithm can be found on &nbsp; [[wp:Md5#Algorithm|Wikipedia]].\n\n\nOptionally, validate your implementation by running all of t...
MD5
[ { "code": "---\nfrom: http://rosettacode.org/wiki/MD5/Implementation\nnote: Checksums\n", "language": "00-META" }, { "code": "The purpose of this task to code and validate an implementation of the MD5 Message Digest Algorithm by coding the algorithm directly (not using a call to a built-in or extern...
MD5-Implementation
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Meissel–Mertens_constant\n", "language": "00-META" }, { "code": ";Task:\nCalculate Meissel–Mertens constant up to a precision your language can handle.\n\n\n;Motivation:\nAnalogous to Euler's constant, which is important in determining the sum of rec...
Meissel-Mertens-constant
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Memory_allocation\nnote: Basic language learning\n", "language": "00-META" }, { "code": ";Task:\nShow how to explicitly allocate and deallocate blocks of memory in your language. \n\nShow access to different types of memory (i.e., [[heap]], [[system ...
Memory-allocation
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Memory_layout_of_a_data_structure\n", "language": "00-META" }, { "code": "It is often useful to control the memory layout of fields in a data structure to match an interface control definition, or to interface with hardware. Define a data structure m...
Memory-layout-of-a-data-structure
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Merge_and_aggregate_datasets\nnote: Data Structures\n", "language": "00-META" }, { "code": "Merge and aggregate datasets\n\n\n;Task:\nMerge and aggregate two datasets as provided in &nbsp; '''.csv''' &nbsp; files into a new resulting dataset.\n\nUse ...
Merge-and-aggregate-datasets
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Mertens_function\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The Mertens function '''M(x)''' is the '''count''' of '''square-free integers''' up to '''x''' that have an '''even number''' of prime factors, '''minus''' the '''count''' ...
Mertens-function
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Metallic_ratios\n", "language": "00-META" }, { "code": "Many people have heard of the '''Golden ratio''', phi ('''φ'''). Phi is just one of a series\nof related ratios that are referred to as the \"'''Metallic ratios'''\".\n\nThe '''Golden ratio''' w...
Metallic-ratios
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Metered_concurrency\nnote: Concurrency\nrequires:\n- Concurrency\n", "language": "00-META" }, { "code": "The goal of this task is to create a [[wp:Counting semaphore|counting semaphore]] used to control the execution of a set of concurrent units. Thi...
Metered-concurrency
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Metronome\n", "language": "00-META" }, { "code": "The task is to implement a &nbsp; [https://en.wikipedia.org/wiki/Metronomemetronome metronome]. \n\nThe metronome should be capable of producing high and low audio beats, accompanied by a visual beat ...
Metronome
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Mian-Chowla_sequence\n", "language": "00-META" }, { "code": "The [[wp:Mian–Chowla sequence|Mian–Chowla sequence]] is an integer sequence defined recursively.\n\n\nMian–Chowla is an infinite instance of a [[wp:Sidon sequence|Sidon sequence]], and belo...
Mian-Chowla-sequence
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Miller–Rabin_primality_test\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The [[wp:Miller–Rabin primality test|Miller–Rabin primality test]] or Rabin–Miller primality test is a primality test: an algorithm which determines whether a gi...
Miller-Rabin-primality-test
[ { "code": "---\ncategory:\n- Puzzles\nfrom: http://rosettacode.org/wiki/Mind_boggling_card_trick\n", "language": "00-META" }, { "code": "Matt Parker of the \"Stand Up Maths channel\" has a &nbsp; [https://www.youtube.com/watch?v=aNpGxZ_1KXU <u>YouTube video</u>] &nbsp; of a card trick that creates a...
Mind-boggling-card-trick
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Minesweeper_game\nnote: games\n", "language": "00-META" }, { "code": "There is an n by m grid that has a random number (between 10% to 20% of the total number of tiles, though older implementations may use 20%..60% instead) of randomly placed mines t...
Minesweeper-game
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Minimum_multiple_of_m_where_digital_sum_equals_m\n", "language": "00-META" }, { "code": "Generate the sequence '''a(n)''' when each element is the minimum integer multiple '''m''' such that the digit sum of '''n''' times '''m''' is equal to '''n'''.\...
Minimum-multiple-of-m-where-digital-sum-equals-m
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Minimum_positive_multiple_in_base_10_using_only_0_and_1\n", "language": "00-META" }, { "code": "Every positive integer has infinitely many base-10 multiples that only use the digits '''0''' and '''1'''. The goal of this task is to find and display th...
Minimum-positive-multiple-in-base-10-using-only-0-and-1
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Minkowski_question-mark_function\n", "language": "00-META" }, { "code": "The '''Minkowski question-mark function''' converts the continued fraction representation {{math|[a<sub>0</sub>; a<sub>1</sub>, a<sub>2</sub>, a<sub>3</sub>, ...]}} of a number ...
Minkowski-question-mark-function
[ { "code": "---\ncategory:\n- Mathematics\nfrom: http://rosettacode.org/wiki/Modular_arithmetic\n", "language": "00-META" }, { "code": "'''[[wp:Modular arithmetic|Modular arithmetic]]''' is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is d...
Modular-arithmetic
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Modular_exponentiation\n", "language": "00-META" }, { "code": "Find the last &nbsp; '''40''' &nbsp; decimal digits of &nbsp; <math>a^b</math>, &nbsp; where\n\n::* &nbsp; <math>a = 2988348162058574136915891421498819466320163312926952423791023078876139...
Modular-exponentiation
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Modular_inverse\n", "language": "00-META" }, { "code": "From [http://en.wikipedia.org/wiki/Modular_multiplicative_inverse Wikipedia]:\n\nIn [[wp:modular arithmetic|modular arithmetic]], &nbsp; the '''modular multiplicative inverse''' of an [[integer]...
Modular-inverse
[ { "code": "---\ncategory:\n- Monads\nfrom: http://rosettacode.org/wiki/Monads/Maybe_monad\n", "language": "00-META" }, { "code": "Demonstrate in your programming language the following:\n\n#Construct a Maybe Monad by writing the 'bind' function and the 'unit' (sometimes known as 'return') function f...
Monads-Maybe-monad
[ { "code": "---\ncategory:\n- Monads\nfrom: http://rosettacode.org/wiki/Monads/Writer_monad\n", "language": "00-META" }, { "code": "The Writer monad is a programming design pattern which makes it possible to compose functions which return their result values paired with a log string. The final result...
Monads-Writer-monad