Sha256: 76c6d773ad2b983e828d254de48b6c68ccdc326290d8ee596d6b024485ec7e43
Contents?: true
Size: 666 Bytes
Versions: 6
Compression:
Stored size: 666 Bytes
Contents
require_relative "dotter" module Vamp module Graphic # simple sample implementation for a graphic basic implementation class TextDotter < Dotter def dot(x, y) super @data[y][x] = "X" self end def dot?(x, y) super @data[y][x] == "X" end def undot(x, y) super @data[y][x] = " " self end def clear @data = Array.new(height) { Array.new(width, " ") } self end def screen line = "+" + "-" * width + "+\n" line + @data.map { |x| "|#{x.join('')}|" }.join("\n").to_s + "\n" + line end end end end
Version data entries
6 entries across 6 versions & 1 rubygems