├── README.md
├── demo.html
├── js
└── tetris.js
├── project.clj
├── src
└── tetris
│ ├── core.clj
│ ├── core.cljs
│ └── game.cljc
├── tetris-1.0-standalone.jar
└── tetris.html
/README.md:
--------------------------------------------------------------------------------
1 | Sample Tetris game in Clojure/Script
2 |
3 | [demo](https://rawgit.com/yogthos/Clojure-Tetris/master/demo.html)
4 |
5 | to compile Clojure version run
6 | ```bash
7 | lein uberjar
8 | ```
9 | to compile ClojureScript version run
10 | ```bash
11 | lein cljsbuild once
12 | ```
13 |
14 | Open `tetris.html` in a browser to play the game.
15 |
16 | Copyright (C) 2010 Yogthos
17 |
18 | Distributed under the Eclipse Public License License.
19 |
--------------------------------------------------------------------------------
/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
14 |
15 |
16 |
17 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/js/tetris.js:
--------------------------------------------------------------------------------
1 | if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) {
2 | Math.imul = function (a, b) {
3 | var ah = (a >>> 16) & 0xffff;
4 | var al = a & 0xffff;
5 | var bh = (b >>> 16) & 0xffff;
6 | var bl = b & 0xffff;
7 | // the shift by 0 fixes the sign on the high part
8 | // the final |0 converts the unsigned value into a signed value
9 | return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
10 | }
11 | }
12 |
13 |
14 | ;(function(){
15 | var f;
16 | function r(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
17 | b&&"undefined"==typeof a.call)return"object";return b}var aa="closure_uid_"+(1E9*Math.random()>>>0),ba=0;function ca(a,b){for(var c in a)b.call(void 0,a[c],c,a)};function da(a,b){this.U=[];this.Ua=b;for(var c=!0,d=a.length-1;0<=d;d--){var e=a[d]|0;c&&e==b||(this.U[d]=e,c=!1)}}var fa={};function ga(a){if(-128<=a&&128>a){var b=fa[a];if(b)return b}b=new da([a|0],0>a?-1:0);-128<=a&&128>a&&(fa[a]=b);return b}function ia(a){if(isNaN(a)||!isFinite(a))return ka;if(0>a)return ia(-a).ba();for(var b=[],c=1,d=0;a>=c;d++)b[d]=a/c|0,c*=la;return new da(b,0)}var la=4294967296,ka=ga(0),oa=ga(1),pa=ga(16777216);f=da.prototype;
18 | f.$b=function(){return 0