solutions
listlengths
2
791
task_name
stringlengths
2
86
[ { "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   '''.csv'''   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   [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
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Monte_Carlo_methods\nnote: Probability and statistics\n", "language": "00-META" }, { "code": "A '''Monte Carlo Simulation''' is a way of approximating the value of a function \nwhere calculating the actual value is difficult or impossible. <br>\nIt u...
Monte-Carlo-methods
[ { "code": "---\ncategory:\n- Temporal media\nfrom: http://rosettacode.org/wiki/Morse_code\nnote: Sound\nrequires:\n- Sound\n", "language": "00-META" }, { "code": "[[wp:Morse_code|Morse code]] is one of the simplest and most versatile methods of telecommunication in existence. \nIt has been in use fo...
Morse-code
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Motzkin_numbers\nnote: Prime Numbers\n", "language": "00-META" }, { "code": ";Definition\nThe '''n'''th [https://en.wikipedia.org/wiki/Motzkin_number Motzkin number] (denoted by M[n]) is the number of different ways of drawing non-intersecting chords...
Motzkin-numbers
[ { "code": "---\ncategory:\n- Testing\n- Hardware\n- Pointing devices\nfrom: http://rosettacode.org/wiki/Mouse_position\nnote: GUI\n", "language": "00-META" }, { "code": ";Task:\nGet the current location of the mouse cursor relative to the active window. \n\nPlease specify if the window may be extern...
Mouse-position
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Multi-base_primes\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "Prime numbers are prime no matter what base they are represented in.\n\nA prime number in a base other than 10 may not ''look'' prime at first glance.\n\nFor instance: '''...
Multi-base-primes
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Multi-dimensional_array\n", "language": "00-META" }, { "code": "For the purposes of this task, the actual memory layout or access method of this data structure is not mandated. \n\nIt is enough to:\n# State the number and extent of each index to the ...
Multi-dimensional-array
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Multifactorial\n", "language": "00-META" }, { "code": "The factorial of a number, written as <math>n!</math>, is defined as <math>n! = n(n-1)(n-2)...(2)(1)</math>.\n\n[http://mathworld.wolfram.com/Multifactorial.html Multifactorials] generalize facto...
Multifactorial
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Multiple_regression\nnote: Probability and statistics\n", "language": "00-META" }, { "code": ";Task:\nGiven a set of data vectors in the following format:\n\n <math>y = \\{ y_1, y_2, ..., y_n \\}\\,</math>\n\n <math>X_i = \\{ x_{i1}, x_{i2}, .....
Multiple-regression
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Multiplication_tables\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": ";Task:\nProduce a formatted &nbsp; 12&times;12 &nbsp; multiplication table of the kind memorized by rote when in primary (or elementary) s...
Multiplication-tables
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Multiplicative_order\nnote: Discrete math\n", "language": "00-META" }, { "code": "The '''multiplicative order''' of ''a'' relative to ''m'' is the least positive integer ''n'' such that ''a^n'' is 1 (modulo ''m'').\n\n\n;Example:\nThe multiplicative ...
Multiplicative-order
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Munchausen_numbers\n", "language": "00-META" }, { "code": "A [[wp:Munchausen number|Munchausen number]] is a natural number ''n'' the sum of whose digits (in base 10), each raised to the power of itself, equals ''n''.\n\n('''Munchausen''' is also spe...
Munchausen-numbers
[ { "code": "---\ncategory:\n- Graphics algorithms\nfrom: http://rosettacode.org/wiki/Munching_squares\nnote: Raster graphics operations\n", "language": "00-META" }, { "code": "Render a graphical pattern where each pixel is colored by the value of 'x xor y' from an arbitrary [[wp:color table|color tab...
Munching-squares
[ { "code": "---\ncategory:\n- Temporal media\nfrom: http://rosettacode.org/wiki/Musical_scale\n", "language": "00-META" }, { "code": ";Task:\nOutput the 8 notes of the <b>C major</b> diatonic scale to the default musical sound device on the system. Specifically, pitch must be tuned to 12-tone equal t...
Musical-scale
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Mutual_recursion\nnote: recursion\n", "language": "00-META" }, { "code": "Two functions are said to be mutually recursive if the first calls the second, \nand in turn the second calls the first.\n\nWrite two mutually recursive functions that compute ...
Mutual-recursion
[ { "code": "---\nfrom: http://rosettacode.org/wiki/N-queens_problem\n", "language": "00-META" }, { "code": "Solve the [[WP:Eight_queens_puzzle|eight queens puzzle]]. \n\n\nYou can extend the problem to solve the puzzle with a board of size &nbsp; <big>'''N'''x'''N'''</big>.\n \nFor the number of solu...
N-queens-problem
[ { "code": "---\nfrom: http://rosettacode.org/wiki/N-smooth_numbers\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "'''n-smooth''' &nbsp; numbers are positive integers which have no prime factors <big> &gt; </big> '''n'''.\n\nThe &nbsp; '''n''' &nbsp; in the expression &nbsp; '''n-smooth...
N-smooth-numbers
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Naming_conventions\nnote: Programming environment operations\n", "language": "00-META" }, { "code": "Many languages have naming conventions regarding the identifiers used in the language, its libraries, and programs written in th...
Naming-conventions
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Narcissist\n", "language": "00-META" }, { "code": "Quoting from the [http://esolangs.org/wiki/Narcissist Esolangs wiki page]:\n\n<blockquote>\nA '''narcissist''' (or '''Narcissus program''') is the decision-problem version of a [[quine]].\n</blockquo...
Narcissist
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Narcissistic_decimal_number\n", "language": "00-META" }, { "code": "A &nbsp; [http://mathworld.wolfram.com/NarcissisticNumber.html Narcissistic decimal number] &nbsp; is a non-negative integer, &nbsp; <math>n</math>, &nbsp; that is equal to the sum o...
Narcissistic-decimal-number
[ { "code": "---\ncategory:\n- Date and time\nfrom: http://rosettacode.org/wiki/Nautical_bell\n", "language": "00-META" }, { "code": ";Task\n\nWrite a small program that emulates a [[wp:Ship's bell#Timing_of_duty_periods|nautical bell]] producing a ringing bell pattern at certain times throughout the ...
Nautical-bell
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Negative_base_numbers\n", "language": "00-META" }, { "code": "Negative base numbers are an alternate way to encode numbers without the need for a minus sign. Various negative bases may be used including negadecimal (base -10), negabinary (-2) and neg...
Negative-base-numbers
[ { "code": "---\ncategory:\n- Scope\n- Functions and subroutines\nfrom: http://rosettacode.org/wiki/Nested_function\n", "language": "00-META" }, { "code": "In many languages, functions can be nested, resulting in outer functions and inner functions. The inner function can access variables from the ou...
Nested-function
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Next_highest_int_from_digits\n", "language": "00-META" }, { "code": "Given a zero or positive integer, the task is to generate the next largest\ninteger using only the given digits<sup>*1</sup>.\n\n* &nbsp; Numbers will not be padded to the left with...
Next-highest-int-from-digits
[ { "code": "---\ncategory:\n- Puzzles\n- Games\nfrom: http://rosettacode.org/wiki/Nim_game\n", "language": "00-META" }, { "code": "Nim is a simple game where the second player─if they know the trick─will always win.\n\n\nThe game has only 3 rules:\n::* &nbsp; start with &nbsp; '''12''' &nbsp; tokens\...
Nim-game
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Non-continuous_subsequences\nnote: Discrete math\n", "language": "00-META" }, { "code": "Consider some sequence of elements. (It differs from a mere set of elements by having an ordering among members.)\n\nA ''subsequence'' contains some subset of th...
Non-continuous-subsequences
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Non-decimal_radices/Input\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": "It is common to have a string containing a number written in some format, with the most common ones being decimal, hexadecimal, octal and binary. Such stri...
Non-decimal-radices-Input
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Non-decimal_radices/Output\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": "Programming languages often have built-in routines to convert a non-negative integer for printing in different number bases. Such common number bases migh...
Non-decimal-radices-Output
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Non-transitive_dice\n", "language": "00-META" }, { "code": "Let our dice select numbers on their faces with equal probability, i.e. fair dice.\nDice may have more or less than six faces. (The possibility of there being a \n3D physical shape that has ...
Non-transitive-dice
[ { "code": "---\ncategory:\n- Puzzles\nfrom: http://rosettacode.org/wiki/Nonogram_solver\n", "language": "00-META" }, { "code": "A [[wp:Nonogram|nonogram]] is a puzzle that provides \nnumeric clues used to fill in a grid of cells, \nestablishing for each cell whether it is filled or not. \nThe puzzle...
Nonogram-solver
[ { "code": "---\ncategory:\n- String manipulation\nfrom: http://rosettacode.org/wiki/N'th\nnote: Ordinal numbers\n", "language": "00-META" }, { "code": "Write a function/method/subroutine/... that when given an integer greater than or equal to zero returns a string of the number followed by an apostr...
Nth
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Nth_root\nnote: Classic CS problems and programs\n", "language": "00-META" }, { "code": ";Task:\nImplement the algorithm to compute the principal &nbsp; [[wp:Nth root|<big>''n''<sup>th</sup></big> &nbsp; root]] &nbsp; <big><big><...
Nth-root
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Number_names\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": ";Task:\nShow how to spell out a number in English. \n\nYou can use a preexisting implementation or roll your own, but you should support inputs up to at least one milli...
Number-names
[ { "code": "---\ncategory:\n- Puzzles\nfrom: http://rosettacode.org/wiki/Number_reversal_game\nnote: Games\n", "language": "00-META" }, { "code": ";Task:\nGiven a jumbled list of the numbers &nbsp; '''1''' &nbsp; to &nbsp; '''9''' &nbsp; that are definitely &nbsp; ''not'' &nbsp; in \nascending order....
Number-reversal-game
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Numbers_which_are_not_the_sum_of_distinct_squares\n", "language": "00-META" }, { "code": "Integer squares are the set of integers multiplied by themselves: 1 x 1 = '''1''', 2 × 2 = '''4''', 3 × 3 = '''9''', etc. ( 1, 4, 9, 16 ... )\n\nMost positive i...
Numbers-which-are-not-the-sum-of-distinct-squares
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Numbers_with_equal_rises_and_falls\n", "language": "00-META" }, { "code": "When a number is written in base 10, &nbsp; adjacent digits may \"rise\" or \"fall\" as the number is read &nbsp; (usually from left to right).\n\n\n;Definition:\nGiven the de...
Numbers-with-equal-rises-and-falls
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Numeric_error_propagation\n", "language": "00-META" }, { "code": "If &nbsp; '''f''', &nbsp; '''a''', &nbsp; and &nbsp; '''b''' &nbsp; are values with uncertainties &nbsp; σ<sub>f</sub>, &nbsp; σ<sub>a</sub>, &nbsp; and &nbsp; σ<sub>b</sub>, &nbsp; an...
Numeric-error-propagation
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Numerical_and_alphabetical_suffixes\n", "language": "00-META" }, { "code": "This task is about expressing numbers with an attached (abutted) suffix multiplier(s), &nbsp; the suffix(es) could be:\n::* &nbsp; an alphabetic (named) multiplier which coul...
Numerical-and-alphabetical-suffixes
[ { "code": "---\ncategory:\n- Arithmetic\n- Mathematics\nfrom: http://rosettacode.org/wiki/Numerical_integration/Gauss-Legendre_Quadrature\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": "{|border=1 cellspacing=0 cellpadding=3\n|In a general [[wp:Gaussian quadrature|Gaussian quadr...
Numerical-integration-Gauss-Legendre-Quadrature
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Object_serialization\nnote: Object oriented\n", "language": "00-META" }, { "code": "Create a set of data types based upon [[inheritance]]. Each data type or class should have a print command that displays the contents of an instance of that class to ...
Object-serialization
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Odd_word_problem\n", "language": "00-META" }, { "code": ";Task:\nWrite a program that solves the [http://c2.com/cgi/wiki?OddWordProblem odd word problem] with the restrictions given below.\n\n\n;Description:\nYou are promised an input stream consisti...
Odd-word-problem
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Old_Russian_measure_of_length\n", "language": "00-META" }, { "code": ";Task:\nWrite a program to perform a conversion of the old Russian measures of length to the metric system &nbsp; (and vice versa).\n\n\nIt is an example of a linear transformation...
Old-Russian-measure-of-length
[ { "code": "---\nfrom: http://rosettacode.org/wiki/OLE_automation\nnote: OLE Automation Client and Server\n", "language": "00-META" }, { "code": "[http://en.wikipedia.org/wiki/OLE_Automation OLE Automation] &nbsp; is an inter-process communication mechanism based on &nbsp; [http://en.wikipedia.org/wi...
OLE-automation
[ { "code": "---\ncategory:\n- Cellular automata\nfrom: http://rosettacode.org/wiki/One-dimensional_cellular_automata\nnote: Games\n", "language": "00-META" }, { "code": "Assume an array of cells with an initial distribution of live and dead cells, \nand imaginary cells off the end of the array having...
One-dimensional-cellular-automata
[ { "code": "---\ncategory:\n- Encryption\n- File_handling\nfrom: http://rosettacode.org/wiki/One-time_pad\n", "language": "00-META" }, { "code": "Implement a [[wp:One-time pad|One-time pad]], for encrypting and decrypting messages.<br>\nTo keep it simple, we will be using letters only.\n\n;Sub-Tasks:...
One-time-pad
[ { "code": "---\ncategory:\n- GUI\n- Temporal media\nfrom: http://rosettacode.org/wiki/OpenGL\nnote: 3D\nrequires:\n- Graphics\n", "language": "00-META" }, { "code": ";Task:\nDisplay a smooth shaded triangle with OpenGL.\n\n[[image:Triangle.png|right|thumb|300px|Triangle created using C example compi...
OpenGL
[ { "code": "---\nfrom: http://rosettacode.org/wiki/OpenWebNet_password\n", "language": "00-META" }, { "code": "Calculate the password requested by ethernet gateways from the Legrand / Bticino MyHome OpenWebNet home automation system when the user's ip address is not in the gateway's whitelist\n\n'''N...
OpenWebNet-password
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Optional_parameters\nnote: Basic language learning\n", "language": "00-META" }, { "code": ";Task:\nDefine a function/method/subroutine which sorts a sequence (\"table\") of sequences (\"rows\") of strings (\"cells\"), by one of the strings. Besides t...
Optional-parameters
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Order_by_pair_comparisons\nnote: Sorting Algorithms\n", "language": "00-META" }, { "code": "{{Sorting Algorithm}}\n[[Category:Sorting]]\n\nAssume we have a set of items that can be sorted into an order by the user.\n\nThe user is presented with pairs...
Order-by-pair-comparisons
[ { "code": "---\ncategory:\n- Sorting\nfrom: http://rosettacode.org/wiki/Order_disjoint_list_items\nnote: Sorting Algorithms\n", "language": "00-META" }, { "code": "{{Sorting Algorithm}}\n\nGiven &nbsp; <code>M</code> &nbsp; as a list of items and another list &nbsp; <code>N</code> &nbsp; of items ch...
Order-disjoint-list-items
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Ordered_partitions\nnote: Discrete math\n", "language": "00-META" }, { "code": "In this task we want to find the ordered partitions into fixed-size blocks. \n\nThis task is related to [[Combinations]] in that it has to do with discrete mathematics an...
Ordered-partitions
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Ordered_words\nnote: text processing\n", "language": "00-META" }, { "code": "An &nbsp; ''ordered word'' &nbsp; is a word in which the letters appear in alphabetic order. \n\nExamples include &nbsp; '''abbey''' &nbsp; and &nbsp; '''dirt'''. \n\n{{task...
Ordered-words
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Ormiston_triples\n", "language": "00-META" }, { "code": ";Definition\nAn '''Ormiston triple''' is three consecutive prime numbers which are anagrams, i.e. contain the same decimal digits but in a different order.\n\n;Example\nThe three consecutive pr...
Ormiston-triples
[ { "code": "---\nfrom: http://rosettacode.org/wiki/P-Adic_numbers,_basic\nnote: mathematics\n", "language": "00-META" }, { "code": ";Conversion and addition of [[wp:P-adic_number|p-adic Numbers]].\n\n\n;Task.\n\nConvert two rationals to p-adic numbers and add them up.\nRational reconstruction is need...
P-Adic-numbers-basic
[ { "code": "---\nfrom: http://rosettacode.org/wiki/P-Adic_square_roots\nnote: mathematics\n", "language": "00-META" }, { "code": ";Task.\n\nConvert rational a/b to its approximate [[wp:Hensel%27s_lemma#Hensel's_lemma_for_p-adic_numbers|p-adic square root]]. To check the result,\nsquare the root and c...
P-Adic-square-roots
[ { "code": "---\nfrom: http://rosettacode.org/wiki/P-value_correction\nnote: Probability and statistics\n", "language": "00-META" }, { "code": "Given a list of [[wp:p-value|p-values]], adjust the p-values for multiple comparisons. This is done in order to control the false positive, or Type 1 error r...
P-value-correction
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Padovan_sequence\n", "language": "00-META" }, { "code": "The [[wp:Padovan sequence|Padovan sequence]] is similar to the [[wp:Fibonacci sequence|Fibonacci sequence]] in several ways.\nSome are given in the table below, and the referenced video shows s...
Padovan-sequence
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Palindrome_dates\n", "language": "00-META" }, { "code": "Today &nbsp; ('''2020-02-02''', &nbsp; at the time of this writing) &nbsp; happens to be a palindrome, &nbsp; without the hyphens, &nbsp; not only for those countries which express their dates ...
Palindrome-dates
[ { "code": "---\ncategory:\n- Recursion\n- String manipulation\n- Classic CS problems and programs\n- Palindromes\nfrom: http://rosettacode.org/wiki/Palindrome_detection\nnote: Text processing\n", "language": "00-META" }, { "code": "A [[wp:Palindrome|palindrome]] is a phrase which reads the same back...
Palindrome-detection
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pancake_numbers\n", "language": "00-META" }, { "code": "Adrian Monk has problems and an assistant, Sharona Fleming. Sharona can deal with most of Adrian's problems except his lack of punctuality paying her remuneration. 2 pay checks down and she pre...
Pancake-numbers
[ { "code": "---\ncategory:\n- String manipulation\nfrom: http://rosettacode.org/wiki/Pangram_checker\n", "language": "00-META" }, { "code": "A pangram is a sentence that contains all the letters of the English alphabet at least once.\n\nFor example: &nbsp; ''The quick brown fox jumps over the lazy do...
Pangram-checker
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Paraffins\n", "language": "00-META" }, { "code": "This organic chemistry task is essentially to implement a tree enumeration algorithm.\n\n\n;Task:\nEnumerate, without repetitions and in order of increasing size, all possible paraffin molecules (also...
Paraffins
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Parallel_calculations\nnote: Control Structures\n", "language": "00-META" }, { "code": "Many programming languages allow you to specify computations to be run in parallel. \nWhile [[Concurrent computing]] is focused on concurrency, \nthe purpose of t...
Parallel-calculations
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Parameterized_SQL_statement\nnote: Database operations\n", "language": "00-META" }, { "code": "Parameterized SQL statements are an easy way to avoid [[wp:SQL injection|SQL injection]] attacks. SQL drivers and libraries will automatically \"sanitize\"...
Parameterized-SQL-statement
[ { "code": "---\ncategory:\n- Type System\nfrom: http://rosettacode.org/wiki/Parametric_polymorphism\nnote: Basic language learning\n", "language": "00-META" }, { "code": "[[wp:Parametric Polymorphism|Parametric Polymorphism]] is a way to define types or functions that are generic over other types. T...
Parametric-polymorphism
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Parsing/RPN_calculator_algorithm\n", "language": "00-META" }, { "code": ";Task:\nCreate a stack-based evaluator for an expression in &nbsp; [[wp:Reverse Polish notation|<u>r</u>everse <u>P</u>olish <u>n</u>otation (RPN)]] &nbsp; that also shows the c...
Parsing-RPN-calculator-algorithm
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Parsing/RPN_to_infix_conversion\n", "language": "00-META" }, { "code": ";Task:\nCreate a program that takes an [[wp:Reverse Polish notation|RPN]] representation of an expression formatted as a space separated sequence of tokens and generates the equi...
Parsing-RPN-to-infix-conversion
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Parsing/Shunting-yard_algorithm\n", "language": "00-META" }, { "code": ";Task:\nGiven the operator characteristics and input from the [[wp:Shunting-yard_algorithm|Shunting-yard algorithm]] page and tables, use the algorithm to show the changes in the...
Parsing-Shunting-yard-algorithm
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Particle_fountain\n", "language": "00-META" }, { "code": "Implement a particle fountain.\n\nEmulate a fountain of water droplets in a gravitational field being sprayed up and then falling back down.\n\nThe particle fountain should be generally ordere...
Particle-fountain
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Partition_an_integer_x_into_n_primes\nnote: Prime Numbers\n", "language": "00-META" }, { "code": ";Task:\nPartition a positive integer &nbsp; '''X''' &nbsp; into &nbsp; '''N''' &nbsp; distinct primes. \n\n\nOr, to put it in another way:\n\nFind &nbsp...
Partition-an-integer-x-into-n-primes
[ { "code": "---\ncategory:\n- Memoization\nfrom: http://rosettacode.org/wiki/Partition_function_P\nnote: Recursion\n", "language": "00-META" }, { "code": "The [https://mathworld.wolfram.com/PartitionFunctionP.html Partition Function P] is the function P(n), where n∈ℤ, defined as the number of distinc...
Partition-function-P
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pascal's_triangle\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": "[[wp:Pascal's triangle|Pascal's triangle]] is an arithmetic and geometric figure often associated with the name of [[wp:Blaise Pascal|Blaise Pascal]], but also stu...
Pascals-triangle
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pascal's_triangle/Puzzle\n", "language": "00-META" }, { "code": "This puzzle involves a [http://xunor.free.fr/en/riddles/auto/pyramidnb.php Pascals Triangle], also known as a [http://xunor.free.fr/en/riddles/auto/pyramidnb.php Pyramid of Numbers].\n<...
Pascals-triangle-Puzzle
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Password_generator\n", "language": "00-META" }, { "code": "Create a password generation program which will generate passwords containing random ASCII characters from the following groups:\n lower-case letters: a ──► z\n upper-case ...
Password-generator
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Peaceful_chess_queen_armies\n", "language": "00-META" }, { "code": "In chess, a queen attacks positions from where it is, in straight lines up-down and left-right as well as on both its diagonals. It attacks only pieces ''not'' of its own colour.\n<b...
Peaceful-chess-queen-armies
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Peano_curve\nnote: Fractals\n", "language": "00-META" }, { "code": "<br/>\n;Task\n\nProduce a graphical or ASCII-art representation of a [[wp:Peano curve|Peano curve]] of at least order 3.\n\n", "language": "00-TASK" }, { "code": "DEFINE ...
Peano-curve
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pell_numbers\n", "language": "00-META" }, { "code": "'''Pell numbers''' are an infinite sequence of integers that comprise the denominators of the closest rational approximations to the square root of 2 but have many other interesting uses and relati...
Pell-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Penney's_game\nnote: Games\n", "language": "00-META" }, { "code": "[[wp:Penney's_game|Penney's game]] is a game where two players bet on being the first to see a particular sequence of [[wp:Coin_flipping|heads or tails]] in consecutive tosses of a [[...
Penneys-game
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pentagram\n", "language": "00-META" }, { "code": "A [[wp:pentagram|pentagram]] is a star polygon, consisting of a central pentagon of which each side forms the base of an isosceles triangle. The vertex of each triangle, a point of the star, is 36 deg...
Pentagram
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pentomino_tiling\n", "language": "00-META" }, { "code": "A [[wp:Pentomino|pentomino]] is a polyomino that consists of 5 squares. There are 12 pentomino shapes, \nif you don't count rotations and reflections. Most pentominoes can form their own mirror...
Pentomino-tiling
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Percolation/Bond_percolation\nnote: Percolation Simulations\n", "language": "00-META" }, { "code": "{{Percolation Simulation}}\nGiven an <math>M \\times N</math> rectangular array of cells numbered <math>\\mathrm{cell}[0..M-1, 0..N-1]</math>, assume ...
Percolation-Bond-percolation