kburnik

LOGO - zadatak Racun - rješenje

Dec 7th, 2012
33
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. to racun :l
  2. ; NAPOMENA
  3. ; ovo rjesenje nije ograniceno samo na dva operanda, ali je vazno da je izraz ispravan!
  4.  
  5. ; TRIVIJALNI SLUCAJ nista ne radi, samo vraca ulaz
  6. ; sto je dobro svojstvo jer ce jednako postupati za + - * / i brojeve!
  7. if not listp :l [op :l]
  8.  
  9. ; BAZICNI SLUCAJ
  10. ; razrijesavamo ulaznu listu
  11. foreach :l [
  12. ; dodaj rekurzivno razrijeseni element na finalni izraz
  13. make "l bf lput (racun ?) :l
  14. ]
  15.  
  16. ; izvrsi listu (npr. ako izraz glasi [ 1 + 2 ] onda run [op 1 + 2] )
  17. run se "op :l
  18.  
  19. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×