Examples
The Examples folder holds example programs that show the current language features. It is also a playground for katas and for trying out new syntax. Every example can be tested, run and built:
strict Examples/FizzBuzz.strict
strict test Examples/FizzBuzz.strict
strict build Examples/FizzBuzz.strict
Showcase
Examples/Greeter.strict: members, a tested method and Run.
has text
has logger
Greet Text
Greeter("World").Greet is "Hello, World!"
Greeter("Strict").Greet is "Hello, Strict!"
"Hello, " + text + "!"
Run
constant english = Greeter("World")
constant strict = Greeter("Strict")
logger.Log(english.Greet)
logger.Log(strict.Greet)
Examples/ReverseList.strict: a for loop over a reversed range builds the result list.
has numbers
Reverse Numbers
ReverseList(1, 2, 3, 4).Reverse is (4, 3, 2, 1)
for Range(0, numbers.Length).Reverse
numbers(index)
Examples/ReduceButGrow.strict: * value multiplies all elements.
has numbers
GetMultiplicationOfNumbers Number
ReduceButGrow(2, 3, 4, 5).GetMultiplicationOfNumbers is 120
ReduceButGrow(120, 5, 40, 0).GetMultiplicationOfNumbers is 0
ReduceButGrow(2, 2, 2, 2).GetMultiplicationOfNumbers is 16
for numbers
* value
Examples/EvenFibonacci.strict: mutable variables, an early return, and an if/else as the result of a method.
has number
Sum Number
EvenFibonacci(100).Sum is 44
mutable first = 1
mutable second = 1
mutable total = 0
for Range(1, number)
let next = first + second
if next >= number
return total
total = AddIfEven(total, next)
first = second
second = next
total
AddIfEven(current Number, next Number) Number
EvenFibonacci(100).AddIfEven(2, 4) is 6
EvenFibonacci(100).AddIfEven(2, 3) is 2
if next % 2 is 0
current + next
else
current
More showcases are on the other pages: FizzBuzz, ArithmeticFunction, TemperatureConverter, Fibonacci, RemoveParentheses and RemoveDuplicateWords and Register.
All examples
Programs and katas
AreaCalculator: a rectangle's area and perimeter from width and height.ArithmeticFunction: applies the operation named by a text with a selectorif.AutofilledMutable: amutablemember gets a default when it isn't passed.Beeramid: kata that counts the complete levels of a beer can pyramid you can buy, recursively.ConvertingNumbers: converts a list of numbers to texts with aforexpression.EvenFibonacci: sums the even Fibonacci numbers below a limit (Project Euler 2).ExecuteOperation: adds or subtracts twoRegistervalues through operator methods.Fibonacci: the nth Fibonacci number with mutable variables and aRangeloop.FindFirstNonConsecutiveNumber: the first element that isn't one more than the one before it.FindNumberCount: counts the numbers in a range by producing 1 per iteration.FizzBuzz: classifies a number as Fizz, Buzz, FizzBuzz or itself.GcdCalculator: the greatest common divisor with Euclid's algorithm.Grade: turns a score into a letter grade withif/else if.Greeter: returns and logs "Hello, X!".HelloLogger: the minimal hello world, logs "Hi".InstructionandInstructionType: a toy virtual machine instruction and an enum of its kinds.LinkedListAnalyzer: counts loop steps up to a maximum with a mutable counter.MatchingLoopFinder: finds a matching loop bracket, from a Brainfuck interpreter kata.Node: returns its number plus one.NumberSummer: sums a list with a mutable total and logs it.Pixel: an RGB pixel withBrightenandDarken.Processor: returnstrue,falseor a text, showing aBoolean or Textreturn type.PureAdder: adds two numbers, the smallest pure function.ReduceButGrow: multiplies all numbers of a list with* value.Register: three numbers with+,-,*and/operator methods.RemoveDuplicateWords: keeps the first occurrence of each text.RemoveExclamation: removes every "!" from a text.RemoveParentheses: removes parenthesized parts of a text with a mutable nesting counter.ReverseList: reverses a list by iterating a reversedRange.ShorterPath: builds a direction text of "N" and "E" from north and east counts.SimpleCalculator: adds and multiplies two numbers.Sum: logs the sum of the numbers passed on the command line.TemperatureConverter: Celsius to Fahrenheit and Kelvin.
Base type tour, in Examples/BaseTypesTest:
BaseTypesTest: inline tests forBoolean,Number,Text,List,Range,Character,Dictionary,File,Errorandmutable.DirectoryTests: tested wrappers aroundDirectory.TextHelper: builds a greeting, used byBaseTypesTest.
Conversions between types, in Examples/CompactTypeTest: NumberHolder and ByteHolder convert into each other with from and to.
Parsing demos, in Examples/Parsing: ParseExpressions, ParseHelloLogger and ParseMethodHeaders classify source lines the way an early parser did.
Native smoke tests and probes: NativeArithmetic, NativeConditions, NativeLoop, NumberStats, MemoryPressure (appends 20,000 numbers to stress the collector), DirProbe and ProcessProbe.
Games, websites and larger programs
Built with Strict covers the growing DeltaEngine game collection, SoulCraft and application logic hosted by existing web stacks. The engine port provides shared rendering, input, audio and native services; game logic stays in Strict. C and C# interop lets existing applications use the same tested types.
Bigger programs
Machine Learning covers the newer NeuralNetworks and MachineLearning packages: perceptrons, recurrent networks, GRUs, evolutionary algorithms, classic classifiers, GPT-2 safetensors inference and Qwen3 GGUF inference.
The biggest Strict program is Strict itself. The packages described in Architecture are written in the same language, follow the same limits, and start every method with tests. ImageProcessing shows image codecs written in Strict, changing a mutable copy and returning it, and multidimensional loops.
