Vibescript Showcase

Approval chain

Showcase

Build a release approval process with states and deadlines.

Vibescript Showcase

Big integers

Showcase

Calculate factorials, Fibonacci numbers, and powers larger than 64 bits.

Vibescript Showcase

Chudnovsky π

Showcase

Calculate 100 digits of π with the Chudnovsky formula and big integers.

Vibescript Showcase

Digest schedule

Showcase

Schedule digest jobs from a cadence and a time window.

Vibescript Showcase

Escalation policy

Showcase

Route support tickets from their severity and response deadline.

Vibescript Showcase

Event timestamps

Showcase

Format RFC3339 timestamps with whole or fractional seconds.

Vibescript Showcase

Hash projection

Showcase

Remove, select, merge, and fetch fields from a hash.

Vibescript Showcase

Late fee

Showcase

Calculate a late fee from an overdue duration.

Vibescript Showcase

Late fee policy

Showcase

Choose a late fee from the account standing and days overdue.

Vibescript Showcase

Log digest

Showcase

Parse log lines, group them by level, and count each group.

Vibescript Showcase

Maintenance window

Showcase

Plan a maintenance window with environment rules, freeze notices, and durations.

Vibescript Showcase

Matrix report

Showcase

Turn rows of daily metrics into totals for each metric.

Vibescript Showcase

Numeric literals and rounding

Showcase

Read hex, octal, binary, and scientific numbers, then round them.

Vibescript Showcase

On-call handoff

Showcase

Build an on-call handoff from the coverage level and shift length.

Vibescript Showcase

Payout schedule

Showcase

Schedule payouts from the amount, cadence, and settlement delay.

Vibescript Showcase

Quote approval

Showcase

Send each quote to the right approval step based on its total.

Vibescript Showcase

Refund decision

Showcase

Use enums, money, and durations to decide whether to refund an order.

Vibescript Showcase

Release readiness

Showcase

Report whether a release is ready from its state, approvals, and schedule.

Vibescript Showcase

Reminder schedule

Showcase

Schedule reminders from a channel and lead time.

Vibescript Showcase

Reshape a list

Showcase

Split a list into pages and rolling windows, then sample values.

Vibescript Showcase

Resilient lookups

Showcase

Recover from missing hash keys and check float edge cases.

Vibescript Showcase

Retry backoff schedule

Showcase

Build an exponential retry schedule with enums, durations, and timestamps.

Vibescript Showcase

Send an email

Embedding

Build a welcome email and send it through a host email capability.

Vibescript Showcase

Send an SMS

Embedding

Write a delivery update and send it through a host SMS capability.

Vibescript Showcase

Session expiry

Showcase

Set a session expiry time from its risk level.

Vibescript Showcase

Shipping quote

Showcase

Calculate delivery dates and prices for each shipping speed.

Vibescript Showcase

Statement grid

Showcase

Turn rows of money values into totals for each category.

Vibescript Showcase

Subscription billing

Showcase

Price a subscription invoice from the plan and quantity.

Vibescript Showcase

Synchronous blocks

Showcase

Pass short-lived behavior directly to the function that uses it.

Vibescript Showcase

Text toolkit

Showcase

Split, align, and inspect text with Ruby-style string helpers.

Vibescript Showcase

Trial offer

Showcase

Build a trial offer from the account type and trial length.

Vibescript Showcase

Trial reminder

Showcase

Remind free users that their trial is ending, and skip everyone else.

Vibescript Showcase

Value boundaries

Showcase

Update arrays and hashes without changing the values held by aliases.

Vibescript Showcase

Word and symbol arrays

Showcase

Build explicit string and symbol arrays, with interpolation for generated names.

Arrays

Batch sensor readings

Reference

Split readings into batches, smooth them with a moving window, and find the gaps.

Arrays

Extras

Reference

Use array helpers to search, sort, combine, and inspect values.

Arrays

Rank a leaderboard

Reference

Sort scores, break ties by name, and pick out the podium.

Background

Jobs and Events

Reference

Queue jobs and publish events through APIs from the host app.

Background

