newpage "eps", "tutorialvar2.eps", 70, 20

# Set binary sequence
#
let seq = java.lang.Integer.toBinaryString(45678)
let seqlen = length(seq)

# Draw sequence, showing black bars for bits
# that have the value '1'.
#
let i = 1
while i <= seqlen
do
  clearpath
  box i * 4, 5, i * 4 + 3, 15
  if (substr(seq, i, 1) eq "1")
  then
    color "black"
  else
    color "yellow"
  endif
  fill
  let i = i + 1
done
