daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Feb 12th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top