Rosetta Code:Village Pump/Suggest a programming task: Difference between revisions

No edit summary
 
(164 intermediate revisions by 52 users not shown)
Line 1:
{{#set:is contribution page=true}}[[Category:Requesting Content]]So
{{#set:is contribution page=true}}[[Category:Requesting Content]]So you want to see a problem solved? If you're not comfortable creating the task page yourself, feel free to edit this page, and describe the problem below. (To edit this page, click the "edit" tab at the top.) You also might want to check out the [[:Category:Draft Programming Tasks|draft tasks]] to see if someone has already suggested one and partially produced the page; if so, just help them out by supplying what's needed to take the page from draft to full task.
you want to see a problem solved? If you're not comfortable creating the task page yourself, feel free to edit this page, and describe the problem below.
(To edit this page, click the "edit" tab at the top.)
You also might want to check out the [[:Category:Draft Programming Tasks|draft tasks]] to see if someone has already suggested one and partially produced the page; if so, just help them out by supplying what's needed to take the page from draft to full task.
 
When making a request, please place it in the [[#Unsorted|Unsorted]] section. Also, feel free to review the others that are already here; help sort them into the other categories, based on the category descriptions. (If we need another category or two, you can create them.)
Also, feel free to review the others that are already here; help sort them into the other categories, based on the category descriptions.
(If we need another category or two, you can create them.)
 
=Incomplete=
 
* c++ console command line app Name/fantasyname/itemname/etc generators, that takes input from the keyboard and appends them to text files, then all the text files are read and every combination of item is then dumped to a new text file.
 
 
==General==
* Benchmarks
** Find out the relative speeds of two or more different pieces of code, which perform the same calculation in different ways. Each piece of code should be iterated enough that it runs for at least one second.
** Show how to run a profiler for a program written in your language. The program that's profiled should be one of the RC tasks. Show the commands which will show the top 10 most frequently run lines of code in the program.
* Date Calculations
** Calculate Self-describing numbers
Line 17 ⟶ 29:
** Calculate number of [Sundays|Mondays|Tuesdays|Wednesdays|Thursdays|Fridays|Saturdays] in a given month or year
** Display a date in various formats
** Something with [http://terrancalendar.com the Terran Computational Calendar] (and contribute to [https://github.com/terrancalendar/terrancalendar their Github project])
** Calculate yesterday's date
* Show creation, element insertion, element removal and enumeration of a "set" type that enforces constraints as described [[Talk:Symmetric difference#Set_type|here]]. (An invariant analog would be nice as well.)
* The [[:Category:Object oriented|Object oriented category]] is missing a lot of the basics like [[calling a method]].
Line 26 ⟶ 40:
* an encryption program
** What sort of encryption? We've already got tasks for using SSL connections (e.g., [[Client-Authenticated HTTPS Request]]) so maybe you're after message-level encryption? Perhaps a simple [[wp:Data Encryption Standard|DES]] implementation would be apt. (The advantage of that is that it is not particularly strong itself, and so doesn't run close to the legal issues in this area, but points the way towards real production encryption.) –[[User:Dkf|Donal Fellows]] 09:17, 20 January 2010 (UTC)
** See Playfair below --[[User:Brnikat|Brnikat]] ([[User talk:Brnikat|talk]]) 15:09, 10 July 2015 (UTC)
* Monads
* Coroutines/[[Generator]]s
* Sentinel value -- What values are commonly used for sentinel purposes. (This may end up beyond language comparison and delve into protocols) --[[User:Short Circuit|Short Circuit]] 18:09, 9 June 2009 (UTC)
* List all duplicated files of a given path. A duplicated is an exact copy, having the same checksum.
** Perhaps [[Null]] should be generalized to cover this? --[[User:Kevin Reid|Kevin Reid]] 21:27, 29 August 2009 (UTC)
* Applying a list of functions to a value. (As different from applying a function to a list of values.)[[User:Rahul|Rahul]] 21:23, 9 December 2008 (UTC)
Line 58 ⟶ 74:
* Zipping sequences (calculating their [[wp:Convolution (computer science)|convolution]]) and unzipping
 
* cat & tee: copy input to output, copy input to multiple outputs. I'm not sure of the best name for these tasks ("IO/cat" & "IO/tee"? "copy input to output"?). [[Input loop]] has some solutions that implement the first, but it doesn't explicitly say what should be done with input, and some solutions to `cat` and `tee` may not use loops (which is what's interesting about these tasks).
===Games===
 
* We should maybe double check whether we are missing any tasks corresponding to algorithms listed at http://algo-visualizer.jasonpark.me/
 
* Images: Reading, modifying, and writing either a .PNG/.JPG or other common image type. (Currently, there's bitmap and PPM stuff, but this task is for somethign more practical.)
 
* It would be good to have an implementation of the Nelder-Mead gradient descent algorithm. https://en.wikipedia.org/wiki/Nelder-Mead_method This would be a good candidate for a generic driver (eg:c++ template class) accepting a function and returning the parameter(s) that map to the functions (apparent) minimum. --[[User:Bitrat|Bitrat]] 14:10, 17 January 2019 (UTC)
 
 
*A program which prints out 'Rainbow' to the screen, with each character being one color of the rainbow.
==Games==
* Connect Four (or more) with variable and standard game board (6 rows, 7 columns)
*:- but watch for trade mark violations etc --[[User:Paddy3118|Paddy3118]] 17:33, 29 April 2009 (UTC)
Line 67 ⟶ 93:
*: More possibilities are [[wp:Von Neumann cellular automaton|von Neumann]] and [[wp:Langton's loops|Langton]] cellular automata. They're not really games as such, but they're certainly interesting in similar ways. —[[User:Dkf|Donal Fellows]] 14:58, 9 August 2009 (UTC)
* Magic square: a program that could compute a magic square of any size, whether odd, doubly-even, or singly even.
::* ''magic squares of odd order'' has been implemented.   ''Magic squares of even order''   has no known algorithm and therefore will be problematic to generate. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 04:41, 20 March 2014 (UTC)
*Some classic and simple games, such as ''[[wp:Hangman (game)|Hangman]]'', ''[[wp:Snake (video game)|Snake]]'', ''[[wp:Breakout (video game)|Breakout]]'', or ''[[wp:Battleship (game)|Battleship]]''. --[[User:Morn|Morn]] 17:26, 26 December 2010 (UTC)
*[[wp:Rule 90]]
* Perl6 [[chess grammar]], eventually with side effects for move validation and/or adjudication.
* 9x9 sudoku, a program that generates a sudoku box as well as has an option to automatically solve it
* Implement a pacman game in our language. Here is the Assembler-code of the original [http://cubeman.org/arcade-source/pacman.asm]
::Note that that assembler code makes deep use of very specific hardware which is not present on most systems. Just reading it for comprehension would take days of work, for someone like me. --[[User:Rdm|Rdm]] 16:02, 17 December 2012 (UTC)
::And the size of any entry is likely to be too large. --[[User:Paddy3118|Paddy3118]] 16:15, 17 December 2012 (UTC)
::::You are both right, here is a link to a java implementation of pacman [http://zetcode.com/tutorials/javagamestutorial/pacman/]
* Implement a program that generates a random [[wp:Chess960 starting position|Chess960 starting position]]--[[User:Grondilu|Grondilu]] ([[User talk:Grondilu|talk]]) 23:56, 18 April 2014 (UTC)
* What about the [[wp:Nim|Nim]] game and the variations found on its wiki page?
:See [[User:DanBron/Game of Nim]] for history... --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:57, 22 May 2015 (UTC)
* Annotate a crossword diagram given in the format
 
<pre>
......#......
.#.#.#.#.#.#.
.......#.....
.#.###.#.#.#.
.....#.......
##.#.#.#.###.
...#.....#...
.###.#.#.#.##
.......#.....
.#.#.#.###.#.
.....#.......
.#.#.#.#.#.#.
......#......
</pre>
 
and produce a diagram with the numbers in place and a skeleton set of clues in this format
 
<pre>
|--------------------------------------|
|1 | |2 | |3 | |##|4 |5 | |6 | |7 |
| | | | | | |##| | | | | | |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
| |##| |##| |##|8 |##| |##| |##| |
| |##| |##| |##| |##| |##| |##| |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
| |##| |##|##|##| |##| |##| |##| |
| |##| |##|##|##| |##| |##| |##| |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
|11| | | |12|##|13| | | | | | |
| | | | | |##| | | | | | | |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
|##|##| |##| |##| |##| |##|##|##| |
|##|##| |##| |##| |##| |##|##|##| |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
|14| | |##|15| | | | |##|16| | |
| | | |##| | | | | |##| | | |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
| |##|##|##| |##| |##| |##| |##|##|
| |##|##|##| |##| |##| |##| |##|##|
|--+--+--+--+--+--+--+--+--+--+--+--+--|
|17| |18| | | | |##|19| | | |20|
| | | | | | | |##| | | | | |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
| |##| |##| |##| |##|##|##| |##| |
| |##| |##| |##| |##|##|##| |##| |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
|21| | | | |##|22| |23| | | | |
| | | | | |##| | | | | | | |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
| |##| |##| |##| |##| |##| |##| |
| |##| |##| |##| |##| |##| |##| |
|--+--+--+--+--+--+--+--+--+--+--+--+--|
|24| | | | | |##|25| | | | | |
| | | | | | |##| | | | | | |
|--------------------------------------|
 
Across
1 (6)
4 (6)
9 (7)
10 (5)
11 (5)
13 (7)
14 (3)
15 (5)
16 (3)
17 (7)
19 (5)
21 (5)
22 (7)
24 (6)
25 (6)
 
Down
1 (5)
2 (7)
3 (7)
5 (9)
6 (5)
7 (7)
8 (11)
12 (9)
14 (7)
16 (7)
18 (5)
20 (5)
23 (3)
</pre>
where the bracket numbers are the lengths of the corresponding solutions.
 
A much harder task would be, given a set of simple definition type clues and the language used, solve the crossword.
 
--[[User:Brnikat|Brnikat]] ([[User talk:Brnikat|talk]]) 15:03, 10 July 2015 (UTC)
* Implement a [[wp:Wa-Tor|Wa-Tor]] population dynamics simulator. --[[User:Cgibbons|Cgibbons]] 22:22, 3 Apr 2023 (UTC)
::Python implementation: [https://scipython.com/blog/wa-tor-world/]
 
===Database / Network===
Line 79 ⟶ 211:
 
=== Data structures and algorithms ===
* Implement a finite state machine that verifies that a string contains a valid binary number. This is already done [https://sites.google.com/site/opensourceconstriubtions/ettl-martin-1/articles/how-to-determine-a-string-represents-a-binary-number-using-a-finite-state-machine here].
* Implement [http://de.wikipedia.org/wiki/Duff%E2%80%99s_Device Duff's Device] in your programming language.
: It seems to be specific to C/C++ and would it be best practice or just some kind of optimisation? --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 17:54, 20 May 2014 (UTC)
* canonical huffman code
* Include-in : test wether a list is a part of another one, ie if each element of the first list is an element of the second one
: In Emacs Lisp: <lang lisp>(defun is-include (l1 l2)
"test if l1 is a part of l2. In other words, if each element of l1
(defun is-include (l1 l2)
is an element of l2"
"test if l1 is a part of l2. In other words, if each element of l1
(cond
is an element of l2"
(cond(null l1) t)
((member (car l1) l2) (is-include (nullcdr l1) tl2))
(t nil)))</lang>
((member (car l1) l2) (is-include (cdr l1) l2))
:: Is that intended to model a subset operation? –[[User:Dkf|Donal Fellows]] 13:52, 18 December 2012 (UTC)
(t nil)))
</lang>
* <s>[[Sorting_algorithms/Heapsort|Heapsort]]</s> [done] and maybe some other sorts from [[wp:Algorithm implementation/Sorting|Wikipedia's list of sorting algorithms]]
:: I might be interested in [[wp:Introsort]] and [[wp:Timsort]], as both are reported to be highly efficient sorts. However, they're also not the best-described sorting algorithms (e.g., no actual algorithm on the WP pages) so I'm not in a hurry to actually take them on. –[[User:Dkf|Donal Fellows]] 09:15, 2 September 2010 (UTC)
 
:::The Timsort algorithm description might only be its source! I suspect it may not be a good candidate for an RC task for that reason, but if someone knowledgable could break out a sub-algorithm, such as finding optimal runs of pre-sorted data then implementing that sub-algorithm might form a useful task. --[[User:Paddy3118|Paddy3118]] 10:51, 10 November 2011 (UTC)
 
:::Timsort is actually very well described - the Wikipedia page now has an algorithm description, and [http://hg.python.org/cpython/file/tip/Objects/listsort.txt this page] has a detailed description from the author. [[User:Gereeter|Gereeter]] 15:51, 17 March 2013 (UTC)
 
:: * [[wp:strand_sort|Strand sort]]
Line 114 ⟶ 250:
* [[wp:Burrows-Wheeler transform|Burrows-Wheeler transform]]
* [[wp:Move-to-front transform|Move-to-front transform]]
: Done as [[Move-to-front algorithm]] --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 20:21, 20 May 2014 (UTC)
* [[wp:Cartesian tree|Cartesian tree]] construction [[User:qu1j0t3]]
* [[wp:Trie|Prefix Tree]]
Line 131 ⟶ 268:
</lang> --[[User:Stuart P. Bentley|STUART]] 21:18, 8 January 2012 (UTC)
* B-Splines might be a good task (I'm having trouble coming up with good example B-Splines right now...). --[[User:Rdm|Rdm]] 19:31, 24 June 2012 (UTC)
* Cannot find [http://en.wikipedia.org/wiki/Selection_algorithm Linear general selection algorithm - Median of Medians algorithm] --[[User:Zmi007|Zmi007]] ([[User talk:Zmi007|talk]]) 23:34, 9 August 2013 (UTC)
* A simple succinct data structure plus its benchmar: http://en.wikipedia.org/wiki/Succinct_data_structure#Succinct_dictionaries
 
==== Graph algorithms ====
Line 138 ⟶ 277:
* List all (strict) [[wp:Dominator_ (graph_theory)|Dominators]] of a node in a graph
* List all (strict) Post-dominators of a node in a graph
* [http://en.wikipedia.org/wiki/Cycle_detection Cycle detection] algorithms:
** [http://en.wikipedia.org/wiki/Cycle_detection#Tortoise_and_hare Floyd's cycle-finding algorithm]/"Tortoise and Hare" - (e.g. [http://en.wikipedia.org/wiki/Cycle_detection#Tortoise_and_hare Python], [http://stackoverflow.com/questions/2663115/how-to-detect-a-loop-in-a-linked-list Java])
** [http://en.wikipedia.org/wiki/Cycle_detection#Brent.27s_algorithm Brent's algorithm]
* Minimum mean-weight cycle cancelling algorithm: minimum-cost maximum-flow problem &mdash;''[[User:Ruud Koot|Ruud]]'' 22:37, 10 March 2011 (UTC)
* [[wp:A* search algorithm|A* search algorithm]], surprised this isn't here, I looked, if it is, [[A*]] and [[A star]] should probably redirect to it. I'm attempting to translate Wikipedia's pseudocode into Python right now. [[User:Keiji|Keiji]] 19:55, 6 April 2011 (UTC)
Line 143 ⟶ 285:
* [[wp:Depth-first search]] Done as [[Tree traversal]].
* [[wp:Breadth-first search]] Done as [[Tree traversal]]. --[[User:Paddy3118|Paddy3118]] 04:31, 24 November 2011 (UTC)
* [[wp:Newick format]] parser.
* [[wp:Lambda calculus|Lambda calculus]] parser and compiler.--[[User:Grondilu|Grondilu]] ([[User talk:Grondilu|talk]]) 10:31, 27 August 2013 (UTC)
 
===System calls===
Line 149 ⟶ 293:
** With an option to specify files or folder to exclude
* Open a named pipe
* Communicate with a child process using pipes
 
===Mathematical Operations===
* Task: bAckermann. The idea is to take the Ackermann function and find the sequence of all possible calls to the function sorted by number of recursions. The output would begin:
A(0,n) , A(1,0) , A(1,1) , A(2,0) , A(1,2) , A(1,3) , A(1,4) , A(1,5) , A(2,1) , A(1,6) , A(3,0) , A(1,7) , ...
:Conjecture: R(x+z,y)>R(x,y) and R(x,y+z)>R(x,y) for all positive integer z and all positive integer x where R is the function returning the number of recursions in the corresponding call to the Ackermann function. Can anyone prove this conjecture? -[[User:Zelah|Zelah]] ([[User talk:Zelah|talk]]) 02:34, 7 May 2014 (UTC)
* Write a programm in our programming language, that showns the numerical limits of all available datatypes for numbers. The limits of datatypes could be max number, min number, bit precission, decimal precission, etc.
* [[Convert a decimal number to fraction ]]Convert a decimal number to fraction.
* [[Self-describing numbers ]]Calculate Self-describing numbers.
Line 172 ⟶ 321:
* [http://www2.stetson.edu/~efriedma/mathmagic/0511.html This] MathMagic entry. [[User:MagiMaster|MagiMaster]] 08:44, 30 May 2011 (UTC)
* [[wp:Exponential moving average]]
* [[Unit calculator/convertor]]. A bit like what Google can do: https://www.google.com/search?q=10.5+cm+in+inches. With all SI units plus others (days, months for time, W.hour for energy, etc)
* Perform basic mathematical operations (+,*,/,-) for numbers represented as strings.[https://github.com/danmar/cppcheck/blob/master/lib/mathlib.h Here] is a sample implementation in C++.
* Implement the longest increasing subsequence algorithm in your programming language. [http://www.algorithmist.com/index.php/Longest_Increasing_Subsequence Here] is an implementation in C and C++.
* [http://en.wikipedia.org/wiki/Fermat_primality_test Fermat primality test]
* Implement a function in your programming language that prints numbers in [http://en.wikipedia.org/wiki/Engineering_notation Engineering_notation]. A C# implementation is already [http://stackoverflow.com/a/808295 available].
* [http://en.wikipedia.org/wiki/Arithmetic_shift Arithmetic shift] - Many languages lack operators like C's << and >>. The goal for the task would be to build the function shift(n,s) where n and s are both signed integers; n is the number to be shifted and s is the number of positions (negative for left; positive for right). So shift(5,-2) would yield the same result as 5<<2. --[[User:Mappo|Mappo]] 19 Nov. 2014
:: See [[Bitwise operations]]. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 17:40, 19 November 2014 (UTC)
:::Looks like he wants it re-implemented even if the language already covers it. --[[User:Mwn3d|Mwn3d]] ([[User talk:Mwn3d|talk]]) 17:56, 19 November 2014 (UTC)
 
===Color Spaces===
Line 183 ⟶ 340:
* Clearing the terminal window [[Terminal Control/Clear the screen]]
* Moving the cursor to a specific position on the screen (such as row 6, column 4) [[Terminal Control/Moving the cursor to a specific location on the screen]]
 
* Allow data entry in a specific place on the screen
* Restict data entry fields to a specific length (for example restrict input to 5 characters, do not allow a 6th character to be entered, and restrict the cursor from moving beyond the input length [[Terminal Control/Restrict width positional input/No wrapping‎]]
* This time restrict the input field on screen to a specific length, but allow the left hand side of the field to disappear, if the length of input exceeds the on screen input length (for example the input field may allow 30 characters on screen, but if you enter 40 characters, only the last 30 are shown on screen (unless you press the backspace key). Do not let the cursor move beyond the designated on screen field length. Terminal Control/Restrict width positional input/With wrapping‎]]
* Draw a box at a specific position on the terminal, with a specific height and width. For example, draw a box at row 3, column 7, 40 characters wide, and 8 characters in height.
* Display text within the box. If the text does not fit in the box, make the text roll up and down in response to cursor movements, so that the text can be displayed.
Line 196 ⟶ 354:
 
==Library-specific==
* Create a COM client (with early binding) (particularly with GCC/MinGW) (if possible under Winelib in linuxLinux is also interesting)
* Convert a Microsoft Word document (*.doc, *.docx) to ASCII text with your favorite programming language.
* Demonstrate how to open and read text from a Microsoft Word document, using you favorite programming language.
 
==Implementation-specific==
* Show how your language supports separation of interface or specification from implementation.
 
==Language-specific==
Add a sample Makefile to demonstrate how to build a dummy executable for several programming languages (distinguish between several platforms: Linux,Windows,etc)
 
[[wp:Duck typing|Duck typing]] specifically my [[wp:Talk:Duck_typing#DuckDecoy Example|DuckDecoy Example]]? --[[User:Paddy3118|Paddy3118]] 18:28, 5 May 2009 (UTC)
: The example is a bit confusing, but I think it's marking the difference between classes as true types and classes as patterns (with method invocations as message sends), yes? –[[User:Dkf|Donal Fellows]] 08:22, 3 January 2010 (UTC)
Line 204 ⟶ 369:
 
==Project level==
Which project, RC ? --[[User:Hajo|Hajo]] ([[User talk:Hajo|talk]]) 07:20, 21 November 2014 (UTC)
If possible, find ways to break these into smaller tasks which can ultimately be assembled into the final project.
 
If possible, find ways to break these into smaller tasks
which can ultimately be assembled into the final project.
 
===Self-hosting compiler===
* Self-hosting compiler. Now it is a draft task. If this task is too large then I could break it up into smaller pieces. An example of a subtask that might be good is to translate functions expressed in language A into functions expressed in language B for languages A and B that have notions of functions. More specific would be to translate a Scheme-like syntax for functions into your language's syntax for functions. -[[User:Zelah|Zelah]] ([[User talk:Zelah|talk]]) 02:43, 7 May 2014 (UTC)
 
===Super Simple p2p network===
: Could be done with FIFOs for streams, and a constant number of clients. Needs to be more specific regarding what it does. --[[User:Short Circuit|Short Circuit]] 22:28, 6 December 2007 (MST)
:: probably means some thing like this <nowiki>http://ansuz.sooke.bc.ca/software/molester/molester</nowiki>. To make it suitable for rc the restrictions need to be spelt out - i.e. fixing the protocol and discovery mechanisms [[User:Rahul|Rahul]] 20:24, 7 October 2008 (UTC)
 
===A table-based native code assembler===
implement a table-based native code (macro?) assembler in various HLLs
Line 242 ⟶ 415:
===Compact Whitespace interpreter===
Implement a [[wp:Whitespace_(programming_language)|whitespace]] interpreter such that the program used to implement it is as small as possible while still correctly implementing whitespace
 
===General 2D morphing===
I have an idea for a task but it might require original work, possibly on research level. It's inspired from recent research about self-assembling robots: http://phys.org/news/2013-10-surprisingly-simple-scheme-self-assembling-robots.html
 
What I have in mind is a simplified 2D model for an algorithm that would allow a set of square robots to take any arbitray shape.
 
Here is how I may formulate the task:
 
:Given N randomly selected points on a possibly infinite grid, and a given arbitrary target set of N points on this very same grid, find a set of N non-colliding trajectories such that the set of points at the end of the trajectories is the same as the target.
 
--[[User:Grondilu|Grondilu]] ([[User talk:Grondilu|talk]]) 09:42, 7 October 2013 (UTC)
 
===Chat Server, Client and Gateway===
I'll get started on a demo of this and proper write up over the next couple weeks.
There's already a [[Chat server]] task, but it doesn't really specify a protocol.
Most implementations seem to be pretty straightforward, query the client for a nick, then announce all messages to everyone.
 
The chat server I'd propose is slightly more complicated, but not as complex as IRC.
I'll work on a more clear protocol spec, but at a minimum changing of nicks and private messages, some others that will come up I'm sure (more features would be permitted, but a minimum and compatible protocol for the later projects).
 
The second project is a Chat Client, it would hide the protocol (similar to IRC clients) so that the user can simply type messages, pm people via something like `/pm rabuf Hey, going to the movie tonight?`. Filtering messages received from the server that the user doesn't need (like PING/PONG messages), or optionally killlists to hide messages from annoying people. This could be split into 2+ projects. A simple CLI, this would look like the result of telnetting into the current chat servers. Hides the protocol, user simply sees prompts for a name at the start, and a prompt for messages. A more complex CLI version using something like ncurses or slang to build a more featureful UI (separate panel for PMs, text input in a panel at the bottom, etc.). And a GUI client
(ideally, each language would have one `client` core that people build these
UI wrappers around).
 
The third part is what [[IRC Gateway]] is proposing now, but simplified. Connect two servers, announce messages between them or extend the protocol of the servers to allow gateways to be special. Announce messages as rabuf if the user is local, rabuf@rosettacode if they're from the other side of the gateway, etc. This is mainly to address what I (personally, nothing against the task, but it's potentially very easy or ludicrously hard) see as a problem in the IRC Gateway task. In the TCL version the code is largley provided by an existing library, in languages lacking such a library one would need to be made or found. Potentially allow PMs across the gateway `/pm rabuf@rosettacode Yo!`.
 
Overall, these three projects build on existing projects around UIs and networked interfaces, they *may* be a bit large, but we've got some pretty hefty tasks floating about now, and I feel these should all be manageable. The name might be changed so that it doesn't conflict with the existing and simple Chat Server task, it doesn't need to be replaced, it's a nice simple example of client/server architecture in each language. Perhaps something like "Rosetta Chat". As I said, I'll be working on this over the next couple weeks and feedback, advice, criticism, etc are all welcome.
 
--[[User:Rabuf|Rabuf]] ([[User talk:Rabuf|talk]]) 20:47, 5 November 2013 (UTC)
 
 
==Unsorted==
I am trying to write the following instructions in Pharo or SmallTalk:
- a linked list with tests
- a simple program equivalent of javadoc system that generates a mini javadoc like html file for a class passed as argument.
 
 
Place new items here, if it's unclear where they belong.
 
=== Count Consonants ===
* Minilight: a minimal global illumination renderer http://www.hxa.name/minilight/
Create a program to count consonants in a string input by the user using the ASCII character set.
The program must only count the letters that are not vowels. It should not count white space, punctuation, control characters, or numeric digits.
For instance, and Ada solution is:
<lang Ada>
with Ada.Text_IO; use Ada.Text_IO;
 
procedure Main is
*Random RC task: select a random task or draft task from RC, filtering out the non-task pages
subtype letter is Character with
Static_Predicate => letter in 'A' .. 'Z' | 'a' .. 'z';
subtype Vowel is Character with
Static_Predicate => Vowel in 'A' | 'E' | 'I' | 'O' | 'U' |
'a' | 'e' | 'i' | 'o' | 'u';
subtype consonant is character with
dynamic_predicate => consonant in letter and then consonant not in vowel;
 
Input : String(1..1024);
length : natural;
consonant_count : Natural := 0;
begin
Put("Enter a string: ");
Get_Line(Item => Input, Last => length);
-- count consonants
for char of input(1..length) loop
if char in consonant then
consonant_count := consonant_count + 1;
end if;
end loop;
New_Line;
Put_Line(Input(1..Length));
Put_Line("contains" & consonant_count'image & " consonants.");
end Main;
</lang>
See also https://rosettacode.org/wiki/Count_how_many_vowels_and_consonants_occur_in_a_string.
[[user:wherrera|wherrera]]
 
=== Multiple Mice ===
If 2 or more USB mice (or trackballs / trackpads) are connected to the system, read the input of each separately (for multiple mouse pointers or for multiplayer game input).
 
=== Colorwheel ===
description
* [https://stackoverflow.com/questions/4235072/what-is-the-math-behind-the-colour-wheel SO]
 
Versions:
* [https://commons.wikimedia.org/wiki/File:HLSColorSpace.png continous]
* discrete: circle is divided into n sectors varying in hue. Each sector is divided into m levels along radial dimension varying in lightnes, like [https://theblog.adobe.com/the-power-of-the-palette-why-color-is-key-in-data-visualization-and-how-to-use-it/ here]
 
=== Operators polymorphism ===
For many OO programming languages we need simple examples of [http://en.wikipedia.org/wiki/Operator_overloading operator overloading] and (if applicable to language) examples how to create new operators.--[[User:Zmi007|Zmi007]] ([[User talk:Zmi007|talk]]) 10:31, 16 April 2015 (UTC)
 
Not only OO languages. Algol68 allows operator overloading and creation of new operators. For instance
<lang ALGOL68>
OP FACTORIAL = (INT n) INT :
IF n < 1 THEN 1 ELSE
INT fact:= 1;
FOR i FROM 2 TO n DO fact TIMESAB i OD;
fact
FI;
OP * = (CHAR c, INT n) []CHAR :
( [n]CHAR result := HEAP [n] CHAR;
FOR i TO n DO result[i]:=c OD;
result
);
print ((FACTORIAL 5, newline));
print (("X" * 6, newline))
</lang>
Output:
<lang>
+120
XXXXXX
</lang>
[[User:Brnikat|Brnikat]] ([[User talk:Brnikat|talk]]) 11:58, 10 July 2015 (UTC)
 
=== Simple OCR ===
("optical character recognition") - Find text (or numbers) in pictures,
for example comics (like Dilbert), or screenshots. <br>
WRT "simple", we restrict this to chars of known fonts,
e.g. by giving the program some picture(s) with known text-samples. --13:07, 13 December 2014 (UTC)
 
=== Page-splitter ===
A bot for splitting pages into sub-pages.
If possible, with only a single captcha-check.<br>
E.g. I moved some entries from [[99_Bottles_of_Beer]] to separate pages, <br>
to organize them into groups of languages per subpage, <br>
see [[:Category:99_Bottles_of_Beer]].
The Page-splitter should be able to automate such tasks. --[[User:Hajo|Hajo]] ([[User talk:Hajo|talk]]) 07:20, 21 November 2014 (UTC)
 
=== Reversible random bit generator ===
Implement a random bit generator that can be run forward and backward.
When run backward it produces bits in reverse order.
I suggest using a maximal period minimal cost linear hybrid cellular automaton utilizing rules 90 and 150. -[[User:Zelah|Zelah]] ([[User talk:Zelah|talk]]) 02:35, 7 May 2014 (UTC)
 
=== Duff's Device ===
Implement [http://en.wikipedia.org/wiki/Duff%27s_device Duff's Device] or a near equivalent [[User:Axtens|Axtens]] ([[User talk:Axtens|talk]]) 03:27, 26 April 2014 (UTC)
 
===Bank Routing Number Validator===
All banks are assigned one or more 9-digit routing numbers (aka. transit routing number) that are self checking according to this algorithm.
From the left, multiply each digit by a corresponding weight (3,7,1,3,7,1,3,7,1) and add all products.
If the sum ends in zero, the number is a valid routing number.
Try it for 121000248 - it should sum up to 60.
Also try it on the 9-digit routing number found at the bottom of your checking account)
 
===Clipboard Manipulation===
Display the clipboard content & Write new content to the clipboard
 
===Minilight===
A minimal global illumination renderer http://www.hxa.name/minilight/
 
===Random RC task===
Select a random task or draft task from RC, filtering out the non-task pages
**Possibly done as a variation on [[Rosetta Code/Find unimplemented tasks]]?
:See [http://irclog.perlgeek.de/rosettacode/2011-11-21#i_4737091 this IRC discussion] for more information -- [[User:Eriksiers|Erik Siers]] 05:46, 21 November 2011 (UTC)
 
=== Noises ===
* Perlin Noise, Simplex Noise, Worley Noise implementations
http://en.wikipedia.org/wiki/Perlin_noise
Line 262 ⟶ 577:
* Perlin Noise, Simplex Noise, Worley Noise implementations for tiling system in video games or other media
 
*=== Thread safe circular buffer: Using mutexes or semaphores to conduct thread safe and robust read and writes from a circular buffer.===
Using mutexes or semaphores to conduct thread safe and robust read and writes from a circular buffer.
 
===Henderson Escher Picture Language===
* Henderson Escher Picture Language: [http://www.ecs.soton.ac.uk/%7Eph/funcgeo.pdf PDF] as made famous by [http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-15.html#%_sec_2.2.4 SICP Section 2.2.4] [http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ Video, Lecture 3a]. Here is an [http://www.frank-buss.de/lisp/functional.html implementation in Lisp] by Frank Buss. --[[User:Alanning|Alanning]] 04:00, 27 May 2011 (UTC)
[http://www.ecs.soton.ac.uk/%7Eph/funcgeo.pdf PDF] as made famous by [http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-15.html#%_sec_2.2.4 SICP Section 2.2.4] [http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ Video, Lecture 3a].
Here is an [http://www.frank-buss.de/lisp/functional.html implementation in Lisp] by Frank Buss. --[[User:Alanning|Alanning]] 04:00, 27 May 2011 (UTC)
 
===Phonecode===
* Phonecode: Given a list of words, and a telephone number, find all possible encodings of that telephone number by words. This task has already been used in a few comparative studies of language performance and productivity, for example [http://page.mi.fu-berlin.de/prechelt/Biblio/jccpprtTR.pdf]
Given a list of words, and a telephone number, find all possible encodings of that telephone number by words. This task has already been used in a few comparative studies of language performance and productivity, for example [http://page.mi.fu-berlin.de/prechelt/Biblio/jccpprtTR.pdf]
: Thanks so much for that link! I had read the paper some time ago but I probably have the link on an old hard drive somewhere...
: You have to remember though, that the aims of RC are ''very'' different to the authors of that paper and any task would have to be written for RC. If anyone has the number to a cold-calling firm, we could find the most appropriate phrase for their number ;-) or maybe not. --[[User:Paddy3118|Paddy3118]] 08:15, 7 May 2011 (UTC)
:: Here's an easy one. The phone number to the White House [http://www.whitehouse.gov/contact switch board]: 202-456-1414. Nothing specific or political intended here; it's just a published, public number. I do like the task idea, though. --[[User:Short Circuit|Michael Mol]] 13:15, 8 May 2011 (UTC)
 
===Weather Routing===
* Project Euler problems
The weather routing problem has the following parts:
<ul>
<li> a predicted surface wind direction and speed, at increments of longitude, latitude, and time</li>
<li> an expected surface current direction and speed, at increments of longitude, latitude, and time</li>
<li> 'polar data' describing maximum speed of a sailboat at points of sail for a given speed of wind over water</li>
<li> regions for sailing (the open ocean) and not (the land, shallows, restricted areas, etc.)</li>
<li> a starting location and time, and a destination</li>
</ul>
 
Given the above information and a specific path, progress along path and therefore arrival time are determined. The weather routing problem, conversely, is to determine the path which results in the earliest arrival time.
[[User:JimTheriot|JimTheriot]] ([[User talk:JimTheriot|talk]]) 00:33, 8 July 2015 (UTC)
 
===Project Euler problems===
 
* I suggest implementations of various maze generation algorithms, such as Recursive Division or Prim's Algorithm. A website that already does this for Python can be found here: [http://weblog.jamisbuck.org/search?q=maze+generation http://weblog.jamisbuck.org]--[[User:Intercoder|Intercoder]] 12:57, 7 March 2011 (UTC)
Line 419 ⟶ 751:
** http://www.rubyquiz.com/quiz137.html
* Ternary and quaternary search (binary search is already present).
 
*Maximum Unchecked Problem: Place 8 queens on a chessboard so that as many squares as possible are not attacked by any queen. (Cells occupied by queens are counted as attacked.) Rouse Ball in "Mathematical Recreations and Essays" believes the answer to be 11, but was never able to prove it. [[User:Jon Rob|Jon Rob]] 14:41, 30 October 2012 (UTC)
 
*Farmer across river problem: man, wolf, goat, cabbage and ship, everyone knows. Make the algorithm to find solution.
 
* Seam Carving (or Context Aware Image Resizing) basic algorithm: http://nparashuram.com/seamcarving/ as test case use this image converted to grey scale: http://upload.wikimedia.org/wikipedia/commons/c/cb/Broadway_tower_edit.jpg
 
* Draw a Pythagoras Tree ( http://fsharpnews.blogspot.it/2009/05/pythagoras-tree.html http://en.wikipedia.org/wiki/Pythagoras_tree_%28fractal%29 )
 
* Linear regression [[User:Wei2912|Wei2912]] ([[User talk:Wei2912|talk]]) 14:38, 6 June 2014 (UTC)
 
=== Playfair encryption and decryption ===
This is a specific example of the encryption problem mentioned in the general section. Playfair is a simple 25-character bigram alphabetic cipher which was still being used by the military in WW1. The task is to use a given keyword or phrase to generate a key which is used to encrypt a plain text and then to decrypt the corresponding cypher text. As only 25 different letters can be used, one must be chosen '''not''' to be used in the plaintext, substituting a valid character as needed to maintain unambiguity of the message. As adjacent identical letters can not be present in the plaintext before encryption, one or more dummy characters must be inserted between them. The plaintext must be padded to an even number of characters before encryption.
 
I don't yet have a suggested plaintext which trips all the above special conditions but will produce one, along with a pass phrase, the corresponding key and the cipher text.
 
[[User:Brnikat|Brnikat]] ([[User talk:Brnikat|talk]]) 11:16, 10 July 2015 (UTC)
 
:There is already a draft task [[Playfair_cipher]] --[[User:AndiPersti|Andreas Perstinger]] ([[User talk:AndiPersti|talk]]) 05:32, 11 July 2015 (UTC)
 
=== ICMP Ping ===
Send an ICMP ping to some local resource, such as the current default gateway or even just 127.0.0.1 or ::1, and display information about the response or the absence of the response.
 
=== Generate a Regular Expression for a Range of Integers ===
 
Write a function that, given the integers 0 <= ''min'' < = ''max'', returns a regular expression that will match the decimal representation of any integer in the range [''min'', ''max'']. You may assume there are no thousand-separators, leading 0's, or other problematic characters in the string to be processed. You may also assume the caller of your function will prepend/append appropriate anchors (e.g., ^, $, or \b) depending on need, so don't include them. Don't use \d as an alias for [0-9] since \d can match weird unicode characters on some systems.
 
'''Example''':
 
''min'' = 1
 
''max'' = 31
 
f(''min'', ''max'') = [1-9]|[1-2][0-9]|3[0-1] /* possible result */
 
f(''min'', ''max'') = [1-9]|[12][0-9]|3[01] /* equally-valid alternate result */
 
'''Example''':
 
''min'' = 91
 
''max'' = 417
 
f(''min'', ''max'') = 9[1-9]|[1-3][0-9]{2}|4(0[0-9]|1[0-7]) /* possible result */
 
f(''min'', ''max'') = 9[1-9]|[1-3][0-9][0-9]|4(0[0-9]|1[0-7]) /* equally-valid alternate result */
 
 
Hint: Use a recursive, divide-and-conquer approach. You will have to handle cases where max contains more digits than min.
 
Bonus: support ranges containing negative integers.
 
=== Weighted Random ===
Pick a random item from a list of dozen items, where each item has different weight (rarity). If the language permits, the list should be made in a way that makes it easy to add new items without having to adjust the weights of the other items.
 
Gaming example: random treasure generation in roguelikes. I've found that this is extremely awkward to do in some languages, and simple in others.
 
=== Partitioning ===
Task for "partition an integer into X primes". For example, partition 19 into 3 primes could return 3+5+11.
 
<br>
-----
<br>
 
This request was just created today.
 
 
See the Rosetta Code task:
 
:* &nbsp; [http://rosettacode.org/wiki/Partition_an_integer_X_into_N_primes '''Partition an integer X into N primes'''].
 
 
-- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 03:48, 3 March 2017 (UTC)
 
=== Bron-Kerbosch algorithm ===
Implement any of the variants of the [[wp:Bron-Kerbosch_algorithm|Bron-Kerbosch algorithm]] for finding maximal cliques (maximal complete subgraphs) in an undirected graph.
 
This should likely be sorted under 1.2.2.1, Graph algorithms.
 
=== Radix-50 encoding and decoding ===
 
[[wp:DEC_Radix-50|Radix-50]] is a method of encoding a restricted character set, used by DEC to store compiler labels and filenames. Each 16-bit word stores three characters encoded as char1*40*40 + char2*40 + char3. The name Radix-50 comes from 50(octal) = 40(decimal).
 
Challenge:
* encode up to three characters into a single word, indicate what you do with invalid characters
* decode a single word into three characters, indicate what you do with invalid data (word>=40*40*40)
* encode a string, indicate what you do with invalid characters
* decode to a string, indicate what you do with invalid data (word>=40*40*40)
 
 
The character set to be used is:
" ABCDEFGHIJKLMNOPQRSTUVWXYZ$?%0123456789"
[[User:Jgh|Jgh]] ([[User talk:Jgh|talk]]) 17:14, 15 May 2020 (UTC)
 
:That sounds like a good idea for a task which will particularly appeal to the 'old timers' amongst us. Why don't you create a draft task for it and add an implementation to start the ball rolling.
[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 08:14, 17 May 2020 (UTC)
 
 
=== Modulo operation ===
The table [[wp:Modulo_operation#In_programming_languages]] deserves to be somewhere on this site, with additional information and features.
 
In my own docs (for Phix) I have this (as a suggestion for the kind of info I think would be useful):
x,y: -9,-4 -9,+4 +9,-4 +9,+4
remainder(x,y): -1 -1 +1 +1
mod(x,y): -1 +3 -3 +1 -- (matches C's % operator)
 
I was thinking there could be checkboxes to filter the list to languages that can and cannot get the results you need/prefer, have an infix operator (or two), work on integers and floating point values or not, and probably something about precedence and associativity. Also the availability of a divmod function, and whether native/bigint/gmp wrappers all agree.
 
A table would clearly be better than a long list of individual entries, I know we can do sorting ([[Rosetta_Code/Count_examples/Full_list|eg]]), I don't know whether filtering is possible. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 08:06, 29 March 2021 (UTC)
 
=== Media files ===
Determine the duration of an audio or video file. Extract a thumbnail from a video file. --[[User:Petelomax|Petelomax]] ([[User talk:Petelomax|talk]]) 01:53, 1 August 2023 (UTC)
 
==Insufficient information==
Line 578 ⟶ 1,022:
would be useful to that end. I was thinking that doing these as small proof of concepts rather than trying to build some kind of big framework would be most useful. Now since I'm not a heavy user of OO, I might go overboard here and was wondering what others might think. --[[User:Dgamey|Dgamey]] 17:38, 27 December 2011 (UTC)
* I'd like to see a set of tasks related to representation of graphs and basic algorithms for them. There is a set of tasks around bitmaps, but that's more like API. For graphs, it's different, yet justifies a common category. [[User:Avmich|Avmich]] 05:06, 10 July 2012 (UTC)
 
* Communicating with a child process using pipes
** I have a procedure, written in Web 68, which creates a child process and provides means of sending data to the child,
via the child's std in,
and getting data from the chid's std out. I want to extend this procedure to provide access to the child's std err output.
I'd like to submit this procedure to rosettacode.org as it is now working satisfactorily. Sian Mountbatten
<poenikatu@fastmail.co.uk>
 
 
==Logarithm, sine and cosine implementations==
I just wanted to know if we could do this, I searched the site and was suprised there wasn't an article about this yet, ofcourse the idea is not to use the standard libraries, what do you think? [[User:Rainb|Rainb]] ([[User talk:Rainb|talk]]) 13:14, 19 July 2013 (UTC)
 
: For the trigonometric (trig) functions, see the Rosetta Code task: &nbsp; Trigonometric functions. &nbsp; For the various logarithms, I agree, it would be nice to have Rosetta Code have algorithms for the various log functions (LOG (LOG10), LN, LG (LOG2), LNLN, LOGLOG, LOGP1, LOG to any base, etc.) -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 04:50, 20 March 2014 (UTC)
7,795

edits