Publish milestone events

Reference

Total a player's entries and publish an event for each milestone crossed.

Background

Stagger queued jobs

Reference

Spread follow-up jobs over time so the host's queue never gets a burst.

Basics

Functions and Calls

Reference

Define functions, call other functions, and return values.

Basics

Literals and Operators

Reference

Work with numbers, strings, arrays, hashes, and common operators.

Basics

Namespaces

Reference

Group constants and module functions under a namespace.

Blocks

Blocks Advanced

Reference

Filter, group, and reduce data with blocks.

Blocks

Enumerable Reports

Reference

Group donations and total the money in each currency.

Blocks

Blocks Transformations

Reference

Map, filter, and reduce collections with blocks.

Blocks

Yield Patterns

Reference

Write functions that accept and yield to blocks.

Capabilities

Context Access

Reference

Read the current user from context provided by the host app.

Capabilities

Database Queries

Reference

Query and update data through a database API from the host app.

Capabilities

Capabilities Iteration

Reference

Iterate over records returned by an API from the host app.

Collections

Collections Arrays

Reference

Read, build, and update arrays.

Collections

Hashes

Reference

Build, update, and read nested hashes.

Collections

Symbols

Reference

Use labels, strings, and symbols in one string-key hash space.

Control Flow

Case When

Reference

Match values and ranges with case and when.

Control Flow

Conditionals

Reference

Choose values with if, elsif, else, and unless.

Control Flow

Loop Control

Reference

Skip and stop loop iterations with next and break.

Control Flow

Recursion

Reference

Write factorial and Fibonacci functions with recursion.

Control Flow

Until Loop

Reference

Repeat work with an until loop.

Control Flow

While Loop

Reference

Repeat work with a while loop.

Durations

Describe durations for people

Reference

Break durations into days, hours, and minutes, and describe them in plain words.

Durations

Durations

Reference

Create durations and add them together.

Durations

Track support SLAs

Reference

Compare each ticket's wait against its priority's target and report time left.

Enums

Move an order through its states

Reference

Use an enum and an exhaustive case to allow only valid state changes.

Enums

Enums Operations

Reference

Define enums and inspect their values.

Enums

Sort tickets by priority

Reference

Give enum members a rank and a label, then sort and count tickets by them.

Errors

Assertions

Reference

Check inputs with assertions.

Errors

Collect validation errors

Reference

Validate each record, rescue the failures by class, and report them all at once.

Errors

Retry a flaky step

Reference

Rescue an error, retry a limited number of times, and always record how it ended.

Hashes

Layer nested settings

Reference

Merge default, team, and user settings, resolving conflicts key by key.

Hashes

Hashes Operations

Reference

Merge, search, and count values in hashes.

Hashes

Hashes Transformations

Reference

Rename, filter, and transform hash keys and values.

Loops

Loops Advanced

Reference

Nest loops and stop early with break.

Loops

Fizzbuzz

Reference

Write FizzBuzz with a loop and conditionals.

Loops

Loops Iteration

Reference

Iterate over ranges and arrays with common loop helpers.

Money

Money Operations

Reference

Add, subtract, and compare money values.

Money

Split a bill fairly

Reference

Divide money into equal shares without losing a cent, then add tip and tax.

Money

Total payments by currency

Reference

Group payments by currency and total each group, since money only adds within one currency.

Policies

Access Control

Reference

Write access rules as small functions.

Policies

Check permissions by role

Reference

Combine the current user's role with record ownership to decide what they may do.

Policies

Decide refund requests

Reference

Approve, escalate, or deny refunds with small rules that each explain themselves.

Ranges

Sort values into buckets

Reference

Use ranges in case branches to label values and count how many land in each bucket.

Ranges

Step through ranges

Reference

Walk ranges in steps, test membership, and clamp values into bounds.

Ranges

Usage

Reference

Create ascending and descending ranges, then filter their values.

Stdlib

Core Utilities

Reference

Parse JSON and time values, then create IDs.

Stdlib

Format and round numbers

Reference

Round, floor, and format numbers for reports, and do exact integer math.

Stdlib

Validate JSON input

Reference

Parse webhook JSON against a shape, handle optional fields, and reject bad payloads.

Strings

Build URL slugs

Reference

Turn titles into clean URL slugs, trim them to a length, and make them unique.

Strings

Format a text receipt

Reference

Line up columns with padding, center a heading, and wrap a long note.

Strings

Strings Operations

Reference

Normalize, split, search, and inspect strings.

Time

Count business days

Reference

Skip weekends and holidays to find a due date and count working days between two dates.

Time

Duration

Reference

Add durations to times and use duration arithmetic.

Time

Format and compare times

Reference

Parse timestamps, show them in other time zones and formats, and measure the gaps between them.

Rosetta Code Popular

ABC Problem

Intermediate

Determine whether a word can be formed from a fixed set of two-letter blocks without reusing a block.

Rosetta Code Popular

Ackermann Function

Intermediate

Run the Ackermann function on small inputs to show deep recursion.

Rosetta Code Popular

Balanced Brackets

Easy

Check whether bracket pairs are properly nested and closed by scanning the text with a stack.

Rosetta Code Popular

Binary Search

Easy

Locate values in a sorted array by repeatedly halving the remaining search interval.

Rosetta Code Popular

Caesar Cipher

Easy

Encode and decode text by rotating alphabetic characters through a fixed shift.

Rosetta Code

100 doors

Intro

Toggle one hundred doors and return the open door numbers.

Rosetta Code

99 Bottles of Beer

beginner

Generate the full 99 Bottles of Beer song from 99 down to 0.

Rosetta Code

Rosetta Code A+B

Intro

Add fixed integer pairs and return the resulting sums.

Rosetta Code

Rosetta Code A+B

Intro

Return the sum of integer pairs.

Rosetta Code

Abbreviations, automatic

Intro

Compute the shortest unique command prefixes for a fixed command set and resolve sample abbreviations.

Rosetta Code

Abbreviations, simple

Intro

Resolve simple command abbreviations by matching unique prefixes from a fixed command list.

Rosetta Code

Abundant odd numbers

Intro

Check a few well-known odd abundant numbers by comparing them with their proper divisor sums.

Rosetta Code

Abundant, deficient and perfect number classifications

Intro

Classify sample integers by comparing them with the sum of their proper divisors.

Rosetta Code

Align columns

Medium

Align Rosetta Code's dollar-delimited sample text into left, right, and centered columns.

Rosetta Code

Aliquot sequence classifications

Medium

Build short aliquot sequences and classify whether they terminate, loop, or are perfect.

Rosetta Code

Anagrams

Intro

Group a fixed word list into anagram sets using sorted-letter signatures.

Rosetta Code

Angle difference between two bearings

Intro

Compute the smallest signed turn needed to move from one bearing to another.

Rosetta Code

Angles (geometric), normalization and conversion

Intro

Normalize degree angles and convert between degrees and radians for fixed sample values.

Rosetta Code

Rosetta Code Arrays

Intro

Create, index, append to, and total arrays.

Rosetta Code

Bacon cipher

Medium

Encode and decode short messages with Bacon's five-letter A/B cipher.

Rosetta Code

Balanced ternary

Intermediate

Convert small signed integers into balanced ternary using 1, 0, and T digits.

Rosetta Code

Best shuffle

Medium

Produce a low-fixed-point shuffle by rotating the sorted characters of a word.

Rosetta Code

Binary digits

Intro

Convert fixed non-negative integers into binary strings.

Rosetta Code

Binary strings

Intro

Generate all binary strings of a fixed length with a simple recursive builder.

Rosetta Code

Bitwise operations

Medium

Run common bitwise operations with a hand-built 8-bit model.

Rosetta Code

Box the compass

Medium

Map degree headings to the correct 32-point compass names for the Rosetta Code sample bearings.

Rosetta Code

Brazilian numbers

Medium

Find the first Brazilian numbers by searching for bases whose representation uses one repeated digit.

Rosetta Code

Bubble sort

Easy

Sort an array of integers using the bubble sort algorithm.

