Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
I'll be competing in TI-BASIC. I also know Python, so I may enter in that category as well.

EDIT: Here are my scores in TI-BASIC.

Week 1: 68 bytes
Week 2: 98 bytes
Week 3: 158 bytes
Week 4: 80 bytes
Week 5: 44 bytes

I think these are right, but I may need to go back and check.
I've submitted my first programs in both TI-BASIC and Python.
And....how big were they?
I have 69 bytes in Python for Challenge 2, but 100 in TI-BASIC. I don't know how PT_ got 85.
I fixed a bug (probably the same issue as PT_ had) and will submit my new programs momentarily.
I solved the third challenge yesterday, in... well, I don't want to say exactly, but fewer bytes in BASIC than PT_ has.

I also submitted a Python answer.
All right, here's my code:

Week 1:

Don't remember it right now. I think it's the same as PT_'s.

Week 2:

Code:
Ans->Str1
1->A
15->B
"ABCDEFGHIJKLMNOPQRSTUVWXYZ
For(X,1,length(Str1
   Ans+sub(Ans,1+remainder(A+BinString(Ans,sub(Str1,X,1)),26),1
End
sub(Ans,27,X-1


Week 3:

Code:
Ans->Str1
"CALCULATORS->Str2
ZStandard
"sub(Str1,I,1->|u
"ABCDEFGHIJKLMNOPQRSTUVWXYZ
Ans+Ans
For(I,1,length(Str1
    If |u!="
   Then
        Ans+sub(Ans,27+inString(Ans,|u)-inString(Ans,sub(Str2,1+remainder(Y,length(Str2)),1)),1
        IS>(Y,I
      Else
      Ans+"
   End
End
sub(Ans,53,I-1


This is an interesting one. Because we need to store the key in a variable (Str2), and take the ciphertext from Ans, we can't get away with what we did in Week 4 (using no variables). Therefore, instead of [alphabet, ciphertext, plaintext] Ans just holds two copies of the alphabet and the plaintext. Two copies removes the need for a remainder(,26.

Since Ans is taken, we also use the u variable to store the Ith character of the ciphertext. We only use u twice, but it still pays off. We can't use u to store any of the strings, because u is stored as a string, and strings can't be in strings.

Finally, instead of counting the spaces by incrementing Y the ordinary way (or counting the spaces at each iteration), we zero it by redrawing the graph screen (ZStandard), and then use IS>(. I was happy that this included the rare IS>(.

Week 4:

Code:
"ABCDEFGHIJKLMNOPQRSTUVWXYZ
For(R,0,62
    Ans+sub(Ans,1+remainder(Sigma(Cpxl-Test(R,C),C,0,94),27),1
End
sub(Ans,28,R


Week 5:

Code:
Ans->Str1
9
For(X,1,length(Str1
    Ans+[i][i]^expr(sub(Str1,X,1
    Pxl-On(imag(Ans),real(Ans
End


I wrote the first one independently, but I soon found that DarkerLine had used the same technique years ago! The idea is to append the code to the alphabet, store that in Ans, and then chop off the alphabet at the end. This makes it so Ans can be used for everything, and eliminates those two-byte references to Str1.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement