~pmikkelsen/apl2048

9d87e150a933e99782befbfcb8825c8c26fbfb60 — Peter Mikkelsen 7 months ago 09e36e1 master
Rename shift to remove
1 files changed, 4 insertions(+), 4 deletions(-)

M swipeup.aplf
M swipeup.aplf => swipeup.aplf +4 -4
@@ 1,12 1,12 @@
 swipeup←{
     swiperow←{
         (⍴⍵)↑1{
             shift←{(⍺≠⍳⍴⍵)/⍵}
             remove←{(⍺≠⍳⍴⍵)/⍵}
             (⍺+1)>⍴⍵:⍵
             ⍵[⍺]=0:⍺ ∇ ⍺ shift ⍵
             ⍵[⍺+1]=0:⍺ ∇ (⍺+1) shift ⍵
             ⍵[⍺]=0:⍺ ∇ ⍺ remove ⍵
             ⍵[⍺+1]=0:⍺ ∇ (⍺+1) remove ⍵
             ⍵[⍺]≠⍵[⍺+1]:(⍺+1)∇ ⍵
             ⍵[⍺]=⍵[⍺+1]:(⍺+1)∇ (⍺+1) shift((⍵[⍺]×2)@⍺)⍵
             ⍵[⍺]=⍵[⍺+1]:(⍺+1)∇ (⍺+1) remove ((⍵[⍺]×2)@⍺)⍵
         }⍵
     }
     newnumber⍉(⍴⍵)⍴∊swiperow¨⊂[1]⍵