Guest User

Untitled

a guest
Mar 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. class Animaux {
  2.  
  3. }
  4. interface Noir {
  5. noir: boolean
  6. }
  7. interface QuatrePattes {
  8. quatrePattes: boolean
  9. }
  10.  
  11. //
  12. class Chat extends Animaux {
  13. quatrePattes: boolean;
  14. }
  15. class Euro extends Chat {
  16. noir: boolean;
  17.  
  18. }
  19. class Chartreux extends Chat {
  20.  
  21. }
  22.  
  23. class Chien extends Animaux {
  24.  
  25. }
  26. class TerreNeuve extends Chien {
  27. noir: boolean;
  28. }
  29. class MoonMoon extends Chien {
  30.  
  31. }
  32. class Oiseaux extends Animaux {
  33.  
  34. }
  35. class Mesange extends Oiseaux {
  36.  
  37. }
  38. class Merle extends Oiseaux {
  39. noir: boolean
  40. }
  41.  
  42. class Poisson extends Animaux {
  43.  
  44. }
  45.  
  46. class Thon extends Poisson {
  47. }
  48.  
  49. class Requin extends Poisson {
  50. }
  51.  
  52. class Insecte extends Animaux {
  53.  
  54. }
  55.  
  56. class Asticot extends Insecte {
  57. }
  58.  
  59. function miauler(chat: Chat) {
  60. console.log("Miaaaaaaaauuuuuuuuuuuu !");
  61.  
  62.  
  63. }
  64. function aboyer(chien: Chien) {
  65. console.log("WafWaf");
  66.  
  67. }
  68. function photo(animaux: Animaux) {
  69. console.log("Cheeeeeeeees !");
  70.  
  71. }
  72. function vole(oiseaux: Oiseaux) {
  73. console.log("~~~~~~~~~~");
  74.  
  75. }
  76. function nager(poisson: Poisson) {
  77. console.log("ooOOooOOO...");
  78.  
  79. }
  80. function caresse(quatrePattes: QuatrePattes) {
  81. console.log("GrateGrate");
  82. }
  83.  
  84. function manger(Animaux: Noir) {
  85. console.log("MiamMiam");
  86.  
  87.  
  88. }
  89.  
  90.  
  91. photo(new Insecte);
  92. miauler(new Chartreux);
  93. manger(new TerreNeuve);
  94. caresse(new Chat);
  95. vole(new Oiseaux);
Add Comment
Please, Sign In to add comment