Guest User

Untitled

a guest
Feb 12th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. abstract class Element{
  2. def contents:Array[String]
  3. def width: Int = if(height==0)0elsecontents(0).length
  4. def height: Int = contents.length
  5. def above(that: Element): Element =
  6. new ArrayElement(this.contents ++ that.contents)
  7. def beside(that: Element): Element=
  8. new ArrayElement(
  9. for(
  10. (line1, line2)<-this.contents zip that.contents
  11. ) yield line1+line2
  12. )
  13. override def toString = contents mkString "n"
  14. }
Add Comment
Please, Sign In to add comment