~pmikkelsen/apl2048

ref: 09e36e1c6d31a3d3061ee08901bdf8c7c2bd93ae apl2048/swipeup.aplf -rw-r--r-- 434 bytes
09e36e1cPeter Mikkelsen Simplify newgame function 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
 swipeup{
     swiperow{
         ()1{
             shift{(≠⍳⍴)/}
             (+1)>⍴⍵:⍵
             []=0:⍺   shift 
             [+1]=0:⍺  (+1) shift 
             [][+1]:(+1) 
             []=[+1]:(+1) (+1) shift(([]×2)@)
         }
     }
     newnumber()⍴∊swiperow¨[1]
 }