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

(Radix-50)
 
(20 intermediate revisions by 11 users not shown)
Line 9:
 
=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==
Line 27 ⟶ 30:
** 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 78 ⟶ 82:
* 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)
Line 195 ⟶ 201:
 
--[[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 436 ⟶ 444:
 
--[[User:Rabuf|Rabuf]] ([[User talk:Rabuf|talk]]) 20:47, 5 November 2013 (UTC)
 
 
==Unsorted==
Line 444 ⟶ 453:
 
Place new items here, if it's unclear where they belong.
 
===Colorwheel===
=== Count Consonants ===
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
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]
Line 794 ⟶ 843:
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==
7,794

edits