code_junkie

Is there a human readable programming language? [closed]

Nov 11th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. Create an object called MyVar and initialize it to 10;
  2. Take MyVar and call MyMethod() with parameters. . .
  3.  
  4. SET MYVAR TO 10.
  5. EXECUTE MYMETHOD with 10, MYVAR.
  6.  
  7. ADD YEARS TO AGE.
  8. MULTIPLY PRICE BY QUANTITY GIVING COST.
  9. SUBTRACT DISCOUNT FROM COST GIVING FINAL-COST.
  10.  
  11. SET VAR_00_MYVAR_PIC99 TO 10.
  12. EXECUTE PROC_10_MYMETHOD with 10, VAR_00_MYVAR_PIC99.
  13.  
  14. HAI
  15. CAN HAS STDIO?
  16. VISIBLE "HAI WORLD!"
  17. KTHXBYE
  18.  
  19. "Hello World" by I.F. Author
  20.  
  21. The story headline is "An Interactive Example".
  22.  
  23. The Living Room is a room. "A comfortably furnished living room."
  24. The Kitchen is north of the Living Room.
  25. The Front Door is south of the Living Room.
  26. The Front Door is a door. The Front Door is closed. The Front Door is locked.
  27.  
  28. The insurance salesman is a man in the Living Room.
  29. "An insurance salesman in a tacky polyester suit. He seems eager to speak to you."
  30. Understand "man" as the insurance salesman.
  31.  
  32. A briefcase is carried by the insurance salesman.
  33. The description is "A slightly worn, black briefcase."
  34. Understand "case" as the briefcase.
  35.  
  36. The insurance paperwork is in the briefcase.
  37. The description is "Page after page of small legalese." Understand "papers"
  38. or "documents" or "forms" as the paperwork.
  39.  
  40. Instead of listening to the insurance salesman:
  41. say "The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you.";
  42. move the insurance paperwork to the player.
  43.  
  44. tell application "iTunes"
  45. activate
  46. play playlist "Party Shuffle"
  47. end tell
  48.  
  49. bob is a parent of tim.
  50. mary is a parent of bob.
  51.  
  52. ?- X is a grandparent of tim.
  53. X = mary
  54.  
  55. ?- jim is a parent of bob.
  56. false
  57.  
  58. Ingredients.
  59. 72 g haricot beans
  60. 101 eggs
  61. 108 g lard
  62. 111 cups oil
  63. 32 zucchinis
  64. 119 ml water
  65. 114 g red salmon
  66. 100 g dijon mustard
  67. 33 potatoes
  68.  
  69. Method.
  70. Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl.
  71. Put lard into the mixing bowl. Put red salmon into the mixing bowl. Put oil into the mixing bowl.
  72. Put water into the mixing bowl. Put zucchinis into the mixing bowl. Put oil into the mixing bowl.
  73. Put lard into the mixing bowl. Put lard into the mixing bowl. Put eggs into the mixing bowl.
  74. Put haricot beans into the mixing bowl. Liquefy contents of the mixing bowl.
  75. Pour contents of the mixing bowl into the baking dish.
  76.  
  77. tell application "Finder"
  78. set the percent_free to ¬
  79. (((the free space of the startup disk) / (the capacity of the startup disk)) * 100) div 1
  80. end tell
  81. if the percent_free is less than 10 then
  82. tell application (path to frontmost application as text)
  83. display dialog "The startup disk has only " & the percent_free & ¬
  84. " percent of its capacity available." & return & return & ¬
  85. "Should this script continue?" with icon 1
  86. end tell
  87. end if
  88.  
  89. print "hello!" and open my $File, '<', $path or die "Couldn't open the file after saying hello!";
  90.  
  91. SELECT name, address FROM customers WHERE region = 'Europe'
  92.  
  93. test "Searching google for watin"
  94. goto "http://www.google.se"
  95. type "watin" into "q"
  96. click "btnG"
  97. assert that text "WatiN Home" exists
  98. assert that element "res" exists
  99. end
  100.  
  101. if Time_To_Loop then
  102. for i in Some_Array loop
  103. Some_Array(i) := i;
  104. end loop;
  105. end if;
  106.  
  107. if (timeToLoop != 0) {
  108. for (int i=0;i<SOME_ARRAY_LENGTH;i++) {
  109. someArray[i] = i;
  110. }
  111. }
  112.  
  113. -module(listsort).
  114. -export([by_length/1]).
  115.  
  116. by_length(Lists) ->
  117. F = fun(A,B) when is_list(A), is_list(B) ->
  118. length(A) < length(B)
  119. end,
  120. qsort(Lists, F).
  121.  
  122. qsort([], _)-> [];
  123. qsort([Pivot|Rest], Smaller) ->
  124. qsort([ X || X <- Rest, Smaller(X,Pivot)], Smaller)
  125. ++ [Pivot] ++
  126. qsort([ Y ||Y <- Rest, not(Smaller(Y, Pivot))], Smaller).
  127.  
  128. <doc keywords="x y z"> doc -keywords=<<x y z>>
  129. <title/> title
  130. <body id="db13"> body -id=db13
  131. This is text. <<This is text.>>
  132. </body>
  133. </doc>
Add Comment
Please, Sign In to add comment