Rosetta Code

Call a function

Intro

Call functions with positional arguments and combine their results.

Rosetta Code

Cartesian product of two or more lists

Intro

Build Cartesian products iteratively for a pair of lists and a three-list input.

Rosetta Code

Catalan numbers

Intro

Generate the opening Catalan numbers with the standard multiplicative recurrence.

Rosetta Code

Chinese zodiac

Intro

Map sample years to their Chinese zodiac animal and element.

Rosetta Code

Conditional structures

Intro

Classify values with if, elsif, and else branches.

Rosetta Code

Day of the week

Intro

Compute weekdays for fixed Gregorian dates with Zeller's congruence.

Rosetta Code

Determine if a string is numeric

Intro

Recognize simple signed integer and decimal strings.

Rosetta Code

Determine if a string is squeezable

Intro

Collapse repeated adjacent characters and compare the squeezed result with a target string.

Rosetta Code

Digital root

Easy

Compute the digital root and additive persistence of a non-negative integer.

Rosetta Code

Discordian date

Medium

Convert Gregorian dates into the Discordian calendar.

Rosetta Code

Dot product

Intro

Compute the dot product of two vectors of equal length.

Rosetta Code

Ethiopian multiplication

Intro

Multiply two integers by repeated halving, doubling, and summing odd rows.

Rosetta Code

Factorial

Intro

Compute factorial values both recursively and iteratively, well past the 64-bit range.

Rosetta Code

Factors of an integer

Intro

Compute all positive factors of a small positive integer with trial division up to its square root.

Rosetta Code

Farey sequence

Medium

Generate Farey sequences of small orders with the classic iterative recurrence.

Rosetta Code

Fibonacci n-step number sequences

Intro

Generate Tribonacci and Tetranacci sequences by summing the previous n terms.

Rosetta Code

Fibonacci sequence

Intro

Produce the opening terms of the Fibonacci sequence iteratively.

Rosetta Code

Fibonacci word

Intro

Build the opening Fibonacci words by concatenating the two previous terms.

Rosetta Code

Find palindromic numbers in both binary and ternary bases

Medium

Search for numbers whose binary and ternary representations are both palindromes.

Rosetta Code

Find words which contain the most consonants

Intro

Count consonants in a fixed word list and return the words with the highest totals.

Rosetta Code

FizzBuzz

Intro

Emit the classic FizzBuzz sequence up to a chosen limit.

Rosetta Code

Floyd's triangle

Intro

Generate the opening rows of Floyd's triangle.

Rosetta Code

Four bit adder

Easy

Add two four-bit binary values and return the carry with the result bits.

Rosetta Code

Fraction reduction

Intro

Reduce sample fractions to lowest terms with Euclid's algorithm.

Rosetta Code

Gray code

Medium

Generate the 4-bit Gray code sequence with the standard reflective construction.

Rosetta Code

Greatest common divisor

Intro

Compute greatest common divisors with the iterative Euclidean algorithm on a fixed sample set.

Rosetta Code

Greedy algorithm for Egyptian fractions

Medium

Decompose sample rational numbers into Egyptian fractions with the standard greedy method, including inputs whose unit-fraction denominators run to 25 digits.

Rosetta Code

Hailstone sequence

Intro

Build a hailstone sequence and report its length.

Rosetta Code

Hamming numbers

Intermediate

Generate the opening Hamming numbers with the classic 2-3-5 pointer technique.

Rosetta Code

Happy numbers

Intro

Classify happy numbers by iterating the sum-of-squares process and list the first twelve.

Rosetta Code

Harshad or Niven series

Easy

Find Harshad (Niven) numbers, which are divisible by the sum of their digits.

Rosetta Code

Heronian triangles

Medium

Search a small side-length range for Heronian triangles with integer area.

Rosetta Code

Humble numbers

Intermediate

Generate humble numbers with the standard 2-3-5-7 pointer technique.

Rosetta Code

I before E except after C

Intro

Check sample words against the classic “i before e except after c” spelling rule.

Rosetta Code

Insertion sort

Easy

