Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Element{
- def contents:Array[String]
- def width: Int = if(height==0)0elsecontents(0).length
- def height: Int = contents.length
- def above(that: Element): Element =
- new ArrayElement(this.contents ++ that.contents)
- def beside(that: Element): Element=
- new ArrayElement(
- for(
- (line1, line2)<-this.contents zip that.contents
- ) yield line1+line2
- )
- override def toString = contents mkString "n"
- }
Add Comment
Please, Sign In to add comment