Results for “variable”
Small, practical examples. Search by task or narrow things down below.
Split a record while retaining its remainder
Bash Scripts: The final read variable receives the remainder of a delimited record.
Bash Scripts✓ Tested
Toggle an output using an explicit software state
Arduino / C: Keep the intended output state in a Boolean variable.
Arduino / C✓ Tested
Understand setup() and loop()
Arduino / C: See initialization run once and the main loop run repeatedly.
Arduino / C✓ Tested
Update a running count
Python: Change a variable after its initial value has been assigned.
Python✓ Tested
Update a running count
C#: Change a variable after its initial value has been assigned.
C#✓ Tested
Update a running count
Java: Change a variable after its initial value has been assigned.
Java✓ Tested
Update a running count
JavaScript: Change a variable after its initial value has been assigned.
JavaScript✓ Tested
Update a running count
TypeScript: Change a variable after its initial value has been assigned.
TypeScript✓ Tested
Update a running count
C++: Change a variable after its initial value has been assigned.
C++✓ Tested
Update a running count
C: Change a variable after its initial value has been assigned.
C✓ Tested
Use a build argument while creating an image
Docker / Compose: ARG supplies a build-time value that is not automatically a runtime environment variable.
Docker / Compose✓ Tested
Use a recursive function for a bounded calculation
Bash Scripts: A recursive factorial demonstrates local variables and a clear base case.
Bash Scripts✓ Tested