FIND YOUR NEXT FEW LINES

Results for “fold”

Small, practical examples. Search by task or narrow things down below.

668 snippets foundClear filters
Bash ScriptsDiagnostics & defensive scripting

Check whether a variable exists under nounset

Bash Scripts: The plus expansion distinguishes an unset variable without reading its missing value.

Bash Scripts✓ Tested
GoTesting & reusable helpers

Check whether bytes contain valid JSON

Check whether bytes contain valid JSON using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsLoops & decisions

Check whether input is a nonnegative integer

Reject empty input and nonnumeric characters before arithmetic.

validation✓ Tested
SQLiteJSON data

Check whether text is valid JSON

Reject malformed input before processing it.

json_valid✓ Tested
Linux CommandsGetting Started

Check whether two practice files match

Linux Commands: Check whether two practice files match using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
GoGetting Started

Choose a branch with if and else

Choose a branch with if and else using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsArguments & decisions

Choose among several numeric ranges

Bash Scripts: An if-elif chain evaluates branches in order and executes the first match.

Bash Scripts✓ Tested
Bash ScriptsGetting Started

Choose an action with case

Bash Scripts: Choose an action with case with a small standalone Bash program.

Bash Scripts✓ Tested
RustGetting Started

Choose an action with match

Choose an action with match in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsGetting Started

Choose between two script branches

Bash Scripts: Choose between two script branches with a small standalone Bash program.

Bash Scripts✓ Tested
RustGetting Started

Choose floating-point arithmetic

Choose floating-point arithmetic in a complete Rust program using the standard library.

Rust✓ Tested
GoGetting Started

Choose floating-point division

Choose floating-point division using a complete Go program with explicit sample inputs.

Go✓ Tested