Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,31 @@
@entry
def main {
var rgb = Rgb.new(0, 255, 255)
var hex = Hex.new("00ffff")
var color Color
color = hex
color.print
color = rgb
color.print
(hex as Color).print
}
interface Color {
def toString string
def print {
dynamic.console.log(self.toString)
}
}
class Rgb :: Color {
var r int, g int, b int
def toString string { return "rgb(\(r), \(g), \(b))" }
}
class Hex :: Color {
var code string
def toString string { return "#\(code)" }
}