# Exercise: Building Vocabulary
#
# Good Seq code builds up layers of abstraction.
# Each word becomes part of your "vocabulary" for the problem.
#
# Example: A temperature converter
#   : c-to-f ( Int -- Int )
#       9 i.* 5 i./ drop 32 i.+
#   ;
#   # Now you can think in terms of c-to-f, not the formula
#
# Your task: Build a word `is-even?` that checks if a number is even.
# Hint: a number is even when its remainder after dividing by two
# is zero.
# When done, delete the marker line below.

# I AM NOT DONE

: is-even? ( Int -- Bool )
    # Your code here.
    # Hint: take the remainder modulo two (and drop the success
    # Bool that the operator returns), then test whether what
    # remains is zero.
    drop false
;

: test-helper-words ( -- )
    4 is-even?
    # Do not edit below this line
    test.assert
    7 is-even? not test.assert
;
