Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions archive/t/ti-basic/zeckendorf.8xp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Input "",Str1
"0123456789"->Str2
length(Str1)->L
L<1->E
0->D
0->V
1->N
1->S
While E=0 and N<=L
sub(Str1,N,1)->C
inString(Str2,C)-1->K
If C="+" or C="-"
Then
D>0->E
If C="-"
Then 0-S->S
End
Else
K<0->E
D+1->D
V*10+K*S->V
End
N+1->N
End
If E or D<1 or V<0->E Then Disp "Usage: please input a non-negative integer"
Else
1->A
2->B
While A<=V
B+A->B
B-A->A
End
{}->l1
0->N
While V>0
B-A->A
B-A->B
If V>=A Then
N+1->N
A->l1(N)
V-A->V
End
End
End
If l1 Then
Disp l1
End