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

Content added Content deleted
No edit summary
mNo edit summary
Line 709: Line 709:
=== ICMP Ping ===
=== 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.
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.

== Weighted Random ==
Pick a random item from a list of dozen items, where each item has different weight (rarity).

Gaming example: random treasure generation in roguelikes. I've found that this is extremely awkward to do in some languages, and simple in others.


=== Generate a Regular Expression for a Range of Integers ===
=== Generate a Regular Expression for a Range of Integers ===
Line 743: Line 738:


Bonus: support ranges containing negative integers.
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).

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 ==
== Partitioning ==