solutions
listlengths
2
791
task_name
stringlengths
2
86
[ { "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
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Percolation/Mean_cluster_density\nnote: Percolation Simulations\n", "language": "00-META" }, { "code": "{{Percolation Simulation}}\nLet <math>c</math> be a 2D boolean square matrix of <math>n \\times n</math> values of either <tt>1</tt> or <tt>0</tt>...
Percolation-Mean-cluster-density
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Percolation/Mean_run_density\nnote: Percolation Simulations\n", "language": "00-META" }, { "code": "{{Percolation Simulation}}\nLet <math>v</math> be a vector of <math>n</math> values of either <tt>1</tt> or <tt>0</tt> where the probability of any \n...
Percolation-Mean-run-density
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Perfect_numbers\n", "language": "00-META" }, { "code": "[[category:Discrete math]]\n{{task|Prime Numbers}}\n\nWrite a function which says whether a number is perfect.\n\n<br>\n[[wp:Perfect_numbers|A perfect number]] is a positive integer that is the ...
Perfect-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Perfect_shuffle\n", "language": "00-META" }, { "code": "A perfect shuffle (or [https://en.wikipedia.org/wiki/Faro_shuffle faro/weave shuffle]) means splitting a deck of cards into equal halves, and perfectly interleaving them - so that you end up wit...
Perfect-shuffle
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Perfect_totient_numbers\n", "language": "00-META" }, { "code": "Generate and show here, the first twenty [https://en.wikipedia.org/wiki/Perfect_totient_number Perfect totient numbers].\n\n\n;Related task:\n::* &nbsp; [[Totient function]]\n\n\n;Also s...
Perfect-totient-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Peripheral_drift_illusion\n", "language": "00-META" }, { "code": ";Task\nGenerate and display a Peripheral Drift Illusion\n\nThe image appears to be moving even though it is perfectly static.\n\nProvide a link to show the output, either by running th...
Peripheral-drift-illusion
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Perlin_noise\n", "language": "00-META" }, { "code": "The '''[[wp:Perlin noise|Perlin noise]]''' is a kind of [[wp:gradient noise|gradient noise]] invented by [[wp:Ken Perlin|Ken Perlin]] around the end of the twentieth century and still currently hea...
Perlin-noise
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Permutation_test\nnote: Probability and statistics\n", "language": "00-META" }, { "code": "A new medical treatment was tested on a population of <math>n + m</math>\nvolunteers, with each volunteer randomly assigned either to a group of\n<math>n</math...
Permutation-test
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Permutations_by_swapping\n", "language": "00-META" }, { "code": ";Task:\nGenerate permutations of n items in which successive permutations differ from each other by the swapping of any two items. \n\nAlso generate the sign of the permutation which is...
Permutations-by-swapping
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Permutations/Derangements\n", "language": "00-META" }, { "code": "A [http://mathworld.wolfram.com/Derangement.html derangement] is a permutation of the order of distinct items in which ''no item appears in its original place''.\n\nFor example, the on...
Permutations-Derangements
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Permutations/Rank_of_a_permutation\n", "language": "00-META" }, { "code": "A particular ranking of a permutation associates an integer with a particular ordering of all the permutations of a set of distinct items. \nFor our purposes the ranking will ...
Permutations-Rank-of-a-permutation
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Phrase_reversals\n", "language": "00-META" }, { "code": ";Task:\nGiven a string of space separated words containing the following phrase:\n rosetta code phrase reversal\n\n:# Reverse the characters of the string.\n:# Reverse the characters of each i...
Phrase-reversals
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pi\nnote: Irrational numbers\n", "language": "00-META" }, { "code": "Create a program to continually calculate and output the next decimal digit of &nbsp; <big><big><math>\\pi</math></big></big> &nbsp; (pi). \n\nThe program should continue forever (u...
Pi
[ { "code": "---\ncategory:\n- Randomness\nfrom: http://rosettacode.org/wiki/Pick_random_element\nnote: Basic language learning\n", "language": "00-META" }, { "code": "Demonstrate how to pick a random element from a list.\n<br><br>\n\n", "language": "00-TASK" }, { "code": "print(random:cho...
Pick-random-element
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pig_the_dice_game\n", "language": "00-META" }, { "code": "The &nbsp; [[wp:Pig (dice)|game of Pig]] &nbsp; is a multiplayer game played with a single six-sided die. &nbsp; The\nobject of the game is to reach &nbsp; '''100''' &nbsp; points or more. &nb...
Pig-the-dice-game
[ { "code": "---\ncategory:\n- Games\nfrom: http://rosettacode.org/wiki/Pig_the_dice_game/Player\n", "language": "00-META" }, { "code": ";Task:\nCreate a dice simulator and scorer of [[Pig the dice game]] and add to it the ability to play the game to at least one strategy.\n* State here the play strat...
Pig-the-dice-game-Player
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Pinstripe/Display\nnote: Test card\n", "language": "00-META" }, { "code": "The task is to demonstrate the creation of a series of vertical pinstripes across '''the entire width of the display'''. \n* in the first quarter the pinstripes should alterna...
Pinstripe-Display
[ { "code": "---\ncategory:\n- Mathematics\nfrom: http://rosettacode.org/wiki/Pisano_period\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The [[wp:Fibonacci_Number|Fibonacci sequence]] taken modulo 2 is a periodic sequence of period 3 : 0, 1, 1, 0, 1, 1, ... \n\nFor any integer n, the F...
Pisano-period
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Plasma_effect\n", "language": "00-META" }, { "code": "The [[wp:Plasma_effect|plasma effect]] is a visual effect created by applying various functions, notably sine and cosine, to the color values of screen pixels. When animated (not a task requiremen...
Plasma-effect
[ { "code": "---\ncategory:\n- Games\nfrom: http://rosettacode.org/wiki/Play_recorded_sounds\nnote: Temporal media\nrequires:\n- Sound\n", "language": "00-META" }, { "code": "Load at least two prerecorded sounds, and demonstrate as many of these features as you can:\n* playing them individually and si...
Play-recorded-sounds