/*
Exercise 1
You have to create a data type for representing a person. A person has a firstName, a lastName and probably an age. A person can be a normal human or super hero. And a super hero have a nickName, eventually a "human" identity. A human is just a normal person ! A super hero has super power. Super power can be what you want !
 */

sealed trait Person{
	def firstName():String
	def lastName():String
	def myage():Int
}

case class SuperHero(prenom:String, nom:String, vie:Int,nickName:String, POWA:String) extends Person{
	override def firstName()=prenom
	override def lastName()=nom
	override def myage()=vie
}

case class Human(prenom:String, nom:String, vie:Int) extends Person{
	override def firstName()=prenom
	override def lastName()=nom
	override def myage()=vie
}

object TestHero{
	def main(args:Array[String]):Unit={
		var l1: List[Person]=List()
		val h1=Human("A","B",10)
		val sh1=SuperHero("Mwa","Ahah",25,"Troll","Rire diabolique")
		l1=l1:+h1
		l1=l1:+sh1
		println(l1(0))
		println(l1(1))
	}
}
 /*
trait BST {
  // Add a value to a BST
  def add (value : Int) : BST
  // Test if a value is in a BST
  def in (value : Int) : Boolean
  // How to print a BST
  override def toString = "."
  // The sum of all values in the BST
  def sum : Int
  // Comparison of two BST (based on their sum)
  def <= (tree : BST) : Boolean
  // How to merge two BST
  def merge (tree : BST) : BST
}

case class Node (value : Int, left : BST, right : BST) extends BST {
}

object Empty extends BST {
}

object Week4 {
  def main (args: Array[String]): Unit = {
    val a = Empty.add(10).add(5).add(13).add(3).add(8)
    val b = a.add(7)
    val c = a.add(6)
    val d = Empty.add(1).add(2).add(3).add(3).add(4)

    println(b)
    println(d)

    println(b.merge(d))
    println(d.merge(b))
  }
}
*/
