microsynthera.net

e-mail rss

Push And Pull

class Muscle
  attr_accessor :tensed, :relaxed

  def initialize ()
    @tensed = false
    @relaxed = true
  end

  def push_pull ()
    @tensed  = !@tensed
    @relaxed = !@relaxed
  end
end

class Heart < Muscle
  attr_accessor :emotions, :age

  @@gamut = [
    :bliss, :joy, :excitement,
    :calm, :boredom, :fear,
    :anger, :disgust, :sadness
  ]

  def initialize ()
    super
    @emotions = [:bliss]
    @life = Array.new(rand * 122, :moment)
    @age = 0
  end

  def push_pull ()
    super
    @emotions << @@gamut.sample
    @age += 1
    if @age > @life.length
      throw :death, 'that is all'
    end
  end
end

a_beating_heart = Heart.new

# stumbling

loop do
  puts a_beating_heart.emotions
  sleep 1
  a_beating_heart.push_pull
end

# falling



Last updated on 10-Oct-2026.