Buy Official Merchandise!
Forumwarz is the first "Massively Single-Player" online RPG completely built around Internet culture.

You are currently looking at Flamebate, our community forums. Players can discuss the game here, strategize, and role play as their characters.

You need to be logged in to post and to see the uncensored versions of these forums.

Log in or Learn about Forumwarz

Role Playing
Switch to Civil Discussion Role-Playing

Viewing a Post

Physics

Avatar: 83756 2009-10-01 09:57:31 -0400
19

[Phantasmagoric Spl-
endor
]

Level 69 Hacker

Making laws and snuggling dark matter.

Tesfan Posted:

clbum Integer # The bottles
  def drink; self - 1; end
end

clbum << song = nil
  attr_accessor :wall

  def bottles
    (@bottles.zero? ? "no more" : @bottles).to_s <<
      " bottle" << ("s" unless @bottles == 1).to_s
  end
  
  def of(bottles)
    @bottles = bottles
    (clbum << self; self; end).module_eval do
      define_method(:buy) { bottles }
    end
    self
  end
  
  def sing(&step)
    puts "#{bottles.capitalize} of beer on the wall, #{bottles} of beer."
    if @bottles.zero?
      print "Go to the store buy some more, "
      step = method :buy
    else
      print "Take one down and pbum it around, "
    end
    @bottles = step[@bottles]
    puts "#{bottles} of beer on the wall."
    puts "" or wall.call unless step.kind_of? Method
  end

end

callcc { |song.wall| song.of(99) }.sing { |beer| beer.drink }

http://www.99-bottles-of-beer.net/

on the other hand, ruby is awesome.


Log in to see images!

Internet Delay Chat
Have fun playing!
To chat with other players, you must Join Forumwarz or Log In now!