Forth
'''Forth''', a procedural, stack-oriented and reflective programming language without type checking, Forth features both interactive execution of commands (making it suitable as a shell for systems that lack a more formal operating system) and the ability to compile sequences of commands for later execution. Some Forth versions (especially early ones) compile threaded code, but many implementations today generate optimized machine code like other language compilers.
Where not otherwise specified, examples conform to the 1994 ANSI Standard, also known as '''ANS Forth'''. Most Forth implementations now conform to this standard, often with system-specific extensions and convenience libraries. Some examples use words that are not in the standard, but which have become accepted as common practice since 1994. Standard words should be uppercase, but most Forth systems are case-insensitive.
Citations
Tasks
- 100 doors
- 15 Puzzle Game
- 2048
- 9 billion names of God the integer
- A+B
- AKS test for primes
- Abbreviations, simple
- Abelian sandpile model
- Abstract type
- Abundant, deficient and perfect number classifications
- Accumulator factory
- Ackermann function
- Add a variable to a class instance at runtime
- Address of a variable
- Align columns
- Anonymous recursion
- Apply a callback to an array
- Arithmetic-geometric mean
- Arithmetic/Complex
- Arithmetic/Integer
- Arithmetic/Rational
- Array concatenation
- Array length
- Arrays
- Assertions
- Associative array/Creation
- Associative array/Iteration
- Averages/Arithmetic mean
- Averages/Median
- Averages/Pythagorean means
- Averages/Root mean square
- Averages/Simple moving average
- Babbage problem
- Balanced brackets
- Benford's law
- Binary digits
- Binary search
- Binary strings
- Bitmap
- Bitmap/Flood fill
- Bitmap/Histogram
- Bitmap/Midpoint circle algorithm
- Bitmap/Read a PPM file
- Bitmap/Write a PPM file
- Bitwise IO
- Bitwise operations
- Boolean values
- Break OO privacy
- Bresenham's Line Algorithm
- Bulls and cows
- CRC-32
- CSV to HTML translation
- Caesar cipher
- Calculating the value of e
- Call a foreign-language function
- Call a function
- Call an object method
- Case-sensitivity of identifiers
- Catalan numbers
- Catamorphism
- Character codes
- Check that file exists
- Chinese remainder theorem
- Classes
- Closures/Value capture
- Collections
- Colour bars/Display
- Comma quibbling
- Command-line arguments
- Comments
- Compare a list of strings
- Compile-time calculation
- Compiler/AST interpreter
- Compiler/code generator
- Compiler/lexical analyzer
- Compiler/syntax analyzer
- Compiler/virtual machine interpreter
- Compound data type
- Concurrent computing
- Conditional structures
- Constrained genericity
- Continued fraction
- Convert decimal number to rational
- Convert seconds to compound duration
- Copy a string
- Count in factors
- Count in octal
- Count occurrences of a substring
- Count the coins
- Create a file
- Create a two-dimensional array at runtime
- Create an HTML table
- Create an object at a given address
- Cumulative standard deviation
- Currying
- Date format
- Day of the week
- Define a primitive data type
- Delegates
- Delete a file
- Detect division by zero
- Determinant and permanent
- Determine if a string is numeric
- Digital root
- Dinesman's multiple-dwelling problem
- Documentation
- Dot product
- Dragon curve
- Draw a clock
- Dutch national flag problem
- Dynamic variable names
- Echo server
- Empty program
- Empty string
- Entropy
- Enumerations
- Environment variables
- Ethiopian multiplication
- Euler method
- Euler's sum of powers conjecture
- Evaluate binomial coefficients
- Even or odd
- Evolutionary algorithm
- Exceptions
- Execute Brainfuck
- Execute HQ9+
- Execute a system command
- Exponentiation operator
- Extend your language
- Extract file extension
- Extreme floating point values
- Factorial
- Factors of a Mersenne number
- Fibonacci n-step number sequences
- Fibonacci sequence
- Filter
- Find limit of recursion
- Find the missing permutation
- First-class functions
- FizzBuzz
- Flatten a list
- Flow-control structures
- Floyd's triangle
- Forest fire
- Formatted numeric output
- Forward difference
- Four bit adder
- Function composition
- Function definition
- Function frequency
- Gamma function
- General FizzBuzz
- Generate Chess960 starting position
- Generate lower case ASCII alphabet
- Generator/Exponential
- Generic swap
- Gray code
- Grayscale image
- Greatest common divisor
- Greatest element of a list
- Greatest subsequential sum
- Guess the number
- HTTP
- Hailstone sequence
- Hamming numbers
- Handle a signal
- Happy numbers
- Hash join
- Haversine formula
- Hello world!
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Here document
- Higher-order functions
- History variables
- Holidays related to Easter
- Horizontal sundial calculations
- Horner's rule for polynomial evaluation
- Host introspection
- Hostname
- IBAN
- Identity matrix
- Include a file
- Increment a numerical string
- Infinity
- Inheritance/Single
- Input loop
- Integer comparison
- Integer sequence
- Interactive programming
- Introspection
- Jensen's Device
- Josephus problem
- Jump anywhere
- Kaprekar numbers
- Keyboard input/Keypress check
- Keyboard input/Obtain a Y or N response
- Knapsack problem/0-1
- Knapsack problem/Continuous
- Knapsack problem/Unbounded
- Knuth shuffle
- LZW compression
- Langton's ant
- Leap year
- Least common multiple
- Left factorials
- Letter frequency
- Levenshtein distance
- Linear congruential generator
- Literals/Floating point
- Literals/Integer
- Literals/String
- Logical operations
- 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
- Luhn test of credit card numbers
- MD5
- Magic 8-Ball
- Man or boy test
- Mandelbrot set
- Map range
- Matrix multiplication
- Matrix transposition
- Memory allocation
- Memory layout of a data structure
- Menu
- Metaprogramming
- Middle three digits
- Modular inverse
- Modulinos
- Monte Carlo methods
- Monty Hall problem
- Morse code
- Multifactorial
- Multiple distinct objects
- Multiplication tables
- Munchausen numbers
- Musical scale
- Mutual recursion
- N'th
- N-queens problem
- Named parameters
- Naming conventions
- Narcissist
- Narcissistic decimal number
- Non-decimal radices/Convert
- Non-decimal radices/Input
- Non-decimal radices/Output
- Nth root
- Null object
- Number reversal game
- Numerical integration
- Odd word problem
- Old lady swallowed a fly
- One of n lines in a file
- One-dimensional cellular automata
- OpenGL
- Operator precedence
- Ordered words
- Palindrome detection
- Pangram checker
- Pascal's triangle
- Percentage difference between images
- Perceptron
- Perfect numbers
- Permutations by swapping
- Pig the dice game
- Playing cards
- Pointers and references
- Polymorphic copy
- Polymorphism
- Population count
- Power set
- Price fraction
- Primality by trial division
- Prime decomposition
- Probabilistic choice
- Program name
- Program termination
- Pythagorean triples
- Quaternion type
- Queue/Definition
- Queue/Usage
- Quine
- Random number generator (device)
- Random numbers
- Range expansion
- Range extraction
- Read a configuration file
- Read a file line by line
- Read entire file
- Real constants and functions
- Regular expressions
- Remove duplicate elements
- Rename a file
- Rep-string
- Repeat
- Repeat a string
- Respond to an unknown method call
- Return multiple values
- Reverse a string
- Reverse words in a string
- Roman numerals/Decode
- Roman numerals/Encode
- Roots of a quadratic function
- Roots of unity
- Rot-13
- Run-length encoding
- Runtime evaluation
- Runtime evaluation/In an environment
- SEDOLs
- Sailors, coconuts and a monkey problem
- Search a list
- Self-describing numbers
- Semordnilap
- Send an unknown method call
- Sequence of non-squares
- Set
- Seven-sided dice from five-sided dice
- Shell one-liner
- Short-circuit evaluation
- Show Ascii table
- Show the epoch
- Sierpinski carpet
- Sierpinski triangle
- Sieve of Eratosthenes
- Simple database
- Simple windowed application
- Singleton
- Singly-linked list/Element definition
- Singly-linked list/Element insertion
- Singly-linked list/Traversal
- Sleep
- Sockets
- Sort an integer array
- Sort three variables
- Sorting Algorithms/Circle Sort
- Sorting algorithms/Bubble sort
- Sorting algorithms/Cocktail sort
- Sorting algorithms/Comb sort
- Sorting algorithms/Gnome sort
- Sorting algorithms/Heapsort
- Sorting algorithms/Insertion sort
- Sorting algorithms/Merge sort
- Sorting algorithms/Quicksort
- Sorting algorithms/Selection sort
- Sorting algorithms/Shell sort
- Soundex
- Special characters
- Special variables
- Spinning rod animation/Text
- Split a character string based on change of character
- Stack
- Stack traces
- Stair-climbing puzzle
- Start from a main routine
- Stem-and-leaf plot
- String append
- String case
- String comparison
- String concatenation
- String length
- String matching
- String prepend
- Strip a set of characters from a string
- Strip comments from a string
- Strip control codes and extended characters from a string
- Strip whitespace from a string/Top and tail
- Subleq
- Substring
- Substring/Top and tail
- Sudoku
- Sum digits of an integer
- Sum multiples of 3 and 5
- Sum of a series
- Sum of squares
- Sum to 100
- Symmetric difference
- Synchronous concurrency
- System time
- Take notes on the command line
- Tamagotchi emulator
- Temperature conversion
- Terminal control/Clear the screen
- Terminal control/Coloured text
- Terminal control/Cursor movement
- Terminal control/Cursor positioning
- Terminal control/Dimensions
- Terminal control/Display an extended character
- Terminal control/Ringing the terminal bell
- Text processing/1
- Text processing/Max licenses in use
- The Twelve Days of Christmas
- Time a function
- Tokenize a string
- Top rank per group
- Topic variable
- Topological sort
- Trabb Pardo–Knuth algorithm
- Tree traversal
- Trigonometric functions
- Twelve statements
- Two Sum
- Ulam spiral (for primes)
- Unicode variable names
- Unix/ls
- Van der Corput sequence
- Variable size/Get
- Variables
- Variadic function
- Vector products
- Verify distribution uniformity/Naive
- Walk a directory/Non-recursively
- Walk a directory/Recursively
- Web scraping
- Window creation
- Wireworld
- Word wrap
- Write float arrays to a text file
- XML/DOM serialization
- XML/Input
- XML/Output
- Y combinator
- Zeckendorf number representation
- Zero to the zero power
- Zig-zag matrix