Advertisement
Guest User

Untitled

a guest
Nov 30th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Oz 2.11 KB | None | 0 0
  1. fun{CheckMap Map}
  2.       local R P CheckRU CheckRUI CheckRUP CheckValue CheckPU CheckPUI CheckPUP CheckFormula in
  3.      R= Map.ru
  4.      P= Map.pu
  5.      fun{CheckRU R}
  6.         case R of nil then true
  7.         [] H|T then {CheckRUI H} andthen {CheckRU T}
  8.         else false
  9.         end
  10.      end
  11.      fun{CheckRUI R}
  12.         case R
  13.         of primitive(kind:A) andthen {CheckRUP A}
  14.         [] translate(dx:A dy:B 1:C) then {CheckValue A} andthen {CheckValue B} andthen {CheckRU C}
  15.         else false
  16.         end
  17.      end
  18.      fun{CheckRUP R}
  19.         case R
  20.         of road then true
  21.         [] building then true
  22.         []water then true
  23.         else false
  24.         end
  25.      end
  26.      fun{CheckValue R}
  27.         case R
  28.         of plus(A B) then {CheckValue A} andthen {CheckValue B}
  29.         []minus(A B) then {CheckValue A} andthen {CheckValue B}
  30.         []mult(A B) then {CheckValue A} andthen {CheckValue B}
  31.         []'div'(A B) then {CheckValue A} andthen {CheckValue B}
  32.         []cos(A) then {CheckValue A}
  33.         []sin(A) then {CheckValue A}
  34.         []tan(A) then {CheckValue A}
  35.         [] {Float.is R} then true
  36.         else false
  37.         end
  38.      end
  39.      fun{CheckPU P}
  40.         case P
  41.         of nil then true
  42.         []H|T then {CheckPUI H} andthen {CheckPU T}
  43.         else false
  44.         end
  45.      end
  46.      fun{CheckPUI P}
  47.         case P
  48.         of primitive(kind:A) then {CheckPUP A}
  49.         [] translate(dx:A dy:B 1:C) then {CheckFormula A} andthen {CheckFormula B} andthen {CheckPU C}
  50.         else false
  51.         end
  52.      end
  53.      fun{CheckPUP P}
  54.         case P
  55.         of pokemon then true
  56.         []pokestop then true
  57.         [] arena then true
  58.         else false
  59.         end
  60.      end
  61.      fun{CheckFormula P}
  62.         case P
  63.         of time then true
  64.         [] plus(A B) then {CheckFormula A} andthen {CheckFormula B}
  65.         []minus(A B) then {CheckFormula A} andthen {CheckFormula B}
  66.         []mult(A B) then {CheckFormula A} andthen {CheckFormula B}
  67.         []'div'(A B) then {CheckFormula A} andthen {CheckFormula B}
  68.         []cos(A) then {CheckFormula A}
  69.         []sin(A) then {CheckFormula A}
  70.         []tan(A) then {CheckFormula A}
  71.         [] {Float.is P} then true
  72.         else false
  73.         end
  74.      end
  75.      if {CheckRU R} then {CheckPU P} else false end
  76.       end
  77.    end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement