Examples.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. smalltalk.addClass('Counter', smalltalk.Widget, ['count', 'header'], 'Examples');
  2. smalltalk.addMethod(
  3. unescape('_increase'),
  4. smalltalk.method({
  5. selector: unescape('increase'),
  6. category: 'actions',
  7. fn: function (){
  8. var self=this;
  9. self['@count']=((($receiver = self['@count']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));
  10. smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [smalltalk.send(self['@count'], "_asString", [])]);})]);
  11. return self;},
  12. args: [],
  13. source: unescape('increase%0A%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20header%20contents%3A%20%5B%3Ahtml%20%7C%20html%20with%3A%20count%20asString%5D'),
  14. messageSends: [unescape("+"), "contents:", "with:", "asString"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.Counter);
  18. smalltalk.addMethod(
  19. unescape('_decrease'),
  20. smalltalk.method({
  21. selector: unescape('decrease'),
  22. category: 'actions',
  23. fn: function (){
  24. var self=this;
  25. self['@count']=((($receiver = self['@count']).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)]));
  26. smalltalk.send(self['@header'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [smalltalk.send(self['@count'], "_asString", [])]);})]);
  27. return self;},
  28. args: [],
  29. source: unescape('decrease%0A%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20header%20contents%3A%20%5B%3Ahtml%20%7C%20html%20with%3A%20count%20asString%5D'),
  30. messageSends: [unescape("-"), "contents:", "with:", "asString"],
  31. referencedClasses: []
  32. }),
  33. smalltalk.Counter);
  34. smalltalk.addMethod(
  35. unescape('_initialize'),
  36. smalltalk.method({
  37. selector: unescape('initialize'),
  38. category: 'initialization',
  39. fn: function (){
  40. var self=this;
  41. smalltalk.send(self, "_initialize", [], smalltalk.Widget);
  42. self['@count']=(0);
  43. return self;},
  44. args: [],
  45. source: unescape('initialize%0A%20%20%20%20super%20initialize.%0A%20%20%20%20count%20%3A%3D%200'),
  46. messageSends: ["initialize"],
  47. referencedClasses: []
  48. }),
  49. smalltalk.Counter);
  50. smalltalk.addMethod(
  51. unescape('_renderOn_'),
  52. smalltalk.method({
  53. selector: unescape('renderOn%3A'),
  54. category: 'rendering',
  55. fn: function (html){
  56. var self=this;
  57. self['@header']=(function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(self['@count'], "_asString", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(html, "_h1", []));
  58. (function($rec){smalltalk.send($rec, "_with_", [unescape("++")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_increase", []);})]);})(smalltalk.send(html, "_button", []));
  59. (function($rec){smalltalk.send($rec, "_with_", [unescape("--")]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_decrease", []);})]);})(smalltalk.send(html, "_button", []));
  60. return self;},
  61. args: ["html"],
  62. source: unescape('renderOn%3A%20html%0A%20%20%20%20header%20%3A%3D%20html%20h1%20%0A%09with%3A%20count%20asString%3B%0A%09yourself.%0A%20%20%20%20html%20button%0A%09with%3A%20%27++%27%3B%0A%09onClick%3A%20%5Bself%20increase%5D.%0A%20%20%20%20html%20button%0A%09with%3A%20%27--%27%3B%0A%09onClick%3A%20%5Bself%20decrease%5D'),
  63. messageSends: ["with:", "asString", "yourself", "h1", "onClick:", "increase", "button", "decrease"],
  64. referencedClasses: []
  65. }),
  66. smalltalk.Counter);
  67. smalltalk.addClass('Tetris', smalltalk.Widget, ['renderingContext', 'timer', 'speed', 'score', 'rows', 'movingPiece'], 'Examples');
  68. smalltalk.addMethod(
  69. unescape('_width'),
  70. smalltalk.method({
  71. selector: unescape('width'),
  72. category: 'accessing',
  73. fn: function (){
  74. var self=this;
  75. return smalltalk.send(smalltalk.send(self, "_class", []), "_width", []);
  76. return self;},
  77. args: [],
  78. source: unescape('width%0A%09%5Eself%20class%20width'),
  79. messageSends: ["width", "class"],
  80. referencedClasses: []
  81. }),
  82. smalltalk.Tetris);
  83. smalltalk.addMethod(
  84. unescape('_height'),
  85. smalltalk.method({
  86. selector: unescape('height'),
  87. category: 'accessing',
  88. fn: function (){
  89. var self=this;
  90. return smalltalk.send(smalltalk.send(self, "_class", []), "_height", []);
  91. return self;},
  92. args: [],
  93. source: unescape('height%0A%09%5Eself%20class%20height'),
  94. messageSends: ["height", "class"],
  95. referencedClasses: []
  96. }),
  97. smalltalk.Tetris);
  98. smalltalk.addMethod(
  99. unescape('_squares'),
  100. smalltalk.method({
  101. selector: unescape('squares'),
  102. category: 'accessing',
  103. fn: function (){
  104. var self=this;
  105. return smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []);
  106. return self;},
  107. args: [],
  108. source: unescape('squares%0A%09%5Eself%20class%20squares'),
  109. messageSends: ["squares", "class"],
  110. referencedClasses: []
  111. }),
  112. smalltalk.Tetris);
  113. smalltalk.addMethod(
  114. unescape('_gluePiece_'),
  115. smalltalk.method({
  116. selector: unescape('gluePiece%3A'),
  117. category: 'accessing',
  118. fn: function (aPiece){
  119. var self=this;
  120. smalltalk.send(aPiece, "_glueOn_", [self]);
  121. return self;},
  122. args: ["aPiece"],
  123. source: unescape('gluePiece%3A%20aPiece%0A%09aPiece%20glueOn%3A%20self'),
  124. messageSends: ["glueOn:"],
  125. referencedClasses: []
  126. }),
  127. smalltalk.Tetris);
  128. smalltalk.addMethod(
  129. unescape('_rows'),
  130. smalltalk.method({
  131. selector: unescape('rows'),
  132. category: 'accessing',
  133. fn: function (){
  134. var self=this;
  135. return self['@rows'];
  136. return self;},
  137. args: [],
  138. source: unescape('rows%0A%09%22An%20array%20of%20rows.%20Each%20row%20is%20a%20collection%20of%20points.%22%0A%09%5Erows'),
  139. messageSends: [],
  140. referencedClasses: []
  141. }),
  142. smalltalk.Tetris);
  143. smalltalk.addMethod(
  144. unescape('_addRow_'),
  145. smalltalk.method({
  146. selector: unescape('addRow%3A'),
  147. category: 'accessing',
  148. fn: function (aCollection){
  149. var self=this;
  150. smalltalk.send(smalltalk.send(self, "_rows", []), "_add_", [aCollection]);
  151. return self;},
  152. args: ["aCollection"],
  153. source: unescape('addRow%3A%20aCollection%0A%09self%20rows%20add%3A%20aCollection'),
  154. messageSends: ["add:", "rows"],
  155. referencedClasses: []
  156. }),
  157. smalltalk.Tetris);
  158. smalltalk.addMethod(
  159. unescape('_startNewGame'),
  160. smalltalk.method({
  161. selector: unescape('startNewGame'),
  162. category: 'actions',
  163. fn: function (){
  164. var self=this;
  165. smalltalk.send(self, "_newGame", []);
  166. (($receiver = self['@timer']) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self['@timer'], "_clearInterval", []);})() : nil;
  167. self['@timer']=smalltalk.send((function(){return smalltalk.send(self, "_nextStep", []);}), "_valueWithInterval_", [self['@speed']]);
  168. return self;},
  169. args: [],
  170. source: unescape('startNewGame%0A%09self%20newGame.%0A%09timer%20ifNotNil%3A%20%5Btimer%20clearInterval%5D.%0A%09timer%20%3A%3D%20%5Bself%20nextStep%5D%20valueWithInterval%3A%20speed'),
  171. messageSends: ["newGame", "ifNotNil:", "clearInterval", "valueWithInterval:", "nextStep"],
  172. referencedClasses: []
  173. }),
  174. smalltalk.Tetris);
  175. smalltalk.addMethod(
  176. unescape('_nextStep'),
  177. smalltalk.method({
  178. selector: unescape('nextStep'),
  179. category: 'actions',
  180. fn: function (){
  181. var self=this;
  182. (($receiver = self['@movingPiece']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(self, "_newPiece", []);})() : $receiver;
  183. ((($receiver = smalltalk.send(self['@movingPiece'], "_canMoveIn_", [self])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self['@movingPiece'], "_position_", [((($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])]))]);})() : (function(){return smalltalk.send(self, "_newPiece", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self['@movingPiece'], "_position_", [((($receiver = smalltalk.send(self['@movingPiece'], "_position", [])).klass === smalltalk.Number) ? $receiver +smalltalk.send((0), "__at", [(1)]) : smalltalk.send($receiver, "__plus", [smalltalk.send((0), "__at", [(1)])]))]);}), (function(){return smalltalk.send(self, "_newPiece", []);})]));
  184. smalltalk.send(self, "_redraw", []);
  185. return self;},
  186. args: [],
  187. source: unescape('nextStep%0A%09movingPiece%20ifNil%3A%20%5Bself%20newPiece%5D.%0A%09%28movingPiece%20canMoveIn%3A%20self%29%0A%09%09ifTrue%3A%20%5BmovingPiece%20position%3A%20movingPiece%20position%20+%20%280@1%29%5D%0A%09%09ifFalse%3A%20%5Bself%20newPiece%5D.%0A%09self%20redraw'),
  188. messageSends: ["ifNil:", "newPiece", "ifTrue:ifFalse:", "canMoveIn:", "position:", unescape("+"), "position", unescape("@"), "redraw"],
  189. referencedClasses: []
  190. }),
  191. smalltalk.Tetris);
  192. smalltalk.addMethod(
  193. unescape('_redraw'),
  194. smalltalk.method({
  195. selector: unescape('redraw'),
  196. category: 'actions',
  197. fn: function (){
  198. var self=this;
  199. smalltalk.send(self['@renderingContext'], "_clearRect_y_to_y_", [(0), smalltalk.send(self, "_width", []), (0), smalltalk.send(self, "_height", [])]);
  200. (function($rec){smalltalk.send($rec, "_drawMap", []);return smalltalk.send($rec, "_drawPiece", []);})(self);
  201. return self;},
  202. args: [],
  203. source: unescape('redraw%0A%09renderingContext%20clearRect%3A%200%20y%3A%20self%20width%20to%3A%200%20y%3A%20self%20height.%0A%09self%20%0A%09%09drawMap%3B%0A%09%09drawPiece'),
  204. messageSends: ["clearRect:y:to:y:", "width", "height", "drawMap", "drawPiece"],
  205. referencedClasses: []
  206. }),
  207. smalltalk.Tetris);
  208. smalltalk.addMethod(
  209. unescape('_drawMap'),
  210. smalltalk.method({
  211. selector: unescape('drawMap'),
  212. category: 'actions',
  213. fn: function (){
  214. var self=this;
  215. (function($rec){smalltalk.send($rec, "_fillStyle_", [unescape("%23fafafa")]);return smalltalk.send($rec, "_fillRect_y_to_y_", [(0), (0), smalltalk.send(self, "_width", []), smalltalk.send(self, "_height", [])]);})(self['@renderingContext']);
  216. (function($rec){smalltalk.send($rec, "_lineWidth_", [(0.5)]);return smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);})(self['@renderingContext']);
  217. smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_x", []), (function(each){var x=nil;
  218. x=((($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]));return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send(x, "__at", [(0)]), smalltalk.send(x, "__at", [smalltalk.send(self, "_height", [])])]);})]);
  219. smalltalk.send((0), "_to_do_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_squares", []), "_y", []), (function(each){var y=nil;
  220. y=((($receiver = each).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_class", []), "_squareSize", [])]));return smalltalk.send(self, "_drawLineFrom_to_", [smalltalk.send((0), "__at", [y]), smalltalk.send(smalltalk.send(self, "_width", []), "__at", [y])]);})]);
  221. return self;},
  222. args: [],
  223. source: unescape('drawMap%0A%09renderingContext%20%0A%09%09fillStyle%3A%20%27%23fafafa%27%3B%0A%09%09fillRect%3A%200%20y%3A%200%20to%3A%20self%20width%20y%3A%20self%20height.%0A%09renderingContext%20%0A%09%09lineWidth%3A%200.5%3B%0A%09%09strokeStyle%3A%20%27%23999%27.%0A%090%20to%3A%20self%20class%20squares%20x%20do%3A%20%5B%3Aeach%20%7C%20%7C%20x%20%7C%0A%09%09x%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%20x@0%20to%3A%20x@self%20height%5D.%0A%090%20to%3A%20self%20class%20squares%20y%20do%3A%20%5B%3Aeach%20%7C%20%7C%20y%20%7C%0A%09%09y%20%3A%3D%20each%20*%20self%20class%20squareSize.%0A%09%09self%20drawLineFrom%3A%200@y%20to%3A%20self%20width@y%5D.'),
  224. messageSends: ["fillStyle:", "fillRect:y:to:y:", "width", "height", "lineWidth:", "strokeStyle:", "to:do:", "x", "squares", "class", unescape("*"), "squareSize", "drawLineFrom:to:", unescape("@"), "y"],
  225. referencedClasses: []
  226. }),
  227. smalltalk.Tetris);
  228. smalltalk.addMethod(
  229. unescape('_drawLineFrom_to_'),
  230. smalltalk.method({
  231. selector: unescape('drawLineFrom%3Ato%3A'),
  232. category: 'actions',
  233. fn: function (aPoint, anotherPoint){
  234. var self=this;
  235. (function($rec){smalltalk.send($rec, "_beginPath", []);smalltalk.send($rec, "_moveTo_y_", [smalltalk.send(aPoint, "_x", []), smalltalk.send(aPoint, "_y", [])]);smalltalk.send($rec, "_lineTo_y_", [smalltalk.send(anotherPoint, "_x", []), smalltalk.send(anotherPoint, "_y", [])]);return smalltalk.send($rec, "_stroke", []);})(self['@renderingContext']);
  236. return self;},
  237. args: ["aPoint", "anotherPoint"],
  238. source: unescape('drawLineFrom%3A%20aPoint%20to%3A%20anotherPoint%0A%09renderingContext%20%0A%09%09beginPath%3B%0A%09%09moveTo%3A%20aPoint%20x%20y%3A%20aPoint%20y%3B%0A%09%09lineTo%3A%20anotherPoint%20x%20y%3A%20anotherPoint%20y%3B%0A%09%09stroke'),
  239. messageSends: ["beginPath", "moveTo:y:", "x", "y", "lineTo:y:", "stroke"],
  240. referencedClasses: []
  241. }),
  242. smalltalk.Tetris);
  243. smalltalk.addMethod(
  244. unescape('_newGame'),
  245. smalltalk.method({
  246. selector: unescape('newGame'),
  247. category: 'actions',
  248. fn: function (){
  249. var self=this;
  250. self['@rows']=[];
  251. self['@movingPiece']=nil;
  252. self['@speed']=(200);
  253. self['@score']=(0);
  254. return self;},
  255. args: [],
  256. source: unescape('newGame%0A%09rows%20%3A%3D%20%23%28%29.%0A%09movingPiece%20%3A%3D%20nil.%0A%09speed%20%3A%3D%20200.%0A%09score%20%3A%3D%200'),
  257. messageSends: [],
  258. referencedClasses: []
  259. }),
  260. smalltalk.Tetris);
  261. smalltalk.addMethod(
  262. unescape('_newPiece'),
  263. smalltalk.method({
  264. selector: unescape('newPiece'),
  265. category: 'actions',
  266. fn: function (){
  267. var self=this;
  268. self['@movingPiece']=smalltalk.send((smalltalk.TetrisPiece || TetrisPiece), "_atRandom", []);
  269. return self;},
  270. args: [],
  271. source: unescape('newPiece%0A%09movingPiece%20%3A%3D%20TetrisPiece%20atRandom'),
  272. messageSends: ["atRandom"],
  273. referencedClasses: []
  274. }),
  275. smalltalk.Tetris);
  276. smalltalk.addMethod(
  277. unescape('_drawRows'),
  278. smalltalk.method({
  279. selector: unescape('drawRows'),
  280. category: 'actions',
  281. fn: function (){
  282. var self=this;
  283. smalltalk.send(smalltalk.send(self, "_rows", []), "_do_", [(function(each){return nil;})]);
  284. (($receiver = self['@movingPiece']) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self['@movingPiece'], "_drawOn_", [self['@renderingContext']]);})() : nil;
  285. return self;},
  286. args: [],
  287. source: unescape('drawRows%0A%09self%20rows%20do%3A%20%5B%3Aeach%20%7C%5D.%0A%09movingPiece%20ifNotNil%3A%20%5BmovingPiece%20drawOn%3A%20renderingContext%5D'),
  288. messageSends: ["do:", "rows", "ifNotNil:", "drawOn:"],
  289. referencedClasses: []
  290. }),
  291. smalltalk.Tetris);
  292. smalltalk.addMethod(
  293. unescape('_drawPiece'),
  294. smalltalk.method({
  295. selector: unescape('drawPiece'),
  296. category: 'actions',
  297. fn: function (){
  298. var self=this;
  299. (($receiver = self['@movingPiece']) != nil && $receiver != undefined) ? (function(){return smalltalk.send(self['@movingPiece'], "_drawOn_", [self['@renderingContext']]);})() : nil;
  300. return self;},
  301. args: [],
  302. source: unescape('drawPiece%0A%09movingPiece%20ifNotNil%3A%20%5B%0A%09%09movingPiece%20drawOn%3A%20renderingContext%5D'),
  303. messageSends: ["ifNotNil:", "drawOn:"],
  304. referencedClasses: []
  305. }),
  306. smalltalk.Tetris);
  307. smalltalk.addMethod(
  308. unescape('_initialize'),
  309. smalltalk.method({
  310. selector: unescape('initialize'),
  311. category: 'initialization',
  312. fn: function (){
  313. var self=this;
  314. smalltalk.send(self, "_initialize", [], smalltalk.Widget);
  315. smalltalk.send(self, "_newGame", []);
  316. return self;},
  317. args: [],
  318. source: unescape('initialize%0A%09super%20initialize.%0A%09self%20newGame'),
  319. messageSends: ["initialize", "newGame"],
  320. referencedClasses: []
  321. }),
  322. smalltalk.Tetris);
  323. smalltalk.addMethod(
  324. unescape('_renderOn_'),
  325. smalltalk.method({
  326. selector: unescape('renderOn%3A'),
  327. category: 'rendering',
  328. fn: function (html){
  329. var self=this;
  330. (function($rec){smalltalk.send($rec, "_class_", ["tetris"]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(smalltalk.send(html, "_h3", []), "_with_", ["Tetris"]);smalltalk.send(self, "_renderCanvasOn_", [html]);return smalltalk.send(self, "_renderButtonsOn_", [html]);})]);})(smalltalk.send(html, "_div", []));
  331. return self;},
  332. args: ["html"],
  333. source: unescape('renderOn%3A%20html%0A%09html%20div%0A%09%09class%3A%20%27tetris%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20h3%20with%3A%20%27Tetris%27.%0A%09%09%09self%20renderCanvasOn%3A%20html.%0A%09%09%09self%20renderButtonsOn%3A%20html%5D'),
  334. messageSends: ["class:", "with:", "h3", "renderCanvasOn:", "renderButtonsOn:", "div"],
  335. referencedClasses: []
  336. }),
  337. smalltalk.Tetris);
  338. smalltalk.addMethod(
  339. unescape('_renderCanvasOn_'),
  340. smalltalk.method({
  341. selector: unescape('renderCanvasOn%3A'),
  342. category: 'rendering',
  343. fn: function (html){
  344. var self=this;
  345. var canvas=nil;
  346. canvas=smalltalk.send(html, "_canvas", []);
  347. smalltalk.send(canvas, "_at_put_", ["width", smalltalk.send(smalltalk.send(self, "_width", []), "_asString", [])]);
  348. smalltalk.send(canvas, "_at_put_", ["height", smalltalk.send(smalltalk.send(self, "_height", []), "_asString", [])]);
  349. self['@renderingContext']=smalltalk.send(smalltalk.send(canvas, "_element", []), "_getContext_", ["2d"]);
  350. smalltalk.send(self, "_redraw", []);
  351. return self;},
  352. args: ["html"],
  353. source: unescape('renderCanvasOn%3A%20html%0A%09%7C%20canvas%20%7C%0A%09canvas%20%3A%3D%20html%20canvas.%0A%09canvas%20at%3A%20%27width%27%20put%3A%20self%20width%20asString.%0A%09canvas%20at%3A%20%27height%27%20put%3A%20self%20height%20asString.%0A%09renderingContext%20%3A%3D%20canvas%20element%20getContext%3A%20%272d%27.%0A%09self%20redraw'),
  354. messageSends: ["canvas", "at:put:", "asString", "width", "height", "getContext:", "element", "redraw"],
  355. referencedClasses: []
  356. }),
  357. smalltalk.Tetris);
  358. smalltalk.addMethod(
  359. unescape('_renderButtonsOn_'),
  360. smalltalk.method({
  361. selector: unescape('renderButtonsOn%3A'),
  362. category: 'rendering',
  363. fn: function (html){
  364. var self=this;
  365. (function($rec){smalltalk.send($rec, "_class_", ["tetris_buttons"]);return smalltalk.send($rec, "_with_", [(function(){(function($rec){smalltalk.send($rec, "_with_", ["New game"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_startNewGame", []);})]);})(smalltalk.send(html, "_button", []));return (function($rec){smalltalk.send($rec, "_with_", [unescape("play/pause")]);return smalltalk.send($rec, "_onClick_", [(function(){return nil;})]);})(smalltalk.send(html, "_button", []));})]);})(smalltalk.send(html, "_div", []));
  366. return self;},
  367. args: ["html"],
  368. source: unescape('renderButtonsOn%3A%20html%0A%09html%20div%20%0A%09%09class%3A%20%27tetris_buttons%27%3B%0A%09%09with%3A%20%5B%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27New%20game%27%3B%0A%09%09%09%09onClick%3A%20%5Bself%20startNewGame%5D.%0A%09%09%09html%20button%0A%09%09%09%09with%3A%20%27play/pause%27%3B%0A%09%09%09%09onClick%3A%20%5B%5D%5D'),
  369. messageSends: ["class:", "with:", "onClick:", "startNewGame", "button", "div"],
  370. referencedClasses: []
  371. }),
  372. smalltalk.Tetris);
  373. smalltalk.addMethod(
  374. unescape('_squareSize'),
  375. smalltalk.method({
  376. selector: unescape('squareSize'),
  377. category: 'accessing',
  378. fn: function (){
  379. var self=this;
  380. return (22);
  381. return self;},
  382. args: [],
  383. source: unescape('squareSize%0A%09%5E22'),
  384. messageSends: [],
  385. referencedClasses: []
  386. }),
  387. smalltalk.Tetris.klass);
  388. smalltalk.addMethod(
  389. unescape('_width'),
  390. smalltalk.method({
  391. selector: unescape('width'),
  392. category: 'accessing',
  393. fn: function (){
  394. var self=this;
  395. return ((($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_x", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_x", [])]));
  396. return self;},
  397. args: [],
  398. source: unescape('width%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20x%29'),
  399. messageSends: [unescape("*"), "squareSize", "x", "squares"],
  400. referencedClasses: []
  401. }),
  402. smalltalk.Tetris.klass);
  403. smalltalk.addMethod(
  404. unescape('_height'),
  405. smalltalk.method({
  406. selector: unescape('height'),
  407. category: 'accessing',
  408. fn: function (){
  409. var self=this;
  410. return ((($receiver = smalltalk.send(self, "_squareSize", [])).klass === smalltalk.Number) ? $receiver *smalltalk.send(smalltalk.send(self, "_squares", []), "_y", []) : smalltalk.send($receiver, "__star", [smalltalk.send(smalltalk.send(self, "_squares", []), "_y", [])]));
  411. return self;},
  412. args: [],
  413. source: unescape('height%0A%09%5Eself%20squareSize%20*%20%28self%20squares%20y%29'),
  414. messageSends: [unescape("*"), "squareSize", "y", "squares"],
  415. referencedClasses: []
  416. }),
  417. smalltalk.Tetris.klass);
  418. smalltalk.addMethod(
  419. unescape('_squares'),
  420. smalltalk.method({
  421. selector: unescape('squares'),
  422. category: 'accessing',
  423. fn: function (){
  424. var self=this;
  425. return smalltalk.send((10), "__at", [(15)]);
  426. return self;},
  427. args: [],
  428. source: unescape('squares%0A%09%5E10@15'),
  429. messageSends: [unescape("@")],
  430. referencedClasses: []
  431. }),
  432. smalltalk.Tetris.klass);
  433. smalltalk.addClass('TetrisPiece', smalltalk.Widget, ['rotation', 'position'], 'Examples');
  434. smalltalk.addMethod(
  435. unescape('_rotation'),
  436. smalltalk.method({
  437. selector: unescape('rotation'),
  438. category: 'accessing',
  439. fn: function (){
  440. var self=this;
  441. return (($receiver = self['@rotation']) == nil || $receiver == undefined) ? (function(){return self['@rotation']=(1);})() : $receiver;
  442. return self;},
  443. args: [],
  444. source: unescape('rotation%0A%09%5Erotation%20ifNil%3A%20%5Brotation%20%3A%3D%201%5D'),
  445. messageSends: ["ifNil:"],
  446. referencedClasses: []
  447. }),
  448. smalltalk.TetrisPiece);
  449. smalltalk.addMethod(
  450. unescape('_rotation_'),
  451. smalltalk.method({
  452. selector: unescape('rotation%3A'),
  453. category: 'accessing',
  454. fn: function (aNumber){
  455. var self=this;
  456. self['@rotation']=aNumber;
  457. return self;},
  458. args: ["aNumber"],
  459. source: unescape('rotation%3A%20aNumber%0A%09rotation%20%3A%3D%20aNumber'),
  460. messageSends: [],
  461. referencedClasses: []
  462. }),
  463. smalltalk.TetrisPiece);
  464. smalltalk.addMethod(
  465. unescape('_position'),
  466. smalltalk.method({
  467. selector: unescape('position'),
  468. category: 'accessing',
  469. fn: function (){
  470. var self=this;
  471. return (($receiver = self['@position']) == nil || $receiver == undefined) ? (function(){return smalltalk.send(((($receiver = ((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_x", [])).klass === smalltalk.Number) ? $receiver /(2) : smalltalk.send($receiver, "__slash", [(2)]))).klass === smalltalk.Number) ? $receiver -(1) : smalltalk.send($receiver, "__minus", [(1)])), "__at", [(0)]);})() : $receiver;
  472. return self;},
  473. args: [],
  474. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B%28Tetris%20squares%20x%20/%202%29%20-1%20@%200%5D'),
  475. messageSends: ["ifNil:", unescape("@"), unescape("-"), unescape("/"), "x", "squares"],
  476. referencedClasses: [smalltalk.Tetris]
  477. }),
  478. smalltalk.TetrisPiece);
  479. smalltalk.addMethod(
  480. unescape('_position_'),
  481. smalltalk.method({
  482. selector: unescape('position%3A'),
  483. category: 'accessing',
  484. fn: function (aPoint){
  485. var self=this;
  486. return self['@position']=aPoint;
  487. return self;},
  488. args: ["aPoint"],
  489. source: unescape('position%3A%20aPoint%0A%09%5Eposition%20%3A%3D%20aPoint'),
  490. messageSends: [],
  491. referencedClasses: []
  492. }),
  493. smalltalk.TetrisPiece);
  494. smalltalk.addMethod(
  495. unescape('_bounds'),
  496. smalltalk.method({
  497. selector: unescape('bounds'),
  498. category: 'accessing',
  499. fn: function (){
  500. var self=this;
  501. smalltalk.send(self, "_subclassResponsibility", []);
  502. return self;},
  503. args: [],
  504. source: unescape('bounds%0A%09self%20subclassResponsibility'),
  505. messageSends: ["subclassResponsibility"],
  506. referencedClasses: []
  507. }),
  508. smalltalk.TetrisPiece);
  509. smalltalk.addMethod(
  510. unescape('_color'),
  511. smalltalk.method({
  512. selector: unescape('color'),
  513. category: 'accessing',
  514. fn: function (){
  515. var self=this;
  516. return unescape("%23afa");
  517. return self;},
  518. args: [],
  519. source: unescape('color%0A%09%5E%27%23afa%27'),
  520. messageSends: [],
  521. referencedClasses: []
  522. }),
  523. smalltalk.TetrisPiece);
  524. smalltalk.addMethod(
  525. unescape('_height'),
  526. smalltalk.method({
  527. selector: unescape('height'),
  528. category: 'accessing',
  529. fn: function (){
  530. var self=this;
  531. return (2);
  532. return self;},
  533. args: [],
  534. source: unescape('height%0A%09%5E2'),
  535. messageSends: [],
  536. referencedClasses: []
  537. }),
  538. smalltalk.TetrisPiece);
  539. smalltalk.addMethod(
  540. unescape('_drawOn_'),
  541. smalltalk.method({
  542. selector: unescape('drawOn%3A'),
  543. category: 'drawing',
  544. fn: function (aRenderingContext){
  545. var self=this;
  546. smalltalk.send(aRenderingContext, "_fillStyle_", [smalltalk.send(self, "_color", [])]);
  547. smalltalk.send(smalltalk.send(self, "_bounds", []), "_do_", [(function(each){var from=nil;
  548. var to=nil;
  549. from=((($receiver = ((($receiver = each).klass === smalltalk.Number) ? $receiver +smalltalk.send(self, "_position", []) : smalltalk.send($receiver, "__plus", [smalltalk.send(self, "_position", [])]))).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]));to=((($receiver = smalltalk.send((1), "__at", [(1)])).klass === smalltalk.Number) ? $receiver *smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", []) : smalltalk.send($receiver, "__star", [smalltalk.send((smalltalk.Tetris || Tetris), "_squareSize", [])]));return (function($rec){smalltalk.send($rec, "_fillRect_y_to_y_", [smalltalk.send(from, "_x", []), smalltalk.send(from, "_y", []), smalltalk.send(to, "_x", []), smalltalk.send(to, "_y", [])]);smalltalk.send($rec, "_strokeStyle_", [unescape("%23999")]);smalltalk.send($rec, "_lineWidth_", [(2)]);return smalltalk.send($rec, "_strokeRect_y_to_y_", [smalltalk.send(from, "_x", []), smalltalk.send(from, "_y", []), smalltalk.send(to, "_x", []), smalltalk.send(to, "_y", [])]);})(aRenderingContext);})]);
  550. return self;},
  551. args: ["aRenderingContext"],
  552. source: unescape('drawOn%3A%20aRenderingContext%0A%09aRenderingContext%20fillStyle%3A%20self%20color.%0A%09self%20bounds%20do%3A%20%5B%3Aeach%20%7C%7C%20from%20to%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20from%20%3A%3D%20each%20+%20self%20position*%20Tetris%20squareSize.%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20to%20%3A%3D%201@1%20*%20Tetris%20squareSize.%0A%09%09aRenderingContext%20%0A%09%09%09fillRect%3A%20from%20x%20y%3A%20from%20y%20to%3A%20to%20x%20y%3A%20to%20y%3B%0A%09%09%09strokeStyle%3A%20%27%23999%27%3B%0A%09%09%09lineWidth%3A%202%3B%0A%09%09%09strokeRect%3A%20from%20x%20y%3A%20from%20y%20to%3A%20to%20x%20y%3A%20to%20y%5D'),
  553. messageSends: ["fillStyle:", "color", "do:", "bounds", unescape("*"), unescape("+"), "position", "squareSize", unescape("@"), "fillRect:y:to:y:", "x", "y", "strokeStyle:", "lineWidth:", "strokeRect:y:to:y:"],
  554. referencedClasses: [smalltalk.Tetris]
  555. }),
  556. smalltalk.TetrisPiece);
  557. smalltalk.addMethod(
  558. unescape('_canMove'),
  559. smalltalk.method({
  560. selector: unescape('canMove'),
  561. category: 'testing',
  562. fn: function (){
  563. var self=this;
  564. return ((($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])) : smalltalk.send($receiver, "__lt", [((($receiver = smalltalk.send(smalltalk.send((smalltalk.Tetris || Tetris), "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]))]));
  565. return self;},
  566. args: [],
  567. source: unescape('canMove%0A%09%5Eself%20position%20y%20%3C%20%28Tetris%20squares%20y%20-%20self%20height%29'),
  568. messageSends: [unescape("%3C"), "y", "position", unescape("-"), "squares", "height"],
  569. referencedClasses: [smalltalk.Tetris]
  570. }),
  571. smalltalk.TetrisPiece);
  572. smalltalk.addMethod(
  573. unescape('_canMoveIn_'),
  574. smalltalk.method({
  575. selector: unescape('canMoveIn%3A'),
  576. category: 'testing',
  577. fn: function (aTetris){
  578. var self=this;
  579. return ((($receiver = smalltalk.send(smalltalk.send(self, "_position", []), "_y", [])).klass === smalltalk.Number) ? $receiver <((($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])])) : smalltalk.send($receiver, "__lt", [((($receiver = smalltalk.send(smalltalk.send(aTetris, "_squares", []), "_y", [])).klass === smalltalk.Number) ? $receiver -smalltalk.send(self, "_height", []) : smalltalk.send($receiver, "__minus", [smalltalk.send(self, "_height", [])]))]));
  580. return self;},
  581. args: ["aTetris"],
  582. source: unescape('canMoveIn%3A%20aTetris%0A%09%5Eself%20position%20y%20%3C%20%28aTetris%20squares%20y%20-%20self%20height%29'),
  583. messageSends: [unescape("%3C"), "y", "position", unescape("-"), "squares", "height"],
  584. referencedClasses: []
  585. }),
  586. smalltalk.TetrisPiece);
  587. smalltalk.addMethod(
  588. unescape('_atRandom'),
  589. smalltalk.method({
  590. selector: unescape('atRandom'),
  591. category: 'instance creation',
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.send(smalltalk.send(smalltalk.send(self, "_subclasses", []), "_at_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_subclasses", []), "_size", []), "_atRandom", [])]), "_new", []);
  595. return self;},
  596. args: [],
  597. source: unescape('atRandom%0A%09%5E%28self%20subclasses%20at%3A%20self%20subclasses%20size%20atRandom%29%20new'),
  598. messageSends: ["new", "at:", "subclasses", "atRandom", "size"],
  599. referencedClasses: []
  600. }),
  601. smalltalk.TetrisPiece.klass);
  602. smalltalk.addClass('TetrisPieceO', smalltalk.TetrisPiece, [], 'Examples');
  603. smalltalk.addMethod(
  604. unescape('_bounds'),
  605. smalltalk.method({
  606. selector: unescape('bounds'),
  607. category: 'accessing',
  608. fn: function (){
  609. var self=this;
  610. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(1)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_new", []));
  611. return self;},
  612. args: [],
  613. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%200@1%3B%0A%09%09add%3A%201@0%3B%0A%09%09add%3A%201@1%3B%0A%09%09yourself'),
  614. messageSends: ["add:", unescape("@"), "yourself", "new"],
  615. referencedClasses: [smalltalk.Array]
  616. }),
  617. smalltalk.TetrisPieceO);
  618. smalltalk.addClass('TetrisPieceL', smalltalk.TetrisPiece, [], 'Examples');
  619. smalltalk.addMethod(
  620. unescape('_bounds'),
  621. smalltalk.method({
  622. selector: unescape('bounds'),
  623. category: 'accessing',
  624. fn: function (){
  625. var self=this;
  626. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(2)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(2)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_new", []));
  627. return self;},
  628. args: [],
  629. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%200@1%3B%0A%09%09add%3A%200@2%3B%0A%09%09add%3A%201@2%3B%0A%09%09yourself'),
  630. messageSends: ["add:", unescape("@"), "yourself", "new"],
  631. referencedClasses: [smalltalk.Array]
  632. }),
  633. smalltalk.TetrisPieceL);
  634. smalltalk.addMethod(
  635. unescape('_color'),
  636. smalltalk.method({
  637. selector: unescape('color'),
  638. category: 'accessing',
  639. fn: function (){
  640. var self=this;
  641. return unescape("%23ffa");
  642. return self;},
  643. args: [],
  644. source: unescape('color%0A%09%5E%27%23ffa%27'),
  645. messageSends: [],
  646. referencedClasses: []
  647. }),
  648. smalltalk.TetrisPieceL);
  649. smalltalk.addMethod(
  650. unescape('_height'),
  651. smalltalk.method({
  652. selector: unescape('height'),
  653. category: 'accessing',
  654. fn: function (){
  655. var self=this;
  656. return (3);
  657. return self;},
  658. args: [],
  659. source: unescape('height%0A%09%5E3'),
  660. messageSends: [],
  661. referencedClasses: []
  662. }),
  663. smalltalk.TetrisPieceL);
  664. smalltalk.addClass('TetrisPieceJ', smalltalk.TetrisPiece, [], 'Examples');
  665. smalltalk.addMethod(
  666. unescape('_color'),
  667. smalltalk.method({
  668. selector: unescape('color'),
  669. category: 'accessing',
  670. fn: function (){
  671. var self=this;
  672. return unescape("%23aaf");
  673. return self;},
  674. args: [],
  675. source: unescape('color%0A%09%5E%27%23aaf%27'),
  676. messageSends: [],
  677. referencedClasses: []
  678. }),
  679. smalltalk.TetrisPieceJ);
  680. smalltalk.addMethod(
  681. unescape('_bounds'),
  682. smalltalk.method({
  683. selector: unescape('bounds'),
  684. category: 'accessing',
  685. fn: function (){
  686. var self=this;
  687. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(2)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(2)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_new", []));
  688. return self;},
  689. args: [],
  690. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%201@0%3B%0A%09%09add%3A%201@1%3B%0A%09%09add%3A%201@2%3B%0A%09%09add%3A%200@2%3B%0A%09%09yourself'),
  691. messageSends: ["add:", unescape("@"), "yourself", "new"],
  692. referencedClasses: [smalltalk.Array]
  693. }),
  694. smalltalk.TetrisPieceJ);
  695. smalltalk.addMethod(
  696. unescape('_height'),
  697. smalltalk.method({
  698. selector: unescape('height'),
  699. category: 'accessing',
  700. fn: function (){
  701. var self=this;
  702. return (3);
  703. return self;},
  704. args: [],
  705. source: unescape('height%0A%09%5E3'),
  706. messageSends: [],
  707. referencedClasses: []
  708. }),
  709. smalltalk.TetrisPieceJ);
  710. smalltalk.addClass('TetrisPieceI', smalltalk.TetrisPiece, [], 'Examples');
  711. smalltalk.addMethod(
  712. unescape('_color'),
  713. smalltalk.method({
  714. selector: unescape('color'),
  715. category: 'accessing',
  716. fn: function (){
  717. var self=this;
  718. return unescape("%23faa");
  719. return self;},
  720. args: [],
  721. source: unescape('color%0A%09%5E%27%23faa%27'),
  722. messageSends: [],
  723. referencedClasses: []
  724. }),
  725. smalltalk.TetrisPieceI);
  726. smalltalk.addMethod(
  727. unescape('_bounds'),
  728. smalltalk.method({
  729. selector: unescape('bounds'),
  730. category: 'accessing',
  731. fn: function (){
  732. var self=this;
  733. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(1)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(2)])]);smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(3)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_new", []));
  734. return self;},
  735. args: [],
  736. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%200@1%3B%0A%09%09add%3A%200@2%3B%0A%09%09add%3A%200@3%3B%0A%09%09yourself'),
  737. messageSends: ["add:", unescape("@"), "yourself", "new"],
  738. referencedClasses: [smalltalk.Array]
  739. }),
  740. smalltalk.TetrisPieceI);
  741. smalltalk.addMethod(
  742. unescape('_height'),
  743. smalltalk.method({
  744. selector: unescape('height'),
  745. category: 'accessing',
  746. fn: function (){
  747. var self=this;
  748. return (4);
  749. return self;},
  750. args: [],
  751. source: unescape('height%0A%09%5E4'),
  752. messageSends: [],
  753. referencedClasses: []
  754. }),
  755. smalltalk.TetrisPieceI);
  756. smalltalk.addClass('TetrisPieceT', smalltalk.TetrisPiece, [], 'Examples');
  757. smalltalk.addMethod(
  758. unescape('_bounds'),
  759. smalltalk.method({
  760. selector: unescape('bounds'),
  761. category: 'accessing',
  762. fn: function (){
  763. var self=this;
  764. return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send((0), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((2), "__at", [(0)])]);smalltalk.send($rec, "_add_", [smalltalk.send((1), "__at", [(1)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_new", []));
  765. return self;},
  766. args: [],
  767. source: unescape('bounds%0A%09%5EArray%20new%0A%09%09add%3A%200@0%3B%0A%09%09add%3A%201@0%3B%0A%09%09add%3A%202@0%3B%0A%09%09add%3A%201@1%3B%0A%09%09yourself'),
  768. messageSends: ["add:", unescape("@"), "yourself", "new"],
  769. referencedClasses: [smalltalk.Array]
  770. }),
  771. smalltalk.TetrisPieceT);
  772. smalltalk.addMethod(
  773. unescape('_color'),
  774. smalltalk.method({
  775. selector: unescape('color'),
  776. category: 'accessing',
  777. fn: function (){
  778. var self=this;
  779. return unescape("%23aaf");
  780. return self;},
  781. args: [],
  782. source: unescape('color%0A%09%5E%27%23aaf%27'),
  783. messageSends: [],
  784. referencedClasses: []
  785. }),
  786. smalltalk.TetrisPieceT);