Advertisement
Guest User

Untitled

a guest
Dec 1st, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Oz 17.55 KB | None | 0 0
  1. %====INFORMATION====%
  2. % LFSAB1402 Projet 2016
  3. % Nomas : 07891500-38421500
  4. % Noms : (Tascon Gutierrez,Luis)-(Mawait,Maxime)
  5. %====MODULELINK====%
  6. declare
  7. [Projet]={Module.link ["Projet2016.ozf"]}
  8.  
  9. %====CODE====%
  10. local
  11.    MaxTime = 25        % nombre de frame a l'animation
  12.    MyFunction          % fonction principale
  13.    Primitive
  14.    FlattenList
  15.    AppendList
  16.    Value
  17.    PokeSearch
  18.    PokeBuild
  19.    Translate
  20.    PokeTranslate
  21.    Scale
  22.    Rotate
  23.    Map                 % map principale
  24.    Spawn
  25.    CheckMap
  26.    Extensions = opt(withExtendedFormula:true
  27.             withIfThenElse:true
  28.             withComparison:true
  29.             withTimeWindow:true
  30.             withCheckMapEasy:true
  31.             withCheckMapComplete:true) %toutes les extensions sont implementees.
  32.    Building = primitive(kind:building)
  33.    B = scale(rx:10.0 ry:10.0 [Building])
  34.  
  35.    fun{A Acc Max}
  36.       if Acc < Max then translate(dx:mult(sin(Acc) Acc) dy:mult(cos(Acc) Acc) [B])|{A Acc+1.0 Max}
  37.       else nil
  38.       end
  39.    end
  40.    
  41.    Ru = [translate(dx:250.0 dy:250.0 {A 0.0 400.0})] %Monde reel
  42.    Pu = [translate(dx: 250.0 dy: 250.0 1:[translate(dx:mult(sin(time) mult(5.0 time)) dy:mult(cos(time) mult(5.0 time)) [spawn(tmin:3 tmax:MaxTime [primitive(kind:pokemon)])])]) translate(dx: 300.0 dy: 100.0 [primitive(kind:pokestop)]) translate(dx:100.0 dy:300.0 1:[primitive(kind:arena)])] %Monde pokemon
  43. in
  44.    Map = map(ru:Ru pu:Pu) %Map envoyee
  45.  
  46.    fun{MyFunction Map}
  47.       %Fait plusieurs appels de fonctions imbriquees afin de retourner une liste de fonctions anonymes en fonction de Map recu.
  48.       case Map of map(ru: Ru pu: Pu) then
  49.      {AppendList {Build {Search {FlattenList Ru}}} {PokeBuild  {PokeSearch {FlattenList Pu}}}}
  50.       end
  51.    end
  52.  
  53.    
  54.    fun{Primitive K}
  55.       %C'est la fonction qui recois une string en argument et qui retourne un realitem ou un pokeitem en fonction de K.
  56.       case K of road then
  57.      realitem(kind: road p1: pt(x: 0.0 y: 0.0) p2: pt(x: 1.0 y: 0.0))
  58.       [] building then
  59.      realitem(kind: building p1: pt(x: 0.0 y: 0.0) p2: pt(x: 0.0 y: 1.0) p3: pt(x: 1.0 y: 1.0) p4: pt(x: 1.0 y: 0.0))
  60.       [] water then
  61.      realitem(kind: water p1: pt(x: 0.0 y: 0.0) p2: pt(x: 0.0 y: 1.0) p3: pt(x: 1.0 y: 1.0) p4: pt(x: 1.0 y: 0.0))
  62.       [] pokemon then
  63.      pokeitem(kind: pokemon position: pt(x: 0.0 y: 0.0))
  64.       [] pokestop then
  65.      pokeitem(kind: pokestop position: pt(x: 0.0 y: 0.0))
  66.       [] arena then
  67.      pokeitem(kind: arena position: pt(x: 0.0 y: 0.0))
  68.       end
  69.    end
  70.  
  71.  
  72.    fun{Translate D1 D2 L1}
  73.       %Cette fonction applique une translation a un pokeitem ou un realitem de D1 dans l'axe des x et de D2 dans l'axe des y.
  74.       %D'abord, on applique FlattenList sur L1 afin d'etre sur qu'on ai une liste simple et pas une liste de listes.
  75.       %Ensuite, on regarde le premier element de L1 et on applique une recursion sur le reste de la liste.
  76.       Dx = {Value D1}
  77.       Dy = {Value D2}
  78.       L = {FlattenList L1}
  79.    in
  80.       case L of nil then nil
  81.       [] H|T then
  82.      %Apres avoir fait le pattern matching, nous observons plusieurs cas:
  83.      case H
  84.      of primitive(kind:K) then %Si on a une primitive, on rappelle la fonction avec comme nouvel argument pour la liste l'item que va nous retourner {Primitive K}
  85.         {Translate D1 D2 [{Primitive K}]}|{Translate D1 D2 T}
  86.      [] realitem(kind:K p1: pt(x:X1 y:Y1) p2: pt(x:X2 y:Y2)) then %Si c'est un realitem a deux points (road) on applique la translation sur les 2points.
  87.         realitem(kind:K p1: pt(x:X1+Dx y:Y1+Dy) p2: pt(x:X2+Dx y:Y2+Dy))|{Translate D1 D2 T}
  88.      [] realitem(kind:K p1: pt(x:X1 y:Y1) p2: pt(x:X2 y:Y2) p3: pt(x:X3 y:Y3) p4: pt(x:X4 y:Y4)) then %Si c'est un realitem a 4 points (water & building), on applique la translation sur les 4 points.
  89.         realitem(kind:K p1: pt(x:X1+Dx y:Y1+Dy) p2: pt(x:X2+Dx y:Y2+Dy) p3: pt(x:X3+Dx y:Y3+Dy) p4: pt(x:X4+Dx y:Y4+Dy))|{Translate D1 D2 T}
  90.      [] translate(dx:A dy:B 1:Ru) then %Si on a deux translates imbriques, on appelle {Translate} dans {Translate} car on ne peut pas appliquer une translation sur un autre tuple que realitem.
  91.         {Translate D1 D2 {Translate A B Ru}}|{Translate D1 D2 T}
  92.      [] scale(rx:A ry:B 1:Ru) then %Si on a scale, on appelle {Scale} dans le {Translate}.
  93.         {Translate D1 D2 {Scale A B Ru}}|{Translate D1 D2 T}
  94.      [] rotate(angle:A 1:Ru) then %Si on a rotate, on appelle {Rotate} dans le {Translate}.
  95.         {Translate D1 D2 {Rotate A Ru}}|{Translate D1 D2 T}
  96.      end
  97.       end
  98.    end
  99.  
  100.    fun{Scale R1 R2 L1}
  101.       %Cette fonction applique un redimensionnement a un pokeitem ou un realitem de R1 dans l'axe des x et de R2 dans l'axe des y.
  102.       %D'abord, on applique FlattenList sur L1 afin d'etre sur qu'on ai une liste simple et pas une liste de listes.
  103.       %Ensuite, on regarde le premier element de L1 et on applique une recursion sur le reste de la liste.
  104.       Rx = {Value R1}
  105.       Ry = {Value R2}
  106.       L = {FlattenList L1}
  107.    in
  108.       case L of nil then nil
  109.       [] H|T then
  110.      case H of primitive(kind:K) then %Si on a une primitive, on appelle la fonction {Primitive} en recursion avec Scale afin de recevoir un realitem.
  111.         {Scale Rx Ry [{Primitive K}]}|{Scale R1 R2 T}
  112.      [] realitem(kind:K p1: pt(x:X1 y:Y1) p2: pt(x:X2 y:Y2)) then %Si on a un realitem a 2 points (road), on applique le dimensionnement aux 2 points.
  113.         realitem(kind:K p1: pt(x:X1*Rx y:Y1*Ry) p2: pt(x:X2*Rx y:Y2*Ry))|{Scale R1 R2 T}
  114.      [] realitem(kind:K p1: pt(x:X1 y:Y1) p2: pt(x:X2 y:Y2) p3: pt(x:X3 y:Y3) p4: pt(x:X4 y:Y4)) then %Si on a un realitem a 4 points (water & building), on applique le dimensionnement aux 4 points.
  115.         realitem(kind:K p1: pt(x:X1*Rx y:Y1*Ry) p2: pt(x:X2*Rx y:Y2*Ry) p3: pt(x:X3*Rx y:Y3*Ry) p4: pt(x:X4*Rx y:Y4*Ry))|{Scale R1 R2 T}
  116.      [] translate(dx: A dy: B 1:Ru) then %Si on a translate, on appelle {Transtlate} dans le {Scale}.
  117.         {Scale R1 R2 {Translate A B Ru}}|{Scale R1 R2 T}
  118.      [] scale(rx: A ry: B 1: Ru) then %Si on a deux scales imbriques, on appelle {Scale} dans {Scale} car on ne peut pas appliquer un dimensionnement sur un autre tuple que realitem.
  119.         {Scale R1 R2 {Scale A B Ru}}|{Scale R1 R2 T}
  120.      [] rotate(angle: A 1:Ru) then %Si on a rotate, on appelle {Rotate} dans le {Scale}.
  121.         {Scale R1 R2 {Rotate A Ru}}|{Scale R1 R2 T}
  122.      end
  123.       end
  124.    end
  125.  
  126.  
  127.    fun{Rotate A1 Ru1}
  128.       %Cette fonction applique une rotation a un pokeitem ou un realitem d'un angle qui vaut A1 en radian autour de (0;0).
  129.       %D'abord, on applique FlattenList sur L1 afin d'etre sur qu'on ai une liste simple et pas une liste de listes.
  130.       %Ensuite, on regarde le premier element de L1 et on applique une recursion sur le reste de la liste.
  131.       A = {Value A1}
  132.       Ru = {FlattenList Ru1}
  133.    in
  134.       case Ru of nil then nil
  135.       [] H|T then
  136.      case H of primitive(kind:K) then %Si on a une primitive, on appelle la fonction {Primitive} en recursion avec Rotate afin de recevoir un realitem.
  137.         {Rotate A [{Primitive K}]}|{Rotate A T}
  138.      [] translate(dx: Dx dy: Dy 1: L) then %Si on a translate, on appelle {Translate} dans le {Rotate}.
  139.         {Rotate A {Translate Dx Dy L}}|{Rotate A T}
  140.      [] rotate(angle: A2 1: L) then %Si on a deux rotates imbriques, on appelle {Rotate} dans {Rotate} car on ne peut pas appliquer un dimensionnement sur un autre tuple que realitem.
  141.         {Rotate A {Rotate A2 L}}|{Rotate A T}
  142.      [] scale(rx: Rx ry: Ry 1: L) then %Si on a Scale, on appelle {Scale} dans le {Rotate}.
  143.         {Rotate A {Scale Rx Ry L}}|{Rotate A T}
  144.      [] realitem(kind:K p1: pt(x:X1 y:Y1) p2: pt(x:X2 y:Y2)) then %Si on a un realitem a 2 points (road), on applique la rotation aux 2 points.
  145.         realitem(kind:K p1: pt(x: {Value plus(mult(X1 cos(A)) mult(Y1 sin(A)))} y: {Value plus(mult(neg(X1) sin(A)) mult(Y1 cos(A)))}) p2: pt(x: {Value plus(mult(X2 cos(A)) mult(Y2 sin(A)))} y: {Value plus(mult(neg(X2) sin(A)) mult(Y2 cos(A)))}))|{Rotate A T}
  146.      [] realitem(kind:K p1: pt(x:X1 y:Y1) p2: pt(x:X2 y:Y2) p3: pt(x:X3 y:Y3) p4: pt(x:X4 y:Y4)) then %Si on a un realitem a 4 points (water & building), on applique la rotation aux 4 points.
  147.         realitem(kind:K p1: pt(x: {Value plus(mult(X1 cos(A)) mult(Y1 sin(A)))} y: {Value plus(mult(neg(X1) sin(A)) mult(Y1 cos(A)))}) p2: pt(x: {Value plus(mult(X2 cos(A)) mult(Y2 sin(A)))} y: {Value plus(mult(neg(X2) sin(A)) mult(Y2 cos(A)))}) p3: pt(x: {Value plus(mult(X3 cos(A)) mult(Y3 sin(A)))} y: {Value plus(mult(neg(X3) sin(A)) mult(Y3 cos(A)))}) p4: pt(x: {Value plus(mult(X4 cos(A)) mult(Y4 sin(A)))} y: {Value plus(mult(neg(X4) sin(A)) mult(Y4 cos(A)))}))|{Rotate A T}
  148.      end
  149.       end
  150.    end
  151.  
  152.    fun{PokeTranslate Dx Dy L1}
  153.       %Cette fonction a le meme principe que Translate a l'exception de la transformation appliquee au point.
  154.       %Pour faire des transformations, a la place de faire directement les plus, on cree des tuples du type plus(A B).
  155.       %Ce tuple va rester la jusqu'a ce qu'on emballe l'item dans une fonction anonyme, a ce moment la, on va evaluer le tuple avec {Formula A Time}.
  156.       L = {FlattenList L1}
  157.    in
  158.       case L of nil then nil
  159.       [] H|T then
  160.      case H of primitive(kind: K) then%Si on a une primitive, on appelle la fonction {Primitive} en recursion avec PokeTranslate afin de recevoir un realitem.
  161.         {PokeTranslate Dx Dy [{Primitive K}]}|{PokeTranslate Dx Dy T}
  162.      [] pokeitem(kind: K position: pt(x: X y: Y)) then %Si on a un pokeitem, on met un tuple plus dans chacune des coordonnees du point indiquant le pokeitem.
  163.         pokeitem(kind: K position: pt(x: plus(X Dx) y: plus(Y Dy)))|{PokeTranslate Dx Dy T}
  164.      [] translate(dx: D1 dy: D2 1:Pu) then %Si on a translate, on appelle {PokeTranslate} en recursion avec {PokeTranslate}.
  165.         {PokeTranslate Dx Dy {PokeTranslate D1 D2 Pu}}|{PokeTranslate Dx Dy T}
  166.      [] spawn(tmin:Tmin tmax:Tmax Pu) then %Si on a Spawn, on appelle {PokeTranslate} dans le {Spawn}.
  167.         {Spawn Tmin Tmax  {PokeTranslate Dx Dy Pu}}|{PokeTranslate Dx Dy T}
  168.      end
  169.       end
  170.    end
  171.  
  172.    fun{Spawn Tmin Tmax L1}
  173.       %Cette fonction renvoie une liste de tuple spawn.
  174.       %Le tuple spawn
  175.       L = {FlattenList L1}
  176.    in
  177.       case L
  178.       of H|T then
  179.      case H
  180.      of primitive(kind: K) then
  181.         {Spawn Tmin Tmax [{Primitive K}]}|{Spawn Tmin Tmax T}
  182.      [] pokeitem(kind: K position: pt(x: X y: Y)) then
  183.         spawn(tmin:Tmin tmax:Tmax 1:[pokeitem(kind: K position: pt(x:X y:Y))])|{Spawn Tmin Tmax T}
  184.      [] translate(dx: D1 dy: D2 1:Pu) then
  185.         spawn(tmin:Tmin tmax:Tmax 1:{PokeTranslate D1 D2 Pu})|{Spawn Tmin Tmax T}
  186.      [] spawn(tmin:A tmax:B 1:Pu) then
  187.         spawn(tmin:Tmin tmax:Tmax 1:{Spawn A B Pu})|{Spawn Tmin Tmax T}
  188.      end
  189.       [] nil then nil
  190.       end
  191.    end
  192.  
  193.    fun{PokeSearch Pu}
  194.       case Pu of nil then nil
  195.       [] H|T then
  196.      case H of primitive(kind: K) then {Primitive K}|{PokeSearch T}
  197.      [] translate(dx: Dx dy: Dy 1: Pu2) then
  198.         {FlattenList {PokeTranslate Dx Dy Pu2}|{PokeSearch T}}
  199.      [] spawn(tmin:Tmin tmax:Tmax 1:Pu2) then
  200.         {FlattenList {Spawn Tmin Tmax Pu2}|{PokeSearch T}}
  201.      end
  202.       end
  203.    end
  204.  
  205.    fun{PokeBuild Pu1}
  206.       Pu = {FlattenList Pu1}
  207.    in
  208.       case Pu of nil then nil
  209.       [] H|T then
  210.      case H of pokeitem(kind: K position: pt(x:X y:Y)) then
  211.         fun{$ Time}pokeitem(kind: K position: pt(x:{Formula X Time} y:{Formula Y Time}))end|{PokeBuild T}
  212.      [] spawn(tmin:Tmin tmax:Tmax 1:B) then
  213.         local X = {PokeBuild B} in
  214.            fun{$ Time}if({Float.toInt Time} >= Tmin andthen {Float.toInt Time} < Tmax)then {X.1 Time} else empty end end|{PokeBuild T}
  215.         end
  216.      [] nil then nil
  217.      end
  218.       end
  219.    end
  220.    
  221.    fun{Search Ru}
  222.       case Ru of nil then nil
  223.       [] H|T then
  224.      case H
  225.      of primitive(kind:K) then {Primitive K}|{Search T}
  226.      [] translate(dx:Dx dy:Dy 1:Ru2) then
  227.         {Translate Dx Dy Ru2}|{Search T}
  228.      [] rotate(angle:Angle 1:Ru2) then
  229.         {Rotate Angle Ru2}|{Search T}
  230.      [] scale(rx: Rx ry: Ry 1:Ru2) then
  231.         {Scale Rx Ry Ru2}|{Search T}
  232.      end
  233.       end
  234.    end
  235.  
  236.    fun{Build L1}
  237.       L = {FlattenList L1}
  238.    in
  239.       case L of H|T then
  240.      fun{$ Time} H end|{Build T}
  241.       else nil
  242.       end
  243.    end
  244.  
  245.    fun{Value V}
  246.       % decrit les valeurs possibles de l'univers reel
  247.       if {Float.is V} then V
  248.       else case V
  249.        of plus(1:A 2:B) then {Value A} + {Value B}
  250.        [] minus(1:A 2:B) then {Value A} - {Value B}
  251.        [] mult(1:A 2:B) then {Value A} * {Value B}
  252.        [] 'div'(1:A 2:B) then {Value A} / {Value B}
  253.        [] cos(1:A) then {Float.cos {Value A}}
  254.        [] sin(1:A) then {Float.sin {Value A}}
  255.        [] tan(1:A) then {Float.tan {Value A}}
  256.        [] exp(1:A) then {Float.exp {Value A}}
  257.        [] log(1:A) then {Float.log {Value A}}
  258.        [] neg(1:A) then ~{Value A}
  259.        end
  260.       end
  261.    end
  262.  
  263.    fun{Formula F Time}
  264.       % donne les 'formules' du monde pokemon
  265.       if {Float.is F} then F
  266.       else
  267.      case F
  268.      of time then Time
  269.      [] plus(1:A 2:B) then {Formula A Time} + {Formula B Time}
  270.      [] minus(1:A 2:B) then {Formula A Time} - {Formula B Time}
  271.      [] mult(1:A 2:B) then {Formula A Time} * {Formula B Time}
  272.      [] 'div'(1:A 2:B) then {Formula A Time} / {Formula B Time}
  273.      [] cos(1:A) then {Float.cos {Formula A Time}}
  274.      [] sin(1:A) then {Float.sin {Formula A Time}}
  275.      [] tan(1:A) then {Float.tan {Formula A Time}}
  276.      [] exp(1:A) then {Float.exp {Formula A Time}}
  277.      [] log(1:A) then {Float.log {Formula A Time}}
  278.      [] neg(1:A) then ~{Formula A Time}
  279.      [] ite(1:A 2:B 3:C) then if {Formula A Time} == 0.0 then {Formula C Time} else {Formula B Time} end
  280.      [] eq(1:A 2:B) then if {Formula A Time} == {Formula B Time} then 1.0 else 0.0 end
  281.      [] ne(1:A 2:B) then if {Formula A Time} \= {Formula B Time} then 1.0 else 0.0 end
  282.      [] lt(1:A 2:B) then if {Formula A Time} < {Formula B Time} then 1.0 else 0.0 end
  283.      [] le(1:A 2:B) then if {Formula A Time} =< {Formula B Time} then 1.0 else 0.0 end
  284.      [] gt(1:A 2:B) then if {Formula A Time} > {Formula B Time} then 1.0 else 0.0 end
  285.      [] ge(1:A 2:B) then if {Formula A Time} >= {Formula B Time} then 1.0 else 0.0 end
  286.      end
  287.       end
  288.    end
  289.  
  290.    fun{AppendList X Y}
  291.       case X of nil then Y
  292.       [] H|T then H|{AppendList T Y}
  293.       end
  294.    end
  295.  
  296.  
  297.    fun{FlattenList X}
  298.       fun{IsList L}
  299.      case L of nil then true
  300.      [] H|T then true
  301.      else false
  302.      end
  303.       end
  304.    in
  305.       case X of nil then nil
  306.       [] H|T then
  307.      if {IsList H} then {AppendList {FlattenList H}{FlattenList T}}
  308.      else H|{FlattenList T}
  309.      end
  310.       end
  311.    end
  312.  
  313.  
  314.    fun{CheckMap Map}
  315.       fun{CheckVal Val}
  316.      if {Float.is Val} then true
  317.      else
  318.         case Val
  319.         of plus(A B) then ({CheckVal A} andthen {CheckVal B})
  320.         [] minus(A B) then ({CheckVal A} andthen {CheckVal B})
  321.         [] mult(A B) then ({CheckVal A} andthen {CheckVal B})
  322.         [] 'div'(A B) then ({CheckVal A} andthen {CheckVal B})
  323.         [] cos(A) then {CheckVal A}
  324.         [] sin(A) then {CheckVal A}
  325.         [] tan(A) then {CheckVal A}
  326.         [] exp(A) then {CheckVal A}
  327.         [] log(A) then {CheckVal A}
  328.         [] neg(A) then {CheckVal A}
  329.         else false
  330.         end
  331.      end
  332.       end
  333.       fun{CheckForm Form}
  334.      if {Float.is Form} then true
  335.      else
  336.         case Form
  337.         of plus(A B) then ({CheckForm A} andthen {CheckForm B})
  338.         [] time then true
  339.         [] minus(A B) then ({CheckForm A} andthen {CheckForm B})
  340.         [] mult(A B) then ({CheckForm A} andthen {CheckForm B})
  341.         [] 'div'(A B) then ({CheckForm A} andthen {CheckForm B})
  342.         [] cos(A) then {CheckForm A}
  343.         [] sin(A) then {CheckForm A}
  344.         [] tan(A) then {CheckForm A}
  345.         [] exp(A) then {CheckForm A}
  346.         [] log(A) then {CheckForm A}
  347.         [] neg(A) then {CheckForm A}
  348.         [] ite(A B C) then ({CheckForm A} andthen {CheckForm B} andthen {CheckForm C})
  349.         [] eq(A B) then ({CheckForm A} andthen {CheckForm B})
  350.         [] ne(A B) then ({CheckForm A} andthen {CheckForm B})
  351.         [] lt(A B) then ({CheckForm A} andthen {CheckForm B})
  352.         [] le(A B) then ({CheckForm A} andthen {CheckForm B})
  353.         [] gt(A B) then ({CheckForm A} andthen {CheckForm B})
  354.         [] ge(A B) then ({CheckForm A} andthen {CheckForm B})
  355.         else false
  356.         end
  357.      end
  358.  
  359.       end
  360.       fun{CheckPrim Prim}
  361.      case Prim
  362.      of road then true
  363.      [] building then true
  364.      [] water then true
  365.      else false
  366.      end
  367.       end
  368.       fun{CheckPrimPok Prim}
  369.      case Prim
  370.      of pokemon then true
  371.      [] arena then true
  372.      [] pokestop then true
  373.      else false
  374.      end
  375.       end
  376.       fun{CheckTrans Dx Dy Ru}
  377.      ({CheckVal Dx} andthen {CheckVal Dy} andthen {CheckR Ru})
  378.       end
  379.       fun{CheckTransPok Dx Dy Pu}
  380.      ({CheckForm Dx} andthen {CheckForm Dy} andthen {CheckP Pu})
  381.       end
  382.       fun{CheckRot Angle Ru}
  383.      ({CheckVal Angle} andthen {CheckR Ru})
  384.       end
  385.       fun{CheckScale Rx Ry Ru}
  386.      ({CheckVal Rx} andthen {CheckVal Ry} andthen {CheckR Ru})
  387.       end
  388.       fun{CheckSpa Tmin Tmax Pu}
  389.      ({Int.is Tmin} andthen {Int.is Tmax} andthen {CheckP Pu})
  390.       end
  391.       fun{CheckR Ru}
  392.      case Ru
  393.      of H|T then
  394.         case H
  395.         of primitive(kind:A) then ({CheckPrim A} andthen {CheckR T})
  396.         [] translate(dx:Dx dy:Dy 1:Ru1) then ({CheckTrans Dx Dy Ru1} andthen {CheckR T})
  397.         [] rotate(angle:Angle 1:Ru1) then ({CheckRot Angle Ru1} andthen {CheckR T})
  398.         [] scale(rx:Rx ry:Ry 1:Ru1) then ({CheckScale Rx Ry Ru1} andthen {CheckR T})
  399.         else false
  400.         end
  401.      [] nil then true
  402.      else false
  403.      end
  404.       end
  405.       fun{CheckP Pu}
  406.      case Pu
  407.      of H|T then
  408.         case H
  409.         of primitive(kind:A) then ({CheckPrimPok A} andthen {CheckP T})
  410.         [] translate(dx:Dx dy:Dy 1:Pu1) then ({CheckTransPok Dx Dy Pu1} andthen {CheckP T})
  411.         [] spawn(tmin:Tmin tmax:Tmax 1:Pu1) then ({CheckSpa Tmin Tmax Pu1} andthen {CheckP T})
  412.         else false
  413.         end
  414.      [] nil then true
  415.      else false
  416.      end
  417.       end
  418.    in
  419.       case Map
  420.       of map(ru:Ru pu:Pu) then
  421.      ({CheckR Ru} andthen {CheckP Pu})
  422.       else false
  423.       end
  424.    end
  425.    
  426.    {Projet.run MyFunction Map MaxTime Extensions CheckMap}
  427. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement