solutions
listlengths
2
791
task_name
stringlengths
2
86
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Stirling_numbers_of_the_first_kind\n", "language": "00-META" }, { "code": "Stirling numbers of the first kind, or Stirling cycle numbers, count permutations according to their number\nof cycles (counting fixed points as cycles of length one).\n\nThey...
Stirling-numbers-of-the-first-kind
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Stirling_numbers_of_the_second_kind\n", "language": "00-META" }, { "code": "Stirling numbers of the second kind, or Stirling partition numbers, are the\nnumber of ways to partition a set of n objects into k non-empty subsets. They are\nclosely relate...
Stirling-numbers-of-the-second-kind
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Straddling_checkerboard\nnote: Encryption\n", "language": "00-META" }, { "code": ";Task:\nImplement functions to encrypt and decrypt a message using the [[wp:Straddling_checkerboard|straddling checkerboard]] method. The checkerboard should take a 28 ...
Straddling-checkerboard
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Stream_merge\n", "language": "00-META" }, { "code": "; 2-stream merge\n: Read two sorted streams of items from external source (e.g. disk, or network), and write one stream of sorted items to external sink.\n: Common algorithm: keep 1 buffered item f...
Stream-merge
[ { "code": "---\ncategory:\n- String manipulation\n- String manipulation\nfrom: http://rosettacode.org/wiki/String_append\nnote: Basic language learning\n", "language": "00-META" }, { "code": "{{basic data operation}} \n[[Category:Simple]]\n\nMost languages provide a way to concatenate two string val...
String-append
[ { "code": "---\nfrom: http://rosettacode.org/wiki/String_case\nnote: String manipulation\n", "language": "00-META" }, { "code": ";Task:\nTake the string     '''alphaBETA'''     and demonstrate how to convert it to:\n:::*   upper-case     and \n:::*   lower-cas...
String-case
[ { "code": "---\ncategory:\n- String manipulation\n- String manipulation\nfrom: http://rosettacode.org/wiki/String_concatenation\n", "language": "00-META" }, { "code": "{{basic data operation}}\n[[Category:Simple]]\n\n{{task|Basic language learning}}\n\n;Task:\nCreate a string variable equal to any t...
String-concatenation
[ { "code": "---\ncategory:\n- String manipulation\n- Simple\n- Strings\nfrom: http://rosettacode.org/wiki/String_interpolation_(included)\nnote: Basic language learning\n", "language": "00-META" }, { "code": "{{basic data operation}}\n{{omit from|NSIS}}\n{{omit from|BBC BASIC}}\n\nGiven a string and ...
String-interpolation-included-
[ { "code": "---\ncategory:\n- String manipulation\nfrom: http://rosettacode.org/wiki/String_length\nnote: Basic language learning\n", "language": "00-META" }, { "code": ";Task:\nFind the <em>character</em> and <em>byte</em> length of a string.\n \nThis means encodings like [[UTF-8]] need to be handle...
String-length
[ { "code": "---\nfrom: http://rosettacode.org/wiki/String_prepend\nnote: Basic language learning\n", "language": "00-META" }, { "code": "{{basic data operation}}\n[[Category:String manipulation]] \n[[Category: String manipulation]] \n[[Category:Simple]] \n{{omit from|bc|No string operations in bc}}\n...
String-prepend
[ { "code": "---\ncategory:\n- Strings\nfrom: http://rosettacode.org/wiki/Strip_a_set_of_characters_from_a_string\nnote: String manipulation\n", "language": "00-META" }, { "code": ";Task:\nCreate a function that strips a set of characters from a string. \n\n\nThe function should take two arguments: \n...
Strip-a-set-of-characters-from-a-string
[ { "code": "---\ncategory:\n- String manipulation\n- Strings\nfrom: http://rosettacode.org/wiki/Strip_block_comments\nnote: Text processing\n", "language": "00-META" }, { "code": "A block comment begins with a &nbsp; ''beginning delimiter'' &nbsp; and ends with a &nbsp; ''ending delimiter'', &nbsp; i...
Strip-block-comments
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Strip_control_codes_and_extended_characters_from_a_string\n", "language": "00-META" }, { "code": ";Task:\nStrip control codes and extended characters from a string. \n\n\nThe solution should demonstrate how to achieve each of the following results:\n...
Strip-control-codes-and-extended-characters-from-a-string
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Strip_whitespace_from_a_string/Top_and_tail\nnote: String manipulation\n", "language": "00-META" }, { "code": ";Task:\nDemonstrate how to strip leading and trailing whitespace from a string. \n\nThe solution should demonstrate how to achieve the foll...
Strip-whitespace-from-a-string-Top-and-tail
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Strong_and_weak_primes\nnote: Prime Numbers\n", "language": "00-META" }, { "code": ";Definitions &nbsp; (as per number theory):\n::* &nbsp; The &nbsp; '''prime(''p'')''' &nbsp; is the &nbsp; ''' ''p''<sup>th</sup> &nbsp; prime.\n:::::* &nbsp; '''prim...
Strong-and-weak-primes
[ { "code": "---\ncategory:\n- String manipulation\nfrom: http://rosettacode.org/wiki/Substitution_cipher\nnote: Encryption\n", "language": "00-META" }, { "code": "Substitution Cipher Implementation - File Encryption/Decryption\n\n\n;Task:\nEncrypt an input/source file by replacing every upper/lower c...
Substitution-cipher
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Substring\nnote: Basic language learning\n", "language": "00-META" }, { "code": "{{basic data operation}} \n[[Category:String manipulation]]\n[[Category:Simple]]\n[[Category:Strings]]\n\n\n;Task:\nDisplay a substring:\n:* &nbsp; starting from &nbsp; ...
Substring
[ { "code": "---\ncategory:\n- String manipulation\nfrom: http://rosettacode.org/wiki/Substring/Top_and_tail\n", "language": "00-META" }, { "code": "The task is to demonstrate how to remove the first and last characters from a string. \n\nThe solution should demonstrate how to obtain the following res...
Substring-Top-and-tail
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Successive_prime_differences\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The series of increasing prime numbers begins: <code>2, 3, 5, 7, 11, 13, 17, 19, 23, 29, ...</code>\n\nThe task applies a filter to the series returning groups ...
Successive-prime-differences
[ { "code": "---\ncategory:\n- Memoization\n- Classic CS problems and programs\nfrom: http://rosettacode.org/wiki/Sudan_function\nnote: Recursion\n", "language": "00-META" }, { "code": "The '''[[wp:Sudan function|Sudan function]]''' is a classic example of a recursive function, notable especially beca...
Sudan-function
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sudoku\nnote: Games\n", "language": "00-META" }, { "code": ";Task:\nSolve a partially filled-in normal &nbsp; 9x9 &nbsp; [[wp:Sudoku|Sudoku]] grid &nbsp; and display the result in a human-readable format. \n\n;references:\n* [[wp:Algorithmics_of_sudo...
Sudoku
[ { "code": "---\ncategory:\n- Iteration\nfrom: http://rosettacode.org/wiki/Sum_and_product_of_an_array\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": ";Task:\nCompute the sum and product of an array of integers.\n<br><br>\n\n", "language": "00-TASK" }, { "code": "V ar...
Sum-and-product-of-an-array
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sum_and_product_puzzle\n", "language": "00-META" }, { "code": ";Task:\nSolve the \"<i>Impossible Puzzle</i>\":\n\n{{quote|\nX and Y are two different whole numbers greater than 1. Their sum is no greater than 100, and Y is greater than X. S and P are...
Sum-and-product-puzzle
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sum_digits_of_an_integer\n", "language": "00-META" }, { "code": ";Task:\nTake a &nbsp; [[wp:Natural_number|Natural Number]] &nbsp; in a given base and return the sum of its digits:\n:* &nbsp; '''1'''<sub>10</sub> &nbsp; &nbsp; &nbsp; &nbsp; ...
Sum-digits-of-an-integer
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sum_of_a_series\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": "Compute the &nbsp; '''n'''<sup>th</sup> &nbsp; term of a [[wp:Series (mathematics)|series]], &nbsp; i.e. the sum of the &nbsp; '''n''' &nbsp; first terms of the cor...
Sum-of-a-series
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sum_of_elements_below_main_diagonal_of_matrix\n", "language": "00-META" }, { "code": ";Task:\nFind and display the sum of elements that are below the main diagonal of a matrix.\n\nThe matrix should be a square matrix.\n\n\n::: ─── &nbsp; Matrix to be...
Sum-of-elements-below-main-diagonal-of-matrix
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sum_of_squares\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": ";Task:\nWrite a program to find the sum of squares of a numeric vector. \n\nThe program should work on a zero-length vector (with an answer of &nbsp; '''0''').\n\n\n;...
Sum-of-squares
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Summarize_and_say_sequence\n", "language": "00-META" }, { "code": "There are several ways to generate a self-referential sequence. One very common one (the [[Look-and-say sequence]]) is to start with a positive integer, then generate the next term by...
Summarize-and-say-sequence
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Summarize_primes\n", "language": "00-META" }, { "code": ";Task:\n\nConsidering in order of length, n, all sequences of consecutive\nprimes, p, from 2 onwards, where p < 1000 and n>0, select those\nsequences whose sum is prime, and for these display t...
Summarize-primes
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Super-d_numbers\n", "language": "00-META" }, { "code": "A super-d number is a positive, decimal (base ten) integer &nbsp; '''n''' &nbsp; such that &nbsp; '''d × n<sup>d</sup>''' &nbsp; has at least &nbsp; '''d''' &nbsp; consecutive digits &nbsp; '''d...
Super-d-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Superpermutation_minimisation\n", "language": "00-META" }, { "code": "A superpermutation of N different characters is a string consisting of an arrangement of multiple copies of those N different characters in which every permutation of those charact...
Superpermutation-minimisation
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sutherland-Hodgman_polygon_clipping\nnote: Graphics algorithms\n", "language": "00-META" }, { "code": "The &nbsp; [[wp:Sutherland-Hodgman clipping algorithm|Sutherland-Hodgman clipping algorithm]] &nbsp; finds the polygon that is the intersection bet...
Sutherland-Hodgman-polygon-clipping
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Sylvester's_sequence\n", "language": "00-META" }, { "code": "In number theory, '''Sylvester's sequence''' is an integer sequence in which each term of the sequence is the product of the previous terms, plus one.\n\nIts values grow doubly exponential...
Sylvesters-sequence
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Synchronous_concurrency\nnote: Concurrency\nrequires:\n- Concurrency\n", "language": "00-META" }, { "code": "The goal of this task is to create two concurrent activities (\"[[Thread|Threads]]\" or \"Tasks\", not [[Process|processes]].) that share dat...
Synchronous-concurrency
[ { "code": "---\ncategory:\n- Date and time\n- Simple\nfrom: http://rosettacode.org/wiki/System_time\nnote: Programming environment operations\n", "language": "00-META" }, { "code": ";Task:\nOutput the system '''time''' &nbsp; (any units will do as long as they are noted) either by a [[Execute a Syst...
System-time
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Table_creation/Postal_addresses\nnote: Database operations\n", "language": "00-META" }, { "code": ";Task:\nCreate a table to store addresses. \n\nYou may assume that all the addresses to be stored will be located in the USA. &nbsp; As such, you will ...
Table-creation-Postal-addresses
[ { "code": "---\ncategory:\n- Algorithm\nfrom: http://rosettacode.org/wiki/Tarjan\n", "language": "00-META" }, { "code": "Tarjan's algorithm is an algorithm in graph theory for finding the strongly connected components of a graph. \n\nIt runs in linear time, matching the time bound for alternative me...
Tarjan
[ { "code": "---\ncategory:\n- Mathematics\nfrom: http://rosettacode.org/wiki/Tau_function\n", "language": "00-META" }, { "code": "Given a positive integer, count the number of its positive divisors.\n\n\n;Task\nShow the result for the first &nbsp; '''100''' &nbsp; positive integers.\n\n\n;Related tas...
Tau-function
[ { "code": "---\ncategory:\n- Mathematics\nfrom: http://rosettacode.org/wiki/Tau_number\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "A [[wp:Refactorable_number|Tau number]] is a positive integer divisible by the count of its positive divisors.\n\n\n;Task\nShow the first &nbsp; '''100'...
Tau-number
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Teacup_rim_text\n", "language": "00-META" }, { "code": "On a set of coasters we have, there's a picture of a teacup. &nbsp; On the rim of the teacup the word &nbsp; '''TEA''' &nbsp; appears a number of times separated by bullet characters &nbsp; (&bu...
Teacup-rim-text
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Temperature_conversion\n", "language": "00-META" }, { "code": "There are quite a number of temperature scales. For this task we will concentrate on four of the perhaps best-known ones: \n[[wp:Kelvin|Kelvin]], [[wp:Degree Celsius|Celsius]], [[wp:Fahre...
Temperature-conversion
[ { "code": "---\ncategory:\n- Initialization\nfrom: http://rosettacode.org/wiki/Terminal_control/Clear_the_screen\nnote: Terminal control\n", "language": "00-META" }, { "code": ";Task:\nClear the terminal window.\n<br><br>\n\n", "language": "00-TASK" }, { "code": "os:(‘clear’)\n", "la...
Terminal-control-Clear-the-screen
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Terminal_control/Cursor_movement\nnote: Terminal control\n", "language": "00-META" }, { "code": ";Task:\nDemonstrate how to achieve movement of the terminal cursor:\n:* how to move the cursor one position to the left\n:* how to move the cursor one po...
Terminal-control-Cursor-movement
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Terminal_control/Cursor_positioning\nnote: Terminal control\n", "language": "00-META" }, { "code": "[[Terminal Control::task| ]]\n\n;Task:\nMove the cursor to column &nbsp; '''3''', &nbsp; row &nbsp; '''6''', &nbsp; and display the word &nbsp; \"Hell...
Terminal-control-Cursor-positioning
[ { "code": "---\ncategory:\n- Initialization\nfrom: http://rosettacode.org/wiki/Terminal_control/Dimensions\nnote: Terminal control\n", "language": "00-META" }, { "code": "Determine the height and width of the terminal, and store this information into variables for subsequent use.\n[[Terminal Control...
Terminal-control-Dimensions
[ { "code": "---\ncategory:\n- Terminal control\nfrom: http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor\nnote: Terminal control\n", "language": "00-META" }, { "code": "The task is to hide the cursor and show it again.\n<br><br>\n\n", "language": "00-TASK" }, { "code": "PROC W...
Terminal-control-Hiding-the-cursor
[ { "code": "---\ncategory:\n- Terminal control\nfrom: http://rosettacode.org/wiki/Terminal_control/Inverse_video\nnote: Terminal control\n", "language": "00-META" }, { "code": ";Task:\nDisplay a word in inverse video &nbsp; (or reverse video) &nbsp; followed by a word in normal video.\n<br><br>\n\n",...
Terminal-control-Inverse-video
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Terminal_control/Positional_read\nnote: Terminal control\n", "language": "00-META" }, { "code": "[[Terminal Control::task| ]]\nDetermine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is ...
Terminal-control-Positional-read
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell\nnote: Terminal control\n", "language": "00-META" }, { "code": "[[Terminal Control::task| ]]\n\n;Task:\nMake the terminal running the program ring its \"bell\". \n\n\nOn modern terminal emulators, this may b...
Terminal-control-Ringing-the-terminal-bell
[ { "code": "---\ncategory:\n- Terminal control\n- Unicode\nfrom: http://rosettacode.org/wiki/Terminal_control/Unicode_output\n", "language": "00-META" }, { "code": "The task is to check that the terminal supports Unicode output, before outputting a Unicode character. If the terminal supports Unicode,...
Terminal-control-Unicode-output
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Ternary_logic\nnote: Logic\n", "language": "00-META" }, { "code": "<br>\nIn [[wp:logic|logic]], a '''three-valued logic''' (also '''trivalent''', '''ternary''', or '''trinary logic''', sometimes abbreviated '''3VL''') is any of several [[wp:many-val...
Ternary-logic
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Test_integerness\n", "language": "00-META" }, { "code": "Mathematically,\n* the [[wp:Integer|integers]] '''Z''' are included in the [[wp:Rational number|rational numbers]] '''Q''',\n* which are included in the [[wp:Real number|real numbers]] '''R''',...
Test-integerness
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Text_processing/1\nnote: Text processing\n", "language": "00-META" }, { "code": "{{Template:clarify task}}\nOften data is produced by one program, in the wrong format for later use by another program or person. In these situations another program can...
Text-processing-1
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Text_processing/2\nnote: Text processing\n", "language": "00-META" }, { "code": "The following task concerns data that came from a pollution monitoring station with twenty-four instruments monitoring twenty-four aspects of pollution in the air. Perio...
Text-processing-2
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Textonyms\n", "language": "00-META" }, { "code": "When entering text on a phone's digital pad it is possible that a particular combination of digits corresponds to more than one word. Such are called textonyms.\n\nAssuming the digit keys are mapped t...
Textonyms
[ { "code": "---\nfrom: http://rosettacode.org/wiki/The_Name_Game\n", "language": "00-META" }, { "code": "Write a program that accepts a name as input and outputs the lyrics to the Shirley Ellis song \"The Name Game\".\n\n\nThe regular verse\n\nUnless your name begins with a vowel (A, E, I, O, U), 'B'...
The-Name-Game
[ { "code": "---\nfrom: http://rosettacode.org/wiki/The_sieve_of_Sundaram\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The sieve of Eratosthenes: you've been there; done that; have the T-shirt. The sieve of Eratosthenes was ancient history when Euclid was a schoolboy. You are ready for...
The-sieve-of-Sundaram
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Thiele's_interpolation_formula\nnote: Arithmetic operations\n", "language": "00-META" }, { "code": "<br>\n'''[[wp:Thiele's_interpolation_formula|Thiele's interpolation formula]]''' is an interpolation formula for a function ''f''(•) of a single varia...
Thieles-interpolation-formula
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Thue-Morse\n", "language": "00-META" }, { "code": ";Task:\nCreate a [http://en.wikipedia.org/wiki/Thue%E2%80%93Morse_sequence Thue-Morse sequence].\n\n\n;See also\n* &nbsp; YouTube entry: [https://www.youtube.com/watch?v=prh72BLNjIk The Fairest Shari...
Thue-Morse
[ { "code": "---\ncategory:\n- Games\nfrom: http://rosettacode.org/wiki/Tic-tac-toe\nnote: Games\n", "language": "00-META" }, { "code": ";Task:\nPlay a game of [[wp:Tic-tac-toe|tic-tac-toe]]. \n\nEnsure that legal moves are played and that a winning position is notified.\n\n\n''Tic-tac-toe'' &nbsp; is...
Tic-tac-toe
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Tokenize_a_string\nnote: String manipulation\n", "language": "00-META" }, { "code": "Separate the string \"Hello,How,Are,You,Today\" by commas into an array (or list) so that each element of it stores a different word. \n\nDispla...
Tokenize-a-string
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Tokenize_a_string_with_escaping\nnote: String manipulation\n", "language": "00-META" }, { "code": "{{task heading}}\nWrite a function or program that can split a string at each non-escaped occurrence of a separator character.\n\nIt should accept thre...
Tokenize-a-string-with-escaping
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Tonelli-Shanks_algorithm\n", "language": "00-META" }, { "code": "In computational number theory, the [[wp:Tonelli–Shanks algorithm|Tonelli–Shanks algorithm]] is a technique for solving for '''x''' in a congruence of the form:\n<big>\n:: x<sup>2</sup>...
Tonelli-Shanks-algorithm
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Topic_variable\n", "language": "00-META" }, { "code": "Several programming languages offer syntax shortcuts to deal with the notion of \"current\" or \"topic\" variable.\n\nA topic variable is a [[Special variables|special variable]] with a very shor...
Topic-variable
[ { "code": "---\ncategory:\n- Sorting\nfrom: http://rosettacode.org/wiki/Topological_sort\nnote: Sorting Algorithms\n", "language": "00-META" }, { "code": "{{Sorting Algorithm}}\n\n\nGiven a mapping between items, and items they depend on, a [[wp:Topological sorting|topological sort]] orders items so...
Topological-sort
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Topswops\n", "language": "00-META" }, { "code": "Topswops is a card game created by John Conway in the 1970's.\n\n\nAssume you have a particular permutation of a set of &nbsp; n &nbsp; cards numbered &nbsp; 1..n &nbsp; on both of their faces, for exa...
Topswops
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Totient_function\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "The &nbsp; '''totient''' &nbsp; function is also known as:\n::* &nbsp; Euler's totient function\n::* &nbsp; Euler's phi totient function\n::* &nbsp; phi totient function\n:...
Totient-function
[ { "code": "---\ncategory:\n- Recursion\n- Games\nfrom: http://rosettacode.org/wiki/Towers_of_Hanoi\nnote: Classic CS problems and programs\n", "language": "00-META" }, { "code": ";Task:\nSolve the &nbsp; [[wp:Towers_of_Hanoi|Towers of Hanoi]] &nbsp; problem with recursion.\n<br><br>\n\n", "langu...
Towers-of-Hanoi
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Trabb_Pardo–Knuth_algorithm\n", "language": "00-META" }, { "code": "The TPK algorithm is an early example of a programming chrestomathy. \nIt was used in Donald Knuth and Luis Trabb Pardo's Stanford tech report [http://bitsavers.org/pdf/stanford/cs_t...
Trabb-Pardo-Knuth-algorithm
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Tree_datastructures\n", "language": "00-META" }, { "code": "The following shows a tree of data with nesting denoted by visual levels of indentation:\n<pre>RosettaCode\n rocks\n code\n comparison\n wiki\n mocks\n trol...
Tree-datastructures
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Tree_from_nesting_levels\n", "language": "00-META" }, { "code": "Given a flat list of integers greater than zero, representing object nesting\nlevels, e.g. <code>[1, 2, 4]</code>,\ngenerate a tree formed from nested lists of those nesting level integ...
Tree-from-nesting-levels
[ { "code": "---\ncategory:\n- Recursion\nfrom: http://rosettacode.org/wiki/Tree_traversal\nnote: Data Structures\n", "language": "00-META" }, { "code": ";Task:\nImplement a binary tree where each node carries an integer, &nbsp; and implement:\n:::* &nbsp; pre-order,\n:::* &nbsp; in-order, \n:::* &nbs...
Tree-traversal
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Tropical_algebra_overloading\n", "language": "00-META" }, { "code": "In algebra, a max tropical semiring (also called a max-plus algebra) is the semiring\n(ℝ ∪ -Inf, ⊕, ⊗) containing the ring of real numbers ℝ augmented by negative infinity,\nthe max...
Tropical-algebra-overloading
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Truncatable_primes\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "A truncatable prime is a prime number that when you successively remove digits from one end of the prime, you are left with a new prime number.\n\n\n;Examples:\nThe numbe...
Truncatable-primes
[ { "code": "---\ncategory:\n- File System Operations\nfrom: http://rosettacode.org/wiki/Truncate_a_file\n", "language": "00-META" }, { "code": ";Task:\nTruncate a file to a specific length. &nbsp; This should be implemented as a routine that takes two parameters: the filename and the required file le...
Truncate-a-file
[ { "code": "---\ncategory:\n- CHR\nfrom: http://rosettacode.org/wiki/Twelve_statements\nnote: Puzzles\n", "language": "00-META" }, { "code": "This puzzle is borrowed from &nbsp; [http://math-frolic.blogspot.co.uk/2012/08/mind-wrenching.html math-frolic.blogspot].\n\n\nGiven the following twelve state...
Twelve-statements
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Twin_primes\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "Twin primes are pairs of natural numbers &nbsp; (P<sub>1</sub> &nbsp;and&nbsp; P<sub>2</sub>) &nbsp; that satisfy the following:\n\n::# &nbsp; &nbsp; P<sub>1</sub> &nbsp; and &n...
Twin-primes
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Two_bullet_roulette\n", "language": "00-META" }, { "code": "The following is supposedly a question given to mathematics graduates seeking jobs on Wall Street:\n<blockquote>\n A revolver handgun has a revolving cylinder with six chambers for bullets....
Two-bullet-roulette
[ { "code": "---\ncategory:\n- String algorithms\nfrom: http://rosettacode.org/wiki/Ukkonen’s_suffix_tree_construction\n", "language": "00-META" }, { "code": "Suffix Trees are very useful in numerous string processing and computational biology problems.\n\nThe task is to create a function which implem...
Ukkonen-s-suffix-tree-construction
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Ulam_spiral_(for_primes)\nnote: Prime Numbers\n", "language": "00-META" }, { "code": "An Ulam spiral (of primes) is a method of visualizing primes when expressed in a (normally counter-clockwise) outward spiral (usually starting at <big>'''1'''</big>...
Ulam-spiral-for-primes-
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Ultra_useful_primes\n", "language": "00-META" }, { "code": "An '''ultra-useful prime''' is a member of the sequence where each <span style=\"font-size:125%;\">'''a(n)'''</span> is the smallest positive integer <span style=\"font-size:125%;\">'''k'''<...
Ultra-useful-primes
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Undefined_values\nnote: Programming language concepts\n", "language": "00-META" }, { "code": "For languages which have an explicit notion of an undefined value, identify and exercise those language's mechanisms for identifying and manipulating a vari...
Undefined-values
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Unicode_strings\n", "language": "00-META" }, { "code": "As the world gets smaller each day, internationalization becomes more and more important. &nbsp; For handling multiple languages, [[Unicode]] is your best friend. \n\nIt is a very capable and [h...
Unicode-strings
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Unicode_variable_names\nnote: Unicode\n", "language": "00-META" }, { "code": ";Task:\n# Describe, and give a pointer to documentation on your languages use of characters ''beyond'' those of the ASCII character set in the naming of variables.\n# Show ...
Unicode-variable-names
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Unix/ls\n", "language": "00-META" }, { "code": ";Task:\nWrite a program that will list everything in the current folder, &nbsp; similar to:\n:::* &nbsp; the Unix utility &nbsp; “<tt>ls</tt>” &nbsp; [http://man7.org/linux/man-pages/man1/ls.1.html] &nb...
Unix-ls
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Unprimeable_numbers\nnote: Prime Numbers\n", "language": "00-META" }, { "code": ";Definitions:\nAs used here, all unprimeable numbers &nbsp; (positive integers) &nbsp; are always expressed in base ten.\n\n\n───── Definition from OEIS ─────:\n<br>Unpr...
Unprimeable-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Untouchable_numbers\nnote: Prime Numbers\n", "language": "00-META" }, { "code": ";Definitions:\n:* &nbsp; ''Untouchable numbers'' &nbsp; are also known as &nbsp; ''nonaliquot numbers''.\n\n:* &nbsp; An &nbsp; untouchable number &nbsp; is a positive i...
Untouchable-numbers
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Update_a_configuration_file\nnote: File handling\n", "language": "00-META" }, { "code": "We have a configuration file as follows:\n\n # This is a configuration file in standard configuration file format\n #\n # Lines begininning with a hash or a semi...
Update-a-configuration-file
[ { "code": "---\ncategory:\n- String manipulation\nfrom: http://rosettacode.org/wiki/URL_decoding\n", "language": "00-META" }, { "code": "This task &nbsp; (the reverse of &nbsp; [[URL encoding]] &nbsp; and distinct from &nbsp; [[URL parser]]) &nbsp; is to provide a function \nor mechanism to convert ...
URL-decoding
[ { "code": "---\ncategory:\n- String manipulation\n- Encodings\nfrom: http://rosettacode.org/wiki/URL_encoding\n", "language": "00-META" }, { "code": ";Task:\nProvide a function or mechanism to convert a provided string into URL encoding representation.\n\nIn URL encoding, special characters, control...
URL-encoding
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Use_another_language_to_call_a_function\nnote: Programming environment operations\n", "language": "00-META" }, { "code": "This task is inverse to the task [[Call foreign language function]]. Consider the following [[C]] program:\n<syntaxhighlight lan...
Use-another-language-to-call-a-function
[ { "code": "---\ncategory:\n- GUI\n- Basic language learning\nfrom: http://rosettacode.org/wiki/User_input/Graphical\nnote: Text processing\nrequires:\n- Graphics\n", "language": "00-META" }, { "code": "In this task, the goal is to input a string and the integer 75000, from [[graphical user interface...
User-input-Graphical
[ { "code": "---\nfrom: http://rosettacode.org/wiki/User_input/Text\nnote: Text processing\n", "language": "00-META" }, { "code": "{{selection|Short Circuit|Console Program Basics}}\n[[Category:Basic language learning]]\n[[Category:Keyboard input]] \n[[Category:Simple]]\n\n;Task: \nInput a string and ...
User-input-Text
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Validate_International_Securities_Identification_Number\n", "language": "00-META" }, { "code": "An [[wp:International_Securities_Identification_Number|International Securities Identification Number]] (ISIN) is a unique international identifier for a ...
Validate-International-Securities-Identification-Number
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Vampire_number\nnote: Mathematics\n", "language": "00-META" }, { "code": "A [[wp:Vampire_number|vampire number]] is a natural decimal number with an even number of digits, &nbsp; that can be factored into two integers. \n\nThese two factors are calle...
Vampire-number
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Van_der_Corput_sequence\n", "language": "00-META" }, { "code": "When counting integers in binary, if you put a (binary) point to the right of the count then the column immediately to the left denotes a digit with a multiplier of <math>2^0</math>; the...
Van-der-Corput-sequence
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Variable_declaration_reset\n", "language": "00-META" }, { "code": "A decidely non-challenging task to highlight a potential difference between programming languages.\n\nUsing a straightforward longhand loop as in the JavaScript and Phix examples belo...
Variable-declaration-reset
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Variable-length_quantity\nnote: Data Structures\n", "language": "00-META" }, { "code": "Implement some operations on [[wp:Variable-length quantity|variable-length quantities]], at least including conversions from a normal number in the language to th...
Variable-length-quantity
[ { "code": "---\nfrom: http://rosettacode.org/wiki/Variable_size/Get\nnote: Type System\n", "language": "00-META" }, { "code": "Demonstrate how to get the size of a variable.\n\nSee also: [[Host introspection]]\n\n", "language": "00-TASK" }, { "code": "Int64 i\nprint(T(i).size)\nprint(Int...
Variable-size-Get
[ { "code": "---\ncategory:\n- Simple\nfrom: http://rosettacode.org/wiki/Variables\nnote: Basic language learning\n", "language": "00-META" }, { "code": ";Task:\nDemonstrate a language's methods of:\n:::* &nbsp; variable declaration\n:::* &nbsp; initialization\n:::* &nbsp; assignment\n:::* &nbsp; data...
Variables