Code:
Lbl 1
ClrHome
Disp "ENTER NUMBER
Input "NUMBER? ",A
startTmr→H
seq(N,N,1,A→X
A/⌊X→Y
fPart(⌊Y)=0→Z
⌊Z*⌊X→X
⌊Z*⌊Y→Y
SortA(⌊X,⌊Y
dim(⌊X)/2
If ⌊X(iPart(dim(⌊X)/2))=0:Then
SortD(⌊X,⌊Y
While ⌊X(iPart(dim(⌊X)/2))=0
iPart(dim(⌊X)/2→dim(⌊X
iPart(dim(⌊Y)/2→dim(⌊Y
End
Goto 3
Else
Lbl 3
SortA(⌊X,⌊Y
While min(⌊X)=0
List(cumSum(⌊X→X
List(cumSum(⌊Y→Y
End
End
iPart((dim(⌊X)/2)+.5→M
M→dim(⌊X
M→dim(⌊Y
SortA(⌊X,⌊Y
Listmatr(⌊X,(⌊Y),[J]
Disp [J]
Output(5,1,Str0
Output(5,6,checkTmr(H
Pause
Menu("DO MORE?","YES",1,"NO",2
Lbl 2
ClrHome
Disp "GOODBYE!
If anyone has any optimizations for this I would love to see them! The parts I want to focus on are how to scroll if the matrix is too long, and how to bypass the 999 number limit on lists.
Thanks in advance!