Sort an array by repeatedly inserting each element into its correct position.

Rosetta Code

Isqrt (integer square root) of X

Intro

Compute integer square roots with a binary search over fixed sample inputs.

Rosetta Code

Josephus problem

Medium

Find the survivor position in the Josephus problem for n people counting every k-th.

Rosetta Code

Kaprekar numbers

Intro

Test fixed integers for the Kaprekar split-square property.

Rosetta Code

Kaprekar routine

Medium

Apply the Kaprekar routine to a 4-digit number and watch it converge to 6174.

Rosetta Code

Last letter-first letter

Intermediate

Build a word chain where each next word starts with the previous word's last letter.

Rosetta Code

Leap year

Intro

Determine whether a given year is a leap year using the Gregorian calendar rules.

Rosetta Code

Letter frequency

Intro

Count alphabetic character frequencies in a sample phrase.

Rosetta Code

Levenshtein distance

Medium

Compute edit distance with insert, delete, and substitute operations using a single rolling row.

Rosetta Code

Long multiplication

Intro

Break a multiplication problem into the partial products used by long multiplication.

Rosetta Code

Look-and-say sequence

Easy

Generate terms of the look-and-say sequence where each term describes the digits of the previous one.

Rosetta Code

Luhn test of credit card numbers

Easy

Validate account numbers with the Luhn checksum.

Rosetta Code

Lychrel numbers

Intro

Check sample numbers for palindrome formation under 200 rounds of the reverse-and-add process, where sums grow far past 64 bits.

Rosetta Code

Magic squares of odd order

Medium

Build a 3x3 magic square with the classic Siamese method.

Rosetta Code

Matrix multiplication

Medium

Multiply two small matrices.

Rosetta Code

Matrix transposition

Easy

Transpose a matrix by swapping its rows and columns with the built-in Array#transpose.

Rosetta Code

Middle three digits

Intro

Return the middle three digits of integers that have an odd number of digits.

Rosetta Code

Minimum multiple of m where digital sum equals m

Intro

Search small multiples until the digit sum matches the divisor.

Rosetta Code

Morse code

Easy

Encode text to Morse code using a fixed A-Z and digit lookup table.

Rosetta Code

Multiplication tables

Intro

Build a small multiplication table as nested arrays.

Rosetta Code

N-smooth numbers

Intro

Generate the first twenty 5-smooth numbers by stripping allowed small factors.

Rosetta Code

Narcissistic decimal number

Intro

Identify fixed sample numbers that equal the sum of their digits raised to the digit count.

Rosetta Code

Natural sorting

Medium

Sort filenames by comparing embedded digit runs numerically instead of lexicographically.

Rosetta Code

Number names

Intermediate

Spell small whole numbers in English.

Rosetta Code

Numerical integration

Intro

Approximate definite integrals with the trapezoidal rule over fixed functions.

Rosetta Code

Palindrome detection

Intro

Detect palindromes after normalizing letters and digits to lowercase.

Rosetta Code

Palindromic gapful numbers

Medium

Find the first palindromic gapful numbers in a bounded decimal range.

Rosetta Code

Pangram checker

Intro

Check whether a sentence contains every letter of the alphabet at least once.

Rosetta Code

Parse an IP Address

Easy

Parse dotted IPv4 strings into four validated octets.

Rosetta Code

Pascal's triangle

Intro

Generate the opening rows of Pascal's triangle iteratively.

Rosetta Code

Permutations

Intro

Generate every permutation of three items with a simple recursive backtracking routine.

Rosetta Code

Pig Latin

Easy

Translate English words into Pig Latin by moving leading consonants and appending ay.

Rosetta Code

Playing cards

Intro

Construct a standard 52-card deck from suit and rank combinations.

Rosetta Code

Prime decomposition

Medium

Find the prime factors of composite integers with trial division.

Rosetta Code

Priority queue

Medium

Model a simple highest-priority-first queue with sorted insertion over an array-backed store.

Rosetta Code

Pythagorean triples

Intro

Enumerate small Pythagorean triples with bounded hypotenuse.

