Even Odd in Elvish

Published on 07 January 2025 (Updated: 07 January 2025)

Welcome to the Even Odd in Elvish page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

use re

if (> 1 (count $args)) {
  echo "Usage: please input a number"
  exit 1
}

if (not (re:match '^[+-]?[0-9]+(\.[0-9]+)?$' $args[0])) {
  echo "Usage: please input a number"
  exit 1
}

if (== 0 (% $args[0] 2)) {
  echo Even
} else {
  echo Odd
}

Even Odd in Elvish was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.