Category:Swift
From Rosetta Code
Swift
This programming language may be used to instruct a computer to perform a task.
Listed below are all of the tasks on Rosetta Code which have been solved using Swift.
This programming language may be used to instruct a computer to perform a task.
Official website |
---|
Execution method: | Compiled (machine code) |
---|---|
Garbage collected: | Reference counting |
Parameter passing methods: | By reference, By value |
Type safety: | Safe |
Type strength: | Strong |
Type compatibility: | Nominative |
Type checking: | Dynamic, Static |
See Also: |
Your Help Needed
If you know Swift, please write code for some of the tasks not implemented in Swift.
Swift is a general purpose, multi-paradigm, systems programming language developed by Apple Inc. originally for Apple platforms. Linux support was added when open source Swift was released. It runs on the Objective-C runtime on Darwin and is mainly used with the Cocoa API. It was announced at WWDC 2014.
If you know Swift, please write code for some of the tasks not implemented in Swift.
Pages in category "Swift"
The following 517 pages are in this category, out of 517 total.
A
- A+B
- ABC problem
- ABC words
- Abundant odd numbers
- Abundant, deficient and perfect number classifications
- Accumulator factory
- Ackermann function
- Active object
- Add a variable to a class instance at runtime
- Address of a variable
- AKS test for primes
- Align columns
- Aliquot sequence classifications
- Almost prime
- Alternade words
- Amicable pairs
- Anagrams
- Angle difference between two bearings
- Angles (geometric), normalization and conversion
- Anonymous recursion
- Anti-primes
- Apply a callback to an array
- Approximate equality
- Arithmetic-geometric mean
- Arithmetic/Complex
- Arithmetic/Integer
- Arithmetic/Rational
- Array concatenation
- Array length
- Arrays
- Assertions
- Associative array/Creation
- Associative array/Iteration
- Associative array/Merging
- Atomic updates
- Attractive numbers
- Averages/Arithmetic mean
- Averages/Mean angle
- Averages/Mean time of day
- Averages/Mode
- Averages/Root mean square
- Averages/Simple moving average
B
C
- Caesar cipher
- Calculating the value of e
- Calendar
- Call a foreign-language function
- Call a function
- Call an object method
- Carmichael 3 strong pseudoprimes
- Cartesian product of two or more lists
- Case-sensitivity of identifiers
- Catalan numbers
- Catamorphism
- Character codes
- Chebyshev coefficients
- Chemical calculator
- Cheryl's birthday
- Chinese remainder theorem
- Cholesky decomposition
- Chowla numbers
- Church numerals
- Circles of given radius through two points
- Classes
- Closest-pair problem
- Closures/Value capture
- Combinations
- Combinations and permutations
- Combinations with repetitions
- Comma quibbling
- Command-line arguments
- Commatizing numbers
- Comments
- Compound data type
- Concurrent computing
- Constrained genericity
- Constrained random points on a circle
- Continued fraction
- Convex hull
- Conway's Game of Life
- Copy a string
- Count in factors
- Count in octal
- Count occurrences of a substring
- Count the coins
- CRC-32
- Create a two-dimensional array at runtime
- Cumulative standard deviation
- Currency
- Currying
- CUSIP
D
- Date format
- Day of the week
- Days between dates
- Deal cards for FreeCell
- Delegates
- Deming's Funnel
- Department numbers
- Determine if a string is collapsible
- Determine if a string is numeric
- Determine if only one instance is running
- Dijkstra's algorithm
- Discordian date
- Documentation
- Dot product
- Draw a sphere
E
- Egyptian division
- Emirp primes
- Empty program
- Empty string
- Enforced immutability
- Entropy
- Enumerations
- Environment variables
- Equilibrium index
- Ethiopian multiplication
- Euler's sum of powers conjecture
- Evaluate binomial coefficients
- Even or odd
- Evolutionary algorithm
- Exceptions
- Exceptions/Catch an exception thrown in a nested call
- Execute a Markov algorithm
- Execute Brain****
- Exponentiation operator
- Extensible prime generator
- Extreme floating point values
F
- Factorial
- Factorions
- Factors of a Mersenne number
- Factors of an integer
- Farey sequence
- Fast Fourier transform
- Feigenbaum constant calculation
- Fibonacci sequence
- Fibonacci word
- Filter
- Find common directory path
- Find largest left truncatable prime in a given base
- Find limit of recursion
- Find palindromic numbers in both binary and ternary bases
- Find the intersection of two lines
- Find the last Sunday of each month
- Find words with alternating vowels and consonants
- First power of 2 that has leading decimal digits of 12
- First-class functions
- FizzBuzz
- Flatten a list
- Flipping bits game
- Forward difference
- Four bit adder
- Fractal tree
- Function composition
- Function definition
- Functional coverage tree
- Fusc sequence
G
- Gapful numbers
- Gaussian elimination
- Generate lower case ASCII alphabet
- Generator/Exponential
- Generic swap
- Geohash
- Get system command output
- Gray code
- Greatest common divisor
- Greatest element of a list
- Greatest subsequential sum
- Guess the number
- Guess the number/With feedback
- Guess the number/With feedback (player)
H
- Hailstone sequence
- Handle a signal
- Happy numbers
- Harshad or Niven series
- Hash from two arrays
- Hash join
- Haversine formula
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newbie
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Heronian triangles
- Higher-order functions
- History variables
- Hofstadter Q sequence
- Hofstadter-Conway $10,000 sequence
- Horner's rule for polynomial evaluation
- Hostname
- HTTP
- HTTPS
- Huffman coding
I
J
K
L
- Lah numbers
- Langton's ant
- Last Friday of each month
- Leap year
- Least common multiple
- Left factorials
- Leonardo numbers
- Letter frequency
- Levenshtein distance
- Line circle intersection
- Linear congruential generator
- List comprehensions
- Literals/Floating point
- Literals/Integer
- Literals/String
- Logical operations
- Long primes
- Long year
- Longest common prefix
- Longest common subsequence
- Longest common substring
- Longest increasing subsequence
- Look-and-say sequence
- Loop over multiple arrays simultaneously
- Loops/Break
- Loops/Continue
- Loops/Do-while
- Loops/Downward for
- Loops/For
- Loops/For with a specified step
- Loops/Foreach
- Loops/Infinite
- Loops/N plus one half
- Loops/Nested
- Loops/While
- Lucas-Lehmer test
- Lucky and even lucky numbers
- Luhn test of credit card numbers
- Lychrel numbers
- LZW compression
M
- Machine code
- Magic squares of odd order
- Magnanimous numbers
- Man or boy test
- Map range
- Markov chain text generator
- Matrix multiplication
- Matrix transposition
- Maze generation
- McNuggets problem
- MD5/Implementation
- Menu
- Mian-Chowla sequence
- Middle three digits
- Miller–Rabin primality test
- Modular exponentiation
- Modular inverse
- Modulinos
- Monte Carlo methods
- Monty Hall problem
- Move-to-front algorithm
- Multifactorial
- Multiple distinct objects
- Munchausen numbers
- Mutual recursion
N
O
P
- Palindrome dates
- Palindrome detection
- Pangram checker
- Parallel calculations
- Parametric polymorphism
- Parsing/RPN calculator algorithm
- Parsing/Shunting-yard algorithm
- Partition an integer x into n primes
- Pascal's triangle
- Password generator
- Pattern matching
- Peaceful chess queen armies
- Pell's equation
- Percentage difference between images
- Percolation/Bond percolation
- Perfect numbers
- Perfect shuffle
- Perfect totient numbers
- Perlin noise
- Permutations
- Pernicious numbers
- Phrase reversals
- Pick random element
- Play recorded sounds
- Playing cards
- Polymorphic copy
- Polymorphism
- Polynomial long division
- Polynomial regression
- Population count
- Power set
- Price fraction
- Primality by trial division
- Prime decomposition
- Prime words
- Priority queue
- Problem of Apollonius
- Proper divisors
- Pythagorean quadruples
- Pythagorean triples
R
- Railway circuit
- Ramer-Douglas-Peucker line simplification
- Range extraction
- Read entire file
- Real constants and functions
- Reduced row echelon form
- Regular expressions
- Remove duplicate elements
- Rep-string
- Repeat
- Repeat a string
- Return multiple values
- Reverse a string
- Reverse words in a string
- RIPEMD-160
- Rock-paper-scissors
- Roman numerals/Decode
- Roman numerals/Encode
- Rot-13
- Run-length encoding
- Runge-Kutta method
S
- Safe addition
- Safe primes and unsafe primes
- Sattolo cycle
- Search a list
- Search a list of records
- Self-describing numbers
- Semiprime
- Semordnilap
- Sequence of primes by trial division
- Sequence of primorial primes
- Sequence: smallest number greater than previous term with exactly n divisors
- Sequence: smallest number with exactly n divisors
- Set
- Shoelace formula for polygonal area
- Short-circuit evaluation
- Sierpinski carpet
- Sierpinski triangle
- Sieve of Eratosthenes
- Singleton
- Singly-linked list/Element definition
- Sleep
- Smarandache prime-digital sequence
- Smith numbers
- Sort a list of object identifiers
- Sort an array of composite structures
- Sort an integer array
- Sort disjoint sublist
- Sort numbers lexicographically
- Sort three variables
- Sort using a custom comparator
- Sorting algorithms/Bogosort
- Sorting algorithms/Bubble sort
- Sorting Algorithms/Circle Sort
- Sorting algorithms/Cocktail sort
- Sorting algorithms/Cocktail sort with shifting bounds
- Sorting algorithms/Comb sort
- Sorting algorithms/Gnome sort
- Sorting algorithms/Heapsort
- Sorting algorithms/Insertion sort
- Sorting algorithms/Merge sort
- Sorting algorithms/Pancake sort
- Sorting algorithms/Quicksort
- Sorting algorithms/Selection sort
- Sorting algorithms/Shell sort
- Sorting algorithms/Sleep sort
- Sorting algorithms/Stooge sort
- Speech synthesis
- Spelling of ordinal numbers
- Split a character string based on change of character
- Square-free integers
- Stable marriage problem
- Stack
- Stair-climbing puzzle
- Stern-Brocot sequence
- String append
- String case
- String comparison
- String concatenation
- String interpolation (included)
- String length
- String matching
- String prepend
- Strip a set of characters from a string
- Strip block comments
- Strong and weak primes
- Subleq
- Substring
- Substring/Top and tail
- Sudoku
- Sum and product of an array
- Sum digits of an integer
- Sum multiples of 3 and 5
- Sum of a series
- Sum of squares
- Super-d numbers
- Sutherland-Hodgman polygon clipping
- Symmetric difference
- Synchronous concurrency
- System time
T
- Take notes on the command line
- Tau function
- Tau number
- Teacup rim text
- Temperature conversion
- Test a function
- Text between
- Textonyms
- The Twelve Days of Christmas
- Thiele's interpolation formula
- Tic-tac-toe
- Time a function
- Tokenize a string
- Tokenize a string with escaping
- Top rank per group
- Topological sort
- Towers of Hanoi
- Trabb Pardo–Knuth algorithm
- Truncatable primes