Rosetta Code

Range extraction

Medium

Compress an ordered list of integers into Rosetta Code's comma-and-range string format.

Rosetta Code

Roman numerals/Decode

Easy

Convert a Roman numeral string back to its integer value.

Rosetta Code

Roman numerals/Encode

Easy

Convert an integer to its Roman numeral representation.

Rosetta Code

Rot-13

Intro

Encode and decode text by rotating letters by thirteen positions.

Rosetta Code

Run-length encoding

Easy

Encode and decode a short sample string with classic run-length encoding.

Rosetta Code

Selection sort

Easy

Sort an array by repeatedly selecting the minimum element from the unsorted portion.

Rosetta Code

Sequence of primorial primes

Medium

Check primorial minus one and plus one values for primality over a short prime prefix.

Rosetta Code

Set

Intro

Find the union, intersection, and difference of array-backed sets.

Rosetta Code

Show ASCII table

Intro

Return a compact slice of ASCII rows with code, character, and ordinal data.

Rosetta Code

Sieve of Eratosthenes

Intro

Generate the prime numbers up to fifty with the classic sieve.

Rosetta Code

Smith numbers

Medium

Detect Smith numbers by comparing the digit sum of a composite integer with the digit sum of its prime factors.

Rosetta Code

Spiral matrix

Medium

Fill a square matrix in clockwise spiral order.

Rosetta Code

Square-free integers

Intro

List the square-free integers up to thirty.

Rosetta Code

Stack

Easy

Model a small LIFO stack with push, pop, and peek over an array-backed store.

Rosetta Code

String comparison

Intro

Compare sample string pairs lexicographically and report the sign of each comparison.

Rosetta Code

String matching

Intro

Find every starting index of a pattern inside a fixed string with a naive scan.

Rosetta Code

Substring

Intro

Extract substrings from a source string using start offsets and lengths.

Rosetta Code

Sum multiples of 3 and 5

Intro

Sum the integers below fixed limits that are divisible by three or five.

Rosetta Code

Taxicab numbers

Medium

Search a small cube-sum table for numbers that can be written as two sums of two cubes.

Rosetta Code

Temperature conversion

Intro

Convert values between Celsius and Fahrenheit.

Rosetta Code

Ternary logic

Medium

Build a small truth table for three-valued logic with true, maybe, and false states.

Rosetta Code

Top rank per group

Intro

Pick the highest-scoring row from each group with a stable tie-break on name.

Rosetta Code

Topological sort

Medium

Topologically sort a small dependency graph with Kahn's algorithm.

Rosetta Code

Total circles area

Intro

Sum the areas of several circles from their radii.

Rosetta Code

Towers of Hanoi

Medium

Solve Towers of Hanoi recursively and return each move in order.

Rosetta Code

Tree traversal

Medium

Traverse a small binary tree in preorder, inorder, postorder, and level order.

Rosetta Code

Truth table

Intro

Enumerate boolean combinations for common logical operators.

Rosetta Code

UPC

Intro

Validate sample UPC codes with the standard checksum rule.

Rosetta Code

URL parser

Intro

Parse a fixed URL into scheme, host, path, and query parameters.

Rosetta Code

UTF-8 encode and decode

Medium

Encode fixed code points into UTF-8 byte arrays and decode them back.

Rosetta Code

Variables

Intro

Show variable assignment, reassignment, and derived values.

Rosetta Code

Vector products

Intro

Compute the dot product and cross product of two fixed three-dimensional vectors.

Rosetta Code

Vigenère cipher

Medium

Encode and decode a short uppercase message with a fixed Vigenère key.

Rosetta Code

Word frequency

Intro

Count the frequency of normalized words in a short sample passage.

Rosetta Code

Word wrap

Intro

Wrap a paragraph with the standard greedy algorithm at two different column widths.

Rosetta Code

Zeckendorf number representation

Medium

Represent integers as sums of non-consecutive Fibonacci numbers using Zeckendorf's theorem.

Rosetta Code

Zig-zag matrix

Medium

Fill a small square matrix with zig-zag diagonal ordering.