Rosetta Code
ghūl solutions to Rosetta Code tasks. Each can be edited and run here: click the pencil, change it, and run it in your browser.
starting out
Short programs, and the shapes every language has to have.
functions and closures
Functions as values: passed, returned, captured, and calling themselves.
types and pattern matching
Unions, traits, generics and operators: modelling data and taking it apart again.
generators and laziness
Sequences produced a value at a time, and consumers that stop when they have enough.
numbers
Arithmetic, primes, and sequences with something to prove.
- Achilles numbers
- Ackermann function
- Additive primes
- Almost prime
- Amicable pairs
- Anti-primes
- Descending primes
- Gapful numbers
- Gray code
- Greatest common divisor
- Haversine formula
- Iterated digits squaring
- Juggler sequence
- Kaprekar numbers
- Ludic numbers
- Map range
- Negative base numbers
- Numbers with equal rises and falls
- Ormiston pairs
- Pernicious numbers
- Population count
- Radical of an integer
- Roman numerals/Encode
- Semiprime
- Sieve of Eratosthenes
- Sphenic numbers
- Taxicab numbers
- Truncatable primes
- Undulating numbers
- Zeckendorf number representation
text
Reading, rewriting and comparing strings.
collections and algorithms
Sorting, searching, and working over whole collections.