Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. class Animal{
  2. miauler: booleen;
  3. aboyer: booleen;
  4. voler: booleen;
  5. nager: booleen;
  6. photo: booleen;
  7. }
  8.  
  9.  
  10. interface QuatresPattes {
  11. Qpattes: booleen;
  12. }
  13.  
  14.  
  15. interface Couleur {
  16. noire: booleen;
  17.  
  18. }
  19.  
  20. class Chat extends Animal implements QuatresPattes{
  21. miauler = true;
  22. Qpattes: true;
  23.  
  24.  
  25. }
  26.  
  27. class ChatChartreux extends Cat {
  28.  
  29. }
  30.  
  31.  
  32.  
  33. class ChatEuropeen extends Chat implements Couleur {
  34. noire = true;
  35.  
  36. }
  37.  
  38.  
  39. class Chien extends Animal implements QuatresPattes{
  40. aboyer = true;
  41. Qpattes = true;
  42.  
  43. }
  44.  
  45. class ChienMoon extends Chien {
  46.  
  47. }
  48.  
  49. class ChienTerreNeuve extends Chien implements Couleur {
  50. noire = true;
  51.  
  52. }
  53.  
  54. class Oiseau extends Animal{
  55. voler = true;
  56. }
  57.  
  58. class Mesange extends Oiseau {
  59.  
  60. }
  61.  
  62. class Merle extends Animal implements Couleur {
  63. noire = true;
  64. }
  65.  
  66. interface Poisson extends Animal{
  67. nager = true;
  68. }
  69.  
  70. class Thon extends Poisson {
  71. }
  72.  
  73. class Requin extends Poisson {
  74. }
  75.  
  76. class Asticot extends Poisson {
  77.  
  78. }
  79.  
  80. function Photo(animaux :Animal) {
  81. console.log("Prenez moi en photo");
  82. }
  83.  
  84. function Miauler(chat : Chat) {
  85. if(chat.miauler == true)
  86. console.log("miauler");
  87. }
  88.  
  89. function Aboyer (chien: Chien) {
  90. if(chien.aboyer == true)
  91. console.log("aboyer");
  92. }
  93. function Voler(oiseau : Oiseau) {
  94. if(oiseau.voler == true)
  95. console.log("voler");
  96. }
  97.  
  98. function Nager(poisson : Poisson) {
  99. if(poisson.nager == true)
  100. console.log("nager");
  101. }
  102. function Caresser(animaux: QuatresPattes) {
  103. if(animaux.Qpattes == true)
  104. console.log("caresser");
  105. }
  106.  
  107. function Nourrir(animaux: Couleur){
  108. if(animaux.noire == true)
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement