TI 83/84
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Dev Hardware ForumsSOFTWARETI 83/84

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old August 14th, 2009, 03:32 PM
Peder Peder is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 19 Peder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 18 sec
Reputation Power: 0
A Playfair program

Ok, it might not be the most useful program you could think of, concidering how simple it is compared to modern techniques, but I thought it would be a fun thing to have.

http://www.pbs.org/wgbh/nova/decoding/playfair.html - the instructions to the Playfair cipher.
As I'm fairly new to programming still, I'm first of all wondering: is it a do-able task?
I thought, you insert your own keyword, and then you could either encrypt or decrypt a message or word. So this way, you could communicate with just those who have the right keyword (other keywords would give other - or meaningless - words)

Would this maybe involve a matrix? At least on paper, you draw something like a table. This is the part where I'm relying on response Help?

Reply With Quote
  Trader Rating: 0 · #2  
Old August 14th, 2009, 09:45 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Quote:
Originally Posted by Peder
Ok, it might not be the most useful program you could think of, concidering how simple it is compared to modern techniques, but I thought it would be a fun thing to have.

http://www.pbs.org/wgbh/nova/decoding/playfair.html - the instructions to the Playfair cipher.
As I'm fairly new to programming still, I'm first of all wondering: is it a do-able task?
I thought, you insert your own keyword, and then you could either encrypt or decrypt a message or word. So this way, you could communicate with just those who have the right keyword (other keywords would give other - or meaningless - words)

Would this maybe involve a matrix? At least on paper, you draw something like a table. This is the part where I'm relying on response Help?

Hmm... That seems pretty interesting
It took me a second to understand exactly how to encrypt it, but I think I got it now. One thing I've been wondering about it, though is what would happen if in your table, you had two numbers in the same row, and one was on the right most column? You're supposed to take the letter to the right of it, but since there is none, what would you do? I have a feeling that it would say to just use the number itself, but I can't be sure.
Anyways, it looks like it would be mostly tedious, rather than difficult. It probably should be done with a matrix as the box/table, and I think a list as the encryption.
If you ask me, it seems natural to just first take the keyword, change the string into numbers that are stored into the matrix, and then fill up the rest of the matrix with the unused numbers, and start encryption algorithms from there.
Find the X and Y of each letter combination; if X1 doesn't equal X2, and Y1 equals Y2, then use X+1 for each X, and the same for Y also. If X1 doesn't equal X2, AND Y1 doesn't equal Y2, then using a temporary variable, switch the values accordingly, (X1 with X2, then Y1 with Y2), and take the letters from those positions.
Let me work on it for a bit, and I should have a working encryption coding done in not too long. I'm not entirely sure about the un-encryption coding, though...
__________________
日本のクールだ
Ich liebe Deutsch!

TI BASIC Tutor

Reply With Quote
  Trader Rating: 0 · #3  
Old August 15th, 2009, 05:54 AM
Peder Peder is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 19 Peder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 18 sec
Reputation Power: 0
Nice. Glad it doesn't look impossible.
However, there are some things I don't know how to do yet. For instance, the numbers-instead-of-letters. I understand that it's absolutely the way to go, but how do you do it? Is there a quick way to say "A->1, Z->26 (?), figure out the rest" to the calculator? Or, actually, for this program, z will be number 25, as i and j "shares" their spot to make the 5x5 square fit.

Another thing, about the thing you wrote with instances where you're "locked" into the right side, where you should (according to the standard technique) pick the number/letter to the right (which isn't there, because you're already far right): I have used to just move "back to the other side" of the column, like you do in snake-games:

- A B C D E - E C <- E C being the message
gives you:
- A B C D E - A D <- Encrypted message

(A B C D E being one of the columns)

This way, if you do the technique reversed (going left), you do "the snake move", and end up with E and C.

Reply With Quote
  Trader Rating: 0 · #4  
Old August 15th, 2009, 11:43 AM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Quote:
Originally Posted by Peder
Nice. Glad it doesn't look impossible.
However, there are some things I don't know how to do yet. For instance, the numbers-instead-of-letters. I understand that it's absolutely the way to go, but how do you do it? Is there a quick way to say "A->1, Z->26 (?), figure out the rest" to the calculator? Or, actually, for this program, z will be number 25, as i and j "shares" their spot to make the 5x5 square fit.

Another thing, about the thing you wrote with instances where you're "locked" into the right side, where you should (according to the standard technique) pick the number/letter to the right (which isn't there, because you're already far right): I have used to just move "back to the other side" of the column, like you do in snake-games:

- A B C D E - E C <- E C being the message
gives you:
- A B C D E - A D <- Encrypted message

(A B C D E being one of the columns)

This way, if you do the technique reversed (going left), you do "the snake move", and end up with E and C.

Ok, I see what you mean about that snake thing. I'm making good progress with the encryptor. What I did with letters to numbers is did some straight out coding, making 25 if statements. sub(Str1,A,1->Str2. If Str2="A":1->L1(A
And so on and so forth. Except for I/J, If Str2="I" or Str2="J":9->L1(A
Right now, I'm having a bit of trouble telling it to not add a number to the matrix if the same number is already in it. But it shouldn't take too long to fix that. After that, I'll get it to go through all 25 numbers, and add (in sequential order, of course) all the remaining numbers that aren't already in it.
I'll update you when I'm done with that and post the coding as I have it.

Reply With Quote
  Trader Rating: 0 · #5  
Old August 15th, 2009, 11:48 AM
Peder Peder is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 19 Peder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 18 sec
Reputation Power: 0
Quote:
Originally Posted by MufinMcFlufin
Ok, I see what you mean about that snake thing. I'm making good progress with the encryptor. What I did with letters to numbers is did some straight out coding, making 25 if statements. sub(Str1,A,1->Str2. If Str2="A":1->L1(A
And so on and so forth. Except for I/J, If Str2="I" or Str2="J":9->L1(A
Right now, I'm having a bit of trouble telling it to not add a number to the matrix if the same number is already in it. But it shouldn't take too long to fix that. After that, I'll get it to go through all 25 numbers, and add (in sequential order, of course) all the remaining numbers that aren't already in it.
I'll update you when I'm done with that and post the coding as I have it.


Awesome. I'll try to understand as much of it as I can. Thanks a lot for all the help!

Reply With Quote
  Trader Rating: 0 · #6  
Old August 19th, 2009, 12:33 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Quote:
Originally Posted by Peder
Awesome. I'll try to understand as much of it as I can. Thanks a lot for all the help!

Hey, I finished the first part of the coding
Next I'm working on the coding that will encrypt the message.
In order, here's what I have so far, and how it does it.
It inputs the keyword, converts it into numbers in a list, puts those numbers into a matrix, eliminates the repeats (changes their values to 0), moves all the numbers to put all the zeros after the keyword, makes a new list of numbers not used in the matrix yet, again moves the numbers so the 0 are at the end, inputs the numbers into the matrix in sequential order and into empty spaces (0), and finally outputs the entire matrix on the homescreen.
I've already started on the coding for the message.
Right now I'm on getting it to convert all spaces into X's, then having it change a repeated number into an "X", and moving the repeated number down the list one (one more to the end).
Here's the code so far
All you do is enter the keyword, then it computes the matrix, and displays it.
Note, it is two programs, so the code will show two programs, PLAYFAIR and LETTERS
Code:
prgmPLAYFAIR
:Input Str1
:prgmLETTERS
:1->A
:{5,5->dim([A]
:Fill(0,[A]
:For(B,1,5
:For(C,1,5
:1->E
:For(D,1,A
:If D*doesn't equal*A:E(*list*A(D)*doesn't equal**list*A(A->E
:End
:If E:*list*A->[A](B,C
:If A=dim(*list*A:Then
:5->B
:5->C
:End
:A+1->A
:End:End
:For(B,1,5
:For(C,1,5
:If not([A](B,C:Then
:For(D,1,5
:For(E,1,5
:If D>B or D=B and E>C:Then
:[A](D,E->[A](B,C
:0->[A](D,E
:5->D
:5->E
:End:End:End:End:End:End:End---------7 End statements
:25->dim(*list 1*
:For(A,1,25
:A->*list 1*(A
:End
:25->dim(*list 2*
:Fill(1,*list 2*
:For(A,1,dim(*list* A
:For(B,1,25
:*list 2*(B)not(*list* A(A)=*list 1*(B->*list 2*(B
:End:End
:For(A,1,25
:A*list 2*(A->*list 1*(A
:End
:For(A,1,25
:If not(*list 1*(A:Then
:For(B,A,25
:If *list 1*(B:Then
:*list 1*(B->*list 1*(A
:0->*list 1*(A
:25->B
:End:End:End:End---------4 End statements
:26->dim(*list 1*
:For(A,25,1,-1
:*list 1*(A->*list 1*(A+1
:End
:0->*list 1*(1
:1->C
:For(A,1,5
:For(B,1,5
:C+not([A](A,B->C
:[A](A,B)+*list 1*(C)not([A](A,B->[A](A,B
:End:End
:DelVar Str2ClrHome
:For(A,1,5
:" "->Str2
:For(B,1,5
:[A](A,B->C
:If C=1:Str2+"A"->Str2
:If C=2:Str2+"B"->Str2
:If C=3:Str2+"C"->Str2
:If C=4:Str2+"D"->Str2
:If C=5:Str2+"E"->Str2
:If C=6:Str2+"F"->Str2
:If C=7:Str2+"G"->Str2
:If C=8:Str2+"H"->Str2
:If C=9:Str2+"I"->Str2
:If C=10:Str2+"K"->Str2
:If C=11:Str2+"L"->Str2
:If C=12:Str2+"M"->Str2
:If C=13:Str2+"N"->Str2
:If C=14:Str2+"O"->Str2
:If C=15:Str2+"P"->Str2
:If C=16:Str2+"Q"->Str2
:If C=17:Str2+"R"->Str2
:If C=18:Str2+"S"->Str2
:If C=19:Str2+"T"->Str2
:If C=20:Str2+"U"->Str2
:If C=21:Str2+"V"->Str2
:If C=22:Str2+"W"->Str2
:If C=23:Str2+"X"->Str2
:If C=24:Str2+"Y"->Str2
:If C=25:Str2+"Z"->Str2
:Str2+" "->Str2
:End
:Output(A,1,Str2
:End
:Str1->Str4
:Disp "","","","","
:Input Str1
:prgmLETTERS
-------------new program here---------------
prgmLETTERS
:Str1->Str2
:length(Str1->dim(*list* A
:For(A,1,length(Str2
:sub(Str2,A,1->Str3
:If Str3=" ":0->*list*A(A
:If Str3="A":1->*list*A(A
:If Str3="B":2->*list*A(A
:If Str3="C":3->*list*A(A
:If Str3="D":4->*list*A(A
:If Str3="E":5->*list*A(A
:If Str3="F":6->*list*A(A
:If Str3="G":7->*list*A(A
:If Str3="H":8->*list*A(A
:If Str3="I" or Str3="J":9->*list*A(A
:If Str3="K":10->*list*A(A
:If Str3="L":11->*list*A(A
:If Str3="M":12->*list*A(A
:If Str3="N":13->*list*A(A
:If Str3="O":14->*list*A(A
:If Str3="P":15->*list*A(A
:If Str3="Q":16->*list*A(A
:If Str3="R":17->*list*A(A
:If Str3="S":18->*list*A(A
:If Str3="T":19->*list*A(A
:If Str3="U":20->*list*A(A
:If Str3="V":21->*list*A(A
:If Str3="W":22->*list*A(A
:If Str3="X":23->*list*A(A
:If Str3="Y":24->*list*A(A
:If Str3="Z":25->*list*A(A
:End
:*list* A->*list 3*

That's the code as I have it so far. It has become quite extensive, and takes longer than I expected. As soon as I finish it, I can start optimizing it, but that seems still quite a while's way away.
Until the message encrypting code is done, Auf Wiedersehen!

Last edited by MufinMcFlufin : August 19th, 2009 at 09:33 PM.

Reply With Quote
  Trader Rating: 0 · #7  
Old August 21st, 2009, 10:53 AM
Peder Peder is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 19 Peder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 18 sec
Reputation Power: 0
Quote:
Originally Posted by MufinMcFlufin
Hey, I finished the first part of the coding
Next I'm working on the coding that will encrypt the message.
In order, here's what I have so far, and how it does it.
It inputs the keyword, converts it into numbers in a list, puts those numbers into a matrix, eliminates the repeats (changes their values to 0), moves all the numbers to put all the zeros after the keyword, makes a new list of numbers not used in the matrix yet, again moves the numbers so the 0 are at the end, inputs the numbers into the matrix in sequential order and into empty spaces (0), and finally outputs the entire matrix on the homescreen.
I've already started on the coding for the message.
Right now I'm on getting it to convert all spaces into X's, then having it change a repeated number into an "X", and moving the repeated number down the list one (one more to the end).
Here's the code so far
All you do is enter the keyword, then it computes the matrix, and displays it.
Note, it is two programs, so the code will show two programs, PLAYFAIR and LETTERS
Code:
prgmPLAYFAIR
:Input Str1
:prgmLETTERS
:1->A
:{5,5->dim([A]
:Fill(0,[A]
:For(B,1,5
:For(C,1,5
:1->E
:For(D,1,A
:If D*doesn't equal*A:E(*list*A(D)*doesn't equal**list*A(A->E
:End
:If E:*list*A->[A](B,C
:If A=dim(*list*A:Then
:5->B
:5->C
:End
:A+1->A
:End:End
:For(B,1,5
:For(C,1,5
:If not([A](B,C:Then
:For(D,1,5
:For(E,1,5
:If D>B or D=B and E>C:Then
:[A](D,E->[A](B,C
:0->[A](D,E
:5->D
:5->E
:End:End:End:End:End:End:End---------7 End statements
:25->dim(*list 1*
:For(A,1,25
:A->*list 1*(A
:End
:25->dim(*list 2*
:Fill(1,*list 2*
:For(A,1,dim(*list* A
:For(B,1,25
:*list 2*(B)not(*list* A(A)=*list 1*(B->*list 2*(B
:End:End
:For(A,1,25
:A*list 2*(A->*list 1*(A
:End
:For(A,1,25
:If not(*list 1*(A:Then
:For(B,A,25
:If *list 1*(B:Then
:*list 1*(B->*list 1*(A
:0->*list 1*(A
:25->B
:End:End:End:End---------4 End statements
:26->dim(*list 1*
:For(A,25,1,-1
:*list 1*(A->*list 1*(A+1
:End
:0->*list 1*(1
:1->C
:For(A,1,5
:For(B,1,5
:C+not([A](A,B->C
:[A](A,B)+*list 1*(C)not([A](A,B->[A](A,B
:End:End
:DelVar Str2ClrHome
:For(A,1,5
:" "->Str2
:For(B,1,5
:[A](A,B->C
:If C=1:Str2+"A"->Str2
:If C=2:Str2+"B"->Str2
:If C=3:Str2+"C"->Str2
:If C=4:Str2+"D"->Str2
:If C=5:Str2+"E"->Str2
:If C=6:Str2+"F"->Str2
:If C=7:Str2+"G"->Str2
:If C=8:Str2+"H"->Str2
:If C=9:Str2+"I"->Str2
:If C=10:Str2+"K"->Str2
:If C=11:Str2+"L"->Str2
:If C=12:Str2+"M"->Str2
:If C=13:Str2+"N"->Str2
:If C=14:Str2+"O"->Str2
:If C=15:Str2+"P"->Str2
:If C=16:Str2+"Q"->Str2
:If C=17:Str2+"R"->Str2
:If C=18:Str2+"S"->Str2
:If C=19:Str2+"T"->Str2
:If C=20:Str2+"U"->Str2
:If C=21:Str2+"V"->Str2
:If C=22:Str2+"W"->Str2
:If C=23:Str2+"X"->Str2
:If C=24:Str2+"Y"->Str2
:If C=25:Str2+"Z"->Str2
:Str2+" "->Str2
:End
:Output(A,1,Str2
:End
:Str1->Str4
:Disp "","","","","
:Input Str1
:prgmLETTERS
-------------new program here---------------
prgmLETTERS
:Str1->Str2
:length(Str1->dim(*list* A
:For(A,1,length(Str2
:sub(Str2,A,1->Str3
:If Str3=" ":0->*list*A(A
:If Str3="A":1->*list*A(A
:If Str3="B":2->*list*A(A
:If Str3="C":3->*list*A(A
:If Str3="D":4->*list*A(A
:If Str3="E":5->*list*A(A
:If Str3="F":6->*list*A(A
:If Str3="G":7->*list*A(A
:If Str3="H":8->*list*A(A
:If Str3="I" or Str3="J":9->*list*A(A
:If Str3="K":10->*list*A(A
:If Str3="L":11->*list*A(A
:If Str3="M":12->*list*A(A
:If Str3="N":13->*list*A(A
:If Str3="O":14->*list*A(A
:If Str3="P":15->*list*A(A
:If Str3="Q":16->*list*A(A
:If Str3="R":17->*list*A(A
:If Str3="S":18->*list*A(A
:If Str3="T":19->*list*A(A
:If Str3="U":20->*list*A(A
:If Str3="V":21->*list*A(A
:If Str3="W":22->*list*A(A
:If Str3="X":23->*list*A(A
:If Str3="Y":24->*list*A(A
:If Str3="Z":25->*list*A(A
:End
:*list* A->*list 3*

That's the code as I have it so far. It has become quite extensive, and takes longer than I expected. As soon as I finish it, I can start optimizing it, but that seems still quite a while's way away.
Until the message encrypting code is done, Auf Wiedersehen!


Wow. Dude. Looks great. Again, I'll try to understand as much of it as I can

Reply With Quote
  Trader Rating: 0 · #8  
Old August 21st, 2009, 10:59 AM
archnaid's Avatar
archnaid archnaid is offline
Moderator
Dev Hardware Specialist (4000 - 4499 posts)
 
Join Date: Feb 2004
Posts: 4,059 archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)  Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 1 Month 1 Week 2 Days 13 h 20 m 16 sec
Reputation Power: 5917
Just out of curiosity, is there any particular reason you want this implemented on the calculator?

If it's just as a project to help you learn some programming or something, you'd really be better served by doing it on a computer with a better language.

Reply With Quote
  Trader Rating: 0 · #9  
Old August 21st, 2009, 01:56 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Quote:
Originally Posted by archnaid
Just out of curiosity, is there any particular reason you want this implemented on the calculator?

If it's just as a project to help you learn some programming or something, you'd really be better served by doing it on a computer with a better language.

Yeah that's true
I'm doing it just to see if I could do it, and I just finished it.
Right now, though, I'm just working on getting a couple bugs out.
(Ex: I inputted "The red fox quickly jumps over the lazy brown dog", encrypted it, decrypted it (yes I added a decryptor, it proved much easier to do than I expected), and got back "The red fox quickly jumps over the lazy brown dod", and I've yet to figure out why...and this could only be the beginning of the bugs)

Reply With Quote
  Trader Rating: 0 · #10  
Old August 24th, 2009, 04:07 AM
Peder Peder is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 19 Peder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 10 m 18 sec
Reputation Power: 0
Quote:
Originally Posted by archnaid
Just out of curiosity, is there any particular reason you want this implemented on the calculator?

If it's just as a project to help you learn some programming or something, you'd really be better served by doing it on a computer with a better language.


Well, I'm fairly new to programming, so I don't really know that many languages. Frankly, my calculator has been the only thing I've been programming for until last week, when I downloaded python.

Any suggestions to alternative languages? I really don't know anything about this. I've heard about C and C+ and such, and now python, but I don't know the differences or what they ar capable of doing.

Reply With Quote
  Trader Rating: 0 · #11  
Old August 24th, 2009, 05:50 AM
archnaid's Avatar
archnaid archnaid is offline
Moderator
Dev Hardware Specialist (4000 - 4499 posts)
 
Join Date: Feb 2004
Posts: 4,059 archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)archnaid User rank is General 74th Grade (Above 100000 Reputation Level)  Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2Folding Points: 692672 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 1 Month 1 Week 2 Days 13 h 20 m 16 sec
Reputation Power: 5917
Well, I'm certainly no programming expert.

However, I do see Python and C++ crop up a lot when learning a first language. Python for it's simplicity and power, plus it offers object oriented programming without forcing you to learn all kinds of messy details - from a conceptual point, it can be a good place to start to get you feet wet. Python is also pretty unique and some of the ways you do things in Python you have to adjust a little for other languages, but this is true when switching between most languages. C++ is good as it is in widespread use, allows you to learn more of the nitty-gritty details with object oriented programming, it gets you experience with compilation of code and linking libraries, and it's a more "orthodox" language compared to Python.

I personally learned C++ first, but only because I had to take a class in it. It wasn't a bad place to start by any means, but my impression looking back is that it requires you to deal with a lot more details and concepts just getting started than Python would. I've been learning some Python myself recently, and there doesn't seem to be as much of that overhead required. Not that it's bad knowledge to have - it's just that Python and C++ are designed in different ways to be good at different things.

I think either language would be a good place to start. But I see Python as having a lower barrier to entry, to put it in economic terms. Both are worthwhile.

Reply With Quote
  Trader Rating: 0 · #12  
Old September 13th, 2009, 10:03 PM
MufinMcFlufin's Avatar
MufinMcFlufin MufinMcFlufin is offline
The Muffinator
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Location: South Eastern USA
Posts: 205 MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level)MufinMcFlufin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 59 m 58 sec
Reputation Power: 95
Ok, done
sorry for the delay
I was looking for bugs, couldn't find any that would cause the one I posted earlier, forgot about it, and recently saw the program again.
Anyways, here's the entirety of the 2 programs.
It inputs the keyword, generates the matrix, you select either encrypting or decrypting, and input the message or encryption ,respectively. It uses two programs, LETTERS and PLAYFAIR, and takes up about 2800 bytes, plus the strings, and matrices.
I'm using an online code editor, so I'm not going through to check everything.
Here's the codes:
Code:
PROGRAM:PLAYFAIR
:Str1→Str5
:ClrHome
:Disp "INPUT KEYWORD
:Input ": ",Str1
:prgmLETTERS
:1→A:dim(∟A→θ:{5,5→dim([A]
:Fill 0,[A]
:For(B,1,5
:For(C,1,5
:1→E
:For(D,1,A
:If D≠A:E(∟A(D)≠∟A(A→E
:End
:If E:∟A(A→[A](B,C
:If A=dim(∟A:Then
:5→B
:5→C
:End
:A+1→A
:End:End
:For(B,1,5
:For(C,1,5
:If not([A](B,C:Then
:For(D,1,5
:For(E,1,5
:If D>B or D=B and E>C:Then
:If [A](D,E:Then
:[A](D,E→[A](B,C
:0→[A](D,E
:5→D
:5→E
:End:End:End:End:End:End:End
:25→dim(L1
:For(A,1,25
:A→L1(A
:End
:25→dim(L2
:Fill 1,L2
:For(A,1,dim(∟A
:For(B,1,25
:L2(B)not(∟A(A)=L1(B→L2(B
:End:End
:For(A,1,25
:AL2(A→L1(A
:End
:For(A,1,25
:If not(L1(A:Then
:For(B,A,25
:If L1(B:Then
:L1(B→L1(A
:0→L1(B
:25→B
:End:End:End:End
:26→dim(L1
:For(A,25,1,‾1
:L1(A→L1(A+1
:End
:0→L1(1
:1→C
:For(A,1,5
:For(B,1,5
:C+not([A](A,B→C
:[A](A,B)+L1(C)not([A](A,B→[A](A,B
:End:End
:Disp "","ENCRYPTING OR","DECRYPTING?","(E/D)
:DelVar GRepeat Ans=51 or Ans=52:getKey→G:End
:(Ans=52)-(Ans=51→G
:"INPUT "→Str1
:If G=1:Str1+"MESSAGE"→Str1
:If G=‾1:Str1+"ENCRYPTION"→Str1
:ClrHome
:Disp Str1,"OR A SPACE TO","USE CODE IN Str1
:Input ": ",Str1
:If Str1=" ":Str5→Str1
:prgmLETTERS
:‾1→C
:For(A,1,dim(L3
:If not(L3(A:Then
:For(B,A,dim(L3
:If L3(B:Then
:L3(B→L3(A
:0→L3(B
:dim(L3→B
:End:End
:C+not(L3(B-1→C
:End:End
:‾C+dim(L3→dim(L3
:For(A,1,‾1+dim(L3
:If L3(A)=L3(A+1):Then
:1+dim(L3→dim(L3
:For(B,dim(L3),A+1,‾1
:L3(B-1→L3(B
:End
:23+2C→L3(A+1
:not(C→C
:Else
:0→C
:End:End
:dim(L3)-1→dim(L3
:2fPart(dim(L3)/2)+dim(L3→dim(L3
:If not(L3(dim(L3:23+2(23=L3(‾1+dim(L3→L3(dim(L3
:DelVar L2DelVar L1{0,0→L1
:For(C,1,2-1dim(L3
:{L3(2C-1),L3(2C→L2
:For(A,1,5
:For(B,1,5
:If [A](A,B)=L2(1:Then
:A→N:B→O:5→A:5→B
:End:End:End
:For(A,1,5
:For(B,1,5
:If [A](A,B)=L2(2:Then
:A→S:B→T:5→A:5→B
:End:End:End
:If N=S and O≠T:Then
:[A](N,O+G-5G(O=3+2G→L2(1
:[A](S,T+G-5G(T=3+2G→L2(2
:End
:If N≠S and O=T:Then
:[A](N+G-5G(N=3+2G),O→L2(1
:[A](S+G-5G(S=3+2G),T→L2(2
:End
:If N≠S and O≠T:Then
:[A](N,T→L2(1
:[A](S,O→L2(2
:End
:If L1(1)≠0 and L1(2)≠0:Then
:2+dim(L1→dim(L1
:L2(1→L1(‾1+dim(L1
:L2(2→L1(dim(L1
:Else
:L2→L1
:End:End
:" "→Str1
:For(B,1,dim(L1
:L1(B→A
:If A=1:Str1+"A"→Str1
:If A=2:Str1+"B"→Str1
:If A=3:Str1+"C"→Str1
:If A=4:Str1+"D"→Str1
:If A=5:Str1+"E"→Str1
:If A=6:Str1+"F"→Str1
:If A=7:Str1+"G"→Str1
:If A=8:Str1+"H"→Str1
:If A=9:Str1+"I"→Str1
:If A=10:Str1+"K"→Str1
:If A=11:Str1+"L"→Str1
:If A=12:Str1+"M"→Str1
:If A=13:Str1+"N"→Str1
:If A=14:Str1+"O"→Str1
:If A=15:Str1+"P"→Str1
:If A=16:Str1+"Q"→Str1
:If A=17:Str1+"R"→Str1
:If A=18:Str1+"S"→Str1
:If A=19:Str1+"T"→Str1
:If A=20:Str1+"U"→Str1
:If A=21:Str1+"V"→Str1
:If A=22:Str1+"W"→Str1
:If A=23:Str1+"X"→Str1
:If A=24:Str1+"Y"→Str1
:If A=25:Str1+"Z"→Str1
:End
:sub(Str1,2,‾1+length(Str1→Str1
:ClrHome
:Disp "CODE IS STORED","IN Str1 FOUND AT","[Vars],[7],[1]","AS LETTERS, AND","IN L1 FOUND AT","[2nd],[1] IN","NUMERICAL FORM
:Output(8,1,"-PRESS A BUTTON-
:Repeat getKey:End
:ClrHome
:Disp "I AND J ARE PUT","TOGETHER AND","THERE IS NO","PUNCTUATION SO","THE ENCRYPTION","WILL WORK
:Repeat getKey:End
:ClrHome
:If G=‾1:Then
:Disp "DOUBLE AND","TRIPLED LETTERS","ARE SEPERATED BY","A X OR Z"
:Repeat getKey:End
:ClrHome
:Disp "THERE MAY OR MAY","NOT BE A X AT","THE END.THAT HAS","NO MEANING,BUT","IS NEEDED FOR","ENCRYPTION. 
:Repeat getKey:End
:ClrHome
:Disp "LONG MESSAGES","MAY HAVE ERRORS
:Repeat getKey:End
:ClrHome
:End
:Disp "THANKS FOR USING","THIS PLAYFAIR","CODE ENCRYPTOR!
:


PROGRAM:LETTERS
:Str1→Str2
:length(Str1→dim(∟A
:For(A,1,length(Str2
:sub(Str2,A,1→Str3
:If Str3=" ":0→∟A(A
:If Str3="A":1→∟A(A
:If Str3="B":2→∟A(A
:If Str3="C":3→∟A(A
:If Str3="D":4→∟A(A
:If Str3="E":5→∟A(A
:If Str3="F":6→∟A(A
:If Str3="G":7→∟A(A
:If Str3="H":8→∟A(A
:If Str3="I" or Str3="J":9→∟A(A
:If Str3="K":10→∟A(A
:If Str3="L":11→∟A(A
:If Str3="M":12→∟A(A
:If Str3="N":13→∟A(A
:If Str3="O":14→∟A(A
:If Str3="P":15→∟A(A
:If Str3="Q":16→∟A(A
:If Str3="R":17→∟A(A
:If Str3="S":18→∟A(A
:If Str3="T":19→∟A(A
:If Str3="U":20→∟A(A
:If Str3="V":21→∟A(A
:If Str3="W":22→∟A(A
:If Str3="X":23→∟A(A
:If Str3="Y":24→∟A(A
:If Str3="Z":25→∟A(A
:End
:∟A→L3
:

I didn't check it over, so if there are typos, blame Cemetech.
Also, it's been a while since I made this, and it could be optimized, but I've got Calculus to do right now, so just be a little more patient with it's (lack of) speed.

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWARETI 83/84 > A Playfair program


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
     
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek