Advertisement
Madmouse

Madcode what works so far lol

Jun 22nd, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.02 KB | None | 0 0
  1. // ------------------------------------------------------------------------------
  2. // THE BEER-WARE LICENSE (Revision 43):
  3. // <aaronryool@gmail.com> wrote this file. As long as you retain this notice you
  4. // can do whatever you want with this stuff. If we meet some day, and you think
  5. // this stuff is worth it, you can buy me a beer in return
  6. // ------------------------------------------------------------------------------
  7. // Madcode example/test file
  8.  
  9. x = 0;
  10. print x+2;
  11.  
  12. is(x == 2){             // if then else
  13.     print "x is 2";
  14. }
  15. else{
  16.     print "x is not 2";
  17. }                       // <<
  18.  
  19. x = 5;
  20. y = (x >= 10) ? 0 : x;  // turnery
  21.  
  22. while(x <= 9){          // while
  23.     print x;
  24.     x = x+1;
  25. }
  26.  
  27. x = 0;
  28. y = int(x){ -> x+2; };  // anonymous function
  29. print (y);
  30.  
  31. fun:int(x){         // declarative function
  32.     print "im inside a function";
  33.     -> x*2;
  34. }
  35.  
  36. fun2:str(){         // declarative function
  37.     -> "a return string";
  38. }
  39.  
  40. fun3:str(){         // declarative function
  41.     print "a return string";
  42. }
  43.  
  44.  
  45. x = fun(2);
  46. y = fun2();
  47.  
  48. print x;
  49. print y;
  50.  
  51. fun3();
  52.  
  53. exit 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement