Advertisement
Scrooble

kolakoskiBFJava

Mar 7th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. import java.util.*;
  2. public class kolakoski_golfed {
  3. public static void main(String[] args) {
  4. List<Long> tape = new ArrayList<>();
  5. tape.add(0L);
  6. int loc = 0;
  7. Scanner in = new Scanner(System.in);
  8. tape.set(loc, tape.get(loc) + 1);
  9. System.out.println(tape.get(loc));
  10. tape.set(loc, tape.get(loc) + 1);
  11. System.out.println(tape.get(loc));
  12. System.out.println(tape.get(loc));
  13. if(loc == 0)
  14. tape.add(0, 0L);
  15. else
  16. loc--;
  17. if(loc == 0)
  18. tape.add(0, 0L);
  19. else
  20. loc--;
  21. tape.set(loc, tape.get(loc) + 1);
  22. System.out.println(tape.get(loc));
  23. while(tape.get(loc) > 0) {
  24. System.out.println(tape.get(loc));
  25. while(tape.get(loc) > 0) {
  26. while(tape.get(loc) > 0) {
  27. loc++;
  28. if(loc == tape.size())
  29. tape.add(0L);
  30. loc++;
  31. if(loc == tape.size())
  32. tape.add(0L);
  33. }
  34. if(loc == 0)
  35. tape.add(0, 0L);
  36. else
  37. loc--;
  38. tape.set(loc, tape.get(loc) + 1);
  39. if(loc == 0)
  40. tape.add(0, 0L);
  41. else
  42. loc--;
  43. while(tape.get(loc) > 0) {
  44. if(loc == 0)
  45. tape.add(0, 0L);
  46. else
  47. loc--;
  48. if(loc == 0)
  49. tape.add(0, 0L);
  50. else
  51. loc--;
  52. }
  53. loc++;
  54. if(loc == tape.size())
  55. tape.add(0L);
  56. loc++;
  57. if(loc == tape.size())
  58. tape.add(0L);
  59. tape.set(loc, tape.get(loc) - 1);
  60. }
  61. loc++;
  62. if(loc == tape.size())
  63. tape.add(0L);
  64. loc++;
  65. if(loc == tape.size())
  66. tape.add(0L);
  67. while(tape.get(loc) > 0) {
  68. loc++;
  69. if(loc == tape.size())
  70. tape.add(0L);
  71. loc++;
  72. if(loc == tape.size())
  73. tape.add(0L);
  74. }
  75. if(loc == 0)
  76. tape.add(0, 0L);
  77. else
  78. loc--;
  79. while(tape.get(loc) > 0) {
  80. loc++;
  81. if(loc == tape.size())
  82. tape.add(0L);
  83. while(tape.get(loc) > 0) {
  84. loc++;
  85. if(loc == tape.size())
  86. tape.add(0L);
  87. loc++;
  88. if(loc == tape.size())
  89. tape.add(0L);
  90. }
  91. tape.set(loc, tape.get(loc) + 1);
  92. tape.set(loc, tape.get(loc) + 1);
  93. tape.set(loc, tape.get(loc) + 1);
  94. if(loc == 0)
  95. tape.add(0, 0L);
  96. else
  97. loc--;
  98. if(loc == 0)
  99. tape.add(0, 0L);
  100. else
  101. loc--;
  102. while(tape.get(loc) > 0) {
  103. if(loc == 0)
  104. tape.add(0, 0L);
  105. else
  106. loc--;
  107. }
  108. loc++;
  109. if(loc == tape.size())
  110. tape.add(0L);
  111. loc++;
  112. if(loc == tape.size())
  113. tape.add(0L);
  114. tape.set(loc, tape.get(loc) - 1);
  115. }
  116. if(loc == 0)
  117. tape.add(0, 0L);
  118. else
  119. loc--;
  120. while(tape.get(loc) > 0) {
  121. if(loc == 0)
  122. tape.add(0, 0L);
  123. else
  124. loc--;
  125. tape.set(loc, tape.get(loc) + 1);
  126. loc++;
  127. if(loc == tape.size())
  128. tape.add(0L);
  129. loc++;
  130. if(loc == tape.size())
  131. tape.add(0L);
  132. tape.set(loc, tape.get(loc) + 1);
  133. if(loc == 0)
  134. tape.add(0, 0L);
  135. else
  136. loc--;
  137. tape.set(loc, tape.get(loc) - 1);
  138. }
  139. loc++;
  140. if(loc == tape.size())
  141. tape.add(0L);
  142. while(tape.get(loc) > 0) {
  143. loc++;
  144. if(loc == tape.size())
  145. tape.add(0L);
  146. tape.set(loc, tape.get(loc) - 1);
  147. loc++;
  148. if(loc == tape.size())
  149. tape.add(0L);
  150. loc++;
  151. if(loc == tape.size())
  152. tape.add(0L);
  153. while(tape.get(loc) > 0) {
  154. tape.set(loc, tape.get(loc) - 1);
  155. if(loc == 0)
  156. tape.add(0, 0L);
  157. else
  158. loc--;
  159. }
  160. if(loc == 0)
  161. tape.add(0, 0L);
  162. else
  163. loc--;
  164. if(loc == 0)
  165. tape.add(0, 0L);
  166. else
  167. loc--;
  168. while(tape.get(loc) > 0) {
  169. if(loc == 0)
  170. tape.add(0, 0L);
  171. else
  172. loc--;
  173. }
  174. loc++;
  175. if(loc == tape.size())
  176. tape.add(0L);
  177. tape.set(loc, tape.get(loc) - 1);
  178. }
  179. if(loc == 0)
  180. tape.add(0, 0L);
  181. else
  182. loc--;
  183. if(loc == 0)
  184. tape.add(0, 0L);
  185. else
  186. loc--;
  187. while(tape.get(loc) > 0) {
  188. loc++;
  189. if(loc == tape.size())
  190. tape.add(0L);
  191. tape.set(loc, tape.get(loc) + 1);
  192. if(loc == 0)
  193. tape.add(0, 0L);
  194. else
  195. loc--;
  196. tape.set(loc, tape.get(loc) - 1);
  197. }
  198. loc++;
  199. if(loc == tape.size())
  200. tape.add(0L);
  201. while(tape.get(loc) > 0) {
  202. if(loc == 0)
  203. tape.add(0, 0L);
  204. else
  205. loc--;
  206. if(loc == 0)
  207. tape.add(0, 0L);
  208. else
  209. loc--;
  210. }
  211. loc++;
  212. if(loc == tape.size())
  213. tape.add(0L);
  214. loc++;
  215. if(loc == tape.size())
  216. tape.add(0L);
  217. }
  218. }
  219. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement