2019-12-09から1日間の記事一覧

AOJ(問題集)22

0210 The Squares むずかしかった。何とか自力で出来た。 Table = %W(E N W S) Man = Struct.new(:x, :y, :dir, :next_x, :next_y) do def next dx, dy = [[1, 0], [0, -1], [-1, 0], [0, 1]][self.dir] self.next_x, self.next_y = self.x + dx, self.y + d…