From 5085b817774b696e13ccd434b16b31f32516b49c Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Thu, 25 Jun 2015 17:13:41 -0700 Subject: [PATCH] fix organization --- src/{ => moonscript}/itoa.moon | 0 src/visitor/Tupfile | 3 --- src/visitor/main.go | 43 ---------------------------------- 3 files changed, 46 deletions(-) rename src/{ => moonscript}/itoa.moon (100%) delete mode 100644 src/visitor/Tupfile delete mode 100644 src/visitor/main.go diff --git a/src/itoa.moon b/src/moonscript/itoa.moon similarity index 100% rename from src/itoa.moon rename to src/moonscript/itoa.moon diff --git a/src/visitor/Tupfile b/src/visitor/Tupfile deleted file mode 100644 index 4883b55..0000000 --- a/src/visitor/Tupfile +++ /dev/null @@ -1,3 +0,0 @@ -include_rules - -: main.go |> !gccgo |> ../../bin/visitor diff --git a/src/visitor/main.go b/src/visitor/main.go deleted file mode 100644 index 4b184ca..0000000 --- a/src/visitor/main.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -// Shape defines the base for shape functions -type Shape interface { - Area() float64 - Perimeter() float64 -} - -type Square struct { - Shape - Arm float64 -} - -func (s *Square) Area() float64 { - return s.Arm * s.Arm -} - -func (s *Square) Perimeter() float64 { - return s.Arm * 4 -} - -type Triangle struct { - Shape - Base float64 - Height float64 -} - -func (t *Triangle) Area() float64 { - return (t.Base * t.Height) / 2 -} - -func (t *Triangle) Perimeter() float64 { - return 0.0 // I forgot how to do this from just base and height. -} - -func main() { - t := &Triangle{ - Base: 15, - Height: 30, - } - - myT := t.(Shape) -}