アルゴリズムC第二巻amazon:4764902567のお勉強を、Rubyで始めてみます。 とっかかりのアイデアはid:technohippyさんの過去日記 http://d.hatena.ne.jp/technohippy/20070719#1184868435 から頂きます。ありがとうございます。 ベースのクラスを作成します。ほぼid:technohippyさんのコピーですが、多角形Polygonに関してのみ追加しています。 class GeoBase attr_accessor :screen class Point attr_accessor :x, :y def initialize(x, y); @x, @y = x, y end def to_s; "(#{x}, #{y})" end def inspect; to_s end def ==(p1); x == p1.x a