# Code.

Discussion in 'Free Thoughts' started by TheFrogger, Jul 21, 2019.

1. ### TheFroggerValued Senior Member

Messages:
1,718
Hi there.

I am trying to develop a new code. It runs along the lines of the following: the "program" counts through the twenty-six letters of the alphabet, before moving to the next "parenthesis", counting there next, before moving to the next parenthesis.

Code:
For LETTER_ONE=1to 26

For LETTER_TWO=1 to 26

For LETTER_THREE=1 to 26

Word

Next LETTER_THREE

Next LETTER_TWO

next LETTER_ONE
What would be the mathematical formula to describe such a program?

You would need to describe the length of the word (or sentence) aswell as which letters are to be chosen. The code would look something like this: 4, 12345.

Is the following correct to spell a word?

(Letter no.)+(letterno.^2)+(letterno.^3)+(letterno.^4)

3. ### James RJust this guy, you know?Staff Member

Messages:
32,997
Hi TheFrogger,

Your word description doesn't match your code, as far as I can tell. The code snippet you posted just has 3 nested loops, so that it will do whatever "Word" means 26*26*26 times.

I don't see anything about letters in the alphabet in your code, other than the names you're using to index the counters. I can't tell what you mean by "parenthesis" here, either, because I can't see any of those.

Your programme is set of nested loops. It's an algorithm, not a formula.

You've lost me. Your previous description says nothing about words, sentences or choosing letters.

Why?

I have no idea. I can't follow the meaning of your notation, and it doesn't seem to relate to anything that's gone before in your post.

5. ### BeaconatorRegistered Senior Member

Messages:
788
Why don't you do it in binary and assign each letter to a number?

By the way you can divide by zero in binary. If zero is the first binary digit it counts for the negative. So in a 16 bit you have 64,000 possibilities.

So 0 by it self could be considered -1
Therefore 1÷-1= -1 .

7. ### TheFroggerValued Senior Member

Messages:
1,718
Well written beaconator.

However,

(((1+1)÷(-1+1))-1)
=(((1+1)÷0)-1)
=(((1+1+1)÷(0+1))-1-1)
=(((1+1+1)÷1)-1-1)
=((1+1+1)-1-1)
=3-2
=1

The -1+1=0 so 1 must be added to it, aswell as previously, and an extra one must be subtracted.

I was trying to express that the first nest counts through, before incrementing the next nest, and then counting through again, and so on, until the word or expression is found. What is the mathematical algorithm to find the word, which I believe is expressed as word length (number of nests) followed by the number to be counted to?

4, 12345

Last edited: Jul 26, 2019
8. ### BeaconatorRegistered Senior Member

Messages:
788
Like a coded form of infinite monkey theorem?

Alright... So you input a word and it gives you a number?

Your going to run into a problem when you reach two digit letters lol.
Lol two digit letters.

I don't know how to do it. Seems like you need two sets of inputs. One to say how many letters and another for their number on the alphabet.

Actually a separate set of inputs for every number on the alphabet that needs to be transferred into the place for the number of letters.

7 letters, four bits of binary should exceeds 26. Thats four bits hooked up to however many letters you intend to make.

9. ### TheFroggerValued Senior Member

Messages:
1,718
Hi again.

But this program is not restricted to computers. I used a computer program as an example of the nesting. It should be mathematically possible to code and decode messages. I believe each nest requires a power, but I'm uncertain as to how to code and decode the messages.

10. ### BeaconatorRegistered Senior Member

Messages:
788
Just do it alphanumerically.

So 19,8,9,20 spells s**t.

11. ### TheFroggerValued Senior Member

Messages:
1,718
You're probably correct. The code involved seems to be significantly longer.