boolToInt function

int boolToInt(
  1. bool value
)

Converts a boolean value to an integer.

Takes a bool value and returns an int (1 for true, 0 for false).

Implementation

int boolToInt(bool value) {
  return value ? 1 : 0;
}