messages listlengths 2 2 |
|---|
[
{
"role": "user",
"content": "There are 100 doors in a row that are all initially closed.\n\nYou make 100 passes by the doors.\n\nThe first time through, visit every door and *toggle* the door (if the door is closed, open it; if it is open, close it).\n\nThe second time, only visit every 2nd door (door #2, ... |
[
{
"role": "user",
"content": "The Problem\n\n* 100 prisoners are individually numbered 1 to 100\n* A room having a cupboard of 100 opaque drawers numbered 1 to 100, that cannot be seen from outside.\n* Cards numbered 1 to 100 are placed randomly, one to a drawer, and the drawers all closed; at the start.\n*... |
[
{
"role": "user",
"content": "Task\n\nFind and show on this page the 10001st prime number."
},
{
"role": "assistant",
"content": "```\nsay (^∞).grep( &is-prime )[10000]\n\n```\n\nOutput:\n\n```\n104743\n```"
}
] |
[
{
"role": "user",
"content": "Task\n\nImplement the Fifteen Puzzle Game.\n\nThe **15-puzzle** is also known as:\n\n: : : * **Fifteen Puzzle**\n * **Gem Puzzle**\n * **Boss Puzzle**\n * **Game of Fifteen**\n * **Mystic Square**\n * **14-15 Puzz... |
[
{
"role": "user",
"content": "Your task is to write a program that finds a solution in the fewest moves possible single moves to a random Fifteen Puzzle Game. \nFor this task you will be using the following puzzle:\n\n```\n15 14 1 6\n 9 11 4 12\n 0 10 7 3\n13 8 5 2\n```\n\nSolution:\n\n```\n 1 2 ... |
[
{
"role": "user",
"content": "16 numbered pieces of the puzzle are placed out of order on a 4 X 4 grid. The correct order to win is to order the pieces\nas 1 through 16, read left to right, top to bottom:\n\n```\n 1 2 3 4\n 5 6 7 8\n 9 10 11 12\n 13 14 15 16\n\n```\n\nHow to Play: The aim is to get... |
[
{
"role": "user",
"content": "Task\n\nImplement a 2D sliding block puzzle game where blocks with numbers are combined to add their values.\n\nRules of the game\n: * The rules are that on each turn the player must choose a direction (up, down, left or right).\n * All tiles move as far as possible in t... |
[
{
"role": "user",
"content": "**21** is a two player game, the game is played by choosing\na number (**1**, **2**, or **3**) to be added to the *running total*.\n\nThe game is won by the player whose chosen number causes the *running total*\nto reach *exactly* **21**.\n\nThe *running total* starts at zero.\... |
[
{
"role": "user",
"content": "The 24 Game tests one's mental arithmetic.\n\nTask\n\nWrite a program that randomly chooses and displays four digits, each from 1 ──► 9 (inclusive) with repetitions allowed.\n\nThe program should prompt for the player to enter an arithmetic expression using *just* those, and *a... |
[
{
"role": "user",
"content": "task\n\nWrite a program that takes four digits, either from user input or by random generation, and computes arithmetic expressions following the rules of the 24 game.\n\nShow examples of solutions generated by the program.\n\nRelated task\n\n* Arithmetic Evaluator"
},
{
... |
[
{
"role": "user",
"content": "Task\n\nReplace **a, b, c, d, e, f,** and\n **g** with the decimal\ndigits LOW ───► HIGH\n \nsuch that the sum of the letters inside of each of the four large squares add up to\nthe same sum.\n\n```\n ╔══════════════╗ ╔══════════════╗\n ... |
[
{
"role": "user",
"content": "This task is a variation of the short story by Arthur C. Clarke.\n\n(Solvers should be aware of the consequences of completing this task.)\n\nIn detail, to specify what is meant by a “name”:\n\n: The integer 1 has 1 name “1”.\n: The integer 2 has 2 names “1+1”, an... |
[
{
"role": "user",
"content": "Task\n\nDisplay the complete lyrics for the song: **99 Bottles of Beer on the Wall**.\n\nThe beer song\n\nThe lyrics follow this form:\n\n> : : : 99 bottles of beer on the wall\n> : 99 bottles of beer\n> : Take one down, pass it around\n> :... |
[
{
"role": "user",
"content": "The A\\* search algorithm is an extension of Dijkstra's algorithm useful for finding the lowest cost path between two nodes (aka vertices) of a graph. The path may traverse any number of nodes connected by edges (aka arcs) with each edge having an associated cost. The algorithm... |
[
{
"role": "user",
"content": "**A+B** ─── a classic problem in programming contests, it's given so contestants can gain familiarity with the online judging system being used.\n\nTask\n\nGiven two integers, **A** and **B**.\n\nTheir sum needs to be calculated.\n\nInput data\n\nTwo integers are written ... |
[
{
"role": "user",
"content": "The use of abbreviations (also sometimes called synonyms, nicknames, AKAs, or aliases) can be an\n \neasy way to add flexibility when specifying or using commands, sub─commands, options, etc.\n\nIt would make a list of words easier to maintain (as words are added, chan... |
[
{
"role": "user",
"content": "This task is an easier (to code) variant of the Rosetta Code task: Abbreviations, simple.\n\nFor this task, the following *command table* will be used:\n\n```\n Add ALTer BAckup Bottom CAppend Change SCHANGE CInsert CLAst COMPress COpy\n COUnt COVerlay CURsor DELe... |
[
{
"role": "user",
"content": "The use of abbreviations (also sometimes called synonyms, nicknames, AKAs, or aliases) can be an\n \neasy way to add flexibility when specifying or using commands, sub─commands, options, etc.\n\nFor this task, the following *command table* will be used:\n\n```\n ad... |
[
{
"role": "user",
"content": "Taken from this video at the time stamp of 9:02\n\n**Task:**\n\nGet a string input and store it into a variable or something and compare the number of occurrences of the letters \"a\", \"b\" and \"c\".\nAll other characters MUST be ignored. If the \"a\"'s, \"b\"'s and \"c\"'s o... |
[
{
"role": "user",
"content": "Write a routine (function, subroutine, procedure, whatever it may be called in your language,) that when given a set of three letters, (a, b, c) for instance, will identify words that contain each of those letters, in differing amounts, and where each count differs from another... |
[
{
"role": "user",
"content": "You are given a collection of ABC blocks (maybe like the ones you had when you were a kid).\n\nThere are twenty blocks with two letters on each block.\n\nA complete alphabet is guaranteed amongst all sides of the blocks.\n\nThe sample collection of blocks:\n\n```\n (B O)\n (X... |
[
{
"role": "user",
"content": "Definition\n\nA word is an *ABC word* if the letters \"**a**\", \"**b**\" and \"**c**\" appear in the word in alphabetical order.\n\nIf any or all of these letters occur more than once in a word, then only the first occurrence of each letter should be used to determine... |
[
{
"role": "user",
"content": "| |\n| --- |\n| This page uses content from **Wikipedia**. The original article was at Abelian sandpile model. The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance) |... |
[
{
"role": "user",
"content": "Our sandpiles are based on a 3 by 3 rectangular grid giving nine areas that\ncontain a number from 0 to 3 inclusive. (The numbers are said to represent\ngrains of sand in each area of the sandpile).\n\nE.g. `s1` =\n\n```\n \n 1 2 0\n 2 1 1\n 0 1 3\n\n```\n\nand `s2`... |
[
{
"role": "user",
"content": "**Abstract type** is a type without instances or without definition.\n\nFor example in object-oriented programming using some languages, abstract types can be partial implementations of other types, which are to be derived there-from. An abstract type may provide implementation... |
[
{
"role": "user",
"content": "An Abundant number is a number **n** for which the *sum of divisors* **σ\n(\nn\n)\n>\n2\nn\n{\\displaystyle {\\displaystyle \\sigma (n)>2n}}**,\n \nor, equivalently, the *sum of proper divisors* (or aliquot sum) **s\n(\nn\n)\n>\nn\n{\\displaystyle {\\displays... |
[
{
"role": "user",
"content": "These define three classifications of positive integers based on their proper divisors.\n\nLet P(n) be the sum of the proper divisors of **n** where the proper divisors are all positive divisors of **n** other than **n** itself.\n\n```\n if P(n) < n t... |
[
{
"role": "user",
"content": "A problem posed by Paul Graham is that of creating a function that takes a single (numeric) argument and which returns another function that is an accumulator. The returned accumulator function in turn also takes a single numeric argument, and returns the sum of all the numeric... |
[
{
"role": "user",
"content": "| |\n| --- |\n| This page uses content from **Wikipedia**. The original article was at Achilles number. The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance) |\n\nAn ... |
[
{
"role": "user",
"content": "The **Ackermann function** is a classic example of a recursive function, notable especially because it is not a primitive recursive function. It grows very quickly in value, as does the size of its call tree.\n\nThe Ackermann function is usually defined as follows:\n\n: A\n ... |
[
{
"role": "user",
"content": "The task is to establish a connection to an Active Directory or Lightweight Directory Access Protocol server."
},
{
"role": "assistant",
"content": "(formerly Perl 6)\n\nUsing module LMDB - bindings to the openLDAP library. Requires an LDAP instance.\n\n```\nuse LMD... |
[
{
"role": "user",
"content": "Make sure you Connect to Active Directory"
},
{
"role": "assistant",
"content": "(formerly Perl 6)\n\n```\n# 20190718 Raku programming solution\n# https://github.com/perl6/doc/issues/2898\n# https://www.facebook.com/groups/perl6/permalink/2379873082279037/\n\n# Refe... |
[
{
"role": "user",
"content": "In object-oriented programming an object is active when its state depends on clock. Usually an active object encapsulates a task that updates the object's state. To the outer world the object looks like a normal object with methods that can be called from outside. Implementatio... |
[
{
"role": "user",
"content": "Demonstrate how to dynamically add variables to an object (a class instance) at runtime.\n\nThis is useful when the methods/variables of an instance are based on a data file that isn't available until runtime. Hal Fulton gives an example of creating an OO CSV parser at An Exerc... |
[
{
"role": "user",
"content": "An addition chain of length r for n is a sequence 1 = a(0) < a(1) < a(2) ... < a(r) = n , such as a(k) = a(i) + a(j) ( i < k and j < k , i may be = j) . Each member is the sum of two earlier members, not necessarily distincts.\n\nA Brauer chain for n is an addition chain where ... |
[
{
"role": "user",
"content": "| |\n| --- |\n| This page uses content from **Wikipedia**. The original article was at Addition-chain exponentiation. The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on vari... |
[
{
"role": "user",
"content": "Definitions\n\nIn mathematics, **additive primes** are prime numbers for which the sum of their decimal digits are also primes.\n\nTask\n\nWrite a program to determine (and show here) all **additive primes** less than **500**.\n\nOptionally, show the **number** of additive prim... |
[
{
"role": "user",
"content": "Task\n\nDemonstrate how to get the address of a variable and how to set the address of a variable."
},
{
"role": "assistant",
"content": "(formerly Perl 6)\n\n```\nmy $x;\nsay $x.WHERE;\n\nmy $y := $x; # alias\nsay $y.WHERE; # same address as $x\n\nsay \"Same var... |
[
{
"role": "user",
"content": "Description\n\nThe ADFGVX cipher was a manually applied field cipher used by the German Army during World War I. It was broken in 1918 by the French cryptanalyst Georges Painvin.\n\nThe workings of the cipher are described in the Wikipedia article, linked to above, and so will ... |
[
{
"role": "user",
"content": "In astronomy **air mass** is a measure of the amount of atmosphere between the observer and the object being observed. It is a function of the *zenith angle* (the angle between the line of sight an vertical) and the altitude of the observer. It is defined as the integral of the... |
[
{
"role": "user",
"content": "The AKS algorithm for testing whether a number is prime is a polynomial-time algorithm based on an elementary theorem about Pascal triangles.\n\nThe theorem on which the test is based can be stated as follows:\n\n* a number \n\n p\n {\\displaystyle {\\displaystyle p}}\n ... |
[
{
"role": "user",
"content": "Some languages offer direct support for algebraic data types and pattern matching on them. While this of course can always be simulated with manual tagging and conditionals, it allows for terse code which is easy to read, and can represent the algorithm directly.\n\nTask\n\nAs ... |
[
{
"role": "user",
"content": "Given a text file of many lines, where fields within a line\nare delineated by a single 'dollar' character, write a program\nthat aligns each column of fields by ensuring that words in each\ncolumn are separated by at least one space.\nFurther, allow for each word in a column t... |
End of preview. Expand in Data Studio
Rosetta Code Raku Questions & Answers
About the Dataset
This dataset is scraped from RosettaCode, it is the full set of tasks from the Raku section (minus <10 that failed to parse) with no cleanup or vetting attempted.
License
This data is licensed under the GFDL, all questions and answers belong to the original authors.
I make no claim to have authored this data.
Format
The dataset is formatted as sharegpt.
Goals
This dataset is part of a larger collection designed to teach LLMs to write a niche programming language. In this case, Raku (perl 6).
- Downloads last month
- 6